r52869 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52868‎ | r52869 | r52870 >
Date:22:39, 7 July 2009
Author:dale
Status:deferred
Tags:
Comment:
IE fixes
firefogg updates for non video files
Modified paths:
  • /branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/htmlEmbed.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/nativeEmbed.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvPlayList.js (modified) (history)

Diff [purge]

Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js
@@ -320,14 +320,18 @@
321321 js_log(" should update: " + _this.target_input_file_name + ' to: ' + _this.fogg.sourceFilename );
322322 $j(_this.target_input_file_name).val(_this.fogg.sourceFilename).show();
323323
324 - if(_this.new_source_cb){
325 - var oggExt = (_this.isSourceAudio())?'oga':'ogg';
326 - oggExt = (_this.isSourceVideo())?'ogv':oggExt;
327 - oggExt = (_this.isUnknown())?'ogg':oggExt;
328 - oggName = _this.fogg.sourceFilename.substr(0,
329 - _this.fogg.sourceFilename.lastIndexOf('.'));
330 -
331 - _this.new_source_cb( _this.fogg.sourceFilename , oggName +'.'+ oggExt);
 324+ if(_this.new_source_cb){
 325+ if(_this.encoder_settings['passthrough']){
 326+ var fName = _this.fogg.sourceFilename
 327+ }else{
 328+ var oggExt = (_this.isSourceAudio())?'oga':'ogg';
 329+ oggExt = (_this.isSourceVideo())?'ogv':oggExt;
 330+ oggExt = (_this.isUnknown())?'ogg':oggExt;
 331+ oggName = _this.fogg.sourceFilename.substr(0,
 332+ _this.fogg.sourceFilename.lastIndexOf('.'));
 333+ var fName = oggName +'.'+ oggExt
 334+ }
 335+ _this.new_source_cb( _this.fogg.sourceFilename , fName);
332336 }
333337 }
334338 }else{
@@ -354,8 +358,8 @@
355359 ext = sf.substring( sf.lastIndexOf('.')+1 ).toLowerCase();
356360 }
357361
358 - //set to passthrough by default (images, arbitrary files that we want to send with http chunks)
359 - this.encoder_settings['passthrough'] = false;
 362+ //set to passthrough to true by default (images, arbitrary files that we want to send with http chunks)
 363+ this.encoder_settings['passthrough'] = true;
360364
361365 //see if we have video or audio:
362366 if( _this.isSourceAudio() || _this.isSourceVideo() ){
@@ -420,7 +424,7 @@
421425 if( sf.lastIndexOf('.') != -1){
422426 ext = sf.substring( sf.lastIndexOf('.') ).toLowerCase();
423427 }
424 - if(!_this.passthrough && $j.inArray(ext.substr(1), _this.ogg_extensions) == -1 ){
 428+ if(!_this.encoder_settings['passthrough'] && $j.inArray(ext.substr(1), _this.ogg_extensions) == -1 ){
425429 var extreg = new RegExp(ext + '$', 'i');
426430 _this.formData['wpDestFile'] = sf.replace(extreg, '.ogg');
427431 }
Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js
@@ -60,8 +60,7 @@
6161 'cFileNS':'File', //what is the cannonical namespace for images
6262 //@@todo (should get that from the api or inpage vars)
6363
64 - 'enable_upload_tab':true, // if we want to enable an uploads tab:
65 -
 64+ 'enable_upload_tab':true // if we want to enable an uploads tab:
6665 }
6766 if(typeof wgServer == 'undefined')
6867 wgServer = '';
Index: branches/new-upload/phase3/js2/mwEmbed/libSequencer/mvPlayList.js
@@ -189,6 +189,10 @@
190190 }
191191 }
192192 },
 193+ doNativeWarningCheck:function(){
 194+ var clip = this.default_track.clips[0];
 195+ return clip.embed.doNativeWarningCheck();
 196+ },
