r50982 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50981‎ | r50982 | r50983 >
Date:17:30, 25 May 2009
Author:dale
Status:deferred
Tags:
Comment:
fixed java embed: play, pause buttons and overlay
Modified paths:
  • /branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/mv_baseEmbed.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/mv_javaEmbed.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/mv_vlcEmbed.js (modified) (history)

Diff [purge]

Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/mv_baseEmbed.js
@@ -1219,7 +1219,7 @@
12201220 var _this = this;
12211221
12221222 //if the clip resolution is < 320 don't do fancy onClipDone stuff
1223 - if(this.width<300){
 1223+ if(this.width < 300){
12241224 return ;
12251225 }
12261226 this.onClipDone_disp=true;
@@ -1426,12 +1426,11 @@
14271427 doThumbnailHTML:function()
14281428 {
14291429 var _this = this;
1430 - js_log('f:doThumbnailHTML'+ this.thumbnail_disp);
1431 - this.closeDisplayedHTML();
1432 - this.thumbnail_disp = true;
1433 -
1434 - $j('#mv_embedded_player_'+this.id).html( this.getThumbnailHTML() );
 1430+ js_log('f:doThumbnailHTML'+ this.thumbnail_disp);
 1431+ this.closeDisplayedHTML();
 1432+ $j( '#mv_embedded_player_' + this.id ).html( this.getThumbnailHTML() );
14351433 this.paused = true;
 1434+ this.thumbnail_disp = true;
14361435 },
14371436 refreshControlsHTML:function(){
14381437 js_log('refreshing controls HTML');
@@ -1815,14 +1814,14 @@
18161815 $j('#blackbg_'+sel_id).fadeOut("slow", function(){
18171816 $j('#blackbg_'+sel_id).remove();
18181817 });
1819 - return false;//onclick action return false
 1818+ return false; //onclick action return false
18201819 },
18211820 selectPlaybackMethod:function(){
18221821 //get id (in case where we have a parent container)
18231822 var this_id = (this.pc!=null)?this.pc.pp.id:this.id;
18241823
18251824 var _this=this;
1826 - var out='<span style="color:#FFF;background-color:black;"><blockquote style="background-color:black;">';
 1825+ var out= '<span style="color:#FFF;background-color:black;"><blockquote style="background-color:black;">';
18271826 var _this=this;
18281827 //js_log('selected src'+ _this.media_element.selected_source.url);
18291828 $j.each( this.media_element.getPlayableSources(), function(source_id, source){
@@ -1982,7 +1981,7 @@
19831982 var this_id = (this.pc!=null)?this.pc.pp.id:this.id;
19841983 //js_log('mv_embed:do pause');
19851984 //(playing) do pause
1986 - this.paused=true;
 1985+ this.paused = true;
19871986 //update the ctrl "paused state"
19881987 $j("#mv_play_pause_button_" + this_id).attr({
19891988 'class':'play_button'
@@ -2006,10 +2005,11 @@
20072006 }else{
20082007 this.pause();
20092008 }
 2009+
20102010 //reset the currentTime:
20112011 this.currentTime=0;
20122012 //check if thumbnail is being displayed in which case do nothing
2013 - if(this.thumbnail_disp){
 2013+ if( this.thumbnail_disp ){
20142014 //already in stooped state
20152015 js_log('already in stopped state');
20162016 }else{
@@ -2019,6 +2019,7 @@
20202020 this.setSliderValue(0);
20212021 this.setStatus( this.getTimeReq() );
20222022 }
 2023+
20232024 //make sure the big playbutton is has click action:
20242025 $j('#big_play_link_' + _this.id).unbind('click').click(function(){
20252026 $j('#' +_this.id).get(0).play();
Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/mv_javaEmbed.js
@@ -79,22 +79,22 @@
8080 }else{*/
8181 //load directly in the page..
8282 // (media must be on the same server or applet must be signed)
83 - return ''+
 83+ var appplet_code = ''+
8484 '<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"+
8585 '<param name="url" value="'+this.media_element.selected_source.src+'" /> ' + "\n"+
8686 '<param name="local" value="false"/>'+ "\n"+
8787 '<param name="keepaspect" value="true" />'+ "\n"+
8888 '<param name="video" value="true" />'+"\n"+
 89+ '<param name="showStatus" value="hide" />' + "\n"+
8990 '<param name="audio" value="true" />'+"\n"+
9091 '<param name="seekable" value="true" />'+"\n"+
9192 '<param name="duration" value="'+this.duration+'" />'+"\n"+
9293 '<param name="bufferSize" value="200" />'+"\n"+
9394 '</applet>';
94 -
95 -
 95+
9696 // Wrap it in an iframe to avoid hanging the event thread in FF 2/3 and similar
97 - // Doesn't work in MSIE or Safari/Mac or Opera 9.5
98 - /*if ( embedTypes.mozilla ) {
 97+ // Doesn't work in MSIE or Safari/Mac or Opera 9.5
 98+ if ( embedTypes.mozilla ) {
9999 var iframe = document.createElement( 'iframe' );
100100 iframe.setAttribute( 'width', params.width );
101101 iframe.setAttribute( 'height', playerHeight );
@@ -102,7 +102,7 @@
103103 iframe.setAttribute( 'frameborder', 0 );
104104 iframe.setAttribute( 'marginWidth', 0 );
105105 iframe.setAttribute( 'marginHeight', 0 );
106 - iframe.setAttribute( 'id', 'cframe_'+ this.id)
 106+ iframe.setAttribute( 'id', 'cframe_' + this.id)
107107 elt.appendChild( iframe );
108108 var newDoc = iframe.contentDocument;
109109 newDoc.open();
@@ -110,9 +110,7 @@
111111 newDoc.close(); // spurious error in some versions of FF, no workaround known
112112 } else {
113113 return appplet_code;
114 - } */
115 -
116 - //}
 114+ }
117115 },
118116 postEmbedJS:function(){
119117 //reset logged domain error flag:
@@ -145,7 +143,11 @@
146144 },
147145 //get java cortado embed object
148146 getJCE:function(){
149 - this.jce = $j('#'+this.pid).get(0);
 147+ if ( embedTypes.mozilla ) {
 148+ this.jce = window.frames['cframe_' + this.id ].document.getElementById( this.pid );
 149+ }else{
 150+ this.jce = $j('#'+this.pid).get( 0 );
 151+ }
150152 /*if( ! mv_java_iframe ){
151153
152154 }else{
@@ -161,8 +163,22 @@
162164 return false;
163165 } */
164166 },
 167+ doThumbnailHTML:function(){
 168+ //empty out player html (jquery with java applets does not work) :
 169+ var pelm = document.getElementById('mv_embedded_player_' + this.id );
 170+ pelm.innerHTML = '';
 171+ this.parent_doThumbnailHTML();
 172+ },
 173+ play:function(){
 174+ this.getJCE();
 175+ this.parent_play();
 176+ if( this.jce )
 177+ this.jce.doPlay();
 178+ },
165179 pause:function(){
 180+ this.getJCE();
166181 this.parent_pause();
167 - this.stop();
 182+ if( this.jce )
 183+ this.jce.doPause();
168184 }
169185 }
Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/mv_vlcEmbed.js
@@ -272,7 +272,7 @@
273273 },
274274 pause : function(){
275275 this.parent_pause(); //update the inteface if paused via native control
276 - if(this.vlc){
 276+ if( this.vlc ){
277277 this.vlc.playlist.togglePause();
278278 }
279279 },

Status & tagging log