r57312 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57311‎ | r57312 | r57313 >
Date:23:51, 2 October 2009
Author:dale
Status:deferred
Tags:
Comment:
* updated local java applet from cortado svn ( supports theora 1.1 encodes )
* some javaEmbed fixes
Modified paths:
  • /trunk/phase3/js2/mwEmbed/binPlayers/cortado/README (modified) (history)
  • /trunk/phase3/js2/mwEmbed/binPlayers/cortado/cortado.jar (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libEmbedVideo/javaEmbed.js (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/mwEmbed/binPlayers/cortado/cortado.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/phase3/js2/mwEmbed/binPlayers/cortado/README
@@ -1 +1 @@
2 -This version of cortado comes form http://theora.org/cortado.jar it should cloesly mirror the svn version hosted by wikimedia
 2+This version of cortado comes form http://theora.org/cortado.jar
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/javaEmbed.js
@@ -84,21 +84,23 @@
8585 this.monitor();
8686 },
8787 monitor:function(){
88 - this.getJCE()
89 - if(this.jce && this.jce.getPlayPosition){
90 - try{
91 - //java reads ogg media time.. so no need to add the start or seek offset:
92 - //js_log(' ct: ' + this.jce.getPlayPosition() + ' ' + this.supportsURLTimeEncoding());
93 - this.currentTime = this.jce.getPlayPosition();
94 - if( this.jce.getPlayPosition() < 0){
95 - js_log('pp:'+this.jce.getPlayPosition());
96 - //probably reached clip end
97 - this.onClipDone();
98 - }
99 - }catch (e){
100 - js_log('could not get time from jPlayer: ' + e);
101 - }
102 - }
 88+ this.getJCE();
 89+ if( this.isPlaying() ){
 90+ if( this.jce && this.jce.getPlayPosition ){
 91+ try{
 92+ //java reads ogg media time.. so no need to add the start or seek offset:
 93+ //js_log(' ct: ' + this.jce.getPlayPosition() + ' ' + this.supportsURLTimeEncoding());
 94+ this.currentTime = this.jce.getPlayPosition();
 95+ if( this.jce.getPlayPosition() < 0){
 96+ js_log('pp:'+this.jce.getPlayPosition());
 97+ //probably reached clip end
 98+ this.onClipDone();
 99+ }
 100+ }catch (e){
 101+ js_log('could not get time from jPlayer: ' + e);
 102+ }
 103+ }
 104+ }
103105 //once currentTime is updated call parent_monitor
104106 this.parent_monitor();
105107 },
@@ -169,7 +171,9 @@
170172 doThumbnailHTML:function(){
171173 //empty out player html (jquery with java applets does mix) :
172174 var pelm = document.getElementById('dc_' + this.id );
173 - pelm.innerHTML = '';
 175+ if( pelm ){
 176+ pelm.innerHTML = '';
 177+ }
174178 this.parent_doThumbnailHTML();
175179 },
176180 play:function(){
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js
@@ -1168,79 +1168,80 @@
11691169 };
11701170 },
11711171 onClipDone:function(){
1172 - js_log('base:onClipDone');
1173 - //stop the clip (load the thumbnail etc)
1174 - this.stop();
1175 - this.seek_time_sec = 0;
1176 - this.setSliderValue(0);
1177 - var _this = this;
 1172+ js_log('base:onClipDone');
 1173+ //stop the clip (load the thumbnail etc)
 1174+ this.stop();
 1175+ this.seek_time_sec = 0;
 1176+ this.setSliderValue(0);
 1177+ var _this = this;
 1178+
 1179+ if(this.width < 300){
 1180+ return ;
 1181+ }
 1182+ this.onClipDone_disp=true;
 1183+ this.thumbnail_disp=true;
 1184+
 1185+ //make sure we are not in preview mode( no end clip actions in preview mode)
 1186+ if( this.preview_mode )
 1187+ return ;
11781188
1179 - if(this.width < 300){
1180 - return ;
 1189+ $j('#img_thumb_'+this.id).css('zindex',1);
 1190+ $j('#'+ this.id + ' .play-btn-large').hide();
 1191+
 1192+ //add black background
 1193+ $j('#dc_'+this.id).append( '<div id="black_back_' + this.id + '" ' +
 1194+ 'style="z-index:-2;position:absolute;background:#000;' +
 1195+ 'top:0px;left:0px;width:' + parseInt( this.width ) + 'px;' +
 1196+ 'height:' + parseInt( this.height ) + 'px;">' +
 1197+ '</div>');
 1198+
 1199+ if( this.wikiTitleKey){
 1200+ $j('#dc_'+this.id).append(
 1201+ '<div class="related_vids" >' +
 1202+ '<h1>' + gM('mwe_related_videos') + '</h1>'+
 1203+ '<ul>' +
 1204+ '</ul>' +
 1205+ '</div>');
 1206+ $j('#img_thumb_' + this.id).fadeOut("fast");
 1207+ $j('#dc_'+ _this.id + ' .related_vids ul').html( gM('mwe-loading_txt') );
 1208+ this.mvVideoAudioSearch();
 1209+ }else{
 1210+ //add the liks_info_div black back
 1211+ $j('#dc_'+this.id).append('<div id="liks_info_'+this.id+'" ' +
 1212+ 'style="width:' +parseInt(parseInt(this.width)/2)+'px;'+
 1213+ 'height:'+ parseInt(parseInt(this.height)) +'px;'+
 1214+ 'position:absolute;top:10px;overflow:auto'+
 1215+ 'width: '+parseInt( ((parseInt(this.width)/2)-15) ) + 'px;'+
 1216+ 'left:'+ parseInt( ((parseInt(this.width)/2)+15) ) +'px;">'+
 1217+ '</div>'
 1218+ );
 1219+ //start animation (make thumb small in upper left add in div for "loading"
 1220+ $j('#img_thumb_'+this.id).animate({
 1221+ width:parseInt(parseInt(_this.width)/2),
 1222+ height:parseInt(parseInt(_this.height)/2),
 1223+ top:20,
 1224+ left:10
 1225+ },
 1226+ 1000,
 1227+ function(){
 1228+ //animation done.. add "loading" to div if empty
 1229+ if($j('#liks_info_'+_this.id).html()==''){
 1230+ $j('#liks_info_'+_this.id).html(gM('mwe-loading_txt'));
 1231+ }
 1232+ }
 1233+ )
 1234+ //now load roe if run the showNextPrevLinks
 1235+ if(this.roe && this.media_element.addedROEData==false){
 1236+ do_request(this.roe, function(data)
 1237+ {
 1238+ _this.media_element.addROE(data);
 1239+ _this.getNextPrevLinks();
 1240+ });
 1241+ }else{
 1242+ this.getNextPrevLinks();
11811243 }
1182 - this.onClipDone_disp=true;
1183 - this.thumbnail_disp=true;
1184 - //make sure we are not in preview mode( no end clip actions in preview mode)
1185 - if( this.preview_mode )
1186 - return ;
1187 -
1188 - $j('#img_thumb_'+this.id).css('zindex',1);
1189 - $j( this.id + ' .play-btn-large').hide();
1190 -
1191 - //add black background
1192 - $j('#dc_'+this.id).append('<div id="black_back_'+this.id+'" ' +
1193 - 'style="z-index:-2;position:absolute;background:#000;' +
1194 - 'top:0px;left:0px;width:'+parseInt(this.width)+'px;' +
1195 - 'height:'+parseInt(this.height)+'px;">' +
1196 - '</div>');
1197 -
1198 - if( this.wikiTitleKey){
1199 - $j('#dc_'+this.id).append(
1200 - '<div class="related_vids" >' +
1201 - '<h1>' + gM('mwe_related_videos') + '</h1>'+
1202 - '<ul>' +
1203 - '</ul>' +
1204 - '</div>');
1205 - $j('#img_thumb_' + this.id).fadeOut("fast");
1206 - $j('#dc_'+ _this.id + ' .related_vids ul').html( gM('mwe-loading_txt') );
1207 - this.mvVideoAudioSearch();
1208 - }else{
1209 - //add the liks_info_div black back
1210 - $j('#dc_'+this.id).append('<div id="liks_info_'+this.id+'" ' +
1211 - 'style="width:' +parseInt(parseInt(this.width)/2)+'px;'+
1212 - 'height:'+ parseInt(parseInt(this.height)) +'px;'+
1213 - 'position:absolute;top:10px;overflow:auto'+
1214 - 'width: '+parseInt( ((parseInt(this.width)/2)-15) ) + 'px;'+
1215 - 'left:'+ parseInt( ((parseInt(this.width)/2)+15) ) +'px;">'+
1216 - '</div>'
1217 - );
1218 - //start animation (make thumb small in upper left add in div for "loading"
1219 - $j('#img_thumb_'+this.id).animate({
1220 - width:parseInt(parseInt(_this.width)/2),
1221 - height:parseInt(parseInt(_this.height)/2),
1222 - top:20,
1223 - left:10
1224 - },
1225 - 1000,
1226 - function(){
1227 - //animation done.. add "loading" to div if empty
1228 - if($j('#liks_info_'+_this.id).html()==''){
1229 - $j('#liks_info_'+_this.id).html(gM('mwe-loading_txt'));
1230 - }
1231 - }
1232 - )
1233 - //now load roe if run the showNextPrevLinks
1234 - if(this.roe && this.media_element.addedROEData==false){
1235 - do_request(this.roe, function(data)
1236 - {
1237 - _this.media_element.addROE(data);
1238 - _this.getNextPrevLinks();
1239 - });
1240 - }else{
1241 - this.getNextPrevLinks();
1242 - }
1243 - }
1244 - },
 1244+ }
 1245+ },
12451246 //@@todo we should merge getNextPrevLinks with textInterface .. there is repeated code between them.
12461247 getNextPrevLinks:function(){
12471248 js_log('f:getNextPrevLinks');
@@ -1997,7 +1998,7 @@
19981999 }
19992000
20002001 //make sure the big playbutton is has click action:
2001 - $j(_this.id + ' .play-btn-large').unbind('click').click(function(){
 2002+ $j('#' + _this.id + ' .play-btn-large').unbind('click').click(function(){
20022003 $j('#' +_this.id).get(0).play();
20032004 });
20042005

Status & tagging log