r50287 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50286‎ | r50287 | r50288 >
Date:22:16, 6 May 2009
Author:dale
Status:deferred
Tags:
Comment:
* per clip buffer indicators in video sequences
* upload api integration updates
Modified paths:
  • /trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/testing_page.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mvFirefogg.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mvUploader.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)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/styles.css (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/testing_page.php
@@ -18,15 +18,8 @@
1919 <table border="1" cellpadding="6" width="600">
2020 <tr>
2121 <td valign="top">
22 - <video id="embed_vid"
23 -thumbnail="http://metavid.org/wiki/index.php?action=ajax&rs=mv_frame_server&stream_id=501&t=0:01:32&amp;size=400x300"
24 -roe="http://metavid.org/wiki/index.php?title=Special:MvExportStream&stream_name=House_proceeding_01-28-08&feed_format=roe&t=0:01:32/0:03:20"
25 -style="width:400px;height:300px"
26 -controls="true" embed_link="true" >
27 - <source type="video/x-flv" src="http://mvbox2.cse.ucsc.edu/mvFlvServer.php/house_proceeding_01-28-08.flv?t=0:01:32/0:03:20"></source>
28 - <source type="video/ogg" src="http://metavidstorage01.ucsc.edu/media/house_proceeding_01-28-08.ogg?t=0:01:32/0:03:20"></source>
29 -</video>
30 -</td>
 22+ <video poster="sample_eclipse.jpg" src="sample_eclipse.ogg" ></video>
 23+ </td>
3124 <td valign="top"><b>Test embed</b><br />
3225 </td>
3326 </tr>
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mvFirefogg.js
@@ -279,11 +279,10 @@
280280 //js_log( 'done upload response is: ' + cat["responseText"] );
281281 _this.procPageResponse( response_text );
282282
283 - }else if( _this.upload_mode == 'chunks'){
 283+ }else if( _this.upload_mode == 'api'){
284284 if( _this.fogg.resultUrl ){
285285 //should have an json result:
286 - $j( '#dlbox-centered' ).html( '<h3>' + gM('mv_upload_completed') + '</h3>' +
287 - gM( 'mv_upload_done', _this.fogg.resultUrl) );
 286+ _this.updateUploadDone( _this.fogg.resultUrl );
288287 }else{
289288 //done state with error? ..not really possible given how firefogg works
290289 js_log(" upload done, in chunks mode, but no resultUrl!");
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mvUploader.js
@@ -364,13 +364,18 @@
365365 },
366366 processApiResult: function( apiRes ){
367367 var _this = this;
368 - //check for error
369 - if( apiRes.upload.result == "Failure" ){
 368+ //check for simple error
 369+ debugger;
 370+ if( apiRes.error ){
 371+ _this.updateUploadError( apiRes.error );
 372+ //check for upload api error:
 373+ }else if( apiRes.upload && apiRes.upload.result == "Failure" ){
370374 //error space is too large so we don't front load it
371375 //do a remote call to get the error msg:
372 - if(apiRes.upload.error != "unknown-error"){
373 - gMsgLoadRemote(apiRes.upload.error, function(msg){
374 - _this.updateUploadError( gM( apiRes.upload.error ));
 376+ if( apiRes.upload.code[0]){
 377+ gMsgLoadRemote(apiRes.upload.code[0], function(){
 378+ js_log('send msg: ' + gM( apiRes.upload.code[0] ));
 379+ _this.updateUploadError( gM( apiRes.upload.code[0] ));
375380 });
376381 }else{
377382 _this.updateUploadError( gM('unknown-error'));
@@ -380,8 +385,7 @@
381386 }else{
382387 //nothing fits assume unkown error:
383388 _this.updateUploadError( gM('unknown-error'));
384 - }
385 -
 389+ }
386390 },
387391 updateUploadError:function( msg ){
388392 $j( '#dlbox-centered' ).html( '<h3>' + gM('uploaderror') + '</h3>' +
@@ -393,7 +397,7 @@
394398 return false;
395399 });
396400 },
397 - updateUploadDone:function(url){
 401+ updateUploadDone:function( url ){
398402 $j( '#dlbox-centered' ).html( '<h3>' + gM('successfulupload') + '</h3>' +
399403 gM( 'mv_upload_done', url) );
400404 },
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mvPlayList.js
@@ -755,7 +755,8 @@
756756 var pwidth = Math.round( perc * _this.track_len);
757757 //var pwidth = Math.round( perc * _this.track_len - (_this.mv_seeker_width*perc) );
758758
759 - var barHtml = '<div id="cl_status_'+clip.id+'" class="cl_status" style="' +
 759+ //add the buffer child indicator:
 760+ var barHtml= '<div id="cl_status_' + clip.embed.id + '" class="cl_status" style="' +
760761 'left:'+cur_pixle +'px;'+
761762 'width:'+pwidth + 'px;';
762763 //set left or right border based on track pos
@@ -763,8 +764,11 @@
764765 'border-left:solid thin black;':
765766 'border-right:solid thin black;';
766767 barHtml+= 'filter:alpha(opacity=40);'+
767 - '-moz-opacity:.40;">'+
768 - '</div>';
 768+ '-moz-opacity:.40;">';
 769+
 770+ barHtml+='<div class="mv_progress mv_buffer"></div>';
 771+
 772+ barHtml+='</div>';
769773 //background:#DDDclip.getColor()
770774 $j('#seeker_bar_'+_this.id).append(barHtml);
771775
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/styles.css
@@ -479,7 +479,7 @@
480480 position:absolute;
481481 height:12px;
482482 top:0px;
483 - z-index:5;
 483+ z-index:3;
484484 }
485485
486486 #SEQUENCER CSS:
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedVideo/mv_baseEmbed.js
@@ -469,7 +469,7 @@
470470 //http://www.jibbering.com/2002/4/httprequest.html (this should be done by extending jquery's ajax objects)
471471 var end_inx = (uri.indexOf('?')!=-1)? uri.indexOf('?') : uri.length;
472472 var no_param_uri = uri.substr(0, end_inx);
473 - switch( no_param_uri.substr(no_param_uri.lastIndexOf('.'),4) ){
 473+ switch( no_param_uri.substr(no_param_uri.lastIndexOf('.'),4).toLowerCase() ){
474474 case '.flv':return 'video/x-flv';break;
475475 case '.ogg': case '.ogv': return 'video/ogg';break;
476476 case '.anx':return 'video/ogg';break;
@@ -1932,6 +1932,8 @@
19331933 this.setStatus( this.getTimeReq() );
19341934 }
19351935 }
 1936+ //update buffer information
 1937+ this.updateBufferStatus();
19361938
19371939 //update monitorTimerId to call child monitor
19381940 if( ! this.monitorTimerId ){
@@ -1939,7 +1941,24 @@
19401942 this.monitorTimerId = setInterval('$j(\'#'+this.id+'\').get(0).monitor()', 250);
19411943 }
19421944 }
1943 - },
 1945+ },
 1946+ updateBufferStatus: function(){
 1947+ //build the buffer targeet based for playlist vs clip
 1948+ var buffer_select = (this.pc) ?
 1949+ '#cl_status_' + this.id + ' .mv_buffer':
 1950+ '#mv_seeker_' + this.id + ' .mv_buffer';
 1951+
 1952+ //update the buffer progress bar (if available )
 1953+ if( this.bufferedPercent != 0 ){
 1954+ //js_log('bufferedPercent: ' + this.bufferedPercent);
 1955+ if(this.bufferedPercent > 1)
 1956+ this.bufferedPercent=1;
 1957+
 1958+ $j(buffer_select).css("width", (this.bufferedPercent*100) +'%' );
 1959+ }else{
 1960+ $j(buffer_select).css("width", '0px' );
 1961+ }
 1962+ },
19441963 relativeCurrentTime: function(){
19451964 if(!this.start_offset)
19461965 this.start_offset =0;
@@ -1992,18 +2011,8 @@
19932012 }else{
19942013 //hide the progress bar
19952014 $j('#mv_seeker_' + this_id + ' .mv_playback').css("width", "0px");
1996 - }
 2015+ }
19972016
1998 - //update the buffer progress bar (if available )
1999 - if( this.bufferedPercent != 0 ){
2000 - //js_log('bufferedPercent: ' + this.bufferedPercent);
2001 - if(this.bufferedPercent > 1)
2002 - this.bufferedPercent=1;
2003 - $j('#mv_seeker_' + this_id + ' .mv_buffer').css("width", (this.bufferedPercent*100) +'%' );
2004 - }else{
2005 - $j('#mv_seeker_' + this_id + ' .mv_buffer').css("width", '0px' );
2006 - }
2007 -
20082017 //js_log('set#mv_seeker_slider_'+this_id + ' perc in: ' + perc + ' * ' + $j('#mv_seeker_'+this_id).width() + ' = set to: '+ val + ' - '+ Math.round(this.mv_seeker_width*perc) );
20092018 //js_log('op:' + offset_perc + ' *('+perc+' * ' + $j('#slider_'+id).width() + ')');
20102019 },

Status & tagging log