r82616 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82615‎ | r82616 | r82617 >
Date:18:08, 22 February 2011
Author:dale
Status:deferred
Tags:
Comment:
fixed metadata for webm files without audio
increased size of popUp dialog box
pageOutputHook for popUpThumbVideo
fix missing ; syntax error
Modified paths:
  • /trunk/extensions/TimedMediaHandler/TimedMediaHandler.hooks.php (modified) (history)
  • /trunk/extensions/TimedMediaHandler/TimedMediaHandler_body.php (modified) (history)
  • /trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscodeJob.php (modified) (history)
  • /trunk/extensions/TimedMediaHandler/handlers/WebMHandler/WebMHandler.php (modified) (history)
  • /trunk/extensions/TimedMediaHandler/resources/PopUpThumbVideo.js (modified) (history)

Diff [purge]

Index: trunk/extensions/TimedMediaHandler/handlers/WebMHandler/WebMHandler.php
@@ -77,9 +77,9 @@
7878 $metadata = self::unpackMetadata( $file->getMetadata() );
7979 if ( !$metadata || isset( $metadata['error'] ) ) {
8080 return false;
81 - }
 81+ }
8282 // id3 gives 'V_VP8' for what we call VP8
83 - if( $metadata['audio']['dataformat'] == 'vorbis' ){
 83+ if( isset( $metadata['audio'] ) && $metadata['audio']['dataformat'] == 'vorbis' ){
8484 $streamTypes[] = 'Vorbis';
8585 }
8686 if( $metadata['video']['dataformat'] == 'V_VP8' ){
Index: trunk/extensions/TimedMediaHandler/TimedMediaHandler_body.php
@@ -85,7 +85,7 @@
8686 }
8787 function parserTransformHook( $parser, $file ) {
8888 if ( isset( $parser->mOutput->hasTimedMediaTransform ) ) {
89 - return;
 89+ return ;
9090 }
9191 $parser->mOutput->hasTimedMediaTransform = true;
9292 $parser->mOutput->addOutputHook( 'TimedMediaHandler' );
Index: trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscodeJob.php
@@ -196,7 +196,7 @@
197197 // Check maxSize
198198 if (isset( $options['maxSize'] ) && intval( $options['maxSize'] ) > 0) {
199199 // Get size transform ( if maxSize is > file, file size is used:
200 - list( $width, $height ) = WebVideoTranscode::getMaxSizeTransform( $file, $options['maxSize'] )
 200+ list( $width, $height ) = WebVideoTranscode::getMaxSizeTransform( $file, $options['maxSize'] );
201201 $cmd.= ' -s ' . intval( $width ) . 'x' . intval( $height );
202202 } else if (
203203 (isset( $options['width'] ) && $options['width'] > 0 )
Index: trunk/extensions/TimedMediaHandler/TimedMediaHandler.hooks.php
@@ -12,7 +12,7 @@
1313 static function register(){
1414 global $wgParserOutputHooks, $wgHooks, $wgJobClasses, $wgJobExplitRequestTypes,
1515 $wgMediaHandlers, $wgResourceModules, $wgExcludeFromThumbnailPurge,
16 - $wgTimedMediaHandlerFileExtensions, $wgParserOutputHooks;
 16+ $wgTimedMediaHandlerFileExtensions, $wgParserOutputHooks, $wgOut;
1717
1818 // Setup media Handlers:
1919 $wgMediaHandlers['application/ogg'] = 'OggHandler';
@@ -42,6 +42,8 @@
4343 'remoteExtPath' => 'TimedMediaHandler',
4444 )
4545 );
 46+ // We should probalby move this to a parser function but not working right in
 47+ $wgHooks['BeforePageDisplay'][] = 'TimedMediaHandlerHooks::pageOutputHook';
4648
4749
4850 // Exclude transcoded assets from normal thumbnail purging
@@ -80,5 +82,11 @@
8183 define( "NS_TIMEDTEXT", $timedTextNS);
8284 define( "NS_TIMEDTEXT_TALK", $timedTextNS +1);
8385 }
 86+ static function pageOutputHook( &$out, &$sk ){
 87+ // FIXME we should only need to add this via parser output hook
 88+ $out->addModules( 'PopUpMediaTransform' );
 89+ $out->addModuleStyles( 'PopUpMediaTransform' );
 90+ return true;
 91+ }
8492
8593 }
\ No newline at end of file
Index: trunk/extensions/TimedMediaHandler/resources/PopUpThumbVideo.js
@@ -9,8 +9,8 @@
1010 $(this).find('a').click( function(){
1111 var $video = $( unescape( $(_parent).attr('data-videopayload') ) );
1212 mw.addDialog({
13 - 'width' : parseInt( $video.css('width') ) + 25,
14 - 'height' : parseInt( $video.css('height') ) + 45,
 13+ 'width' : parseInt( $video.css('width') ) + 35,
 14+ 'height' : parseInt( $video.css('height') ) + 55,
1515 'title' : $video.attr('data-mwtitle'),
1616 'content' : $video
1717 })

Status & tagging log