r73704 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73703‎ | r73704 | r73705 >
Date:02:25, 25 September 2010
Author:dale
Status:deferred
Tags:
Comment:
* lowered z-index of menu overlay ( bug 25285 )
* fixed SwamTransport post url2torrent response player update
* set timed text size relative to player interface size
Modified paths:
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/kskin/mw.style.PlayerSkinKskin.css (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js
@@ -25,7 +25,7 @@
2626 _this.addSwarmSource( embedPlayer, function(){
2727 // Update the source if paused
2828 if( embedPlayer.paused ) {
29 - embedPlayer.mediaElement.autoSelectSource();
 29+ embedPlayer.setupSourcePlayer();
3030 }
3131 });
3232 }
Index: branches/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js
@@ -769,12 +769,11 @@
770770 $j('<span \>')
771771 )
772772
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+
779778 $playerTarget.append( $track );
780779 // Resize the interface for layoutMode == 'ontop' ( if not in fullscreen )
781780 // NOTE this shoudl be a call to controlBuilder not handled here inline
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -862,15 +862,8 @@
863863
864864 // Return the mime type string if not known type.
865865 return this.mimeType;
866 - },
 866+ },
867867
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 -
875868 /**
876869 *
877870 * Get Duration of the media in milliseconds from the source url.
@@ -1605,7 +1598,7 @@
16061599 // only load from api if sources are empty:
16071600 if ( _this.apiTitleKey && this.mediaElement.sources.length == 0) {
16081601 // Load media from external data
1609 - mw.log( 'EmbedPlayer::checkPlayerSources: loading apiTitleKey data' );
 1602+ mw.log( 'EmbedPlayer::checkPlayerSources: loading apiTitleKey:' + _this.apiTitleKey );
16101603 _this.loadSourceFromApi( function(){
16111604 finishCheckPlayerSources();
16121605 } );
@@ -1639,10 +1632,10 @@
16401633 'iiprop': 'url|size|dimensions|metadata',
16411634 'iiurlwidth': _this.width,
16421635 'redirects' : true // automatically resolve redirects
1643 - }
1644 -
 1636+ };
 1637+
16451638 // Run the request:
1646 - mw.getJSON( mw.getApiProviderURL( this.apiProvider ), request, function( data ){
 1639+ mw.getJSON( mw.getApiProviderURL( _this.apiProvider ), request, function( data ){
16471640 if ( data.query.pages ) {
16481641 for ( var i in data.query.pages ) {
16491642 if( i == '-1' ) {
@@ -2815,7 +2808,7 @@
28162809 * Update volume function ( called from interface updates )
28172810 * @param {float} percent Percent of full volume
28182811 */
2819 - setVolume: function( percent ) {
 2812+ setVolume: function( percent, dissableTrigger ) {
28202813 // ignore NaN percent:
28212814 if( isNaN( percent ) ){
28222815 return ;
@@ -2831,7 +2824,7 @@
28322825 // Update the playerElement volume
28332826 this.setPlayerElementVolume( percent );
28342827
2835 - //mw.log(" setVolume:: " + percent + ' this.volume is: ' + this.volume);
 2828+ //mw.log(" setVolume:: " + percent + ' this.volume is: ' + this.volume);
28362829 $j( this ).trigger('volumeChanged', percent );
28372830 },
28382831
@@ -2973,7 +2966,7 @@
29742967
29752968 // Check if volume was set outside of embed player function
29762969 //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 ) ) {
29782971 _this.setInterfaceVolume( _this.volume );
29792972 $j( this ).trigger('volumeChanged', _this.volume );
29802973 }
@@ -3450,7 +3443,7 @@
34513444 for ( var i = 0; i < this.players.length; i++ ) {
34523445 if ( this.players[i].id == playerId ) {
34533446 selectedPlayer = this.players[i];
3454 - mw.log( 'choosing ' + playerId + ' for ' + mimeType );
 3447+ mw.log( 'EmbedPlayer::setPlayerPreference: choosing ' + playerId + ' for ' + mimeType );
34553448 this.preference[ mimeType ] = playerId;
34563449 mw.setUserConfig( 'playerPref', this.preference );
34573450 break;
@@ -3464,7 +3457,7 @@
34653458 if ( embed.mediaElement.selectedSource && ( embed.mediaElement.selectedSource.mimeType == mimeType ) )
34663459 {
34673460 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() );
34693462 }
34703463 }
34713464 }
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/kskin/mw.style.PlayerSkinKskin.css
@@ -188,7 +188,7 @@
189189 opacity: 0.9;
190190 position: absolute;
191191 top: 0;
192 - z-index: 999;
 192+ z-index: 2;
193193 }
194194
195195 .k-player .k-menu-bar li a {
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js
@@ -250,7 +250,7 @@
251251 /**
252252 * Get the fullscreen text css
253253 */
254 - getFullscreenTextCss: function() {
 254+ getInterfaceSizeTextCss: function() {
255255 // Some arbitrary scale relative to window size
256256 var textSize = ( $j( window ).width() / 8 ) + 20;
257257 if( textSize < 95 ) textSize = 95;
@@ -375,7 +375,7 @@
376376 .animate( _this.getFullscreenPlayerCss() );
377377
378378 // Resize the timed text font size per window width
379 - $interface.find( '.track' ).css( _this.getFullscreenTextCss() );
 379+ $interface.find( '.track' ).css( _this.getInterfaceSizeTextCss() );
380380
381381 // Reposition play-btn-large ( this is unfortunately not easy to position with 'margin': 'auto'
382382 $interface.find('.play-btn-large').animate( _this.getFullscreenPlayButtonCss() )
@@ -421,7 +421,7 @@
422422 $interface.find('.play-btn-large').css( _this.getFullscreenPlayButtonCss() );
423423
424424 // Update the timed text size
425 - $interface.find( '.track' ).css( _this.getFullscreenTextCss() );
 425+ $interface.find( '.track' ).css( _this.getInterfaceSizeTextCss() );
426426 }
427427 });
428428
@@ -615,7 +615,9 @@
616616 var animateDuration = 'slow';
617617 if(! this.embedPlayer )
618618 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+ }
620622 mw.log( 'showControlBar' );
621623 // Move up text track if present
622624 this.embedPlayer.$interface.find( '.track' )
@@ -1176,7 +1178,9 @@
11771179 * @param {Object} $target jQuery target for output
11781180 */
11791181 getPlayerSelect: function( ) {
1180 - mw.log('getPlayerSelect::');
 1182+ mw.log('ControlBuilder::getPlayerSelect: source:' +
 1183+ this.embedPlayer.mediaElement.selectedSource.getSrc() +
 1184+ ' player: ' + this.embedPlayer.selectedPlayer.id );
11811185
11821186 var embedPlayer = this.embedPlayer;
11831187
@@ -1190,22 +1194,22 @@
11911195
11921196 $j.each( embedPlayer.mediaElement.getPlayableSources(), function( sourceId, source ) {
11931197
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() );
11961200
11971201 $playerSelect.append(
11981202 $j( '<h2 />' )
11991203 .text( source.getTitle() )
12001204 );
12011205
1202 - if ( playable ) {
 1206+ if ( isPlayable ) {
12031207 $playerList = $j('<ul />');
12041208 // output the player select code:
12051209
12061210 var supportingPlayers = mw.EmbedTypes.players.getMIMETypePlayers( source.getMIMEType() );
12071211
1208 - for ( var i = 0; i < supportingPlayers.length ; i++ ) {
1209 -
 1212+ for ( var i = 0; i < supportingPlayers.length ; i++ ) {
 1213+
12101214 // Add link to select the player if not already selected )
12111215 if( embedPlayer.selectedPlayer.id == supportingPlayers[i].id && is_selected ) {
12121216 // Active player ( no link )

Status & tagging log