Index: branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | _this.addSwarmSource( embedPlayer, function(){ |
27 | 27 | // Update the source if paused |
28 | 28 | if( embedPlayer.paused ) { |
29 | | - embedPlayer.mediaElement.autoSelectSource(); |
| 29 | + embedPlayer.setupSourcePlayer(); |
30 | 30 | } |
31 | 31 | }); |
32 | 32 | } |
Index: branches/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js |
— | — | @@ -769,12 +769,11 @@ |
770 | 770 | $j('<span \>') |
771 | 771 | ) |
772 | 772 | |
773 | | - // If in fullscreen mode update the text size: |
774 | | - if( this.embedPlayer.controlBuilder.fullscreenMode ){ |
775 | | - $track.css( |
776 | | - this.embedPlayer.controlBuilder.getFullscreenTextCss() |
777 | | - ); |
778 | | - } |
| 773 | + // Scale the text Relative to player size: |
| 774 | + $track.css( |
| 775 | + this.embedPlayer.controlBuilder.getInterfaceSizeTextCss() |
| 776 | + ); |
| 777 | + |
779 | 778 | $playerTarget.append( $track ); |
780 | 779 | // Resize the interface for layoutMode == 'ontop' ( if not in fullscreen ) |
781 | 780 | // NOTE this shoudl be a call to controlBuilder not handled here inline |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js |
— | — | @@ -862,15 +862,8 @@ |
863 | 863 | |
864 | 864 | // Return the mime type string if not known type. |
865 | 865 | return this.mimeType; |
866 | | - }, |
| 866 | + }, |
867 | 867 | |
868 | | - /** Index accessor function. |
869 | | - * @return {Integer} the source's index within the enclosing mediaElement container. |
870 | | - */ |
871 | | - getIndex : function() { |
872 | | - return this.index; |
873 | | - }, |
874 | | - |
875 | 868 | /** |
876 | 869 | * |
877 | 870 | * Get Duration of the media in milliseconds from the source url. |
— | — | @@ -1605,7 +1598,7 @@ |
1606 | 1599 | // only load from api if sources are empty: |
1607 | 1600 | if ( _this.apiTitleKey && this.mediaElement.sources.length == 0) { |
1608 | 1601 | // Load media from external data |
1609 | | - mw.log( 'EmbedPlayer::checkPlayerSources: loading apiTitleKey data' ); |
| 1602 | + mw.log( 'EmbedPlayer::checkPlayerSources: loading apiTitleKey:' + _this.apiTitleKey ); |
1610 | 1603 | _this.loadSourceFromApi( function(){ |
1611 | 1604 | finishCheckPlayerSources(); |
1612 | 1605 | } ); |
— | — | @@ -1639,10 +1632,10 @@ |
1640 | 1633 | 'iiprop': 'url|size|dimensions|metadata', |
1641 | 1634 | 'iiurlwidth': _this.width, |
1642 | 1635 | 'redirects' : true // automatically resolve redirects |
1643 | | - } |
1644 | | - |
| 1636 | + }; |
| 1637 | + |
1645 | 1638 | // Run the request: |
1646 | | - mw.getJSON( mw.getApiProviderURL( this.apiProvider ), request, function( data ){ |
| 1639 | + mw.getJSON( mw.getApiProviderURL( _this.apiProvider ), request, function( data ){ |
1647 | 1640 | if ( data.query.pages ) { |
1648 | 1641 | for ( var i in data.query.pages ) { |
1649 | 1642 | if( i == '-1' ) { |
— | — | @@ -2815,7 +2808,7 @@ |
2816 | 2809 | * Update volume function ( called from interface updates ) |
2817 | 2810 | * @param {float} percent Percent of full volume |
2818 | 2811 | */ |
2819 | | - setVolume: function( percent ) { |
| 2812 | + setVolume: function( percent, dissableTrigger ) { |
2820 | 2813 | // ignore NaN percent: |
2821 | 2814 | if( isNaN( percent ) ){ |
2822 | 2815 | return ; |
— | — | @@ -2831,7 +2824,7 @@ |
2832 | 2825 | // Update the playerElement volume |
2833 | 2826 | this.setPlayerElementVolume( percent ); |
2834 | 2827 | |
2835 | | - //mw.log(" setVolume:: " + percent + ' this.volume is: ' + this.volume); |
| 2828 | + //mw.log(" setVolume:: " + percent + ' this.volume is: ' + this.volume); |
2836 | 2829 | $j( this ).trigger('volumeChanged', percent ); |
2837 | 2830 | }, |
2838 | 2831 | |
— | — | @@ -2973,7 +2966,7 @@ |
2974 | 2967 | |
2975 | 2968 | // Check if volume was set outside of embed player function |
2976 | 2969 | //mw.log( ' this.volume: ' + _this.volume + ' prev Volume:: ' + _this.previousVolume ); |
2977 | | - if( _this.volume != _this.previousVolume ) { |
| 2970 | + if( Math.round( _this.volume * 100 ) != Math.round( _this.previousVolume * 100 ) ) { |
2978 | 2971 | _this.setInterfaceVolume( _this.volume ); |
2979 | 2972 | $j( this ).trigger('volumeChanged', _this.volume ); |
2980 | 2973 | } |
— | — | @@ -3450,7 +3443,7 @@ |
3451 | 3444 | for ( var i = 0; i < this.players.length; i++ ) { |
3452 | 3445 | if ( this.players[i].id == playerId ) { |
3453 | 3446 | selectedPlayer = this.players[i]; |
3454 | | - mw.log( 'choosing ' + playerId + ' for ' + mimeType ); |
| 3447 | + mw.log( 'EmbedPlayer::setPlayerPreference: choosing ' + playerId + ' for ' + mimeType ); |
3455 | 3448 | this.preference[ mimeType ] = playerId; |
3456 | 3449 | mw.setUserConfig( 'playerPref', this.preference ); |
3457 | 3450 | break; |
— | — | @@ -3464,7 +3457,7 @@ |
3465 | 3458 | if ( embed.mediaElement.selectedSource && ( embed.mediaElement.selectedSource.mimeType == mimeType ) ) |
3466 | 3459 | { |
3467 | 3460 | embed.selectPlayer( selectedPlayer ); |
3468 | | - mw.log( 'using ' + embed.selectedPlayer.getName() + ' for ' + embed.mediaElement.selectedSource.getTitle() ); |
| 3461 | + mw.log( 'EmbedPlayer::setPlayerPreference: using ' + embed.selectedPlayer.getName() + ' for ' + embed.mediaElement.selectedSource.getTitle() ); |
3469 | 3462 | } |
3470 | 3463 | } |
3471 | 3464 | } |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/kskin/mw.style.PlayerSkinKskin.css |
— | — | @@ -188,7 +188,7 @@ |
189 | 189 | opacity: 0.9; |
190 | 190 | position: absolute; |
191 | 191 | top: 0; |
192 | | - z-index: 999; |
| 192 | + z-index: 2; |
193 | 193 | } |
194 | 194 | |
195 | 195 | .k-player .k-menu-bar li a { |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js |
— | — | @@ -250,7 +250,7 @@ |
251 | 251 | /** |
252 | 252 | * Get the fullscreen text css |
253 | 253 | */ |
254 | | - getFullscreenTextCss: function() { |
| 254 | + getInterfaceSizeTextCss: function() { |
255 | 255 | // Some arbitrary scale relative to window size |
256 | 256 | var textSize = ( $j( window ).width() / 8 ) + 20; |
257 | 257 | if( textSize < 95 ) textSize = 95; |
— | — | @@ -375,7 +375,7 @@ |
376 | 376 | .animate( _this.getFullscreenPlayerCss() ); |
377 | 377 | |
378 | 378 | // Resize the timed text font size per window width |
379 | | - $interface.find( '.track' ).css( _this.getFullscreenTextCss() ); |
| 379 | + $interface.find( '.track' ).css( _this.getInterfaceSizeTextCss() ); |
380 | 380 | |
381 | 381 | // Reposition play-btn-large ( this is unfortunately not easy to position with 'margin': 'auto' |
382 | 382 | $interface.find('.play-btn-large').animate( _this.getFullscreenPlayButtonCss() ) |
— | — | @@ -421,7 +421,7 @@ |
422 | 422 | $interface.find('.play-btn-large').css( _this.getFullscreenPlayButtonCss() ); |
423 | 423 | |
424 | 424 | // Update the timed text size |
425 | | - $interface.find( '.track' ).css( _this.getFullscreenTextCss() ); |
| 425 | + $interface.find( '.track' ).css( _this.getInterfaceSizeTextCss() ); |
426 | 426 | } |
427 | 427 | }); |
428 | 428 | |
— | — | @@ -615,7 +615,9 @@ |
616 | 616 | var animateDuration = 'slow'; |
617 | 617 | if(! this.embedPlayer ) |
618 | 618 | return ; |
619 | | - $j( this.embedPlayer.getPlayerElement() ).css( 'z-index', '1' ) |
| 619 | + if( this.embedPlayer.getPlayerElement ){ |
| 620 | + $j( this.embedPlayer.getPlayerElement() ).css( 'z-index', '1' ) |
| 621 | + } |
620 | 622 | mw.log( 'showControlBar' ); |
621 | 623 | // Move up text track if present |
622 | 624 | this.embedPlayer.$interface.find( '.track' ) |
— | — | @@ -1176,7 +1178,9 @@ |
1177 | 1179 | * @param {Object} $target jQuery target for output |
1178 | 1180 | */ |
1179 | 1181 | getPlayerSelect: function( ) { |
1180 | | - mw.log('getPlayerSelect::'); |
| 1182 | + mw.log('ControlBuilder::getPlayerSelect: source:' + |
| 1183 | + this.embedPlayer.mediaElement.selectedSource.getSrc() + |
| 1184 | + ' player: ' + this.embedPlayer.selectedPlayer.id ); |
1181 | 1185 | |
1182 | 1186 | var embedPlayer = this.embedPlayer; |
1183 | 1187 | |
— | — | @@ -1190,22 +1194,22 @@ |
1191 | 1195 | |
1192 | 1196 | $j.each( embedPlayer.mediaElement.getPlayableSources(), function( sourceId, source ) { |
1193 | 1197 | |
1194 | | - var playable = mw.EmbedTypes.players.defaultPlayer( source.getMIMEType() ); |
1195 | | - var is_selected = ( source == embedPlayer.mediaElement.selectedSource ); |
| 1198 | + var isPlayable = (typeof mw.EmbedTypes.players.defaultPlayer( source.getMIMEType() ) == 'object' ); |
| 1199 | + var is_selected = ( source.getSrc() == embedPlayer.mediaElement.selectedSource.getSrc() ); |
1196 | 1200 | |
1197 | 1201 | $playerSelect.append( |
1198 | 1202 | $j( '<h2 />' ) |
1199 | 1203 | .text( source.getTitle() ) |
1200 | 1204 | ); |
1201 | 1205 | |
1202 | | - if ( playable ) { |
| 1206 | + if ( isPlayable ) { |
1203 | 1207 | $playerList = $j('<ul />'); |
1204 | 1208 | // output the player select code: |
1205 | 1209 | |
1206 | 1210 | var supportingPlayers = mw.EmbedTypes.players.getMIMETypePlayers( source.getMIMEType() ); |
1207 | 1211 | |
1208 | | - for ( var i = 0; i < supportingPlayers.length ; i++ ) { |
1209 | | - |
| 1212 | + for ( var i = 0; i < supportingPlayers.length ; i++ ) { |
| 1213 | + |
1210 | 1214 | // Add link to select the player if not already selected ) |
1211 | 1215 | if( embedPlayer.selectedPlayer.id == supportingPlayers[i].id && is_selected ) { |
1212 | 1216 | // Active player ( no link ) |