Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/testing_page.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | <table border="1" cellpadding="6" width="600"> |
20 | 20 | <tr> |
21 | 21 | <td valign="top"> |
22 | | - <playlist src="fresh_smil_load.php" type="audio/ogg"></playlist> |
| 22 | + <video src="http://192.168.1.235/wiki/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_eclipse.ogg" poster="sample_eclipse.jpg" duration="7"></video> |
23 | 23 | </td> |
24 | 24 | <td valign="top"><b>Test embed</b><br /> |
25 | 25 | </td> |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedVideo/mv_nativeEmbed.js |
— | — | @@ -97,8 +97,8 @@ |
98 | 98 | this.currentTime = this.currentTime - this.startOffset; |
99 | 99 | |
100 | 100 | //js_log('this.currentTime: ' + this.currentTime ); |
101 | | - //once currentTime is updated call parent_monitor |
102 | | - this.parent_monitor(); |
| 101 | + //once currentTime is updated call parent_monitor |
| 102 | + this.parent_monitor(); |
103 | 103 | }, |
104 | 104 | /* |
105 | 105 | * native callbacks for the video tag: |
— | — | @@ -107,6 +107,7 @@ |
108 | 108 | js_log('f:oncanplaythrough'); |
109 | 109 | }, |
110 | 110 | onloadedmetadata: function(){ |
| 111 | + this.getVID(); |
111 | 112 | js_log('f:onloadedmetadata metadata ready (update duration)'); |
112 | 113 | //update duration if not set (for now trust the getDuration more than this.vid.duration |
113 | 114 | this.duration = ( this.getDuration() ) ?this.getDuration() : this.vid.duration; |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedVideo/mv_baseEmbed.js |
— | — | @@ -1053,7 +1053,6 @@ |
1054 | 1054 | $j('#mv_embedded_player_'+_this.id).html(embed_code); |
1055 | 1055 | }); |
1056 | 1056 | }, |
1057 | | - /* todo abstract out onClipDone chain of functions and merge with mvTextInterface */ |
1058 | 1057 | onClipDone:function(){ |
1059 | 1058 | js_log('base:onClipDone'); |
1060 | 1059 | //stop the clip (load the thumbnail etc) |
— | — | @@ -1183,7 +1182,7 @@ |
1184 | 1183 | } |
1185 | 1184 | }else{ |
1186 | 1185 | js_log('no annotative track found'); |
1187 | | - $j('#liks_info_'+this.id).html('no metadata found for next, previous links'); |
| 1186 | + $j('#liks_info_'+this.id).html('no metadata found for related links'); |
1188 | 1187 | } |
1189 | 1188 | //query current request time +|- 60s to get prev next speech links. |
1190 | 1189 | }, |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedVideo/mv_javaEmbed.js |
— | — | @@ -22,7 +22,8 @@ |
23 | 23 | this.getDuration(); |
24 | 24 | //if still unset set to an arbitrary time 60 seconds: |
25 | 25 | if(!this.duration)this.duration=60; |
26 | | - if( mv_java_iframe ){ |
| 26 | + |
| 27 | + /*if( mv_java_iframe && parseUri(document.URL).host != parseUri(document.URL).host){ |
27 | 28 | //make sure iframe and embed path match (java security model) |
28 | 29 | var iframe_src=''; |
29 | 30 | var src = this.getURI( this.seek_time_sec ); |
— | — | @@ -63,11 +64,11 @@ |
64 | 65 | iframe_src+=parent_domain; |
65 | 66 | |
66 | 67 | //check for the mvMsgFrame |
67 | | - /*if($j('#mvMsgFrame').length == 0){ |
68 | | - js_log('appened mvMsgFrame'); |
69 | | - //add it to the dom: (sh |
70 | | - $j('body').prepend( '<iframe id="mvMsgFrame" width="0" height="0" scrolling=no marginwidth=0 marginheight=0 src="#none"></iframe>' ); |
71 | | - }*/ |
| 68 | + //if($j('#mvMsgFrame').length == 0){ |
| 69 | + // js_log('appened mvMsgFrame'); |
| 70 | + // //add it to the dom: (sh |
| 71 | + // $j('body').prepend( '<iframe id="mvMsgFrame" width="0" height="0" scrolling=no marginwidth=0 marginheight=0 src="#none"></iframe>' ); |
| 72 | + //} |
72 | 73 | js_log("about to set iframe source and embed code"); |
73 | 74 | this.iframe_src = iframe_src; |
74 | 75 | var embed_code = '<iframe id="iframe_' + this.pid + '" width="'+this.width+'" height="'+this.height+'" '+ |
— | — | @@ -75,11 +76,11 @@ |
76 | 77 | 'src = "'+ this.iframe_src + '"></iframe>'; |
77 | 78 | js_log('going to embed: ' + embed_code); |
78 | 79 | return embed_code; |
79 | | - }else{ |
| 80 | + }else{*/ |
80 | 81 | //load directly in the page.. |
81 | 82 | // (media must be on the same server or applet must be signed) |
82 | 83 | return ''+ |
83 | | - '<applet id="'+this.pid+'" code="com.fluendo.player.Cortado.class" archive="'+mv_embed_path+'binPlayer/cortado/cortado-wmf-r46643.jar" width="'+this.width+'" height="'+this.height+'"> '+ "\n"+ |
| 84 | + '<applet id="'+this.pid+'" code="com.fluendo.player.Cortado.class" archive="'+mv_embed_path+'binPlayers/cortado/cortado-wmf-r46643.jar" width="'+this.width+'" height="'+this.height+'"> '+ "\n"+ |
84 | 85 | '<param name="url" value="'+this.media_element.selected_source.src+'" /> ' + "\n"+ |
85 | 86 | '<param name="local" value="false"/>'+ "\n"+ |
86 | 87 | '<param name="keepaspect" value="true" />'+ "\n"+ |
— | — | @@ -89,7 +90,29 @@ |
90 | 91 | '<param name="duration" value="'+this.duration+'" />'+"\n"+ |
91 | 92 | '<param name="bufferSize" value="200" />'+"\n"+ |
92 | 93 | '</applet>'; |
93 | | - } |
| 94 | + |
| 95 | + |
| 96 | + // Wrap it in an iframe to avoid hanging the event thread in FF 2/3 and similar |
| 97 | + // Doesn't work in MSIE or Safari/Mac or Opera 9.5 |
| 98 | + /*if ( embedTypes.mozilla ) { |
| 99 | + var iframe = document.createElement( 'iframe' ); |
| 100 | + iframe.setAttribute( 'width', params.width ); |
| 101 | + iframe.setAttribute( 'height', playerHeight ); |
| 102 | + iframe.setAttribute( 'scrolling', 'no' ); |
| 103 | + iframe.setAttribute( 'frameborder', 0 ); |
| 104 | + iframe.setAttribute( 'marginWidth', 0 ); |
| 105 | + iframe.setAttribute( 'marginHeight', 0 ); |
| 106 | + iframe.setAttribute( 'id', 'cframe_'+ this.id) |
| 107 | + elt.appendChild( iframe ); |
| 108 | + var newDoc = iframe.contentDocument; |
| 109 | + newDoc.open(); |
| 110 | + newDoc.write( '<html><body>' + appplet_code + '</body></html>' ); |
| 111 | + newDoc.close(); // spurious error in some versions of FF, no workaround known |
| 112 | + } else { |
| 113 | + return appplet_code; |
| 114 | + } */ |
| 115 | + |
| 116 | + //} |
94 | 117 | }, |
95 | 118 | postEmbedJS:function(){ |
96 | 119 | //reset logged domain error flag: |
— | — | @@ -98,24 +121,33 @@ |
99 | 122 | this.monitor(); |
100 | 123 | }, |
101 | 124 | monitor:function(){ |
102 | | - if( this.getJCE() ) { |
| 125 | + this.getJCE() |
| 126 | + if(this.jce){ |
103 | 127 | try{ |
104 | 128 | //java reads "playtime" not ogg media time.. so add the start_offset or seek_offset |
105 | 129 | //js_log(' ct: ' + this.jce.getPlayPosition() + ' so:' + this.start_offset + ' st:' + this.seek_time_sec); |
| 130 | + if(!this.start_offset) |
| 131 | + this.start_offset = 0; |
| 132 | + |
106 | 133 | this.currentTime = (this.seek_time_sec==0)? |
107 | 134 | this.jce.getPlayPosition() + this.start_offset : |
108 | 135 | this.jce.getPlayPosition() + this.seek_time_sec ; |
109 | 136 | }catch (e){ |
110 | 137 | ///js_log('could not get time from jPlayer: ' + e); |
111 | | - } |
112 | | - } |
| 138 | + } |
| 139 | + if( this.currentTime < 0){ |
| 140 | + //probably reached clip end |
| 141 | + this.onClipDone(); |
| 142 | + } |
| 143 | + } |
113 | 144 | //once currentTime is updated call parent_monitor |
114 | 145 | this.parent_monitor(); |
115 | 146 | }, |
116 | 147 | //get java cortado embed object |
117 | 148 | getJCE:function(){ |
118 | | - if( ! mv_java_iframe ){ |
119 | | - this.jce = $j('#'+this.pid).get(0); |
| 149 | + this.jce = $j('#'+this.pid).get(0); |
| 150 | + /*if( ! mv_java_iframe ){ |
| 151 | + |
120 | 152 | }else{ |
121 | 153 | if( $j('#iframe_' + this.pid ).length > 0 ) |
122 | 154 | try{ |
— | — | @@ -127,8 +159,7 @@ |
128 | 160 | } |
129 | 161 | else |
130 | 162 | return false; |
131 | | - } |
132 | | - return this.jce; |
| 163 | + } */ |
133 | 164 | }, |
134 | 165 | pause:function(){ |
135 | 166 | this.parent_pause(); |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedVideo/mv_vlcEmbed.js |
— | — | @@ -194,12 +194,8 @@ |
195 | 195 | { |
196 | 196 | js_log('setting duration to ' + this.vlc.input.length /1000); |
197 | 197 | this.media_element.selected_source.setDuration( this.vlc.input.length /1000); |
| 198 | + this.duration = this.vlc.input.length /1000; |
198 | 199 | } |
199 | | - |
200 | | - this.duration = ( this.getDuration() ) ? this.getDuration() : this.vlc.input.length /1000; |
201 | | - /*if(this.duration!=this.vlc.input.length /1000){ |
202 | | - this.duration = this.vlc.input.length /1000; |
203 | | - }*/ |
204 | 200 | //update the currentTime attribute |
205 | 201 | if( this.media_element.selected_source.timeFormat =='anx' ){ |
206 | 202 | this.currentTime = this.vlc.input.time/1000; |
— | — | @@ -212,7 +208,7 @@ |
213 | 209 | }else{ |
214 | 210 | this.currentTime = (this.vlc.input.time/1000) + this.media_element.selected_source.start_offset; |
215 | 211 | } |
216 | | - //vlc uses original time: |
| 212 | + //vlc uses original time update startOffset if playing chop stream: |
217 | 213 | if( this.startOffset ) |
218 | 214 | this.currentTime = this.currentTime - this.startOffset; |
219 | 215 | //updates hanlded by parent monitor and currentTime |