r88292 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88291‎ | r88292 | r88293 >
Date:10:30, 17 May 2011
Author:dale
Status:deferred
Tags:
Comment:
fixed audio layout issues with thumb parm ( bug 28974 )
removed blocking upscaling embed transforms ( ie you should be able to embed a video larger than its source files )
Modified paths:
  • /trunk/extensions/TimedMediaHandler/TimedMediaHandler_body.php (modified) (history)
  • /trunk/extensions/TimedMediaHandler/TimedMediaTransformOutput.php (modified) (history)
  • /trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscodeJob.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TimedMediaHandler/TimedMediaHandler_body.php
@@ -183,12 +183,14 @@
184184 $srcWidth = $file->getWidth();
185185 $srcHeight = $file->getHeight();
186186
187 - $params['width'] = isset( $params['width'] )? $params['width'] : $srcWidth;
188 - // don't upscale:
189 - if( $params['width'] > $srcWidth ){
190 - $params['width'] = $srcWidth;
 187+ // Audio should not be transformed by size, give it a default width and height
 188+ if( $this->isAudio( $file ) ){
 189+ $srcWidth = 220;
 190+ $srcHeight = 23;
191191 }
192192
 193+ $params['width'] = isset( $params['width'] ) ? $params['width'] : $srcWidth;
 194+
193195 $options = array(
194196 'file' => $file,
195197 'length' => $this->getLength( $file ),
Index: trunk/extensions/TimedMediaHandler/TimedMediaTransformOutput.php
@@ -56,15 +56,6 @@
5757 return 23;
5858 }
5959 }
60 - function getPlayerWidth(){
61 - // Check if "video" tag output:
62 - if ( $this->isVideo ) {
63 - return intval( $this->width );
64 - } else {
65 - // Give sound files a width of 220px
66 - return 220;
67 - }
68 - }
6960
7061 function getTagName(){
7162 return ( $this->isVideo ) ? 'video' : 'audio';
@@ -101,8 +92,8 @@
10293 return Xml::tags( 'div' , array(
10394 'id' => "ogg_thumbplayer_" . TimedMediaTransformOutput::$serial++,
10495 'class' => 'PopUpMediaTransform',
105 - 'style' => "width:" . intval( $this->getPlayerWidth() ) . "px;height:" .
106 - intval( $this->getPlayerHeight() ) . "px",
 96+ 'style' => "width:" . intval( $this->width ) . "px;height:" .
 97+ intval( $this->height ) . "px",
10798 'data-videopayload' => $this->getXmlMediaTagOutput( $this->getPopupPlayerSize() ),
10899 ),
109100 Xml::tags( 'img', array(
@@ -199,9 +190,9 @@
200191 $length = floatval( $this->length );
201192 $offset = floatval( $this->offset );
202193
203 - $width = $sizeOverride ? $sizeOverride[0] : $this->getPlayerWidth();
204 - $height = $sizeOverride ? $sizeOverride[1]: $this->getPlayerHeight();
205 -
 194+ $width = $sizeOverride ? $sizeOverride[0] : $this->width;
 195+ $height = $sizeOverride ? $sizeOverride[1]: $this->height;
 196+
206197 // The poster url:
207198 $posterUrl = $this->getUrl();
208199
Index: trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscodeJob.php
@@ -93,7 +93,6 @@
9494 }
9595
9696 // If status is oky move the file to its final destination. ( timedMediaHandler will look for it there )
97 - // @@todo we should use some status class of some sort
9897 if( $status === true ){
9998 $finalDerivativeFilePath = WebVideoTranscode::getDerivativeFilePath( $file, $transcodeKey);
10099 wfSuppressWarnings();

Status & tagging log