r41213 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41212‎ | r41213 | r41214 >
Date:01:53, 24 September 2008
Author:dale
Status:old
Tags:
Comment:
fixed video edit preview bug
Modified paths:
  • /trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_flashEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_playlist.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_stream.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/skins/mv_stream.js
@@ -62,8 +62,7 @@
6363 mvJsLoader.doLoad({
6464 '$j.autocomplete':'jquery/plugins/jquery.autocomplete.js',
6565 '$j.fn.hoverIntent':'jquery/plugins/jquery.hoverIntent.js',
66 - '$j.ui.resizable':'jquery/plugins/ui.resizable.js',
67 - '$j.ui.draggable':'jquery/plugins/ui.draggable.js'
 66+ '$j.ui.resizable':'jquery/jquery.ui-1.5.2/ui/minified/ui.resizable.min.js'
6867 },function(){
6968 //now extend draggable
7069 mvJsLoader.doLoad({
@@ -272,10 +271,12 @@
273272 /* based on a a mvd_id update the video thumbnail to the correct location
274273 */
275274 doRestore:function(){
 275+ js_log('f:doRestore');
276276 var vid_elm = $j('#embed_vid').get(0);
277277 if(vid_elm){
278278 if( vid_elm.isPlaying()){
279 - //js_log('vid elm is playing delay restore:')
 279+ js_log('vid elm is playing delay restore:')
 280+ if(!vid_elm.userSlide) //dont' restore if userSlide is true
280281 setTimeout("mv_init_interface.doRestore()", 500);
281282 }else{
282283 //only restore if onClipDone_disp is false
@@ -464,6 +465,7 @@
465466 div.innerHTML=global_loading_txt;
466467 }
467468 //free the editor slot:
 469+ js_log('mv_disp_mvd: nset mv_open_edit_mvd');
468470 mv_open_edit_mvd=null;
469471 function f( request ) {
470472 result= request.responseText;
@@ -503,29 +505,15 @@
504506 /* non-ajax preview of clip adjustment*/
505507 function mv_adjust_preview(mvd_id){
506508 mv_lock_vid_updates=true;
507 - //if(!$('mv_start_hr_'+mvd_id))return ;
508 - //if(!$('mv_end_hr_'+mvd_id))return ;
509 - //if(!$('embed_vid'))return ;
510 - //if mv_embed state is "playing" swap preview button per html5 spec:
511 - if($j('#embed_vid').get(0).isPlaying()){
512 - //do stop swap preview button back
513 - $j('#embed_vid').get(0).stop();
514 - }
515 - //first time set up
516 - //if(!golobal_org_ptext)golobal_org_ptext = $j('#wpPreview_'+mvd_id).val();
517 - //js_log('gptext: ' + golobal_org_ptext);
518 - //if($j('#wpPreview_'+mvd_id).val()!=$j('#wpPreview_stop_msg_'+mvd_id).val() ){
519 - //preview request set text to hidden stop text:
520 - //$j('#wpPreview_'+mvd_id).val( $j('#wpPreview_stop_msg_'+mvd_id).val() ) ;
521 - //update the video source
 509+
522510 js_log('start val:#mv_start_hr_'+mvd_id+' ' + $j('#mv_start_hr_'+mvd_id).val() + ' end:'+ $j('#mv_end_hr_'+mvd_id).val() );
 511+
 512+ $j('#embed_vid').get(0).stop();
 513+
523514 do_video_time_update($j('#mv_start_hr_'+mvd_id).val(), $j('#mv_end_hr_'+mvd_id).val() );
524515 //start playing
525 - mv_do_play();
526 - //}else{
527 - //(video should already be stooped). restore org ptext:
528 - // $j('#wpPreview_'+mvd_id).val(golobal_org_ptext);
529 - //}
 516+ $j('#embed_vid').get(0).play();
 517+
530518 mv_lock_vid_updates=false;
531519 }
532520 /*
@@ -839,10 +827,12 @@
840828 $j(setHtmlId).html( result) ;
841829 scroll_to_pos(mvd_id);
842830 }
843 - //unlock the interface updates
844 - mv_lock_vid_updates=false;
845 - //free the editor slot:
846 - mv_open_edit_mvd=null;
 831+ if(edit_action!='preview'){
 832+ //unlock the interface updates
 833+ mv_lock_vid_updates=false;
 834+ //free the editor slot:
 835+ mv_open_edit_mvd=null;
 836+ }
847837 }
848838 //return false to prevent the form being submitted
849839 return false;
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_flashEmbed.js
@@ -153,8 +153,14 @@
154154 }
155155 },
156156 monitor : function()
157 - {
158 - this.getFLA();
 157+ {
 158+ //do monitor update:
 159+ if( ! this.monitorTimerId ){
 160+ if(document.getElementById(this.id)){
 161+ this.monitorTimerId = setInterval('$j(\'#'+this.id+'\').get(0).monitor()', 250);
 162+ }
 163+ }
 164+ this.getFLA();
159165 if(!this.fla['getTime'])
160166 return js_log('can not monitor without time');
161167
@@ -179,20 +185,13 @@
180186 this.setStatus( seconds2ntp(this.currentTime) + '/' + end_ntp);
181187 this.setSliderValue((this.currentTime - ntp2seconds(start_ntp)) / (ntp2seconds(end_ntp)-ntp2seconds(start_ntp)) );
182188 }
183 - }
184 - //do monitor update:
185 - if( ! this.monitorTimerId ){
186 - if(document.getElementById(this.id)){
187 - this.monitorTimerId = setInterval('$j(\'#'+this.id+'\').get(0).monitor()', 250);
188 - }
189 - }
 189+ }
190190
191191 //super hackery to see if we have "probably" reached the end of playback:
192192 if(this.prevTime==this.currentTime && (this.currentTime > (ntp2seconds(end_ntp)-1)) ){
193193 js_log('probablly reached end of stream: '+this.currentTime);
194194 this.onClipDone();
195 - }
196 -
 195+ }
197196 this.prevTime = this.currentTime;
198197
199198 //js_log('cur perc loaded: ' + this.fla.getPercentLoaded() +' cur time : ' + (this.currentTime - ntp2seconds(start_ntp)) +' / ' +(ntp2seconds(end_ntp)-ntp2seconds(start_ntp)));
@@ -225,6 +224,8 @@
226225 if( ! this.startedTimedPlayback){
227226 js_log('clip done before timed playback started .. not good. (ignoring) ');
228227 //setTimeout('$j(\'#'+embed.id+'\').get(0).play()', 250);
 228+ //keep monitoring:
 229+ this.monitor();
229230 }else{
230231 js_log('clip done and '+ this.startedTimedPlayback);
231232 //stop the clip if its not stoped already:
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
@@ -531,12 +531,8 @@
532532 var _this = embedObj;
533533 //add in drag/seek hooks:
534534 if(!_this.base_seeker_slider_offset && $j('#mv_seeker_slider_'+_this.id).get(0))
535 - _this.base_seeker_slider_offset = $j('#mv_seeker_slider_'+_this.id).get(0).offsetLeft;
 535+ _this.base_seeker_slider_offset = $j('#mv_seeker_slider_'+_this.id).get(0).offsetLeft;
536536
537 - //if playlist always start at 0
538 - _this.start_time_sec = (_this.instanceOf == 'mvPlayList')?0:
539 - _this.start_time_sec = ntp2seconds(_this.getTimeReq().split('/')[0]);
540 -
541537 //js_log('looking for: #mv_seeker_slider_'+_this.id + "\n " +
542538 // 'start sec: '+_this.start_time_sec + ' base offset: '+_this.base_seeker_slider_offset);
543539
@@ -551,6 +547,9 @@
552548 var options = ui.options;
553549 //remove "play button"
554550 $j('#big_play_link_'+_this.id).fadeOut('fast');
 551+ //if playlist always start at 0
 552+ _this.start_time_sec = (_this.instanceOf == 'mvPlayList')?0:
 553+ _this.start_time_sec = ntp2seconds(_this.getTimeReq().split('/')[0]);
555554 },
556555 drag:function(e, ui){
557556 //@@todo get the -14 number from the skin somehow
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_playlist.js
@@ -1679,11 +1679,11 @@
16801680 $j('#'+tObj.overlay_selector_id).show();
16811681
16821682 //do update:
1683 - /*js_log('doing update for: '+ tObj.pClip.id +
 1683+ js_log('doing update for: '+ tObj.pClip.id +
16841684 ' type:' + tObj.transAttrType +
16851685 ' t_type:'+ tObj.type +
16861686 ' subypte:'+ tObj.subtype +
1687 - ' percent:' + percent);*/
 1687+ ' percent:' + percent);
16881688
16891689 this['type'][tObj.type][tObj.subtype].u(tObj,percent);
16901690 },

Status & tagging log