r90623 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90622‎ | r90623 | r90624 >
Date:22:48, 22 June 2011
Author:dale
Status:deferred
Tags:
Comment:
fixed IE size attributes for player ( can't read style attribute for created tags like <video> <audio>
Modified paths:
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js (modified) (history)
  • /trunk/extensions/TimedMediaHandler/TimedMediaTransformOutput.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TimedMediaHandler/TimedMediaTransformOutput.php
@@ -204,9 +204,12 @@
205205 $posterUrl = $apiUrl;
206206 }
207207 }
208 - $mediaAttr = array(
 208+ $mediaAttr = array(
209209 'id' => self::PLAYER_ID_PREFIX . TimedMediaTransformOutput::$serial++,
210210 'style' => "width:{$width}px;height:{$height}px",
 211+ // also set direct width height attributes for IE html elements to retain properties:
 212+ 'width' => $width,
 213+ 'height' => $height,
211214 // Get the correct size:
212215 'poster' => $posterUrl,
213216 'alt' => $this->file->getTitle()->getText(),
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
@@ -601,6 +601,7 @@
602602
603603 // Set the player size attributes based loaded video element:
604604 this.loadPlayerSize( element );
 605+
605606 // Set the plugin id
606607 this.pid = 'pid_' + this.id;
607608
@@ -658,8 +659,9 @@
659660 * element Source element to grab size from
660661 */
661662 loadPlayerSize: function( element ) {
662 - this.height = $(element).css( 'height' );
663 - this.width = $(element).css( 'width' );
 663+ // check for direct element attribute:
 664+ this.height = element.height ? element.height : $(element).css( 'height' );
 665+ this.width = element.width ? element.width : $(element).css( 'width' );
664666 // Special check for chrome 100% with re-mapping to 32px
665667 // ( hopefully no one embeds video at 32x32 )
666668 if( this.height == '32px' || this.height =='32px' ){

Status & tagging log