Skip to content

Commit

Permalink
Multimedia: Applied #4140 to v4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentGoderre committed Dec 20, 2013
1 parent 5652bd0 commit 80ca01b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/plugins/multimedia/multimedia.js
Expand Up @@ -680,7 +680,7 @@ $document.on( renderUIEvent, selector, function( event, type ) {
}

$player = $( "#" + data.mId );
data.player = $player.is( "object" ) ? $player.children( ":first-child" ) : $player.load();
data.player = $player.is( "object" ) ? $player.children( ":first-child" ) : $player;

// Create an adapter for the event management
data.player.on( "durationchange play pause ended volumechange timeupdate " +
Expand All @@ -693,6 +693,11 @@ $document.on( renderUIEvent, selector, function( event, type ) {
this.player = ( data.ytPlayer ) ? youTubeApi : playerApi;
$this.data( "properties", data );

// Trigger the duration change for cases where the event was called before the event binding
if ( !isNaN( this.player( "getDuration" ) ) ) {
data.player.trigger( "durationchange" );
}

// Load the progress polyfill if needed
$this.find( "progress" ).trigger( "wb-init.wb-progress" );

Expand Down

0 comments on commit 80ca01b

Please sign in to comment.