r51143 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51142‎ | r51143 | r51144 >
Date:23:02, 28 May 2009
Author:dale
Status:deferred
Tags:
Comment:
updated applet location to point to singed applet: http://xiph.org/cortado.jar for cross domain media support
Modified paths:
  • /branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/mv_javaEmbed.js (modified) (history)

Diff [purge]

Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/mv_javaEmbed.js
@@ -22,66 +22,19 @@
2323 this.getDuration();
2424 //if still unset set to an arbitrary time 60 seconds:
2525 if(!this.duration)this.duration=60;
26 -
27 - /*if( mv_java_iframe && parseUri(document.URL).host != parseUri(document.URL).host){
28 - //make sure iframe and embed path match (java security model)
29 - var iframe_src='';
30 - var src = this.getURI( this.seek_time_sec );
31 - //make url absolute:
32 - if(src[0]=='/'){
33 - //js_log('java: media relative path from:'+ document.URL);
34 - var pURL=parseUri(document.URL);
35 - src= pURL.protocol + '://' + pURL.authority + src;
36 - }else if(src.indexOf('://')===-1){
37 - //js_log('java: media relative file');
38 - var pURL=parseUri(document.URL);
39 - src= pURL.protocol + '://' + pURL.authority + pURL.directory + src;
40 - }
41 - js_log('java media url: '+ src);
42 - var parent_domain='';
43 - //set the domain locally and for the script:
44 - var doc_host = parseUri(document.location).host;
45 - if( doc_host ){
46 - js_log('set parent domain:' + doc_host);
47 - //set the parent domain:
48 - document.domain = doc_host;
49 -
50 - iframe_src = parseUri(src).protocol + '://'+
51 - parseUri(src).authority +
52 - mv_media_iframe_path + 'cortado_iframe.php';
53 - js_log('iframe source: ' + iframe_src);
54 - //set the domain of the script:
55 - parent_domain = '&parent_domain=' + doc_host;
56 -
57 - js_log('parent_domain: ' + parent_domain);
58 - }else{
59 - iframe_src = mv_embed_path + 'cortado_iframe.php';
60 - }
61 - //js_log('base iframe src:'+ iframe_src);
62 - iframe_src+= "?media_url=" + src.replace('?','%3F').replace('&','%26') + '&id=' + this.pid;
63 - iframe_src+= "&width=" + this.width + "&height=" + this.height;
64 - iframe_src+= "&duration=" + this.duration;
65 - iframe_src+=parent_domain;
66 -
67 - //check for the mvMsgFrame
68 - //if($j('#mvMsgFrame').length == 0){
69 - // js_log('appened mvMsgFrame');
70 - // //add it to the dom: (sh
71 - // $j('body').prepend( '<iframe id="mvMsgFrame" width="0" height="0" scrolling=no marginwidth=0 marginheight=0 src="#none"></iframe>' );
72 - //}
73 - js_log("about to set iframe source and embed code");
74 - this.iframe_src = iframe_src;
75 - var embed_code = '<iframe id="iframe_' + this.pid + '" width="'+this.width+'" height="'+this.height+'" '+
76 - 'frameborder="0" scrolling="no" marginwidth="0" marginheight="0" ' +
77 - 'src = "'+ this.iframe_src + '"></iframe>';
78 - js_log('going to embed: ' + embed_code);
79 - return embed_code;
80 - }else{*/
 26+ //@@todo we should have src property in our base embed object
 27+ var mediaSrc = this.media_element.selected_source.getURI( this.seek_time_sec );
 28+
 29+ if(mediaSrc.indexOf('://')!=-1 & parseUri(document.URL).host != parseUri(mediaSrc).host){
 30+ applet_loc = 'http://xiph.org/cortado.jar';
 31+ }else{
 32+ applet_loc = mv_embed_path+'binPlayers/cortado/cortado-wmf-r46643.jar';
 33+ }
8134 //load directly in the page..
8235 // (media must be on the same server or applet must be signed)
8336 var appplet_code = ''+
84 - '<applet id="'+this.pid+'" code="com.fluendo.player.Cortado.class" archive="'+mv_embed_path+'binPlayers/cortado/cortado-wmf-r46643.jar" width="'+this.width+'" height="'+this.height+'"> '+ "\n"+
85 - '<param name="url" value="'+this.media_element.selected_source.src+'" /> ' + "\n"+
 37+ '<applet id="'+this.pid+'" code="com.fluendo.player.Cortado.class" archive="'+applet_loc+'" width="'+this.width+'" height="'+this.height+'"> '+ "\n"+
 38+ '<param name="url" value="' + mediaSrc + '" /> ' + "\n"+
8639 '<param name="local" value="false"/>'+ "\n"+
8740 '<param name="keepaspect" value="true" />'+ "\n"+
8841 '<param name="video" value="true" />'+"\n"+
@@ -90,8 +43,7 @@
9144 '<param name="seekable" value="true" />'+"\n"+
9245 '<param name="duration" value="'+this.duration+'" />'+"\n"+
9346 '<param name="bufferSize" value="200" />'+"\n"+
94 - '</applet>';
95 -
 47+ '</applet>';
9648 // Wrap it in an iframe to avoid hanging the event thread in FF 2/3 and similar
9749 // Doesn't work in MSIE or Safari/Mac or Opera 9.5
9850 if ( embedTypes.mozilla ) {

Status & tagging log