Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_htmlEmbed.js |
— | — | @@ -82,15 +82,16 @@ |
83 | 83 | var do_refresh = (typeof options['refresh'] != 'undefined')?true:false; |
84 | 84 | |
85 | 85 | var thumb_render_id = this.id +'_thumb_render_'+ options.height; |
86 | | - if( $j('#' + thumb_render_id ).length == 0 || do_refresh ){ |
| 86 | + if( $j('#' + thumb_render_id ).length == 0 || do_refresh ){ |
87 | 87 | //set the font scale down percentage: (kind of arbitrary) |
88 | 88 | var scale_perc = options.width / this.pc.pp.width; |
89 | 89 | //js_log('scale_perc:'+options.width + ' / '+ $j(this).width()+ ' = '+scale_perc ); |
90 | 90 | //min scale font percent of 70 (overflow is hidden) |
91 | 91 | var font_perc = ( Math.round( scale_perc*100 ) < 80 )?80:Math.round( scale_perc*100 ); |
92 | | - |
| 92 | + var thumb_class = (typeof options['thumb_class'] !='undefined')? options['thumb_class'] : ''; |
| 93 | + |
93 | 94 | $j('body').append( '<div id="' + thumb_render_id + '" style="display:none">'+ |
94 | | - '<div class="mv_tl_thumb" style="display:block;border:solid thin black;'+ |
| 95 | + '<div class="' + thumb_class + '" style="display:block;border:solid thin black;'+ |
95 | 96 | 'width:'+options.width+'px;height:'+options.height+'px;overflow:hidden;" >'+ |
96 | 97 | this.getThumbnailHTML() + |
97 | 98 | '</div>'+ |
— | — | @@ -124,7 +125,7 @@ |
125 | 126 | js_log('f:html:getEmbedHTML'); |
126 | 127 | //set up the css for our parent div: |
127 | 128 | $j(this).css({'width':this.pc.pp.width, 'height':this.pc.pp.height, 'overflow':"hidden"}); |
128 | | - //@@todo support more smil annimation layout stuff: |
| 129 | + //@@todo support more smil animation layout stuff: |
129 | 130 | |
130 | 131 | //wrap output in videoPlayer_ div: |
131 | 132 | $j(this).html('<div id="videoPlayer_'+ this.id+'">'+this.getThumbnailHTML()+'</div>'); |
— | — | @@ -152,12 +153,14 @@ |
153 | 154 | getDuration:function(){ |
154 | 155 | if(this.pc.dur) |
155 | 156 | return this.pc.dur; |
156 | | - //set duration (depreciated all .duration calls should get from getDuration) |
157 | | - this.duration=pcHtmlEmbedDefaults.dur; |
158 | | - //no dur use default: |
| 157 | + //return default value: |
159 | 158 | return pcHtmlEmbedDefaults.dur; |
| 159 | + }, |
| 160 | + updateVideoTime:function(start_ntp, end_ntp){ |
| 161 | + //since we don't really have timeline for html elements just take the delta and set it as the duration |
| 162 | + this.pc.dur = ntp2seconds(end_ntp) - ntp2seconds(start_ntp); |
160 | 163 | }, |
161 | | - //gives a chance to make any neseary external requests |
| 164 | + //gives a chance to make any nesseary external requests |
162 | 165 | //@@todo we can "start loading images" if we want |
163 | 166 | on_dom_swap:function(){ |
164 | 167 | this.loading_external_data=false |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_vlcEmbed.js |
— | — | @@ -21,9 +21,12 @@ |
22 | 22 | currentTime:0, |
23 | 23 | duration:0, |
24 | 24 | userSlide:false, |
| 25 | + pejs_count:0, //post embed js count |
| 26 | + |
25 | 27 | getEmbedHTML : function(){ |
26 | 28 | //give VLC 150ms to initialize before we start playback |
27 | 29 | //@@todo should be able to do this as an ready event |
| 30 | + this.pejs_count=0; |
28 | 31 | setTimeout('document.getElementById(\''+this.id+'\').postEmbedJS()', 150); |
29 | 32 | return this.getEmbedObj(); |
30 | 33 | }, |
— | — | @@ -70,8 +73,13 @@ |
71 | 74 | } |
72 | 75 | setTimeout('$j(\'#'+this.id+'\').get(0).monitor()',100); |
73 | 76 | }else{ |
74 | | - js_log('vlc not ready'); |
75 | | - setTimeout('document.getElementById(\''+this.id+'\').postEmbedJS()',100); |
| 77 | + js_log('postEmbedJS:vlc not ready'); |
| 78 | + this.pejs_count++; |
| 79 | + if( this.pejs_count < 10 ){ |
| 80 | + setTimeout('document.getElementById(\''+this.id+'\').postEmbedJS()',100); |
| 81 | + }else{ |
| 82 | + js_log('vlc never ready'); |
| 83 | + } |
76 | 84 | } |
77 | 85 | }, |
78 | 86 | doSeek : function(value){ |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/mv_sequence.css |
— | — | @@ -66,14 +66,6 @@ |
67 | 67 | font-family:"verdana","helvetica","arial",sans-serif; |
68 | 68 | font-size:12px; |
69 | 69 | } |
70 | | -.mv_time_clip{ |
71 | | - position:absolute; |
72 | | - z-index:0; |
73 | | - overflow:hidden; |
74 | | - border:solid thin white; |
75 | | - white-space: nowrap; |
76 | | - height:69px; |
77 | | -} |
78 | 70 | .mv_clip_cnt{ |
79 | 71 | position:absolute; |
80 | 72 | width:16px; |
— | — | @@ -103,7 +95,27 @@ |
104 | 96 | .mv_clip_list_result{ |
105 | 97 | padding:10px; |
106 | 98 | } |
107 | | -.mv_tl_thumb{ |
| 99 | +.mv_time_clip{ |
108 | 100 | position:absolute; |
109 | | - top:7px; |
| 101 | + z-index:0; |
| 102 | + overflow:hidden; |
| 103 | + border:solid thin white; |
110 | 104 | } |
| 105 | +.mv_clip_thumb{ |
| 106 | + position:absolute; |
| 107 | + top:7px; |
| 108 | + border:solid thin #BBB; |
| 109 | +} |
| 110 | +.mv_tl_clip{ |
| 111 | + position:absolute; |
| 112 | + z-index:0; |
| 113 | + overflow:hidden; |
| 114 | + border:solid thin white; |
| 115 | + white-space: nowrap; |
| 116 | +} |
| 117 | +.mv_tl_thumb{ |
| 118 | + white-space: nowrap; |
| 119 | +} |
| 120 | +.mv_selected_clip{ |
| 121 | + border:solid thin #9F9; |
| 122 | +} |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -835,7 +835,8 @@ |
836 | 836 | libs:{}, |
837 | 837 | //to keep consistency across threads: |
838 | 838 | ptime:0, |
839 | | - ctime:0, |
| 839 | + ctime:0, |
| 840 | + load_error:false,//load error flag (false by default) |
840 | 841 | |
841 | 842 | load_time:0, |
842 | 843 | callbacks:new Array(), |
— | — | @@ -886,6 +887,7 @@ |
887 | 888 | if(loading){ |
888 | 889 | if( this.load_time++ > 2000){ //time out after ~50seconds |
889 | 890 | js_error( getMsg('error_load_lib') + cur_path); |
| 891 | + this.load_error=true; |
890 | 892 | }else{ |
891 | 893 | setTimeout('mvJsLoader.doLoad()',25); |
892 | 894 | } |
— | — | @@ -2455,7 +2457,8 @@ |
2456 | 2458 | var time_ntp = seconds2ntp ( options.time + parseInt(this.start_offset) ); |
2457 | 2459 | my_thumb_src = getUpdateTimeURL( my_thumb_src, time_ntp, options.size ); |
2458 | 2460 | } |
2459 | | - return '<img class="mv_tl_thumb" src="' + my_thumb_src +'" '+ |
| 2461 | + var thumb_class = (typeof options['thumb_class'] !='undefined')? options['thumb_class'] : ''; |
| 2462 | + return '<img class="' + thumb_class + '" src="' + my_thumb_src +'" '+ |
2460 | 2463 | 'style="height:' + options.height + 'px;' + |
2461 | 2464 | 'width:' + options.width + 'px" >'; |
2462 | 2465 | }, |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_sequencer.js |
— | — | @@ -67,6 +67,9 @@ |
68 | 68 | |
69 | 69 | track_clipThumb_height:80, // how large are the i-movie type clips |
70 | 70 | |
| 71 | + base_adj_duration:.5, //default time to subtract or add when adjusting clips. |
| 72 | + |
| 73 | + |
71 | 74 | //Msg are all the language specific values ... |
72 | 75 | // (@@todo overwrite by msg values preloaded in the page) |
73 | 76 | //tack/clips can be pushed via json or inline playlist format |
— | — | @@ -326,7 +329,7 @@ |
327 | 330 | '<div id="container_track_'+i+'" style="top:'+top_pos+'px;height:'+(track_height+2)+'px;left:0px;right:0px;" class="container_track">' + |
328 | 331 | '</div>' |
329 | 332 | ); |
330 | | - top_pos+=track_height+10; |
| 333 | + top_pos+=track_height+20; |
331 | 334 | } |
332 | 335 | } |
333 | 336 | if( this.timeline_mode=='clip'){ |
— | — | @@ -339,7 +342,7 @@ |
340 | 343 | '<div id="container_track_'+i+'" style="position:absolute;top:'+top_pos+'px;height:'+(track_height+20)+'px;left:10px;right:0px;" class="container_track">' + |
341 | 344 | '</div>' |
342 | 345 | ); |
343 | | - top_pos+=track_height+10; |
| 346 | + top_pos+=track_height+20; |
344 | 347 | } |
345 | 348 | } |
346 | 349 | }, |
— | — | @@ -510,9 +513,9 @@ |
511 | 514 | '</div>' |
512 | 515 | ); |
513 | 516 | rewrite_by_id('chop_clip_' + track_inx + '_' + clip_inx ); |
514 | | - //add in-out setters |
| 517 | + //@@todo add in-out setters |
515 | 518 | |
516 | | - //add start / end hooks |
| 519 | + //@@todo add start / end hooks |
517 | 520 | |
518 | 521 | }, |
519 | 522 | //save new clip segment |
— | — | @@ -555,6 +558,10 @@ |
556 | 559 | //make the adjustments |
557 | 560 | this.makeAdjustment( editObj ); |
558 | 561 | }, |
| 562 | + /* |
| 563 | + * takes adjust ment object with options: |
| 564 | + * track_inx, clip_inx, start, end delta |
| 565 | + */ |
559 | 566 | makeAdjustment:function(e){ |
560 | 567 | switch(e.type){ |
561 | 568 | case 'resize_start': |
— | — | @@ -565,8 +572,8 @@ |
566 | 573 | break; |
567 | 574 | } |
568 | 575 | js_log('re render: '+e.track_inx); |
569 | | - //re-render the video track |
570 | | - this.render_tracks(e.track_inx); |
| 576 | + //refresh the playlist after adjustment |
| 577 | + this.do_refresh_timeline(); |
571 | 578 | }, |
572 | 579 | //@@todo set up key bindings for undo |
573 | 580 | undoEdit:function(){ |
— | — | @@ -650,9 +657,10 @@ |
651 | 658 | 'border:none;'+ |
652 | 659 | 'left:'+clip.left_px+'px;'+ |
653 | 660 | 'height:' + (this.track_clipThumb_height+20) + 'px;' + |
654 | | - 'width:'+(container_width)+'px;" >'; |
| 661 | + 'width:'+(container_width)+'px;" >'; |
655 | 662 | track_html+=clip.embed.renderTimelineThumbnail({ |
656 | 663 | 'width':frame_width, |
| 664 | + 'thumb_class':'mv_clip_thumb', |
657 | 665 | 'height':this.track_clipThumb_height, |
658 | 666 | 'time':0 |
659 | 667 | }); |
— | — | @@ -662,6 +670,12 @@ |
663 | 671 | //render out transition edit box |
664 | 672 | track_html+='<div style="" id="tb_' + base_id + '" class="clip_trans_box"/>'; |
665 | 673 | |
| 674 | + //render out adjustment text |
| 675 | + track_html+='<div id="' + base_id + '_adj' + '" style="font-size:small;color:#6F6;display:none;position:absolute;top:'+ (this.track_clipThumb_height+10 )+'px;>'+ |
| 676 | + '<span onClick="'+this.instance_name+'.adjClipDur(' + track_id + ',' + j + ',\'-\')" /> - </span>'+ |
| 677 | + clip.getDuration() + |
| 678 | + '<span onClick="'+this.instance_name+'.adjClipDur(' + track_id + ',' + j + ',\'+\')" /> + </span>'+ |
| 679 | + '</div>'; |
666 | 680 | track_html+='</span>'; |
667 | 681 | |
668 | 682 | } |
— | — | @@ -669,11 +683,16 @@ |
670 | 684 | if(this.timeline_mode == 'time'){ |
671 | 685 | clip.left_px = Math.round( cur_clip_time/this.timeline_scale); |
672 | 686 | clip.width_px = Math.round( Math.round( clip.getDuration() )/this.timeline_scale); |
673 | | - js_log('at time:' + cur_clip_time + ' left: ' +clip.left_px + ' clip dur: ' + Math.round( clip.getDuration() ) + ' clip wdith:' + clip.width_px); |
| 687 | + js_log('at time:' + cur_clip_time + ' left: ' +clip.left_px + ' clip dur: ' + Math.round( clip.getDuration() ) + ' clip width:' + clip.width_px); |
674 | 688 | |
675 | 689 | //for every clip_width pixle output image |
676 | 690 | if(track.disp_mode=='timeline_thumb'){ |
677 | | - track_html+='<span id="track_'+track_id+'_clip_'+j+'" style="left:'+clip.left_px+'px;width:'+clip.width_px+'px;" class="mv_time_clip mv_clip_drag">'; |
| 691 | + track_html+='<span id="track_'+track_id+'_clip_'+j+'" '+ |
| 692 | + 'class="mv_tl_clip mv_clip_drag" '+ |
| 693 | + 'style="'+ |
| 694 | + 'left:' + clip.left_px + 'px;'+ |
| 695 | + 'width:'+ clip.width_px + 'px;'+ |
| 696 | + 'height:'+ clip.height_px + 'px" >'; |
678 | 697 | track_html+= this.render_clip_frames( clip ); |
679 | 698 | }else if(track.disp_mode=='text'){ |
680 | 699 | //'+left_px+ |
— | — | @@ -705,6 +724,20 @@ |
706 | 725 | $j(this).removeClass("clip_edit_over").addClass("clip_edit_base"); |
707 | 726 | }); |
708 | 727 | |
| 728 | + //apply onClick edit controls: |
| 729 | + $j('.mv_clip_thumb').click(function(){ |
| 730 | + if( $j(this).hasClass("mv_selected_clip") ){ |
| 731 | + $j(this).removeClass("mv_selected_clip") |
| 732 | + $j('#' + $j(this).parent().attr("id") + '_adj').fadeOut("fast"); |
| 733 | + }else{ |
| 734 | + $j(this).addClass('mv_selected_clip'); |
| 735 | + $j('#' + $j(this).parent().attr("id") + '_adj').fadeIn("fast"); |
| 736 | + } |
| 737 | + }); |
| 738 | + //set up key binding "escape" and drag to deselect |
| 739 | + |
| 740 | + |
| 741 | + |
709 | 742 | //add in control for time based display |
710 | 743 | //debugger; |
711 | 744 | if(this.timeline_mode == 'time'){ |
— | — | @@ -853,6 +886,7 @@ |
854 | 887 | js_log('rendering clip frames: p:' +p+' '+ (p*this.timeline_scale)+' ' + clip_time); |
855 | 888 | clip_frames_html+=clip.embed.renderTimelineThumbnail({ |
856 | 889 | 'width': frame_width, |
| 890 | + 'thumb_class':'mv_tl_thumb', |
857 | 891 | 'height': this.track_thumb_height, |
858 | 892 | 'size' : "icon", //set size to "icon" preset |
859 | 893 | 'time': clip_time |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_playlist.js |
— | — | @@ -221,7 +221,8 @@ |
222 | 222 | this.doWhenClipLoadDone(); |
223 | 223 | }else{ |
224 | 224 | js_log("only "+ _this.clip_ready_count +" clips done, scheduling callback:"); |
225 | | - setTimeout('document.getElementById(\''+this.id+'\').doWhenParseDone()', 250); |
| 225 | + if( !mvJsLoader.load_error ) //re-issue request if no load error: |
| 226 | + setTimeout('document.getElementById(\''+this.id+'\').doWhenParseDone()', 250); |
226 | 227 | } |
227 | 228 | }, |
228 | 229 | doWhenClipLoadDone:function(){ |
— | — | @@ -787,8 +788,7 @@ |
788 | 789 | if(clipObj.order==0){ |
789 | 790 | if(!this.cur_clip)this.cur_clip=clipObj; |
790 | 791 | } |
791 | | - this.default_track.addClip(clipObj, pos); |
792 | | - |
| 792 | + this.default_track.addClip(clipObj, pos); |
793 | 793 | }, |
794 | 794 | swapClipDesc: function(req_clipID, callback){ |
795 | 795 | //hide all but the requested |
— | — | @@ -923,7 +923,7 @@ |
924 | 924 | |
925 | 925 | }, |
926 | 926 | doAdjust:function(side, delta){ |
927 | | - js_log("f:doAdjust: "+side+ ' , ' + delta); |
| 927 | + js_log("f:doAdjust: " + side + ' , ' + delta); |
928 | 928 | if(this.embed){ |
929 | 929 | if(side=='start'){ |
930 | 930 | var start_offset =parseInt(this.embed.start_offset)+parseInt(delta*-1); |
— | — | @@ -932,6 +932,8 @@ |
933 | 933 | var end_offset = parseInt(this.embed.start_offset) + parseInt( this.embed.getDuration() ) + parseInt(delta); |
934 | 934 | this.embed.updateVideoTime( seconds2ntp(this.embed.start_offset), seconds2ntp(end_offset) ); |
935 | 935 | } |
| 936 | + //update everything: |
| 937 | + this.pp.refresh |
936 | 938 | /*var base_src = this.src.substr(0,this.src.indexOf('?')); |
937 | 939 | js_log("delta:"+ delta); |
938 | 940 | if(side=='start'){ |