Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_page.php |
— | — | @@ -61,7 +61,7 @@ |
62 | 62 | $sample_embed[3]['desc'] = 'Demo2 of json ROE attribute'; |
63 | 63 | |
64 | 64 | |
65 | | -$sample_embed[2]['tag'] = '<video id="v2" controls="true" src="sample_fish.ogg" poster="sample_fish.jpg"></video>'; |
| 65 | +$sample_embed[2]['tag'] = '<video id="v2" controls="true" src="sample_fish.ogg?t=0:0:0/0:0:26" poster="sample_fish.jpg"></video>'; |
66 | 66 | $sample_embed[2]['desc'] = 'simple video with controls and thumbnail'; |
67 | 67 | |
68 | 68 | //playlist tags: |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_nativeEmbed.js |
— | — | @@ -7,7 +7,8 @@ |
8 | 8 | setTimeout('$j(\'#'+this.id+'\').get(0).postEmbedJS()', 150); |
9 | 9 | //set a default duration of 30 seconds: cortao should detect duration. |
10 | 10 | var embed_code = this.getEmbedObj(); |
11 | | - js_log('EMBED CODE: ' + embed_code); |
| 11 | + js_log('embed code: ' + embed_code); |
| 12 | + js_log("DURATION: "+ this.getDuration() ); |
12 | 13 | return this.wrapEmebedContainer( embed_code); |
13 | 14 | }, |
14 | 15 | getEmbedObj:function(){ |
— | — | @@ -17,14 +18,16 @@ |
18 | 19 | 'src="'+this.media_element.selected_source.uri+'" ' + |
19 | 20 | 'controls="false" ' + |
20 | 21 | 'oncanplaythrough="$j(\'#'+this.id+'\').get(0).oncanplaythrough();return false;" ' + |
21 | | - 'onloadedmetadata="$j(\'#'+this.id+'\').get(0).onloadedmetadata();return false;" >' + |
| 22 | + 'onloadedmetadata="$j(\'#'+this.id+'\').get(0).onloadedmetadata();return false;" ' + |
| 23 | + 'loadedmetadata="$j(\'#'+this.id+'\').get(0).onloadedmetadata();return false;" >' + |
22 | 24 | '</video>'; |
23 | 25 | }, |
24 | 26 | //@@todo : loading progress |
25 | 27 | postEmbedJS:function(){ |
26 | 28 | this.getVID(); |
27 | 29 | if(this.vid){ |
28 | | - this.vid.load(); |
| 30 | + this.vid.play(); |
| 31 | + //this.vid.load(); //does not seem to work so well |
29 | 32 | setTimeout('$j(\'#'+this.id+'\').get(0).monitor()',100); |
30 | 33 | }else{ |
31 | 34 | js_log('could not grab vid obj:' + typeof this.vid); |
— | — | @@ -33,11 +36,27 @@ |
34 | 37 | }, |
35 | 38 | monitor : function(){ |
36 | 39 | this.getVID(); //make shure we have .vid obj |
37 | | - js_log('time loaded: ' + this.vid.TimeRanges() ); |
38 | | - //update load progress and |
| 40 | + js_log('time loaded: ' + this.vid.TimeRanges ); |
| 41 | + js_log('current time: '+ this.vid.currentTime + ' dur: ' + this.duration); |
| 42 | + |
| 43 | + //update duration if not set |
| 44 | + this.duration =(this.vid.duration==0)?this.getDuration():this.vid.duration; |
| 45 | + |
| 46 | + //update pointers (should just have a loop): |
| 47 | + this.currentTime = this.vid.currentTime; |
| 48 | + |
| 49 | + if( this.currentTime > 0 ){ |
| 50 | + if(! this.userSlide){ |
| 51 | + this.setSliderValue(this.currentTime/this.duration ); |
| 52 | + this.setStatus( seconds2ntp(this.currentTime) + '/'+ seconds2ntp(this.duration)); |
| 53 | + }else{ |
| 54 | + this.setStatus('seek to: ' + seconds2ntp(Math.round( (this.sliderVal*this.duration)) )); |
| 55 | + } |
| 56 | + } |
| 57 | + //update load progress if nessisary |
39 | 58 | if( ! this.monitorTimerId ){ |
40 | 59 | if(document.getElementById(this.id)){ |
41 | | - this.monitorTimerId = setInterval('$j(\'#'+this.id+'\').get(0).monitor()', 1000); |
| 60 | + this.monitorTimerId = setInterval('$j(\'#'+this.id+'\').get(0).monitor()', 250); |
42 | 61 | } |
43 | 62 | } |
44 | 63 | }, |
— | — | @@ -49,20 +68,33 @@ |
50 | 69 | this.play(); |
51 | 70 | }, |
52 | 71 | onloadedmetadata: function(){ |
53 | | - js_log('f:onloadedmetadata get duration'); |
| 72 | + js_log('f:onloadedmetadata get duration: ' +this.vid.duration); |
54 | 73 | //this. |
55 | 74 | }, |
56 | | - pause : function(){ |
57 | | - document.getElementById(this.pid).pause(); |
| 75 | + onloadedmetadata: function(){ |
| 76 | + js_log('f:onloadedmetadata metadata ready'); |
| 77 | + //set the clip duration |
58 | 78 | }, |
| 79 | + pause : function(){ |
| 80 | + this.vid.pause(); |
| 81 | + //stop updates: |
| 82 | + if( this.monitorTimerId != 0 ) |
| 83 | + { |
| 84 | + clearInterval(this.monitorTimerId); |
| 85 | + this.monitorTimerId = 0; |
| 86 | + } |
| 87 | + }, |
59 | 88 | play:function(){ |
60 | | - if(!document.getElementById(this.pid) || this.thumbnail_disp){ |
| 89 | + this.getVID(); |
| 90 | + if(!this.vid || this.thumbnail_disp){ |
61 | 91 | this.parent_play(); |
62 | 92 | }else{ |
63 | | - document.getElementById(this.pid).play(); |
| 93 | + this.vid.play(); |
| 94 | + //re-start the monitor: |
| 95 | + this.vid.monitor(); |
64 | 96 | } |
65 | 97 | }, |
66 | | - // get the embed vlc object |
| 98 | + // get the embed vlc object |
67 | 99 | getVID : function (){ |
68 | 100 | this.vid = $j('#'+this.pid).get(0); |
69 | 101 | } |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_vlcEmbed.js |
— | — | @@ -178,7 +178,7 @@ |
179 | 179 | if( this.duration > 0 || this.vlc.input.time > 0){ |
180 | 180 | ///set mediaLen via request Url |
181 | 181 | if(this.duration==0) |
182 | | - this.duration=this.media_element.selected_source.duration; |
| 182 | + this.duration=this.getDuration(); |
183 | 183 | |
184 | 184 | if(!this.start_offset) |
185 | 185 | this.start_offset=this.media_element.selected_source.start_offset; |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -1721,7 +1721,8 @@ |
1722 | 1722 | return this.media_element.selected_source.start_ntp+'/'+this.media_element.selected_source.end_ntp; |
1723 | 1723 | }, |
1724 | 1724 | getDuration:function(){ |
1725 | | - return this.media_element.selected_source.duration; |
| 1725 | + this.duration = this.media_element.selected_source.duration; |
| 1726 | + return this.duration; |
1726 | 1727 | }, |
1727 | 1728 | /* get the duration in ntp format */ |
1728 | 1729 | getDurationNTP:function(){ |