Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[#940715] Media ready callbacks were called in the incorrect order. #359

Open
wants to merge 1 commit into from

2 participants

ScottDowne Matthew Schranz
ScottDowne
Owner

No description provided.

Matthew Schranz mjschranz commented on the diff
wrappers/youtube/popcorn.HTMLYouTubeVideoElement.js
@@ -200,10 +200,10 @@
self.dispatchEvent( "canplay" );
mediaReady = true;
- var i = mediaReadyCallbacks.length;
- while( i-- ) {
+ var i = 0;
Matthew Schranz Owner

We don't need i anymore. Just used mediaReadyCallbacks[ 0 ](); below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 wrappers/youtube/popcorn.HTMLYouTubeVideoElement.js
6 wrappers/youtube/popcorn.HTMLYouTubeVideoElement.js
View
@@ -200,10 +200,10 @@
self.dispatchEvent( "canplay" );
mediaReady = true;
- var i = mediaReadyCallbacks.length;
- while( i-- ) {
+ var i = 0;
Matthew Schranz Owner

We don't need i anymore. Just used mediaReadyCallbacks[ 0 ](); below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ while( mediaReadyCallbacks.length ) {
mediaReadyCallbacks[ i ]();
- delete mediaReadyCallbacks[ i ];
+ mediaReadyCallbacks.shift();
}
// We can't easily determine canplaythrough, but will send anyway.
Something went wrong with that request. Please try again.