r40934 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40933‎ | r40934 | r40935 >
Date:20:55, 16 September 2008
Author:dale
Status:old
Tags:
Comment:
updates to playlist scrubbing
Modified paths:
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_playlist.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
@@ -169,11 +169,16 @@
170170 //plugin libs var names and paths:
171171 lib_jquery:{'window.jQuery':'jquery/jquery-1.2.6.min.js'},
172172 lib_plugins:{
 173+ '$j.timer.global':'jquery/plugins/jquery.timers.js', //we may be able to remove the timer
 174+ '$j.ui.progressbar':'jquery/jquery-ui-personalized-1.6rc1.debug.js'
 175+ },
 176+ /*old lib includes:
173177 '$j.fn.offsetParent':'jquery/plugins/jquery.dimensions.js',
174178 '$j.ui.mouseInteraction':'jquery/plugins/ui.mouse.js',
175 - '$j.ui.slider':'jquery/plugins/ui.slider.js',
176 - '$j.timer.global':'jquery/plugins/jquery.timers.js'
177 - },
 179+ '$j.ui.slider':'jquery/plugins/ui.slider.js',
 180+ '$j.ui.draggable':'jquery/plugins/ui.draggable.js', //include draggable
 181+ '$j.ui.droppable':'jquery/plugins/ui.droppable.js'
 182+ */
178183 pc:null, //used to store pointer to parent clip (when in playlist mode)
179184 load_libs:function(callback){
180185 if(callback)this.load_callback = callback;
@@ -508,6 +513,57 @@
509514 }
510515 return o;
511516 },
 517+ /*
 518+ * addControlHooks
 519+ * to be run once controls are attached to the dom
 520+ */
 521+ addControlHooks:function(embedObj){
 522+ var _this = embedObj;
 523+ //add in drag/seek hooks:
 524+ if(!_this.base_seeker_slider_offset && $j('#mv_seeker_slider_'+_this.id).get(0))
 525+ _this.base_seeker_slider_offset = $j('#mv_seeker_slider_'+_this.id).get(0).offsetLeft;
 526+
 527+ //if playlist always start at 0
 528+ _this.start_time_sec = (_this.instanceOf == 'mvPlayList')?0:
 529+ _this.start_time_sec = ntp2seconds(_this.getTimeReq().split('/')[0]);
 530+
 531+ js_log('looking for: #mv_seeker_slider_'+_this.id + "\n " +
 532+ 'start sec: '+_this.start_time_sec + ' base offset: '+_this.base_seeker_slider_offset);
 533+
 534+ //buid dragable hook here:
 535+ $j('#mv_seeker_slider_'+_this.id).draggable({
 536+ containment:'#seeker_bar_'+_this.id,
 537+ axis:'x',
 538+ opacity:.6,
 539+ start:function(e, ui){
 540+ _this.userSlide=true;
 541+ js_log("started draging set userSlide"+_this.userSlide)
 542+ var options = ui.options;
 543+ //remove "play button"
 544+ $j('#big_play_link_'+_this.id).fadeOut('fast');
 545+ },
 546+ drag:function(e, ui){
 547+ //@@todo get the -14 number from the skin somehow
 548+ var perc = (($j('#mv_seeker_slider_'+_this.id).get(0).offsetLeft-_this.base_seeker_slider_offset)
 549+ /
 550+ ($j('#mv_seeker_'+_this.id).width()-14));
 551+
 552+ this.jump_time = seconds2ntp(parseInt(_this.getDuration()*perc)+ _this.start_time_sec);
 553+ js_log('perc:' + perc + ' * ' + _this.getDuration() + ' jt:'+ this.jump_time);
 554+ _this.setStatus( getMsg('seek_to')+' '+this.jump_time );
 555+ //update the thumbnail/ frame
 556+ _this.updateTimeThumb(perc);
 557+ },
 558+ stop:function(e, ui){
 559+ _this.userSlide=false;
 560+ js_log('do jump to: '+this.jump_time)
 561+ //reset slider
 562+ _this.seek_time_sec=ntp2seconds(this.jump_time);
 563+ //_this.stop();
 564+ //_this.play();
 565+ }
 566+ });
 567+ },