193197 doWhenParseDone:function(){
194198 js_log('f:doWhenParseDone');
195199 //do additional init for clips:
@@ -1212,8 +1216,7 @@
12131217 //string -> boolean:
12141218 if(this[method]=="false")this[method]=false;
12151219 if(this[method]=="true")this[method]=true;
1216 - }
1217 - debugger;
 1220+ }
12181221 },
12191222 onClipDone:function(){
12201223 js_log('pl onClipDone (should go to next)');
Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/htmlEmbed.js
@@ -70,7 +70,7 @@
7171 library:"html"
7272 },
7373 selected_source:{
74 - URLTimeEncoding:false,
 74+ URLTimeEncoding:false
7575 },
7676 timedTextSources:function(){
7777 return false;
Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js
@@ -40,7 +40,7 @@
4141 "mv_ogg-player-omtkplayer" : "OMTK Flash Vorbis",
4242 "mv_generic_missing_plugin" : "You browser does not appear to support playback type: <b>$1</b><br> visit the <a href=\"http://commons.wikimedia.org/wiki/Commons:Media_help\">Playback Methods</a> page to download a player<br>",
4343
44 - "mv_for_best_experience": "For best video playback experience we recomend <a href=\"http://www.mozilla.com/en-US/firefox/upgrade.html?from=mv_embed\">Firefox 3.5</a>",
 44+ "mv_for_best_experience": "For best video playback experience we recomend <b><a href=\"http://www.mozilla.com/en-US/firefox/upgrade.html?from=mv_embed\">Firefox 3.5</a></b>",
4545 "mv_do_not_warn_again": "Do not warn me again."
4646
4747 });
@@ -325,10 +325,10 @@
326326 $j('#' + embedObj.id).get(0).play();
327327 });
328328
329 - //add recomend firefox if non-native playback:
330 - if( embedObj.doNativeWarningCheck() ){
 329+ //add recomend firefox if non-native playback:
 330+ if( embedObj.doNativeWarningCheck() ){
331331 $j('#dc_'+ embedObj.id).hover(
332 - function(){
 332+ function(){
333333 if($j('#gnp_' + embedObj.id).length==0){
334334 $j(this).append('<div id="gnp_' + embedObj.id + '" class="ui-state-highlight ui-corner-all" ' +
335335 'style="position:absolute;display:none;background:#FFF;top:10px;left:10px;right:10px;height:60px;">' +
@@ -1277,14 +1277,16 @@
12781278 }
12791279 }
12801280 //see if we are using a fallback (in which case it does not matter)
1281 - var playable_sources = this.media_element.getPlayableSources();
1282 - for(var source=0; source <playable_sources.length; source++){
1283 - var mime_type = playable_sources[source].mime_type;
1284 - if( mime_type=='video/h264' || mime_type=='video/x-flv'){
1285 - //they have flash / h.264 fallback no need to push firefox :(
1286 - return false;
1287 - }
1288 - }
 1281+ if(this.media_element && this.media_element.sources){
 1282+ var playable_sources = this.media_element.getPlayableSources();
 1283+ for(var sInx=0; sInx < playable_sources.length; sInx++){
 1284+ var mime_type = playable_sources[sInx].mime_type;
 1285+ if( mime_type=='video/h264' || mime_type=='video/x-flv'){
 1286+ //they have flash / h.264 fallback no need to push firefox :(
 1287+ return false;
 1288+ }
 1289+ }
 1290+ }
12891291 }
12901292 return true;
12911293 },
Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/nativeEmbed.js
@@ -228,12 +228,12 @@
229229 updateVolumen:function(perc){
230230 this.getVID();
231231 if(this.vid)
232 - this.vid.volume(perc);
 232+ this.vid.volume = perc;
233233 },
234234 getVolumen:function(){
235235 this.getVID();
236236 if(this.vid)
237 - return this.vid.volume();
 237+ return this.vid.volume;
238238 },
239239 load:function(){
240240 this.getVID();

Status & tagging log