Index: trunk/extensions/MetavidWiki/skins/mv_embed/cortado_iframe.php |
— | — | @@ -106,11 +106,27 @@ |
107 | 107 | <head> |
108 | 108 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
109 | 109 | <title>cortado_embed</title> |
110 | | - <?php if( !empty( $parent_domain ) ){?> |
111 | 110 | <script type="text/javascript"> |
112 | | - window.DOMAIN = '<?php echo escapeJsString( $parent_domain ); ?>'; |
| 111 | + var i = 1; |
| 112 | + var last_msg=''; |
| 113 | + function doMonitor(){ |
| 114 | + //get the current time: |
| 115 | + var jce = document.getElementById('<?php echo htmlspecialchars( $id ) ?>'); |
| 116 | + if(jce){ |
| 117 | + //setup the msg: |
| 118 | + var hash = 'currentTime=' + jce.getPlayPosition(); |
| 119 | + |
| 120 | + //update the msg frame hash: |
| 121 | + window.top['mvMsgFrame'].location = '#' + hash; |
| 122 | + top.location = '#' + hash; |
| 123 | + |
| 124 | + } |
| 125 | + |
| 126 | + setTimeout(doMonitor, 1000); |
| 127 | + i++; |
| 128 | + } |
| 129 | + setTimeout(doMonitor, 1000); |
113 | 130 | </script> |
114 | | - <?php }?> |
115 | 131 | <style type="text/css"> |
116 | 132 | <!-- |
117 | 133 | body { |
— | — | @@ -125,7 +141,7 @@ |
126 | 142 | <?php if (empty($error)){ ?> |
127 | 143 | <applet id="<?php echo htmlspecialchars( $id ) ?>" |
128 | 144 | code="com.fluendo.player.Cortado.class" |
129 | | - archive="cortado-ovt-stripped_r34336.jar" |
| 145 | + archive="cortado-svn.jar" |
130 | 146 | width="<?php echo htmlspecialchars( $width )?>" |
131 | 147 | height="<?php echo htmlspecialchars( $height )?>" |
132 | 148 | > |
— | — | @@ -140,7 +156,9 @@ |
141 | 157 | <param name="duration" value="<?php echo htmlspecialchars( $duration )?>" /> |
142 | 158 | <? |
143 | 159 | } ?> |
144 | | - <param name="bufferSize" value="200" /> |
| 160 | + <param name='BufferSize' value='8192'> |
| 161 | + <param name='BufferHigh' value='30'> |
| 162 | + <param name='BufferLow' value='5'> |
145 | 163 | </applet> |
146 | 164 | <? }else{ ?> |
147 | 165 | <b>Error:</b> <?php echo htmlspecialchars( $error )?> |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/cortado-svn.jar |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/cortado-svn.jar |
___________________________________________________________________ |
Added: svn:mime-type |
148 | 166 | + application/octet-stream |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sample_page.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | <html> |
14 | 14 | <head> |
15 | 15 | <title>sample mv embed</title> |
16 | | - <script type="text/javascript" src="../mv_embed.js?<?php echo time()?>"></script> |
| 16 | + <script type="text/javascript" src="../mv_embed.js?urid=<?php echo time()?>"></script> |
17 | 17 | </head> |
18 | 18 | <body> |
19 | 19 | <h3> Sample Embed</h3> |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -54,6 +54,7 @@ |
55 | 55 | if( !mv_embed_path ){ |
56 | 56 | var mv_embed_path = getMvEmbedPath(); |
57 | 57 | } |
| 58 | +//js_log("mv embed path:"+ mv_embed_path); |
58 | 59 | //set the unique request id (for ensuring fresh copies of scripts on updates) |
59 | 60 | if( !mv_embed_urid ){ |
60 | 61 | var mv_embed_urid = getMvUniqueReqId(); |
— | — | @@ -384,7 +385,7 @@ |
385 | 386 | });*/ |
386 | 387 | |
387 | 388 | eval('var lib = {"'+this.library+'Embed":\'libEmbedObj/mv_'+this.library+'Embed.js\'}'); |
388 | | - //js_log('DO LOAD: '+this.library); |
| 389 | + js_log('DO LOAD: '+this.library); |
389 | 390 | mvJsLoader.doLoad(lib,function(){ |
390 | 391 | //js_log( 'type of lib: ' + eval( 'typeof ' + this.library + 'Embed' ) ); |
391 | 392 | //js_log(_this.id + ' plugin loaded'); |
— | — | @@ -587,8 +588,6 @@ |
588 | 589 | (domain ? ("; domain=" + domain) : "") + |
589 | 590 | (secure ? "; secure" : ""); |
590 | 591 | } |
591 | | - |
592 | | -js_log("mv embed path:"+ mv_embed_path); |
593 | 592 | /* |
594 | 593 | * embedTypes object handles setting and getting of supported embed types: |
595 | 594 | * closely mirrors OggHandler so that its easier to share efforts in this area: |
— | — | @@ -1230,7 +1229,8 @@ |
1231 | 1230 | function getMvEmbedURL(){ |
1232 | 1231 | js_elements = document.getElementsByTagName("script"); |
1233 | 1232 | for(var i=0;i<js_elements.length; i++){ |
1234 | | - if( js_elements[i].src.indexOf('mv_embed') !=-1){ |
| 1233 | + //check for normal mv_embed.js and or script loader |
| 1234 | + if( js_elements[i].src.indexOf('mv_embed.js') !=-1 || ( js_elements[i].src.indexOf('mv_embed') != -1 && js_elements[i].src.indexOf('mvwScriptLoader.php') != -1) ){ |
1235 | 1235 | return js_elements[i].src; |
1236 | 1236 | } |
1237 | 1237 | } |
— | — | @@ -1250,13 +1250,13 @@ |
1251 | 1251 | */ |
1252 | 1252 | function getMvEmbedPath(){ |
1253 | 1253 | var mv_embed_url = getMvEmbedURL(); |
1254 | | - if(mv_embed_url.indexOf('mv_embed.js') !== -1){ |
| 1254 | + if( !mv_embed_url || mv_embed_url.indexOf('mv_embed.js') !== -1){ |
1255 | 1255 | mv_embed_path = mv_embed_url.substr(0, mv_embed_url.indexOf('mv_embed.js')); |
1256 | 1256 | }else{ |
1257 | 1257 | mv_embed_path = mv_embed_url.substr(0, mv_embed_url.indexOf('mvwScriptLoader.php')); |
1258 | 1258 | } |
1259 | 1259 | //absolute the url (if relative) (if we don't have mv_embed path) |
1260 | | - if(mv_embed_path.indexOf('://')==-1){ |
| 1260 | + if( mv_embed_path.indexOf('://') == -1){ |
1261 | 1261 | var pURL = parseUri( document.URL ); |
1262 | 1262 | if(mv_embed_path.charAt(0)=='/'){ |
1263 | 1263 | mv_embed_path = pURL.protocol + '://' + pURL.authority + mv_embed_path; |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_javaEmbed.js |
— | — | @@ -1,5 +1,6 @@ |
2 | 2 | var javaEmbed = { |
3 | 3 | instanceOf:'javaEmbed', |
| 4 | + iframe_src:'', |
4 | 5 | supports: { |
5 | 6 | 'play_head':true, |
6 | 7 | 'pause':true, |
— | — | @@ -14,9 +15,12 @@ |
15 | 16 | //set a default duration of 30 seconds: cortao should detect duration. |
16 | 17 | return this.wrapEmebedContainer( this.getEmbedObj() ); |
17 | 18 | }, |
18 | | - getEmbedObj:function(){ |
19 | | - if(!this.duration)this.duration=30; |
20 | | - if(mv_java_iframe){ |
| 19 | + getEmbedObj:function(){ |
| 20 | + //get the duration |
| 21 | + this.getDuration(); |
| 22 | + //if still unset set to an arbitrary time 60 seconds: |
| 23 | + if(!this.duration)this.duration=60; |
| 24 | + if( mv_java_iframe ){ |
21 | 25 | //make sure iframe and embed path match (java security model) |
22 | 26 | var iframe_src=''; |
23 | 27 | var src = this.media_element.selected_source.getURI(); |
— | — | @@ -45,9 +49,17 @@ |
46 | 50 | iframe_src+= "&width=" + this.width + "&height=" + this.height; |
47 | 51 | iframe_src+= "&duration=" + this.duration; |
48 | 52 | iframe_src+=parent_domain; |
49 | | - return '<iframe id="iframe_'+this.pid+'" width="'+this.width+'" height="'+this.height+'" '+ |
50 | | - 'frameborder=0 scrolling=no marginwidth=0 marginheight=0 ' + |
51 | | - 'src = "'+ iframe_src + '"></iframe>'; |
| 53 | + |
| 54 | + //check for the mvMsgFrame |
| 55 | + if($j('#mvMsgFrame').length == 0){ |
| 56 | + js_log('appened mvMsgFrame'); |
| 57 | + //add it to the dom: (sh |
| 58 | + $j('body').prepend( '<iframe id="mvMsgFrame" width="0" height="0" scrolling=no marginwidth=0 marginheight=0 src="#none"></iframe>' ); |
| 59 | + } |
| 60 | + this.iframe_src = iframe_src; |
| 61 | + return '<iframe id="iframe_' + this.pid + '" width="'+this.width+'" height="'+this.height+'" '+ |
| 62 | + 'frameborder="0" scrolling="no" marginwidth="0" marginheight="0" ' + |
| 63 | + 'src = "'+ this.iframe_src + '"></iframe>'; |
52 | 64 | }else{ |
53 | 65 | //load directly in the page.. |
54 | 66 | // (media must be on the same server or applet must be signed) |
— | — | @@ -62,31 +74,51 @@ |
63 | 75 | '<param name="duration" value="'+this.duration+'" />'+"\n"+ |
64 | 76 | '<param name="bufferSize" value="200" />'+"\n"+ |
65 | 77 | '</applet>'; |
| 78 | + } |
| 79 | + }, |
| 80 | + sendFrameMsg:function( msg ){ |
| 81 | + var iwin; |
| 82 | + if(navigator.userAgent.indexOf("Safari") != -1){ |
| 83 | + iwin = frames["iframe_" + this.pid]; |
| 84 | + }else{ |
| 85 | + iwin = document.getElementById("iframe_" + this.pid).contentWindow; |
66 | 86 | } |
67 | | - }, |
| 87 | + //update the msg text: |
| 88 | + iwin.location = this.iframe_src +'#'+ msg; |
| 89 | + }, |
68 | 90 | postEmbedJS:function(){ |
69 | | - this.getJCE(); |
| 91 | + //start monitor: |
| 92 | + this.monitor(); |
| 93 | + this.sendFrameMsg('test_frame_update'); |
70 | 94 | }, |
71 | | - //get java cortado embed object |
72 | | - getJCE:function(){ |
73 | | - if(!mv_java_iframe){ |
74 | | - this.jce = $j('#'+this.pid).get(0); |
| 95 | + monitor:function(){ |
| 96 | + this.updateJavaState(); |
| 97 | + |
| 98 | + if( ! this.monitorTimerId ){ |
| 99 | + if(document.getElementById(this.id)){ |
| 100 | + this.monitorTimerId = setInterval('document.getElementById(\''+this.id+'\').monitor()', 250); |
| 101 | + } |
| 102 | + } |
| 103 | + }, |
| 104 | + updateJavaState:function(){ |
| 105 | + if( ! mv_java_iframe ){ |
| 106 | + this.getJCE(); |
| 107 | + if(typeof this.jce != 'undefined' ){ |
| 108 | + if(typeof this.jce.getPlayPosition != 'undefined' ){ |
| 109 | + this.currentTime = this.jce.getPlayPosition(); |
| 110 | + } |
| 111 | + } |
75 | 112 | }else{ |
76 | | - //set via iframe refrence: |
77 | | - //(does not work even if we set window.domain on the remote iframe) |
78 | | - //this.jce = $j('#iframe_'+this.pid).get(0).contentDocument.getElementById(this.pid); |
| 113 | + //read the packaged info from the iframe: |
| 114 | + //js_log( 'iframe_src: ' + $j('#mvMsgFrame' + this.pid).attr("src") ); |
79 | 115 | } |
80 | 116 | }, |
| 117 | + //get java cortado embed object |
| 118 | + getJCE:function(){ |
| 119 | + this.jce = $j('#'+this.pid).get(0); |
| 120 | + }, |
81 | 121 | pause:function(){ |
82 | 122 | this.parent_pause(); |
83 | 123 | this.stop(); |
84 | | - }, |
85 | | - currentTime:function(){ |
86 | | - if(typeof this.jce != 'undefined' ){ |
87 | | - if(typeof this.jce.getPlayPosition != 'undefined' ){ |
88 | | - return this.jce.getPlayPosition(); |
89 | | - } |
90 | | - } |
91 | | - return '0'; |
92 | 124 | } |
93 | 125 | } |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_baseEmbed.js |
— | — | @@ -1677,13 +1677,13 @@ |
1678 | 1678 | for(var i=0; i < supporting_players.length ; i++){ |
1679 | 1679 | if( _this.selected_player.id == supporting_players[i].id && is_selected ){ |
1680 | 1680 | out+='<li style="border-style:dashed;margin-left:20px;">'+ |
1681 | | - '<img border="0" width="16" height="16" src="'+mv_embed_path+'images/plugin.png">'+ |
| 1681 | + '<img border="0" width="16" height="16" src="' + mv_embed_path + 'images/plugin.png">' + |
1682 | 1682 | supporting_players[i].getName() + |
1683 | 1683 | '</li>'; |
1684 | 1684 | }else{ |
1685 | 1685 | //else gray plugin and the plugin with link to select |
1686 | 1686 | out+='<li style="margin-left:20px;">'+ |
1687 | | - '<a href="#" onClick="'+ source_select_code + 'embedTypes.players.userSelectPlayer(\''+supporting_players[i].id+'\',\''+ source.getMIMEType()+'\');return false;">'+ |
| 1687 | + '<a href="#" onClick="'+ source_select_code + 'embedTypes.players.userSelectPlayer(\'' + supporting_players[i].id + '\',\'' + source.getMIMEType() +'\');return false;">'+ |
1688 | 1688 | '<img border="0" width="16" height="16" src="'+mv_embed_path+'images/plugin_disabled.png">'+ |
1689 | 1689 | supporting_players[i].getName() + |
1690 | 1690 | '</a>'+ |