From feeabfc0bae1f4e5c0f594cd6765c1df41023d32 Mon Sep 17 00:00:00 2001 From: David Seifried Date: Mon, 13 Jun 2011 11:32:08 -0400 Subject: [PATCH] Added flag that is used in butter to track whether the state of the video is paused or not --- players/youtube/popcorn.youtube.js | 5 +++++ 1 file changed, 5 insertions(+) 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. -- 2.43.0