r40495 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40494‎ | r40495 | r40496 >
Date:15:07, 5 September 2008
Author:dale
Status:old
Tags:
Comment:
updates to smil transition support
other minor fixes
some more sample assets for smil playlists
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_Overlay.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_nativeEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_vlcEmbed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/flowerprop.svg (added) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_eclipse.jpg (added) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_eclipse.ogg (added) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_sky_image.jpg (added) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_smil.smil.xml (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_playlist.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skin/styles.css (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php
@@ -6,7 +6,7 @@
77 * for more info visit http:/metavid.ucsc.edu/code
88 *
99 */
10 -define('MV_VERSION','1.0rc1 (pre alpha)');
 10+define('MV_VERSION','1.0');
1111
1212
1313 if ( !defined( 'MEDIAWIKI' ) ) die( 1 );
@@ -114,7 +114,7 @@
115115 $wgAutoloadClasses['MV_CategoryPage'] = dirname(__FILE__) .'/articlepages/MV_CategoryPage.php';
116116 $wgAutoloadClasses['MV_SequencePage'] = dirname(__FILE__) .'/articlepages/MV_SequencePage.php';
117117 $wgAutoloadClasses['MV_StreamPage'] = dirname(__FILE__) .'/articlepages/MV_StreamPage.php';
118 - $wgAutoloadClasses['MV_EditDataPage'] = $wgAutoloadClasses['MV_DataPage'] = dirname(__FILE__) . '/articlepages/MV_DataPage.php';
 118+ $wgAutoloadClasses['MV_EditDataPage'] = $wgAutoloadClasses['MV_DataPage'] = dirname(__FILE__) . '/articlepages/MV_DataPage.php';
119119 $wgAutoloadClasses['MV_EditStreamPage'] = dirname(__FILE__) .'/MV_EditStreamPage.php';
120120
121121
Index: trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_Overlay.php
@@ -485,7 +485,7 @@
486486 $rlink = '<a title="'.htmlspecialchars(wfMsg('mv_remove_title')).'" href="javascript:mv_disp_remove_mvd(\''.htmlspecialchars($mvd_page->wiki_title).'\', \''.htmlspecialchars($mvd_page->id).'\')">'.wfMsg('mv_remove').'</a>';
487487 $out.=' - ' . $rlink;
488488 }
489 - $out.=" ) ";
 489+ $out.=" )<br> ";
490490 return $out;
491491 }
492492 /*
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_sky_image.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_sky_image.jpg
___________________________________________________________________
Name: svn:mime-type
493493 + application/octet-stream
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/flowerprop.svg
@@ -0,0 +1,54 @@
 2+<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" onload="startup(evt)" onmousedown="running=!running;offset()">
 3+<script>
 4+<![CDATA[
 5+var svgDocument;
 6+var svgDocument;
 7+var xmlns="http://www.w3.org/2000/svg"
 8+function startup(evt) {
 9+ O=evt.target
 10+ svgDocument=O.ownerDocument
 11+ O.setAttribute("onmousedown","running=!running;offset()")
 12+ grada = svgDocument.getElementById("flo");
 13+ offset()
 14+}
 15+running=true
 16+ limit=120
 17+ blu=2
 18+ incr=2
 19+ rate=2
 20+function offset(){
 21+ if (!running) return
 22+
 23+ onestep(rate)
 24+ window.setTimeout("offset()",10)
 25+}
 26+function onestep(i){
 27+ T="rotate("+blu+" 40 40)"
 28+ grada.setAttribute ("transform", T);
 29+ blu=blu+i
 30+ if ((blu>limit)) blu=0
 31+}
 32+//]]>
 33+</script>
 34+<defs>
 35+ <radialGradient id="f">
 36+ <stop offset="0" style="stop-color: white; stop-opacity: 1;"/>
 37+ <stop id="CO" offset=".4" stop-opacity=".2" style="stop-color: white;"/>
 38+ <stop offset="1" style="stop-color: white; stop-opacity: 0;"/>
 39+ </radialGradient>
 40+
 41+</defs>
 42+<g id="ninef" transform="scale(2, 1)">
 43+ <path d="M 40 40 C 60 60 30 100 60 180 z" style="fill: rgb(102, 221, 0); stroke: green; stroke-width: 2;"/>
 44+ <g id="flo" transform="rotate(50, 40, 40)">
 45+ <g id="g">
 46+ <path id="hp" d="M 40 0 Q 60 20 40 40"/>
 47+ <use xlink:href="#hp" transform="rotate(40, 40, 40)" style="fill: red;"/>
 48+ <use xlink:href="#hp" transform="rotate(80, 40, 40)" style="fill: orange;"/>
 49+ </g>
 50+ <use xlink:href="#g" transform="rotate(120, 40, 40)"/>
 51+ <use xlink:href="#g" transform="rotate(240, 40, 40)"/>
 52+ </g>
 53+</g>
 54+<text x="130" y="145" font-size="20">Click to start/stop</text>
 55+</svg>
\ No newline at end of file
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_eclipse.ogg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_eclipse.ogg
___________________________________________________________________
Name: svn:mime-type
156 + application/octet-stream
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_eclipse.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_eclipse.jpg
___________________________________________________________________
Name: svn:mime-type
257 + application/octet-stream
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_smil.smil.xml
@@ -29,15 +29,13 @@
3030 type="video/ogg"
3131 fill="transition"
3232 dur="10s"
33 - poster="sample_fish.jpg"/>
34 -
35 - <video src="sample_magnolia.ogg?t=0:0:0/0:0:05"
36 - region="video_region"
37 - transIn="xFade"
38 - transOut="toGreen"
 33+ poster="sample_fish.jpg"/>
 34+
 35+ <video src="sample_eclipse.ogg?t=0:0:0/0:0:06"
 36+ region="video_region"
3937 fill="transition"
4038 type="video/ogg"
41 - poster="sample_magnolia.jpg"/>
 39+ poster="sample_eclipse.jpg"/>
4240 </seq>
4341 </body>
4442 </smil>
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_nativeEmbed.js
@@ -25,11 +25,11 @@
2626 'id="'+this.pid + '" ' +
2727 'style="width:'+this.width+'px;height:'+this.height+'px;" ' +
2828 'width="'+this.width+'" height="'+this.height+'" '+
29 - 'src="'+this.media_element.selected_source.uri+'" ' +
30 - 'controls="false" ' +
 29+ 'src="'+this.media_element.selected_source.uri+'" ' +
3130 'oncanplaythrough="$j(\'#'+this.id+'\').get(0).oncanplaythrough();return false;" ' +
3231 'onloadedmetadata="$j(\'#'+this.id+'\').get(0).onloadedmetadata();return false;" ' +
33 - 'loadedmetadata="$j(\'#'+this.id+'\').get(0).onloadedmetadata();return false;" >' +
 32+ 'loadedmetadata="$j(\'#'+this.id+'\').get(0).onloadedmetadata();return false;" ' +
 33+ 'onended="$j(\'#'+this.id+'\').get(0).onended();return false;" >' +
3434 '</video>';
3535 },
3636 //@@todo : loading progress
@@ -49,24 +49,39 @@
5050 //js_log('time loaded: ' + this.vid.TimeRanges );
5151 //js_log('current time: '+ this.vid.currentTime + ' dur: ' + this.duration);
5252
53 - //update duration if not set
54 - this.duration =(this.vid.duration==0)?this.getDuration():this.vid.duration;
 53+ //update duration if not set (for now trust the getDuration more than this.vid.duration
 54+ this.duration =(this.getDuration())?this.getDuration():this.vid.duration;
5555
5656 //update currentTime
5757 this.currentTime = this.vid.currentTime;
5858
 59+ //update the start offset:
 60+ if(!this.start_offset)
 61+ this.start_offset=this.media_element.selected_source.start_offset;
 62+
5963 //does smili based actions
6064 this.doSmilActions();
61 -
 65+ //if in playlist mode make sure we are the "current_clip"
 66+ if(this.pc){
 67+ if(this.pc.pp.cur_clip.embed.id!=this.id){
 68+ js_log("no status updates for "+this.id + ' not current clip');
 69+ return ;
 70+ }
 71+ }
6272 if( this.currentTime > 0 ){
6373 if(!this.userSlide){
64 - this.setSliderValue(this.currentTime/this.duration );
65 - this.setStatus( seconds2ntp(this.currentTime) + '/'+ seconds2ntp(this.duration));
 74+ if(this.currentTime > this.duration){//we are likely viewing a annodex stream add in offset
 75+ this.setSliderValue((this.currentTime-this.start_offset)/this.duration);
 76+ this.setStatus( seconds2ntp(this.currentTime) + '/'+ seconds2ntp(this.start_offset+this.duration ));
 77+ }else{
 78+ this.setSliderValue(this.currentTime/this.duration );
 79+ this.setStatus( seconds2ntp(this.currentTime) + '/'+ seconds2ntp(this.duration ));
 80+ }
6681 }else{
6782 this.setStatus('seek to: ' + seconds2ntp(Math.round( (this.sliderVal*this.duration)) ));
6883 }
6984 }
70 - //update load progress if nessisary
 85+ //update load progress if nessisary f
7186 if( ! this.monitorTimerId ){
7287 if(document.getElementById(this.id)){
7388 this.monitorTimerId = setInterval('$j(\'#'+this.id+'\').get(0).monitor()', 250);
@@ -88,15 +103,25 @@
89104 js_log('f:onloadedmetadata metadata ready');
90105 //set the clip duration
91106 },
92 - pause : function(){
93 - this.vid.pause();
94 - //stop updates:
 107+ onended:function(){
 108+ //clip "ended"
 109+ js_log('f:onended ');
 110+ //stop monitor
 111+ this.stopMonitor();
 112+ this.stop();
 113+ },
 114+ stopMonitor:function(){
95115 if( this.monitorTimerId != 0 )
96116 {
97117 clearInterval(this.monitorTimerId);
98118 this.monitorTimerId = 0;
99119 }
100120 },
 121+ pause : function(){
 122+ this.vid.pause();
 123+ //stop updates:
 124+ this.stopMonitor();
 125+ },
101126 play:function(){
102127 this.getVID();
103128 if(!this.vid || this.thumbnail_disp){
@@ -127,9 +152,10 @@
128153 _pClip.dur = this.duration;
129154
130155 //check for duration actions / clip freze mode
131 - if(_pClip.dur <= this.currentTime ){
 156+ if(_pClip.dur <= this.currentTime && _pClip.order != _pClip.pp.getClipCount()-1 ){
132157 //force next clip
133 - js_log('smil dur: '+_pClip.dur + ' <= curTime: ' + this.currentTime + ' go to next clip');
 158+ js_log('order:' +_pClip.order + ' != count:' + (_pClip.pp.getClipCount()-1) +
 159+ ' smil dur: '+_pClip.dur + ' <= curTime: ' + this.currentTime + ' go to next clip..');
134160 _pClip.pp.next();
135161 }
136162
@@ -161,7 +187,7 @@
162188 }
163189 }
164190 }*/
165 - js_log("check for transOut: ct:"+this.currentTime + ' not > dur:'+_pClip.dur+'-'+'cdur:'+ _pClip.transOut.dur +' = '+ (_pClip.dur - _pClip.transOut.dur));
 191+ //js_log("check for transOut: ct:"+this.currentTime + ' not > dur:'+_pClip.dur+'-'+'cdur:'+ _pClip.transOut.dur +' = '+ (_pClip.dur - _pClip.transOut.dur));
