r49676 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49675‎ | r49676 | r49677 >
Date:22:02, 20 April 2009
Author:dale
Status:deferred
Tags:
Comment:
* fixes for missing assets in playlist output
* stubs for firefogg chunk uploading (new-upload branch)
Modified paths:
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mvFirefogg.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/searchLibs/baseRemoteSearch.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedVideo/mv_baseEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mvPlayList.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/searchLibs/baseRemoteSearch.js
@@ -157,12 +157,15 @@
158158 },
159159 //default license permission wiki text is cc based template mapping (does not confirm the templates actually exist)
160160 getPermissionWikiTag: function( rObj ){
 161+ if(!rObj.license)
 162+ return '';//no license info
161163 //check that its a defined creative commons licnese key:
162 - if( typeof this.rsd.licenses.cc.licenses[ rObj.license.key ] != 'undefined' ){
 164+ if( this.rsd.licenses.cc.licenses[ rObj.license.key ] != 'undefined' ){
163165 return '{{Cc-' + rObj.license.key + '}}';
164166 }else if( rObj.license.lurl ) {
165167 return '{{Template:External_License|' + rObj.license.lurl + '}}';
166 - }
 168+ }
 169+
167170 },
168171 getImportResourceDescWiki:function(rObj){
169172 return rObj.title + ' imported from ' + '[' + this.cp.homepage +
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mvFirefogg.js
@@ -218,23 +218,12 @@
219219 },
220220 //doChunkUpload does both uploading and encoding at the same time and uploads one meg chunks as they are ready
221221 doChunkUpload : function(){
222 - var _this = this;
223 - //add chunk response hook to build the resultURL when uploading chunks
224 - /*_this.fogg.setChunkCallback( function( result ){
225 - js_log( 'chunkResponseHook:' + result );
226 - try{
227 - var upRes = JSON.parse( result );
228 - if( upRes.upload.sessionkey ){
229 -
230 - }
231 - if( upRes.upload.result ){
232 -
233 - }
234 - }catch(e){
235 - js_error( 'error could not parse chunkResponse' );
236 - }
237 - });*/
 222+ var _this = this;
238223
 224+ if( ! _this.api_url )
 225+ return js_error( 'Error: can\'t autodetect mode without api url' );
 226+
 227+ //add chunk response hook to build the resultURL when uploading chunks
239228
240229 //build the api url:
241230 var aReq ={
@@ -250,9 +239,12 @@
251240
252241 if( _this.formData['wpIgnoreWarning'] )
253242 aReq['ignorewarnings'] = _this.formData['wpIgnoreWarning'];
254 -
255 - _this.fogg.upload( JSON.stringify( _this.encoder_settings ), aReq , JSON.stringify( _this.formData ) );
 243+
 244+ js_log('do fogg upload call: '+ _this.api_url + ' :: ' + JSON.stringify( aReq ) );
256245
 246+
 247+ _this.fogg.upload( JSON.stringify( _this.encoder_settings ), _this.api_url , JSON.stringify( aReq ) );
 248+
257249 //update upload status:
258250 _this.doUploadStatus();
259251 },
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mvPlayList.js
@@ -790,7 +790,8 @@
791791 callback();
792792 });
793793 }
794 - },
 794+ },
 795+ //this is pretty outdated:
795796 getPLControls: function(){
796797 js_log('getPL cont');
797798 return '<a id="mv_prev_link_'+this.id+'" title="Previus Clip" onclick="document.getElementById(\''+this.id+'\').prev();return false;" href="#">'+
@@ -848,6 +849,7 @@
849850 //init:
850851 //debugger;
851852
 853+
852854 this.embed=null;
853855 //js_log('setup embed for clip '+ this.id + ':id is a function?');
854856 //set up the pl_mv_embed object:
@@ -868,11 +870,11 @@
869871
870872 if(this.poster)init_pl_embed['thumbnail']=this.poster;
871873
872 - if(this.type)init_pl_embed['type'] = this.type;
 874+ if( this.type ) init_pl_embed['type'] = this.type;
873875
874 - this.embed = new PlMvEmbed(init_pl_embed);
 876+ this.embed = new PlMvEmbed( init_pl_embed );
875877
876 - js_log('ve src len:' + this.embed.media_element.sources.length);
 878+ js_log('media src len:' + this.embed.media_element.sources.length);
877879 //js_log('media element:'+ this.embed.media_element.length);
878880 //js_log('type of embed:' + typeof(this.embed) + ' seq:' + this.pp.sequencer+' pb:'+ this.embed.play_button);
879881 },
@@ -1018,7 +1020,7 @@
10191021 }
10201022 var videoInterface = new embedVideo(ve);
10211023 //inherit the videoInterface
1022 - for(method in videoInterface){
 1024+ for( method in videoInterface ){
10231025 if(method!='style'){
10241026 if(this[method]){
10251027 //parent embed method preservation:
@@ -1030,7 +1032,7 @@
10311033 //string -> boolean:
10321034 if(this[method]=="false")this[method]=false;
10331035 if(this[method]=="true")this[method]=true;
1034 - }
 1036+ }
10351037 },
10361038 stop:function(){
10371039 //set up convenience pointer to parent playlist
@@ -1502,7 +1504,7 @@
15031505 var meta_tags = this.data.getElementsByTagName('meta');
15041506 var metaNames = new Array('title','interface_url', 'linkback', 'mTitle', 'mTalk');
15051507 $j.each(meta_tags, function(i,meta_elm){
1506 - js_log( "on META tag: "+ $j(meta_elm).attr('name') );
 1508+ //js_log( "on META tag: "+ $j(meta_elm).attr('name') );
15071509 for(var i in metaNames){
15081510 var _name = metaNames[i];
15091511 if( $j(meta_elm).attr('name') && $j(meta_elm).attr('content') ){
@@ -1550,13 +1552,13 @@
15511553 "pp":this, //set the parent playlist object pointer
15521554 "order": order
15531555 }
1554 - );
 1556+ );
15551557 //set optional params track
15561558 if( typeof track_id != 'undefined')
15571559 clipObj["track_id"] = track_id;
15581560
15591561 //debugger;
1560 - if (clipObj ){
 1562+ if ( clipObj ){
15611563 //set up embed:
15621564 clipObj.setUpEmbedObj();
15631565 //add clip to track:
@@ -1590,8 +1592,7 @@
15911593 mvSMILClip.prototype = {
15921594 params : {}, //support param as child of ref clips per SMIL spec
15931595 init:function(sClipElm, mvClipInit){
1594 - _this = this;
1595 -
 1596+ _this = this;
15961597 //make new mvCLip with ClipInit vals
15971598 var myMvClip = new mvClip( mvClipInit );
15981599
@@ -1607,14 +1608,14 @@
16081609 //get supported media attr init non-set
16091610 $j.each(mv_smil_ref_supported_attributes, function(i, attr){
16101611 if( $j(sClipElm).attr(attr)){
1611 - _this[attr]=$j(sClipElm).attr(attr);
 1612+ _this[attr] = $j(sClipElm).attr(attr);
16121613 }
16131614 })
16141615 this['tagName'] = sClipElm.tagName;
16151616
16161617 if( sClipElm.firstChild ){
16171618 this['wholeText'] = sClipElm.firstChild.nodeValue;
1618 - js_log("SET wholeText for: "+this['tagName'] + ' '+ this['wholeText']);
 1619+ js_log("SET wholeText for: " + this['tagName'] + ' '+ this['wholeText']);
16191620 }
16201621 //debugger;
16211622 //mv_embed specific property:
@@ -1635,13 +1636,17 @@
16361637 this.transOut.transAttrType = 'transOut';
16371638 }
16381639 //parse duration / begin times:
1639 - if(this.dur)
1640 - this.dur = smilParseTime(this.dur);
 1640+ if( this.dur )
 1641+ this.dur = smilParseTime( this.dur );
16411642
16421643 //conform type to video/ogg:
1643 - if(this['type']=='application/ogg'){
1644 - this['type']='video/ogg'; //conform to 'video/ogg' type
1645 - }
 1644+ if( this.type == 'application/ogg' )
 1645+ this.type = 'video/ogg'; //conform to 'video/ogg' type
 1646+
 1647+ //if unset type and we have innerHTML assume text/html type
 1648+ if( !this.type && this.wholeText ){
 1649+ this.type = 'text/html';
 1650+ }
16461651
16471652 //also grab andy child param elements if present:
16481653 if( sClipElm.getElementsByTagName('param')[0] ){
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedVideo/mv_baseEmbed.js
@@ -501,10 +501,10 @@
502502 init:function( video_element )
503503 {
504504 var _this = this;
505 - js_log('Initializing mediaElement...' + video_element);
 505+ js_log('Initializing mediaElement...' );
506506 this.sources = new Array();
507507 this.thumbnail = mv_default_thumb_url;
508 - // Process the <video> element
 508+ // Process the source element:
509509 if($j(video_element).attr("src"))
510510 this.tryAddSource(video_element);
511511
@@ -592,7 +592,7 @@
593593 return true;
594594 }
595595 //set via user-preference
596 - if(embedTypes.players.preference['format_prefrence']==mime_type){
 596+ if(embedTypes.players.preference['format_prefrence'] == mime_type){
597597 js_log('set via preference: '+playable_sources[source].mime_type);
598598 this.selected_source = playable_sources[source];
599599 return true;
@@ -678,7 +678,7 @@
679679 */
680680 tryAddSource:function(element)
681681 {
682 - //js_log('f:tryAddSource:'+ $j(element).attr("src"));
 682+ js_log('f:tryAddSource:'+ $j(element).attr("src"));
683683 if (! $j(element).attr("src")){
684684 //js_log("element has no src");
685685 return false;
@@ -695,7 +695,7 @@
696696 }
697697 var source = new mediaSource( element );
698698 this.sources.push(source);
699 - //js_log('pushed source to stack'+ source + 'sl:'+this.sources.length);
 699+ //alert('pushed source to stack'+ source + 'sl:'+this.sources.length);
700700 },
701701 getPlayableSources: function(){
702702 var playable_sources= new Array();
@@ -862,7 +862,7 @@
863863 {
864864 js_log('f:init_with_sources_loaded');
865865 //set flag that we have run this function:
866 - this.init_with_sources_loadedDone=true;
 866+ this.init_with_sources_loadedDone=true;
867867 //autoseletct the source
868868 this.media_element.autoSelectSource();
869869 //auto select player based on prefrence or default order
@@ -870,22 +870,23 @@
871871 {
872872 //check for parent clip:
873873 if( typeof this.pc != 'undefined' ){
874 - js_log('no sources, type:' +this.type + ' check for html');
 874+ js_log('no sources, type:' +this.type + ' check for html');
 875+ //debugger;
875876 //do load player if just displaying innerHTML:
876 - if(this.pc.type =='text/html'){
 877+ if( this.pc.type == 'text/html' ){
877878 this.selected_player = embedTypes.players.defaultPlayer( 'text/html' );
878879 js_log('set selected player:'+ this.selected_player.mime_type);
879880 }
880881 }
881882 }else{
882883 this.selected_player = embedTypes.players.defaultPlayer( this.media_element.selected_source.mime_type );
883 - }
 884+ }
884885 if( this.selected_player ){
885886 js_log('selected ' + this.selected_player.getName());
886887 js_log("PLAYBACK TYPE: "+this.selected_player.library);
887888 this.thumbnail_disp = true;
888889 this.inheritEmbedObj();
889 - }else{
 890+ }else{
890891 //no source's playable
891892 var missing_type ='';
892893 var or ='';

Status & tagging log