r40768 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40767‎ | r40768 | r40769 >
Date:00:26, 13 September 2008
Author:dale
Status:old
Tags:
Comment:
seeking for mv_embed
updates for onClipDone actions
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/MV_DefaultSettings.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_flashEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_genericEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_javaEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_nativeEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_oggplayEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_quicktimeEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_vlcEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skin/styles.css (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_stream.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php
@@ -243,7 +243,7 @@
244244 $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/plugins/jquery.autocomplete.js\"></script>");
245245 $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/plugins/jquery.hoverIntent.js\"></script>");
246246
247 - $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/mv_embed.js?".time."\"></script>");
 247+ $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/mv_embed.js\"></script>");
248248 $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_allpages.js\"></script>");
249249 $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_search.js\"></script>");
250250
Index: trunk/extensions/MetavidWiki/includes/MV_DefaultSettings.php
@@ -45,6 +45,7 @@
4646 //metadata helpers for annotative layer (anno_en)
4747 // 'property'=>category for auto_complete (ALL LOWER CASE)
4848 $mvMetaDataHelpers = array('anno_en'=>array('speech_by'=>'person', 'bill'=>'bill'));
 49+
4950 //by default categories are handled differently enable or disable below:
5051 $mvMetaCategoryHelper=true;
5152
Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php
@@ -335,7 +335,7 @@
336336 //do mvd_index query:
337337 $mvd_rows = MV_Index::getMVDInRange($streamTitle->getStreamId(),
338338 $streamTitle->getStartTimeSeconds(),
339 - $streamTitle->getEndTimeSeconds(), $tracks);
 339+ $streamTitle->getEndTimeSeconds(), $tracks, $getText=false, 'Speech_by,Bill,category');
