Skip to content
This repository has been archived by the owner on Jun 29, 2018. It is now read-only.

Vimeo onPlayerReady broken: no event fires on load #463

Open
goingonit opened this issue Sep 28, 2015 · 2 comments
Open

Vimeo onPlayerReady broken: no event fires on load #463

goingonit opened this issue Sep 28, 2015 · 2 comments

Comments

@goingonit
Copy link

Browser info: Chrome on MacOS [Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36]

The HTMLVimeoVideoElement tries to do a play/pause cycle on load but on my machine this only pauses. Issues are fixed by eliminating the play/pause cycle but then presumably whatever bug this was introduced for would come back?

@goingonit goingonit changed the title Vimeo load-even support broken Vimeo onPlayerReady broken: no event fires on load Sep 28, 2015
@liveaspankaj
Copy link

I am facing an odd issue, but may be related.

on first clicking Play, the Play event is not fired, infact even onPlayerReady event is also not fired. Then when I click on Pause and again Play. Then Play event is fired.

It started few days back, so it could be related and could be due to some change in Vimeo API?

Where did you make the change you are talking about, I could not find the play/pause cycle on load?

@liveaspankaj
Copy link

This is a temporary fix I did to fix the issue:
Not sure if its best way to do it?

--- a/popcorn-complete.js
+++ b/popcorn-complete.js
@@ -5292,7 +5292,8 @@
       playerReadyCallbacks = [],
       timeUpdateInterval,
       currentTimeInterval,
-      lastCurrentTime = 0;
+      lastCurrentTime = 0,
+       play = false;

     // Namespace all events we'll produce
     self._eventNamespace = Popcorn.guid( "HTMLVimeoVideoElement::" );
@@ -5516,6 +5517,13 @@
           if( duration > 0 && !playerReady ) {
             playerReady = true;
             player.pause();
+
+                 player.setVolume( 1 );
+                 // Switch message pump to use run-time message callback vs. startup
+                 window.removeEventListener( "message", startupMessage, false );
+                 window.addEventListener( "message", onStateChange, false );
+                 onPlayerReady();
+
           }
           break;
         case "pause":
@@ -5564,6 +5572,10 @@
           updateDuration( parseFloat( data.data.duration ) );
           break;
         case "playProgress":
+         if(!play && data.data.seconds > 0) {
+               play = true;
+               onPlay();
+         }
           onCurrentTime( parseFloat( data.data.seconds ) );
           break;
         case "play":

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants