r73784 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73783‎ | r73784 | r73785 >
Date:17:09, 26 September 2010
Author:dale
Status:deferred
Tags:
Comment:
* some IE fixes for vlc and java embed methods
* fixed false positive for IE java detect
Modified paths:
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerJava.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerVlc.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SwarmTransport/mw.EmbedPlayerSwarmVlc.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/SwarmTransport/mw.EmbedPlayerSwarmVlc.js
@@ -11,8 +11,9 @@
1212 var _this = this;
1313 var oggHttpSource = this.mediaElement.getSources( 'video/ogg' )[0];
1414 $j( this ).html(
15 - '<object classid="clsid:98FF91C0-A3B8-11DF-8555-0002A5D5C51B" ' +
16 - 'id="' + this.pid + '" events="True" height="' + this.getHeight() + '" width="' + this.getWidth() + '"' +
 15+ '<object classid="clsid:98FF91C0-A3B8-11DF-8555-0002A5D5C51B" ' +
 16+ 'name="' + this.pid + '" ' +
 17+ 'id="' + this.pid + '" events="True" height="' + this.getPlayerHeight() + '" width="' + this.getPlayerWidth() + '"' +
1718 '>' +
1819 '<param name="ShowDisplay" value="True" />' +
1920 '<param name="AutoLoop" value="False" />' +
@@ -23,6 +24,11 @@
2425 '</object>'
2526 );
2627 setTimeout( function() {
 28+ // make sure the object is the correct size ( IE appears to do weird stuff with object tags )
 29+ $j( '#' + _this.pid ).css( {
 30+ 'width' : _this.getPlayerWidth(),
 31+ 'height' : _this.getPlayerHeight()
 32+ })
2733 _this.monitor();
2834 }, 100 );
2935 }
@@ -33,7 +39,7 @@
3440 mw.log("Error:: EmbedPLayerVlc not defefined ");
3541 } else {
3642 for( var i in mw.EmbedPlayerVlc ){
37 - if( !mw.EmbedPlayerSwarmVlc[ i ] ){
 43+ if( typeof mw.EmbedPlayerSwarmVlc[ i ] == 'undefined' ){
3844 mw.EmbedPlayerSwarmVlc[ i ] = mw.EmbedPlayerVlc[i];
3945 }
4046 };
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -3526,12 +3526,14 @@
35273527 try{
35283528 var javaEnabled = navigator.javaEnabled();
35293529 } catch ( e ){
 3530+
35303531 }
35313532 // Some browsers filter out duplicate mime types, hiding some plugins
35323533 var uniqueMimesOnly = $j.browser.opera || $j.browser.safari;
 3534+
35333535 // Opera will switch off javaEnabled in preferences if java can't be found.
35343536 // And it doesn't register an application/x-java-applet mime type like Mozilla does.
3535 - if ( javaEnabled ) {
 3537+ if ( javaEnabled && ( navigator.appName == 'Opera' ) ) {
35363538 this.players.addPlayer( cortadoPlayer );
35373539 }
35383540
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerJava.js
@@ -219,7 +219,11 @@
220220 this.getPlayerElement();
221221 this.parent_play();
222222 if ( this.playerElement ) {
 223+ try{
223224 this.playerElement.play();
 225+ }catch( e ){
 226+ mw.log("EmbedPlayerJava::Could not issue play request");
 227+ }
224228 }
225229 },
226230
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerVlc.js
@@ -38,7 +38,7 @@
3939 $j( this ).html(
4040 '<object classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" ' +
4141 'codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab#Version=0,8,6,0" ' +
42 - 'id="' + this.pid + '" events="True" height="' + this.getHeight() + '" width="' + this.getWidth() + '"' +
 42+ 'id="' + this.pid + '" events="True" height="' + this.getPlayerHeight() + '" width="' + this.getPlayerWidth() + '"' +
4343 '>' +
4444 '<param name="MRL" value="">' +
4545 '<param name="ShowDisplay" value="True">' +
@@ -129,7 +129,7 @@
130130 if ( ( this.playerElement.input.state == 3 ) && ( this.playerElement.input.position != percent ) )
131131 {
132132 this.playerElement.input.position = percent;
133 - this.setStatus( 'seeking...' );
 133+ this.controlBuilder.setStatus( 'seeking...' );
134134 }
135135 } else {
136136 this.doPlayThenSeek( percent );
@@ -173,10 +173,10 @@
174174 this.getPlayerElement();
175175 if ( !this.playerElement )
176176 return ;
177 - if ( this.playerElement.log ) {
178 - // mw.log( 'state:' + this.playerElement.input.state);
179 - // mw.log('time: ' + this.playerElement.input.time);
180 - // mw.log('pos: ' + this.playerElement.input.position);
 177+ try{
 178+ mw.log( 'state:' + this.playerElement.input.state);
 179+ mw.log('time: ' + this.playerElement.input.time);
 180+ mw.log('pos: ' + this.playerElement.input.position);
181181 if ( this.playerElement.log.messages.count > 0 ) {
182182 // there is one or more messages in the log
183183 var iter = this.playerElement.log.messages.iterator();
@@ -191,6 +191,7 @@
192192 // clear the log once finished to avoid clogging
193193 this.playerElement.log.messages.clear();
194194 }
 195+
195196 var newState = this.playerElement.input.state;
196197 if ( this.prevState != newState ) {
197198 if ( newState == 0 )
@@ -222,6 +223,8 @@
223224 // current media is playing
224225 this.onPlaying();
225226 }
 227+ } catch( e ){
 228+ mw.log("EmbedPlayerVlc::Monitor error");
226229 }
227230 // update the status and check timmer via universal parent monitor
228231 this.parent_monitor();
@@ -232,10 +235,10 @@
233236 * @@note: should be localized:
234237 */
235238 onOpen: function() {
236 - this.setStatus( "Opening..." );
 239+ this.controlBuilder.setStatus( "Opening..." );
237240 },
238241 onBuffer: function() {
239 - this.setStatus( "Buffering..." );
 242+ this.controlBuilder.setStatus( "Buffering..." );
240243 },
241244 onPlay: function() {
242245 this.onPlaying();
@@ -300,7 +303,8 @@
301304 pause : function() {
302305 this.parent_pause(); // update the interface if paused via native control
303306 if ( this.getPlayerElement() ) {
304 - this.playerElement.playlist.togglePause();
 307+ alter('togglePause:' + document[this.pid].playlist.togglePause );
 308+ document[this.pid].playlist.togglePause();
305309 }
306310 },
307311
@@ -338,17 +342,25 @@
339343 */
340344 fullscreen : function() {
341345 if ( this.playerElement ) {
342 - if ( this.playerElement.video )
343 - this.playerElement.video.toggleFullscreen();
344 - }
345 - this.parent_fullscreen();
 346+ if ( this.playerElement.video ){
 347+ try{
 348+ this.playerElement.video.toggleFullscreen();
 349+ } catch ( e ){
 350+ mw.log("VlcEmbed toggle fullscreen : possible error: " + e);
 351+ }
 352+ }
 353+ }
346354 },
347355
348356 /**
349357 * Get the embed vlc object
350358 */
351359 getPlayerElement : function() {
352 - this.playerElement = $j( '#' + this.pid ).get(0);
 360+ if( $j.browser.msie ){
 361+ this.playerElement = document[this.pid];
 362+ }else{
 363+ this.playerElement = $j( '#' + this.pid ).get(0);
 364+ }
353365 return this.playerElement;
354366 }
355367 };

Status & tagging log