diff --git a/src/plugins/multimedia/assets/mediacontrols.html b/src/plugins/multimedia/assets/mediacontrols.html
index e8022147b5f..7ad108c236d 100644
--- a/src/plugins/multimedia/assets/mediacontrols.html
+++ b/src/plugins/multimedia/assets/mediacontrols.html
@@ -5,7 +5,7 @@
diff --git a/src/plugins/multimedia/multimedia.js b/src/plugins/multimedia/multimedia.js
index 9afe2e979c6..db8f92e3402 100644
--- a/src/plugins/multimedia/multimedia.js
+++ b/src/plugins/multimedia/multimedia.js
@@ -23,8 +23,10 @@ var pluginName = "wb-mltmd",
initializedEvent = "inited" + selector,
fallbackEvent = "fallback" + selector,
youtubeEvent = "youtube" + selector,
+ resizeEvent = "resize" + selector,
captionClass = "cc_on",
$document = wb.doc,
+ $window = wb.win,
/**
* Init runs once per plugin element on the page. There may be multiple elements.
@@ -458,6 +460,10 @@ var pluginName = "wb-mltmd",
target.timeline = clearInterval( target.timeline );
break;
}
+ },
+
+ onResize = function() {
+ $( selector + " object, " + selector + " iframe" ).trigger( resizeEvent );
};
$document.on( "timerpoke.wb " + initEvent, selector, init );
@@ -532,7 +538,8 @@ $document.on( fallbackEvent, selector, function() {
$this = ref[ 0 ],
data = ref[ 1 ],
$media = data.media,
- source = $media.find( "source" + ( data.type === "video" ) ? "[type='video/mp4']" : "[type='audio/mp3']" ).attr( "src" ),
+ type = data.type,
+ source = $media.find( "source" + data.type === "video" ? "[type='video/mp4']" : "[type='audio/mp3']" ).attr( "src" ),
poster = $media.attr( "poster" ),
flashvars = "id=" + data.mId,
width = data.width,
@@ -540,7 +547,7 @@ $document.on( fallbackEvent, selector, function() {
playerresource = wb.getPath( "/assets" ) + "/multimedia.swf?" + flashvars;
flashvars += "&media=" + encodeURI( wb.getUrlParts( source ).absolute );
- if ( data.type === "video" ) {
+ if ( type === "video" ) {
data.poster = "
";
@@ -549,7 +556,7 @@ $document.on( fallbackEvent, selector, function() {
}
$this.find( "video, audio" ).replaceWith( "
" );
$this.data( "properties", data );
-
- $this.trigger( renderUIEvent );
+ $window.on( "resize", onResize );
+ $this.trigger( renderUIEvent, type );
});
/*
@@ -587,7 +594,10 @@ $document.on( youtubeEvent, selector, function() {
cc_load_policy: 1
},
events: {
- onReady: youTubeEvents,
+ onReady: function( event ) {
+ onResize();
+ youTubeEvents( event );
+ },
onStateChange: youTubeEvents,
onApiChange: function( event ) {
event.target.setOption( "cc", "track", {} );
@@ -596,6 +606,7 @@ $document.on( youtubeEvent, selector, function() {
});
$this.addClass( "youtube" );
+
$this.find( "iframe" ).attr( "tabindex", -1 );
data.poster = "