From: David Seifried Date: Mon, 13 Jun 2011 15:32:08 +0000 (-0400) Subject: Added flag that is used in butter to track whether the state of the video is paused... X-Git-Tag: v0.7^2~38^2~2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=feeabfc0bae1f4e5c0f594cd6765c1df41023d32;p=popcorn-js.git Added flag that is used in butter to track whether the state of the video is paused or not --- diff --git a/players/youtube/popcorn.youtube.js b/players/youtube/popcorn.youtube.js index 4ef1185..82394b5 100644 --- a/players/youtube/popcorn.youtube.js +++ b/players/youtube/popcorn.youtube.js @@ -147,6 +147,7 @@ var onYouTubePlayerReady; // Video hadn't loaded yet when ctor was called vid.video = document.getElementById( playerId ); vid.duration = vid.video.getDuration(); + // Issue load event vid.dispatchEvent( 'load' ); @@ -174,6 +175,7 @@ var onYouTubePlayerReady; this.loadStarted = false; this.loadedData = false; this.fullyLoaded = false; + this.paused = true; // If supplied as number, append 'px' on end // If suppliied as '###' or '###px', convert to number and append 'px' back on end @@ -361,7 +363,10 @@ var onYouTubePlayerReady; // Prevent Youtube's behaviour to start playing video after seeking. if ( !playing ) { + this.video.paused = true; this.video.pauseVideo(); + } else { + this.video.paused = false; } // Data need to be loaded again.