166192 if(_pClip.transOut){
167193 if(this.currentTime > (_pClip.dur - _pClip.transOut.dur) ){
168194 if(_pClip.transOut.animation_state==0){
@@ -169,11 +195,16 @@
170196 _pClip.transOut.animation_state=1;//running transition
171197 if(_pClip.transOut.subtype=='crossfade'){
172198 //make sure the "next" clip is visiable
173 - var next_pClip = _pClip.pp.getClip(1);
174 - $j('#clipDesc_'+next_pClip.id).show();
175 - var overlay_selector_id = 'clipDesc_'+_pClip.id;
 199+ var next_pClip = _pClip.pp.getClip(1);
 200+ //start playing the clip
 201+ next_pClip.embed.play();
 202+ //alert('opacity: '+$j('#clipDesc_'+next_pClip.id).css('opacity'));
 203+ var overlay_selector_id = 'clipDesc_'+next_pClip.id;
 204+ js_log("do transOUT for: "+overlay_selector_id);
176205 mvTransLib.doTransition(_pClip.transOut, overlay_selector_id, offSetTime );
177206 }
 207+ }else if(_pClip.transOut.animation_state==2){
 208+ this.stop();
178209 }
179210 }
180211 }
@@ -235,14 +266,14 @@
236267 * Smil Transition Effects see:
237268 * http://www.w3.org/TR/SMIL3/smil-transitions.html#TransitionEffects-TransitionAttribute
238269 */
239 -mvTransLib = {
 270+var mvTransLib = {
240271 /*
241272 * function doTransition lookups up the transition in the mvTransLib obj
242273 * and intiates the transition if its avaliable
243274 * @param tObj transition attribute object
244275 * @param offSetTime default value 0 if we need to start rendering from a given time
245276 */
246 - doTransition:function(tObj, overlay_selector_id, offSetTime){
 277+ doTransition:function(tObj, overlay_selector_id, offSetTime){
247278 if(!tObj.type)
248279 return js_log('transition is missing type attribute');
249280
@@ -256,8 +287,7 @@
257288 return js_log('mvTransLib does not support subType: '+tObj.subtype);
258289
259290 //has type and subype call function with params:
260 - this['type'][tObj.type][tObj.subtype](tObj,overlay_selector_id, offSetTime);
261 -
 291+ this['type'][tObj.type][tObj.subtype](tObj,overlay_selector_id, offSetTime);
262292 },
263293 type:{
264294 //types:
@@ -294,20 +324,25 @@
295325 //corssFade
296326 crossfade:function(tObj, overlay_selector_id, offSetTime){
297327 js_log('f:crossfade: '+overlay_selector_id);
298 - //set the initial state
299 - $j('#'+overlay_selector_id).css({
300 - 'opacity':0
301 - });
 328+ if($j('#'+overlay_selector_id).length==0)
 329+ js_log("ERROR overlay selector not found: "+overlay_selector_id);
 330+
 331+ //set the initial state show the zero opacity animiation
 332+ $j('#'+overlay_selector_id).css({'opacity':0}).show();
 333+
 334+ /*js_log("should have set "+overlay_selector_id +"to zero is: "+
 335+ $j('#'+overlay_selector_id).css('opacity') + ' should annimate for'+
 336+ (( tObj.dur - offSetTime )*1000) );*/
 337+
302338 $j('#'+overlay_selector_id).animate(
303339 {
304 - "opacity" : "0"
 340+ "opacity" : "1"
305341 },
306 - {
307 - "duration" : ( tObj.dur - offSetTime )
308 - },
 342+ (( tObj.dur - offSetTime )*1000),
309343 'linear',
310344 function(){ //callback
311 - tObj.animation_done=true;
 345+ js_log("animated opacity done");
 346+ tObj.animation_state=2;
312347 }
313348 );
314349 }
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_vlcEmbed.js
@@ -169,8 +169,7 @@
170170 //document.getElementById("PlayOrPause").value = "Pause";
171171 //document.getElementById("PlayOrPause").disabled = false;
172172 //document.getElementById("Stop").disabled = false;
173 - this.onPlaying();
174 -
 173+ this.onPlaying();
175174 },
176175 liveFeedRoll : 0,
177176 onPlaying : function(){
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
@@ -99,7 +99,7 @@
100100 //@@todo integrate msg serving into CMS
101101 function getMsg( key ) {
102102 if ( key in gMsg ) {
103 - return gMsg[key];
 103+ return gMsg[key];getCont
104104 } else{
105105 return '[' + key + ']';
106106 }
@@ -480,6 +480,125 @@
481481 /*parseUri class:*/
482482 var parseUri=function(d){var o=parseUri.options,value=o.parser[o.strictMode?"strict":"loose"].exec(d);for(var i=0,uri={};i<14;i++){uri[o.key[i]]=value[i]||""}uri[o.q.name]={};uri[o.key[12]].replace(o.q.parser,function(a,b,c){if(b)uri[o.q.name][b]=c});return uri};parseUri.options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};
483483
 484+/*
 485+ * controlsBuilder:
 486+ *
 487+ */
 488+var ctrlBuilder = {
 489+ getControls:function(embedObj){
 490+ js_log('f:controlsBuilder');
 491+ ctrlBuilder.id = (embedObj.pc)?embedObj.pc.pp.id:embedObj.id;
 492+ ctrlBuilder.avaliable_width=embedObj.playerPixelWidth();
 493+ //make pointer to the embedObj
 494+ ctrlBuilder.embedObj =embedObj;
 495+ //build local support var
 496+ ctrlBuilder.suports ={
 497+ 'options':true,
 498+ 'borders':true
 499+ };
 500+ for(i in embedObj.supports)
 501+ ctrlBuilder.suports[i] = embedObj.supports[i];
 502+ //special case vars:
 503+ if(embedObj.roe && embedObj.show_meta_link)
 504+ ctrlBuilder.suports['closed_captions']=true;
 505+
 506+ //append options to body (if not already there)
 507+ if($j('#mv_embedded_options_'+ctrlBuilder.id).length==0)
 508+ $j('body').append(ctrlBuilder.components['mv_embedded_options'].o());
 509+
 510+ var o='';
 511+ for(i in ctrlBuilder.components){
 512+ if(ctrlBuilder.suports[i]){
 513+ if(ctrlBuilder.avaliable_width > ctrlBuilder.components[i].w){
 514+ o+=ctrlBuilder.components[i].o();
 515+ ctrlBuilder.avaliable_width -= ctrlBuilder.components[i].w;
 516+ }else{
 517+ js_log('not enough space for control component:'+i);
 518+ }
 519+ }
 520+ }
 521+ return o;
 522+ },
 523+ components:{
 524+ 'borders':{
 525+ 'w':8,
 526+ 'o':function(){
 527+ return '<span class="border_left">&nbsp;</span>'+
 528+ '<span class="border_right">&nbsp;</span>';
 529+ }
 530+ },
 531+ 'fullscreen':{
 532+ 'w':20,
 533+ 'o':function(){
 534+ return '<div class="fullscreen"><a href="javascript:$j(\'#'+ctrlBuilder.id+'\').get(0).fullscreen();"></a></div>'
 535+ }
 536+ },
 537+ 'options':{
 538+ 'w':26,
 539+ 'o':function(){
 540+ return '<div id="options_button_'+ctrlBuilder.id+'" class="options"><a href="javascript:$j(\'#'+ctrlBuilder.id+'\').get(0).doOptionsHTML();"></a></div>';
 541+ }
 542+ },
 543+ 'mv_embedded_options':{
 544+ 'w':0,
 545+ 'o':function(){
 546+ return '<div id="mv_embedded_options_'+ctrlBuilder.id+'" class="videoOptions">'
 547++' <div class="videoOptionsTop"></div>'
 548++' <div class="videoOptionsBox">'
 549++' <div class="block">'
 550++' <h6>Video Options</h6>'
 551++' </div>'
 552++' <div class="block">'
 553++' <p class="short_match"><a href="javascript:$j(\'#'+ctrlBuilder.id+'\').get(0).selectPlaybackMethod();" onClick="$j(\'#mv_embedded_options_'+ctrlBuilder.id+'\').hide();"><span><strong>Stream Selection</strong></span></a></p>'
 554++' <p class="short_match"><a href="javascript:$j(\'#'+ctrlBuilder.id+'\').get(0).showVideoDownload();" onClick="$j(\'#mv_embedded_options_'+ctrlBuilder.id+'\').hide();" ><span><strong>Download</strong></span></a></p>'
 555++' <p class="short_match"><a href="javascript:$j(\'#'+ctrlBuilder.id+'\').get(0).showEmbedCode();" onClick="$j(\'#mv_embedded_options_'+ctrlBuilder.id+'\').hide();" ><span><strong>Share or Embed</strong></span></a></p>'
 556++' </div>'
 557++' </div><!--videoOptionsInner-->'
 558++' <div class="videoOptionsBot"></div>'
 559++' </div><!--videoOptions-->';
 560+ }
 561+ },
 562+ 'play_or_pause':{
 563+ 'w':24,
 564+ 'o':function(){
 565+ return '<div id="mv_play_pause_button_'+ctrlBuilder.id+'" class="play_button"><a href="javascript:document.getElementById(\''+ctrlBuilder.id+'\').play_or_pause();"></a></div>'
 566+ }
 567+ },
 568+ 'closed_captions':{
 569+ 'w':40,
 570+ 'o':function(){
 571+ return '<div class="closed_captions"><a href="javascript:$j(\'#'+ctrlBuilder.id+'\').get(0).showTextInterface();"></a></div>'
 572+ }
 573+ },
 574+ 'volume_control':{
 575+ 'w':22,
 576+ 'o':function(){
 577+ return '<div class="volume_icon"></div>'
 578+ }
 579+ },
 580+ 'time_display':{
 581+ 'w':80,
 582+ 'o':function(){
 583+ return '<div id="mv_time_'+ctrlBuilder.id+'" class="time">'+ctrlBuilder.embedObj.getTimeReq()+'</div>'
 584+ }
 585+ },
 586+ 'play_head':{
 587+ 'w':0, //special case (takes up remaning space)
 588+ 'o':function(){
 589+ return '<div class="seeker" id="mv_seeker_'+ctrlBuilder.id+'" style="width: ' + (ctrlBuilder.avaliable_width - 18) + 'px;">'+
 590+ ' <div class="seeker_bar">'+
 591+ ' <div class="seeker_bar_outer"></div>'+
 592+ ' <div id="mv_seeker_slider_'+ctrlBuilder.id+'" class="seeker_slider"></div>'+
 593+ ' <div class="seeker_bar_close"></div>'+
 594+ ' </div>'+
 595+ ' </div><!--seeker-->'
 596+ }
 597+ }
 598+ }
 599+}
 600+
 601+
 602+
484603 js_log("mv embed path:"+ mv_embed_path);
485604 /*
486605 * embedTypes object handles setting and getting of supported embed types:
@@ -1858,113 +1977,11 @@
18591978 return;
18601979 }else{
18611980 $j('#mv_embedded_controls_'+this.id).html( this.getControlsHTML() );
1862 - }
 1981+ }
18631982 },
18641983 getControlsHTML:function()
1865 - {
1866 - //check if we are in playlist mode:
1867 - var id = (this.pc)?this.pc.pp.id:this.id;
1868 -
1869 - js_log('f:getControlsHTML');
1870 - //var true_id = (this.pc!=null)?this.pc.pp.id:this.id;
1871 - var available_width = this.playerPixelWidth();
1872 - var html_code='';
1873 - // borders
1874 - html_code += '<span class="border_left">&nbsp;</span>';
1875 - available_width -= 4;
1876 - html_code += '<span class="border_right">&nbsp;</span>';
1877 - available_width -= 4;
1878 -
1879 - // fullscreen
1880 - if(this.supports['fullscreen'])
1881 - {
1882 - html_code += '<div class="fullscreen"><a href="javascript:$j(\'#'+id+'\').get(0).fullscreen();"></a></div>';
1883 - available_width -= 20;
1884 - }
1885 - // options
1886 - html_code += '<div class="options"><a href="javascript:$j(\'#'+id+'\').get(0).DoOptionsHTML();"></a></div>';
1887 - available_width -= 26;
1888 -
1889 - options_margin = available_width - 119;
1890 - if(options_margin<0) options_margin = 0;
1891 -
1892 - $j('#mv_embedded_options_'+id).css('margin-left',options_margin+'px');
1893 - // play_pause
1894 - if (this.supports['play_or_pause'])
1895 - {
1896 - html_code += '<div id="mv_play_pause_button_'+id+'" class="play_button"><a href="javascript:document.getElementById(\''+this.id+'\').play_or_pause();"></a></div>';
1897 - available_width -= 24;
1898 - }
1899 -
1900 - // closed captioning
1901 - if(this.roe && this.show_meta_link)
1902 - {
1903 - //add in cmml inline dispaly if roe description avaliable
1904 - //not to be displayed in stream interface.
1905 - html_code += '<div class="closed_captions"><a href="javascript:$j(\'#'+id+'\').get(0).showTextInterface();"></a></div>';
1906 - available_width -= 40;
1907 - }
1908 - // volume control
1909 - if(this.supports['volume_control'])
1910 - {
1911 - /*html_code +=
1912 - ' <div class="volume_control">'+
1913 - ' <div class="volume_knob"></div>'+
1914 - ' </div>';
1915 - available_width -= 46;*/
1916 - html_code +='<div class="volume_icon"></div>';
1917 - available_width -= 22;
1918 - }
1919 - // time display
1920 - if(this.supports['time_display'] && (available_width > 80))
1921 - {
1922 - html_code += '<div id="mv_time_'+id+'" class="time">'+this.getDurationNTP()+'</div>';
1923 - available_width -= 80;
1924 - }
1925 -
1926 - if(this.supports['play_head'] && (available_width > 18))
1927 - {
1928 - html_code +=
1929 - ' <div class="seeker" id="mv_seeker_'+id+'" style="width: ' + (available_width - 18) + 'px;">';
1930 - html_code+=
1931 - ' <div class="seeker_bar">'+
1932 - ' <div class="seeker_bar_outer"></div>'+
1933 - ' <div id="mv_seeker_slider_'+id+'" class="seeker_slider"></div>'+
1934 - ' <div class="seeker_bar_close"></div>'+
1935 - ' </div>';
1936 - html_code+=
1937 - ' </div><!--seeker-->';
1938 - }
1939 - // code for stream selection and displaying embed code:
1940 - var dlLink = 'javascript:$j(\'#'+this.id+'\').get(0).showVideoDownload();';
1941 - var source_link = 'javascript:$j(\'#'+this.id+'\').get(0).selectPlaybackMethod();';
1942 - var close_link = '$j(\'#mv_embedded_options_'+this.id+'\').hide();';
1943 -
1944 - html_code += '<div id="mv_embedded_options_'+this.id+'" class="videoOptions">'
1945 -+' <div class="videoOptionsTop"></div>'
1946 -+' <div class="videoOptionsBox">'
1947 -+' <div class="block">'
1948 -+' <h6>Video Options</h6>'
1949 -+' </div>'
1950 -+' <div class="block">'
1951 -+'<p class="short_match"><a href="'+source_link+'" onClick="'+close_link+'"><span><strong>Stream Selection</strong></span></a></p>'
1952 -+' <p class="short_match"><a href="'+dlLink+'" onClick="'+close_link+'" class="last_match"><span><strong>Download</strong></span></a><p>'
1953 -+' </div>'
1954 -+' <div class="block">'
1955 -+' <h6>Share or Embed</h6>'
1956 -+' </div>'
1957 -+' <div class="block embed_code">'
1958 -+' <p class="short_match">'
1959 -+' <textarea name="embed" id="embed">'+this.getEmbeddingHTML()+'</textarea>'
1960 -+' <button class="copy_to_clipboard">Copy to Clipboard</button>'
1961 -+' </p>'
1962 -+' </div> '
1963 -+' </div><!--videoOptionsInner-->'
1964 -+' <div class="videoOptionsBot"></div>'
1965 -+' </div><!--videoOptions-->';
1966 -
1967 -
1968 - return html_code;
 1984+ {
 1985+ return ctrlBuilder.getControls(this);
19691986 },
19701987 getHTML : function (){
19711988 //@@todo check if we have sources avaliable
@@ -1981,13 +1998,13 @@
19821999 if(this.controls)
19832000 {
19842001 js_log("f:getHTML:AddControls");
1985 - html_code += '<div id="mv_embedded_controls_'+this.id+'" class="controls">';
 2002+ html_code +='<div id="mv_embedded_controls_'+this.id+'" class="controls" style="width:'+this.width+'px">';
19862003 html_code += this.getControlsHTML();
1987 - html_code += '</div>';
 2004+ html_code +='</div>';
19882005 }
19892006 html_code += '</div>'; //videoPlayer div close
19902007 js_log('should set: '+this.id);
1991 - $j(this).html(html_code);
 2008+ $j(this).html(html_code);
19922009 //js_log('set this to: ' + $j(this).html() );
19932010 //alert('stop');
19942011 //if auto play==true directly embed the plugin
@@ -2102,13 +2119,17 @@
21032120
21042121 return embed_code_html;
21052122 },
2106 - DoOptionsHTML:function()
 2123+ doOptionsHTML:function()
21072124 {
21082125 var sel_id = (this.pc!=null)?this.pc.pp.id:this.id;
2109 - $j('#mv_embedded_options_'+sel_id).toggle();
 2126+ var pos = $j('#options_button_'+sel_id).offset();
 2127+ pos['top']=pos['top']+24;
 2128+ pos['left']=pos['left']-124;
 2129+ js_log('pos of options button: t:'+pos['top']+' l:'+ pos['left']);
 2130+ $j('#mv_embedded_options_'+sel_id).css(pos).toggle();
21102131 return;
21112132
2112 - var thumbnail = this.media_element.getThumbnailURL();
 2133+ /*var thumbnail = this.media_element.getThumbnailURL();
21132134 var thumb_html='';
21142135 //add plugin config button (don't add for playlists)
21152136 if(!this.pc){
@@ -2118,6 +2139,7 @@
21192140 '</a>'+
21202141 '</div>';
21212142 }
 2143+ * */
21222144
21232145 //add in cmml inline dispaly if roe description avaliable
21242146 //not to be displayed in stream interface.
@@ -2130,15 +2152,16 @@
21312153 }*/
21322154
21332155 //add link back if requested
2134 - if(this.linkback){
 2156+ /*if(this.linkback){
21352157 thumb_html+='<div style="border:none;position:absolute;bottom:2px;right:2px;z-index:1">'+
21362158 '<a title="'+getMsg('clip_linkback')+'" target="_new" href="'+this.linkback+'">';
21372159 thumb_html+=getTransparentPng({id:'lb_'+this.id, width:"27", height:"27", border:"0",
21382160 src:mv_embed_path + 'images/vid_info_sm.png' });
21392161 thumb_html+='</div>';
21402162 }
 2163+ * */
21412164 //add direct download link if option:
2142 - if(this.download_link){
 2165+ /*if(this.download_link){
21432166 //check for roe attribute (extened download options)
21442167 var dlLink = (this.media_element.sources.length>1)?'javascript:document.getElementById(\''+this.id+'\').showVideoDownload();':this.media_element.sources[0].uri;
21452168 thumb_html+='<div style="border:none;position:absolute;bottom:2px;left:2px;z-index:1">'+
@@ -2147,11 +2170,12 @@
21482171 src:mv_embed_path + 'images/vid_download_sm.png' });
21492172 thumb_html+='</div>';
21502173 }
 2174+ */
21512175 //add in embed link (if requested)
2152 - if(this.embed_link){
 2176+ /*if(this.embed_link){
21532177 var right_offset = (this.linkback)?32:0;
21542178 thumb_html+='<div style="border:none;position:absolute;bottom:2px;right:'+right_offset+'px;z-index:1">'+
2155 - '<a title="Embed Clip Code" href="javascript:document.getElementById(\''+this.id+'\').hideShowEmbedCode();">';
 2179+ '<a title="Embed Clip Code" href="javascript:document.getElementById(\''+this.id+'\').showEmbedCode();">';
21562180
21572181 thumb_html+=getTransparentPng(new Object ({id:'le_'+this.id, width:"27", height:"27", border:"0",
21582182 src:mv_embed_path + 'images/vid_embed_sm.png' }));
@@ -2162,8 +2186,8 @@
21632187 '<input onClick="this.select();" type="text" size="40" length="1024" value="'+this.getEmbeddingHTML()+'">'
21642188 '</div>';
21652189 thumb_html+='</div>';
2166 - }
2167 - this.displayHTML(thumb_html);
 2190+ }*/
 2191+ //this.displayHTML(thumb_html);
21682192 },
21692193 getPlayButton:function(id){
21702194 if(!id)id=this.id;
@@ -2192,23 +2216,28 @@
21932217 return out;*/
21942218 },
21952219 //display the code to remotely embed this video:
2196 - hideShowEmbedCode : function(){
2197 - if($j('#embed_code_'+this.id).css('display')=='none'){
2198 - $j('#embed_code_'+this.id).fadeIn("slow");
2199 - }else{
2200 - $j('#embed_code_'+this.id).fadeOut("slow", function(){
2201 - $j('#embed_code_'+this.id).css('display', 'none');
2202 - });
2203 - }
2204 - /* this should work but does not! :(
2205 - $j('#embed_code_'+this.id).toggle(function(){
2206 - $j(this).fadeIn("slow");
2207 - },function(){
2208 - $j(this).fadeOut("slow");
2209 - } );
2210 - *
2211 - */
 2220+ showEmbedCode : function(embed_code){
 2221+ if(!embed_code)
 2222+ embed_code = this.getEmbeddingHTML();
 2223+
 2224+ this.displayHTML('<a class="email" href="#">Share Clip via Email</a> '+
 2225+ '<p>or</p> '+
 2226+ '<a href="#">Embed Clip in Blog or Site</a> '+
 2227+ '<div class="embed_code"> '+
 2228+ '<textarea onClick="this.select();" id="embedding_user_html_'+this.id+'" name="embed">' +
 2229+ embed_code+
 2230+ '</textarea> '+
 2231+ '<button onClick="$j(\'#'+this.id+'\').get(0).copyText(); return false;" class="copy_to_clipboard">Copy to Clipboard</button> '+
 2232+ '</div> '+
 2233+ '</div>');
22122234 },
 2235+ copyText:function(){
 2236+ $j('#embedding_user_html_'+this.id).focus().select();
 2237+ if(document.selection){
 2238+ CopiedTxt = document.selection.createRange();
 2239+ CopiedTxt.execCommand("Copy");
 2240+ }
 2241+ },
22132242 showTextInterface:function(){
22142243 //check if textObj present:
22152244 if(typeof this.textInterface == 'undefined' ){
@@ -2230,19 +2259,22 @@
22312260 */
22322261 displayHTML:function(html_code)
22332262 {
 2263+ var sel_id = (this.pc!=null)?this.pc.pp.id:this.id;
 2264+
22342265 if(!this.supports['overlays'])
22352266 this.stop();
22362267
22372268 //put select list on-top
22382269 //make sure the parent is relatively positioned:
2239 - $j('#'+this.id).css('position', 'relative');
 2270+ $j('#'+sel_id).css('position', 'relative');
22402271 //set height width (check for playlist container)
22412272 var width = (this.pc)?this.pc.pp.width:this.playerPixelWidth();
22422273 var height = (this.pc)?this.pc.pp.height:this.playerPixelHeight();
2243 - if(width<320)width=320;
2244 - if(height<240)height=240;
 2274+
 2275+ if(this.pc)
 2276+ height+=(pl_layout.title_bar_height + pl_layout.control_height);
22452277
2246 - var sel_id = (this.pc!=null)?this.pc.pp.id:this.id;
 2278+
22472279 var fade_in = true;
22482280 if($j('#blackbg_'+sel_id).length!=0)
22492281 {
@@ -2262,7 +2294,7 @@
22632295 +'</div>'+
22642296 // close_link+'</span>'+
22652297 '</div></div>';
2266 - $j('#'+sel_id).append(div_code);
 2298+ $j('#'+sel_id).prepend(div_code);
22672299 if (fade_in)
22682300 $j('#blackbg_'+sel_id).fadeIn("slow");
22692301 else
@@ -2305,14 +2337,17 @@
23062338 return select_html;
23072339 },
23082340 selectPlaybackMethod:function(){
2309 - var _this=this;
 2341+ //get id (in case where we have a parent container)
 2342+ var this_id = (this.pc!=null)?this.pc.pp.id:this.id;
 2343+
 2344+ var _this=this;
23102345 var out='<span style="color:white"><blockquote>';
23112346 var _this=this;
23122347 //js_log('selected src'+ _this.media_element.selected_source.url);
23132348 $j.each(this.media_element.getPlayableSources(), function(index, source)
23142349 {
23152350 var default_player = embedTypes.players.defaultPlayer(source.getMIMEType());
2316 - var source_select_code = 'document.getElementById(\''+_this.id+'\').closeDisplayedHTML(); document.getElementById(\''+_this.id+'\').media_element.selectSource(\''+index+'\');';
 2351+ var source_select_code = '$j(\'#'+this_id+'\').closeDisplayedHTML(); $j(\''+_this.id+'\').media_element.selectSource(\''+index+'\');';
23172352 var player_code = _this.getPlayerSelectList(source.getMIMEType(), index, source_select_code);
23182353 var is_not_selected = (source != _this.media_element.selected_source);
23192354 var image_src = mv_embed_path+'/images/stream/';
@@ -2438,7 +2473,7 @@
24392474 * base embed stop (should be overwritten by the plugin)
24402475 */
24412476 stop: function(){
2442 - js_log('base stop');
 2477+ js_log('base stop:'+this.id);
24432478 //check if thumbnail is being displayed in which case do nothing
24442479 if(this.thumbnail_disp){
24452480 //already in stooped state
@@ -2572,6 +2607,7 @@
25732608 $j('#mv_time_'+id).html(value);
25742609 }
25752610 }
 2611+
25762612 /* returns html for a transparent png (for ie<7)*/
25772613 function getTransparentPng(image){
25782614 if(!image.style)image.style='';
@@ -2620,7 +2656,7 @@
26212657 function mv_addLoadEvent(func) {
26222658 mvEmbed.addLoadEvent(func);
26232659 }
2624 - function do_request(req_url, callback, mv_json_response){
 2660+function do_request(req_url, callback, mv_json_response){
26252661 js_log('do request: ' + req_url);
26262662 if( parseUri(document.URL).host == parseUri(req_url).host){
26272663 //no proxy at all do a direct request:
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skin/styles.css
@@ -36,8 +36,7 @@
3737 height: 305px;
3838 }
3939 .videoPlayer .controls {
40 - height: 29px;
41 - width: 100%;
 40+ height: 29px;
4241 background: #454545;
4342 }
4443 .videoPlayer .controlInnerSmall {
@@ -187,7 +186,7 @@
188187 cursor: pointer;
189188 }
190189
191 -.videoPlayer .large_play_button {
 190+.large_play_button {
192191 background: url(images/player_big_play_button.png) 0 0 no-repeat;
193192 display:block;
194193 width: 130px;
@@ -221,6 +220,7 @@
222221 padding: 0px 11px 0 4px;
223222 position: relative;
224223 overflow: hidden;
 224+ color:#6C6C6C;
225225 z-index: 3;
226226 background: url(images/player_options_bg.png) 0 0 repeat-y;
227227 }
@@ -316,6 +316,7 @@
317317 top:0px;
318318 left:0px;
319319 z-index: 10;
 320+ font-size:16px;
320321 overflow: hidden;
321322 }
322323
@@ -339,8 +340,13 @@
340341 font-size:12px;
341342 text-decoration: underline;
342343 }
343 -.videoComplete .videoOptionsComplete a.email {background: url(images/ico_mail.png) right 0px no-repeat; padding: 0 50px 0 0;}
344344
 345+.videoComplete .videoOptionsComplete a.email {
 346+ font-size:16px;
 347+ background: url(images/ico_mail.png) right 0px no-repeat;
 348+ padding: 0 50px 0 0;
 349+}
 350+
345351 .videoComplete div.embed_code textarea {
346352 margin: 8px 0 8px 0;
347353 padding: 3px;
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_playlist.js
@@ -30,7 +30,10 @@
3131 clip_aspect:1.33, // 4/3 video aspect ratio
3232 seq:.25, //display clip thumbnails
3333 seq_thumb:.25, //size for thumbnails (same as seq by default)
34 - seq_nav:0 //for a nav bar at the base (currently disabled)
 34+ seq_nav:0, //for a nav bar at the base (currently disabled)
 35+ //some pl_layout info:
 36+ title_bar_height:20,
 37+ control_height:29
3538 }
3639 //globals:
3740 var mv_lock_vid_updates=false;
@@ -81,8 +84,8 @@
8285
8386 //if style is set override width and height
8487 if(element.style.width)this.width = parseInt(element.style.width.replace('px',''));
85 - if(element.style.height)this.height = parseInt(element.style.height.replace('px',''));
86 -
 88+ if(element.style.height)this.height = parseInt(element.style.height.replace('px',''));
 89+
8790 //@@todo more attribute value checking:
8891
8992 //if no src is specified try and use the innerHTML as a sorce type:
@@ -126,6 +129,32 @@
127130 track.inheritEmbedObj();
128131 });
129132 },
 133+ doOptionsHTML:function(){
 134+ //grab "options" use current clip:
 135+ this.cur_clip.embed.doOptionsHTML();
 136+ },
 137+ selectPlaybackMethod:function(){
 138+ this.cur_clip.embed.selectPlaybackMethod();
 139+ },
 140+ closeDisplayedHTML:function(){
 141+ this.cur_clip.embed.closeDisplayedHTML();
 142+ },
 143+ showVideoDownload:function(){
 144+ this.cur_clip.embed.showVideoDownload();
 145+ },
 146+ showEmbedCode:function(){
 147+ var embed_code = '&lt;script type=&quot;text/javascript&quot; '+
 148+ 'src=&quot;'+mv_embed_path+'mv_embed.js&quot;&gt;&lt;/script&gt '+"\n" +
 149+ '&lt;playlist id=&quot;'+this.id+'&quot; ';
 150+ if(this.src){
 151+ embed_code+='src=&quot;'+this.src+'&quot; /&gt;';
 152+ }else{
 153+ embed_code+='&gt;'+"\n";
 154+ embed_code+= this.data.htmlEntities();
 155+ embed_code+='&lt;playlist/&gt;';
 156+ }
 157+ this.cur_clip.embed.showEmbedCode(embed_code);
 158+ },
130159 getPlaylist:function(){
131160 js_log("f:getPlaylist: " + this.srcType );
132161 //@@todo lazy load plLib
@@ -318,15 +347,30 @@
319348 $j(this).html('empty playlist');
320349 return ;
321350 }
322 - var plObj=this;
323 - var title_bar_height=20;
324 - var control_height = 29;
 351+ var plObj=this;
325352 //setup layout for title and dc_ clip container
326353 $j(this).html('<div id="dc_'+this.id+'" style="width:'+this.width+'px;' +
327 - 'height:'+(this.height+title_bar_height + control_height)+'px;position:relative;">' +
 354+ 'height:'+(this.height+pl_layout.title_bar_height + pl_layout.control_height)+'px;position:relative;">' +
328355 ' <div style="font-size:13px" id="ptitle_'+this.id+'"></div>' +
329356 '</div>');
330357
 358+ //add the playlist controls:
 359+ $j('#dc_'+plObj.id).append(
 360+ '<div class="videoPlayer" style="position:absolute;top:'+(plObj.height+pl_layout.title_bar_height)+'px">' +
 361+ '<div id="mv_embedded_controls_'+plObj.id+'" ' +
 362+ 'style="postion:relative;top:'+(plObj.height+pl_layout.title_bar_height)+'px;' +
 363+ 'width:'+plObj.width+'px" ' +
 364+ 'class="controls">' +
 365+ plObj.getControlsHTML() +
 366+ '</div>'+
 367+ '</div>'
 368+ );
 369+ //add the play button:
 370+ $j('#dc_'+plObj.id).append(
 371+ this.cur_clip.embed.getPlayButton()
 372+ );
 373+
 374+
331375 $j.each(this.default_track.clips, function(i, clip){
332376 $j('#dc_'+plObj.id).append('<div class="clip_container" id="clipDesc_'+clip.id+'" '+
333377 'style="display:none;position:absolute;text-align: center;width:'+plObj.width + 'px;'+
@@ -334,9 +378,8 @@
335379 'top:20px;left:0px"></div>');
336380 //update the embed html:
337381 clip.embed.height=plObj.height;
338 - clip.embed.width=plObj.width;
339 - if(clip.id != plObj.cur_clip.id)
340 - clip.embed.play_button=false;
 382+ clip.embed.width=plObj.width;
 383+ clip.embed.play_button=false;
341384
342385 clip.embed.getHTML();//get the thubnails for everything
343386 $j(clip.embed).css({ 'position':"absolute",'top':"0px", 'left':"0px"});
@@ -344,88 +387,14 @@
345388 $j('#clipDesc_'+clip.id).get(0).appendChild(clip.embed);
346389 }else{
347390 js_log('cound not find: clipDesc_'+clip.id);
348 - }
349 - //add the controls if we are on the current clip:
350 - if(clip.id == plObj.cur_clip.id){
351 - //js_log("add controls: "+ clip.embed.getControlsHTML() +"\nto:videoPlayer_"+ clip.embed.id);
352 - $j('#videoPlayer_'+clip.embed.id).append(
353 - '<div id="mv_embedded_controls_'+plObj.id+'" ' +
354 - 'style="postion:relative;top:'+(plObj.height+title_bar_height)+'px" ' +
355 - 'class="controls">' +
356 - clip.embed.getControlsHTML() +
357 - '</div>'
358 - );
359 - }
 391+ }
360392 });
361393
362394 if(this.cur_clip)
363 - $j('#clipDesc_'+this.cur_clip.id).css({display:'inline'});
364 -
 395+ $j('#clipDesc_'+this.cur_clip.id).css({display:'inline'});
365396
366397 //update the title and status bar
367 - this.updateBaseStatus();
368 -
369 -
370 - /*va sh=Math.round(this.height* pl_layout.seq_title);
371 - var ay=Math.round(this.height* pl_layout.clip_desc);
372 - //var by=Math.round(this.height* pl_layout.nav);
373 - var cy=Math.round(this.height* pl_layout.seq);
374 - var sy=Math.round(this.height* pl_layout.seq_nav);
375 -
376 - //empty out the html and insert the container
377 - var cheight =(this.sequencer=='true')?this.height+27:this.height;
378 -
379 -
380 - //set up the sequence info link if present
381 - js_log('linkback: '+ this.linkback);
382 - var pl_info_link = (this.linkback)?
383 - '<span style="position:absolute;right:0px;top:0px">'+
384 - '<a title="playlist linkback" target="_new" href="'+this.linkback+'">'+
385 - getTransparentPng({id:'link_'+this.id, width:"27", height:"27", border:"0",
386 - src:mv_embed_path + 'images/vid_info_sm.png' })+'</a></span>':'';
387 - var rp=0;
388 - if(pl_info_link!='')rp=30;
389 - var pl_embed_link = (this.embed_link)?
390 - '<span style="position:absolute;right:'+rp+'px;top:0px">'+
391 - '<a id="a_eblink_'+this.id+'" title="Embed Playlist Code" ' +
392 - 'onclick="document.getElementById(\''+this.id+'\').showEmbedLink();return false;" href="#">'+
393 - getTransparentPng({id:'eblink_'+this.id, width:"27", height:"27", border:"0",
394 - src:mv_embed_path + 'images/vid_embed_sm.png' })+'</a></span>':'';
395 -
396 - //set title to 'Untitled' (if still missing)
397 - if(!this.title)this.title='Untitled';
398 -
399 -
400 -
401 -
402 - //check if we are in sequence mode (for seq layout don't display clips)
403 - js_log('seq: ' + this.sequencer);
404 - if(this.sequencer=='true'){ //string val
405 - */
406 -
407 - /*}else{
408 - //append all clip descriptions
409 - this.getAllClipDesc();
410 - //display the first clip
411 - $j('#clipDesc_'+this.cur_clip.id).css({display:'inline'});
412 - $j('#dc_'+this.id).append('<div id="seqThumb_'+this.id+'" ' +
413 - 'style="white-space:nowrap;position:absolute;width:'+this.width+'px;'+
414 - 'height:'+cy + 'px;'+
415 - 'bottom:'+Math.round(this.height* pl_layout.seq_nav)+'px;left:0px;'+
416 - 'overflow-x:auto;overflow-y:hidden;"></div>');
417 - //append seq thumbnails
418 - this.getSeqThumb();
419 - }*/
420 - //append the playhead (for highlighting current sequence)
421 - //this.getPlayHead();
422 -
423 - //add the default background image xiph_logo_lg_transparent.png
424 - //out+='<div id="'
425 - //js_log('set:'+ this.id+' to: ' + out);
426 - //this.this_elm =
427 - //this_elm = document.getElementById(this.id);
428 - //this_elm.innerHTML=out;
429 - //this.innerHTML=out;
 398+ this.updateBaseStatus();
430399 }
431400 },
432401 updateBaseStatus:function(){
@@ -433,7 +402,7 @@
434403 $j('#ptitle_'+this.id).html(''+
435404 '<b>' + this.title + '</b> '+
436405 this.getClipCount()+' clips, <i>'+
437 - this.getPlDurationNTP() + '</i>' );
 406+ this.getPlDurationNTP() + '</i>' );
438407 },
439408 /*gets adds hidden desc to the #dc container*/
440409 getAllClipDesc : function(){
@@ -514,8 +483,8 @@
515484 this.cur_clip=next_clip;
516485 }else if(this.cur_clip.embed.supports['playlist_swap_loader']){
517486 //where the plugin supports pre_loading future clips and manage that in javascript
518 - //pause current clip
519 - this.cur_clip.embed.pause;
 487+ //stop current clip
 488+ this.cur_clip.embed.stop();
520489 //do swap:
521490 $j('#clipDesc_'+this.cur_clip.id).hide();
522491 this.cur_clip=next_clip;
@@ -561,27 +530,34 @@
562531 play : function(){
563532 var plObj=this;
564533 js_log('pl play');
 534+ //hide the playlist play button:
 535+ $j('#big_play_link_'+this.id).hide();
565536 //update cur clip based if sequence playhead set:
566 -
 537+ var d = new Date();
 538+ this.clockStartTime = d.getTime();
 539+
 540+ js_log('pl_true_start_time:'+ this.pl_true_start_time);
 541+
567542 this.start_clip = this.cur_clip;
568543 this.start_clip_src= this.cur_clip.src;
569544 //load up the ebmed object with the playlist (if it supports it)
570545 if(this.cur_clip.embed.supports['playlist_driver'] ){
571546 //load the playlist into the embed object:
572547 js_log('clip obj supports playlist driver');
 548+ //start up playlist driver:
573549 this.cur_clip.embed.playMovieAt(this.cur_clip.order);
574550 }else{
575551 js_log('basic play');
576552 //play cur_clip
577553 this.cur_clip.embed.play();
578554 }
579 - },
 555+ },
580556 //wrappers for call to pl object to current embed obj
581557 play_or_pause:function(){
582 - this.start_clip.embed.play_or_pause();
 558+ this.cur_clip.embed.play_or_pause();
583559 },
584560 fullscreen:function(){
585 - this.start_clip.embed.fullscreen();
 561+ this.cur_clip.embed.fullscreen();
586562 },
587563 //playlist stops playback for the current clip (and resets state for start clips)
588564 stop:function(){
@@ -605,6 +581,14 @@
606582 //do an animated stop of the current clip
607583 this.cur_clip.embed.stop();
608584 },
 585+ //gets playlist controls large control height for sporting
 586+ //next prev button and more status display
 587+ getControlsHTML:function(){
 588+ //get controls from current clip (add some playlist specific controls:
 589+ this.cur_clip.embed.supports['prev_next']=true;
 590+ this.cur_clip.embed.supports['options_in_body']=true;
 591+ return ctrlBuilder.getControls(this.cur_clip.embed);
 592+ },
609593 //ads colors/dividers between tracks
610594 colorPlayHead: function(){
611595 //total duration:
@@ -716,54 +700,7 @@
717701 callback();
718702 });
719703 }
720 - },
721 - //display the embed code
722 - showEmbedLink: function(){
723 - //js_log('do show embed link');
724 - var topOffset = (pl_layout.seq_title*this.height)-2;
725 - //make sure the parent is relativly positioned:
726 - $j('#'+this.id).css('position', 'relative');
727 - //fade in a black bg div ontop of everything
728 - var embed_code = '<div id="blackbg_'+this.id+'" ' +
729 - 'style="position:absolute;display:none;z-index:2;background:black;top:'+topOffset+'px;left:0px;' +
730 - 'height:'+parseInt(this.height-topOffset+2)+'px;width:'+parseInt(this.width+2)+'px;">' +
731 - '<span style="position:relative;top:20px;left:20px">' +
732 - '<b style="color:white">Playlist Embed Code:</b><br>'+
733 - '<textarea onClick="this.select();" style="width:'+parseInt(this.width*.75)+'px" rows="4" cols="30">'+
734 - '&lt;script type=&quot;text/javascript&quot; '+
735 - 'src=&quot;'+mv_embed_path+'mv_embed.js&quot;&gt;&lt;/script&gt '+"\n" +
736 - '&lt;playlist id=&quot;'+this.id+'&quot; ';
737 - if(this.src){
738 - embed_code+='src=&quot;'+this.src+'&quot; /&gt;';
739 - }else{
740 - embed_code+='&gt;'+"\n";
741 - embed_code+= this.data.htmlEntities();
742 - embed_code+='&lt;playlist/&gt;';
743 - }
744 - embed_code+='</textarea><br>'+
745 - '<a href="#" style="color:white" onClick="document.getElementById(\''+this.id+'\').closeEmbedLink();return false;">close</a>'+
746 - '</span>'+
747 - '</div>';
748 - js_log("append to:"+ this.id + ' c:'+embed_code);
749 - $j('#'+this.id).append(embed_code);
750 - $j('#blackbg_'+this.id).fadeIn("slow");
751 - //update the embed link to close
752 - var dp ='document.getElementById(\''+this.id+'\')';
753 - $j('#a_eblink_'+this.id).get(0).setAttribute('onclick',dp+'.closeEmbedLink();return false;');
754 - //js_log('update onclick:'+$j('#a_eblink_'+this.id).get(0).getAttribute('onclick')) ;
755 - return false; //onclick action return false
756 - },
757 - closeEmbedLink:function(){
758 - js_log('close embed link');
759 - plObj = this;
760 - $j('#blackbg_'+this.id).fadeOut("slow", function(){
761 - $j('#blackbg_'+plObj.id).remove();
762 - });
763 - //update the embed link to open
764 - var dp ='document.getElementById(\''+this.id+'\')';
765 - $j('#a_eblink_'+this.id).get(0).setAttribute('onclick', dp+'.showEmbedLink();return false;');
766 - return false;//onclick action return false
767 - },
 704+ },
768705 getPLControls: function(){
769706 js_log('getPL cont');
770707 return '<a id="mv_prev_link_'+this.id+'" title="Previus Clip" onclick="document.getElementById(\''+this.id+'\').prev();return false;" href="#">'+
@@ -1500,7 +1437,12 @@
15011438 /*****************************
15021439 * SMIL CODE (should be put into another js file / lazy_loaded)
15031440 *****************************/
 1441+/*playlist driver extensions to the playlist object*/
 1442+mvPlayList.prototype.monitor = function(){
 1443+
 1444+}
15041445
 1446+
15051447 //smile based extension of <video> tag:
15061448 //region="video_region" transIn="fromGreen" begin="2s"
15071449 //http://www.w3.org/TR/2007/WD-SMIL3-20070713/smil-extended-media-object.html#edef-ref
@@ -1574,7 +1516,6 @@
15751517 'region',
15761518 'transIn',
15771519 'transOut',
1578 - 'begin',
15791520 'fill',
15801521 'dur'
15811522 );
@@ -1612,9 +1553,10 @@
16131554 if(this.transOut && this.pp.transitions[this.transOut])
16141555 this.transOut =this.pp.transitions[this.transOut].clone();
16151556
1616 - //parse duration:
 1557+ //parse duration / begin times:
16171558 if(this.dur)
1618 - this.dur = smilParseTime(this.dur);
 1559+ this.dur = smilParseTime(this.dur);
 1560+
16191561 //check if the transition is a valid id:
16201562 return this;
16211563 },