512568 components:{
513569 'borders':{
514570 'w':8,
@@ -575,7 +631,7 @@
576632 'w':0, //special case (takes up remaning space)
577633 'o':function(){
578634 return '<div class="seeker" id="mv_seeker_'+ctrlBuilder.id+'" style="width: ' + (ctrlBuilder.avaliable_width - 18) + 'px;">'+
579 - ' <div class="seeker_bar">'+
 635+ ' <div id="seeker_bar_'+ctrlBuilder.id+'" class="seeker_bar">'+
580636 ' <div class="seeker_bar_outer"></div>'+
581637 ' <div id="mv_seeker_slider_'+ctrlBuilder.id+'" class="seeker_slider"></div>'+
582638 ' <div class="seeker_bar_close"></div>'+
@@ -920,17 +976,12 @@
921977 mvEmbed.load_libs(function(){
922978 //load playlist object and drag,drop,resize,hoverintent,libs
923979 mvJsLoader.doLoad({
924 - 'mvPlayList':'mv_playlist.js',
925 - '$j.ui.resizable':'jquery/plugins/ui.resizable.js',
926 - '$j.ui.draggable':'jquery/plugins/ui.draggable.js',
927 - '$j.ui.droppable':'jquery/plugins/ui.droppable.js'
 980+ 'mvPlayList':'mv_playlist.js'
928981 //'$j.ui.sortable':'jquery/plugins/ui.sortable.js'
929982 },function(){
930983 //load the sequencer and draggable ext
931984 mvJsLoader.doLoad({
932 - 'mvSequencer':'mv_sequencer.js',
933 - '$j.ui.draggable.prototype.plugins.drag':'jquery/plugins/ui.draggable.ext.js',
934 - '$j.ui.droppable.prototype.plugins.over':'jquery/plugins/ui.droppable.ext.js'
 985+ 'mvSequencer':'mv_sequencer.js'
935986 },function(){
936987 //init the sequence object (it will take over from there)
937988 mvSeq = new mvSequencer(initObj);
@@ -1442,14 +1493,8 @@
14431494 getURI : function(seek_time_sec)
14441495 {
14451496 if(!seek_time_sec)
1446 - return this.src;
1447 -
1448 - pSrc = parseUri(this.src);
1449 - var new_url = pSrc.protocol +'://'+ pSrc.host + pSrc.path +'?';
1450 - for(i in pSrc.queryKey){
1451 - new_url +=(i=='t')?'t=' + seconds2ntp(seek_time_sec) +'/'+ this.end_ntp +'&' :
1452 - i+'='+ pSrc.queryKey[i]+'&';
1453 - }
 1497+ return this.src;
 1498+ var new_url = getUpdateTimeURL(this.src, seconds2ntp(seek_time_sec)+'/'+ this.end_ntp);
14541499 return new_url;
14551500 },
14561501 /** Title accessor function.
@@ -1770,7 +1815,11 @@
17711816 seek_time_sec:0,
17721817 base_seeker_slider_offset:null,
17731818 onClipDone_disp:false,
1774 - supports:{},
 1819+ supports:{},
 1820+ //for seek thumb updates:
 1821+ cur_thumb_seek_time:0,
 1822+ thumb_seek_interval:null,
 1823+
17751824 //utility functions for property values:
17761825 hx : function ( s ) {
17771826 if ( typeof s != 'String' ) {
@@ -2209,8 +2258,9 @@
22102259 return;
22112260 }else{
22122261 $j('#mv_embedded_controls_'+this.id).html( this.getControlsHTML() );
 2262+ this.addControlHooks();
22132263 }
2214 - },
 2264+ },
22152265 getControlsHTML:function()
22162266 {
22172267 return ctrlBuilder.getControls(this);
@@ -2239,44 +2289,10 @@
22402290 }
22412291 html_code += '</div>'; //videoPlayer div close
22422292 js_log('should set: '+this.id);
2243 - $j(this).html(html_code);
2244 -
2245 - if(!_this.base_seeker_slider_offset)
2246 - _this.base_seeker_slider_offset = $j('#mv_seeker_slider_'+_this.id).get(0).offsetLeft;
2247 -
2248 - _this.start_time_sec = ntp2seconds(_this.getTimeReq().split('/')[0]);
2249 -
2250 - js_log('start sec: '+_this.start_time_sec + ' base offset: '+_this.base_seeker_slider_offset);
2251 -
2252 - //buid dragable hook here:
2253 - $j('#mv_seeker_slider_'+this.id).draggable({
2254 - containment:'parent',
2255 - axis:'x',
2256 - opacity:.6,
2257 - start:function(e, ui){
2258 - _this.userSlide=true;
2259 - js_log("started draging set userSlide"+_this.userSlide)
2260 - },
2261 - drag:function(e, ui){
2262 - //@@todo get the -14 number from the skin somehow
2263 - var perc = (($j('#mv_seeker_slider_'+_this.id).get(0).offsetLeft-_this.base_seeker_slider_offset)
2264 - /
2265 - ($j('#mv_seeker_'+_this.id).width()-14));
2266 -
2267 - this.jump_time = seconds2ntp(parseInt(_this.duration*perc)+ _this.start_time_sec);
2268 - js_log('perc:' + perc + ' * ' + _this.duration + ' jt:'+ this.jump_time);
2269 - _this.setStatus( getMsg('seek_to')+' '+this.jump_time );
2270 - },
2271 - stop:function(e, ui){
2272 - _this.userSlide=false;
2273 - js_log('do jump to: '+this.jump_time)
2274 - //reset slider
2275 - _this.seek_time_sec=ntp2seconds(this.jump_time);
2276 - _this.stop();
2277 - _this.play();
2278 - }
2279 - });
2280 -
 2293+ $j(this).html(html_code);
 2294+ //add hooks once Controls are in DOM
 2295+ ctrlBuilder.addControlHooks(this);
 2296+
22812297 //js_log('set this to: ' + $j(this).html() );
22822298 //alert('stop');
22832299 //if auto play==true directly embed the plugin
@@ -2318,6 +2334,19 @@
23192335 updateVideoSrc : function(src){
23202336 js_log("UPDATE SRC:"+src);
23212337 this.src = src;
 2338+ },
 2339+ updateTimeThumb: function(perc){
 2340+ //do quick thumb update
 2341+ if(typeof org_thum_src=='undefined'){
 2342+ org_thum_src = this.media_element.getThumbnailURL();
 2343+ }
 2344+ if(org_thum_src.indexOf('t=')!==-1){
 2345+ this.updateThumbnail( getUpdateTimeURL(
 2346+ seconds2ntp( (this.getDuration() * perc) + this.start_offset)
 2347+ )
 2348+ );
 2349+ }
 2350+ js_log('f:doUpdateTimeThumb: update thumb to: '+ perc + ' os:'+ org_thum_src);
23222351 },
23232352 //updates the thumbnail if the thumbnail is being displayed
23242353 updateThumbnail : function(src, quick_switch){
@@ -2790,7 +2819,7 @@
27912820 }
27922821 return null;
27932822 },
2794 - activateSlider : function(slider_id){
 2823+ /*activateSlider : function(slider_id){
27952824 var id = (this.pc)?this.pc.pp.id:this.id;
27962825 var thisVid = this;
27972826 this.sliderVal=0;
@@ -2811,15 +2840,15 @@
28122841 });
28132842 //if(!slider_id)slider_id=this.id;
28142843 //get a pointer to this id (as this in onSlide context is not "this")
2815 - /*var parent_id = this.id; */
2816 - },
 2844+ /*var parent_id = this.id;
 2845+ },*/
28172846 setSliderValue: function(perc){
28182847 var id = (this.pc)?this.pc.pp.id:this.id;
28192848 //alinment offset:
28202849 if(!this.mv_seeker_width)
28212850 this.mv_seeker_width = $j('#mv_seeker_slider_'+id).width();
28222851
2823 - js_log('currentTime:'+ this.currentTime);
 2852+ //js_log('currentTime:'+ this.currentTime);
28242853
28252854 var val = Math.round( perc * $j('#mv_seeker_'+id).width() - (this.mv_seeker_width*perc));
28262855 $j('#mv_seeker_slider_'+id).css('left', (val+41)+'px' );
@@ -2847,23 +2876,31 @@
28482877 }
28492878
28502879 /*
2851 -* EMBED OBJECTS:
2852 -* (dynamically included)
2853 -*/
2854 -
2855 -/*
28562880 * utility functions:
28572881 */
 2882+function getUpdateTimeURL(url, new_time){
 2883+ pSrc = parseUri(url);
 2884+ var new_url = pSrc.protocol +'://'+ pSrc.host + pSrc.path +'?';
 2885+ var amp = '';
 2886+ for(i in pSrc.queryKey){
 2887+ new_url +=(i=='t')? amp + 't=' + new_time:
 2888+ amp+i+'='+ pSrc.queryKey[i];
 2889+ amp = '&';
 2890+ }
 2891+ return new_url;
 2892+}
28582893 function seconds2ntp(sec){
2859 - sec = parseInt(sec);
2860 - hours = Math.floor(sec/ 3600);
2861 - minutes = Math.floor((sec/60) % 60);
2862 - seconds = sec % 60;
 2894+ var sec = parseInt(sec);
 2895+ var hours = Math.floor(sec/ 3600);
 2896+ var minutes = Math.floor((sec/60) % 60);
 2897+ var seconds = sec % 60;
28632898 if ( minutes < 10 ) minutes = "0" + minutes;
28642899 if ( seconds < 10 ) seconds = "0" + seconds;
28652900 return hours+":"+minutes+":"+seconds;
28662901 }
2867 -/* takes hh:mm:ss input returns number of seconds */
 2902+/*
 2903+ * takes hh:mm:ss input returns number of seconds
 2904+ */
28682905 function ntp2seconds(ntp){
28692906 if(!ntp){
28702907 js_log('ntp2seconds:not valid ntp:'+ntp);
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_playlist.js
@@ -51,6 +51,7 @@
5252 };
5353 //set up the mvPlaylist object
5454 mvPlayList.prototype = {
 55+ instanceOf:'mvPlayList',
5556 pl_duration:null,
5657 update_tl_hook:null,
5758 clip_ready_count:0,
@@ -213,7 +214,10 @@
214215 this.loading=false;
215216 this.getHTML();
216217 },
217 - getPlDuration:function(regen){
 218+ /*
 219+ * @@todo getDuration should replace getDuration
 220+ */
 221+ getDuration:function(regen){
218222 //js_log("GET PL DURRATION for : "+ this.tracks[this.default_track_id].clips.length + 'clips');
219223 if(!regen && this.pl_duration)
220224 return this.pl_duration;
@@ -232,9 +236,9 @@
233237 //js_log("return dur: " + this.pl_duration);
234238 return this.pl_duration;
235239 },
236 - getPlDurationNTP:function(){
 240+ getDurationNTP:function(){
237241 //get duration in ms and return in NTP
238 - return seconds2ntp(this.getPlDuration());
 242+ return seconds2ntp(this.getDuration());
239243 //return 'wtf';
240244 },
241245 getDataSource:function(){
@@ -368,6 +372,8 @@
369373 '</div>'+
370374 '</div>'
371375 );
 376+ //once the contorls are in the DOM add hooks:
 377+ ctrlBuilder.addControlHooks(this);
372378 //add the play button:
373379 $j('#dc_'+plObj.id).append(
374380 this.cur_clip.embed.getPlayButton()
@@ -399,15 +405,53 @@
400406 this.updateBaseStatus();
401407 }
402408 },
 409+ updateTimeThumb:function(perc){
 410+ //get float seconds:
 411+ var float_sec = (this.getDuration()*perc)
 412+ js_log('float sec:' + float_sec);
 413+
 414+ //update display & cur_clip:
 415+ var pl_sum_time =0;
 416+ var clip_float_sec=0;
 417+ for(var i in this.default_track.clips){
 418+ var clip = this.default_track.clips[i];
 419+ if( (clip.getDuration() + pl_sum_time) > float_sec ){
 420+ if(this.cur_clip.id != clip.id){
 421+ $j('#clipDesc_'+this.cur_clip.id).hide();
 422+ this.cur_clip = clip;
 423+ $j('#clipDesc_'+this.cur_clip.id).show();
 424+ }
 425+ break;
 426+ }
 427+ pl_sum_time+=clip.getDuration();
 428+ }
 429+ //update start offset (@@todo should probably happen somewhere else like in getDuration() )
 430+ if(!this.cur_clip.embed.start_offset)
 431+ this.cur_clip.embed.start_offset=this.cur_clip.embed.media_element.selected_source.start_offset;
 432+
 433+ //render effects ontop:
 434+ //issue thumbnail update request: (if plugin supports it will render out
 435+ this.cur_clip.embed.updateTimeThumb(perc);
 436+
 437+ this.cur_clip.embed.currentTime = (float_sec -pl_sum_time)+this.cur_clip.embed.start_offset ;
 438+ this.cur_clip.embed.seek_time_sec = (float_sec -pl_sum_time );
 439+
 440+ this.doSmilActions();
 441+
 442+ },
403443 updateBaseStatus:function(){
404444 js_log('update title');
405445 $j('#ptitle_'+this.id).html(''+
406446 '<b>' + this.title + '</b> '+
407447 this.getClipCount()+' clips, <i>'+
408 - this.getPlDurationNTP() + '</i>' );
 448+ this.getDurationNTP() + '</i>' );
409449 //update status:
410 - this.cur_clip.embed.setStatus('0:0:00/'+this.getPlDurationNTP());
 450+ this.cur_clip.embed.setStatus('0:0:00/'+this.getDurationNTP());
411451 },
 452+ /*setStatus overide (could call the jquery directly) */
 453+ setStatus:function(value){
 454+ $j('#mv_time_'+this.id).html(value);
 455+ },
412456 /*gets adds hidden desc to the #dc container*/
413457 getAllClipDesc : function(){
414458 //js_log("build all clip details pages");
@@ -444,12 +488,12 @@
445489 }
446490 var track_len = $j('#mv_seeker_'+this.id).css('width').replace(/px/, '');
447491 //assume the duration is static and present at .duration during playback
448 - var clip_perc = this.cur_clip.embed.duration / this.getPlDuration();
 492+ var clip_perc = this.cur_clip.embed.duration / this.getDuration();
449493 var perc_offset =time_offset = 0;
450494 for(var i in this.default_track.clips){
451495 var clip = this.default_track.clips[i];
452496 if(this.cur_clip.id ==clip.id)break;
453 - perc_offset+=(clip.embed.duration / plObj.getPlDuration());
 497+ perc_offset+=(clip.embed.duration / plObj.getDuration());
454498 time_offset+=clip.embed.duration;
455499 }
456500 //run any update time line hooks:
@@ -601,14 +645,13 @@
602646 //next prev button and more status display
603647 getControlsHTML:function(){
604648 //get controls from current clip (add some playlist specific controls:
605 - this.cur_clip.embed.supports['prev_next']=true;
606 - this.cur_clip.embed.supports['options_in_body']=true;
 649+ this.cur_clip.embed.supports['prev_next']=true;
607650 return ctrlBuilder.getControls(this.cur_clip.embed);
608651 },
609652 //ads colors/dividers between tracks
610653 colorPlayHead: function(){
611654 //total duration:
612 - var pl_duration = this.getPlDuration();
 655+ var pl_duration = this.getDuration();
613656 var track_len = $j('#slider_'+this.id).css('width').replace(/px/, '');
614657 var cur_pixle=0;
615658
@@ -943,9 +986,7 @@
944987 }
945988 }
946989 },
947 - getDuration:function(){
948 - //return duration if clips already has duration
949 - if(this.duration)return this.duration;
 990+ getDuration:function(){
950991 if(!this.embed)this.setUpEmbedObj();
951992 return this.embed.getDuration();
952993 },
@@ -1202,7 +1243,7 @@
12031244 this.pe_setStatus(value);
12041245 }else{
12051246 //js_log("set time via base offset:"+base_dur + ' curTime:'+plObj.cur_clip.embed.currentTime)
1206 - this.pe_setStatus(seconds2ntp(plObj.cur_clip.dur_offset + plObj.cur_clip.embed.currentTime) + '/'+ plObj.getPlDurationNTP());
 1247+ this.pe_setStatus(seconds2ntp(plObj.cur_clip.dur_offset + plObj.cur_clip.embed.currentTime) + '/'+ plObj.getDurationNTP());
12071248 }
12081249 },
12091250 setSliderValue:function(value){
@@ -1210,10 +1251,10 @@
12111252 //js_log('set slider value:c:'+this.id+' v:'+ value + ' trueVa:'+ sliderVal);
12121253 this.pe_setSliderValue(sliderVal);
12131254 },
1214 - activateSlider:function(){
 1255+ /*activateSlider:function(){
12151256 //map the slider to the parent playlist slider id:
12161257 this.pe_activateSlider(this.pc.pp.id);
1217 - },
 1258+ },*/
12181259 doSeek:function(v){
12191260 var plObj = this.pc.pp;
12201261 var prevClip=null;
@@ -1221,7 +1262,7 @@
12221263 var perc_offset=0;
12231264 for(var i in plObj.default_track.clips){
12241265 var clip = plObj.default_track.clips[i];
1225 - perc_offset+=(clip.embed.duration / plObj.getPlDuration());
 1266+ perc_offset+=(clip.embed.duration / plObj.getDuration());
12261267 if(perc_offset > v ){
12271268 if(this.playMovieAt){
12281269 this.playMovieAt(i);
@@ -1496,13 +1537,14 @@
14971538 //handles the rendering of overlays loaind of future clips (if nessesary)
14981539 //@@todo could be lazy loaded if nessesary
14991540 mvPlayList.prototype.doSmilActions = function(){
1500 - //js_log('f:doSmilActions');
 1541+ //js_log('f:doSmilActions');
15011542 var offSetTime = 0; //offset time should let us start a transition later on if we have to.
15021543 _pClip = this.cur_clip;
15031544
1504 - //@@todo move some of this out of this loop
 1545+
 1546+ //@@todo move some of this out of this loop (ie init should assure .dur
15051547 if(!_pClip.dur)
1506 - _pClip.dur = this.duration;
 1548+ _pClip.dur = _pClip.embed.getDuration();
15071549
15081550 //check for duration actions / clip freze mode
15091551 if(_pClip.dur <= _pClip.embed.currentTime && _pClip.order != _pClip.pp.getClipCount()-1 ){
@@ -1513,7 +1555,7 @@
15141556 }
15151557
15161558 if(_pClip.dur >= _pClip.embed.currentTime ){
1517 - //@@todo freeze on onClipStop
 1559+ //@@todo freeze-frame on onClipStop
15181560 }
15191561
15201562 if(_pClip.begin){
@@ -1533,7 +1575,6 @@
15341576 var prev_pClip = _pClip.pp.getClip(-1);
15351577 if(prev_pClip.id == this.cur_clip.id)
15361578 js_log('Error: transIn crossfade without previus media asset');
1537 -
15381579 _pClip.transIn.overlay_selector_id = 'clipDesc_'+prev_pClip.id;
15391580 }else{
15401581 _pClip.transIn.overlay_selector_id =this.getOverlaySelector(_pClip, 'transIn_');
@@ -1545,7 +1586,17 @@
15461587 //start running the transition animation (will stop once pClip time > transition duration
15471588 js_log("ABOUT TO RUN transIn");
15481589 js_log("cid: "+_pClip.transIn.pClip.id);
 1590+ //if user seeking don't start animations just update frame
15491591 _pClip.transIn.run_animation();
 1592+ }else if(_pClip.transIn.animation_state==1 ){
 1593+ //only update if userSlide (otherwise hanndled by internal transition timer)
 1594+ if(this.userSlide){
 1595+ js_log('user slide update transition state:'+ _pClip.embed.currentTime );
 1596+ _pClip.transIn.run_animation();
 1597+ }
 1598+ }else if(_pClip.transIn.animation_state==2){
 1599+ //close up shop:
 1600+ $j('#'+_pClip.transIn.overlay_selector_id).remove();
15501601 }
15511602 }
15521603 }
@@ -1563,8 +1614,10 @@
15641615 if(next_pClip.id == this.cur_clip.id)
15651616 js_log('Error: transOut crossfade without subquent asset');
15661617
1567 - //start playing the next clip
1568 - next_pClip.embed.play();
 1618+ //start playing the next clip (if not user slide)
 1619+ if(!this.userSlide){
 1620+ next_pClip.embed.play();
 1621+ }
15691622 _pClip.transOut.overlay_selector_id = 'clipDesc_'+next_pClip.id;
15701623 //mvTransLib.doTransition(_pClip.transOut, overlay_selector_id, pClip);
15711624
@@ -1641,7 +1694,7 @@
16421695 //types:
16431696 fade:{
16441697 fadeFromColor:{
1645 - "init":function(tObj){
 1698+ 'init':function(tObj){
16461699 js_log('f:fadeFromColor: '+tObj.overlay_selector_id +' to color: '+ tObj.fadeColor);
16471700 if(!tObj.fadeColor)
16481701 return js_log('missing fadeColor');
@@ -1653,9 +1706,10 @@
16541707 'background-color':tObj.fadeColor,
16551708 'opacity':"1",
16561709 });
1657 - },
 1710+ },
16581711 'u':function(tObj, percent){
1659 - //fade from color invert the percent
 1712+ js_log(':fadeFromColor:update: '+ percent);
 1713+ //fade from color (invert the percent)
16601714 var percent = 1- percent;
16611715 $j('#'+tObj.overlay_selector_id).css({
16621716 "opacity" : percent
@@ -1825,11 +1879,9 @@
18261880 */
18271881 getDuration:function(){
18281882 //check for smil dur:
1829 - if(this.dur)
1830 - return this.dur;
1831 - //else get the duration from the embed clip:
1832 - if(this.embed.getDuration())
1833 - return this.embed.getDuration();
 1883+ if(!this.dur)
 1884+ this.dur = this.embed.getDuration();
 1885+ return this.dur;
18341886 },
18351887 setUpEmbedObj:function(){
18361888 js_log('set up embed for smil based clip');
@@ -1908,7 +1960,8 @@
19091961
19101962 if(percentage >= 1){
19111963 this.animation_state=2;
1912 - js_log("transition done");
 1964+ js_log("transition done update with percentage "+percentage);
 1965+ clearInterval(this.timerId);
19131966 return true;
19141967 }
19151968 //js_log('cur percentage: '+percentage);
@@ -1917,8 +1970,8 @@
19181971
19191972
19201973 this.interValCount++;
1921 - //setInterval in we are still in running state
1922 - if(this.animation_state==1){
 1974+ //setInterval in we are still in running state and user is not using the playhead
 1975+ if(this.animation_state==1 && !this.pClip.pp.userSlide){
19231976 if(!this.timerId){
19241977 this.timerId = setInterval('document.getElementById(\''+this.pClip.pp.id+'\').cur_clip.'+this.transAttrType+'.run_animation()',
19251978 MV_ANIMATION_CB_RATE);