]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Added flag that is used in butter to track whether the state of the video is paused...
authorDavid Seifried <david.c.seifried@gmail.com>
Mon, 13 Jun 2011 15:32:08 +0000 (11:32 -0400)
committerDavid Seifried <david.c.seifried@gmail.com>
Mon, 13 Jun 2011 15:32:08 +0000 (11:32 -0400)
players/youtube/popcorn.youtube.js

index 4ef1185a0016a46caab0b77d77bbdc44a6cce941..82394b5f8f491e3d1dd15d7b8f34d68258893bf3 100644 (file)
@@ -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.