Index: branches/MwEmbedStandAlone/tests/Player_SwarmTransport.html |
— | — | @@ -0,0 +1,53 @@ |
| 2 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| 3 | +"http://www.w3.org/TR/html4/loose.dtd"> |
| 4 | +<html> |
| 5 | +<head> |
| 6 | + <title>sample mv embed</title> |
| 7 | + <!-- <script type="text/javascript" src="../mwEmbed.js?debug=true"></script> --> |
| 8 | + <!-- <script type="text/javascript" src="../jsScriptLoader.php?class=window.jQuery,mwEmbed&debug=true"></script> --> |
| 9 | + |
| 10 | + <script type="text/javascript" src="../mwEmbed.js?debug=true"></script> |
| 11 | + |
| 12 | + <script type="text/javascript"> |
| 13 | + |
| 14 | + // Set configuration: |
| 15 | + mw.setConfig( 'enableSwarmTransport', true ); |
| 16 | + |
| 17 | + mw.setConfig( 'recommendSwarmTransport', true ); |
| 18 | + |
| 19 | + </script> |
| 20 | +</head> |
| 21 | +<body> |
| 22 | +<h3> Swarm Transport:</h3> |
| 23 | + |
| 24 | +Install the swarmTransport add-on and this video will be served via p2p next <a href="http://wikipedia.p2p-next.org/">swarm transport</a> <br /> |
| 25 | + <table border="1" cellpadding="6" width="950"> |
| 26 | + |
| 27 | + <tr> |
| 28 | + <td id="apiExample" valign="top" width="410"> |
| 29 | + <video |
| 30 | + style="width:400px;height:300px" |
| 31 | + apiTitleKey="Welcome_to_globallives_2.0.ogv" |
| 32 | + apiProvider="commons" |
| 33 | + class="kskin"> |
| 34 | + </video> |
| 35 | + <td valign="top"> |
| 36 | + Commons Video API based timedText discovery<br> |
| 37 | + |
| 38 | + <textarea id="apiExampleTextArea" style="width:600px;height:180px"> |
| 39 | +<video |
| 40 | + style="width:400px;height:300px" |
| 41 | + apiTitleKey="Welcome_to_globallives_2.0.ogv" |
| 42 | + apiProvider="commons" |
| 43 | + class="kskin"> |
| 44 | +</video> |
| 45 | + |
| 46 | + </textarea> |
| 47 | + </td> |
| 48 | + </tr> |
| 49 | + |
| 50 | + </table> |
| 51 | + |
| 52 | +</body> |
| 53 | +</html> |
| 54 | + |
Index: branches/MwEmbedStandAlone/modules/SwarmTransport/loader.js |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | mw.addClassFilePaths( { |
12 | 12 | "mw.SwarmTransport" : "mw.SwarmTransport.js" |
13 | 13 | }); |
14 | | - |
| 14 | + |
15 | 15 | mw.setDefaultConfig({ |
16 | 16 | /** |
17 | 17 | * If SwarmTransport should be enabled as a video transport mechanism |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | }); |
26 | 26 | |
27 | 27 | // Add the mw.SwarmTransport to the embedPlayer loader: |
28 | | - $j( mw ).bind( 'LoaderEmbedPlayerUpdateRequest', function( event, playerElement, classRequest ) { |
| 28 | + $j( mw ).bind( 'LoaderEmbedPlayerUpdateRequest', function( event, playerElement, classRequest ) { |
29 | 29 | // If the swarm transport is enabled add mw.SwarmTransport to the request. |
30 | 30 | if( mw.getConfig( 'enableSwarmTransport' ) ) { |
31 | 31 | if( $j.inArray( 'mw.SwarmTransport', classRequest ) == -1 ) { |
Index: branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js |
— | — | @@ -8,7 +8,8 @@ |
9 | 9 | * Define mw.SwarmTransport object: |
10 | 10 | */ |
11 | 11 | mw.SwarmTransport = { |
12 | | - addPlayerHooks: function(){ |
| 12 | + |
| 13 | + addPlayerHooks: function(){ |
13 | 14 | var _this = this; |
14 | 15 | // Bind some hooks to every player: |
15 | 16 | $j( mw ).bind( 'newEmbedPlayerEvent', function( event, swapedPlayerId ) { |
— | — | @@ -16,11 +17,10 @@ |
17 | 18 | var embedPlayer = $j( '#' + swapedPlayerId ).get(0); |
18 | 19 | |
19 | 20 | // Setup the "embedCode" binding to swap in an updated url |
20 | | - $j( embedPlayer ).bind( 'checkPlayerSourcesEvent', function( event, callback ) { |
21 | | - |
| 21 | + $j( embedPlayer ).bind( 'checkPlayerSourcesEvent', function( event, callback ) { |
22 | 22 | // Confirm SwarmTransport add-on is available ( defines swarmTransport var ) |
23 | 23 | if( typeof window['swarmTransport'] != 'undefined' ){ |
24 | | - |
| 24 | + _this.addSwarmPlayer( embedPlayer ); |
25 | 25 | mw.log(" SwarmTransport :: checkPlayerSourcesEvent "); |
26 | 26 | _this.addSwarmSource( embedPlayer, callback ); |
27 | 27 | |
— | — | @@ -30,7 +30,7 @@ |
31 | 31 | } |
32 | 32 | } ); |
33 | 33 | |
34 | | - // Check if we have a "recommend" binding and provide an xpi link |
| 34 | + // Check if we have a "recommend" binding and provide an xpi install link |
35 | 35 | mw.log('bind::addControlBindingsEvent'); |
36 | 36 | $j( embedPlayer ).bind( 'addControlBindingsEvent', function(){ |
37 | 37 | if( mw.getConfig( 'recommendSwarmTransport' ) && |
— | — | @@ -43,28 +43,23 @@ |
44 | 44 | } |
45 | 45 | }); |
46 | 46 | |
47 | | - } ); |
| 47 | + } ); |
| 48 | + |
| 49 | + }, |
48 | 50 | |
| 51 | + addSwarmPlayer: function( embedPlayer ){ |
| 52 | + // Add the swarmTransport playerType |
| 53 | + mw.EmbedTypes.players.defaultPlayers['video/swarmTransport'] = ['native']; |
49 | 54 | |
| 55 | + // Build the swarm Transport Player |
| 56 | + var swarmTransportPlayer = new mediaPlayer( 'swarmTransportPlayer', ['video/swarmTransport' ], 'native' ); |
50 | 57 | |
51 | | - $j( mw ).bind( 'embedPlayerUpdateMediaPlayersEvent', function( event, mediaPlayers){ |
52 | | - // Detect support for SwarmTransport |
53 | | - if( typeof window['swarmTransport'] != 'undefined' ){ |
54 | | - // Add the swarmTransport playerType |
55 | | - mediaPlayers.defaultPlayers['video/swarmTransport'] = ['native']; |
56 | | - |
57 | | - // For now swarm transport only supports ogg ( probably add webm in the future ) |
58 | | - // Native html5 player |
59 | | - var swarmTransportPlayer = new mediaPlayer( 'swarmTransportPlayer', ['video/swarmTransport' ], 'native' ); |
60 | | - |
61 | | - // Add the swarmTransport "player" |
62 | | - mediaPlayers.addPlayer( swarmTransportPlayer ); |
63 | | - } |
64 | | - }); |
65 | | - |
| 58 | + // Add the swarmTransport "player" |
| 59 | + mw.EmbedTypes.players.addPlayer( swarmTransportPlayer ); |
66 | 60 | }, |
67 | 61 | |
68 | 62 | addSwarmSource: function( embedPlayer, callback ) { |
| 63 | + var _this = this; |
69 | 64 | |
70 | 65 | // Setup function to run in context based on callback result |
71 | 66 | var finishAddSwarmSource = function(){ |
— | — | @@ -74,7 +69,7 @@ |
75 | 70 | var absoluteSource = mw.absoluteUrl( source.getSrc() ); |
76 | 71 | var swarmSrc = httpseed2tstream( absoluteSource ); |
77 | 72 | |
78 | | - mw.log('addSwarmSource for: ' + source.getSrc() + "\nGot:" + swarmSrc ); |
| 73 | + mw.log('addSwarmSource for: ' + source.getSrc() + "\n\nGot:" + swarmSrc ); |
79 | 74 | |
80 | 75 | embedPlayer.mediaElement.tryAddSource( |
81 | 76 | $j('<source />') |
— | — | @@ -92,9 +87,11 @@ |
93 | 88 | // p2p next does not have a lookup service rather a static file that defines a function |
94 | 89 | // by the name of httpseed2tstream ( check if httpseed2tstream is defined ) |
95 | 90 | if ( typeof httpseed2tstream == 'undefined' ) { |
| 91 | + // should do a check to avoid loading tlookup multiple times |
96 | 92 | mw.load('http://wikipedia.p2p-next.org/tlookup.js', function(){ |
97 | | - finishAddSwarmSource(); |
98 | | - } ); |
| 93 | + finishAddSwarmSource(); |
| 94 | + }); |
| 95 | + |
99 | 96 | } else { |
100 | 97 | finishAddSwarmSource(); |
101 | 98 | } |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js |
— | — | @@ -197,9 +197,8 @@ |
198 | 198 | ] |
199 | 199 | |
200 | 200 | ]; |
201 | | - |
202 | | - // Get the class of all embed video elements |
203 | | - // to add the skin to the load request |
| 201 | + |
| 202 | + // Pass every tag being rewritten through the update request function |
204 | 203 | $j( mw.getConfig( 'rewritePlayerTags' ) ).each( function() { |
205 | 204 | var playerElement = this; |
206 | 205 | mw.embedPlayerUpdateLibraryRequest( playerElement, dependencyRequest[ 0 ] ) |
— | — | @@ -226,10 +225,8 @@ |
227 | 226 | // Setup userConfig |
228 | 227 | mw.setupUserConfig( function() { |
229 | 228 | // Remove no video html elements: |
230 | | - $j( '.videonojs' ).remove(); |
| 229 | + $j( '.videonojs' ).remove(); |
231 | 230 | |
232 | | - |
233 | | - |
234 | 231 | // Detect supported players: |
235 | 232 | mw.EmbedTypes.init(); |
236 | 233 | |
— | — | @@ -284,6 +281,7 @@ |
285 | 282 | |
286 | 283 | $j( mw ).trigger( 'LoaderEmbedPlayerUpdateRequest', |
287 | 284 | [ playerElement, dependencyRequest ] ); |
| 285 | + |
288 | 286 | } |
289 | 287 | |
290 | 288 | } )( window.mw ); |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js |
— | — | @@ -344,7 +344,7 @@ |
345 | 345 | * _this.checkForTimedText() |
346 | 346 | * _this.setupSourcePlayer() |
347 | 347 | * _this.inheritEmbedPlayer() |
348 | | - * _this.selected_player.load() |
| 348 | + * _this.selectedPlayer.load() |
349 | 349 | * _this.showPlayer() |
350 | 350 | * |
351 | 351 | * @param {Element} playerElement DOM element to be swapped |
— | — | @@ -1324,6 +1324,10 @@ |
1325 | 1325 | if( this[ attr ] == "false" ) this[attr] = false; |
1326 | 1326 | if( this[ attr ] == "true" ) this[attr] = true; |
1327 | 1327 | } |
| 1328 | + |
| 1329 | + if( this.apiTitleKey ){ |
| 1330 | + this.apiTitleKey = unescape( this.apiTitleKey ); |
| 1331 | + } |
1328 | 1332 | |
1329 | 1333 | // Hide "controls" if using native player controls: |
1330 | 1334 | if( this.useNativeControls() ){ |
— | — | @@ -1636,16 +1640,16 @@ |
1637 | 1641 | mw.log( 'no sources, type:' + this.type + ' check for html' ); |
1638 | 1642 | // do load player if just displaying innerHTML: |
1639 | 1643 | if ( this.pc.type == 'text/html' ) { |
1640 | | - this.selected_player = mw.EmbedTypes.players.defaultPlayer( 'text/html' ); |
1641 | | - mw.log( 'set selected player:' + this.selected_player.mimeType ); |
| 1644 | + this.selectedPlayer = mw.EmbedTypes.players.defaultPlayer( 'text/html' ); |
| 1645 | + mw.log( 'set selected player:' + this.selectedPlayer.mimeType ); |
1642 | 1646 | } |
1643 | 1647 | } |
1644 | 1648 | } else { |
1645 | | - this.selected_player = mw.EmbedTypes.players.defaultPlayer( this.mediaElement.selectedSource.mimeType ); |
| 1649 | + this.selectedPlayer = mw.EmbedTypes.players.defaultPlayer( this.mediaElement.selectedSource.mimeType ); |
1646 | 1650 | } |
1647 | 1651 | |
1648 | | - if ( this.selected_player ) { |
1649 | | - mw.log( "Playback system: " + this.selected_player.library ); |
| 1652 | + if ( this.selectedPlayer ) { |
| 1653 | + mw.log( "Playback system: " + this.selectedPlayer.library ); |
1650 | 1654 | |
1651 | 1655 | // Inherit the playback system of the selected player: |
1652 | 1656 | this.inheritEmbedPlayer(); |
— | — | @@ -1688,14 +1692,14 @@ |
1689 | 1693 | } |
1690 | 1694 | |
1691 | 1695 | // Set up the new embedObj |
1692 | | - mw.log( 'f: inheritEmbedPlayer: embedding with ' + this.selected_player.library ); |
| 1696 | + mw.log( 'f: inheritEmbedPlayer: embedding with ' + this.selectedPlayer.library ); |
1693 | 1697 | var _this = this; |
1694 | 1698 | |
1695 | 1699 | // Load the selected player |
1696 | | - this.selected_player.load( function() { |
1697 | | - mw.log( _this.selected_player.library + " player loaded" ); |
| 1700 | + this.selectedPlayer.load( function() { |
| 1701 | + mw.log( _this.selectedPlayer.library + " player loaded" ); |
1698 | 1702 | // Get embed library player Interface |
1699 | | - var playerInterface = window[ _this.selected_player.library + 'Embed' ]; |
| 1703 | + var playerInterface = window[ _this.selectedPlayer.library + 'Embed' ]; |
1700 | 1704 | |
1701 | 1705 | for ( var method in playerInterface ) { |
1702 | 1706 | if ( _this[method] && !_this['parent_' + method] ) { |
— | — | @@ -1726,8 +1730,8 @@ |
1727 | 1731 | */ |
1728 | 1732 | selectPlayer: function( player ) { |
1729 | 1733 | var _this = this; |
1730 | | - if ( this.selected_player.id != player.id ) { |
1731 | | - this.selected_player = player; |
| 1734 | + if ( this.selectedPlayer.id != player.id ) { |
| 1735 | + this.selectedPlayer = player; |
1732 | 1736 | this.inheritEmbedPlayer( function() { |
1733 | 1737 | // Update the controls for the new selected player |
1734 | 1738 | _this.refreshControls(); |
— | — | @@ -1831,7 +1835,7 @@ |
1832 | 1836 | * issues a loading request |
1833 | 1837 | */ |
1834 | 1838 | doEmbedPlayer: function() { |
1835 | | - mw.log( 'f:doEmbedPlayer::' + this.selected_player.id ); |
| 1839 | + mw.log( 'f:doEmbedPlayer::' + this.selectedPlayer.id ); |
1836 | 1840 | mw.log( 'thum disp:' + this.thumbnail_disp ); |
1837 | 1841 | var _this = this; |
1838 | 1842 | |
— | — | @@ -2528,8 +2532,8 @@ |
2529 | 2533 | |
2530 | 2534 | // Check if thumbnail is being displayed and embed html |
2531 | 2535 | if ( this.thumbnail_disp ) { |
2532 | | - if ( !this.selected_player ) { |
2533 | | - mw.log( 'no selected_player' ); |
| 2536 | + if ( !this.selectedPlayer ) { |
| 2537 | + mw.log( 'no selectedPlayer' ); |
2534 | 2538 | this.showPluginMissingHTML(); |
2535 | 2539 | } else { |
2536 | 2540 | this.thumbnail_disp = false; |
— | — | @@ -2802,7 +2806,7 @@ |
2803 | 2807 | mw.getJSON( { |
2804 | 2808 | 'action' : 'playtracking', |
2805 | 2809 | 'filename' : this.apiTitleKey, |
2806 | | - 'client' : this.selected_player.library + ' && ' + navigator.userAgent |
| 2810 | + 'client' : this.selectedPlayer.library + ' && ' + navigator.userAgent |
2807 | 2811 | }, function( data ) { |
2808 | 2812 | mw.log( 'done logging play request' ); |
2809 | 2813 | } ); |
— | — | @@ -3310,10 +3314,10 @@ |
3311 | 3315 | * @param {String} mimeType Mime type for the associated player stream |
3312 | 3316 | */ |
3313 | 3317 | setPlayerPreference : function( playerId, mimeType ) { |
3314 | | - var selected_player = null; |
| 3318 | + var selectedPlayer = null; |
3315 | 3319 | for ( var i = 0; i < this.players.length; i++ ) { |
3316 | 3320 | if ( this.players[i].id == playerId ) { |
3317 | | - selected_player = this.players[i]; |
| 3321 | + selectedPlayer = this.players[i]; |
3318 | 3322 | mw.log( 'choosing ' + playerId + ' for ' + mimeType ); |
3319 | 3323 | this.preference[ mimeType ] = playerId; |
3320 | 3324 | mw.setUserConfig( 'playerPref', this.preference ); |
— | — | @@ -3321,14 +3325,14 @@ |
3322 | 3326 | } |
3323 | 3327 | } |
3324 | 3328 | // Update All the player instances: |
3325 | | - if ( selected_player ) { |
| 3329 | + if ( selectedPlayer ) { |
3326 | 3330 | var playerList = mw.playerManager.getPlayerList(); |
3327 | 3331 | for ( var i = 0; i < playerList.length; i++ ) { |
3328 | 3332 | var embed = $j( '#' + playerList[i] ).get( 0 ); |
3329 | 3333 | if ( embed.mediaElement.selectedSource && ( embed.mediaElement.selectedSource.mimeType == mimeType ) ) |
3330 | 3334 | { |
3331 | | - embed.selectPlayer( selected_player ); |
3332 | | - mw.log( 'using ' + embed.selected_player.getName() + ' for ' + embed.mediaElement.selectedSource.getTitle() ); |
| 3335 | + embed.selectPlayer( selectedPlayer ); |
| 3336 | + mw.log( 'using ' + embed.selectedPlayer.getName() + ' for ' + embed.mediaElement.selectedSource.getTitle() ); |
3333 | 3337 | } |
3334 | 3338 | } |
3335 | 3339 | } |
— | — | @@ -3344,7 +3348,6 @@ |
3345 | 3349 | if( typeof preferenceConfig == 'object' ) { |
3346 | 3350 | this.preference = preferenceConfig; |
3347 | 3351 | } |
3348 | | - //debugger; |
3349 | 3352 | } |
3350 | 3353 | }; |
3351 | 3354 | |
— | — | @@ -3390,7 +3393,7 @@ |
3391 | 3394 | */ |
3392 | 3395 | detect: function() { |
3393 | 3396 | mw.log( "embedPlayer: running detect" ); |
3394 | | - this.players = new mediaPlayers(); |
| 3397 | + this.players = new mediaPlayers(); |
3395 | 3398 | // every browser supports html rendering: |
3396 | 3399 | this.players.addPlayer( htmlPlayer ); |
3397 | 3400 | // In Mozilla, navigator.javaEnabled() only tells us about preferences, we need to |
— | — | @@ -3514,6 +3517,7 @@ |
3515 | 3518 | } |
3516 | 3519 | |
3517 | 3520 | // Allow extensions to detect and add their own "players" |
| 3521 | + mw.log("trigger::embedPlayerUpdateMediaPlayersEvent"); |
3518 | 3522 | $j( mw ).trigger( 'embedPlayerUpdateMediaPlayersEvent' , this.players ); |
3519 | 3523 | |
3520 | 3524 | }, |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/kskin/kskinConfig.js |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | }, |
35 | 35 | 'options': { |
36 | 36 | 'w':50, |
37 | | - 'o':function() { |
| 37 | + 'o':function( ctrlObj ) { |
38 | 38 | return $j( '<div />' ) |
39 | 39 | .attr( 'title', gM( 'mwe-embedplayer-player_options' ) ) |
40 | 40 | .addClass( "ui-state-default ui-corner-bl rButton k-options" ) |
— | — | @@ -194,7 +194,8 @@ |
195 | 195 | * Close the menu overlay |
196 | 196 | */ |
197 | 197 | closeMenuOverlay: function( ) { |
198 | | - mw.log(" close menu overlay" ); |
| 198 | + mw.log(" close menu overlay" ); |
| 199 | + |
199 | 200 | var $optionsMenu = this.$playerTarget.find( '.k-options' ); |
200 | 201 | var $kmenu = this.$playerTarget.find( '.k-menu' ); |
201 | 202 | $kmenu.fadeOut( "fast", function() { |
— | — | @@ -202,6 +203,9 @@ |
203 | 204 | .text ( gM( 'mwe-embedplayer-menu_btn' ) ); |
204 | 205 | } ); |
205 | 206 | this.$playerTarget.find( '.play-btn-large' ).fadeIn( 'fast' ); |
| 207 | + |
| 208 | + // Set close overlay menu flag: |
| 209 | + this.displayOptionsMenuFlag = false; |
206 | 210 | }, |
207 | 211 | |
208 | 212 | /** |
— | — | @@ -210,11 +214,15 @@ |
211 | 215 | showMenuOverlay: function( $ktxt ) { |
212 | 216 | var $optionsMenu = this.$playerTarget.find( '.k-options' ); |
213 | 217 | var $kmenu = this.$playerTarget.find( '.k-menu' ); |
| 218 | + |
214 | 219 | $kmenu.fadeIn( "fast", function() { |
215 | 220 | $optionsMenu.find( 'span' ) |
216 | 221 | .text ( gM( 'mwe-embedplayer-close_btn' ) ); |
217 | 222 | } ); |
218 | 223 | this.$playerTarget.find( '.play-btn-large' ).fadeOut( 'fast' ); |
| 224 | + |
| 225 | + // Set the Options Menu display flag to true: |
| 226 | + this.displayOptionsMenuFlag = true; |
219 | 227 | }, |
220 | 228 | |
221 | 229 | /** |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/ctrlBuilder.js |
— | — | @@ -52,6 +52,9 @@ |
53 | 53 | // Flag to store if a warning binding has been added |
54 | 54 | addWarningFlag: false, |
55 | 55 | |
| 56 | + // Flag to store state of overlay on player |
| 57 | + displayOptionsMenuFlag: false, |
| 58 | + |
56 | 59 | /** |
57 | 60 | * Initialization Object for the control builder |
58 | 61 | * |
— | — | @@ -569,8 +572,18 @@ |
570 | 573 | * Hide the control bar. |
571 | 574 | */ |
572 | 575 | hideControlBar : function(){ |
573 | | - var animateDuration = 'slow'; |
| 576 | + var animateDuration = 'slow'; |
| 577 | + var _this = this; |
574 | 578 | |
| 579 | + // Do not hide control bar if overlay menu item is being displayed: |
| 580 | + if( _this.displayOptionsMenuFlag ){ |
| 581 | + setTimeout( function(){ |
| 582 | + _this.hideControlBar(); |
| 583 | + }, 200 ); |
| 584 | + return ; |
| 585 | + } |
| 586 | + |
| 587 | + |
575 | 588 | // Hide the control bar |
576 | 589 | this.embedPlayer.$interface.find( '.control-bar') |
577 | 590 | .fadeOut( animateDuration ); |
— | — | @@ -581,11 +594,7 @@ |
582 | 595 | .animate( { |
583 | 596 | 'bottom' : 10 |
584 | 597 | }, 'slow' ); |
585 | | - |
586 | | - // Hide the warning if present |
587 | | - if( this.addWarningFlag ){ |
588 | | - $j( '#warningOverlay_' + this.embedPlayer.id ).fadeOut( 'slow' ); |
589 | | - } |
| 598 | + |
590 | 599 | }, |
591 | 600 | |
592 | 601 | /** |
— | — | @@ -594,7 +603,7 @@ |
595 | 604 | showControlBar : function(){ |
596 | 605 | var animateDuration = 'slow'; |
597 | 606 | $j( this.embedPlayer.getPlayerElement() ).css('z-index', '1') |
598 | | - |
| 607 | + mw.log( 'showControlBar' ); |
599 | 608 | // Move up text track if present |
600 | 609 | this.embedPlayer.$interface.find( '.track' ) |
601 | 610 | .animate( |
— | — | @@ -921,8 +930,11 @@ |
922 | 931 | var embedPlayer = this.embedPlayer; |
923 | 932 | var $overlay = embedPlayer.$interface.find( '.overlay-win,.ui-widget-overlay,.ui-widget-shadow' ); |
924 | 933 | |
| 934 | + this.displayOptionsMenuFlag = false; |
| 935 | + mw.log(' closeMenuOverlay: ' + this.displayOptionsMenuFlag); |
| 936 | + |
925 | 937 | $overlay.fadeOut( "slow", function() { |
926 | | - $overlay.remove(); |
| 938 | + $overlay.remove(); |
927 | 939 | } ); |
928 | 940 | // Show the big play button: |
929 | 941 | embedPlayer.$interface.find( '.play-btn-large' ).fadeIn( 'slow' ); |
— | — | @@ -938,6 +950,10 @@ |
939 | 951 | displayOverlay: function( overlayContent ) { |
940 | 952 | var _this = this; |
941 | 953 | var embedPlayer = this.embedPlayer; |
| 954 | + mw.log( 'displayOverlay::' ); |
| 955 | + // set the overlay display flag to true: |
| 956 | + this.displayOptionsMenuFlag = true; |
| 957 | + mw.log(" set displayOptionsMenuFlag:: " + this.displayOptionsMenuFlag); |
942 | 958 | |
943 | 959 | if ( !this.supportedComponets[ 'overlays' ] ) { |
944 | 960 | embedPlayer.stop(); |
— | — | @@ -1104,9 +1120,10 @@ |
1105 | 1121 | .append( |
1106 | 1122 | $j( '<h2 />' ) |
1107 | 1123 | .text( gM( 'mwe-embedplayer-choose_player' ) ) |
1108 | | - ); |
| 1124 | + ); |
1109 | 1125 | |
1110 | 1126 | $j.each( embedPlayer.mediaElement.getPlayableSources(), function( sourceId, source ) { |
| 1127 | + |
1111 | 1128 | var playable = mw.EmbedTypes.players.defaultPlayer( source.getMIMEType() ); |
1112 | 1129 | var is_selected = ( source == embedPlayer.mediaElement.selectedSource ); |
1113 | 1130 | |
— | — | @@ -1118,12 +1135,13 @@ |
1119 | 1136 | if ( playable ) { |
1120 | 1137 | $playerList = $j('<ul />'); |
1121 | 1138 | // output the player select code: |
| 1139 | + |
1122 | 1140 | var supportingPlayers = mw.EmbedTypes.players.getMIMETypePlayers( source.getMIMEType() ); |
1123 | 1141 | |
1124 | 1142 | for ( var i = 0; i < supportingPlayers.length ; i++ ) { |
1125 | 1143 | |
1126 | 1144 | // Add link to select the player if not already selected ) |
1127 | | - if( embedPlayer.selected_player.id == supportingPlayers[i].id && is_selected ) { |
| 1145 | + if( embedPlayer.selectedPlayer.id == supportingPlayers[i].id && is_selected ) { |
1128 | 1146 | // Active player ( no link ) |
1129 | 1147 | $playerLine = $j( '<span />' ) |
1130 | 1148 | .text( |
— | — | @@ -1434,7 +1452,7 @@ |
1435 | 1453 | .addClass( 'ui-icon ui-icon-wrench' ) |
1436 | 1454 | ) |
1437 | 1455 | .buttonHover() |
1438 | | - // Options binding: |
| 1456 | + // Options binding: |
1439 | 1457 | .menu( { |
1440 | 1458 | 'content' : ctrlObj.getOptionsMenu(), |
1441 | 1459 | 'zindex' : mw.getConfig( 'fullScreenIndex' ) + 1, |
Index: branches/MwEmbedStandAlone/jsScriptLoader.php |
— | — | @@ -30,7 +30,7 @@ |
31 | 31 | class jsScriptLoader { |
32 | 32 | |
33 | 33 | // The list of named javascript & css files |
34 | | - var $namedFileList = array(); |
| 34 | + private $namedFileList = array(); |
35 | 35 | |
36 | 36 | // The language code for the script-loader request |
37 | 37 | var $langCode = ''; |
— | — | @@ -144,6 +144,15 @@ |
145 | 145 | // Output the current language class js |
146 | 146 | $this->output .= jsClassLoader::getLanguageJs( $this->langCode ); |
147 | 147 | |
| 148 | + // Add the required core mwEmbed style sheets Commted out |
| 149 | + // because when creating stand alone packages js package with css |
| 150 | + // the paths get messed up. |
| 151 | + /* |
| 152 | + if( !isset( $this->namedFileList[ 'mw.style.mwCommon' ] ) ) { |
| 153 | + $this->output .= $this->getScriptText( 'mw.style.mwCommon' ); |
| 154 | + } |
| 155 | + */ |
| 156 | + |
148 | 157 | // Output "special" IE comment tag to support "special" mwEmbed tags. |
149 | 158 | $this->notMinifiedTopOutput .='/*@cc_on@if(@_jscript_version<9){\'video audio source itext playlist\'.replace(/\w+/g,function(n){document.createElement(n)})}@end@*/'."\n"; |
150 | 159 | } |
— | — | @@ -797,7 +806,7 @@ |
798 | 807 | // Do language swap by index: |
799 | 808 | if ( $wgEnableScriptLocalization ){ |
800 | 809 | // Get the mw.addMessage javascript from scriptText and moduleName |
801 | | - $addMessageJs = $this->getAddMessagesFromScriptText( & $scriptText , $moduleName); |
| 810 | + $addMessageJs = $this->getAddMessagesFromScriptText( $scriptText , $moduleName); |
802 | 811 | //@@NOTE getAddMessagesFromClass could identify which mode we are in and we would not need to |
803 | 812 | // try each of these search patterns in the same order as before. |
804 | 813 | |
Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | var urlparts = getRemoteEmbedPath(); |
7 | 7 | var mwEmbedHostPath = urlparts[0]; |
8 | 8 | var mwRemoteVersion = 'r127'; |
9 | | -var mwUseScriptLoader = false; |
| 9 | +var mwUseScriptLoader = true; |
10 | 10 | |
11 | 11 | // Log the mwRemote version makes it easy to debug cache issues |
12 | 12 | if( window.console ){ |
— | — | @@ -171,17 +171,28 @@ |
172 | 172 | */ |
173 | 173 | function mwLoadPlayer( callback ){ |
174 | 174 | // the jsPlayerRequest includes both javascript and style sheets for the embedPlayer |
175 | | - var jsPlayerRequest = [ |
| 175 | + var jsPlayerRequest = [ |
| 176 | + |
176 | 177 | 'mw.EmbedPlayer', |
| 178 | + 'mw.style.EmbedPlayer', |
177 | 179 | '$j.ui', |
178 | 180 | 'ctrlBuilder', |
| 181 | + '$j.fn.hoverIntent', |
179 | 182 | '$j.cookie', |
| 183 | + 'JSON', |
180 | 184 | '$j.ui.slider', |
181 | 185 | 'kskinConfig', |
182 | 186 | 'mw.style.kskin', |
183 | 187 | '$j.fn.menu', |
184 | 188 | 'mw.style.jquerymenu', |
185 | | - 'mw.TimedText' |
| 189 | + |
| 190 | + // Timed Text module |
| 191 | + 'mw.TimedText', |
| 192 | + 'mw.style.TimedText', |
| 193 | + |
| 194 | + // mwSwarmTransport module |
| 195 | + 'mw.SwarmTransport' |
| 196 | + |
186 | 197 | ]; |
187 | 198 | // Quick sniff use java if IE and native if firefox |
188 | 199 | // ( other browsers will run detect and get on-demand ) |