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

Commit

Permalink
Merge pull request #51 from dseif/t1056
Browse files Browse the repository at this point in the history
[#1056] Fixed issue where vimeo was firing loadeddata prematurely
  • Loading branch information
ScottDowne committed May 7, 2012
2 parents 72b4c54 + 915ab77 commit 6ed2b2a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions players/vimeo/popcorn.vimeo.js
Expand Up @@ -49,8 +49,8 @@
vimeoObject = document.getElementById( vimeoContainer.id );

vimeo_player_loaded.seek[ vimeoContainer.id ] = function( time ) {
if( time !== currentTime ) {
currentTime = time;
if( time.seconds !== currentTime ) {
currentTime = time.seconds;
media.dispatchEvent( "seeked" );
media.dispatchEvent( "timeupdate" );
}
Expand Down Expand Up @@ -206,11 +206,11 @@
}
});

media.dispatchEvent( "loadedmetadata" );
media.dispatchEvent( "loadeddata" );

media.duration = vimeoObject.api_getDuration();
media.dispatchEvent( "durationchange" );
media.dispatchEvent( "loadedmetadata" );
media.dispatchEvent( "loadeddata" );
volumeUpdate();
media.readyState = 4;
media.dispatchEvent( "canplaythrough" );
Expand Down Expand Up @@ -249,4 +249,4 @@
}
}
});
})();
})();
5 changes: 4 additions & 1 deletion players/vimeo/popcorn.vimeo.unit.js
Expand Up @@ -32,7 +32,7 @@ asyncTest( "Options Check", function() {
asyncTest( "Update Timer", function() {

var p2 = Popcorn.vimeo( "#player_1", "http://player.vimeo.com/video/11336811" ),
expects = 16,
expects = 17,
count = 0,
execCount = 0,
// These make sure events are only fired once
Expand Down Expand Up @@ -65,6 +65,9 @@ asyncTest( "Update Timer", function() {
p2.unlisten( "loadedmetadata" );
ok( true, "'loadedmetadata' fired" );
plus();
// make sure that we always have a duration at this point
ok( this.duration() > 0, "Videos duration is greather than 0" );
plus();
});

p2.listen( "durationchange", function() {
Expand Down

0 comments on commit 6ed2b2a

Please sign in to comment.