Index: trunk/extensions/TimedMediaHandler/handlers/WebMHandler/WebMHandler.php |
— | — | @@ -104,10 +104,12 @@ |
105 | 105 | $metadata = $this->unpackMetadata( $file->getMetadata() ); |
106 | 106 | if ( !$metadata || isset( $metadata['error'] ) ) { |
107 | 107 | 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; |
112 | 114 | } |
113 | 115 | } |
114 | 116 | |
Index: trunk/extensions/TimedMediaHandler/TimedMediaHandler.i18n.php |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | |
43 | 43 | // derivative timedmedia-derivative-desc-220_200kbs.ogv |
44 | 44 | '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)', |
46 | 46 | |
47 | 47 | 'timedmedia-derivative-360_400kbs.ogv' => 'Ogg 360P', |
48 | 48 | 'timedmedia-derivative-desc-360_400kbs.ogv' => 'Web streamable Ogg video (360P)', |
Index: trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php |
— | — | @@ -155,7 +155,7 @@ |
156 | 156 | $sources = array(); |
157 | 157 | |
158 | 158 | // Add the original file: |
159 | | - $sources[] = array( |
| 159 | + $source = array( |
160 | 160 | 'src' => $file->getUrl(), |
161 | 161 | 'title' => wfMsg('timedmedia-source-file-desc', |
162 | 162 | $file->getHandler()->getMetadataType(), |
— | — | @@ -164,15 +164,25 @@ |
165 | 165 | $wgLang->formatBitrate( $file->getHandler()->getBitrate( $file ) ) |
166 | 166 | ), |
167 | 167 | '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(), |
169 | 171 | // TODO add some title and data about the file |
170 | 172 | ); |
171 | | - |
| 173 | + |
172 | 174 | // Just directly return audio sources ( for now no transcoding for audio ) |
173 | 175 | if( $file->getHandler()->isAudio( $file ) ){ |
174 | 176 | return $sources; |
175 | 177 | } |
| 178 | + // For video include bitrate and framerate: |
| 179 | + $bitrate = $file->getHandler()->getBitrate( $file ); |
| 180 | + if( $bitrate ) $source['data-bandwidth'] = $bitrate; |
176 | 181 | |
| 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; |
177 | 187 | // Setup local variables |
178 | 188 | $fileName = $file->getName(); |
179 | 189 | |
— | — | @@ -236,8 +246,8 @@ |
237 | 247 | |
238 | 248 | // if the source size is < $transcodeKey assume source size: |
239 | 249 | 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; |
242 | 252 | |
243 | 253 | list( $width, $height ) = WebVideoTranscode::getMaxSizeTransform( |
244 | 254 | $file, |
— | — | @@ -256,7 +266,7 @@ |
257 | 267 | // eventually we will define a manifest xml entry point. |
258 | 268 | 'data-width' => $width, |
259 | 269 | 'data-height' => $height, |
260 | | - 'data-bandwith' => $bandwith, |
| 270 | + 'data-bandwidth' => $bandwidth, |
261 | 271 | 'data-framerate' => $framerate, |
262 | 272 | ); |
263 | 273 | } else { |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js |
— | — | @@ -37,7 +37,7 @@ |
38 | 38 | 'data-shorttitle', // short title for stream ( usefull for stream switching control bar item) |
39 | 39 | 'data-width', // the width of the stream |
40 | 40 | '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 |
42 | 42 | 'data-framerate', // the framereate of the stream |
43 | 43 | |
44 | 44 | // Media start time |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/PlayerSkinKskin.css |
— | — | @@ -120,6 +120,7 @@ |
121 | 121 | overflow: hidden; |
122 | 122 | width: 48px; |
123 | 123 | float: right; |
| 124 | + text-align:center; |
124 | 125 | } |
125 | 126 | |
126 | 127 | .k-player .source-switch{ |
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js |
— | — | @@ -1941,7 +1941,7 @@ |
1942 | 1942 | .css({ |
1943 | 1943 | "position" : 'absolute', |
1944 | 1944 | "left" : '33px', |
1945 | | - "right" : ( ( embedPlayer.getPlayerWidth() - ctrlObj.available_width ) - 30) + 'px' |
| 1945 | + "right" : ( ( embedPlayer.getPlayerWidth() - ctrlObj.available_width ) - 20) + 'px' |
1946 | 1946 | }) |
1947 | 1947 | // Playhead binding |
1948 | 1948 | .slider( sliderConfig ); |