http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73784
Revision: 73784
Author: dale
Date: 2010-09-26 17:09:27 +0000 (Sun, 26 Sep 2010)
Log Message:
-----------
* 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
branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerJava.js
branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerVlc.js
branches/MwEmbedStandAlone/modules/SwarmTransport/mw.EmbedPlayerSwarmVlc.js
Modified: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
===================================================================
--- branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
2010-09-26 16:37:00 UTC (rev 73783)
+++ branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
2010-09-26 17:09:27 UTC (rev 73784)
@@ -3526,12 +3526,14 @@
try{
var javaEnabled = navigator.javaEnabled();
} catch ( e ){
+
}
// Some browsers filter out duplicate mime types, hiding some
plugins
var uniqueMimesOnly = $j.browser.opera || $j.browser.safari;
+
// Opera will switch off javaEnabled in preferences if java
can't be found.
// And it doesn't register an application/x-java-applet mime
type like Mozilla does.
- if ( javaEnabled ) {
+ if ( javaEnabled && ( navigator.appName == 'Opera' ) ) {
this.players.addPlayer( cortadoPlayer );
}
Modified: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerJava.js
===================================================================
--- branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerJava.js
2010-09-26 16:37:00 UTC (rev 73783)
+++ branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerJava.js
2010-09-26 17:09:27 UTC (rev 73784)
@@ -219,7 +219,11 @@
this.getPlayerElement();
this.parent_play();
if ( this.playerElement ) {
+ try{
this.playerElement.play();
+ }catch( e ){
+ mw.log("EmbedPlayerJava::Could not issue play
request");
+ }
}
},
Modified: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerVlc.js
===================================================================
--- branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerVlc.js
2010-09-26 16:37:00 UTC (rev 73783)
+++ branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerVlc.js
2010-09-26 17:09:27 UTC (rev 73784)
@@ -38,7 +38,7 @@
$j( this ).html(
'<object
classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" ' +
'codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab#Version=0,8,6,0"
' +
- 'id="' + this.pid + '" events="True" height="'
+ this.getHeight() + '" width="' + this.getWidth() + '"' +
+ 'id="' + this.pid + '" events="True" height="'
+ this.getPlayerHeight() + '" width="' + this.getPlayerWidth() + '"' +
'>' +
'<param name="MRL" value="">' +
'<param name="ShowDisplay"
value="True">' +
@@ -129,7 +129,7 @@
if ( ( this.playerElement.input.state == 3 ) && (
this.playerElement.input.position != percent ) )
{
this.playerElement.input.position = percent;
- this.setStatus( 'seeking...' );
+ this.controlBuilder.setStatus( 'seeking...' );
}
} else {
this.doPlayThenSeek( percent );
@@ -173,10 +173,10 @@
this.getPlayerElement();
if ( !this.playerElement )
return ;
- if ( this.playerElement.log ) {
- // mw.log( 'state:' + this.playerElement.input.state);
- // mw.log('time: ' + this.playerElement.input.time);
- // mw.log('pos: ' + this.playerElement.input.position);
+ try{
+ mw.log( 'state:' + this.playerElement.input.state);
+ mw.log('time: ' + this.playerElement.input.time);
+ mw.log('pos: ' + this.playerElement.input.position);
if ( this.playerElement.log.messages.count > 0 ) {
// there is one or more messages in the log
var iter =
this.playerElement.log.messages.iterator();
@@ -191,6 +191,7 @@
// clear the log once finished to avoid clogging
this.playerElement.log.messages.clear();
}
+
var newState = this.playerElement.input.state;
if ( this.prevState != newState ) {
if ( newState == 0 )
@@ -222,6 +223,8 @@
// current media is playing
this.onPlaying();
}
+ } catch( e ){
+ mw.log("EmbedPlayerVlc::Monitor error");
}
// update the status and check timmer via universal parent
monitor
this.parent_monitor();
@@ -232,10 +235,10 @@
* @@note: should be localized:
*/
onOpen: function() {
- this.setStatus( "Opening..." );
+ this.controlBuilder.setStatus( "Opening..." );
},
onBuffer: function() {
- this.setStatus( "Buffering..." );
+ this.controlBuilder.setStatus( "Buffering..." );
},
onPlay: function() {
this.onPlaying();
@@ -300,7 +303,8 @@
pause : function() {
this.parent_pause(); // update the interface if paused via
native control
if ( this.getPlayerElement() ) {
- this.playerElement.playlist.togglePause();
+ alter('togglePause:' +
document[this.pid].playlist.togglePause );
+ document[this.pid].playlist.togglePause();
}
},
@@ -338,17 +342,25 @@
*/
fullscreen : function() {
if ( this.playerElement ) {
- if ( this.playerElement.video )
- this.playerElement.video.toggleFullscreen();
- }
- this.parent_fullscreen();
+ if ( this.playerElement.video ){
+ try{
+
this.playerElement.video.toggleFullscreen();
+ } catch ( e ){
+ mw.log("VlcEmbed toggle fullscreen :
possible error: " + e);
+ }
+ }
+ }
},
/**
* Get the embed vlc object
*/
getPlayerElement : function() {
- this.playerElement = $j( '#' + this.pid ).get(0);
+ if( $j.browser.msie ){
+ this.playerElement = document[this.pid];
+ }else{
+ this.playerElement = $j( '#' + this.pid ).get(0);
+ }
return this.playerElement;
}
};
Modified:
branches/MwEmbedStandAlone/modules/SwarmTransport/mw.EmbedPlayerSwarmVlc.js
===================================================================
--- branches/MwEmbedStandAlone/modules/SwarmTransport/mw.EmbedPlayerSwarmVlc.js
2010-09-26 16:37:00 UTC (rev 73783)
+++ branches/MwEmbedStandAlone/modules/SwarmTransport/mw.EmbedPlayerSwarmVlc.js
2010-09-26 17:09:27 UTC (rev 73784)
@@ -11,8 +11,9 @@
var _this = this;
var oggHttpSource = this.mediaElement.getSources( 'video/ogg'
)[0];
$j( this ).html(
- '<object
classid="clsid:98FF91C0-A3B8-11DF-8555-0002A5D5C51B" ' +
- 'id="' + this.pid + '" events="True" height="'
+ this.getHeight() + '" width="' + this.getWidth() + '"' +
+ '<object
classid="clsid:98FF91C0-A3B8-11DF-8555-0002A5D5C51B" ' +
+ 'name="' + this.pid + '" ' +
+ 'id="' + this.pid + '" events="True" height="'
+ this.getPlayerHeight() + '" width="' + this.getPlayerWidth() + '"' +
'>' +
'<param name="ShowDisplay" value="True"
/>' +
'<param name="AutoLoop" value="False"
/>' +
@@ -23,6 +24,11 @@
'</object>'
);
setTimeout( function() {
+ // make sure the object is the correct size ( IE
appears to do weird stuff with object tags )
+ $j( '#' + _this.pid ).css( {
+ 'width' : _this.getPlayerWidth(),
+ 'height' : _this.getPlayerHeight()
+ })
_this.monitor();
}, 100 );
}
@@ -33,7 +39,7 @@
mw.log("Error:: EmbedPLayerVlc not defefined ");
} else {
for( var i in mw.EmbedPlayerVlc ){
- if( !mw.EmbedPlayerSwarmVlc[ i ] ){
+ if( typeof mw.EmbedPlayerSwarmVlc[ i ] == 'undefined' ){
mw.EmbedPlayerSwarmVlc[ i ] = mw.EmbedPlayerVlc[i];
}
};
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs