r82624 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82623‎ | r82624 | r82625 >
Date:19:09, 22 February 2011
Author:dale
Status:deferred
Tags:
Comment:
some fixes to not include attributes that are not present
fix for framerate
fix for bandwidth typo
Modified paths:
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js (modified) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/PlayerSkinKskin.css (modified) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js (modified) (history)
  • /trunk/extensions/TimedMediaHandler/TimedMediaHandler.i18n.php (modified) (history)
  • /trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php (modified) (history)
  • /trunk/extensions/TimedMediaHandler/handlers/WebMHandler/WebMHandler.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TimedMediaHandler/handlers/WebMHandler/WebMHandler.php
@@ -104,10 +104,12 @@
105105 $metadata = $this->unpackMetadata( $file->getMetadata() );
106106 if ( !$metadata || isset( $metadata['error'] ) ) {
107107 return 0;
108 - } else {
109 - print_r($metadata);
110 - die();
111 - return $metadata['framerate'];
 108+ } else {
 109+ // return the frame rate of the first found video stream:
 110+ if( isset( $metadata['video']['frame_rate'] ) ){
 111+ return $metadata['video']['frame_rate'];
 112+ }
 113+ return false;
112114 }
113115 }
114116
Index: trunk/extensions/TimedMediaHandler/TimedMediaHandler.i18n.php
@@ -41,7 +41,7 @@
4242
4343 // derivative timedmedia-derivative-desc-220_200kbs.ogv
4444 'timedmedia-derivative-220_200kbs.ogv' => 'Ogg 200P',
45 - 'timedmedia-derivative-desc-220_200kbs.ogv' => 'Low bandwith Ogg video (200P)',
 45+ 'timedmedia-derivative-desc-220_200kbs.ogv' => 'Low bandwidth Ogg video (200P)',
4646
4747 'timedmedia-derivative-360_400kbs.ogv' => 'Ogg 360P',
4848 'timedmedia-derivative-desc-360_400kbs.ogv' => 'Web streamable Ogg video (360P)',
Index: trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php
@@ -155,7 +155,7 @@
156156 $sources = array();
157157
158158 // Add the original file:
159 - $sources[] = array(
 159+ $source = array(
160160 'src' => $file->getUrl(),
161161 'title' => wfMsg('timedmedia-source-file-desc',
162162 $file->getHandler()->getMetadataType(),
@@ -164,15 +164,25 @@
165165 $wgLang->formatBitrate( $file->getHandler()->getBitrate( $file ) )
166166 ),
167167 'data-shorttitle' => wfMsg('timedmedia-source-file', wfMsg( 'timedmedia-' . $file->getHandler()->getMetadataType() ) ),
168 - 'data-size' => $file->getWidth() . 'x' . $file->getHeight()
 168+
 169+ 'data-width' => $file->getWidth(),
 170+ 'data-height' => $file->getHeight(),
169171 // TODO add some title and data about the file
170172 );
171 -
 173+
172174 // Just directly return audio sources ( for now no transcoding for audio )
173175 if( $file->getHandler()->isAudio( $file ) ){
174176 return $sources;
175177 }
 178+ // For video include bitrate and framerate:
 179+ $bitrate = $file->getHandler()->getBitrate( $file );
 180+ if( $bitrate ) $source['data-bandwidth'] = $bitrate;
176181
 182+ $framerate = $file->getHandler()->getFramerate( $file );
 183+ if( $framerate ) $source['data-framerate'] = $framerate;
 184+
 185+ // Add the source to the sources array
 186+ $sources[] = $source;
177187 // Setup local variables
178188 $fileName = $file->getName();
179189
@@ -236,8 +246,8 @@
237247
238248 // if the source size is < $transcodeKey assume source size:
239249 if( is_file( $derivativeFile ) ){
240 - // Estimate bandwith:
241 - $bandwith = intval( filesize( $derivativeFile ) / $file->getLength() ) * 8;
 250+ // Estimate bandwidth:
 251+ $bandwidth = intval( filesize( $derivativeFile ) / $file->getLength() ) * 8;
242252
243253 list( $width, $height ) = WebVideoTranscode::getMaxSizeTransform(
244254 $file,
@@ -256,7 +266,7 @@
257267 // eventually we will define a manifest xml entry point.
258268 'data-width' => $width,
259269 'data-height' => $height,
260 - 'data-bandwith' => $bandwith,
 270+ 'data-bandwidth' => $bandwidth,
261271 'data-framerate' => $framerate,
262272 );
263273 } else {
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
@@ -37,7 +37,7 @@
3838 'data-shorttitle', // short title for stream ( usefull for stream switching control bar item)
3939 'data-width', // the width of the stream
4040 'data-height', // the height of the stream
41 - 'data-bandwith', // the overall bitrate of the stream
 41+ 'data-bandwidth', // the overall bitrate of the stream
4242 'data-framerate', // the framereate of the stream
4343
4444 // Media start time
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/PlayerSkinKskin.css
@@ -120,6 +120,7 @@
121121 overflow: hidden;
122122 width: 48px;
123123 float: right;
 124+ text-align:center;
124125 }
125126
126127 .k-player .source-switch{
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js
@@ -1941,7 +1941,7 @@
19421942 .css({
19431943 "position" : 'absolute',
19441944 "left" : '33px',
1945 - "right" : ( ( embedPlayer.getPlayerWidth() - ctrlObj.available_width ) - 30) + 'px'
 1945+ "right" : ( ( embedPlayer.getPlayerWidth() - ctrlObj.available_width ) - 20) + 'px'
19461946 })
19471947 // Playhead binding
19481948 .slider( sliderConfig );

Status & tagging log