r77220 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77219‎ | r77220 | r77221 >
Date:07:54, 24 November 2010
Author:dale
Status:deferred
Tags:
Comment:
minor cleanup:
added correct sourceHandler ref to playlist,
updated seeking trigger
updated device detection
unescape apiTitleKey for credits display
Modified paths:
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerKplayer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerNative.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/kskin/mw.PlayerSkinKskin.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Playlist/mw.Playlist.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/tests/VideoRender.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js (modified) (history)
  • /branches/MwEmbedStandAlone/mwEmbed.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/mwEmbed.js
@@ -21,7 +21,6 @@
2222 if ( typeof window.mw == 'undefined' ) {
2323 window.mw = { };
2424 }
25 -
2625 /**
2726 * Set the mwEmbedVersion
2827 */
@@ -83,6 +82,7 @@
8483 }
8584 mwConfig[ name ] = value;
8685 };
 86+
8787 /**
8888 * Merge in a configuration value:
8989 */
@@ -793,6 +793,7 @@
794794 }
795795 return moduleList;
796796 },
 797+
797798 /**
798799 * Loads javascript or css associated with a resourceName
799800 *
@@ -1158,7 +1159,20 @@
11591160 } );
11601161 return $j( '#mwTempLoaderDialog' );
11611162 };
1162 -
 1163+ mw.isIphone = function(){
 1164+ return ( navigator.userAgent.indexOf('iPhone') != -1 );
 1165+ };
 1166+ mw.isIpod = function(){
 1167+ return ( navigator.userAgent.indexOf('iPod') != -1 );
 1168+ };
 1169+ mw.isIpad = function(){
 1170+ return ( navigator.userAgent.indexOf('iPad') != -1 );
 1171+ };
 1172+ // Android 2 has some restrictions vs other mobile platforms
 1173+ mw.isAndroid2 = function(){
 1174+ return ( navigator.userAgent.indexOf( 'Android 2.') != -1 );
 1175+ };
 1176+
11631177 /**
11641178 * Fallforward system by default prefers flash.
11651179 *
@@ -1210,20 +1224,7 @@
12111225 }
12121226 // No video tag or flash, return false ( normal "install flash" user flow )
12131227 return false;
1214 - }
1215 - mw.isIphone = function(){
1216 - return ( navigator.userAgent.indexOf('iPhone') != -1 );
12171228 };
1218 - mw.isIpod = function(){
1219 - return ( navigator.userAgent.indexOf('iPod') != -1 );
1220 - };
1221 - mw.isIpad = function(){
1222 - return ( navigator.userAgent.indexOf('iPad') != -1 );
1223 - };
1224 - // Android 2 has some restrictions vs other mobile platforms
1225 - mw.isAndroid2 = function(){
1226 - return ( navigator.userAgent.indexOf( 'Android 2.') != -1 );
1227 - };
12281229
12291230 /**
12301231 * Similar to php isset function checks if the variable exists. Does a safe
@@ -2634,6 +2635,11 @@
26352636 }
26362637 mw.domReady();
26372638 }
 2639+// temporary hack to work around dom ready breakage when loading
 2640+// dynamically with other dom ready scripts
 2641+if( typeof KALTURA_LOADER_REV != 'undefined' ){
 2642+ mw.domReady();
 2643+}
26382644
26392645
26402646 // If using the resource loader and jQuery has not been set give a warning to
Index: branches/MwEmbedStandAlone/modules/Playlist/mw.Playlist.js
@@ -143,7 +143,7 @@
144144 .click( function(){
145145 _this.sourceHandler.setPlaylistIndex( inx );
146146 $j( _this.target + ' .media-rss-video-list').loadingSpinner();
147 - _this.loadPlaylist( function(){
 147+ _this.sourceHandler.loadPlaylist( function(){
148148 $j( _this.target + ' .media-rss-video-list').empty();
149149 _this.addMediaList();
150150 });
@@ -350,15 +350,16 @@
351351 this.targetWidth = $j( this.target ).width();
352352 this.targetHeight = $j( this.target ).height();
353353
354 - /* vertical layout */
 354+
355355 if( _this.layout == 'vertical' ){
 356+ /* vertical layout */
356357 var pa = this.playerAspect.split(':');
357358 this.targetPlayerSize = {
358359 'width' : this.targetWidth + 'px',
359360 'height' : parseInt( ( pa[1] / pa[0] ) * this.targetWidth )
360361 };
361362 } else {
362 - /* horizontal layout */
 363+ /* horizontal layout */
363364 var pa = this.playerAspect.split(':');
364365 this.targetPlayerSize = {
365366 'height' : ( this.targetHeight - this.titleHeight ) + 'px',
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js
@@ -114,7 +114,7 @@
115115 var _this = this;
116116 // Run the seeking hook
117117
118 - $j( this.embedPlayer ).trigger( 'onSeek' );
 118+ $j( this.embedPlayer ).trigger( 'seeking' );
119119 this.setCurrentTime( percentage * this.getDuration(), function(){
120120 mw.log("EmbedPlayerSmil:: seek done");
121121 _this.seeking = false;
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/kskin/mw.PlayerSkinKskin.js
@@ -385,7 +385,7 @@
386386 var $target = embedPlayer.$interface.find( '.menu-credits' );
387387
388388 var apiUrl = mw.getApiProviderURL( embedPlayer.apiProvider );
389 - var fileTitle = 'File:' + embedPlayer.apiTitleKey.replace(/File:|Image:/, '');
 389+ var fileTitle = 'File:' + unescape( embedPlayer.apiTitleKey ).replace(/File:|Image:/, '');
390390
391391 // Get the image info
392392 var request = {
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js
@@ -116,6 +116,7 @@
117117 'left' : '0px',
118118 'right' : '0px'
119119 } );
 120+
120121 // Check for overlay controls:
121122 if( ! _this.checkOverlayControls() ) {
122123 // Add some space to interface for the control bar ( if not overlaying controls )
@@ -218,6 +219,7 @@
219220 // Set target width
220221 var targetWidth = windowSize.width;
221222 var targetHeight = targetWidth * ( embedPlayer.getHeight() / embedPlayer.getWidth() );
 223+
222224 // Check if it exceeds the height constraint:
223225 if( targetHeight > windowSize.height ){
224226 targetHeight = windowSize.height;
@@ -1511,7 +1513,7 @@
15121514 return $j( '<div/>' )
15131515 .attr( {
15141516 'title' : gM( 'mwe-embedplayer-play_clip' ),
1515 - 'class' : "ui-state-default play-btn-large"
 1517+ 'class' : "play-btn-large"
15161518 } )
15171519 // Get dynamic position for big play button
15181520 .css( {
@@ -1519,7 +1521,7 @@
15201522 'top' : ( ( ctrlObj.embedPlayer.getPlayerHeight() - this.h ) / 2 )
15211523 } )
15221524 // Add play hook:
1523 - .buttonHover().click( function() {
 1525+ .click( function() {
15241526 ctrlObj.embedPlayer.play();
15251527 } );
15261528 }
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerNative.js
@@ -570,7 +570,7 @@
571571 onprogress: function( event ) {
572572 var e = event.originalEvent;
573573 //mw.log("onprogress: e:" + e + ' ' + e.loaded + ' && ' + e.total );
574 - if( e.loaded && e.total ) {
 574+ if( e && e.loaded && e.total ) {
575575 this.bufferedPercent = e.loaded / e.total;
576576 this.progressEventData = e.loaded;
577577 }
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerKplayer.js
@@ -71,7 +71,7 @@
7272
7373 mw.log(" about to add the pid container");
7474 $j(this).html($j('<div />').attr('id', this.pid + '_container'));
75 - // call swm dom loaded function:
 75+ // Call swm dom loaded function:
7676 swfobject.callDomLoadFunctions();
7777 // Do the flash embedding with embedSWF
7878 swfobject.embedSWF(playerPath + "/kdp3.swf", this.pid + '_container',
@@ -120,9 +120,9 @@
121121 }
122122
123123 if (this.playerElement && this.playerElement.addJsListener) {
124 - $j.each(bindEventMap, function(bindName, localMethod) {
 124+ $j.each( bindEventMap, function( bindName, localMethod ) {
125125 _this.bindPlayerFunction(bindName, localMethod);
126 - });
 126+ } );
127127 // Start the monitor
128128 this.monitor();
129129 } else {
Index: branches/MwEmbedStandAlone/modules/Sequencer/tests/VideoRender.html
@@ -6,7 +6,7 @@
77 <!-- <script type="text/javascript" src="../../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script> -->
88 <script type="text/javascript">
99 mw.setConfig( 'EmbedPlayer.OverlayControls', false );
10 - mw.ready(function(){
 10+ mw.ready( function(){
1111 $j( "#seekInputTime" ).blur( function(){
1212 var smilVid = $j('#videoCrossfade').get(0);
1313 $j('#seekInProgress').show();

Status & tagging log