Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js |
— | — | @@ -110,10 +110,10 @@ |
111 | 111 | /** |
112 | 112 | * Update the thumbnail html |
113 | 113 | */ |
114 | | - updateThumbnailHTML: function() { |
| 114 | + updatePosterHTML: function() { |
115 | 115 | // If we have a "poster" use that; |
116 | 116 | if( this.poster ){ |
117 | | - this.parent_updateThumbnailHTML(); |
| 117 | + this.parent_updatePosterHTML(); |
118 | 118 | return ; |
119 | 119 | } |
120 | 120 | // If no thumb could be found use the first frame of smil: |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js |
— | — | @@ -228,9 +228,7 @@ |
229 | 229 | $j( '.videonojs' ).remove(); |
230 | 230 | |
231 | 231 | // Detect supported players: |
232 | | - mw.EmbedTypes.init(); |
233 | | - |
234 | | - //mw.log(" run callback: " + callback ); |
| 232 | + mw.EmbedTypes.init(); |
235 | 233 | |
236 | 234 | // Run the callback with name of the module |
237 | 235 | if( typeof callback == 'function' ) { |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js |
— | — | @@ -280,6 +280,11 @@ |
281 | 281 | $j( mw ).trigger( 'EmbedPlayerManagerReady' ); |
282 | 282 | } |
283 | 283 | |
| 284 | + // If we have not detected player yet do that: |
| 285 | + if( ! mw.EmbedTypes.players ){ |
| 286 | + mw.EmbedTypes.init(); |
| 287 | + } |
| 288 | + |
284 | 289 | // Add the embedPlayer ready callback |
285 | 290 | if( typeof callback == 'function' ){ |
286 | 291 | mw.playerManager.addCallback( callback ); |
— | — | @@ -1962,7 +1967,7 @@ |
1963 | 1968 | this.controlBuilder.closeMenuOverlay(); |
1964 | 1969 | |
1965 | 1970 | // update the thumbnail html: |
1966 | | - this.updateThumbnailHTML(); |
| 1971 | + this.updatePosterHTML(); |
1967 | 1972 | |
1968 | 1973 | this.paused = true; |
1969 | 1974 | this.thumbnail_disp = true; |
— | — | @@ -2004,7 +2009,7 @@ |
2005 | 2010 | this.$interface = $j( this ).parent( '.interface_wrap' ); |
2006 | 2011 | |
2007 | 2012 | // Update Thumbnail for the "player" |
2008 | | - this.updateThumbnailHTML(); |
| 2013 | + this.updatePosterHTML(); |
2009 | 2014 | |
2010 | 2015 | // Add controls if enabled: |
2011 | 2016 | if ( this.controls ) { |
— | — | @@ -2155,7 +2160,7 @@ |
2156 | 2161 | } |
2157 | 2162 | ); |
2158 | 2163 | if ( !this.thumbnail_updating ) { |
2159 | | - this.updateThumbnail( this.last_thumb_url , false ); |
| 2164 | + this.updatePoster( this.last_thumb_url , false ); |
2160 | 2165 | this.last_thumb_url = null; |
2161 | 2166 | } |
2162 | 2167 | } |
— | — | @@ -2177,7 +2182,7 @@ |
2178 | 2183 | * true switch happens instantly |
2179 | 2184 | * false / undefined animated cross fade |
2180 | 2185 | */ |
2181 | | - updateThumbnail : function( src, quick_switch ) { |
| 2186 | + updatePosterSrc: function( src, quick_switch ) { |
2182 | 2187 | // make sure we don't go to the same url if we are not already updating: |
2183 | 2188 | if ( !this.thumbnail_updating && $j( '#img_thumb_' + this.id ).attr( 'src' ) == src ) |
2184 | 2189 | return false; |
— | — | @@ -2227,7 +2232,7 @@ |
2228 | 2233 | if ( _this.last_thumb_url ) { |
2229 | 2234 | var src_url = _this.last_thumb_url; |
2230 | 2235 | _this.last_thumb_url = null; |
2231 | | - _this.updateThumbnail( src_url ); |
| 2236 | + _this.updatePosterSrc( src_url ); |
2232 | 2237 | } |
2233 | 2238 | } ); |
2234 | 2239 | } |
— | — | @@ -2239,8 +2244,8 @@ |
2240 | 2245 | * playing, configuring the player, inline cmml display, HTML linkback, |
2241 | 2246 | * download, and embed code. |
2242 | 2247 | */ |
2243 | | - updateThumbnailHTML: function () { |
2244 | | - mw.log( 'embedPlayer:updateThumbnailHTML::' + this.id ); |
| 2248 | + updatePosterHTML: function () { |
| 2249 | + mw.log( 'embedPlayer:updatePosterHTML::' + this.id ); |
2245 | 2250 | var thumb_html = ''; |
2246 | 2251 | var class_atr = ''; |
2247 | 2252 | var style_atr = ''; |
— | — | @@ -2255,7 +2260,7 @@ |
2256 | 2261 | var posterSrc = ( this.poster ) ? this.poster : |
2257 | 2262 | mw.getConfig( 'imagesPath' ) + 'vid_default_thumb.jpg'; |
2258 | 2263 | |
2259 | | - // Poster support is not very consistant in browsers |
| 2264 | + // Poster support is not very consistent in browsers |
2260 | 2265 | // use a jpg poster image: |
2261 | 2266 | $j( this ).html( |
2262 | 2267 | $j( '<img />' ) |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerHtml.js |
— | — | @@ -232,7 +232,7 @@ |
233 | 233 | // mw.log('f:getThumbnailHTML: got thumb: '+out); |
234 | 234 | return out; |
235 | 235 | }, |
236 | | - updateThumbnailHTML: function(){ |
| 236 | + updatePosterHTML: function(){ |
237 | 237 | $j( this ).css( 'background', '#fff'); |
238 | 238 | $j( this ).html( this.getThumbnailHTML() ); |
239 | 239 | }, |
Index: branches/MwEmbedStandAlone/mwEmbed.js |
— | — | @@ -1042,7 +1042,7 @@ |
1043 | 1043 | * @param {Boolean} fresh A fresh check is issued. |
1044 | 1044 | */ |
1045 | 1045 | // Stub feature apiUserNameCache to avoid multiple calls |
1046 | | - // ( a more general api cache framework should be devloped ) |
| 1046 | + // ( a more general api framework should be developed ) |
1047 | 1047 | var apiUserNameCache = {}; |
1048 | 1048 | mw.getUserName = function( apiUrl, callback, fresh ){ |
1049 | 1049 | if( typeof apiUrl == 'function' ){ |
— | — | @@ -1055,7 +1055,8 @@ |
1056 | 1056 | if( mw.isLocalDomain( apiUrl ) ){ |
1057 | 1057 | if( typeof wgUserName != 'undefined' && wgUserName !== null ) { |
1058 | 1058 | callback( wgUserName ) |
1059 | | - return ; |
| 1059 | + // In case someone called this function without a callback |
| 1060 | + return wgUserName; |
1060 | 1061 | } |
1061 | 1062 | } |
1062 | 1063 | if( ! fresh && apiUserNameCache[ apiUrl ] ) { |