From 215c746c63dd22ad313a8be17729ff5d494ac197 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 20 Oct 2017 10:14:37 -0400 Subject: build --- frontend/static/js/sj_compiled.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/static/js/sj_compiled.js b/frontend/static/js/sj_compiled.js index 7105f35..d2c915c 100755 --- a/frontend/static/js/sj_compiled.js +++ b/frontend/static/js/sj_compiled.js @@ -2021,8 +2021,9 @@ var Youtube = $("li#queue_"+Youtube.video.idx+" span.title").html("This video cannot be embedded") setTimeout(Youtube.finish, 1000) }, - onStateChange: function (state) + onStateChange: function (e) { + var state = e.data Youtube.state = state if (state === -1) { @@ -2127,6 +2128,7 @@ var Youtube = Youtube.pending = false }, build: function(){ + if (Youtube.player) return Youtube.player = new YT.Player("ytscreen", { // videoId: Youtube.video && Youtube.video.name, width: Player.width, @@ -2134,7 +2136,7 @@ var Youtube = events: { onReady: Youtube.isReady, onError: Youtube.error, - onStateChange: Youtube.statechange, + onStateChange: Youtube.onStateChange, }, playerVars: { autohide: 1, @@ -2155,11 +2157,13 @@ var Youtube = }, init: function () { d.warn("YOUTUBE INIT") + if (window.YT) + Youtube.build() }, }; window.onYouTubePlayerReady = function (playerId) { - d.warn("YOUTUBE READY") + console.log("YOUTUBE READY") Youtube.build() } Player.register(Youtube) -- cgit v1.2.3-70-g09d2