Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js |
— | — | @@ -335,7 +335,7 @@ |
336 | 336 | } |
337 | 337 | } |
338 | 338 | //update duration from hit if present: |
339 | | - if(this.durationHint) |
| 339 | + if( this.durationHint ) |
340 | 340 | this.duration = this.durationHint; |
341 | 341 | |
342 | 342 | |
Index: trunk/phase3/js2/remoteMwEmbed.js |
— | — | @@ -63,7 +63,10 @@ |
64 | 64 | // will be depreciated in favor of updates to OggHandler |
65 | 65 | function rewrite_for_OggHandler( vidIdList ){ |
66 | 66 | function procVidId( vidId ){ |
67 | | - js_log('vidIdList length: ' + vidIdList.length + ' left in the set: ' + vidIdList ); |
| 67 | + //don't proccess empty vids |
| 68 | + if(!vidId) |
| 69 | + return ; |
| 70 | + js_log('vidIdList on: ' + vidId +' length: ' + vidIdList.length + ' left in the set: ' + vidIdList ); |
68 | 71 | |
69 | 72 | // Grab the thumbnail and src of the video |
70 | 73 | var pimg = $j( '#' + vidId + ' img' ); |
— | — | @@ -85,7 +88,8 @@ |
86 | 89 | // Parsed values: |
87 | 90 | var src = ''; |
88 | 91 | var duration_attr = ''; |
89 | | - var wikiTitleKey = $j( '#'+vidId + ' img').filter(':first').attr('alt').replace(/ /g, '_'); |
| 92 | + var wikiTitleKey = $j( '#'+vidId + ' img').filter(':first').attr('src').split('/'); |
| 93 | + wikiTitleKey = unescape( wikiTitleKey[ wikiTitleKey.length - 2 ] ); |
90 | 94 | var re = new RegExp( /videoUrl(":?\s*)*([^&]*)/ ); |
91 | 95 | src = re.exec( $j( '#'+vidId ).html() )[2]; |
92 | 96 | |
— | — | @@ -122,8 +126,7 @@ |
123 | 127 | |
124 | 128 | } |
125 | 129 | rewrite_by_id( 'mwe_' + vidId, function(){ |
126 | | - if(vidIdList.length != 0){ |
127 | | - alert('did first rewite now doing another'); |
| 130 | + if( vidIdList.length != 0 ){ |
128 | 131 | setTimeout( function(){ |
129 | 132 | procVidId( vidIdList.pop() ) |
130 | 133 | }, 1); |
— | — | @@ -131,9 +134,7 @@ |
132 | 135 | }); |
133 | 136 | }; |
134 | 137 | //process each item in the vidIdList (with setTimeout to avoid locking) |
135 | | - setTimeout( function(){ |
136 | | - procVidId( vidIdList.pop() ) |
137 | | - }, 1); |
| 138 | + procVidId( vidIdList.pop() ); |
138 | 139 | } |
139 | 140 | function getRemoteEmbedPath() { |
140 | 141 | for( var i = 0; i < document.getElementsByTagName( 'script' ).length; i++ ) { |