http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88292

Revision: 88292
Author:   dale
Date:     2011-05-17 10:30:40 +0000 (Tue, 17 May 2011)
Log Message:
-----------
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
    trunk/extensions/TimedMediaHandler/TimedMediaTransformOutput.php
    
trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscodeJob.php

Modified: trunk/extensions/TimedMediaHandler/TimedMediaHandler_body.php
===================================================================
--- trunk/extensions/TimedMediaHandler/TimedMediaHandler_body.php       
2011-05-17 10:08:56 UTC (rev 88291)
+++ trunk/extensions/TimedMediaHandler/TimedMediaHandler_body.php       
2011-05-17 10:30:40 UTC (rev 88292)
@@ -183,12 +183,14 @@
                $srcWidth = $file->getWidth();
                $srcHeight = $file->getHeight();
                
-               $params['width'] = isset( $params['width'] )? $params['width'] 
: $srcWidth;
-               // don't upscale: 
-               if( $params['width'] > $srcWidth ){
-                       $params['width'] = $srcWidth;
+               // Audio should not be transformed by size, give it a default 
width and height
+               if( $this->isAudio( $file ) ){
+                       $srcWidth = 220;
+                       $srcHeight = 23;
                }
                
+               $params['width'] = isset( $params['width'] ) ? $params['width'] 
: $srcWidth;
+               
                $options = array(
                        'file' => $file,
                        'length' => $this->getLength( $file ),

Modified: trunk/extensions/TimedMediaHandler/TimedMediaTransformOutput.php
===================================================================
--- trunk/extensions/TimedMediaHandler/TimedMediaTransformOutput.php    
2011-05-17 10:08:56 UTC (rev 88291)
+++ trunk/extensions/TimedMediaHandler/TimedMediaTransformOutput.php    
2011-05-17 10:30:40 UTC (rev 88292)
@@ -56,15 +56,6 @@
                        return 23;
                }
        }
-       function getPlayerWidth(){
-               // Check if "video" tag output:
-               if ( $this->isVideo ) {
-                       return intval( $this->width );
-               } else {
-                       // Give sound files a width of 220px 
-                       return 220;
-               }
-       }
        
        function getTagName(){          
                return ( $this->isVideo ) ? 'video' : 'audio';
@@ -101,8 +92,8 @@
                return Xml::tags( 'div' , array(
                                'id' => "ogg_thumbplayer_" . 
TimedMediaTransformOutput::$serial++,
                                'class' => 'PopUpMediaTransform',
-                               'style' => "width:" . intval( 
$this->getPlayerWidth() ) . "px;height:" . 
-                                                       intval( 
$this->getPlayerHeight() ) . "px",
+                               'style' => "width:" . intval( $this->width ) . 
"px;height:" . 
+                                                       intval( $this->height ) 
. "px",
                                'data-videopayload' => 
$this->getXmlMediaTagOutput( $this->getPopupPlayerSize() ),
                                ),
                        Xml::tags( 'img', array(
@@ -199,9 +190,9 @@
                $length = floatval( $this->length  );
                $offset = floatval( $this->offset );
                
-               $width = $sizeOverride ? $sizeOverride[0] : 
$this->getPlayerWidth();
-               $height = $sizeOverride ? $sizeOverride[1]: 
$this->getPlayerHeight();
-               
+               $width = $sizeOverride ? $sizeOverride[0] : $this->width;
+               $height = $sizeOverride ? $sizeOverride[1]: $this->height;
+       
                // The poster url:
                $posterUrl = $this->getUrl();
                

Modified: 
trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscodeJob.php
===================================================================
--- 
trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscodeJob.php   
    2011-05-17 10:08:56 UTC (rev 88291)
+++ 
trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscodeJob.php   
    2011-05-17 10:30:40 UTC (rev 88292)
@@ -93,7 +93,6 @@
                }
                
                // If status is oky move the file to its final destination. ( 
timedMediaHandler will look for it there ) 
-               // @@todo we should use some status class of some sort  
                if( $status === true ){
                        $finalDerivativeFilePath = 
WebVideoTranscode::getDerivativeFilePath( $file, $transcodeKey);
                        wfSuppressWarnings();


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to