Index: trunk/extensions/MetavidWiki/skins/mv_stream.js |
— | — | @@ -292,7 +292,7 @@ |
293 | 293 | //js_log('vid elm is playing delay restore:') |
294 | 294 | if(!vid_elm.userSlide){ //dont' restore if userSlide is true |
295 | 295 | if( ! this.monitorTimerId ){ |
296 | | - this.monitorTimerId = setInterval('mv_stream_interface.doRestore()', 250); |
| 296 | + // this.monitorTimerId = setInterval('mv_stream_interface.doRestore()', 250); |
297 | 297 | } |
298 | 298 | } |
299 | 299 | }else{ |
— | — | @@ -395,6 +395,8 @@ |
396 | 396 | return ; |
397 | 397 | } |
398 | 398 | mv_open_edit_mvd=mvd_type; |
| 399 | + $j('#embed_vid').get(0).preview_mode=true;//turn on clip preivew mode: |
| 400 | + |
399 | 401 | sajax_request_type='GET'; |
400 | 402 | sajax_do_call( "mv_add_disp",[wgTitle, mvd_type, org_vid_time_req], f ); |
401 | 403 | //insert before the first mvd: |
— | — | @@ -492,7 +494,9 @@ |
493 | 495 | } |
494 | 496 | //free the editor slot: |
495 | 497 | js_log('mv_disp_mvd: nset mv_open_edit_mvd'); |
496 | | - mv_open_edit_mvd=null; |
| 498 | + mv_open_edit_mvd=null; |
| 499 | + $j('#embed_vid').get(0).preview_mode=false;//turn off clip preivew mode: |
| 500 | + |
497 | 501 | function f( request ) { |
498 | 502 | result= request.responseText; |
499 | 503 | if (request.status != 200) result= "<div class='error'> " + request.status + " " + request.statusText + ": " + result + "</div>"; |
— | — | @@ -529,12 +533,11 @@ |
530 | 534 | }*/ |
531 | 535 | |
532 | 536 | /* non-ajax preview of clip adjustment*/ |
533 | | -function mv_adjust_preview(mvd_id){ |
534 | | - |
535 | | - |
| 537 | +function mv_adjust_preview(mvd_id){ |
536 | 538 | js_log('start val:#mv_start_hr_'+mvd_id+' ' + $j('#mv_start_hr_'+mvd_id).val() + ' end:'+ $j('#mv_end_hr_'+mvd_id).val() ); |
537 | | - |
| 539 | + $j('#embed_vid').get(0).hideHighlight(); |
538 | 540 | $j('#embed_vid').get(0).stop(); |
| 541 | + $j('#embed_vid').get(0).preview_mode=true; |
539 | 542 | mv_lock_vid_updates=false; |
540 | 543 | do_video_time_update($j('#mv_start_hr_'+mvd_id).val(), $j('#mv_end_hr_'+mvd_id).val() ); |
541 | 544 | mv_lock_vid_updates=true; |
— | — | @@ -764,7 +767,7 @@ |
765 | 768 | //do edit action specific calls: |
766 | 769 | switch(edit_action){ |
767 | 770 | case 'save': |
768 | | - var setHtmlId ='#mv_fcontent_'+mvd_id; |
| 771 | + var setHtmlId ='#mv_fcontent_'+mvd_id; |
769 | 772 | break; |
770 | 773 | case 'preview': |
771 | 774 | mv_lock_vid_updates=true; |
— | — | @@ -863,6 +866,7 @@ |
864 | 867 | mv_lock_vid_updates=false; |
865 | 868 | //free the editor slot: |
866 | 869 | mv_open_edit_mvd=null; |
| 870 | + $j('#embed_vid').get(0).preview_mode=false;//turn off clip preivew mode: |
867 | 871 | } |
868 | 872 | } |
869 | 873 | //return false to prevent the form being submitted |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_timed_text.php |
— | — | @@ -11,21 +11,21 @@ |
12 | 12 | <?php |
13 | 13 | run_examples(); |
14 | 14 | function run_examples(){ |
15 | | - |
| 15 | +$examples = Array(); |
16 | 16 | //set up tags for easy display: |
17 | 17 | $roe_url = 'http://metavid.org/w/index.php?title=Special:MvExportStream&stream_name=House_proceeding_07-18-06_00&t=1:23:16/1:23:44&feed_format=roe'; |
18 | 18 | $examples[] = array( 'tag' => '<video roe="'.$roe_url.'" ></video>', |
19 | 19 | 'desc' => 'Metavid based ROE file using CMML<br> ' . |
20 | 20 | '<iframe width="500" height="300" src="'.$roe_url.'" ></iframe>' |
21 | 21 | ); |
22 | | - |
| 22 | +$examples = Array(); |
23 | 23 | $srt_tag = ''. |
24 | | -'<video src="sample_fish.ogg" poster="sample_fish.jpg"> |
| 24 | +'<video src="sample_fish.ogg" poster="sample_fish.jpg" duration="26"> |
25 | 25 | <text category="SUB" lang="en" type="text/x-srt" default="true" |
26 | | - src="sample_fish_text_en.srt"> |
| 26 | + title="english SRT subtitles" src="sample_fish_text_en.srt"> |
27 | 27 | </text> |
28 | 28 | <text category="SUB" lang="es" type="text/x-srt" |
29 | | - src="sample_fish_text_es.srt"> |
| 29 | + title="spanish SRT subtitles" src="sample_fish_text_es.srt"> |
30 | 30 | </text> |
31 | 31 | </video>'; |
32 | 32 | $examples[] = array( 'tag' => $srt_tag, |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/timedTextLibs/mv_timed_text.js |
— | — | @@ -9,53 +9,57 @@ |
10 | 10 | default_time_range: "source", //by default just use the source don't get a time-range |
11 | 11 | transcript_set:null, |
12 | 12 | autoscroll:true, |
13 | | - scrollTimerId:0, |
14 | | - availableTracks:{}, |
| 13 | + scrollTimerId:0, |
15 | 14 | init:function( parentEmbed ){ |
| 15 | + //init a new availableTracks obj: |
| 16 | + this.availableTracks={}; |
16 | 17 | //set the parent embed object: |
17 | 18 | this.pe=parentEmbed; |
18 | 19 | //parse roe if not already done: |
19 | | - this.getTimedTextTracks(); |
| 20 | + this.getTimedTextTracks(); |
20 | 21 | }, |
21 | 22 | //@@todo separate out data loader & data display |
22 | 23 | getTimedTextTracks:function(){ |
23 | 24 | js_log("load timed text from roe: "+ this.pe.roe); |
24 | | - |
| 25 | + var _this = this; |
25 | 26 | //if roe not yet loaded do load it: |
26 | 27 | if(this.pe.roe){ |
27 | 28 | if(!this.pe.media_element.addedROEData){ |
28 | 29 | js_log("load roe data!"); |
29 | | - var _this = this; |
| 30 | + $j('#mv_txt_load_'+_this.pe.id).show(); //show the loading icon |
30 | 31 | do_request(this.pe.roe, function(data) |
31 | 32 | { |
32 | 33 | //continue |
33 | 34 | _this.pe.media_element.addROE(data); |
34 | | - _this.getParseCMML_rowReady(); |
| 35 | + _this.getParseTimedText_rowReady(); |
35 | 36 | }); |
36 | 37 | }else{ |
37 | 38 | js_log('row data ready (no roe request)'); |
38 | | - this.getParseTimedText_rowReady(); |
| 39 | + _this.getParseTimedText_rowReady(); |
39 | 40 | } |
40 | 41 | }else{ |
41 | 42 | if( this.pe.media_element.timedTextSources() ){ |
42 | | - this.getParseTimedText_rowReady(); |
| 43 | + _this.getParseTimedText_rowReady(); |
43 | 44 | }else{ |
44 | 45 | js_log('no roe data or timed text sources'); |
45 | 46 | } |
46 | 47 | } |
47 | 48 | }, |
48 | 49 | getParseTimedText_rowReady: function (){ |
49 | | - _this = this; |
| 50 | + var _this = this; |
50 | 51 | //create timedTextObj |
51 | | - var default_found=false; |
| 52 | + var default_found=false; |
| 53 | + js_log("mv_txt_load_:SHOW mv_txt_load_"); |
52 | 54 | $j('#mv_txt_load_'+_this.pe.id).show(); //show the loading icon |
53 | 55 | |
54 | 56 | $j.each( this.pe.media_element.sources, function(inx, source){ |
55 | | - if( typeof source.id == 'undefined' ) |
| 57 | + |
| 58 | + if( typeof source.id == 'undefined' || source.id == null ) |
56 | 59 | source.id = 'tt_' + inx; |
57 | 60 | var tObj = new timedTextObj( source ); |
58 | 61 | //make sure its a valid timed text format (we have not loaded or parsed yet) : ( |
59 | 62 | if( tObj.lib != null ){ |
| 63 | + js_log('adding Track: ' + source.id + ' to ' + _this.pe.id); |
60 | 64 | _this.availableTracks[ source.id ] = tObj; |
61 | 65 | //debugger; |
62 | 66 | js_log( 'is : ' + source.id + ' default: ' + source.default ); |
— | — | @@ -73,7 +77,7 @@ |
74 | 78 | }); |
75 | 79 | //no default clip found take the first_id |
76 | 80 | if(!default_found) |
77 | | - $j.each( _this.availableTracks, function(inx, sourceTrack){ |
| 81 | + $j.each( _this.availableTracks, function(inx, sourceTrack){ |
78 | 82 | _this.loadAndDisplay( sourceTrack.id ); |
79 | 83 | default_found=true; |
80 | 84 | //retun after loading first available |
— | — | @@ -87,8 +91,8 @@ |
88 | 92 | }, |
89 | 93 | loadAndDisplay: function ( track_id){ |
90 | 94 | var _this = this; |
| 95 | + $j('#mv_txt_load_'+_this.pe.id).show();//show the loading icon |
91 | 96 | _this.availableTracks[ track_id ].load(_this.default_time_range, function(){ |
92 | | - //hide the loading icon |
93 | 97 | $j('#mv_txt_load_'+_this.pe.id).hide(); |
94 | 98 | _this.addTrack( track_id ); |
95 | 99 | }); |
— | — | @@ -100,23 +104,27 @@ |
101 | 105 | _this.availableTracks[ track_id ].display=true; |
102 | 106 | //setup the layout: |
103 | 107 | this.setup_layout(); |
| 108 | + js_log("SHOULD ADD: "+ track_id + ' count:' + _this.availableTracks[ track_id ].textNodes.length); |
104 | 109 | $j.each(_this.availableTracks[ track_id ].textNodes, function(inx, text_clip){ |
105 | 110 | _this.add_merge_text_clip( text_clip ); |
106 | 111 | }); |
107 | 112 | }, |
108 | | - add_merge_text_clip:function(text_clip){ |
| 113 | + add_merge_text_clip: function(text_clip){ |
| 114 | + var _this = this; |
109 | 115 | //make sure the clip does not already exist: |
110 | 116 | if($j('#tc_'+text_clip.id).length==0){ |
111 | 117 | var inserted = false; |
112 | | - var text_clip_start_time = ntp2seconds(text_clip.start); |
| 118 | + var text_clip_start_time = ntp2seconds( text_clip.start ); |
| 119 | + |
113 | 120 | var insertHTML = '<div style="border:solid thin black;" id="tc_'+text_clip.id+'" ' + |
114 | | - 'start="'+text_clip.start+'" end="'+text_clip.end+'" class="mvtt '+text_clip.type_id+'">' + |
115 | | - '<div style="top:0px;left:0px;right:0px;height:20px;font-size:small">'+ |
| 121 | + 'start="'+text_clip.start+'" end="'+text_clip.end+'" class="mvtt tt_'+text_clip.type_id+'">' + |
| 122 | + '<div class="mvttseek" style="top:0px;left:0px;right:0px;height:20px;font-size:small">'+ |
116 | 123 | '<img style="display:inline;" src="'+mv_embed_path+'/images/control_play_blue.png">'+ |
117 | 124 | text_clip.start + ' to ' +text_clip.end+ |
118 | 125 | '</div>'+ |
119 | 126 | text_clip.body + |
120 | 127 | '</div>'; |
| 128 | + //js_log("ADDING CLIP: " + text_clip_start_time + ' html: ' + insertHTML); |
121 | 129 | $j('#mmbody_'+this.pe.id +' .mvtt').each(function(){ |
122 | 130 | if(!inserted){ |
123 | 131 | //js_log( ntp2seconds($j(this).attr('start')) + ' > ' + text_clip_start_time); |
— | — | @@ -125,11 +133,32 @@ |
126 | 134 | $j(this).before(insertHTML); |
127 | 135 | } |
128 | 136 | } |
129 | | - }); |
130 | | - //js_log('should just append: '+insertHTML); |
| 137 | + }); |
| 138 | + //js_log('should just add to end: '+insertHTML); |
131 | 139 | if(!inserted){ |
132 | 140 | $j('#mmbody_'+this.pe.id ).append(insertHTML); |
133 | 141 | } |
| 142 | + |
| 143 | + //apply the mouse over transcript seek/click functions: |
| 144 | + $j(".mvttseek").click( function() { |
| 145 | + _this.pe.play(); |
| 146 | + }); |
| 147 | + $j(".mvttseek").hover( |
| 148 | + function () { |
| 149 | + js_log('mvttseek: over'); |
| 150 | + $j(this).parent().addClass('tt_highlight'); |
| 151 | + //do section highlight |
| 152 | + _this.pe.highlightPlaySection( { |
| 153 | + 'start' : $j(this).parent().attr("start"), |
| 154 | + 'end' : $j(this).parent().attr("end") |
| 155 | + }); |
| 156 | + }, |
| 157 | + function () { |
| 158 | + $j(this).parent().removeClass('tt_highlight'); |
| 159 | + //de highlight section |
| 160 | + _this.pe.hideHighlight(); |
| 161 | + } |
| 162 | + ); |
134 | 163 | } |
135 | 164 | }, |
136 | 165 | setup_layout:function(){ |
— | — | @@ -161,29 +190,28 @@ |
162 | 191 | 'style="position:absolute;top:20px;left:0px;' + |
163 | 192 | 'right:0px;bottom:0px;' + |
164 | 193 | 'height:'+(this.pe.height-20)+ |
165 | | - 'px;overflow:auto;"><span id="mv_txt_load_' + this.pe.id + '">'+ |
| 194 | + 'px;overflow:auto;"><span style="display:none;" id="mv_txt_load_' + this.pe.id + '">'+ |
166 | 195 | getMsg('loading_txt')+'</span>' + |
167 | 196 | '</div>'; |
168 | 197 | }, |
169 | 198 | getTsSelect:function(){ |
170 | 199 | var _this = this; |
171 | | - js_log('getTsSelect'); |
172 | | - //check if menu already present |
| 200 | + js_log('getTsSelect'); |
173 | 201 | var selHTML = '<div id="mvtsel_' + this.pe.id + '" style="position:absolute;background:#FFF;top:20px;left:0px;right:0px;bottom:0px;overflow:auto;">'; |
174 | 202 | selHTML+='<b>' + getMsg('select_transcript_set') + '</b><ul>'; |
175 | | - for(var i in _this.availableTracks){ //for in loop ok on object |
176 | | - var checked = (_this.availableTracks[i].display)?'checked':''; |
| 203 | + //debugger; |
| 204 | + for(var i in _this.availableTracks){ //for in loop ok on object |
| 205 | + var checked = ( _this.availableTracks[i].display ) ? 'checked' : ''; |
177 | 206 | selHTML+='<li><input name="'+i+'" class="mvTsSelect" type="checkbox" ' + checked + '>'+ |
178 | 207 | _this.availableTracks[i].getTitle() + '</li>'; |
179 | 208 | } |
180 | 209 | selHTML+='</ul>' + |
181 | 210 | '<a href="#" onClick="document.getElementById(\'' + this.pe.id + '\').textInterface.applyTsSelect();return false;">'+getMsg('close')+'</a>'+ |
182 | | - '</div>'; |
| 211 | + '</div>'; |
183 | 212 | $j('#metaBox_'+_this.pe.id).append( selHTML ); |
184 | 213 | }, |
185 | 214 | applyTsSelect:function(){ |
186 | | - var _this = this; |
187 | | - |
| 215 | + var _this = this; |
188 | 216 | //update availableTracks |
189 | 217 | $j('#mvtsel_'+this.pe.id+' .mvTsSelect').each(function(){ |
190 | 218 | if(this.checked){ |
— | — | @@ -193,12 +221,14 @@ |
194 | 222 | _this.loadAndDisplay( track_id); |
195 | 223 | }else{ |
196 | 224 | _this.availableTracks[this.name].display=true; |
197 | | - $j('#mmbody_'+_this.pe.id +' .'+this.name ).fadeIn("fast"); |
| 225 | + //display the named class: |
| 226 | + $j('#mmbody_'+_this.pe.id +' .tt_'+this.name ).fadeIn("fast"); |
198 | 227 | } |
199 | 228 | }else{ |
200 | 229 | if(_this.availableTracks[this.name].display){ |
201 | 230 | _this.availableTracks[this.name].display=false; |
202 | | - $j('#mmbody_'+_this.pe.id +' .'+this.name ).fadeOut("fast"); |
| 231 | + //hide unchecked |
| 232 | + $j('#mmbody_'+_this.pe.id +' .tt_'+this.name ).fadeOut("fast"); |
203 | 233 | } |
204 | 234 | } |
205 | 235 | }); |
— | — | @@ -271,7 +301,8 @@ |
272 | 302 | * @@todo allow loading from external lib set |
273 | 303 | */ |
274 | 304 | var timedTextObj = function( source ){ |
275 | | - //@@todo in the future we could support timed text in oggs if they can be accessed via javascript |
| 305 | + //@@todo in the future we could support timed text in oggs if they can be accessed via javascript |
| 306 | + //we should be able to do a HEAD request to see if we can read transcripts from the file. |
276 | 307 | switch( source.mime_type ){ |
277 | 308 | case 'text/cmml': |
278 | 309 | this.lib = 'CMML'; |
— | — | @@ -319,7 +350,7 @@ |
320 | 351 | var _this = this; |
321 | 352 | js_log('textCMML: loading track: '+ this.src); |
322 | 353 | |
323 | | - //:: Load transcript range :: (currently disabled) |
| 354 | + //:: Load transcript range :: |
324 | 355 | |
325 | 356 | var pcurl = parseUri( _this.getSRC() ); |
326 | 357 | var req_time = pcurl.queryKey['t'].split('/'); |
— | — | @@ -394,8 +425,8 @@ |
395 | 426 | var text_clip = { |
396 | 427 | "start": i, |
397 | 428 | "end": o, |
398 | | - "type_id": _this.id, |
399 | | - "id": n, |
| 429 | + "type_id": this.id, |
| 430 | + "id": this.id + '_' + n, |
400 | 431 | "body": t |
401 | 432 | } |
402 | 433 | this.textNodes.push( text_clip ); |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_nativeEmbed.js |
— | — | @@ -25,6 +25,7 @@ |
26 | 26 | //we want to let mv_embed handle the controls so notice the absence of control attribute |
27 | 27 | // controls=false results in controls being displayed: |
28 | 28 | //http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2008-August/016159.html |
| 29 | + js_log("play url:" + this.getURI( this.seek_time_sec )); |
29 | 30 | return '<video ' + |
30 | 31 | 'id="'+this.pid + '" ' + |
31 | 32 | 'style="width:'+this.width+'px;height:'+this.height+'px;" ' + |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_vlcEmbed.js |
— | — | @@ -221,10 +221,10 @@ |
222 | 222 | if( this.duration > 0 || this.vlc.input.time > 0){ |
223 | 223 | this.start_offset=this.media_element.selected_source.start_offset; |
224 | 224 | |
225 | | - //if we have media duration procceed |
| 225 | + //if we have media duration proceed |
226 | 226 | if(this.duration){ |
227 | 227 | //as long as the user is not interacting with the playhead update: |
228 | | - if(! this.userSlide){ |
| 228 | + if(! this.userSlide){ |
229 | 229 | //slider pos is not accurate with flash: |
230 | 230 | if(this.vlc.input.position!=0 && this.media_element.selected_source.mime_type!='video/x-flv'){ |
231 | 231 | /*js_log(' set slider via input.position: ' + |
— | — | @@ -238,7 +238,7 @@ |
239 | 239 | ' ='+ ((this.vlc.input.time/1000)-this.start_offset)/this.duration ); |
240 | 240 | */ |
241 | 241 | this.setSliderValue( ((this.vlc.input.time/1000) -this.start_offset) / this.duration); |
242 | | - } |
| 242 | + } |
243 | 243 | //js_log('set status: '+ seconds2ntp(this.currentTime) + ' e:'+seconds2ntp(this.duration+this.start_offset)); |
244 | 244 | this.setStatus(seconds2ntp(this.currentTime) + '/' + seconds2ntp(this.duration+this.start_offset) ); |
245 | 245 | } |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/styles.css |
— | — | @@ -286,7 +286,13 @@ |
287 | 287 | margin: -13px 0 0 0px; |
288 | 288 | cursor: pointer; |
289 | 289 | } |
290 | | - |
| 290 | +.tt_highlight{ |
| 291 | + border: solid thin blue; |
| 292 | + background: #CCC; |
| 293 | +} |
| 294 | +.mvttseek{ |
| 295 | + cursor:pointer; |
| 296 | +} |
291 | 297 | .large_play_button { |
292 | 298 | background: url(images/player_big_play_button.png) 0 0 no-repeat; |
293 | 299 | display:block; |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -160,10 +160,10 @@ |
161 | 161 | "paused":true, |
162 | 162 | "readyState":0, //http://www.whatwg.org/specs/web-apps/current-work/#readystate |
163 | 163 | "currentTime":0, //current playback position (should be updated by plugin) |
164 | | - "duration":NaN, //media duration (read from file or the temporal url) |
| 164 | + "duration":null, //media duration (read from file or the temporal url) |
165 | 165 | |
166 | 166 | //custom attributes for mv_embed: |
167 | | - "play_button":true, |
| 167 | + "play_button":true, |
168 | 168 | "thumbnail":null, |
169 | 169 | "linkback":null, |
170 | 170 | "embed_link":true, |
— | — | @@ -1649,6 +1649,7 @@ |
1650 | 1650 | embedVideo.prototype = { |
1651 | 1651 | /** The mediaElement object containing all mediaSource objects */ |
1652 | 1652 | media_element:null, |
| 1653 | + preview_mode:false, |
1653 | 1654 | slider:null, |
1654 | 1655 | ready_to_play:false, //should use html5 ready state |
1655 | 1656 | load_error:false, //used to set error in case of error |
— | — | @@ -1708,8 +1709,12 @@ |
1709 | 1710 | this[attr]=default_video_attributes[attr]; |
1710 | 1711 | //js_log('attr:' + attr + ' val: ' + video_attributes[attr] +" "+ 'elm_val:' + element.getAttribute(attr) + "\n (set by attr)"); |
1711 | 1712 | } |
1712 | | - } |
1713 | | - //js_log("ROE SET: "+ this.roe); |
| 1713 | + } |
| 1714 | + if( this.duration!=null && this.duration.split(':').length >= 2) |
| 1715 | + this.duration = ntp2seconds( this.duration ); |
| 1716 | + |
| 1717 | + js_log("DD:Init:Duration set:: "+ this.duration); |
| 1718 | + |
1714 | 1719 | //if style is set override width and height |
1715 | 1720 | var dwh = mv_default_video_size.split('x'); |
1716 | 1721 | this.width = element.style.width ? element.style.width : dwh[0]; |
— | — | @@ -1722,7 +1727,7 @@ |
1723 | 1728 | if(element.innerHTML!='' && element.getElementsByTagName('source').length==0){ |
1724 | 1729 | js_log('innerHTML: ' + element.innerHTML); |
1725 | 1730 | this.user_missing_plugin_html=element.innerHTML; |
1726 | | - } |
| 1731 | + } |
1727 | 1732 | // load all of the specified sources |
1728 | 1733 | this.media_element = new mediaElement(element); |
1729 | 1734 | }, |
— | — | @@ -1841,8 +1846,8 @@ |
1842 | 1847 | } |
1843 | 1848 | }, |
1844 | 1849 | getTimeReq:function(){ |
1845 | | - js_log('f:getTimeReq'); |
1846 | | - var default_time_req = '0:00:00/0:00:00'; |
| 1850 | + js_log('f:getTimeReq:'+ this.getDurationNTP()); |
| 1851 | + var default_time_req = '0:00:00/' + this.getDurationNTP() ; |
1847 | 1852 | if(!this.media_element) |
1848 | 1853 | return default_time_req; |
1849 | 1854 | if(!this.media_element.selected_source) |
— | — | @@ -1851,12 +1856,13 @@ |
1852 | 1857 | return default_time_req; |
1853 | 1858 | return this.media_element.selected_source.start_ntp+'/'+this.media_element.selected_source.end_ntp; |
1854 | 1859 | }, |
1855 | | - getDuration:function(){ |
1856 | | - //update some local pointers for the selected source: |
1857 | | - this.duration = this.media_element.selected_source.duration; |
| 1860 | + getDuration:function(){ |
| 1861 | + //update some local pointers for the selected source: |
| 1862 | + if( this.media_element.selected_source.duration != 0 ) |
| 1863 | + this.duration = this.media_element.selected_source.duration; |
1858 | 1864 | this.start_offset = this.media_element.selected_source.start_offset; |
1859 | 1865 | this.start_ntp = this.media_element.selected_source.start_ntp; |
1860 | | - this.end_ntp = this.media_element.selected_source.end_ntp; |
| 1866 | + this.end_ntp = this.media_element.selected_source.end_ntp; |
1861 | 1867 | //return the duration |
1862 | 1868 | return this.duration; |
1863 | 1869 | }, |
— | — | @@ -1934,6 +1940,10 @@ |
1935 | 1941 | } |
1936 | 1942 | this.onClipDone_disp=true; |
1937 | 1943 | this.thumbnail_disp=true; |
| 1944 | + //make sure we are not in preview mode( no end clip actions in preview mode) |
| 1945 | + if( this.preview_mode ) |
| 1946 | + return ; |
| 1947 | + |
1938 | 1948 | $j('#img_thumb_'+this.id).css('zindex',1); |
1939 | 1949 | $j('#big_play_link_'+this.id).hide(); |
1940 | 1950 | //add the liks_info_div black back |
— | — | @@ -1966,7 +1976,7 @@ |
1967 | 1977 | } |
1968 | 1978 | } |
1969 | 1979 | ) |
1970 | | - //now load roe if nessesaryand showNextPrevLinks |
| 1980 | + //now load roe if run the showNextPrevLinks |
1971 | 1981 | if(this.roe && this.media_element.addedROEData==false){ |
1972 | 1982 | do_request(this.roe, function(data) |
1973 | 1983 | { |
— | — | @@ -2422,9 +2432,14 @@ |
2423 | 2433 | mvJsLoader.doLoad({ |
2424 | 2434 | 'textInterface':'timedTextLibs/mv_timed_text.js' |
2425 | 2435 | }, function(){ |
2426 | | - _this.textInterface = new textInterface( _this ); |
| 2436 | + |
| 2437 | + _this.textInterface = new textInterface( _this ); |
2427 | 2438 | //show interface |
2428 | 2439 | _this.textInterface.show(); |
| 2440 | + js_log("NEW TEXT INTERFACE"); |
| 2441 | + for(var i in _this.textInterface.availableTracks){ |
| 2442 | + js_log("tracks in new interface: "+_this.id+ ' tid:' + i); |
| 2443 | + } |
2429 | 2444 | } |
2430 | 2445 | ); |
2431 | 2446 | }else{ |
— | — | @@ -2724,6 +2739,12 @@ |
2725 | 2740 | } |
2726 | 2741 | return null; |
2727 | 2742 | }, |
| 2743 | + /* |
| 2744 | + * returns the selected source url for players to play |
| 2745 | + */ |
| 2746 | + getURI : function(seek_time_sec){ |
| 2747 | + return this.media_element.selected_source.getURI( this.seek_time_sec ); |
| 2748 | + }, |
2728 | 2749 | setSliderValue: function(perc, hide_progress){ |
2729 | 2750 | |
2730 | 2751 | //js_log('setSliderValue:'+perc+' ct:'+ this.currentTime); |
— | — | @@ -2740,6 +2761,9 @@ |
2741 | 2762 | //update the playback progress bar |
2742 | 2763 | if( ! hide_progress ){ |
2743 | 2764 | $j('#mv_seeker_' + this_id + ' .mv_playback').css("width", Math.round( val + (this.mv_seeker_width*.5) ) + 'px' ); |
| 2765 | + }else{ |
| 2766 | + //hide the progress bar |
| 2767 | + $j('#mv_seeker_' + this_id + ' .mv_playback').css("width", "0px"); |
2744 | 2768 | } |
2745 | 2769 | |
2746 | 2770 | //update the buffer progress bar (if available ) |
— | — | @@ -2756,21 +2780,23 @@ |
2757 | 2781 | //js_log('op:' + offset_perc + ' *('+perc+' * ' + $j('#slider_'+id).width() + ')'); |
2758 | 2782 | }, |
2759 | 2783 | highlightPlaySection:function(options){ |
2760 | | - js_log('highlightPlaySection'); |
2761 | | - |
| 2784 | + js_log('highlightPlaySection'); |
2762 | 2785 | var this_id = (this.pc)?this.pc.pp.id:this.id; |
2763 | 2786 | var dur = this.getDuration(); |
2764 | 2787 | var hide_progress = true; |
2765 | 2788 | //set the left percet and update the slider: |
2766 | 2789 | rel_start_sec = ( ntp2seconds( options['start']) - this.start_offset ); |
2767 | | - if( rel_start_sec < 0 ){ |
2768 | | - left_perc =0; |
2769 | | - |
| 2790 | + |
| 2791 | + if( rel_start_sec <= 0 ){ |
| 2792 | + left_perc =0; |
| 2793 | + options['start'] = seconds2ntp( this.start_offset ); |
| 2794 | + rel_start_sec=0; |
2770 | 2795 | this.setSliderValue( 0 , hide_progress); |
2771 | 2796 | }else{ |
2772 | 2797 | left_perc = parseInt( (rel_start_sec / dur)*100 ) ; |
2773 | 2798 | this.setSliderValue( (left_perc / 100) , hide_progress); |
2774 | 2799 | } |
| 2800 | + |
2775 | 2801 | width_perc = parseInt( (( ntp2seconds( options['end'] ) - ntp2seconds( options['start'] ) ) / dur)*100 ) ; |
2776 | 2802 | if( (width_perc + left_perc) > 100 ){ |
2777 | 2803 | width_perc = 100 - left_perc; |
— | — | @@ -2780,14 +2806,19 @@ |
2781 | 2807 | 'left':left_perc+'%', |
2782 | 2808 | 'width':width_perc+'%', |
2783 | 2809 | }).show(); |
| 2810 | + |
2784 | 2811 | this.jump_time = options['start']; |
2785 | | - this.seek_time_sec = ntp2seconds( options['start']); |
2786 | | - this.setStatus( getMsg('seek_to')+' '+this.jump_time ); |
2787 | | - this.updateThumbTime( ntp2seconds( this.jump_time ) ); |
| 2812 | + this.seek_time_sec = ntp2seconds( options['start']); |
| 2813 | + //trim output to |
| 2814 | + this.setStatus( getMsg('seek_to')+' '+ seconds2ntp( this.seek_time_sec ) ); |
| 2815 | + js_log('DO update: ' + this.jump_time); |
| 2816 | + this.updateThumbTime( rel_start_sec ); |
2788 | 2817 | }, |
2789 | 2818 | hideHighlight:function(){ |
2790 | 2819 | var this_id = (this.pc)?this.pc.pp.id:this.id; |
2791 | 2820 | $j('#mv_seeker_' + this_id + ' .mv_highlight').hide(); |
| 2821 | + this.setStatus( this.getTimeReq() ); |
| 2822 | + this.setSliderValue( 0 ); |
2792 | 2823 | }, |
2793 | 2824 | setStatus:function(value){ |
2794 | 2825 | var id = (this.pc)?this.pc.pp.id:this.id; |
— | — | @@ -2832,7 +2863,7 @@ |
2833 | 2864 | return hours+":"+minutes+":"+seconds; |
2834 | 2865 | } |
2835 | 2866 | /* |
2836 | | - * takes hh:mm:ss input returns number of seconds |
| 2867 | + * takes hh:mm:ss,ms or hh:mm:ss.ms input returns number of seconds |
2837 | 2868 | */ |
2838 | 2869 | function ntp2seconds(ntp){ |
2839 | 2870 | if(!ntp){ |
— | — | @@ -2843,6 +2874,8 @@ |
2844 | 2875 | if(times.length!=3){ |
2845 | 2876 | return js_log('ntp2seconds:not valid ntp:'+ntp); |
2846 | 2877 | } |
| 2878 | + //sometimes the comma is used inplace of pereid for ms |
| 2879 | + times[2] = times[2].replace(/,\s?/,'.'); |
2847 | 2880 | //return seconds float (ie take seconds float value if present): |
2848 | 2881 | return parseInt(times[0]*3600)+parseInt(times[1]*60)+parseFloat(times[2]); |
2849 | 2882 | } |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_playlist.js |
— | — | @@ -474,6 +474,7 @@ |
475 | 475 | setSliderValue:function(value){ |
476 | 476 | //js_log('calling original embed slider with val: '+value); |
477 | 477 | this.cur_clip.embed.pe_setSliderValue( value ); |
| 478 | + //call seq playline update here |
478 | 479 | }, |
479 | 480 | getSeqThumb: function(){ |
480 | 481 | //for each clip |
— | — | @@ -545,7 +546,7 @@ |
546 | 547 | this.cur_clip=new_clip; |
547 | 548 | $j('#clipDesc_'+this.cur_clip.id).show(); |
548 | 549 | //update the playhead: |
549 | | - this.setSliderValue( this.cur_clip.dur_offset / this.getDuration() ); |
| 550 | + this.setSliderValue( this.cur_clip.dur_offset / this.getDuration() ); |
550 | 551 | }, |
551 | 552 | prev: function(){ |
552 | 553 | //advance the playhead to the previous clip |
— | — | @@ -1154,7 +1155,7 @@ |
1155 | 1156 | //status updates handled by playlist obj |
1156 | 1157 | }, |
1157 | 1158 | setSliderValue:function(value){ |
1158 | | - //setSlider value handled by playlist obj |
| 1159 | + //setSlider value handled by playlist obj |
1159 | 1160 | } |
1160 | 1161 | } |
1161 | 1162 | |