r44351 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44350‎ | r44351 | r44352 >
Date:18:10, 9 December 2008
Author:dale
Status:deferred
Tags:
Comment:
* Timed text abstracted to separate library. (enabling easy support for other timed text formats such as .str)
* mv_embed_iframe.php ( entry point ) for cross site embedding without mv_embed.js javascript exposure. see: http://metavid.org/wiki/Security_Notes_on_Remote_Embedding
* pause_or_play() replaced with pause() or play() embed libraries updated
* style updates for sequencer
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/cortado_iframe.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_flashEmbed.js (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/sample_page.php (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_timed_text.html (added) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed_iframe.php (added) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/skins/mvpcf/images/opened.png (added) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/timedTextLibs (added) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_embed/timedTextLibs/mv_timed_text.js (added) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php
@@ -281,8 +281,11 @@
282282 $query = 'stream_name=' . $this->stream_name . '&t=' . $this->req_time . '&feed_format=cmml&tracks=' . strtolower( $row->mvd_type );
283283 $clink = $sTitle->getFullURL( $query );
284284 $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+ '';
287290 ?>
288291 <mediaSource id="<?php echo htmlentities( $row->mvd_type )?>"
289292 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 @@
4848 $sample_embed[2]['desc'] = 'simple video with controls and thumbnail';
4949
5050
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>';
5252 $sample_embed[3]['desc'] = 'Demo of ROE only attribute';
5353
5454
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 @@
135135 },
136136 pause : function(){
137137 this.getVID();
 138+ this.parent_pause(); //update interface
138139 if(this.vid){
139140 this.vid.pause();
140141 }
@@ -142,9 +143,8 @@
143144 },
144145 play:function(){
145146 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 ){
149149 this.vid.play();
150150 //re-start the monitor:
151151 this.monitor();
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_flashEmbed.js
@@ -1603,24 +1603,18 @@
16041604 //get the this.fla value:
16051605 this.getFLA();
16061606 //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
16121609 })
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
16181612 });
16191613 //start monitor:
16201614 this.monitor();
16211615 this.old_pid++;
16221616 },
16231617 /* js hooks/controls */
1624 - play: function(){
 1618+ play: function(){
16251619 this.getFLA();
16261620 //update play/pause button etc
16271621 this.parent_play();
@@ -1651,9 +1645,13 @@
16521646 {
16531647 this.getFLA();
16541648 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+ }
16581656 },
16591657 monitor : function()
16601658 {
@@ -1760,8 +1758,7 @@
17611759 onClipDone: function(){
17621760 js_log('f:flash:onClipDone');
17631761 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) ');
17661763 //keep monitoring:
17671764 this.monitor();
17681765 }else{
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_vlcEmbed.js
@@ -23,7 +23,7 @@
2424 userSlide:false,
2525 pejs_count:0, //post embed js count
2626
27 - getEmbedHTML : function(){
 27+ getEmbedHTML: function(){
2828 //give VLC 150ms to initialize before we start playback
2929 //@@todo should be able to do this as an ready event
3030 this.pejs_count=0;
@@ -48,7 +48,7 @@
4949 /*
5050 * some java script to start vlc playback after the embed:
5151 */
52 - postEmbedJS : function(){
 52+ postEmbedJS: function(){
5353 //load a pointer to the vlc into the object (this.vlc)
5454 this.getVLC();
5555 if( this.vlc.log ){
@@ -92,14 +92,14 @@
9393 }
9494 }
9595 },*/
96 - playMovieAt : function (order){
 96+ playMovieAt: function (order){
9797 //@@todo add clips to playlist after (order) and then play
9898 this.play();
9999 },
100100 /*
101101 * updates the status time
102102 */
103 - monitor : function(){
 103+ monitor: function(){
104104 this.getVLC();
105105 if(this.vlc.log){
106106 //js_log( 'state:' + this.vlc.input.state);
@@ -162,26 +162,26 @@
163163 }
164164 },
165165 /* events */
166 - onOpen : function(){
 166+ onOpen: function(){
167167 this.setStatus("Opening...");
168168 //document.getElementById("info_"+this.id).innerHTML = "Opening...";
169169 //document.getElementById("PlayOrPause").disabled = true;
170170 //document.getElementById("Stop").disabled = false;
171171 },
172 - onBuffer : function(){
 172+ onBuffer: function(){
173173 this.setStatus("Buffering...");
174174 //document.getElementById("info_"+this.id).innerHTML = "Buffering...";
175175 //document.getElementById("PlayOrPause").disabled = true;
176176 //document.getElementById("Stop").disabled = false;
177177 },
178 - onPlay : function(){
 178+ onPlay: function(){
179179 //document.getElementById("PlayOrPause").value = "Pause";
180180 //document.getElementById("PlayOrPause").disabled = false;
181181 //document.getElementById("Stop").disabled = false;
182182 this.onPlaying();
183183 },
184 - liveFeedRoll : 0,
185 - onPlaying : function(){
 184+ liveFeedRoll: 0,
 185+ onPlaying: function(){
186186 if(this.seek_time_sec != 0 && !this.media_element.selected_source.supports_url_time_encoding)
187187 {
188188 // VLC seems to have a problem seeking into the future this way
@@ -248,10 +248,10 @@
249249 this.setStatus('live');
250250 }
251251 },
252 - onPause : function(){
253 - //document.getElementById("PlayOrPause").value = " Play ";
 252+ onPause: function(){
 253+ this.parent_pause(); //update the inteface if paused via native control
254254 },
255 - onStop : function(){
 255+ onStop: function(){
256256 //
257257 // disable logging
258258 this.vlc.log.verbosity = -1;
@@ -302,6 +302,7 @@
303303 this.parent_stop();
304304 },
305305 pause : function(){
 306+ this.parent_pause(); //update the inteface if paused via native control
306307 this.vlc.playlist.togglePause();
307308 },
308309 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
309310 + *
Added: svn:mime-type
310311 + 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 @@
683683 'pause':{
684684 'w':24,
685685 '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>';
687688 }
688689 },
689690 'closed_captions':{
@@ -1141,314 +1142,11 @@
11421143 $j('#'+embed_video.id).get(0).init_with_sources_loadedDone==false){
11431144 //load and set ready state since source are available:
11441145 $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+ }
11621147 js_log('done with child: ' + embed_video.id + ' len:' + global_player_list.length);
11631148 return true;
11641149 }
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);
14141150
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 -
14531151 /**
14541152 * mediaSource class represents a source for a media element.
14551153 * @param {String} type MIME type of the source.
@@ -1460,13 +1158,16 @@
14611159 this.init(element);
14621160 }
14631161
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+);
14711172 mediaSource.prototype =
14721173 {
14731174 /** MIME type of the source. */
@@ -1497,20 +1198,23 @@
14981199 this.marked_default = false;
14991200 if ( element.tagName.toLowerCase() == 'video')
15001201 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 ];
15031208 if( $j(element).attr( attr ) ) {
15041209 this[ attr ] = $j(element).attr( attr );
1505 - }else{
1506 - this[ attr ] = default_source_attr[ attr ];
15071210 }
15081211 }
15091212
 1213+
15101214 if ( $j(element).attr('type'))
15111215 this.mime_type = $j(element).attr('type');
15121216 else if ($j(element).attr('content-type'))
15131217 this.mime_type = $j(element).attr('content-type');
1514 - else
 1218+ else
15151219 this.mime_type = this.detectType(this.src);
15161220
15171221 //set the title if unset:
@@ -1613,8 +1317,7 @@
16141318 * special case derive duration from request url
16151319 * supports media_url?t=ntp_start/ntp_end url request format
16161320 */
1617 - parseURLDuration : function(){
1618 - js_log('f:parseURLDuration() for:' + this.src);
 1321+ parseURLDuration : function(){
16191322 //check if we have a timeFormat:
16201323 if( this.timeFormat ){
16211324 if( this.timeFormat == 'anx' ){
@@ -1648,6 +1351,7 @@
16491352 this.start_offset = 0;
16501353 this.start_ntp = seconds2ntp(this.start_offset);
16511354 }
 1355+ js_log('f:parseURLDuration() for:' + this.src + ' d:' + this.duration);
16521356 },
16531357 /** Attempts to detect the type of a media file based on the URI.
16541358 @param {String} uri URI of the media file.
@@ -2073,8 +1777,7 @@
20741778 this.load_error= getMsg('generic_missing_plugin', missing_type );
20751779 }
20761780 },
2077 - inheritEmbedObj:function(){
2078 - js_log("f: inheritEmbedObj");
 1781+ inheritEmbedObj:function(){
20791782 //@@note: tricky cuz direct overwrite is not so ideal.. since the extended object is already tied to the dom
20801783 //clear out any non-base embedObj stuff:
20811784 if(this.instanceOf){
@@ -2086,9 +1789,9 @@
20871790 this[i]=null;
20881791 }
20891792 }
2090 - }
 1793+ }
20911794 //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);
20931796 var _this = this;
20941797 this.selected_player.load( function()
20951798 {
@@ -2103,6 +1806,8 @@
21041807 _this['parent_' + method] = _this[method];
21051808 _this[method]=embedObj[method];
21061809 }
 1810+ js_log('TYPEOF_ppause: ' + typeof _this['parent_pause']);
 1811+
21071812 if(_this.inheritEmbedOverride){
21081813 _this.inheritEmbedOverride();
21091814 }
@@ -2202,7 +1907,8 @@
22031908 js_log('changed embed code');
22041909 _this.paused = false;
22051910 _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()');
22071913 });
22081914 },
22091915 /* todo abstract out onClipDone chain of functions and merge with textInterface */
@@ -2223,7 +1929,7 @@
22241930 $j('#dc_'+this.id).append('<div id="liks_info_'+this.id+'" ' +
22251931 'style="width:' +parseInt(parseInt(this.width)/2)+'px;'+
22261932 'height:'+ parseInt(parseInt(this.height)) +'px;'+
2227 - 'position:absolute;top:10px;'+
 1933+ 'position:absolute;top:10px;overflow:auto'+
22281934 'width: '+parseInt( ((parseInt(this.width)/2)-15) ) + 'px;'+
22291935 'left:'+ parseInt( ((parseInt(this.width)/2)+15) ) +'px;">'+
22301936 '</div>' +
@@ -2421,7 +2127,11 @@
24222128 $j('#mv_embedded_player_'+this.id).html( this.getThumbnailHTML() );
24232129 this.paused = true;
24242130 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+
24262136 },
24272137 refreshControlsHTML:function(){
24282138 js_log('refreshing controls HTML');
@@ -2678,12 +2388,38 @@
26792389 }
26802390 },
26812391 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");
26822409 //check if textObj present:
26832410 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();
26852423 }
2686 - //show interface
2687 - this.textInterface.show();
26882424 },
26892425 closeTextInterface:function(){
26902426 js_log('closeTextInterface '+ typeof this.textInterface);
@@ -2853,7 +2589,7 @@
28542590 * the play button calls
28552591 */
28562592 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;
28582594 js_log( "mv_embed play:" + this.id);
28592595 js_log('thum disp:'+this.thumbnail_disp);
28602596 //check if thumbnail is being displayed and embed html
@@ -2869,13 +2605,13 @@
28702606 this.paused=false;
28712607 }
28722608 }else{
2873 - //the plugin is already being displayed
2874 - js_log("we are already playing..." );
 2609+ //the plugin is already being displayed
28752610 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+ });
28802616 },
28812617 /*
28822618 * base embed pause
@@ -2888,8 +2624,10 @@
28892625 //(playing) do pause
28902626 this.paused=true;
28912627 //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+ });
28942632 },
28952633 /*play_or_pause: function(){
28962634 js_log('embed:f:play_or_pause');
Index: trunk/extensions/MetavidWiki/skins/mv_embed/cortado_iframe.php
@@ -9,7 +9,7 @@
1010
1111 function cortado_iframe() {
1212 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>');
1414 }
1515 //load the http GETS:
1616 // set the parent domain if provided

Status & tagging log