Skip to content
Permalink
Browse files

Multimedia: Applied #4140 to v4.0

  • Loading branch information...
LaurentGoderre committed Dec 20, 2013
1 parent 5652bd0 commit 80ca01b824289c2afa52d754a80a5a543866caa4
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/plugins/multimedia/multimedia.js
@@ -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 " +
@@ -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" );

0 comments on commit 80ca01b

Please sign in to comment.
You can’t perform that action at this time.