http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73259

Revision: 73259
Author:   dale
Date:     2010-09-17 23:36:09 +0000 (Fri, 17 Sep 2010)

Log Message:
-----------
fixes for usage of library on file:// protocal 

Modified Paths:
--------------
    branches/MwEmbedStandAlone/ResourceLoader.php
    branches/MwEmbedStandAlone/includes/noMediaWikiConfig.php
    branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js
    branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
    branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerKplayer.js
    branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerNative.js
    
branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/kskin/mw.PlayerSkinKskin.js
    
branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mvpcf/mw.style.PlayerSkinMvpcf.css
    
branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js
    branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Sources.html
    branches/MwEmbedStandAlone/modules/Playlist/mw.Playlist.js
    branches/MwEmbedStandAlone/modules/Playlist/tests/Player_MediaRss.html
    branches/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js
    branches/MwEmbedStandAlone/mwEmbed.js

Modified: branches/MwEmbedStandAlone/ResourceLoader.php
===================================================================
--- branches/MwEmbedStandAlone/ResourceLoader.php       2010-09-17 23:23:04 UTC 
(rev 73258)
+++ branches/MwEmbedStandAlone/ResourceLoader.php       2010-09-17 23:36:09 UTC 
(rev 73259)
@@ -160,14 +160,12 @@
                                        wfRestoreWarnings();
                                }                                               
                
        
-                               // Add the required core mwEmbed style sheets 
removed for now
-                               // because when creating stand alone packages 
js package with css
+                               // Add the required core mwEmbed style sheets 
+                               // removed for now because when creating stand 
alone packages js package with css
                                // the paths get messed up.
-                               /*
-                               if( !isset( $this->namedFileList[ 
'mw.style.mwCommon' ] ) ) {
+                               /*if( !isset( $this->namedFileList[ 
'mw.style.mwCommon' ] ) ) {
                                        $this->output .= 
$this->getResourceText( 'mw.style.mwCommon' );
-                               }
-                               */
+                               }*/
 
                                // Output "special" IE comment tag to support 
"special" mwEmbed tags.
                                $this->notMinifiedTopOutput 
.='/*...@cc_on@if(@_jscript_version<9){\'video audio source itext 
playlist\'.replace(/\w+/g,function(n){document.createElement(n)})}...@end@*/'."\n";

Modified: branches/MwEmbedStandAlone/includes/noMediaWikiConfig.php
===================================================================
--- branches/MwEmbedStandAlone/includes/noMediaWikiConfig.php   2010-09-17 
23:23:04 UTC (rev 73258)
+++ branches/MwEmbedStandAlone/includes/noMediaWikiConfig.php   2010-09-17 
23:36:09 UTC (rev 73259)
@@ -151,6 +151,9 @@
        if( $wgLoadedMsgKeysFlag ) {
                return true;
        }
+       if( !$wgMessageCache ){
+               $wgMessageCache = array();
+       }
        foreach( $wgExtensionMessagesFiles as $msgFile ){
                if( !is_file( $msgFile ) ) {
                        throw new MWException( "Missing msgFile: " . 
htmlspecialchars( $msgFile ) . "\n" );

Modified: branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js
===================================================================
--- branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js    2010-09-17 
23:23:04 UTC (rev 73258)
+++ branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js    2010-09-17 
23:36:09 UTC (rev 73259)
@@ -166,15 +166,17 @@
                
                // Set up the embed video player class request: (include the 
skin js as well)
                var dependencyRequest = [
+                       [                                                       
        
+                               'mw.EmbedPlayer'
+                       ],
                        [
-                               '$j.ui',                                        
                        
-                               'mw.EmbedPlayer',
-                               'mw.PlayerControlBuilder',
+                               'mw.PlayerControlBuilder',
                                '$j.fn.hoverIntent',
                                'mw.style.EmbedPlayer',
                                '$j.cookie',
                                // Add JSON lib if browsers does not define 
"JSON" natively
                                'JSON',
+                               '$j.ui',                        
                                '$j.widget'
                        ],
                        [                        
@@ -189,7 +191,7 @@
                // Pass every tag being rewritten through the update request 
function
                $j( mw.getConfig( 'EmbedPlayer.RewriteTags' ) ).each( 
function() {      
                        var playerElement = this;               
-                       mw.embedPlayerUpdateLibraryRequest( playerElement,  
dependencyRequest[ 0 ] )                    
+                       mw.embedPlayerUpdateLibraryRequest( playerElement,  
dependencyRequest[ 1 ] )                    
                } );
                
                // Add PNG fix code needed:

Modified: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
===================================================================
--- branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js    
2010-09-17 23:23:04 UTC (rev 73258)
+++ branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js    
2010-09-17 23:36:09 UTC (rev 73259)
@@ -11,68 +11,7 @@
  * Add the messages text: 
  */
  
-mw.addMessages( {
-       "mwe-embedplayer-loading_plugin" : "Loading plugin ...",
-       "mwe-embedplayer-select_playback" : "Set playback preference",
-       "mwe-embedplayer-link_back" : "Link back",
-       "mwe-embedplayer-error_swap_vid" : "Error: mwEmbed was unable to swap 
the video tag for the mwEmbed interface",
-       "mwe-embedplayer-add_to_end_of_sequence" : "Add to end of sequence",
-       "mwe-embedplayer-missing_video_stream" : "The video file for this 
stream is missing",
-       "mwe-embedplayer-play_clip" : "Play clip",
-       "mwe-embedplayer-pause_clip" : "Pause clip",
-       "mwe-embedplayer-volume_control" : "Volume control",
-       "mwe-embedplayer-player_options" : "Player options",
-       "mwe-embedplayer-timed_text" : "Timed text",
-       "mwe-embedplayer-player_fullscreen" : "Fullscreen",
-       "mwe-embedplayer-next_clip_msg" : "Play next clip",
-       "mwe-embedplayer-prev_clip_msg" : "Play previous clip",
-       "mwe-embedplayer-current_clip_msg" : "Continue playing this clip",
-       "mwe-embedplayer-seek_to" : "Seek $1",
-       "mwe-embedplayer-paused" : "paused",
-       "mwe-embedplayer-download_segment" : "Download selection:",
-       "mwe-embedplayer-download_full" : "Download full video file:",
-       "mwe-embedplayer-download_right_click" : "To download, right click and 
select <i>Save link as...<\/i>",
-       "mwe-embedplayer-download_clip" : "Download video",
-       "mwe-embedplayer-download_text" : "Download timed text",
-       "mwe-embedplayer-download" : "Download",
-       "mwe-embedplayer-share" : "Share",
-       "mwe-embedplayer-about-library" : "About kaltura player",
-       "mwe-embedplayer-about-library-desc" : "Kaltura's HTML5 Media Library 
enables you to take advantage of the html5 &lt;video&gt; and &lt;audio&gt; tags 
today with a consistent player interface across all major browsers. <br> <br> 
[$1 More about the kaltura player library]",
-       "mwe-embedplayer-credits" : "Credits",
-       "mwe-embedplayer-clip_linkback" : "Clip source page",
-       "mwe-embedplayer-choose_player" : "Choose video player",
-       "mwe-embedplayer-no-player" : "No player available for $1", 
-       "mwe-embedplayer-share_this_video" : "Share this video",
-       "mwe-embedplayer-video_credits" : "Video credits",
-       "mwe-embedplayer-kaltura-platform-title" : "Kaltura open source video 
platform",
-       "mwe-embedplayer-menu_btn" : "Menu",
-       "mwe-embedplayer-close_btn" : "Close",
-       "mwe-embedplayer-ogg-player-vlc-player" : "VLC player",
-       "mwe-embedplayer-ogg-player-oggNative" : "HTML5 Ogg player",
-       "mwe-embedplayer-ogg-player-h264Native" : "HTML5 H.264 player",
-       "mwe-embedplayer-ogg-player-oggPlugin" : "Generic Ogg plugin",
-       "mwe-embedplayer-ogg-player-quicktime-mozilla" : "QuickTime plugin",
-       "mwe-embedplayer-ogg-player-quicktime-activex" : "QuickTime ActiveX",
-       "mwe-embedplayer-ogg-player-cortado" : "Java Cortado",
-       "mwe-embedplayer-ogg-player-flowplayer" : "Flowplayer",
-       "mwe-embedplayer-ogg-player-kplayer" : "Kaltura player",
-       "mwe-embedplayer-ogg-player-selected" : "(selected)",
-       "mwe-embedplayer-generic_missing_plugin" : "You browser does not appear 
to support the following playback type: <b>$1<\/b><br \/>Visit the <a 
href=\"http:\/\/commons.wikimedia.org\/wiki\/Commons:Media_help\">Playback 
methods<\/a> page to download a player.<br \/>",
-       "mwe-embedplayer-missing-source" : "No source video was found",
-       "mwe-embedplayer-for_best_experience" : "For a better video playback 
experience we recommend the <b><a 
href=\"http:\/\/www.mozilla.com\/en-US\/firefox\/upgrade.html?from=mwEmbed\">latest
 Firefox<\/a>.<\/b>",
-       "mwe-embedplayer-do_not_warn_again" : "Dismiss for now.",
-       "mwe-embedplayer-playerSelect" : "Players",
-       "mwe-embedplayer-read_before_embed" : "<a 
href=\"http:\/\/mediawiki.org\/wiki\/Security_Notes_on_Remote_Embedding\" 
target=\"_new\">Read this<\/a> before embedding.",
-       "mwe-embedplayer-embed_site_or_blog" : "Embed on a page",
-       "mwe-embedplayer-related_videos" : "Related videos",
-       "mwe-embedplayer-seeking" : "seeking",
-       "mwe-embedplayer-buffering" : "buffering",
-       "mwe-embedplayer-copy-code" : "Copy code",      
-       "mwe-embedplayer-video-h264" : "H.264 video",
-       "mwe-embedplayer-video-flv" : "Flash video",
-       "mwe-embedplayer-video-ogg" : "Ogg video",
-       "mwe-embedplayer-video-audio" : "Ogg audio"
-} );
+mw.includeAllModuleMessages();
 
 /*
 * The default video attributes supported by embedPlayer
@@ -335,7 +274,8 @@
                }       
                var addedToPlayerManager = false;
                // Make sure we have user preference setup ( for setting 
preferences on video selection )                               
-               mw.setupUserConfig( function() {                        
+               mw.setupUserConfig( function() {                                
+                       mw.log("EmbedPlayer:: found: " + $j( playerSelect 
).length + ' players ');                      
                        // Add each selected element to the player manager:     
        
                        $j( playerSelect ).each( function( index, 
playerElement) {                      
                                // Make sure the video tag was not generated by 
our library: 
@@ -1153,7 +1093,7 @@
        /** 
        * Selects the default source via cookie preference, default marked, or 
by id order
        */
-       autoSelectSource: function() {
+       autoSelectSource: function() { 
                mw.log( 'EmbedPlayer::mediaElement::autoSelectSource:' + 
this.id);
                // Select the default source
                var playableSources = this.getPlayableSources();
@@ -1163,7 +1103,7 @@
                for ( var source = 0; source < playableSources.length; source++ 
) {
                        var mimeType = playableSources[source].mimeType;        
                                
                        if ( mw.EmbedTypes.players.preference[ 
'format_preference' ] == mimeType ) {
-                                mw.log( 'set via preference: ' + 
playableSources[source].mimeType );
+                                mw.log( 'Set via preference: ' + 
playableSources[source].mimeType );
                                 this.selectedSource = playableSources[source];
                                 return true;
                        }
@@ -1172,17 +1112,18 @@
                // Set via marked default: 
                for ( var source = 0; source < playableSources.length; source++ 
) {
                        if ( playableSources[ source ].markedDefault ) {
-                               mw.log( 'set via marked default: ' + 
playableSources[source].markedDefault );
+                               mw.log( 'Set via marked default: ' + 
playableSources[source].markedDefault );
                                this.selectedSource = playableSources[source];
                                return true;
                        }
                }
                
-               // Set native client for flash
+               // Prefer native playback 
                for ( var source = 0; source < playableSources.length; source++ 
) {
                        var mimeType = playableSources[source].mimeType;
                        var player =  mw.EmbedTypes.players.defaultPlayer( 
mimeType );
-                       if ( this.isOgg( mimeType )     && player && 
player.library == 'Native' ) {
+                       if ( player && player.library == 'Native'       ) {
+                               mw.log('Set native playback');
                                this.selectedSource = playableSources[ source ];
                                return true;
                        }                       
@@ -1199,7 +1140,8 @@
                                        ||
                                        player.library == 'Kplayer'
                                )
-                       ) {                             
+                       ) {     
+                               mw.log('Set h264 via native or flash fallback');
                                this.selectedSource = playableSources[ source ];
                                return true;
                        }
@@ -2396,7 +2338,7 @@
         * @returns boolean true if the mwEmbed player interface should be used
         *                                      false if the mwEmbed player 
interface should not be used
         */
-       shouldUseNativeControls: function() {
+       shouldUseNativeControls: function() {           
                if( this.usenativecontrols === true ){
                        return true;
                }
@@ -2405,7 +2347,7 @@
                        return true;
                }
                if( mw.getConfig('EmbedPlayer.NativeControlsMobileSafari' ) &&
-                       mw.isMobileSafari()
+                       mw.isMobileHTML5()
                ){
                        return true;
                } 
@@ -2430,9 +2372,9 @@
                
                
                // Check if we need to refresh mobile safari
-               var mobileSafairNeedsRefresh = false;                           
        
+               var mobileSafariNeedsRefresh = false;                           
        
                                
-               // Unhide the original video element
+               // Unhide the original video element if not part of a 
playerThemer embed
                if( !$j( '#' + this.pid ).hasClass('PlayerThemer') ){
                        $j( '#' + this.pid )
                        .css( {
@@ -2441,12 +2383,12 @@
                        .show()
                        .attr('controls', 'true');
                        
-                       mobileSafairNeedsRefresh = true;
+                       mobileSafariNeedsRefresh = true;
                }
                
                // iPad does not handle video tag update for attributes like 
"controls" 
                // so we have to do a full replace ( if controls are not 
included initially )           
-               if( mw.isMobileSafari() && mobileSafairNeedsRefresh ) {
+               if( mw.isMobileHTML5() && mobileSafariNeedsRefresh ) {
                        var source = this.mediaElement.getSources( 'video/h264' 
)[0];
                        if( source && ! source.src ){
                                mw.log( 'Error: should have caught no playable 
sources for mobile safari earlier' );
@@ -2465,20 +2407,43 @@
                        var cssStyle = {
                                'width' : _this.width,
                                'height' : _this.height
-                       };                      
+                       };
                        $j( '#' + this.pid ).replaceWith( 
                                _this.getNativePlayerHtml( videoAttribues, 
cssStyle )                                                                   
                        )
                        // Bind native events:
                        this.applyMediaElementBindings();
                }
+               // Android only can play with a special play button ( no native 
controls in the dom , and no auto-play )
+               // and only with 'native display'
+               if( mw.isAndroid2() ){
+                       $j( '#' + _this.pid 
).siblings('.play-btn-large').remove();
+                       $j( '#' + _this.pid ).after( 
+                               $j('<div />')                           
+                               .css({
+                                       'position' : 'relative',
+                                       'top' : -1 * ( .5 * 
_this.getPlayerHeight() ) - 52,
+                                       'left' : ( .5 * _this.getPlayerWidth() 
) - 75
+                               })
+                               .attr( {                                
+                                       'title' : gM( 
'mwe-embedplayer-play_clip' ),
+                                       'class' : "ui-state-default 
play-btn-large"
+                               } )
+                               .click( function() {
+                                       _this.play();
+                                       // no need to hide the play button 
since android plays fullscreen
+                               } )
+                       )
+               }               
                return ;
        },
        /**
        * Should be set via native embed support  
        */
        getNativePlayerHtml: function(){
-               return $j('<div />' ).html( 'Error: Trying to get native html5 
player without native support for codec' );
+               return $j('<div />' )
+                       .css( 'width', this.getWidth() )
+                       .html( 'Error: Trying to get native html5 player 
without native support for codec' );
        },
        /**
        * Should be set via native embed support  
@@ -3467,7 +3432,7 @@
        * @param {String} mimeType Mime type for the associated player stream
        */
        setPlayerPreference : function( playerId, mimeType ) {  
-               var selectedPlayer = null;              
+               var selectedPlayer = null;                              
                for ( var i = 0; i < this.players.length; i++ ) {
                        if ( this.players[i].id == playerId ) {
                                selectedPlayer = this.players[i];
@@ -3597,12 +3562,16 @@
                                        }
                                                                                
                                        // Test for h264:                       
        
-                                       if ( dummyvid.canPlayType('video/mp4; 
codecs="avc1.42E01E, mp4a.40.2"' ) ) {
+                                       if ( dummyvid.canPlayType('video/mp4; 
codecs="avc1.42E01E, mp4a.40.2"' ) ) {                                          
  
                                                this.players.addPlayer( 
h264NativePlayer );
                                        }
+                                       // For now if Android assume we support 
h264Native (FIXME test on real devices )
+                                       if ( mw.isAndroid2() ){
+                                               this.players.addPlayer( 
h264NativePlayer );
+                                       }
                                        
                                        //       Test for ogg
-                                       if (  dummyvid.canPlayType( 
"video/ogg;codecs=\"theora,vorbis\"" ) ) {
+                                       if (  dummyvid.canPlayType( 'video/ogg; 
codecs="theora,vorbis"' ) ) {
                                                this.players.addPlayer( 
oggNativePlayer );                                              
                                        // older versions of safari do not 
support canPlayType,
                                        // but xiph qt registers mimetype via 
quicktime plugin
@@ -3613,7 +3582,7 @@
                        } catch ( e ) {
                                mw.log( 'could not run canPlayType ' + e );
                        }               
-               }
+               } 
                
                 // "navigator" plugins
                if ( navigator.mimeTypes && navigator.mimeTypes.length > 0 ) {

Modified: 
branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerKplayer.js
===================================================================
--- branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerKplayer.js     
2010-09-17 23:23:04 UTC (rev 73258)
+++ branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerKplayer.js     
2010-09-17 23:36:09 UTC (rev 73259)
@@ -31,13 +31,20 @@
        * Write the Embed html to the target 
        */
        doEmbedHTML : function () {
-               var _this = this;
-               var playerPath = mw.getMwEmbedPath() + 
'modules/EmbedPlayer/binPlayers/kaltura-player';                         
+               var _this = this;               
                
                mw.log("kPlayer:: embed src::" + _this.getSrc() );
                var flashvars = {};
                flashvars.autoPlay = "true";
+               var playerPath = mw.getMwEmbedPath() + 
'modules/EmbedPlayer/binPlayers/kaltura-player';         
                flashvars.entryId = mw.absoluteUrl( _this.getSrc() );
+               
+               // Use a relative url if the protocal is file://                
+               if( mw.parseUri( document.URL).protocol == 'file' ) {
+                       playerPath = mw.getRelativeMwEmbedPath() + 
'modules/EmbedPlayer/binPlayers/kaltura-player';                             
+                       flashvars.entryId  =  _this.getSrc();                   
+               }
+               
                flashvars.debugMode = "true";
                flashvars.fileSystemMode = "true";
                flashvars.widgetId = "_7463";
@@ -208,6 +215,7 @@
        doSeek: function( percentage ) {
                var _this = this;
                if ( this.supportsURLTimeEncoding() ){
+                       
                        //      Make sure we could not do a local seek instead:
                        if ( !( percentage <  this.bufferedPercent &&  
this.playerElement.duration &&  !this.didSeekJump )) {
                        // We support URLTimeEncoding call parent seek:
@@ -216,10 +224,8 @@
                        }
                } 
 
-
                if( this.playerElement ) {
-                       var seekTime = percentage * this.getDuration(); 
-                       
+                       var seekTime = percentage * this.getDuration();         
        
                        // Issue the seek to the flash player:
                        this.playerElement.sendNotification('doSeek',  
seekTime);
                        

Modified: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerNative.js
===================================================================
--- branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerNative.js      
2010-09-17 23:23:04 UTC (rev 73258)
+++ branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerNative.js      
2010-09-17 23:36:09 UTC (rev 73259)
@@ -46,7 +46,7 @@
        updateFeatureSupport: function(){
                // iWhatever devices appear to have a broken
                // dom overlay implementation of video atm. (hopefully iphone 
OS 4 fixes this )
-               if( mw.isMobileSafari() ) {
+               if( mw.isMobileHTML5() ) {
                        this.supports.overlays = false;
                }                               
        },
@@ -173,12 +173,12 @@
                // Bind events to local js methods:                     
                vid.addEventListener( 'canplaythrogh',  function() { $j( _this 
).trigger('canplaythrough'); }, true);                    
                vid.addEventListener( 'loadedmetadata', function() { 
_this.onloadedmetadata() }, true);
-               vid.addEventListener( 'progress', function( e ) { 
_this.onprogress( e );  }, true);
+               vid.addEventListener( 'progress', function( e ) { if( 
_this.onprogress ) { _this.onprogress( e ); }  }, true);
                vid.addEventListener( 'ended', function() {  _this.onended() }, 
true);          
                vid.addEventListener( 'seeking', function() { _this.onSeeking() 
}, true);
                vid.addEventListener( 'seeked', function() { _this.onSeeked() 
}, true);                 
                
-               vid.addEventListener( 'pause', function() { _this.onPaused() }, 
true );
+               vid.addEventListener( 'pause', function() { if( _this.onPaused 
) { _this.onPaused() } }, true );
                vid.addEventListener( 'play', function(){ _this.onPlay() }, 
true );                     
                vid.addEventListener( 'volumechange', function(){ 
_this.onVolumeChange() } , true );
        },
@@ -364,6 +364,15 @@
                        this.monitor();
                }
        },
+       /**
+        * Stop the player ( end all listeners ) 
+        */
+       stop:function(){
+               if( this.playerElement ){
+                       $j( this.playerElement ).unbind();
+               }
+               this.parent_stop();
+       },
        
        /**
        * Toggle the Mute

Modified: 
branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/kskin/mw.PlayerSkinKskin.js
===================================================================
--- 
branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/kskin/mw.PlayerSkinKskin.js
    2010-09-17 23:23:04 UTC (rev 73258)
+++ 
branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/kskin/mw.PlayerSkinKskin.js
    2010-09-17 23:36:09 UTC (rev 73259)
@@ -2,10 +2,6 @@
 * Skin js allows you to override contrlBuilder html/class output
 */
 
-mw.addMessages( {
-       "mwe-embedplayer-credit-title" : "Title: $1"
-} );
-
 mw.PlayerSkinKskin = {
 
        // The parent class for all kskin css: 

Modified: 
branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mvpcf/mw.style.PlayerSkinMvpcf.css
===================================================================
--- 
branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mvpcf/mw.style.PlayerSkinMvpcf.css
     2010-09-17 23:23:04 UTC (rev 73258)
+++ 
branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mvpcf/mw.style.PlayerSkinMvpcf.css
     2010-09-17 23:36:09 UTC (rev 73259)
@@ -49,11 +49,6 @@
        position:relative;
 }
 
-.controls a{
-       display: block;
-       height: 100%;
-       width: 100%;
-}
 .mv-player .volume_icon {
        float: right;
        display: inline;

Modified: 
branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js
===================================================================
--- 
branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js 
    2010-09-17 23:23:04 UTC (rev 73258)
+++ 
branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js 
    2010-09-17 23:36:09 UTC (rev 73259)
@@ -984,10 +984,10 @@
        * 
        * @param {String} overlayContent content to be displayed
        */
-       displayOverlay: function( overlayContent ) {
+       displayMenuOverlay: function( overlayContent ) {
                var _this = this;
                var embedPlayer = this.embedPlayer;
-               mw.log( 'displayOverlay::' );
+               mw.log( 'displayMenuOverlay::' );
                //      set the overlay display flag to true:
                this.displayOptionsMenuFlag = true;
                mw.log(" set displayOptionsMenuFlag:: " + 
this.displayOptionsMenuFlag);
@@ -1069,11 +1069,9 @@
                        $overlayShadow
                )
                .find( '.overlay-win' )
-               .fadeIn( "slow" );                                      
+               .fadeIn( "slow" );                                              
        
                
-               
-               // trigger menu overlay display
-               alert('triger displayMenuOverlay');
+               // trigger menu overlay display         
                $j(embedPlayer).trigger( 'displayMenuOverlay' );
                
                return false; // onclick action return false
@@ -1223,8 +1221,8 @@
                                                        .click( function() {
                                                                var iparts = 
$j( this ).attr( 'id' ).replace(/sc_/ , '' ).split( '_' );
                                                                var sourceId = 
iparts[0];
-                                                               var 
default_player_id = iparts[1];
-                                                               mw.log( 'source 
id: ' +  sourceId + ' player id: ' + default_player_id );
+                                                               var player_id = 
iparts[1];
+                                                               mw.log( 'source 
id: ' +  sourceId + ' player id: ' + player_id );
                                
                                                                
embedPlayer.controlBuilder.closeMenuOverlay();
                                                                
@@ -1234,10 +1232,11 @@
                                                                }
                                                                
                                                                
embedPlayer.mediaElement.selectSource( sourceId );
-                               
+                                                               var 
playableSources = embedPlayer.mediaElement.getPlayableSources();
+                                                               
                                                                
mw.EmbedTypes.players.setPlayerPreference( 
-                                                                       
default_player_id,
-                                                                       
embedPlayer.mediaElement.sources[ sourceId ].getMIMEType() 
+                                                                       
player_id,
+                                                                       
playableSources[ sourceId ].getMIMEType() 
                                                                );
                                
                                                                // Issue a stop

Modified: 
branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Sources.html
===================================================================
--- branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Sources.html    
2010-09-17 23:23:04 UTC (rev 73258)
+++ branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Sources.html    
2010-09-17 23:36:09 UTC (rev 73259)
@@ -17,4 +17,4 @@
 
 
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: branches/MwEmbedStandAlone/modules/Playlist/mw.Playlist.js
===================================================================
--- branches/MwEmbedStandAlone/modules/Playlist/mw.Playlist.js  2010-09-17 
23:23:04 UTC (rev 73258)
+++ branches/MwEmbedStandAlone/modules/Playlist/mw.Playlist.js  2010-09-17 
23:36:09 UTC (rev 73259)
@@ -257,7 +257,7 @@
                                $videoList.show()
                                // show the video list and apply the swipe 
binding 
                                $j( _this.target 
).find('.media-rss-video-list-wrapper').fadeIn();                              
-                               if( mw.isMobileSafari() ){                      
+                               if( mw.isMobileHTML5() ){                       
                                        // iScroll is buggy with current 
version of iPad / iPhone use scroll buttons instead
                                        /*
                                        document.addEventListener('touchmove', 
function(e){ e.preventDefault(); });                                            
         
@@ -434,7 +434,7 @@
                // ( mobile safari can't javascript start the video ) 
                // see: 
http://developer.apple.com/iphone/search/search.php?simp=1&num=10&Search=html5+autoplay
                var addVideoPlayerToDom = true;                         
-               if( mw.isMobileSafari() ){
+               if( mw.isMobileHTML5() ){
                        // Check for a current video:   
                        var $inDomVideo = $j( _this.target + ' 
.media-rss-video-player video' );                        
                        if( $inDomVideo.length == 0 ){

Modified: branches/MwEmbedStandAlone/modules/Playlist/tests/Player_MediaRss.html
===================================================================
--- branches/MwEmbedStandAlone/modules/Playlist/tests/Player_MediaRss.html      
2010-09-17 23:23:04 UTC (rev 73258)
+++ branches/MwEmbedStandAlone/modules/Playlist/tests/Player_MediaRss.html      
2010-09-17 23:36:09 UTC (rev 73259)
@@ -14,8 +14,8 @@
   
 <script type="text/javascript">
        // For testing safari in chrome / 
-       if( document.URL.indexOf('forceMobileSafari') != -1 ){          
-               mw.setConfig( 'forceMobileSafari' , true );
+       if( document.URL.indexOf('forceMobileHTML5') != -1 ){           
+               mw.setConfig( 'forceMobileHTML5' , true );
        }
                
        mw.ready( function(){   

Modified: branches/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js
===================================================================
--- branches/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js        
2010-09-17 23:23:04 UTC (rev 73258)
+++ branches/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js        
2010-09-17 23:36:09 UTC (rev 73259)
@@ -11,36 +11,7 @@
  *
  */ 
 
-mw.addMessages( {
-       "mwe-timedtext-back-btn" : "Back",
-       "mwe-timedtext-choose-text" : "Chose text",
-       "mwe-timedtext-add-timed-text" : "Add timed text",
-       "mwe-timedtext-loading-text-edit" : "Loading timed text editor", 
-       
-       "mwe-timedtext-search" : "Search clip",
-       
-       "mwe-timedtext-layout" : "Layout", 
-       "mwe-timedtext-layout-ontop" : "Ontop of video",
-       "mwe-timedtext-layout-below": "Below video", 
-       "mwe-timedtext-layout-off" : "Hide subtitles",
-       
-       "mwe-timedtext-loading-text" : "Loading text ...",
-       
-       "mwe-timedtext-key-language": "$1, $2",
-       
-       "mwe-timedtext-textcat-cc" : "Captions",
-       "mwe-timedtext-textcat-sub" : "Subtitles",
-       "mwe-timedtext-textcat-tad" : "Audio description",
-       "mwe-timedtext-textcat-ktv" : "Karaoke",
-       "mwe-timedtext-textcat-tik" : "Ticker text",
-       "mwe-timedtext-textcat-ar" : "Active regions",
-       "mwe-timedtext-textcat-nb" : "Annotation",
-       "mwe-timedtext-textcat-meta" : "Timed metadata",
-       "mwe-timedtext-textcat-trx" : "Transcript",
-       "mwe-timedtext-textcat-lrc" : "Lyrics",
-       "mwe-timedtext-textcat-lin" : "Linguistic markup",
-       "mwe-timedtext-textcat-cue" : "Cue points"
-} );
+mw.includeAllModuleMessages();
 
 // Bind to mw ( for uncluttered global namespace ) 
 ( function( $ ) {

Modified: branches/MwEmbedStandAlone/mwEmbed.js
===================================================================
--- branches/MwEmbedStandAlone/mwEmbed.js       2010-09-17 23:23:04 UTC (rev 
73258)
+++ branches/MwEmbedStandAlone/mwEmbed.js       2010-09-17 23:36:09 UTC (rev 
73259)
@@ -1,6 +1,6 @@
-// Add support for html5 / mwEmbed elements to IE ( comment must come before 
js code ) 
-// For discussion and comments, see: 
http://remysharp.com/2009/01/07/html5-enabling-script/
-/*...@cc_on@if(@_jscript_version<9){'video audio source 
track'.replace(/\w+/g,function(n){document.createElement(n)})}...@end@*/
+// Add support for html5 / mwEmbed elements to browsers that do not support 
the elements natively 
+// For discussion and comments, see: http://ejohn.org/blog/html5-shiv/
+'video audio source track'.replace(/\w+/g, function(n){ 
document.createElement(n) });
 
 /**
  * @license
@@ -1144,22 +1144,31 @@
        }       
        
        /**
-        * Mobile Safari has special properties for html5 video::
+        * Mobile HTML5 has special properties for html5 video::
         * 
-        * NOTE: should be phased out in favor of browser feature detection 
script
+        * NOTE: should be phased out in favor of browser feature detection 
where possible
         */
-       mw.isMobileSafari = function() {                
+       mw.isMobileHTML5 = function() {
                // check mobile safari foce ( for debug )
-               if( mw.getConfig( 'forceMobileSafari' ) || 
document.URL.indexOf('forceMobileSafari') != -1 ){
+               if( mw.getConfig( 'forceMobileHTML5' ) || 
document.URL.indexOf('forceMobileHTML5') != -1 ){
                        return true;
                }
-               if ((navigator.userAgent.indexOf('iPhone') != -1) || 
-                       (navigator.userAgent.indexOf('iPod') != -1) || 
-                       (navigator.userAgent.indexOf('iPad') != -1)) {
+               if (( navigator.userAgent.indexOf('iPhone') != -1) || 
+                       ( navigator.userAgent.indexOf('iPod') != -1) || 
+                       ( navigator.userAgent.indexOf('iPad') != -1) ||
+                       ( mw.isAndroid2() )  
+               ) {
                        return true;
                }
                return false;
-       }
+       };
+       // Android 2 has some restrictions vs other mobile platforms 
+       mw.isAndroid2 = function(){
+               if ( navigator.userAgent.indexOf('Android 2.') != -1) {
+                       return true;
+               }
+               return false;
+       };
        
        /**
         * Similar to php isset function checks if the variable exists. Does a 
safe
@@ -1185,7 +1194,7 @@
                        }
                }
                return true;
-       }
+       };
        
        /**
         * Wait for a object to be defined and the call the callback
@@ -1268,10 +1277,11 @@
                
                if ( window.console ) {
                        window.console.log( string );
-               } else {        
+               } else {
                        /**
                         * Old IE and non-Firebug debug: ( commented out for 
now )
-                        */                                             
+                        */             
+               
                        /*var log_elm = document.getElementById('mv_js_log'); 
                        if(!log_elm) {                          
                                
document.getElementsByTagName("body")[0].innerHTML += '<div ' +
@@ -1282,7 +1292,9 @@
                        var log_elm = document.getElementById('mv_js_log'); 
                        if(log_elm) {
                                log_elm.value+=string+"\n"; 
-                       }*/                     
+                               // scroll to bottom: 
+                               log_elm.scrollTop = log_elm.scrollHeight;
+                       }*/
                }
        }
        
@@ -1390,6 +1402,7 @@
                if( mw.isset( 'window.jQuery' ) 
                        && mw.getConfig( 'debug' ) === false 
                        && typeof $j != 'undefined'
+                       && mw.parseUri( url ).protocal != 'file'
                        && !isCssFile ) 
                {       
                        $j.getScript( url, myCallback);                 
@@ -1507,18 +1520,13 @@
                }
        };
        
-       
-       // Local mwEmbedPath variable ( for cache of mw.getMwEmbedPath )
-       var mwEmbedPath = null;
-                               
+       mw.getRelativeMwEmbedPath = function(){
+               return mw.getMwEmbedPath(true);
+       };              
        /**
         * Get the path to the mwEmbed folder
         */
-       mw.getMwEmbedPath = function() {
-               if ( mwEmbedPath ) {
-                       return mwEmbedPath;
-               }       
-                       
+       mw.getMwEmbedPath = function( relativePath ) {                  
                // Get mwEmbed src:
                var src = mw.getMwEmbedSrc();
                var mwpath = null;
@@ -1539,7 +1547,7 @@
                if( src.indexOf( 'ResourceLoader.php' ) !== -1 ) {
                        mwpath = src.substr( 0, src.indexOf( 
'ResourceLoader.php' ) );                  
                }       
-               
+                       
                // For static packages mwEmbed packages start with: "mwEmbed-"
                if( src.indexOf( 'mwEmbed-' ) !== -1 && src.indexOf( '-static' 
) !== -1 ) {
                        mwpath = src.substr( 0, src.indexOf( 'mwEmbed-' ) );
@@ -1552,8 +1560,10 @@
                }
                
                // Update the cached var with the absolute path:
-               mwEmbedPath = mw.absoluteUrl( mwpath )  ;                       
-               return mwEmbedPath;
+               if( !relativePath ){
+                       mwpath = mw.absoluteUrl( mwpath )       ;
+               }
+               return mwpath;
        }
        
        /**
@@ -1823,28 +1833,36 @@
         *      from a relative path
         * @return {String} absolute url
         */
-       mw.absoluteUrl = function( src, contextUrl ) {
+mw.absoluteUrl = function( src, contextUrl ) {
                
                var parsedSrc =  mw.parseUri( src );            
+
                // Source is already absolute return:
                if( parsedSrc.protocol != '') {
                        return src;                             
                }
                
                // Get parent Url location the context URL
-               if( contextUrl ) {      
-                       var parsedUrl = mw.parseUri( contextUrl );              
        
-               } else {
-                       var parsedUrl = mw.parseUri( document.URL );
+               if( !contextUrl ) {     
+                       contextUrl = document.URL;
+               }               
+               var parsedUrl = mw.parseUri( contextUrl );      
+       
+               // Check for IE local file that does not flip the slashes       
+               if( parsedUrl.directory == '' && parsedUrl.protocol == 'file' 
){                        
+                       // pop off the file
+                       var fileUrl = contextUrl.split( '\\');
+                       fileUrl.pop();
+                       return  fileUrl.join('\\') + '\\' + src;                
                }
-               
+
                // Check for leading slash:
                if( src.indexOf( '/' ) === 0 ) {
                        return parsedUrl.protocol + '://' + parsedUrl.authority 
+ src;
-               }else{
+               }else{                  
                        return parsedUrl.protocol + '://' + parsedUrl.authority 
+ parsedUrl.directory + src;
                }
-       };      
+       };
        /**
         * Check if a given source string is likely a url   
         * 
@@ -2164,11 +2182,18 @@
                        } );
                }               
                function addLocalSettings(){
-                       mw.log("Load loacal settings")
-                       mw.load( 'localSettings.js', function(){
+                       var continueCallback = function(){
                                // Set the mwModuleLoaderCheckFlag flag to true
                                mwModuleLoaderCheckFlag = true;         
                                callback();
+                       }
+                       if( mw.getConfig( 'LoadLocalSettings') != true ){
+                               continueCallback();
+                               return; 
+                       }
+                       mw.log("Load loacal settings")
+                       mw.load( 'localSettings.js', function(){
+                               continueCallback();
                        })
                }
                                        



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to