r60301 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60300‎ | r60301 | r60302 >
Date:00:52, 23 December 2009
Author:dale
Status:deferred
Tags:
Comment:
* some speed improvements of mw.EmbedPlayer functions: ( on a page with 4 videos: )

Removed some "class" / "style" checks on swapEmbedPlayerElement
swapEmbedPlayerElement() 4 26.6% 131.703ms
swapEmbedPlayerElement() 4 0.87% 19.933ms

Cached some jQuery calls, doing less of them:
init() 2432 21.09% 62.236ms
init() 1864 16.93% 42.867ms

Only load timed Text sources on play or menu display, added simultaneous loading, and we don't wait for next video to be ready before issuing a rewrite request.

About 10 seconds on
http://commons.wikimedia.org/wiki/Category:Files_with_closed_captioning
Instead of a minute or so.
Modified paths:
  • /branches/js2-work/phase3/js/mwEmbed/jsScriptLoader.php (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/mwEmbed.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/tests/Player_Themable.html (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/tests/Player_Timed_Text.html (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/tests/Player_Themable.html
@@ -3,8 +3,12 @@
44 <html>
55 <head>
66 <title>Sample Themed Player</title>
7 - <!--<script type="text/javascript" src="../jsScriptLoader.php?class=mwEmbed&debug=true"></script> -->
8 - <script type="text/javascript" src="../mwEmbed.js?debug=true"></script>
 7+ <!-- Stuff likely needed for video display -->
 8+ <script type="text/javascript" src="../jsScriptLoader.php?class=window.jQuery,mwEmbed,$j.ui,mw.EmbedPlayer,nativeEmbed,ctrlBuilder,mvpcfConfig,kskinConfig,$j.fn.menu,$j.cookie,$j.ui.slider,mw.TimedText&debug=true"></script>
 9+ <link rel="stylesheet" href="../skins/styles.css" type="text/css" media="screen" />
 10+ <link rel="stylesheet" href="../skins/mvpcf/playerSkin.css" type="text/css" media="screen" />
 11+ <link rel="stylesheet" href="../skins/kskin/playerSkin.css" type="text/css" media="screen" />
 12+ <!-- <script type="text/javascript" src="../mwEmbed.js?debug=true"></script> -->
913 </head>
1014 <script type="text/javascript">
1115 </script>
Index: branches/js2-work/phase3/js/mwEmbed/tests/Player_Timed_Text.html
@@ -3,12 +3,13 @@
44 <html>
55 <head>
66 <title>sample mv embed</title>
7 - <script type="text/javascript" src="../mwEmbed.js?debug=true"></script>
 7+ <script type="text/javascript" src="../mwEmbed.js?debug=true"></script>
88 </head>
99 <body>
1010 <h3> mwEmbed Timed Text Examples:</h3>
1111 Click on the little lower right "CC" icon to expose the timed text
1212 <table border="1" cellpadding="6" width="950">
 13+
1314 <tr>
1415 <td valign="top" width="410">
1516
@@ -32,9 +33,9 @@
3334 </td>
3435 </tr>
3536
36 -
37 -
3837 <!--
 38+
 39+
3940 <tr>
4041 <td valign="top" width="410">
4142
@@ -58,6 +59,7 @@
5960
6061 </tr>
6162
 63+
6264 <tr>
6365 <td valign="top" width="410">
6466
@@ -148,17 +150,16 @@
149151 src="media/elephants_dream/chapters.srt"></itext>
150152 </itextlist>
151153
152 - </video>
153 -
154 -
 154+ </video>
155155 </td>
156 -
157156 <td valign="top">
158157 <h4>Mirrors Silvia's iText example</h4>
159158 see: <a href="http://www.annodex.net/~silvia/itext/elephant_no_skin_v2.html">Video Player Accessibility</a>
160159 </td>
161160 </tr>
162 - -->
 161+
 162+-->
 163+
163164 </table>
164165
165166 </body>
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js
@@ -78,21 +78,26 @@
7979 /**
8080 * The list of enabled sources
8181 */
82 - enabledSources: [ ],
 82+ enabledSources: null,
8383
8484
8585 /**
8686 * Stores the last text string per category to avoid dom checks
8787 * for updated text
8888 */
89 - prevText: [],
 89+ prevText: null,
9090
9191 /**
9292 * Text sources ( a set of textSource objects )
9393 */
94 - textSources: [ ],
 94+ textSources: null,
9595
9696 /**
 97+ * Text Source(s) Setup Flag
 98+ */
 99+ textSourceSetupFlag: null,
 100+
 101+ /**
97102 * Valid "iText" categories
98103 */
99104 validCategoriesKeys: [
@@ -138,6 +143,12 @@
139144 this.embedPlayer = embedPlayer;
140145 this.options = options;
141146
 147+ //Init internal variables:
 148+ this.enabledSources = [];
 149+ this.prevText = '';
 150+ this.textSources = [];
 151+ this.textSourceSetupFlag = false;
 152+
142153 //Load user prefrences config:
143154 preferenceConfig = mw.getUserConfig( 'timedTextConfig' );
144155 if( typeof preferenceConfig == 'object' ) {
@@ -149,6 +160,24 @@
150161 _this.monitor();
151162 } )
152163
 164+ embedPlayer.addHook( 'play', function(){
 165+ // Will load and setup timedText sources (if not loaded already loaded )
 166+ _this.setupTextSources();
 167+ } );
 168+ },
 169+
 170+ /**
 171+ * Setups available text sources
 172+ * loads text sources
 173+ * auto-selects a source based on the user language
 174+ * @param {Function} callback Function to be called once text sources are setup.
 175+ */
 176+ setupTextSources: function( callback ){
 177+ var _this = this;
 178+ if( this.textSourceSetupFlag ){
 179+ callback();
 180+ return ;
 181+ }
153182 // Load textSources
154183 _this.loadTextSources( function(){
155184
@@ -158,35 +187,46 @@
159188 // Load and parse the text value of enabled text sources:
160189 _this.loadEnabledSources();
161190
162 - } );
163 - },
 191+ _this.textSourceSetupFlag = true;
 192+
 193+ if( callback )
 194+ callback();
 195+ } );
 196+ },
164197
165198 /**
166 - * Show the timed text menu
 199+ * Binds the timed text menu
 200+ * and updates its content from "getMenu"
 201+ *
167202 * @param {Object} target to display the menu
168203 * @param {Bollean} autoShow If the menu should be displayed
169204 */
170 - bindMenu: function( target , autoShow ){
 205+ bindMenu: function( target , autoShow){
171206 var _this = this;
172207 mw.log( "TimedText:bindMenu" );
173 - _this.menuTarget = target;
174 - // NOTE: Button target should be an option or config thing
175 - var $menuButton = $j('#' + this.embedPlayer.id + ' .timed-text');
176 - $menuButton.unbind().menu( {
177 - 'content' : this.buildMenu(),
178 - 'crumbDefaultText' : ' ',
179 - 'targetMenuContainer' : _this.menuTarget,
180 - 'autoShow' : autoShow,
181 - 'backLinkText' : gM( 'mwe-back-btn' )
182 - } );
183 -
 208+ _this.menuTarget = target;
 209+ var $menuButton = $j('#' + this.embedPlayer.id + ' .timed-text');
 210+
 211+ // Else bind and show the menu
 212+ // We already have a loader in embedPlayer so the delay of
 213+ // setupTextSources is already taken into account
 214+ _this.setupTextSources( function(){
 215+ // NOTE: Button target should be an option or config
 216+ $menuButton.unbind().menu( {
 217+ 'content' : _this.getMenu(),
 218+ 'crumbDefaultText' : ' ',
 219+ 'targetMenuContainer' : _this.menuTarget,
 220+ 'autoShow' : autoShow,
 221+ 'backLinkText' : gM( 'mwe-back-btn' )
 222+ } );
 223+ });
184224 },
185225
186226 /**
187227 * Refresh the menu
188228 */
189229 refreshMenu: function( ){
190 - // Bind the menu without showing it:
 230+ // update the menu
191231 this.bindMenu( this.menuTarget, false );
192232 },
193233
@@ -347,7 +387,11 @@
348388 },
349389
350390 /**
351 - * Builds the core timed Text menu
 391+ * Builds the core timed Text menu and
 392+ * returns the binded jquery object / dom set
 393+ *
 394+ * Assumes text sources have been setup: ( _this.setupTextSources )
 395+ *
352396 * calls a few sub-functions:
353397 * Basic menu layout:
354398 * Chose Language
@@ -360,15 +404,16 @@
361405 * [ All videos ]
362406 * [ Chapters ] seek to chapter
363407 */
364 - buildMenu: function(){
365 - var _this = this;
366 - // Build the source list menu item:
 408+ getMenu: function(){
 409+ var _this = this;
 410+
367411
 412+ // Build the source list menu item:
368413 $menu = $j( '<ul>' );
369414 // Chouse text menu item ( if there are sources)
370415 if( _this.textSources.length != 0 ){
371416 $menu.append(
372 - _this.getLi( gM( 'mwe-chose-text'), 'comment' ).append(
 417+ _this.getLi( gM( 'mwe-chose-text'), 'comment' ).append(
373418 _this.getLanguageMenu()
374419 ),
375420 // Layout Menu option
@@ -377,7 +422,10 @@
378423 ),
379424
380425 // Search Menu option
381 - _this.getLi( gM('mwe-search'), 'search')
 426+ _this.getLi( gM('mwe-search'), 'search'),
 427+
 428+ //Include the "make transcript" link:
 429+ _this.getLiAddText()
382430 );
383431 }
384432 // Put in the "Make Transcript" link
@@ -819,7 +867,7 @@
820868 if( this.getSrc() ){
821869 // Issue the load request ( if we can )
822870 if ( mw.parseUri( document.URL ).host != mw.parseUri( this.getSrc() ).host ){
823 - mw.log("Error can't load non-json src via jsonp:" + this.getSrc() )
 871+ mw.log("Error: host mis-match: " + mw.parseUri( document.URL ).host != mw.parseUri( this.getSrc() ).host )
824872 return ;
825873 }
826874 $j.get( this.getSrc(), function( data ){
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -84,13 +84,7 @@
8585
8686 // id: Auto-populated if unset
8787 "id" : null,
88 -
89 - // Class: used to set the player "skin"
90 - "class" : null,
9188
92 - // Style: used to set player width and height
93 - "style" : null,
94 -
9589 // Width: alternate to "style" to set player width
9690 "width" : null,
9791
@@ -334,14 +328,15 @@
335329 */
336330 addElement: function( element, attributes ) {
337331 var _this = this;
338 -
339 - if ( $j( element ).attr( "id" ) == '' ) {
340 - $j( element ).attr( "id", 'v' + this.playerList.length );
 332+ var element_id = $j( element ).attr( "id" );
 333+ if ( element_id == '' ) {
 334+ element_id = 'v' + this.playerList.length;
 335+ $j( element ).attr( "id", element_id);
341336 }
342 - var element_id = $j( element ).attr( "id" );
 337+
343338
344339 // Add the element id to playerList
345 - this.playerList.push( $j( element ).attr( "id" ) );
 340+ this.playerList.push( element_id );
346341
347342 // Check for class based player skin ( could have been loaded before in 'EmbedPlayer' loader module )
348343 var skinClassRequest = [ ];
@@ -380,10 +375,10 @@
381376 var playerInx = _this.playerList.length;
382377 var ranPlayerSwapFlag = false;
383378 // Local callback to runPlayer swap once element has metadat
384 - function runPlayerSwap(){
385 - mw.log("runPlayerSwap" );
 379+ function runPlayerSwap(){
386380 if( ranPlayerSwapFlag )
387381 return ;
 382+ mw.log("runPlayerSwap::" + $j( element ).attr('id') );
388383 ranPlayerSwapFlag = true;
389384 var playerInterface = new mw.EmbedPlayer( element , attributes);
390385 _this.swapEmbedPlayerElement( element, playerInterface );
@@ -396,10 +391,10 @@
397392 mw.log(" WaitForMeta ( video missing height width info and has src )");
398393 element.removeEventListener( "loadedmetadata", runPlayerSwap, true );
399394 element.addEventListener( "loadedmetadata", runPlayerSwap, true );
400 - // Time-out of 3 seconds ( maybe still playable but no timely metadata )
401 - setTimeout( runPlayerSwap, 3000 );
 395+ // Time-out of 5 seconds ( maybe still playable but no timely metadata )
 396+ setTimeout( runPlayerSwap, 5000 );
402397 }else{
403 - runPlayerSwap( element_id )
 398+ runPlayerSwap()
404399 }
405400 break;
406401 case 'playlist':
@@ -444,7 +439,7 @@
445440 swapEmbedPlayerElement: function( targetElement, playerInterface ) {
446441
447442 // Create a new element to swap the player interface into
448 - var swapPlayerElement = document.createElement( 'div' );
 443+ var swapPlayerElement = document.createElement( 'div' );
449444
450445 // Make sure the new swapPlayerElement has height / width set:
451446 $j( swapPlayerElement ).css( {
@@ -453,28 +448,11 @@
454449 } )
455450 .html( mw.loading_spinner() );
456451
457 - // Apply the Player interface to the DOM element
458 - for ( var method in playerInterface ) { // for in loop oky in Element context
 452+ for ( var method in playerInterface ) {
459453 if ( method != 'readyState' ) { // readyState crashes IE ( don't include )
460 - if ( method == 'style' ) {
461 - swapPlayerElement.setAttribute( 'style', playerInterface[method] );
462 - } else if ( method == 'class' ) {
463 - if ( $j.browser.msie )
464 - swapPlayerElement.setAttribute( "className", playerInterface['class'] );
465 - else
466 - swapPlayerElement.setAttribute( "class", playerInterface['class'] );
467 - } else {
468 - // Normal interface method:
469 - swapPlayerElement[method] = playerInterface[method];
470 - }
 454+ swapPlayerElement[method] = playerInterface[method];
471455 }
472 - // String -> Boolean:
473 - if ( swapPlayerElement[method] == "false" )
474 - swapPlayerElement[method] = false;
475 -
476 - if ( swapPlayerElement[method] == "true" )
477 - swapPlayerElement[method] = true;
478 - }
 456+ }
479457
480458 // Now Swap out the video element for the embed_video obj:
481459 $j( targetElement )
@@ -497,17 +475,10 @@
498476 // mw.log('checkClipsReady');
499477 var is_ready = true;
500478 for ( var i = 0; i < this.playerList.length; i++ ) {
501 - if ( $j( '#' + this.playerList[i] ).length != 0 ) {
502 - var player = $j( '#' + this.playerList[i] ).get( 0 );
503 -
 479+ var player = $j( '#' + this.playerList[i] ).get( 0 );
 480+ if ( player ) {
504481 // Check if the current video is ready
505 - is_ready = ( player.ready_to_play ) ? is_ready : false;
506 -
507 - if ( !is_ready && player.load_error ) {
508 - is_ready = true;
509 - // Update the player with its load error:
510 - $j( player ).html( player.load_error );
511 - }
 482+ is_ready = ( player.ready_to_play || player.load_error ) ? is_ready : false;
512483 }
513484 }
514485 if ( is_ready ) {
@@ -519,7 +490,7 @@
520491 // Continue checking the playerList
521492 setTimeout( function(){
522493 _this.waitPlayersReadyCallback();
523 - }, 25 );
 494+ }, 10 );
524495 }
525496 }
526497 }
@@ -594,20 +565,22 @@
595566 }
596567 for ( var i = 0; i < default_source_attributes.length; i++ ) { // array loop:
597568 var attr = default_source_attributes[ i ];
598 - if ( $j( element ).attr( attr ) ) {
599 - this[ attr ] = $j( element ).attr( attr );
 569+ var attr_value = element.getAttribute( attr );
 570+ if ( attr_value ) {
 571+ this[ attr ] = attr_value;
600572 }
601573 }
602574
603575
604 - if ( $j( element ).attr( 'type' ) )
 576+ if ( $j( element ).attr( 'type' ) ){
605577 this.mime_type = $j( element ).attr( 'type' );
606 - else if ( $j( element ).attr( 'content-type' ) )
 578+ }else if ( $j( element ).attr( 'content-type' ) ){
607579 this.mime_type = $j( element ).attr( 'content-type' );
608 - else
 580+ }else{
609581 this.mime_type = this.detectType( this.src );
 582+ }
610583
611 - // Check for parent elements ( supplies catagories in "itext" )
 584+ // Check for parent elements ( supplies categories in "itext" )
612585 if( $j( element ).parent().attr('category') ){
613586 this.category = $j( element ).parent().attr('category');
614587 }
@@ -1058,8 +1031,8 @@
10591032 */
10601033 tryAddSource: function( element ) {
10611034 mw.log( 'f:tryAddSource:' + $j( element ).attr( "src" ) );
1062 - if ( $j( element ).attr( "src" ) ) {
1063 - var new_src = $j( element ).attr( 'src' );
 1035+ var new_src = $j( element ).attr( 'src' );
 1036+ if ( new_src ) {
10641037 // make sure an existing element with the same src does not already exist:
10651038 for ( var i = 0; i < this.sources.length; i++ ) {
10661039 if ( this.sources[i].src == new_src ) {
@@ -1250,9 +1223,9 @@
12511224 this.pid = 'pid_' + this.id;
12521225
12531226 // Grab any innerHTML and set it to missing_plugin_html
1254 - // @@todo we should strip source tags instead of checking and skipping
 1227+ // @@todo we should strip "source" tags instead of checking and skipping
12551228 if ( element.innerHTML != '' && element.getElementsByTagName( 'source' ).length == 0 ) {
1256 - mw.log( 'innerHTML: ' + element.innerHTML );
 1229+ //mw.log( 'innerHTML: ' + element.innerHTML );
12571230 this.user_missing_plugin_html = element.innerHTML;
12581231 }
12591232
@@ -1331,11 +1304,7 @@
13321305 * @return {Number} pixle height of the video
13331306 */
13341307 getPlayerWidth: function(){
1335 - var player = $j( '#mv_embedded_player_' + this.id ).get( 0 );
1336 - if ( typeof player != 'undefined' && player['offsetWidth'] )
1337 - return player.offsetWidth;
1338 - else
1339 - return parseInt( this.width );
 1308+ return parseInt( this.width );
13401309 },
13411310
13421311 /**
@@ -1343,12 +1312,8 @@
13441313 *
13451314 * @return {Number} pixle height of the video
13461315 */
1347 - getPlayerHeight: function(){
1348 - var player = $j( '#mv_embedded_player_' + this.id ).get( 0 );
1349 - if ( typeof player != 'undefined' && player['offsetHeight'] )
1350 - return player.offsetHeight;
1351 - else
1352 - return parseInt( this.height );
 1316+ getPlayerHeight: function(){
 1317+ return parseInt( this.height );
13531318 },
13541319
13551320 /**
@@ -1400,7 +1365,7 @@
14011366
14021367 /**
14031368 * Check for timed Text support
1404 - * and load nessesary libraries
 1369+ * and load necessary libraries
14051370 *
14061371 * @param {Function} callback Function to call once timed text check is done
14071372 */
@@ -1461,7 +1426,7 @@
14621427 var missing_type = this.pc.type;
14631428
14641429 mw.log( 'No player found for given source type ' + missing_type );
1465 - this.load_error = this.getPluginMissingHTML( missing_type );
 1430+ $(this).html( this.getPluginMissingHTML( missing_type ) );
14661431 }
14671432 },
14681433
@@ -2005,7 +1970,7 @@
20061971
20071972 /**
20081973 * Show the player
2009 - * NOTE: the player area is dobule <div> encapsulation will be factored out shortly
 1974+ * NOTE: the player area is double <div> encapsulation will be factored out shortly
20101975 */
20111976 showPlayer : function () {
20121977 // set-up the local ctrlBuilder instance:
Index: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js
@@ -57,10 +57,8 @@
5858 */
5959 var mwDefaultConf = {
6060
61 -
6261 'enabledModules' : mwEnabledModuleList,
6362
64 -
6563 // Default skin name
6664 'skinName' : 'mvpcf',
6765
@@ -199,8 +197,8 @@
200198 //debugger;
201199
202200 setupUserConfigFlag = true;
203 - if( callback )
204 - callback();
 201+ if( callback )
 202+ callback();
205203 });
206204 }
207205
@@ -958,7 +956,7 @@
959957 // Try loading as a "file"?
960958 if( loadRequest ) {
961959 mw.log("Loading as \"file\" : " + loadRequest );
962 - if( loadRequest.indexOf( '.js' ) == -1 ){
 960+ if( loadRequest.indexOf( '.js' ) == -1 && !mw.getScriptLoaderPath() ){
963961 mw.log( 'Error: are you sure ' + loadRequest + ' is a file ( is it missing a class path? ) ' );
964962 }
965963 mw.getScript( loadRequest, callback );
@@ -984,7 +982,12 @@
985983
986984 // Check if we can load via the "script-loader" ( mwEmbed was included via scriptLoader )
987985 if( mw.getScriptLoaderPath() ){
988 - loadStates = this.getGroupLoadState( loadSet );
 986+ loadStates = this.getGroupLoadState( loadSet );
 987+ //if loadStates is empty issue the callback direclty:
 988+ if( mw.isEmpty( loadStates ) ){
 989+ callback();
 990+ return ;
 991+ }
989992 }else{
990993 // Check if its a dependency set ( nested objects )
991994 if( typeof loadSet [ 0 ] == 'object' ){
@@ -1016,7 +1019,7 @@
10171020 }
10181021 // Run the parent scope callback for "loadMany"
10191022 if( loadDone ){
1020 - callback( loadName );
 1023+ callback( );
10211024 }
10221025 } );
10231026 }
@@ -1027,7 +1030,7 @@
10281031 * Groups the loadSet into a single sequential array
10291032 *
10301033 * Groups the scriptRequest where possible:
1031 - * Modules include "loader code" so they are seperated
 1034+ * Modules include "loader code" so they are separated
10321035 * into pre-condition code to be run for subsequent requests
10331036 *
10341037 * @param {Object} loadSet Loadset to return grouped
@@ -1037,6 +1040,7 @@
10381041 getGroupLoadState: function( loadSet ){
10391042 var groupedLoadSet = [];
10401043 var loadStates = { };
 1044+
10411045 // Merge load set into new groupedLoadSet
10421046 if( typeof loadSet[0] == 'object' ){
10431047 for( var i in loadSet ){
@@ -1049,12 +1053,13 @@
10501054 groupedLoadSet = loadSet;
10511055 }
10521056
1053 - // Setup grouped loadStates Set:
 1057+ // Build the loadStates Set as a single string:
10541058 var groupClassKey = '';
10551059 var coma = '';
10561060 for( var i=0; i < groupedLoadSet.length; i++ ) {
10571061 var loadName = groupedLoadSet[ i ];
1058 - if( this.classPaths[ loadName ] ) {
 1062+ //Check if its a classPath key, if so make sure it does not exist (before adding it to the grouped request)
 1063+ if( this.classPaths[ loadName ] && ! mw.isset( loadName ) ) {
10591064 groupClassKey += coma + loadName
10601065 coma = ',';
10611066 }else if( this.moduleLoaders[ loadName ] ) {
@@ -1068,12 +1073,13 @@
10691074 }
10701075 }
10711076
1072 - // Add groupClassKey if set:
 1077+ // Add groupClassKey is empty return false
10731078 if( groupClassKey != '' ){
1074 - loadStates [ groupClassKey ] = 0;
1075 - }
 1079+ //return the loadStates
 1080+ loadStates [ groupClassKey ] = 0;
 1081+ }
10761082
1077 - return loadStates;
 1083+ return loadStates;
10781084 },
10791085
10801086
Index: branches/js2-work/phase3/js/mwEmbed/jsScriptLoader.php
@@ -412,7 +412,9 @@
413413 if ( isset( $_GET['urid'] ) && $_GET['urid'] != '' ) {
414414 $urid = htmlspecialchars( $_GET['urid'] );
415415 }else{
416 - die( 'missing urid param');
 416+ // If no urid is set use special "cache" version.
 417+ // (this requires that the cache is removed for updates to take effect.)
 418+ $urid = 'cache';
417419 }
418420
419421 // Get the language code (if not provided use the "default" language
Index: branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js
@@ -147,7 +147,7 @@
148148 mw.log( "Error: empty rewrite html" );
149149 return ;
150150 }else{
151 - mw.log(" rewrite: " + rewriteHTML + "\n of type: " + typeof rewriteHTML);
 151+ //mw.log(" rewrite: " + rewriteHTML + "\n of type: " + typeof rewriteHTML);
152152 }
153153 var re = new RegExp( /videoUrl(&quot;:?\s*)*([^&]*)/ );
154154 src = re.exec( rewriteHTML )[2];
@@ -192,13 +192,13 @@
193193 .css( 'height', pheight + 30 );
194194
195195 // Do the actual rewrite
196 - $j( '#mwe_' + vidId ).embedPlayer( function() {
197 - if ( vidIdList.length != 0 ) {
198 - setTimeout( function() {
199 - procVidId( vidIdList.pop() )
200 - }, 10 );
201 - }
202 - } );
 196+ $j( '#mwe_' + vidId ).embedPlayer();
 197+ //issue an async request to rewrite the next clip
 198+ if ( vidIdList.length != 0 ) {
 199+ setTimeout( function() {
 200+ procVidId( vidIdList.pop() )
 201+ }, 1 );
 202+ }
203203
204204 }
205205 };

Status & tagging log