340340 //get the stream stream req
341341 if(!$inline)header('Content-Type: text/xml');
342342 //print the header:
@@ -345,12 +345,27 @@
346346 if(count($mvd_rows)!=0){
347347 global $wgOut;
348348 $MV_Overlay = new MV_Overlay();
349 - foreach($mvd_rows as $mvd){
 349+ foreach($mvd_rows as $mvd){
350350 if(!isset($tracks[$mvd->mvd_type]))$tracks[$mvd->mvd_type]='';
351351 $tracks[$mvd->mvd_type].='
352352 <'.$ns.'clip id="mvd_'.htmlentities($mvd->id).'" start="npt:'.htmlentities(seconds2ntp($mvd->start_time)).'" end="npt:'.htmlentities(seconds2ntp($mvd->end_time)).'">
353 - <'.$ns.'img src="'.htmlentities($streamTitle->getFullStreamImageURL(null, seconds2ntp($mvd->start_time))).'"/>
354 - <'.$ns.'body><![CDATA[
 353+ <'.$ns.'img src="'.htmlentities($streamTitle->getFullStreamImageURL(null, seconds2ntp($mvd->start_time))).'"/>';
 354+ //output all metadata @@todo we should generalize the semantic properties.
 355+ $tracks[$mvd->mvd_type].=(isset($mvd->Speech_by) && trim($mvd->Speech_by)!='' ) ?'<meta name="Speech_by" content="'.htmlentities($mvd->Speech_by).'"/>':'';
 356+ $tracks[$mvd->mvd_type].=(isset($mvd->Bill) && trim($mvd->Bill)!='')?'<meta name="Bill" content="'.htmlentities($mvd->Bill).'"/>':'';
 357+
 358+ //add in categories as "keywords"
 359+ if(count($mvd->category)!=0){
 360+ $tracks[$mvd->mvd_type].='<meta name="keywords" content="';
 361+ $coma='';
 362+ foreach($mvd->category as $cat){
 363+ $tracks[$mvd->mvd_type].=$coma . htmlentities($cat);
 364+ $coma=',';
 365+ }
 366+ $tracks[$mvd->mvd_type].='"/>';
 367+ }
 368+
 369+ $tracks[$mvd->mvd_type].='<'.$ns.'body><![CDATA[
355370 '. $MV_Overlay->getMVDhtml($mvd, $absolute_links=true).'
356371 ]]></'.$ns.'body>
357372 </'.$ns.'clip>';
Index: trunk/extensions/MetavidWiki/skins/mv_stream.js
@@ -214,11 +214,14 @@
215215 });
216216 },
217217 mvdOver:function(mvd_id){
218 - js_log('do mv_fdOver ' + mvd_id );
219 - if($j('#embed_vid').get(0).isPlaying()){
220 - this.delay_cur_mvd_id= mvd_id;
221 - setTimeout("mv_init_interface.delayDoVidMvdUpdate()", 250);
222 - }else{
 218+ js_log('f:mvdOver' + mvd_id );
 219+ var vid_elm = $j('#embed_vid').get(0);
 220+ if( vid_elm.isPlaying() ){
 221+ if(!vid_elm.onClipDone_disp){
 222+ this.delay_cur_mvd_id= mvd_id;
 223+ setTimeout("mv_init_interface.delayDoVidMvdUpdate()", 250);
 224+ }
 225+ }else{
223226 this.cur_mvd_id=this.delay_cur_mvd_id=mvd_id;
224227 do_video_mvd_update(mvd_id);
225228 }
@@ -231,11 +234,9 @@
232235 de_highlight_tl_ts(mvd_id);
233236 de_highlight_fd(mvd_id);
234237 js_log('calling interface restore: ');
235 - //give an additional 500ms (so if we jump from one mvd_id to another we don't restore original so quickly)
236 - //dont restore:
237 - //setTimeout("mv_init_interface.doRestore()", 500);
 238+ setTimeout('mv_init_interface.doRestore()',500);
238239 //activiate over on time restore
239 - $j('#mv_stream_time').hoverIntent({
 240+ /*$j('#mv_stream_time').hoverIntent({
240241 interval:200, //polling interval
241242 timeout:200, //delay before onMouseOut
242243 over:function(){
@@ -244,35 +245,40 @@
245246 out:function(){
246247
247248 }
248 - });
 249+ });*/
249250 },
250 - //delay video updates until we are not playing the clip:
 251+ //delay video updates until we are not playing the clip and clipEnd is not displayed
251252 delayDoVidMvdUpdate:function(){
252253 if($j('#embed_vid').get(0).isPlaying()){
253254 setTimeout("mv_init_interface.delayDoVidMvdUpdate()", 250);
254255 }else{
255 - if(this.cur_mvd_id!=this.delay_cur_mvd_id){
256 - this.cur_mvd_id = this.delay_cur_mvd_id;
257 - do_video_mvd_update(this.cur_mvd_id);
 256+ //only restore if the onClipDone_disp is false
 257+ if( !$j('#embed_vid').get(0).onClipDone_disp){
 258+ if(this.cur_mvd_id!=this.delay_cur_mvd_id){
 259+ this.cur_mvd_id = this.delay_cur_mvd_id;
 260+ do_video_mvd_update(this.cur_mvd_id);
 261+ }
258262 }
259263 }
260264 },
261265 /* based on a a mvd_id update the video thumbnail to the correct location
262 - * if scriptaculus is loaded fade between images
263266 */
264267 doRestore:function(){
265268 var vid_elm = $j('#embed_vid').get(0);
266269 if(vid_elm){
267 - if( vid_elm.isPlaying() ){
268 - //js_log('vid elm is playing delay restore:')
269 - setTimeout("mv_init_interface.doRestore()", 500);
 270+ if( vid_elm.isPlaying()){
 271+ //js_log('vid elm is playing delay restore:')
 272+ setTimeout("mv_init_interface.doRestore()", 500);
270273 }else{
271 - //only restore if the cur_mvd = 'base' and interface updates are not locked
272 - if(this.cur_mvd_id=='base'){
273 - vid_elm.updateThumbnail(org_thum_src);
274 - vid_elm.updateVideoTimeReq(org_vid_time_req);
275 - //vid_elm.updateVideoSrc(org_vid_src);
276 - $j('#mv_videoPlayerTime').html(org_vid_title);
 274+ //only restore if onClipDone_disp is false
 275+ if(!vid_elm.onClipDone_disp){
 276+ //only restore if the cur_mvd = 'base' and interface updates are not locked
 277+ if(this.cur_mvd_id=='base'){
 278+ vid_elm.updateThumbnail(org_thum_src);
 279+ vid_elm.updateVideoTimeReq(org_vid_time_req);
 280+ //vid_elm.updateVideoSrc(org_vid_src);
 281+ $j('#mv_videoPlayerTime').html(org_vid_title);
 282+ }
277283 }
278284 }
279285 }
@@ -788,8 +794,12 @@
789795 function mv_play_or_pause(){
790796 //issue a stop since we want mouse_overs to work
791797 var ebvid = $j('#embed_vid').get(0);
792 - if(!ebvid.paused)
 798+ if(!ebvid.paused){
793799 mv_do_stop();
 800+ ebvid.pauseed=true;
 801+ }else{
 802+ mv_do_play();
 803+ }
794804 }
795805 function mv_do_stop(){
796806 $j('#mv_videoPlayerTime').fadeIn('fast');
@@ -912,6 +922,8 @@
913923 //get the current thumbnail
914924 var vid_elm = document.getElementById('embed_vid');
915925 if(!vid_elm)return '';
 926+ //make the play button visable again (if its hidden) :
 927+ $j('#big_play_link_embed_vid').show();
916928 do_video_time_update(time_ary[1], time_ary[2],mvd_id);
917929 }
918930 }
@@ -927,8 +939,8 @@
928940 //set via mvd
929941 if(mvd_id){
930942 if($j('#mv_fd_mvd_'+mvd_id).attr('image_url')!=$j('#embed_vid').get(0).thumbnail){
931 - $j('#embed_vid').get(0).updateThumbnail($j('#mv_fd_mvd_'+mvd_id).attr('image_url'));
932 - return ;
 943+ $j('#embed_vid').get(0).updateThumbnail($j('#mv_fd_mvd_'+mvd_id).attr('image_url'));
 944+ return ;
933945 }
934946 }
935947 //else set via org_thum_src
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_nativeEmbed.js
@@ -28,7 +28,7 @@
2929 'id="'+this.pid + '" ' +
3030 'style="width:'+this.width+'px;height:'+this.height+'px;" ' +
3131 'width="'+this.width+'" height="'+this.height+'" '+
32 - 'src="'+this.media_element.selected_source.uri+'" ' +
 32+ 'src="' + this.media_element.selected_source.getURI(this.seek_time_sec) + '" ' +
3333 'oncanplaythrough="$j(\'#'+this.id+'\').get(0).oncanplaythrough();return false;" ' +
3434 'onloadedmetadata="$j(\'#'+this.id+'\').get(0).onloadedmetadata();return false;" ' +
3535 'loadedmetadata="$j(\'#'+this.id+'\').get(0).onloadedmetadata();return false;" ' +
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_quicktimeEmbed.js
@@ -42,7 +42,7 @@
4343 "<param name='SCALE' value='Aspect'/>" +
4444 "<param name='AUTOPLAY' value='True'/>" +
4545 "<param name='src' value=" + mv_embed_path + 'null_file.mov' + "/>" +
46 - "<param name='QTSRC' value=" + this.src + "/>" +
 46+ "<param name='QTSRC' value=" + this.media_element.selected_source.getURI(this.seek_time_sec) + "/>" +
4747 "</object></div>";
4848 },
4949 makeQuickTimePollFunction : function ( ) {
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_genericEmbed.js
@@ -4,6 +4,6 @@
55 getEmbedHTML:function(){
66 return '<object type="application/ogg" '+
77 'width="'+this.width+'" height="'+this.height+'" ' +
8 - 'data="' + this.src + '"></object>';
 8+ 'data="' + this.media_element.selected_source.getURI(this.seek_time_sec) + '"></object>';
99 }
1010 }
\ No newline at end of file
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_flashEmbed.js
@@ -21,9 +21,9 @@
2222 'play_head':true,
2323 'play_or_pause':true,
2424 'stop':true,
25 - 'fullscreen':true,
 25+ //'fullscreen':true,
2626 'time_display':true,
27 - 'volume_control':true,
 27+ //'volume_control':true,
2828 'overlay':false
2929 },
3030 flashParams : {
@@ -60,7 +60,8 @@
6161 this.flashParams.height = this.height;
6262 this.flashParams.id = this.pid;
6363
64 - this.flashVars.config.videoFile = this.media_element.selected_source.uri;
 64+ js_log('set flash videoFile: '+ this.media_element.selected_source.getURI(this.seek_time_sec) );
 65+ this.flashVars.config.videoFile = this.media_element.selected_source.getURI(this.seek_time_sec);
6566
6667 if(this.muted)
6768 this.flashVars.config.initialVolumePercentage=0;
@@ -127,6 +128,17 @@
128129 setTimeout('$j(\'#'+this.id+'\').get(0).monitor()', 250);
129130 }
130131 },
 132+ toggleMute: function(){
 133+ parent_toggleMute();
 134+ this.getFLA();
 135+ if(this.fla){
 136+ if(this.muted){
 137+
 138+ }else{
 139+
 140+ }
 141+ }
 142+ },
131143 pause : function()
132144 {
133145 this.getFLA();
@@ -148,24 +160,25 @@
149161
150162 this.currentTime = this.fla.getTime();
151163
152 - if(this.currentTime > 0 ){
 164+ if(this.currentTime > 1 && !this.startedTimedPlayback){
153165 this.startedTimedPlayback=true;
154166 js_log("time is "+ this.currentTime + " started playback");
155 - }
 167+ }
156168
157169
158 - //flash is giving bogus duration get from this
 170+ //flash is giving bogus duration get from this (if available)
159171 var end_ntp = (this.media_element.selected_source.end_ntp)?
160172 this.media_element.selected_source.end_ntp :
161173 seconds2ntp( this.fla.getDuration() );
162174 var start_ntp = (this.media_element.selected_source.start_ntp)?
163175 this.media_element.selected_source.start_ntp : 0;
164 -
165 - if((this.currentTime - ntp2seconds(start_ntp))<0){
166 - this.setStatus('buffering...');
167 - }else{
168 - this.setStatus( seconds2ntp(this.currentTime) + '/' + end_ntp);
169 - this.setSliderValue((time - ntp2seconds(start_ntp)) / (ntp2seconds(end_ntp)-ntp2seconds(start_ntp)) );
 176+ if(!this.userSlide){
 177+ if((this.currentTime - ntp2seconds(start_ntp))<0){
 178+ this.setStatus('buffering...');
 179+ }else{
 180+ this.setStatus( seconds2ntp(this.currentTime) + '/' + end_ntp);
 181+ this.setSliderValue((this.currentTime - ntp2seconds(start_ntp)) / (ntp2seconds(end_ntp)-ntp2seconds(start_ntp)) );
 182+ }
170183 }
171184 //do monitor update:
172185 if( ! this.monitorTimerId ){
@@ -173,15 +186,24 @@
174187 this.monitorTimerId = setInterval('$j(\'#'+this.id+'\').get(0).monitor()', 250);
175188 }
176189 }
177 - js_log('cur perc loaded: ' + this.fla.getPercentLoaded() +
178 - ' cur time : ' + (time - ntp2seconds(start_ntp)) +' / ' +(ntp2seconds(end_ntp)-ntp2seconds(start_ntp)));
 190+
 191+ //super hackery to see if we have "probably" reached the end of playback:
 192+ if(this.prevTime==this.currentTime && (this.currentTime > (ntp2seconds(end_ntp)-1)) ){
 193+ js_log('probablly reached end of stream: '+this.currentTime);
 194+ this.onClipDone();
 195+ }
 196+
 197+ this.prevTime = this.currentTime;
 198+
 199+ //js_log('cur perc loaded: ' + this.fla.getPercentLoaded() +' cur time : ' + (this.currentTime - ntp2seconds(start_ntp)) +' / ' +(ntp2seconds(end_ntp)-ntp2seconds(start_ntp)));
179200 },
180201 // get the embed fla object
181202 getFLA : function (){
182203 this.fla = this.getPluginEmbed();
183204 },
184205 stop : function(){
185 - js_log('f:flashEmbed:stop');
 206+ js_log('f:flashEmbed:stop');
 207+ this.startedTimedPlayback=false;
186208 if (this.monitorTimerId != 0 )
187209 {
188210 clearInterval(this.monitorTimerId);
@@ -197,6 +219,20 @@
198220 clearInterval(this.monitorTimerId);
199221 this.monitorTimerId = 0;
200222 }
 223+ },
 224+ onClipDone: function(){
 225+ js_log('f:flash:onClipDone');
 226+ if( ! this.startedTimedPlayback){
 227+ js_log('clip done before timed playback started .. not good. (ignoring) ');
 228+ //setTimeout('$j(\'#'+embed.id+'\').get(0).play()', 250);
 229+ }else{
 230+ js_log('clip done and '+ this.startedTimedPlayback);
 231+ //stop the clip if its not stoped already:
 232+ this.stop();
 233+ this.setStatus("Clip Done...");
 234+ //run the onClip done action:
 235+ this.parent_onClipDone();
 236+ }
201237 }
202238 }
203239 function asString(obj) {
@@ -237,7 +273,7 @@
238274 for(var i in global_ogg_list)
239275 {
240276 var embed = document.getElementById(global_ogg_list[i]);
241 - if(embed.media_element.selected_source.uri.match(clip.fileName))
 277+ if(embed.media_element.selected_source.src.match(clip.fileName))
242278 {
243279 //js_log('found flash embed');
244280 return embed;
@@ -248,46 +284,41 @@
249285 /* flowplayer callbacks */
250286 function onFlowPlayerReady()
251287 {
252 - js_log('onFlowPlayerReady');
 288+ js_log('f:flash_CB:onFlowPlayerReady');
253289 }
254290
255291 function onClipDone(clip)
256292 {
 293+ js_log('f:flash_CB:onClipDone');
257294 var embed = locateFlashEmbed(clip);
258 - js_log('f:onClipDone:'+embed.id + ' embed time: '+ embed.time);
259 -
260 - if( ! embed.startedTimedPlayback){
261 - js_log('clip done before timed playback started .. not good...re-issuing play in .250 seconds');
262 - setTimeout('$j(\'#'+embed.id+'\').get(0).play()', 250);
263 - }else{
264 - js_log('clip done and '+ embed.startedTimedPlayback);
265 - embed.setStatus("Clip Done...");
266 - //stop the
267 - embed.onClipDone();
268 - }
 295+ embed.onClipDone();
269296 }
270297
271298 function onLoadBegin(clip)
272299 {
273300 var embed = locateFlashEmbed(clip);
 301+ js_log('f:flash_CB:onLoadBegin');
274302 embed.setStatus("Loading Begun...");
275303 }
276304
277305 function onPlay(clip)
278306 {
279307 var embed = locateFlashEmbed(clip);
 308+ js_log('f:flash_CB:onPlay');
280309 embed.setStatus("Playing...");
281310 }
282311
283312 function onStop(clip)
284313 {
285314 var embed = locateFlashEmbed(clip);
 315+ js_log('f:flash_CB:onStop');
286316 embed.setStatus("Stopped...");
287317 }
288318
289319 function onPause(clip)
290320 {
291321 var embed = locateFlashEmbed(clip);
 322+ js_log('f:flash_CB:onPause');
292323 embed.pause();
293324 embed.setStatus("Paused...");
294325 }
@@ -295,11 +326,13 @@
296327 function onResume(clip)
297328 {
298329 var embed = locateFlashEmbed(clip);
 330+ js_log('f:flash_CB:onResume');
299331 embed.setStatus("Resumed...");
300332 }
301333
302334 function onStartBuffering(clip)
303335 {
304336 var embed = locateFlashEmbed(clip);
 337+ js_log('f:flash_CB:onStartBuffering');
305338 embed.setStatus("Buffering Started...");
306339 }
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_javaEmbed.js
@@ -12,7 +12,7 @@
1313 if(mv_java_iframe){
1414 //make sure iframe and embed path match (java security model)
1515 var iframe_src='';
16 - var src = this.media_element.selected_source.uri;
 16+ var src = this.media_element.selected_source.getURI();
1717 //if the src is relative add in current_url as path:
1818 if(src[0]=='/'){
1919 js_log('java: media relative path');
@@ -45,7 +45,7 @@
4646 // (media must be on the same server or applet must be signed)
4747 return ''+
4848 '<applet id="'+this.pid+'" code="com.fluendo.player.Cortado.class" archive="cortado-ovt-stripped_r34336.jar" width="'+this.width+'" height="'+this.height+'"> '+ "\n"+
49 - '<param name="url" value="'+this.media_element.selected_source.uri+'" /> ' + "\n"+
 49+ '<param name="url" value="'+this.media_element.selected_source.src+'" /> ' + "\n"+
5050 '<param name="local" value="false"/>'+ "\n"+
5151 '<param name="keepaspect" value="true" />'+ "\n"+
5252 '<param name="video" value="true" />'+"\n"+
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_oggplayEmbed.js
@@ -29,7 +29,7 @@
3030 getEmbedObj:function(){
3131 return '<embed type="application/liboggplay" ' +
3232 'id="'+this.pid + '" ' +
33 - 'src="'+this.src+'" '+
 33+ 'src="'+this.media_element.selected_source.getURI(this.seek_time_sec)+'" '+
3434 'width="'+this.width+'" height="'+this.height+'">' +
3535 '</embed>';
3636 },
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_vlcEmbed.js
@@ -54,8 +54,9 @@
5555 this.vlc.style.width=this.width;
5656 this.vlc.style.height=this.height;
5757 this.vlc.playlist.items.clear();
58 - js_log('vlc play:' + this.media_element.selected_source.uri);
59 - var itemId = this.vlc.playlist.add(this.media_element.selected_source.uri);
 58+ //@@todo if client supports seeking no need to send seek_offset to URI
 59+ js_log('vlc play:' + this.media_element.selected_source.getURI(this.seek_time_sec));
 60+ var itemId = this.vlc.playlist.add( this.media_element.selected_source.getURI(this.seek_time_sec) );
6061 if( itemId != -1 ){
6162 //play
6263 this.vlc.playlist.playItem(itemId);
@@ -117,7 +118,7 @@
118119 // current media has stopped
119120 this.onStop();
120121 //assume we reached the end: (since it was not a js call to stop)
121 - this.streamEnd();
 122+ this.onClipDone();
122123 }
123124 else if( newState == 1 )
124125 {
@@ -173,26 +174,25 @@
174175 },
175176 liveFeedRoll : 0,
176177 onPlaying : function(){
177 - //update the duration attribute
178 - if(this.duration!=this.vlc.input.length /1000){
 178+ //for now trust the duration from url over vlc input.length
 179+ this.duration = (this.getDuration())?this.getDuration():this.vlc.input.length /1000;
 180+ /*if(this.duration!=this.vlc.input.length /1000){
179181 this.duration = this.vlc.input.length /1000;
180 - }
 182+ }*/
181183 //update the currentTime attribute
182 - this.currentTime =this.vlc.input.time/1000;
183 - if( this.duration > 0 || this.vlc.input.time > 0){
184 - ///set mediaLen via request Url
185 - if(this.duration==0)
186 - this.duration=this.getDuration();
 184+ this.currentTime =this.vlc.input.time/1000;
 185+ if( this.duration > 0 || this.vlc.input.time > 0){
 186+ this.start_offset=this.media_element.selected_source.start_offset;
187187
188 - if(!this.start_offset)
189 - this.start_offset=this.media_element.selected_source.start_offset;
190 -
191188 //if we have media duration procceed
192189 if(this.duration){
193190 //as long as the user is not interacting with the playhead update:
194 - if(! this.userSlide){
195 - //js_log('user slide is false' + this.userSlide + '(update)');
196 - if(this.vlc.input.position!=0){
 191+ if(! this.userSlide){
 192+ //slider pos is not accurate with flash:
 193+ if(this.vlc.input.position!=0 && this.media_element.selected_source.mime_type!='video/x-flv'){
 194+ /*js_log(' set slider via input.position: ' +
 195+ this.media_element.selected_source.mime_type + ' pos:'+ this.vlc.input.position);
 196+ */
197197 this.setSliderValue(this.vlc.input.position);
198198 }else{
199199 //set via time:
@@ -204,9 +204,6 @@
205205 }
206206 //js_log('set status: '+ seconds2ntp(this.currentTime) + ' e:'+seconds2ntp(this.duration+this.start_offset));
207207 this.setStatus(seconds2ntp(this.currentTime) + '/' + seconds2ntp(this.duration+this.start_offset) );
208 - }else{
209 - //update info to seek to:
210 - this.setStatus('seek to: ' + seconds2ntp(Math.round( (this.sliderVal*this.duration)) ));
211208 }
212209 }
213210 }else{
@@ -272,8 +269,10 @@
273270 this.vlc.playlist.togglePause();
274271 },
275272 fullscreen : function(){
276 - if(this.vlc)
277 - this.vlc.video.toggleFullscreen();
 273+ if(this.vlc){
 274+ if(this.vlc.video)
 275+ this.vlc.video.toggleFullscreen();
 276+ }
278277 },
279278 /* returns current time in float seconds
280279 * as per html5 we should just have an attribute by name of CurrentTime
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
@@ -1,5 +1,5 @@
2 -/** @fileoverview
3 - * ~mv_embed~
 2+/*
 3+ * ~mv_embed version 1.0~
44 * for details see: http://metavid.ucsc.edu/wiki/index.php/Mv_embed
55 *
66 * All Metavid Wiki code is Released under the GPL2
@@ -97,6 +97,12 @@
9898 gMsg['close']='close';
9999 gMsg['improve_transcript']='Improve Transcript';
100100
 101+gMsg['next_clip_msg']='Play Next Clip';
 102+gMsg['prev_clip_msg']='Play Previus Clip';
 103+gMsg['current_clip_msg']='Continue Playing this Clip';
 104+
 105+gMsg['seek_to']='Seek to';
 106+
101107 //grabs from the globalMsg obj
102108 //@@todo integrate msg serving into CMS
103109 function getMsg( key ) {
@@ -556,7 +562,7 @@
557563 'volume_control':{
558564 'w':22,
559565 'o':function(){
560 - return '<div class="volume_icon"><a href="javascript:$j(\'#'+ctrlBuilder.id+'\').get(0).toggleMute();"></a></div>'
 566+ return '<div id="volume_icon_'+ctrlBuilder.id+'" class="volume_icon"><a href="javascript:$j(\'#'+ctrlBuilder.id+'\').get(0).toggleMute();"></a></div>'
561567 }
562568 },
563569 'time_display':{
@@ -1088,7 +1094,7 @@
10891095 $j.each(this.pe.media_element.sources, function(inx, n){
10901096 if(n.mime_type=='text/cmml'){
10911097 _this.availableTracks[n.id] = {
1092 - src:n.uri,
 1098+ src:n.src,
10931099 title:n.title,
10941100 loaded:false,
10951101 display:false
@@ -1356,9 +1362,9 @@
13571363 {
13581364 js_log(element);
13591365
1360 - this.uri = $j(element).attr('src');
 1366+ this.src = $j(element).attr('src');
13611367 if(ogg_chop_links)
1362 - this.uri = this.uri.replace(".anx", '');
 1368+ this.src = this.src.replace(".anx", '');
13631369 this.marked_default = false;
13641370
13651371 var tag = element.tagName.toLowerCase();
@@ -1371,7 +1377,7 @@
13721378 else if ($j(element).attr('content-type'))
13731379 this.mime_type = $j(element).attr('content-type');
13741380 else
1375 - this.mime_type = this.detectType(this.uri);
 1381+ this.mime_type = this.detectType(this.src);
13761382
13771383 js_log("MIME TYPE: "+ this.mime_type );
13781384
@@ -1393,7 +1399,7 @@
13941400 this.start = $j(element).attr("start");
13951401 if($j(element).attr("end"))
13961402 this.start = $j(element).attr("end");
1397 - //js_log('Adding mediaSource of type ' + this.mime_type + ' and uri ' + this.uri + ' and title ' + this.title);
 1403+ //js_log('Adding mediaSource of type ' + this.mime_type + ' and uri ' + this.src + ' and title ' + this.title);
13981404 this.parseURLDuration();
13991405 },
14001406 /** updates the src time and start & end
@@ -1402,23 +1408,23 @@
14031409 */
14041410 updateSrcTime:function (start_ntp, end_ntp){
14051411 js_log("f:updateSrcTime: "+ start_ntp+'/'+ end_ntp);
1406 - //js_log("pre uri:" + this.uri);
 1412+ //js_log("pre uri:" + this.src);
14071413 //if we have time we can use:
14081414 if(this.start_ntp!=null){
14091415 var index_time_val = false;
14101416 var time_req_delimitator = '';
1411 - if(this.uri.indexOf('?t=')!=-1)index_time_val='?t=';
1412 - if(this.uri.indexOf('&t=')!=-1)index_time_val='&t=';
 1417+ if(this.src.indexOf('?t=')!=-1)index_time_val='?t=';
 1418+ if(this.src.indexOf('&t=')!=-1)index_time_val='&t=';
14131419 if(index_time_val){
1414 - var end_req_string = (this.uri.indexOf('&', this.uri.indexOf(index_time_val)+3)==-1)?
 1420+ var end_req_string = (this.src.indexOf('&', this.src.indexOf(index_time_val)+3)==-1)?
14151421 '':
1416 - this.uri.indexOf('&', this.uri.indexOf(index_time_val));
1417 - this.uri = this.uri.substring(0, this.uri.indexOf(index_time_val) ) + index_time_val + start_ntp + '/'+end_ntp + end_req_string;
 1422+ this.src.indexOf('&', this.src.indexOf(index_time_val));
 1423+ this.src = this.src.substring(0, this.src.indexOf(index_time_val) ) + index_time_val + start_ntp + '/'+end_ntp + end_req_string;
14181424 }
14191425 }
14201426 //update the duration
14211427 this.parseURLDuration();
1422 - //js_log("post uri:" + this.uri);
 1428+ //js_log("post uri:" + this.src);
14231429 },
14241430 /** MIME type accessor function.
14251431 @return the MIME type of the source.
@@ -1429,12 +1435,22 @@
14301436 return this.mime_type;
14311437 },
14321438 /** URI accessor function.
 1439+ * @param int seek_time_sec (used to adjust the URI for players that can't do local seeks well on given media types)
14331440 @return the URI of the source.
14341441 @type String
14351442 */
1436 - getURI : function()
 1443+ getURI : function(seek_time_sec)
14371444 {
1438 - return this.uri;
 1445+ 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+ }
 1454+ return new_url;
14391455 },
14401456 /** Title accessor function.
14411457 @return the title of the source.
@@ -1458,23 +1474,22 @@
14591475 * supports media_url?t=ntp_start/ntp_end url request format
14601476 */
14611477 parseURLDuration : function(){
1462 - js_log('f:parseURLDuration() for:' + this.uri);
 1478+ js_log('f:parseURLDuration() for:' + this.src);
14631479 var index_time_val = false;
1464 - if(this.uri.indexOf('?t=')!=-1)index_time_val='?t=';
1465 - if(this.uri.indexOf('&t=')!=-1)index_time_val='&t=';
 1480+ if(this.src.indexOf('?t=')!=-1)index_time_val='?t=';
 1481+ if(this.src.indexOf('&t=')!=-1)index_time_val='&t=';
14661482 if(index_time_val){
1467 - var end_index = (this.uri.indexOf('&', this.uri.indexOf(index_time_val)+3)==-1)?
1468 - this.uri.length:
1469 - this.uri.indexOf('&', this.uri.indexOf(index_time_val));
1470 - this.start_ntp = this.uri.substring(
1471 - this.uri.indexOf(index_time_val)+index_time_val.length,
1472 - this.uri.indexOf('/', this.uri.indexOf(index_time_val) ));
1473 - this.end_ntp = this.uri.substring(
1474 - this.uri.indexOf('/', this.uri.indexOf(index_time_val))+1, end_index);
 1483+ var end_index = (this.src.indexOf('&', this.src.indexOf(index_time_val)+3)==-1)?
 1484+ this.src.length:
 1485+ this.src.indexOf('&', this.src.indexOf(index_time_val));
 1486+ this.start_ntp = this.src.substring(
 1487+ this.src.indexOf(index_time_val)+index_time_val.length,
 1488+ this.src.indexOf('/', this.src.indexOf(index_time_val) ));
 1489+ this.end_ntp = this.src.substring(
 1490+ this.src.indexOf('/', this.src.indexOf(index_time_val))+1, end_index);
14751491 this.start_offset = ntp2seconds(this.start_ntp);
14761492 this.duration = ntp2seconds( this.end_ntp ) - this.start_offset;
1477 - //keep values in float seconds
1478 - this.start_offset = this.start_offset
 1493+
14791494 this.duration = this.duration;
14801495 }else{
14811496 //else normal media request (can't predict the duration without the plugin reading it)
@@ -1750,6 +1765,11 @@
17511766 thumbnail_disp:true,
17521767 init_with_sources_loadedDone:false,
17531768 inDOM:false,
 1769+ //for onClip done stuff:
 1770+ anno_data_cache:null,
 1771+ seek_time_sec:0,
 1772+ base_seeker_slider_offset:null,
 1773+ onClipDone_disp:false,
17541774 supports:{},
17551775 //utility functions for property values:
17561776 hx : function ( s ) {
@@ -1906,6 +1926,7 @@
19071927
19081928 js_log("READY TO PLAY:"+_this.id);
19091929 _this.ready_to_play=true;
 1930+ _this.getDuration();
19101931 _this.getHTML();
19111932 });
19121933 },
@@ -1927,7 +1948,7 @@
19281949 if(!this.media_element.selected_source.start_ntp)
19291950 return default_time_req;
19301951 return this.media_element.selected_source.start_ntp+'/'+this.media_element.selected_source.end_ntp;
1931 - },
 1952+ },
19321953 getDuration:function(){
19331954 this.duration = this.media_element.selected_source.duration;
19341955 return this.duration;
@@ -1981,24 +2002,189 @@
19822003 $j("#mv_play_pause_button_"+_this.id).attr('class', 'pause_button');
19832004 });
19842005 },
 2006+ /* todo abstract out onClipDone chain of functions and merge with textInterface */
19852007 onClipDone:function(){
19862008 //stop the clip (load the thumbnail etc)
19872009 this.stop();
19882010 var _this = this;
1989 - //now load roe if nessesary and showNextPrevLinks
 2011+
 2012+ //if the clip resolution is < 320 don't do fancy onClipDone stuff
 2013+ if(this.width<300){
 2014+ return ;
 2015+ }
 2016+ this.onClipDone_disp=true;
 2017+ $j('#img_thumb_'+this.id).css('zindex',1);
 2018+ $j('#big_play_link_'+this.id).hide();
 2019+ //add the liks_info_div black back
 2020+ $j('#dc_'+this.id).append('<div id="liks_info_'+this.id+'" ' +
 2021+ 'style="width:' +parseInt(parseInt(this.width)/2)+'px;'+
 2022+ 'height:'+ parseInt(parseInt(this.height)) +'px;'+
 2023+ 'position:absolute;top:10px;'+
 2024+ 'width: '+parseInt( ((parseInt(this.width)/2)-15) ) + 'px;'+
 2025+ 'left:'+ parseInt( ((parseInt(this.width)/2)+15) ) +'px;">'+
 2026+ '</div>' +
 2027+ '<div id="black_back_'+this.id+'" ' +
 2028+ 'style="z-index:-2;position:absolute;background:#000;' +
 2029+ 'top:0px;left:0px;width:'+parseInt(this.width)+'px;' +
 2030+ 'height:'+parseInt(this.height)+'px;">' +
 2031+ '</div>');
 2032+
 2033+ //start animation (make thumb small in uper left add in div for "loading"
 2034+ $j('#img_thumb_'+this.id).animate({
 2035+ width:parseInt(parseInt(_this.width)/2),
 2036+ height:parseInt(parseInt(_this.height)/2),
 2037+ top:20,
 2038+ left:10
 2039+ },
 2040+ 1000,
 2041+ function(){
 2042+ //animation done.. add "loading" to div if empty
 2043+ if($j('#liks_info_'+_this.id).html()==''){
 2044+ $j('#liks_info_'+_this.id).html(getMsg('loading_txt'));
 2045+ }
 2046+ }
 2047+ )
 2048+ //now load roe if nessesaryand showNextPrevLinks
19902049 if(this.roe && this.media_element.addedROEData==false){
19912050 do_request(this.roe, function(data)
19922051 {
19932052 _this.media_element.addROE(data);
1994 - _this.showNextPrevLinks();
 2053+ _this.getNextPrevLinks();
19952054 });
19962055 }else{
1997 - this.showNextPrevLinks();
 2056+ this.getNextPrevLinks();
19982057 }
19992058 },
 2059+ //@@todo we should merge getNextPrevLinks with textInterface .. there is repeated code between them.
 2060+ getNextPrevLinks:function(){
 2061+ js_log('f:getNextPrevLinks');
 2062+ var anno_track_url = null;
 2063+ var _this = this;
 2064+ //check for annoative track
 2065+ $j.each(this.media_element.sources, function(inx, n){
 2066+ if(n.mime_type=='text/cmml'){
 2067+ if( n.id == 'Anno_en'){
 2068+ anno_track_url = n.src;
 2069+ }
 2070+ }
 2071+ });
 2072+ if(anno_track_url){
 2073+ js_log('found annotative track'+ anno_track_url);
 2074+ //zero out seconds (should improve cache hit rate and generally expands metadata search)
 2075+ //@@todo this could be repalced with a regExp
 2076+ var annoURL = parseUri(anno_track_url);
 2077+ var times = annoURL.queryKey['t'].split('/');
 2078+ var stime_parts = times[0].split(':');
 2079+ var etime_parts = times[0].split(':');
 2080+ //zero out the hour:
 2081+ var new_start = stime_parts[0]+':'+'0:0';
 2082+ //zero out the end sec
 2083+ var new_end = (etime_parts[0]== stime_parts[0])? (etime_parts[0]+1)+':0:0' :etime_parts[0]+':0:0';
 2084+
 2085+ var etime_parts = times[1].split(':');
 2086+
 2087+ var new_anno_track_url = annoURL.protocol +'://'+ annoURL.host + annoURL.path +'?';
 2088+ for(i in annoURL.queryKey){
 2089+ new_anno_track_url +=(i=='t')?'t='+new_start+'/'+new_end +'&' :
 2090+ i+'='+ annoURL.queryKey[i]+'&';
 2091+ }
 2092+ var request_key = new_start+'/'+new_end;
 2093+ //check the anno_data cache:
 2094+ //@@todo search cache see if current is in range.
 2095+ if(this.anno_data_cache){
 2096+ js_log('anno data found in cache: '+request_key);
 2097+ this.showNextPrevLinks();
 2098+ }else{
 2099+ do_request(new_anno_track_url, function(cmml_data){
 2100+ js_log('raw response: '+ cmml_data);
 2101+ if(typeof cmml_data == 'string')
 2102+ {
 2103+ var parser=new DOMParser();
 2104+ js_log('Parse CMML data:' + cmml_data);
 2105+ cmml_data=parser.parseFromString(cmml_data,"text/xml");
 2106+ }
 2107+ //init anno_data_cache
 2108+ if(!_this.anno_data_cache)
 2109+ _this.anno_data_cache={};
 2110+ //grab all metadata and put it into the anno_data_cache:
 2111+ $j.each(cmml_data.getElementsByTagName('clip'), function(inx, clip){
 2112+ _this.anno_data_cache[ $j(clip).attr("id") ]={
 2113+ 'start_time_sec':ntp2seconds($j(clip).attr("start").replace('npt:','')),
 2114+ 'end_time_sec':ntp2seconds($j(clip).attr("end").replace('npt:','')),
 2115+ 'time_req':$j(clip).attr("start").replace('npt:','')+'/'+$j(clip).attr("end").replace('npt:','')
 2116+ };
 2117+ //grab all its meta
 2118+ _this.anno_data_cache[ $j(clip).attr("id") ]['meta']={};
 2119+ $j.each(clip.getElementsByTagName('meta'),function(imx, meta){
 2120+ //js_log('adding meta: '+ $j(meta).attr("name")+ ' = '+ $j(meta).attr("content"));
 2121+ _this.anno_data_cache[$j(clip).attr("id")]['meta'][$j(meta).attr("name")]=$j(meta).attr("content");
 2122+ });
 2123+ });
 2124+ _this.showNextPrevLinks();
 2125+ });
 2126+ }
 2127+ }else{
 2128+ js_log('no annotative track found');
 2129+ }
 2130+ //query current request time +|- 60s to get prev next speech links.
 2131+ },
20002132 showNextPrevLinks:function(){
 2133+ //int requested links:
 2134+ var link = {
 2135+ 'prev':'',
 2136+ 'current':'',
 2137+ 'next':''
 2138+ }
 2139+ var curTime = this.getTimeReq().split('/');
20012140
 2141+ var s_sec = ntp2seconds(curTime[0]);
 2142+ var e_sec = ntp2seconds(curTime[1]);
 2143+
 2144+ //now we have all the data in anno_data_cache
 2145+ for(var clip_id in this.anno_data_cache){
 2146+ var clip = this.anno_data_cache[clip_id];
 2147+ //js_log('on clip:'+ clip_id);
 2148+ //set prev_link (if cur_link is still empty)
 2149+ if(s_sec < clip.start_time_sec && link.current=='')
 2150+ link.prev = clip_id;
 2151+
 2152+ //clip is encapsulated by the current clip add current link:
 2153+ if(s_sec > clip.start_time_sec && e_sec < clip.end_time_sec )
 2154+ link.current = clip_id;
 2155+
 2156+ if(e_sec < clip.start_time_sec && link.next=='')
 2157+ link.next = clip_id;
 2158+ }
 2159+ var html='';
 2160+ for(var link_type in link){
 2161+ var link_id = link[link_type];
 2162+ if(link_id!=''){
 2163+ var clip = this.anno_data_cache[link_id];
 2164+
 2165+ var title_msg='';
 2166+ for(var j in clip['meta']){
 2167+ title_msg+=j.replace(/_/g,' ') +': ' +clip['meta'][j].replace(/_/g,' ') +" \n";
 2168+ }
 2169+ var time_req = clip.time_req;
 2170+ if(link_type=='current') //if current start from end of current clip play to end of current meta:
 2171+ time_req = curTime[1]+ '/' + seconds2ntp(clip.end_time_sec);
 2172+
 2173+ html+='<p><a href="#" title="' +title_msg + '" '+
 2174+ 'onClick="$j(\'#'+this.id+'\').get(0).playByTimeReq(\''+
 2175+ time_req + '\'); return false; ">' +
 2176+ getMsg(link_type+'_clip_msg') +
 2177+ '</a></p>';
 2178+ }
 2179+ }
 2180+ //js_log("should set html:"+ html);
 2181+ $j('#liks_info_'+this.id).html(html);
20022182 },
 2183+ playByTimeReq: function(time_req){
 2184+ js_log('f:playByTimeReq: '+time_req );
 2185+ this.stop();
 2186+ this.updateVideoTimeReq(time_req);
 2187+ this.play();
 2188+ },
20032189 doThumbnailHTML:function()
20042190 {
20052191 js_log('f:doThumbnailHTML');
@@ -2032,7 +2218,7 @@
20332219 getHTML : function (){
20342220 //@@todo check if we have sources avaliable
20352221 js_log('f : getHTML');
2036 -
 2222+ var _this = this;
20372223 var html_code = '';
20382224 html_code = '<div id="videoPlayer_'+this.id+'" style="width:'+this.width+'px;" class="videoPlayer">';
20392225 html_code += '<div style="width:'+parseInt(this.width)+'px;height:'+parseInt(this.height)+'px;" id="mv_embedded_player_'+this.id+'">' +
@@ -2053,7 +2239,44 @@
20542240 }
20552241 html_code += '</div>'; //videoPlayer div close
20562242 js_log('should set: '+this.id);
2057 - $j(this).html(html_code);
 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+
20582281 //js_log('set this to: ' + $j(this).html() );
20592282 //alert('stop');
20602283 //if auto play==true directly embed the plugin
@@ -2085,7 +2308,11 @@
20862309 //update media
20872310 this.media_element.updateSourceTimes(start_time, end_time);
20882311 //update mv_time
2089 - $j('#mv_time_'+ this.id).html(start_time+'/'+end_time);
 2312+ this.setStatus(start_time+'/'+end_time);
 2313+ //reset slider
 2314+ this.setSliderValue(0);
 2315+ //reset seek_offset:
 2316+ this.seek_time_sec=0;
20902317 },
20912318 //updates the video src
20922319 updateVideoSrc : function(src){
@@ -2430,20 +2657,23 @@
24312658 //this.innerHTML = this.getPluginMissingHTML();
24322659 //$j(this).html(this.getPluginMissingHTML());
24332660 $j('#'+this.id).html(this.getPluginMissingHTML());
2434 - }else
 2661+ }else{
24352662 this.doEmbedHTML();
 2663+ this.onClipDone_disp=false;
 2664+ }
24362665 }else{
24372666 //the plugin is already being displayed
24382667 js_log("we are already playing" );
24392668 }
24402669 },
2441 - toggleMute:function(){
 2670+ toggleMute:function(){
24422671 if(this.muted){
24432672 this.muted=false;
 2673+ $j('#volume_icon_'+this.id).removeClass('volume_off').addClass('volume_on');
24442674 }else{
24452675 this.muted=true;
 2676+ $j('#volume_icon_'+this.id).removeClass('volume_on').addClass('volume_off');
24462677 }
2447 - //update audio icon:
24482678 },
24492679 play_or_pause : function(){
24502680 js_log('base play or pause');
@@ -2469,7 +2699,7 @@
24702700 //if we are not in playlist mode stop:
24712701 if(!this.pc){
24722702 this.stop();
2473 - }
 2703+ }
24742704 },
24752705 /*
24762706 * base embed pause
@@ -2491,6 +2721,7 @@
24922722 }else{
24932723 //rewrite the html to thumbnail disp
24942724 this.doThumbnailHTML();
 2725+ this.setSliderValue(0);
24952726 }
24962727 if(this.update_interval)
24972728 {
@@ -2580,25 +2811,7 @@
25812812 });
25822813 //if(!slider_id)slider_id=this.id;
25832814 //get a pointer to this id (as this in onSlide context is not "this")
2584 - /*var parent_id = this.id; */
2585 - /*this.slider = new Control.Slider('playhead_'+this.id, 'track_'+this.id,{
2586 - sliderValue:0,
2587 - onSlide:function(v){
2588 - if(! thisVid.userSlide){
2589 - //user slide clip:
2590 - thisVid.userSlide=true;
2591 - js_log('user slide: ' + thisVid.userSlide);
2592 - }
2593 - },
2594 - onChange:function(v){
2595 - if(thisVid.userSlide==true){
2596 - //seek to a given position:
2597 - js_log('this.userSlide seek to: ' + v);
2598 - thisVid.doSeek(v);
2599 - thisVid.userSlide=false;
2600 - }
2601 - }
2602 - });*/
 2815+ /*var parent_id = this.id; */
26032816 },
26042817 setSliderValue: function(perc){
26052818 var id = (this.pc)?this.pc.pp.id:this.id;
@@ -2606,8 +2819,10 @@
26072820 if(!this.mv_seeker_width)
26082821 this.mv_seeker_width = $j('#mv_seeker_slider_'+id).width();
26092822
 2823+ js_log('currentTime:'+ this.currentTime);
 2824+
26102825 var val = Math.round( perc * $j('#mv_seeker_'+id).width() - (this.mv_seeker_width*perc));
2611 - $j('#mv_seeker_slider_'+id).css('marginLeft', val );
 2826+ $j('#mv_seeker_slider_'+id).css('left', (val+41)+'px' );
26122827 //js_log('perc in: ' + perc + ' * ' + $j('#mv_seeker_'+id).width() + ' = set to: '+ val + ' - '+ Math.round(this.mv_seeker_width*perc) );
26132828 //js_log('op:' + offset_perc + ' *('+perc+' * ' + $j('#slider_'+id).width() + ')');
26142829 },
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skin/styles.css
@@ -70,21 +70,25 @@
7171 display: inline;
7272 background: url(images/player_button_play.png) 2px 0 no-repeat;
7373 }
74 -
75 -.videoPlayer a {
76 -display: block;
77 -height: 100%;
78 -width: 100%;
 74+.controls a{
 75+ display: block;
 76+ height: 100%;
 77+ width: 100%;
7978 }
80 -
8179 .videoPlayer .volume_icon {
8280 float: right;
8381 display: inline;
8482 width: 22px;
8583 height: 29px;
8684 padding: 0 0 0 0;
 85+
 86+}
 87+.volume_on {
8788 background: url(images/player_volume_tag.png) 0 8px no-repeat;
8889 }
 90+.volume_off{
 91+ background: url(images/player_volume_tag_off.png) 0 8px no-repeat;
 92+}
8993
9094 .videoPlayer .volume_control {
9195 width: 42px;