Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php |
— | — | @@ -281,8 +281,11 @@ |
282 | 282 | $query = 'stream_name=' . $this->stream_name . '&t=' . $this->req_time . '&feed_format=cmml&tracks=' . strtolower( $row->mvd_type ); |
283 | 283 | $clink = $sTitle->getFullURL( $query ); |
284 | 284 | $inline = ( in_array( strtolower( $row->mvd_type ), $this->mvcp->mvd_tracks ) ) ? 'true':'false'; |
285 | | - // for now make ht_en the default layer |
286 | | - $default_attr = ( strtolower( $row->mvd_type ) == 'ht_en' ) ? 'default="true"':''; |
| 285 | + // for now make ht_en or anno_en the default layer |
| 286 | + $default_attr = ( strtolower( $row->mvd_type ) == 'ht_en' || |
| 287 | + strtolower( $row->mvd_type ) == 'anno_en' ) ? |
| 288 | + 'default="true"': |
| 289 | + ''; |
287 | 290 | ?> |
288 | 291 | <mediaSource id="<?php echo htmlentities( $row->mvd_type )?>" |
289 | 292 | title="<?php echo wfMsg( $row->mvd_type )?>" <?php echo $default_attr?> |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_page.php |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | $sample_embed[2]['desc'] = 'simple video with controls and thumbnail'; |
49 | 49 | |
50 | 50 | |
51 | | -$sample_embed[3]['tag'] = '<video style="width:320px;height:240px" roe="http://metavid.org/w/index.php?title=Special:MvExportStream&feed_format=roe&stream_name=Senate_proceeding_08-01-07&t=0:11:40/0:12:20" ></video>'; |
| 51 | +$sample_embed[3]['tag'] = '<video style="width:320px;height:240px" roe="http://localhost/wiki/index.php?title=Special:MvExportStream&stream_name=Senate_proceeding_08-01-07&t=0:00:00/0:20:00&feed_format=roe" ></video>'; |
52 | 52 | $sample_embed[3]['desc'] = 'Demo of ROE only attribute'; |
53 | 53 | |
54 | 54 | |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_timed_text.html |
— | — | @@ -0,0 +1,23 @@ |
| 2 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| 3 | +"http://www.w3.org/TR/html4/loose.dtd"> |
| 4 | +<html> |
| 5 | +<head> |
| 6 | + <title>sample mv embed</title> |
| 7 | + <script type="text/javascript" src="../mv_embed.js"></script> |
| 8 | +</head> |
| 9 | +<body> |
| 10 | +<h3> Mv_Embed Timed Text examples:</h3> |
| 11 | + <table border="1" cellpadding="6" width="600"> |
| 12 | + <tr> |
| 13 | + <td> |
| 14 | + <video roe="http://metavid.org/w/index.php?title=Special:MvExportStream&stream_name=House_proceeding_07-18-06_00&t=1:23:16/1:23:44&feed_format=roe" > |
| 15 | + </video> |
| 16 | + </td> |
| 17 | + <td> |
| 18 | + <h4>Using serverside gennerated roe xml from the metavid.org wiki</h4> |
| 19 | + <iframe src="http://metavid.org/w/index.php?title=Special:MvExportStream&stream_name=House_proceeding_07-18-06_00&t=1:23:16/1:23:44&feed_format=roe"> |
| 20 | + </td> |
| 21 | + </tr> |
| 22 | + </table> |
| 23 | +</body> |
| 24 | +</html> |
\ No newline at end of file |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/timedTextLibs/mv_timed_text.js |
— | — | @@ -0,0 +1,348 @@ |
| 2 | +// text interface object (for inline display captions) |
| 3 | +var textInterface = function(parentEmbed){ |
| 4 | + return this.init(parentEmbed); |
| 5 | +} |
| 6 | +textInterface.prototype = { |
| 7 | + text_lookahead_time:0, |
| 8 | + body_ready:false, |
| 9 | + default_time_range: "source", //by default just use the source don't get a time-range |
| 10 | + transcript_set:null, |
| 11 | + autoscroll:true, |
| 12 | + scrollTimerId:0, |
| 13 | + availableTracks:{}, |
| 14 | + init:function( parentEmbed ){ |
| 15 | + //set the parent embed object: |
| 16 | + this.pe=parentEmbed; |
| 17 | + //parse roe if not already done: |
| 18 | + this.getTimedTextTracks(); |
| 19 | + }, |
| 20 | + //@@todo separate out data loader & data display |
| 21 | + getTimedTextTracks:function(){ |
| 22 | + js_log("load timed text from roe: "+ this.pe.roe); |
| 23 | + |
| 24 | + //if roe not yet loaded do load it: |
| 25 | + if(this.pe.roe){ |
| 26 | + if(!this.pe.media_element.addedROEData){ |
| 27 | + js_log("load roe data!"); |
| 28 | + var _this = this; |
| 29 | + do_request(this.pe.roe, function(data) |
| 30 | + { |
| 31 | + //continue |
| 32 | + _this.pe.media_element.addROE(data); |
| 33 | + _this.getParseCMML_rowReady(); |
| 34 | + }); |
| 35 | + }else{ |
| 36 | + js_log('row data ready (no roe request)'); |
| 37 | + this.getParseTimedText_rowReady(); |
| 38 | + } |
| 39 | + }else{ |
| 40 | + js_log('no roe data to get text transcript from'); |
| 41 | + } |
| 42 | + }, |
| 43 | + getParseTimedText_rowReady: function (){ |
| 44 | + _this = this; |
| 45 | + //create timedTextObj |
| 46 | + $j.each( this.pe.media_element.sources, function(inx, source){ |
| 47 | + if( typeof source.id == 'undefined' ) |
| 48 | + source.id = 'tt_' + inx; |
| 49 | + var tObj = new timedTextObj( source ); |
| 50 | + //make sure its a valid timed text format (we have not loaded or parsed yet) : ( |
| 51 | + if( tObj.lib != null ){ |
| 52 | + _this.availableTracks[ source.id ] = tObj; |
| 53 | + //debugger; |
| 54 | + js_log( 'is : ' + source.id + ' default: ' + source.default ); |
| 55 | + |
| 56 | + //display if requested: |
| 57 | + if( source.default == "true" ){ |
| 58 | + if( _this.availableTracks.length == 1) |
| 59 | + $j('#mv_txt_load_'+_this.pe.id).show(); //show the loading icon |
| 60 | + js_log('do load timed text: ' + source.id ); |
| 61 | + _this.availableTracks[ source.id ].load( _this.default_time_range, function(){ |
| 62 | + //hide the loading icon |
| 63 | + $j('#mv_txt_load_'+_this.pe.id).fadeOut('fast'); |
| 64 | + _this.displayTrack( source.id ); |
| 65 | + }); |
| 66 | + }else{ |
| 67 | + //don't load the track and don't display |
| 68 | + } |
| 69 | + } |
| 70 | + }); |
| 71 | + }, |
| 72 | + displayTrack: function( track_id ){ |
| 73 | + js_log('f:displayTrack'); |
| 74 | + var _this = this; |
| 75 | + //setup the layout: |
| 76 | + this.setup_layout(); |
| 77 | + $j.each(_this.availableTracks[ track_id ].textNodes, function(inx, text_clip){ |
| 78 | + _this.add_merge_text_clip( text_clip ); |
| 79 | + }); |
| 80 | + }, |
| 81 | + add_merge_text_clip:function(text_clip){ |
| 82 | + //make sure the clip does not already exist: |
| 83 | + if($j('#tc_'+text_clip.id).length==0){ |
| 84 | + var inserted = false; |
| 85 | + var text_clip_start_time = ntp2seconds(text_clip.start); |
| 86 | + var insertHTML = '<div style="border:solid thin black;" id="tc_'+text_clip.id+'" ' + |
| 87 | + 'start="'+text_clip.start+'" end="'+text_clip.end+'" class="mvtt '+text_clip.type_id+'">' + |
| 88 | + '<div style="top:0px;left:0px;right:0px;height:20px;font-size:small">'+ |
| 89 | + '<img style="display:inline;" src="'+mv_embed_path+'/images/control_play_blue.png">'+ |
| 90 | + text_clip.start + ' to ' +text_clip.end+ |
| 91 | + '</div>'+ |
| 92 | + text_clip.body + |
| 93 | + '</div>'; |
| 94 | + $j('#mmbody_'+this.pe.id +' .mvtt').each(function(){ |
| 95 | + if(!inserted){ |
| 96 | + //js_log( ntp2seconds($j(this).attr('start')) + ' > ' + text_clip_start_time); |
| 97 | + if( ntp2seconds($j(this).attr('start')) > text_clip_start_time){ |
| 98 | + inserted=true; |
| 99 | + $j(this).before(insertHTML); |
| 100 | + } |
| 101 | + } |
| 102 | + }); |
| 103 | + //js_log('should just append: '+insertHTML); |
| 104 | + if(!inserted){ |
| 105 | + $j('#mmbody_'+this.pe.id ).append(insertHTML); |
| 106 | + } |
| 107 | + } |
| 108 | + }, |
| 109 | + setup_layout:function(){ |
| 110 | + //check if we have already loaded the menu/body: |
| 111 | + if($j('#tt_mmenu_'+this.pe.id).length==0){ |
| 112 | + $j('#metaBox_'+this.pe.id).html( |
| 113 | + this.getMenu() + |
| 114 | + this.getBody() |
| 115 | + ); |
| 116 | + } |
| 117 | + }, |
| 118 | + show:function(){ |
| 119 | + //setup layout if not already done: |
| 120 | + this.setup_layout(); |
| 121 | + //display the interface if not already displayed: |
| 122 | + $j('#metaBox_'+this.pe.id).fadeIn("fast"); |
| 123 | + //start the autoscroll timer: |
| 124 | + if( this.autoscroll ){ |
| 125 | + _this.setAutoScroll(); |
| 126 | + } |
| 127 | + }, |
| 128 | + close:function(){ |
| 129 | + //the meta box: |
| 130 | + $j('#metaBox_'+this.pe.id).fadeOut('fast'); |
| 131 | + //the icon link: |
| 132 | + $j('#metaButton_'+this.pe.id).fadeIn('fast'); |
| 133 | + }, |
| 134 | + getBody:function(){ |
| 135 | + return '<div id="mmbody_'+this.pe.id+'" ' + |
| 136 | + 'style="position:absolute;top:20px;left:0px;' + |
| 137 | + 'right:0px;bottom:0px;' + |
| 138 | + 'height:'+(this.pe.height-20)+ |
| 139 | + 'px;overflow:auto;"><span id="mv_txt_load_' + _this.pe.id + '">'+ |
| 140 | + getMsg('loading_txt')+'</span>' + |
| 141 | + '</div>'; |
| 142 | + }, |
| 143 | + getTsSelect:function(){ |
| 144 | + js_log('getTsSelect'); |
| 145 | + //check if menu already present |
| 146 | + if($j('mvtsel_'+this.pe.id).length!=0){ |
| 147 | + $j('mvtsel_'+this.pe.id).fadeIn('fast'); |
| 148 | + }else{ |
| 149 | + var selHTML = '<div id="mvtsel_'+this.pe.id+'" style="position:absolute;background:#FFF;top:20px;left:0px;right:0px;bottom:0px;overflow:auto;">'; |
| 150 | + selHTML+='<b>'+getMsg('select_transcript_set')+'</b><ul>'; |
| 151 | + for(var i in this.availableTracks){ //for in loop ok on object |
| 152 | + var checked = (this.availableTracks[i].display)?'checked':''; |
| 153 | + selHTML+='<li><input name="'+i+'" class="mvTsSelect" type="checkbox" '+checked+'>'+ |
| 154 | + this.availableTracks[i].title + '</li>'; |
| 155 | + } |
| 156 | + selHTML+='</ul>' + |
| 157 | + '<a href="#" onClick="document.getElementById(\''+this.pe.id+'\').textInterface.applyTsSelect();return false;">'+getMsg('close')+'</a>'+ |
| 158 | + '</div>'; |
| 159 | + $j('#metaBox_'+this.pe.id).append(selHTML); |
| 160 | + //js_log('appended: '+ selHTML); |
| 161 | + } |
| 162 | + }, |
| 163 | + applyTsSelect:function(){ |
| 164 | + //update availableTracks |
| 165 | + var _this = this; |
| 166 | + $j('#mvtsel_'+this.pe.id+' .mvTsSelect').each(function(){ |
| 167 | + if(this.checked){ |
| 168 | + var track_id = this.name; |
| 169 | + //if not yet loaded now would be a good time |
| 170 | + if(! _this.availableTracks[ track_id ].loaded ){ |
| 171 | + _this.availableTracks[ track_id ].load( ) |
| 172 | + }else{ |
| 173 | + _this.availableTracks[this.name].display=true; |
| 174 | + $j('#mmbody_'+_this.pe.id +' .'+this.name ).fadeIn("fast"); |
| 175 | + } |
| 176 | + }else{ |
| 177 | + if(_this.availableTracks[this.name].display){ |
| 178 | + _this.availableTracks[this.name].display=false; |
| 179 | + $j('#mmbody_'+_this.pe.id +' .'+this.name ).fadeOut("fast"); |
| 180 | + } |
| 181 | + } |
| 182 | + }); |
| 183 | + $j('#mvtsel_'+this.pe.id).fadeOut('fast'); |
| 184 | + }, |
| 185 | + monitor:function(){ |
| 186 | + //grab the time from the video object |
| 187 | + var cur_time = parseInt( this.pe.currentTime ); |
| 188 | + if(cur_time!=0 && this.prevTimeScroll!=cur_time){ |
| 189 | + //search for current time: flash red border trascript |
| 190 | + _this = this; |
| 191 | + $j('#mmbody_'+this.pe.id +' .mvtt').each(function(){ |
| 192 | + if(ntp2seconds($j(this).attr('start')) == cur_time){ |
| 193 | + _this.prevTimeScroll=cur_time; |
| 194 | + $j('#mmbody_'+_this.pe.id).animate({scrollTop: $j(this).get(0).offsetTop}, 'slow'); |
| 195 | + } |
| 196 | + }); |
| 197 | + } |
| 198 | + }, |
| 199 | + setAutoScroll:function( timer ){ |
| 200 | + var _this = this; |
| 201 | + this.autoscroll = ( typeof timer=='undefined' )?this.autoscroll:timer; |
| 202 | + if(this.autoscroll){ |
| 203 | + //start the timer if its not already running |
| 204 | + if(!this.scrollTimerId){ |
| 205 | + this.scrollTimerId = setInterval('$j(\'#'+_this.pe.id+'\').get(0).textInterface.monitor()', 500); |
| 206 | + } |
| 207 | + //jump to the current position: |
| 208 | + var cur_time = parseInt (this.pe.currentTime ); |
| 209 | + js_log('cur time: '+ cur_time); |
| 210 | + |
| 211 | + _this = this; |
| 212 | + var scroll_to_id=''; |
| 213 | + $j('#mmbody_'+this.pe.id +' .mvtt').each(function(){ |
| 214 | + if(cur_time > ntp2seconds($j(this).attr('start')) ){ |
| 215 | + _this.prevTimeScroll=cur_time; |
| 216 | + if( $j(this).attr('id') ) |
| 217 | + scroll_to_id = $j(this).attr('id'); |
| 218 | + } |
| 219 | + }); |
| 220 | + if(scroll_to_id != '') |
| 221 | + $j( '#mmbody_' + _this.pe.id ).animate( { scrollTop: $j('#'+scroll_to_id).position().top } , 'slow' ); |
| 222 | + }else{ |
| 223 | + //stop the timer |
| 224 | + clearInterval(this.scrollTimerId); |
| 225 | + this.scrollTimerId=0; |
| 226 | + } |
| 227 | + }, |
| 228 | + getMenu:function(){ |
| 229 | + var out=''; |
| 230 | + //add in loading icon: |
| 231 | + var as_checked = (this.autoscroll)?'checked':''; |
| 232 | + out+= '<div id="tt_mmenu_'+this.pe.id+'" style="background:#AAF;font-size:small;position:absolute;top:0;height:20px;left:0px;right:0px;">' + |
| 233 | + '<a style="font-color:#000;" title="'+getMsg('close')+'" href="#" onClick="document.getElementById(\''+this.pe.id+'\').closeTextInterface();return false;">'+ |
| 234 | + '<img border="0" width="16" height="16" src="'+mv_embed_path + 'images/cancel.png"></a> ' + |
| 235 | + '<a style="font-color:#000;" title="'+getMsg('select_transcript_set')+'" href="#" onClick="document.getElementById(\''+this.pe.id+'\').textInterface.getTsSelect();return false;">'+ |
| 236 | + getMsg('select_transcript_set')+'</a> | ' + |
| 237 | + '<input onClick="document.getElementById(\''+this.pe.id+'\').textInterface.setAutoScroll(this.checked);return false;" ' + |
| 238 | + 'type="checkbox" '+as_checked +'>'+getMsg('auto_scroll'); |
| 239 | + if(this.pe.media_element.linkback){ |
| 240 | + out+=' | <a style="font-color:#000;" title="'+getMsg('improve_transcript')+'" href="'+this.pe.media_element.linkback+'" target="_new">'+ |
| 241 | + getMsg('improve_transcript')+'</a> '; |
| 242 | + } |
| 243 | + out+='</div>'; |
| 244 | + return out; |
| 245 | + } |
| 246 | +} |
| 247 | + |
| 248 | +/* text format objects |
| 249 | +* @@todo allow loading from external lib set |
| 250 | +*/ |
| 251 | +var timedTextObj = function( source ){ |
| 252 | + //@@todo in the future we could support timed text in oggs if they can be accessed via javascript |
| 253 | + switch( source.mime_type ){ |
| 254 | + case 'text/cmml': |
| 255 | + this.lib = 'CMML'; |
| 256 | + break; |
| 257 | + case 'text/srt': |
| 258 | + this.lib = 'SRT'; |
| 259 | + break; |
| 260 | + default: |
| 261 | + js_log( source.mime_type + ' is not suported timed text fromat'); |
| 262 | + return ; |
| 263 | + break; |
| 264 | + } |
| 265 | + //extend with the per-mime type lib: |
| 266 | + eval('var tObj = timedText' + this.lib + ';'); |
| 267 | + for( var i in tObj ){ |
| 268 | + this[ i ] = tObj[i]; |
| 269 | + } |
| 270 | + return this.init( source ); |
| 271 | +} |
| 272 | + |
| 273 | +//base timedText object |
| 274 | +timedTextObj.prototype = { |
| 275 | + loaded: false, |
| 276 | + lib:null, |
| 277 | + display: false, |
| 278 | + textNodes:new Array(), |
| 279 | + init: function( source ){ |
| 280 | + js_log('init: timedTextObj'); |
| 281 | + this.src = source.src; |
| 282 | + this.title = source.title; |
| 283 | + this.id = source.id; |
| 284 | + } |
| 285 | +} |
| 286 | + |
| 287 | +// Specific Timed Text formats: |
| 288 | + |
| 289 | +timedTextCMML = { |
| 290 | + load: function( range, callback ){ |
| 291 | + var _this = this; |
| 292 | + js_log('textCMML: loading track: '+ this.src); |
| 293 | + |
| 294 | + //:: Load transcript range :: (currently disabled) |
| 295 | + |
| 296 | + /*var pcurl = parseUri( track.src ); |
| 297 | + var req_time = pcurl.queryKey['t'].split('/'); |
| 298 | + req_time[0]=ntp2seconds(req_time[0]); |
| 299 | + req_time[1]=ntp2seconds(req_time[1]); |
| 300 | + if(req_time[1]-req_time[0]> _this.request_length){ |
| 301 | + //longer than 5 min will only issue a (request 5 min) |
| 302 | + req_time[1] = req_time[0]+_this.request_length; |
| 303 | + } |
| 304 | + //set up request url: |
| 305 | + url = pcurl.protocol+'://'+pcurl.authority+pcurl.path+'?'; |
| 306 | + $j.each(pcurl.queryKey, function(key, val){ |
| 307 | + if( key != 't'){ |
| 308 | + url+=key+'='+val+'&'; |
| 309 | + }else{ |
| 310 | + url+= 't=' + seconds2ntp(req_time[0]) + '/' + seconds2ntp(req_time[1]) + '&'; |
| 311 | + } |
| 312 | + }); |
| 313 | + */ |
| 314 | + do_request( _this.src, function(data){ |
| 315 | + js_log("load track clip count:" + data.getElementsByTagName('clip').length ); |
| 316 | + _this.doParse( data ); |
| 317 | + _this.loaded=true; |
| 318 | + callback(); |
| 319 | + }); |
| 320 | + }, |
| 321 | + doParse: function(data){ |
| 322 | + var _this = this; |
| 323 | + $j.each(data.getElementsByTagName('clip'), function(inx, clip){ |
| 324 | + //js_log(' on clip ' + clip.id); |
| 325 | + var text_clip = { |
| 326 | + start: $j(clip).attr('start').replace('npt:', ''), |
| 327 | + end: $j(clip).attr('end').replace('npt:', ''), |
| 328 | + type_id: _this.id, |
| 329 | + id: $j(clip).attr('id') |
| 330 | + } |
| 331 | + $j.each( clip.getElementsByTagName('body'), function(binx, bn ){ |
| 332 | + if(bn.textContent){ |
| 333 | + text_clip.body = bn.textContent; |
| 334 | + }else if(bn.text){ |
| 335 | + text_clip.body = bn.text; |
| 336 | + } |
| 337 | + }); |
| 338 | + _this.textNodes.push( text_clip ); |
| 339 | + }); |
| 340 | + } |
| 341 | +} |
| 342 | +timedTextSRT = { |
| 343 | + init: function(){ |
| 344 | + js_log('init: SRT'); |
| 345 | + }, |
| 346 | + doParse: function(){ |
| 347 | + |
| 348 | + } |
| 349 | +} |
\ No newline at end of file |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_nativeEmbed.js |
— | — | @@ -134,6 +134,7 @@ |
135 | 135 | }, |
136 | 136 | pause : function(){ |
137 | 137 | this.getVID(); |
| 138 | + this.parent_pause(); //update interface |
138 | 139 | if(this.vid){ |
139 | 140 | this.vid.pause(); |
140 | 141 | } |
— | — | @@ -142,9 +143,8 @@ |
143 | 144 | }, |
144 | 145 | play:function(){ |
145 | 146 | this.getVID(); |
146 | | - if(!this.vid || this.thumbnail_disp){ |
147 | | - this.parent_play(); |
148 | | - }else{ |
| 147 | + this.parent_play(); //update interface |
| 148 | + if( this.vid ){ |
149 | 149 | this.vid.play(); |
150 | 150 | //re-start the monitor: |
151 | 151 | this.monitor(); |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_flashEmbed.js |
— | — | @@ -1603,24 +1603,18 @@ |
1604 | 1604 | //get the this.fla value: |
1605 | 1605 | this.getFLA(); |
1606 | 1606 | //set up bindings (for when interacting with the swf causes action: |
1607 | | - this.fla.onPause(function(){ |
1608 | | - js_log('flash:onPause'); |
1609 | | - if( !_this.paused ){ |
1610 | | - _this.pause(); |
1611 | | - } |
| 1607 | + this.fla.onPause(function(){ |
| 1608 | + _this.parent_pause(); //update the interface |
1612 | 1609 | }) |
1613 | | - this.fla.onResume(function(){ |
1614 | | - js_log('flash;onResume'); |
1615 | | - if(_this.paused){ |
1616 | | - _this.play(); |
1617 | | - } |
| 1610 | + this.fla.onResume( function(){ |
| 1611 | + _this.parent_play(); //update the interface |
1618 | 1612 | }); |
1619 | 1613 | //start monitor: |
1620 | 1614 | this.monitor(); |
1621 | 1615 | this.old_pid++; |
1622 | 1616 | }, |
1623 | 1617 | /* js hooks/controls */ |
1624 | | - play: function(){ |
| 1618 | + play: function(){ |
1625 | 1619 | this.getFLA(); |
1626 | 1620 | //update play/pause button etc |
1627 | 1621 | this.parent_play(); |
— | — | @@ -1651,9 +1645,13 @@ |
1652 | 1646 | { |
1653 | 1647 | this.getFLA(); |
1654 | 1648 | this.parent_pause(); |
1655 | | - if( this.fla['pause'] ) |
1656 | | - if( !this.fla.isPaused() ) |
1657 | | - this.fla.pause(); |
| 1649 | + js_log("Flash:Pause: " + this.fla.isPaused() ); |
| 1650 | + if( this.fla['pause'] ){ |
| 1651 | + if( ! this.fla.isPaused() ){ |
| 1652 | + js_log('calling plugin pause'); |
| 1653 | + this.fla.pause(); |
| 1654 | + } |
| 1655 | + } |
1658 | 1656 | }, |
1659 | 1657 | monitor : function() |
1660 | 1658 | { |
— | — | @@ -1760,8 +1758,7 @@ |
1761 | 1759 | onClipDone: function(){ |
1762 | 1760 | js_log('f:flash:onClipDone'); |
1763 | 1761 | if( ! this.startedTimedPlayback){ |
1764 | | - js_log('clip done before timed playback started .. not good. (ignoring) '); |
1765 | | - //setTimeout('$j(\'#'+embed.id+'\').get(0).play()', 250); |
| 1762 | + js_log('clip done before timed playback started .. not good. (ignoring) '); |
1766 | 1763 | //keep monitoring: |
1767 | 1764 | this.monitor(); |
1768 | 1765 | }else{ |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_vlcEmbed.js |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | userSlide:false, |
25 | 25 | pejs_count:0, //post embed js count |
26 | 26 | |
27 | | - getEmbedHTML : function(){ |
| 27 | + getEmbedHTML: function(){ |
28 | 28 | //give VLC 150ms to initialize before we start playback |
29 | 29 | //@@todo should be able to do this as an ready event |
30 | 30 | this.pejs_count=0; |
— | — | @@ -48,7 +48,7 @@ |
49 | 49 | /* |
50 | 50 | * some java script to start vlc playback after the embed: |
51 | 51 | */ |
52 | | - postEmbedJS : function(){ |
| 52 | + postEmbedJS: function(){ |
53 | 53 | //load a pointer to the vlc into the object (this.vlc) |
54 | 54 | this.getVLC(); |
55 | 55 | if( this.vlc.log ){ |
— | — | @@ -92,14 +92,14 @@ |
93 | 93 | } |
94 | 94 | } |
95 | 95 | },*/ |
96 | | - playMovieAt : function (order){ |
| 96 | + playMovieAt: function (order){ |
97 | 97 | //@@todo add clips to playlist after (order) and then play |
98 | 98 | this.play(); |
99 | 99 | }, |
100 | 100 | /* |
101 | 101 | * updates the status time |
102 | 102 | */ |
103 | | - monitor : function(){ |
| 103 | + monitor: function(){ |
104 | 104 | this.getVLC(); |
105 | 105 | if(this.vlc.log){ |
106 | 106 | //js_log( 'state:' + this.vlc.input.state); |
— | — | @@ -162,26 +162,26 @@ |
163 | 163 | } |
164 | 164 | }, |
165 | 165 | /* events */ |
166 | | - onOpen : function(){ |
| 166 | + onOpen: function(){ |
167 | 167 | this.setStatus("Opening..."); |
168 | 168 | //document.getElementById("info_"+this.id).innerHTML = "Opening..."; |
169 | 169 | //document.getElementById("PlayOrPause").disabled = true; |
170 | 170 | //document.getElementById("Stop").disabled = false; |
171 | 171 | }, |
172 | | - onBuffer : function(){ |
| 172 | + onBuffer: function(){ |
173 | 173 | this.setStatus("Buffering..."); |
174 | 174 | //document.getElementById("info_"+this.id).innerHTML = "Buffering..."; |
175 | 175 | //document.getElementById("PlayOrPause").disabled = true; |
176 | 176 | //document.getElementById("Stop").disabled = false; |
177 | 177 | }, |
178 | | - onPlay : function(){ |
| 178 | + onPlay: function(){ |
179 | 179 | //document.getElementById("PlayOrPause").value = "Pause"; |
180 | 180 | //document.getElementById("PlayOrPause").disabled = false; |
181 | 181 | //document.getElementById("Stop").disabled = false; |
182 | 182 | this.onPlaying(); |
183 | 183 | }, |
184 | | - liveFeedRoll : 0, |
185 | | - onPlaying : function(){ |
| 184 | + liveFeedRoll: 0, |
| 185 | + onPlaying: function(){ |
186 | 186 | if(this.seek_time_sec != 0 && !this.media_element.selected_source.supports_url_time_encoding) |
187 | 187 | { |
188 | 188 | // VLC seems to have a problem seeking into the future this way |
— | — | @@ -248,10 +248,10 @@ |
249 | 249 | this.setStatus('live'); |
250 | 250 | } |
251 | 251 | }, |
252 | | - onPause : function(){ |
253 | | - //document.getElementById("PlayOrPause").value = " Play "; |
| 252 | + onPause: function(){ |
| 253 | + this.parent_pause(); //update the inteface if paused via native control |
254 | 254 | }, |
255 | | - onStop : function(){ |
| 255 | + onStop: function(){ |
256 | 256 | // |
257 | 257 | // disable logging |
258 | 258 | this.vlc.log.verbosity = -1; |
— | — | @@ -302,6 +302,7 @@ |
303 | 303 | this.parent_stop(); |
304 | 304 | }, |
305 | 305 | pause : function(){ |
| 306 | + this.parent_pause(); //update the inteface if paused via native control |
306 | 307 | this.vlc.playlist.togglePause(); |
307 | 308 | }, |
308 | 309 | fullscreen : function(){ |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/opened.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/opened.png |
___________________________________________________________________ |
Added: svn:executable |
309 | 310 | + * |
Added: svn:mime-type |
310 | 311 | + application/octet-stream |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed_iframe.php |
— | — | @@ -0,0 +1,116 @@ |
| 2 | +<?php |
| 3 | +/* |
| 4 | +mv_embed_iframe.php |
| 5 | +this allows for remote embedding without exposing the hosting site to javascript. |
| 6 | +*/ |
| 7 | + |
| 8 | +mv_embed_iframe(); |
| 9 | + |
| 10 | +function mv_embed_iframe() { |
| 11 | + if(!function_exists('filter_input')){ |
| 12 | + die('your version of php lacks <b>filter_input()</b> function</br>'); |
| 13 | + } |
| 14 | + //default to null media in not provided: |
| 15 | + $query_ary = explode('&', $_SERVER['QUERY_STRING']); |
| 16 | + $row_url = $width = $height =''; |
| 17 | + //rejoin url (could not find the standard encoding for Get URL in requests) |
| 18 | + foreach($query_ary as $get_pair_str){ |
| 19 | + list($key, $val) = explode('=' ,$get_pair_str,2); |
| 20 | + if( $key=='width' ) |
| 21 | + $width = (int) $val; |
| 22 | + |
| 23 | + if( $key == 'height' ) |
| 24 | + $height = (int) $val; |
| 25 | + |
| 26 | + if( $key == 'roe_url' ) |
| 27 | + $roe_url = $val; |
| 28 | + |
| 29 | + if( $key == 'size' ){ |
| 30 | + list( $width, $height ) = explode('x', $val); |
| 31 | + $width = (int) $width; |
| 32 | + $height = (int) $height; |
| 33 | + } |
| 34 | + |
| 35 | + if( substr($get_pair_str, 0, 4) == 'amp;' ) |
| 36 | + $roe_url.= '&' . str_replace('amp;','', $key) .'='. $val; |
| 37 | + } |
| 38 | + if( $roe_url == '' ){ |
| 39 | + die('not valid or missing roe url'); |
| 40 | + } |
| 41 | + |
| 42 | + if( $width=='' ){ |
| 43 | + $width=400; |
| 44 | + } |
| 45 | + if( $height=='' ){ |
| 46 | + $height=300; |
| 47 | + } |
| 48 | + |
| 49 | + //everything good output page: |
| 50 | + output_page(array( |
| 51 | + 'roe_url' => $roe_url, |
| 52 | + 'width' => $width, |
| 53 | + 'height' => $height, |
| 54 | + )); |
| 55 | +} |
| 56 | + |
| 57 | +/** |
| 58 | + * JS escape function copied from MediaWiki's Xml::escapeJsString() |
| 59 | + */ |
| 60 | +function wfEscapeJsString( $string ) { |
| 61 | + // See ECMA 262 section 7.8.4 for string literal format |
| 62 | + $pairs = array( |
| 63 | + "\\" => "\\\\", |
| 64 | + "\"" => "\\\"", |
| 65 | + '\'' => '\\\'', |
| 66 | + "\n" => "\\n", |
| 67 | + "\r" => "\\r", |
| 68 | + |
| 69 | + # To avoid closing the element or CDATA section |
| 70 | + "<" => "\\x3c", |
| 71 | + ">" => "\\x3e", |
| 72 | + |
| 73 | + # To avoid any complaints about bad entity refs |
| 74 | + "&" => "\\x26", |
| 75 | + |
| 76 | + # Work around https://bugzilla.mozilla.org/show_bug.cgi?id=274152 |
| 77 | + # Encode certain Unicode formatting chars so affected |
| 78 | + # versions of Gecko don't misinterpret our strings; |
| 79 | + # this is a common problem with Farsi text. |
| 80 | + "\xe2\x80\x8c" => "\\u200c", // ZERO WIDTH NON-JOINER |
| 81 | + "\xe2\x80\x8d" => "\\u200d", // ZERO WIDTH JOINER |
| 82 | + ); |
| 83 | + return strtr( $string, $pairs ); |
| 84 | +} |
| 85 | + |
| 86 | +function error_out($error=''){ |
| 87 | + output_page(array('error' => $error)); |
| 88 | + exit(); |
| 89 | +} |
| 90 | +function output_page($params){ |
| 91 | + extract( $params ); |
| 92 | +?> |
| 93 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 94 | + <html xmlns="http://www.w3.org/1999/xhtml"> |
| 95 | + <head> |
| 96 | + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
| 97 | + <title>mv_embed iframe</title> |
| 98 | + <style type="text/css"> |
| 99 | + <!-- |
| 100 | + body { |
| 101 | + margin-left: 0px; |
| 102 | + margin-top: 0px; |
| 103 | + margin-right: 0px; |
| 104 | + margin-bottom: 0px; |
| 105 | + } |
| 106 | + --> |
| 107 | + </style> |
| 108 | + <script type="text/javascript" src="mv_embed.js"></script> |
| 109 | + </head> |
| 110 | + <body> |
| 111 | + <video roe="<?php echo htmlspecialchars( $roe_url )?>" width="<?php echo htmlspecialchars( $width )?>" |
| 112 | + height="<?php echo htmlspecialchars( $height )?>"></video> |
| 113 | + </body> |
| 114 | + </html> |
| 115 | +<? |
| 116 | +} |
| 117 | +?> |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -682,7 +682,8 @@ |
683 | 683 | 'pause':{ |
684 | 684 | 'w':24, |
685 | 685 | 'o':function(){ |
686 | | - return '<div id="mv_play_pause_button_'+ctrlBuilder.id+'" class="play_button"><a href="javascript:document.getElementById(\''+ctrlBuilder.id+'\').play();"></a></div>' |
| 686 | + return '<div id="mv_play_pause_button_' + ctrlBuilder.id + '" class="play_button"' + |
| 687 | + 'onClick="$j(\'#' + ctrlBuilder.id + '\').get(0).play()"></div>'; |
687 | 688 | } |
688 | 689 | }, |
689 | 690 | 'closed_captions':{ |
— | — | @@ -1141,314 +1142,11 @@ |
1142 | 1143 | $j('#'+embed_video.id).get(0).init_with_sources_loadedDone==false){ |
1143 | 1144 | //load and set ready state since source are available: |
1144 | 1145 | $j('#'+embed_video.id).get(0).init_with_sources_loaded(); |
1145 | | - } |
1146 | | - //js_log(" isd: "+this.init_with_sources_loadedDone + ' ed:' + ) |
1147 | | - //js_log('vid elm:'+ $j(video_element).html() ); |
1148 | | - /* var parent_elm = video_element.parentNode; |
1149 | | - js_log('remove video elm'); |
1150 | | - parent_elm.removeChild(video_element); |
1151 | | - |
1152 | | - //append the object into the dom: |
1153 | | - js_log('append mvEmbed vid elm'); |
1154 | | - parent_elm.appendChild(embed_video); |
1155 | | - |
1156 | | - embed_video.more_init(); |
1157 | | - |
1158 | | - //now run the getHTML on the new embedVideo Obj: |
1159 | | - embed_video.getHTML(); |
1160 | | - */ |
1161 | | - //js_log('html set:' + document.getElementById(embed_video.id).innerHTML); |
| 1146 | + } |
1162 | 1147 | js_log('done with child: ' + embed_video.id + ' len:' + global_player_list.length); |
1163 | 1148 | return true; |
1164 | 1149 | } |
1165 | | -// text interface object (for inline display captions) |
1166 | | -var textInterface = function(parentEmbed){ |
1167 | | - return this.init(parentEmbed); |
1168 | | -} |
1169 | | -textInterface.prototype = { |
1170 | | - text_lookahead_time:0, |
1171 | | - body_ready:false, |
1172 | | - request_length:5*60, //5 min |
1173 | | - transcript_set:null, |
1174 | | - autoscroll:true, |
1175 | | - scrollTimerId:0, |
1176 | | - availableTracks:{}, |
1177 | | - init:function(parentEmbed){ |
1178 | | - //set the parent embed object: |
1179 | | - this.pe=parentEmbed; |
1180 | | - //parse roe if not already done: |
1181 | | - this.getParseCMML(); |
1182 | | - }, |
1183 | | - //@@todo separate out data loader & data display |
1184 | | - getParseCMML:function(){ |
1185 | | - js_log("load cmml from roe: "+ this.pe.roe); |
1186 | | - //read the current play head time (if embed object is playing) |
1187 | | - |
1188 | | - //if roe not yet loaded do load it: |
1189 | | - if(this.pe.roe){ |
1190 | | - if(!this.pe.media_element.addedROEData){ |
1191 | | - js_log("load roe data!"); |
1192 | | - var _this = this; |
1193 | | - do_request(this.pe.roe, function(data) |
1194 | | - { |
1195 | | - //continue |
1196 | | - _this.pe.media_element.addROE(data); |
1197 | | - _this.getParseCMML_rowReady(); |
1198 | | - }); |
1199 | | - }else{ |
1200 | | - js_log('row data ready (no roe request)'); |
1201 | | - this.getParseCMML_rowReady(); |
1202 | | - } |
1203 | | - }else{ |
1204 | | - js_log('no roe data to get text transcript from'); |
1205 | | - } |
1206 | | - }, |
1207 | | - getParseCMML_rowReady: function (){ |
1208 | | - _this = this; |
1209 | | - $j.each(this.pe.media_element.sources, function(inx, n){ |
1210 | | - if(n.mime_type=='text/cmml'){ |
1211 | | - _this.availableTracks[n.id] = { |
1212 | | - src:n.src, |
1213 | | - title:n.title, |
1214 | | - loaded:false, |
1215 | | - display:false |
1216 | | - } |
1217 | | - //load or skip the track based on "default" attribute |
1218 | | - if(n.marked_default){ |
1219 | | - return; |
1220 | | - }else{ |
1221 | | - //load the track if its default track |
1222 | | - _this.load_track(n.id); |
1223 | | - } |
1224 | | - } |
1225 | | - }); |
1226 | | - }, |
1227 | | - load_track:function(track_id){ |
1228 | | - var _this = this; |
1229 | | - var track = this.availableTracks[track_id]; |
1230 | | - //js_log('cmml available loading track: '+ track.src); |
1231 | | - //add transcript to bodyHTML |
1232 | | - var pcurl = parseUri( track.src ); |
1233 | | - var req_time = pcurl.queryKey['t'].split('/'); |
1234 | | - req_time[0]=ntp2seconds(req_time[0]); |
1235 | | - req_time[1]=ntp2seconds(req_time[1]); |
1236 | | - if(req_time[1]-req_time[0]> _this.request_length){ |
1237 | | - //longer than 5 min will only issue a (request 5 min) |
1238 | | - req_time[1] = req_time[0]+_this.request_length; |
1239 | | - } |
1240 | | - //set up request url: |
1241 | | - url = pcurl.protocol+'://'+pcurl.authority+pcurl.path+'?'; |
1242 | | - $j.each(pcurl.queryKey, function(key, val){ |
1243 | | - if( key != 't'){ |
1244 | | - url+=key+'='+val+'&'; |
1245 | | - }else{ |
1246 | | - url+= 't=' + seconds2ntp(req_time[0]) + '/' + seconds2ntp(req_time[1]) + '&'; |
1247 | | - } |
1248 | | - }); |
1249 | | - $j('#mv_txt_load_'+_this.pe.id).show(); |
1250 | | - do_request(url, function(data){ |
1251 | | - js_log("load track clip count:"+ data.getElementsByTagName('clip').length ); |
1252 | | - //debugger; |
1253 | | - //hide loading icon: |
1254 | | - $j('#mv_txt_load_'+_this.pe.id).fadeOut('fast'); |
1255 | | - $j.each(data.getElementsByTagName('clip'), function(inx, clip){ |
1256 | | - js_log(' on clip ' + clip.id); |
1257 | | - var text_clip = { |
1258 | | - start:$j(clip).attr('start').replace('npt:', ''), |
1259 | | - end:$j(clip).attr('end').replace('npt:', ''), |
1260 | | - type_id:track_id, |
1261 | | - id:$j(clip).attr('id') |
1262 | | - } |
1263 | | - $j.each( clip.getElementsByTagName('body'), function(binx, bn ){ |
1264 | | - if(bn.textContent){ |
1265 | | - text_clip.body = bn.textContent; |
1266 | | - }else if(bn.text){ |
1267 | | - text_clip.body = bn.text; |
1268 | | - } |
1269 | | - }); |
1270 | | - _this.add_merge_text_clip(text_clip); |
1271 | | - }); |
1272 | | - //done loading update availableTracks |
1273 | | - _this.availableTracks[track_id].loaded=true; |
1274 | | - _this.availableTracks[track_id].display=true; |
1275 | | - }); |
1276 | | - }, |
1277 | | - add_merge_text_clip:function(text_clip){ |
1278 | | - //make sure the clip does not already exist: |
1279 | | - if($j('#tc_'+text_clip.id).length==0){ |
1280 | | - var inserted = false; |
1281 | | - var text_clip_start_time = ntp2seconds(text_clip.start); |
1282 | | - var insertHTML = '<div style="border:solid thin black;" id="tc_'+text_clip.id+'" ' + |
1283 | | - 'start="'+text_clip.start+'" end="'+text_clip.end+'" class="mvtt '+text_clip.type_id+'">' + |
1284 | | - '<div style="top:0px;left:0px;right:0px;height:20px;font-size:small">'+ |
1285 | | - '<img style="display:inline;" src="'+mv_embed_path+'/images/control_play_blue.png">'+ |
1286 | | - text_clip.start + ' to ' +text_clip.end+ |
1287 | | - '</div>'+ |
1288 | | - text_clip.body + |
1289 | | - '</div>'; |
1290 | | - if($j('#mmbody_'+this.pe.id).length==0)this.show(); |
1291 | | - $j('#mmbody_'+this.pe.id +' .mvtt').each(function(){ |
1292 | | - if(!inserted){ |
1293 | | - //js_log( ntp2seconds($j(this).attr('start')) + ' > ' + text_clip_start_time); |
1294 | | - if( ntp2seconds($j(this).attr('start')) > text_clip_start_time){ |
1295 | | - inserted=true; |
1296 | | - $j(this).before(insertHTML); |
1297 | | - } |
1298 | | - } |
1299 | | - }); |
1300 | | - //js_log('should just append: '+insertHTML); |
1301 | | - if(!inserted){ |
1302 | | - $j('#mmbody_'+this.pe.id ).append(insertHTML); |
1303 | | - } |
1304 | | - } |
1305 | | - }, |
1306 | | - show:function(){ |
1307 | | - js_log("f:show() text interface"); |
1308 | | - /*slide in interface container*/ |
1309 | | - //dont' know how 'px' creeps in here: |
1310 | | - this.pe.height = this.pe.height.replace('px', ''); |
1311 | | - |
1312 | | - if($j('#metaBox_'+this.pe.id).length==0){ |
1313 | | - //append it to body relative to offset of this.pe |
1314 | | - var loc = $j(this.pe).position(); |
1315 | | - //js_log('top ' +loc.top + ' left:'+loc.left ); |
1316 | | - $j(this.pe).after('<div style="position:absolute;z-index:'+($j(this.pe).css("zindex")+1) + ';'+ |
1317 | | - 'top:'+(loc.top)+'px;' + |
1318 | | - 'left:'+(parseInt(loc.left)+parseInt(this.pe.width)+10)+'px;' + |
1319 | | - 'height:'+this.pe.height+'px;width:400px;' + |
1320 | | - 'background:white;border:solid black;" ' + |
1321 | | - 'id="metaBox_'+this.pe.id+'">' + |
1322 | | - this.getMenu() + |
1323 | | - this.getBody() + |
1324 | | - '</div>'); |
1325 | | - //$j('body').append(); |
1326 | | - }else{ |
1327 | | - $j('#metaBox_'+this.pe.id).fadeIn("fast"); |
1328 | | - } |
1329 | | - //start the autoscroll timer: |
1330 | | - if(this.autoscroll){ |
1331 | | - _this.setAutoScroll(); |
1332 | | - } |
1333 | | - }, |
1334 | | - close:function(){ |
1335 | | - //the meta box: |
1336 | | - $j('#metaBox_'+this.pe.id).fadeOut('fast'); |
1337 | | - //the icon link: |
1338 | | - $j('#metaButton_'+this.pe.id).fadeIn('fast'); |
1339 | | - }, |
1340 | | - getBody:function(){ |
1341 | | - return '<div id="mmbody_'+this.pe.id+'" ' + |
1342 | | - 'style="position:absolute;top:20px;left:0px;' + |
1343 | | - 'right:0px;bottom:0px;' + |
1344 | | - 'height:'+(this.pe.height-20)+ |
1345 | | - 'px;overflow:auto;"><span id="mv_txt_load_' + _this.pe.id + '">'+ |
1346 | | - getMsg('loading_txt')+'</span>' + |
1347 | | - '</div>'; |
1348 | | - }, |
1349 | | - getTsSelect:function(){ |
1350 | | - js_log('getTsSelect'); |
1351 | | - //check if menu already present |
1352 | | - if($j('mvtsel_'+this.pe.id).length!=0){ |
1353 | | - $j('mvtsel_'+this.pe.id).fadeIn('fast'); |
1354 | | - }else{ |
1355 | | - var selHTML = '<div id="mvtsel_'+this.pe.id+'" style="position:absolute;background:#FFF;top:20px;left:0px;right:0px;bottom:0px;overflow:auto;">'; |
1356 | | - selHTML+='<b>'+getMsg('select_transcript_set')+'</b><ul>'; |
1357 | | - for(var i in this.availableTracks){ //for in loop ok on object |
1358 | | - var checked = (this.availableTracks[i].display)?'checked':''; |
1359 | | - selHTML+='<li><input name="'+i+'" class="mvTsSelect" type="checkbox" '+checked+'>'+ |
1360 | | - this.availableTracks[i].title + '</li>'; |
1361 | | - } |
1362 | | - selHTML+='</ul>' + |
1363 | | - '<a href="#" onClick="document.getElementById(\''+this.pe.id+'\').textInterface.applyTsSelect();return false;">'+getMsg('close')+'</a>'+ |
1364 | | - '</div>'; |
1365 | | - $j('#metaBox_'+this.pe.id).append(selHTML); |
1366 | | - //js_log('appended: '+ selHTML); |
1367 | | - } |
1368 | | - }, |
1369 | | - applyTsSelect:function(){ |
1370 | | - //update availableTracks |
1371 | | - var _this = this; |
1372 | | - $j('#mvtsel_'+this.pe.id+' .mvTsSelect').each(function(){ |
1373 | | - if(this.checked){ |
1374 | | - //if not yet loaded now would be a good time |
1375 | | - if(!_this.availableTracks[this.name].loaded){ |
1376 | | - _this.load_track( this.name); //will load and dispaly |
1377 | | - }else{ |
1378 | | - _this.availableTracks[this.name].display=true; |
1379 | | - $j('#mmbody_'+_this.pe.id +' .'+this.name ).fadeIn("fast"); |
1380 | | - } |
1381 | | - }else{ |
1382 | | - if(_this.availableTracks[this.name].display){ |
1383 | | - _this.availableTracks[this.name].display=false; |
1384 | | - $j('#mmbody_'+_this.pe.id +' .'+this.name ).fadeOut("fast"); |
1385 | | - } |
1386 | | - } |
1387 | | - }); |
1388 | | - $j('#mvtsel_'+this.pe.id).fadeOut('fast'); |
1389 | | - }, |
1390 | | - monitor:function(){ |
1391 | | - //grab the time from the video object |
1392 | | - var cur_time = parseInt( this.pe.currentTime ); |
1393 | | - if(cur_time!=0 && this.prevTimeScroll!=cur_time){ |
1394 | | - //search for current time: flash red border trascript |
1395 | | - _this = this; |
1396 | | - $j('#mmbody_'+this.pe.id +' .mvtt').each(function(){ |
1397 | | - if(ntp2seconds($j(this).attr('start')) == cur_time){ |
1398 | | - _this.prevTimeScroll=cur_time; |
1399 | | - $j('#mmbody_'+_this.pe.id).animate({scrollTop: $j(this).get(0).offsetTop}, 'slow'); |
1400 | | - } |
1401 | | - }); |
1402 | | - } |
1403 | | - }, |
1404 | | - setAutoScroll:function( timer ){ |
1405 | | - this.autoscroll = ( typeof timer=='undefined' )?this.autoscroll:timer; |
1406 | | - if(this.autoscroll){ |
1407 | | - //start the timer if its not already running |
1408 | | - if(!this.scrollTimerId){ |
1409 | | - this.scrollTimerId = setInterval('$j(\'#'+this.pe.id+'\').get(0).textInterface.monitor()', 500); |
1410 | | - } |
1411 | | - //jump to the current position: |
1412 | | - var cur_time = parseInt (this.pe.currentTime ); |
1413 | | - js_log('cur time: '+ cur_time); |
1414 | 1150 | |
1415 | | - _this = this; |
1416 | | - var scroll_to_id=''; |
1417 | | - $j('#mmbody_'+this.pe.id +' .mvtt').each(function(){ |
1418 | | - if(cur_time > ntp2seconds($j(this).attr('start')) ){ |
1419 | | - _this.prevTimeScroll=cur_time; |
1420 | | - if( $j(this).attr('id') ) |
1421 | | - scroll_to_id = $j(this).attr('id'); |
1422 | | - } |
1423 | | - }); |
1424 | | - if(scroll_to_id != '') |
1425 | | - $j( '#mmbody_' + _this.pe.id ).animate( { scrollTop: $j('#'+scroll_to_id).position().top } , 'slow' ); |
1426 | | - }else{ |
1427 | | - //stop the timer |
1428 | | - clearInterval(this.scrollTimerId); |
1429 | | - this.scrollTimerId=0; |
1430 | | - } |
1431 | | - }, |
1432 | | - getMenu:function(){ |
1433 | | - var out=''; |
1434 | | - //add in loading icon: |
1435 | | - var as_checked = (this.autoscroll)?'checked':''; |
1436 | | - out+= '<div id="mmenu_'+this.pe.id+'" style="background:#AAF;font-size:small;position:absolute;top:0;height:20px;left:0px;right:0px;">' + |
1437 | | - '<a style="font-color:#000;" title="'+getMsg('close')+'" href="#" onClick="document.getElementById(\''+this.pe.id+'\').closeTextInterface();return false;">'+ |
1438 | | - '<img border="0" width="16" height="16" src="'+mv_embed_path + 'images/cancel.png"></a> ' + |
1439 | | - '<a style="font-color:#000;" title="'+getMsg('select_transcript_set')+'" href="#" onClick="document.getElementById(\''+this.pe.id+'\').textInterface.getTsSelect();return false;">'+ |
1440 | | - getMsg('select_transcript_set')+'</a> | ' + |
1441 | | - '<input onClick="document.getElementById(\''+this.pe.id+'\').textInterface.setAutoScroll(this.checked);return false;" ' + |
1442 | | - 'type="checkbox" '+as_checked +'>'+getMsg('auto_scroll'); |
1443 | | - if(this.pe.media_element.linkback){ |
1444 | | - out+=' | <a style="font-color:#000;" title="'+getMsg('improve_transcript')+'" href="'+this.pe.media_element.linkback+'" target="_new">'+ |
1445 | | - getMsg('improve_transcript')+'</a> '; |
1446 | | - } |
1447 | | - out+='</div>'; |
1448 | | - return out; |
1449 | | - } |
1450 | | -} |
1451 | | - |
1452 | | - |
1453 | 1151 | /** |
1454 | 1152 | * mediaSource class represents a source for a media element. |
1455 | 1153 | * @param {String} type MIME type of the source. |
— | — | @@ -1460,13 +1158,16 @@ |
1461 | 1159 | this.init(element); |
1462 | 1160 | } |
1463 | 1161 | |
1464 | | -var default_source_attr={ |
1465 | | - 'src':'', |
1466 | | - 'title':'', |
1467 | | - 'timeFormat':'anx', |
1468 | | - 'start':'', |
1469 | | - 'end':'' |
1470 | | -} |
| 1162 | +var mv_default_source_attr= new Array( |
| 1163 | + 'id', |
| 1164 | + 'src', |
| 1165 | + 'title', |
| 1166 | + 'timeFormat', |
| 1167 | + 'start', |
| 1168 | + 'end', |
| 1169 | + 'default', |
| 1170 | + 'lang' |
| 1171 | +); |
1471 | 1172 | mediaSource.prototype = |
1472 | 1173 | { |
1473 | 1174 | /** MIME type of the source. */ |
— | — | @@ -1497,20 +1198,23 @@ |
1498 | 1199 | this.marked_default = false; |
1499 | 1200 | if ( element.tagName.toLowerCase() == 'video') |
1500 | 1201 | this.marked_default = true; |
1501 | | - |
1502 | | - for(var attr in default_source_attr){ //for in loop oky on object |
| 1202 | + |
| 1203 | + //set default timeFormat: |
| 1204 | + this['timeFormat']='anx'; |
| 1205 | + |
| 1206 | + for(var i=0; i < mv_default_source_attr.length; i++){ //for in loop oky on object |
| 1207 | + var attr = mv_default_source_attr[ i ]; |
1503 | 1208 | if( $j(element).attr( attr ) ) { |
1504 | 1209 | this[ attr ] = $j(element).attr( attr ); |
1505 | | - }else{ |
1506 | | - this[ attr ] = default_source_attr[ attr ]; |
1507 | 1210 | } |
1508 | 1211 | } |
1509 | 1212 | |
| 1213 | + |
1510 | 1214 | if ( $j(element).attr('type')) |
1511 | 1215 | this.mime_type = $j(element).attr('type'); |
1512 | 1216 | else if ($j(element).attr('content-type')) |
1513 | 1217 | this.mime_type = $j(element).attr('content-type'); |
1514 | | - else |
| 1218 | + else |
1515 | 1219 | this.mime_type = this.detectType(this.src); |
1516 | 1220 | |
1517 | 1221 | //set the title if unset: |
— | — | @@ -1613,8 +1317,7 @@ |
1614 | 1318 | * special case derive duration from request url |
1615 | 1319 | * supports media_url?t=ntp_start/ntp_end url request format |
1616 | 1320 | */ |
1617 | | - parseURLDuration : function(){ |
1618 | | - js_log('f:parseURLDuration() for:' + this.src); |
| 1321 | + parseURLDuration : function(){ |
1619 | 1322 | //check if we have a timeFormat: |
1620 | 1323 | if( this.timeFormat ){ |
1621 | 1324 | if( this.timeFormat == 'anx' ){ |
— | — | @@ -1648,6 +1351,7 @@ |
1649 | 1352 | this.start_offset = 0; |
1650 | 1353 | this.start_ntp = seconds2ntp(this.start_offset); |
1651 | 1354 | } |
| 1355 | + js_log('f:parseURLDuration() for:' + this.src + ' d:' + this.duration); |
1652 | 1356 | }, |
1653 | 1357 | /** Attempts to detect the type of a media file based on the URI. |
1654 | 1358 | @param {String} uri URI of the media file. |
— | — | @@ -2073,8 +1777,7 @@ |
2074 | 1778 | this.load_error= getMsg('generic_missing_plugin', missing_type ); |
2075 | 1779 | } |
2076 | 1780 | }, |
2077 | | - inheritEmbedObj:function(){ |
2078 | | - js_log("f: inheritEmbedObj"); |
| 1781 | + inheritEmbedObj:function(){ |
2079 | 1782 | //@@note: tricky cuz direct overwrite is not so ideal.. since the extended object is already tied to the dom |
2080 | 1783 | //clear out any non-base embedObj stuff: |
2081 | 1784 | if(this.instanceOf){ |
— | — | @@ -2086,9 +1789,9 @@ |
2087 | 1790 | this[i]=null; |
2088 | 1791 | } |
2089 | 1792 | } |
2090 | | - } |
| 1793 | + } |
2091 | 1794 | //set up the new embedObj |
2092 | | - js_log('embedding with ' + this.selected_player.library); |
| 1795 | + js_log('f: inheritEmbedObj: embedding with ' + this.selected_player.library); |
2093 | 1796 | var _this = this; |
2094 | 1797 | this.selected_player.load( function() |
2095 | 1798 | { |
— | — | @@ -2103,6 +1806,8 @@ |
2104 | 1807 | _this['parent_' + method] = _this[method]; |
2105 | 1808 | _this[method]=embedObj[method]; |
2106 | 1809 | } |
| 1810 | + js_log('TYPEOF_ppause: ' + typeof _this['parent_pause']); |
| 1811 | + |
2107 | 1812 | if(_this.inheritEmbedOverride){ |
2108 | 1813 | _this.inheritEmbedOverride(); |
2109 | 1814 | } |
— | — | @@ -2202,7 +1907,8 @@ |
2203 | 1908 | js_log('changed embed code'); |
2204 | 1909 | _this.paused = false; |
2205 | 1910 | _this.thumbnail_disp=false; |
2206 | | - $j("#mv_play_pause_button_"+_this.id).attr('class', 'pause_button'); |
| 1911 | + $j("#mv_play_pause_button_"+ _this.id).attr('class', 'pause_button'); |
| 1912 | + $j("#mv_play_pause_button_"+ _this.id).attr('onClick', '$j(\'#'+_this.id+'\').get(0).pause()'); |
2207 | 1913 | }); |
2208 | 1914 | }, |
2209 | 1915 | /* todo abstract out onClipDone chain of functions and merge with textInterface */ |
— | — | @@ -2223,7 +1929,7 @@ |
2224 | 1930 | $j('#dc_'+this.id).append('<div id="liks_info_'+this.id+'" ' + |
2225 | 1931 | 'style="width:' +parseInt(parseInt(this.width)/2)+'px;'+ |
2226 | 1932 | 'height:'+ parseInt(parseInt(this.height)) +'px;'+ |
2227 | | - 'position:absolute;top:10px;'+ |
| 1933 | + 'position:absolute;top:10px;overflow:auto'+ |
2228 | 1934 | 'width: '+parseInt( ((parseInt(this.width)/2)-15) ) + 'px;'+ |
2229 | 1935 | 'left:'+ parseInt( ((parseInt(this.width)/2)+15) ) +'px;">'+ |
2230 | 1936 | '</div>' + |
— | — | @@ -2421,7 +2127,11 @@ |
2422 | 2128 | $j('#mv_embedded_player_'+this.id).html( this.getThumbnailHTML() ); |
2423 | 2129 | this.paused = true; |
2424 | 2130 | if(!this.pc) //if not in playlist mode update the play_pause button: |
2425 | | - $j("#mv_play_pause_button_"+this.id).attr('class', 'play_button'); |
| 2131 | + $j("#mv_play_pause_button_" + this.id).attr({ |
| 2132 | + 'class':'play_button', |
| 2133 | + 'onClick':'$j(\'#' + this.id + '\').get(0).play()' |
| 2134 | + }); |
| 2135 | + |
2426 | 2136 | }, |
2427 | 2137 | refreshControlsHTML:function(){ |
2428 | 2138 | js_log('refreshing controls HTML'); |
— | — | @@ -2678,12 +2388,38 @@ |
2679 | 2389 | } |
2680 | 2390 | }, |
2681 | 2391 | showTextInterface:function(){ |
| 2392 | + var _this = this; |
| 2393 | + //display the text container with loading text: |
| 2394 | + //@@todo support position config |
| 2395 | + var loc = $j(this).position(); |
| 2396 | + if($j('#metaBox_'+this.id).length==0){ |
| 2397 | + $j(this).after('<div style="position:absolute;z-index:' + ($j(this).css("zindex") + 1) + ';'+ |
| 2398 | + 'top:' + (loc.top) + 'px;' + |
| 2399 | + 'left:' + (parseInt( loc.left ) + parseInt(this.width) + 10 )+'px;' + |
| 2400 | + 'height:'+ parseInt( this.height )+'px;width:400px;' + |
| 2401 | + 'background:white;border:solid black;' + |
| 2402 | + 'display:none;" ' + |
| 2403 | + 'id="metaBox_' + this.id + '">'+ |
| 2404 | + getMsg('loading_txt') + |
| 2405 | + '</div>'); |
| 2406 | + } |
| 2407 | + //fade in the text display |
| 2408 | + $j('#metaBox_'+this.id).fadeIn("fast"); |
2682 | 2409 | //check if textObj present: |
2683 | 2410 | if(typeof this.textInterface == 'undefined' ){ |
2684 | | - this.textInterface = new textInterface(this); |
| 2411 | + //load the default text interface: |
| 2412 | + mvJsLoader.doLoad({ |
| 2413 | + 'textInterface':'timedTextLibs/mv_timed_text.js' |
| 2414 | + }, function(){ |
| 2415 | + _this.textInterface = new textInterface( _this ); |
| 2416 | + //show interface |
| 2417 | + _this.textInterface.show(); |
| 2418 | + } |
| 2419 | + ); |
| 2420 | + }else{ |
| 2421 | + //show interface |
| 2422 | + this.textInterface.show(); |
2685 | 2423 | } |
2686 | | - //show interface |
2687 | | - this.textInterface.show(); |
2688 | 2424 | }, |
2689 | 2425 | closeTextInterface:function(){ |
2690 | 2426 | js_log('closeTextInterface '+ typeof this.textInterface); |
— | — | @@ -2853,7 +2589,7 @@ |
2854 | 2590 | * the play button calls |
2855 | 2591 | */ |
2856 | 2592 | play:function(){ |
2857 | | - var this_id = (this.pc!=null)?this.pc.pp.id:this.id; |
| 2593 | + var this_id = (this.pc!=null)?this.pc.pp.id:this.id; |
2858 | 2594 | js_log( "mv_embed play:" + this.id); |
2859 | 2595 | js_log('thum disp:'+this.thumbnail_disp); |
2860 | 2596 | //check if thumbnail is being displayed and embed html |
— | — | @@ -2869,13 +2605,13 @@ |
2870 | 2606 | this.paused=false; |
2871 | 2607 | } |
2872 | 2608 | }else{ |
2873 | | - //the plugin is already being displayed |
2874 | | - js_log("we are already playing..." ); |
| 2609 | + //the plugin is already being displayed |
2875 | 2610 | this.paused=false; //make sure we are not "paused" |
2876 | | - } |
2877 | | - js_log(' did not run?'); |
2878 | | - $j("#mv_play_pause_button_"+this_id).attr('class', 'pause_button'); |
2879 | | - $j("#mv_play_pause_button_"+this_id).attr('onClick', '$j(\'#'+this_id+'\').get(0).pause()'); |
| 2611 | + } |
| 2612 | + $j("#mv_play_pause_button_"+this.id).attr({ |
| 2613 | + 'class':'pause_button', |
| 2614 | + 'onClick':'$j(\'#'+this_id+'\').get(0).pause()' |
| 2615 | + }); |
2880 | 2616 | }, |
2881 | 2617 | /* |
2882 | 2618 | * base embed pause |
— | — | @@ -2888,8 +2624,10 @@ |
2889 | 2625 | //(playing) do pause |
2890 | 2626 | this.paused=true; |
2891 | 2627 | //update the ctrl "paused state" |
2892 | | - $j("#mv_play_pause_button_"+this_id).attr('class', 'play_button'); |
2893 | | - $j("#mv_play_pause_button_"+this_id).attr('onClick', '$j(\'#'+this_id+'\').get(0).play()'); |
| 2628 | + $j("#mv_play_pause_button_"+this.id).attr({ |
| 2629 | + 'class':'play_button', |
| 2630 | + 'onClick':'$j(\'#'+this_id+'\').get(0).play()' |
| 2631 | + }); |
2894 | 2632 | }, |
2895 | 2633 | /*play_or_pause: function(){ |
2896 | 2634 | js_log('embed:f:play_or_pause'); |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/cortado_iframe.php |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | |
11 | 11 | function cortado_iframe() { |
12 | 12 | if(!function_exists('filter_input')){ |
13 | | - error_out('your version of php lacks <b>filter_input()</b> function</br>'); |
| 13 | + die('your version of php lacks <b>filter_input()</b> function</br>'); |
14 | 14 | } |
15 | 15 | //load the http GETS: |
16 | 16 | // set the parent domain if provided |