Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js |
— | — | @@ -41,10 +41,11 @@ |
42 | 42 | /** |
43 | 43 | * Setup the layout if not already setup |
44 | 44 | */ |
45 | | - setupLayout: function( $renderTarget ){ |
| 45 | + setupLayout: function( $renderTarget ){ |
46 | 46 | if( ! $renderTarget.find( '.smilRootLayout').length ) { |
47 | 47 | $renderTarget.append( this.getRootLayout() ); |
48 | 48 | } |
| 49 | + this.$rootLayout =$renderTarget.find( '.smilRootLayout'); |
49 | 50 | }, |
50 | 51 | |
51 | 52 | getTargetAspectRatio:function(){ |
— | — | @@ -56,8 +57,8 @@ |
57 | 58 | */ |
58 | 59 | getRootLayout: function(){ |
59 | 60 | var _this = this; |
60 | | - mw.log( "SmilLayout::getRootLayout:" ); |
61 | | - if( !this.$rootLayout ){ |
| 61 | + mw.log( "SmilLayout::getRootLayout:" ); |
| 62 | + if( !this.$rootLayout ) { |
62 | 63 | // Setup target Size: |
63 | 64 | this.targetWidth = this.smil.embedPlayer.getWidth(); |
64 | 65 | this.targetHeight = this.smil.embedPlayer.getHeight(); |
— | — | @@ -336,14 +337,13 @@ |
337 | 338 | /** |
338 | 339 | * Hide a smilElement in the layout |
339 | 340 | */ |
340 | | - hideElement: function( smilElement ){ |
341 | | - if( this.$rootLayout ){ |
342 | | - // Check that the element is already in the dom |
343 | | - var $targetElement = this.$rootLayout.find( '#' + this.smil.getSmilElementPlayerID( smilElement ) ); |
344 | | - if( $targetElement.length ){ |
345 | | - // Issue a quick hide request |
346 | | - $targetElement.hide(); |
347 | | - } |
| 341 | + hideElement: function( smilElement ){ |
| 342 | + mw.log(" hide: " + this.smil.getSmilElementPlayerID( smilElement )); |
| 343 | + // Check that the element is already in the dom |
| 344 | + var $targetElement = this.$rootLayout.find( '#' + this.smil.getSmilElementPlayerID( smilElement ) ); |
| 345 | + if( $targetElement.length ){ |
| 346 | + // Issue a quick hide request |
| 347 | + $targetElement.hide(); |
348 | 348 | } |
349 | 349 | }, |
350 | 350 | |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js |
— | — | @@ -236,8 +236,10 @@ |
237 | 237 | transformMediaForTime: function( smilElement, animateTime, callback ){ |
238 | 238 | // Get the video element |
239 | 239 | var assetId = this.smil.getSmilElementPlayerID( smilElement ); |
240 | | - var vid = $j ( '#' + assetId ).get( 0 ); |
241 | | - mw.log( "SmilAnimate::transformMediaForTime:" + assetId + " ct:" +vid.currentTime + ' should be: ' + mediaSeekTime ); |
| 240 | + var media = $j ( '#' + assetId ).get( 0 ); |
| 241 | + if( !media ){ |
| 242 | + mw.log("Error: transformMediaForTime could not find media asest: " +assetId ); |
| 243 | + } |
242 | 244 | |
243 | 245 | |
244 | 246 | var mediaSeekTime = animateTime; |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js |
— | — | @@ -158,9 +158,9 @@ |
159 | 159 | /** |
160 | 160 | * Render a specific time |
161 | 161 | */ |
162 | | - renderTime : function(time, callback) { |
| 162 | + renderTime : function(time, callback) { |
163 | 163 | // Setup the layout if not already setup: |
164 | | - this.getLayout().setupLayout(this.embedPlayer.getRenderTarget()); |
| 164 | + this.getLayout().setupLayout( this.embedPlayer.getRenderTarget() ); |
165 | 165 | |
166 | 166 | // Update the render target with bodyElements for the requested time |
167 | 167 | this.getBody().renderTime( time ); |
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js |
— | — | @@ -311,7 +311,7 @@ |
312 | 312 | callback( _this.smil ); |
313 | 313 | }); |
314 | 314 | } else { |
315 | | - callback( _this.smil ); |
| 315 | + callback( this.smil ); |
316 | 316 | } |
317 | 317 | }, |
318 | 318 | |
Index: branches/MwEmbedStandAlone/modules/SwarmTransport/loader.js |
— | — | @@ -8,12 +8,14 @@ |
9 | 9 | ( function( mw ) { |
10 | 10 | |
11 | 11 | mw.addResourcePaths( { |
12 | | - "mw.SwarmTransport" : "mw.SwarmTransport.js" |
| 12 | + "mw.SwarmTransport" : "mw.SwarmTransport.js", |
| 13 | + "mw.EmbedPlayerSwamVlc" : "mw.EmbedPlayerSwamVlc.js" |
13 | 14 | }); |
14 | 15 | |
15 | 16 | mw.setDefaultConfig({ |
16 | 17 | /** |
17 | | - * If SwarmTransport should be enabled by default as video transport mechanism |
| 18 | + * If SwarmTransport should be enabled as video transport mechanism |
| 19 | + * Enabling SwarmTransport loads mw.SwarmTransport, vlc and swarmvlc embed if in IE. |
18 | 20 | */ |
19 | 21 | 'SwarmTransport.Enable': false, |
20 | 22 | |
— | — | @@ -34,6 +36,13 @@ |
35 | 37 | if( mw.getConfig( 'SwarmTransport.Enable' ) ) { |
36 | 38 | if( $j.inArray( 'mw.SwarmTransport', classRequest ) == -1 ) { |
37 | 39 | classRequest.push( [ 'mw.SwarmTransport' ]); |
| 40 | + // if IE / ActiveX |
| 41 | + // Look for swarm player: |
| 42 | + if( mw.EmbedTypes.testActiveX( 'P2PNext.SwarmPlayer' ) ){ |
| 43 | + // Add vlc and swarmVlc to request |
| 44 | + classRequest.push( 'mw.EmbedPlayerVlc' ); |
| 45 | + classRequest.push( 'mw.EmbedPlayerSwarmVlc' ); |
| 46 | + } |
38 | 47 | } |
39 | 48 | } |
40 | 49 | }); |
Index: branches/MwEmbedStandAlone/modules/SwarmTransport/mw.EmbedPlayerSwamVlc.js |
— | — | @@ -0,0 +1,37 @@ |
| 2 | +/* |
| 3 | +* Swarm VLC embed |
| 4 | +* inherits EmbedPlayerVlc |
| 5 | +*/ |
| 6 | +mw.EmbedPlayerSwarmVlc = { |
| 7 | + |
| 8 | + //Instance Name: |
| 9 | + instanceOf : 'SwarmVlc', |
| 10 | + |
| 11 | + doEmbedHTML: function() { |
| 12 | + var _this = this; |
| 13 | + var oggHttpSource = this.mediaElement.getSources( 'video/ogg' )[0]; |
| 14 | + $j( this ).html( |
| 15 | + '<object classid="clsid:98FF91C0-A3B8-11DF-8555-0002A5D5C51B" ' + |
| 16 | + 'id="' + this.pid + '" events="True" height="' + this.getHeight() + '" width="' + this.getWidth() + '"' + |
| 17 | + '>' + |
| 18 | + '<param name="ShowDisplay" value="True" />' + |
| 19 | + '<param name="AutoLoop" value="False" />' + |
| 20 | + '<param name="AutoPlay" value="True" />' + |
| 21 | + '<param name="Volume" value="'+ this.volume * 100 + '" />' + |
| 22 | + '<param name="Src" value="' + this.getSrc() +'" />' + |
| 23 | + '<param name="AltSrc" value="' + mw.absoluteUrl( oggHttpSource.getSrc() ) + '" />' + |
| 24 | + '</object>' |
| 25 | + ); |
| 26 | + setTimeout( function() { |
| 27 | + _this.monitor(); |
| 28 | + }, 100 ); |
| 29 | + } |
| 30 | +}; |
| 31 | +// Inherit the vlc object |
| 32 | +if( typeof mw.EmbedPlayerVlc == 'undefined' ){ |
| 33 | + mw.log("Error:: EmbedPLayerVlc not defefined "); |
| 34 | +} else { |
| 35 | + for(var i in mw.EmbedPlayerVlc.prototype ){ |
| 36 | + mw.EmbedPlayerSwarmVlc |
| 37 | + }; |
| 38 | +} |
Index: branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | // Setup the "embedCode" binding to swap in an updated url |
21 | 21 | $j( embedPlayer ).bind( 'checkPlayerSourcesEvent', function( event, callback ) { |
22 | 22 | // Confirm SwarmTransport add-on is available ( defines swarmTransport var ) |
23 | | - if( _this.getPluginLibrary() ){ |
| 23 | + if( _this.getPluginLibrary() ){ |
24 | 24 | // Add the swarm source |
25 | 25 | mw.log(" SwarmTransport :: checkPlayerSourcesEvent " + swapedPlayerId); |
26 | 26 | _this.addSwarmSource( embedPlayer, function(){ |
— | — | @@ -69,7 +69,7 @@ |
70 | 70 | } |
71 | 71 | // Look for swarm player: |
72 | 72 | if( mw.EmbedTypes.testActiveX( 'P2PNext.SwarmPlayer' ) ){ |
73 | | - return 'Vlc'; |
| 73 | + return 'SwarmVlc'; |
74 | 74 | } |
75 | 75 | return false; |
76 | 76 | }, |
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js |
— | — | @@ -120,7 +120,7 @@ |
121 | 121 | |
122 | 122 | // Cache the pre / post bits |
123 | 123 | callback( _this.serverSmilXml ); |
124 | | - }) |
| 124 | + }); |
125 | 125 | }, |
126 | 126 | wrapSequencerWikiText : function( xmlString ){ |
127 | 127 | var _this = this; |
— | — | @@ -205,7 +205,7 @@ |
206 | 206 | mw.log("SequenceServer::Save: " + saveSummary ); |
207 | 207 | this.getSaveToken( function( token ){ |
208 | 208 | if( !token ){ |
209 | | - callback( false, 'could not get edit token') |
| 209 | + callback( false, 'could not get edit token'); |
210 | 210 | return ; |
211 | 211 | } |
212 | 212 | var request = { |
— | — | @@ -218,7 +218,7 @@ |
219 | 219 | mw.getJSON( _this.getApiUrl(), request, function( data ) { |
220 | 220 | if( data.edit && data.edit.result == 'Success' ) { |
221 | 221 | // Update the latest local variables |
222 | | - _this.saveSummary = saveSummary |
| 222 | + _this.saveSummary = saveSummary; |
223 | 223 | _this.sequenceSaved = true; |
224 | 224 | _this.serverSmilXml = sequenceXML; |
225 | 225 | callback( true ); |
— | — | @@ -226,8 +226,8 @@ |
227 | 227 | // xxx Should have more error handling ( conflict version save etc ) |
228 | 228 | callback( false, 'failed to save to server'); |
229 | 229 | } |
230 | | - }) |
231 | | - }) |
| 230 | + }); |
| 231 | + }); |
232 | 232 | }, |
233 | 233 | |
234 | 234 | /** |
— | — | @@ -299,9 +299,9 @@ |
300 | 300 | var pageText = ''; |
301 | 301 | // Check if we should use commons asset description template: |
302 | 302 | if( mw.parseUri( _this.getApiUrl() ).host == 'commons.wikimedia.org' ){ |
303 | | - pageText = _this.getCommonsDescriptionText() |
| 303 | + pageText = _this.getCommonsDescriptionText(); |
304 | 304 | } else { |
305 | | - pageText = _this.getBaseFileDescription() |
| 305 | + pageText = _this.getBaseFileDescription(); |
306 | 306 | } |
307 | 307 | var request = { |
308 | 308 | 'action': 'edit', |
— | — | @@ -318,7 +318,7 @@ |
319 | 319 | callback( false ); |
320 | 320 | } |
321 | 321 | }); |
322 | | - }) |
| 322 | + }); |
323 | 323 | }, |
324 | 324 | |
325 | 325 | getBaseFileDescription: function(){ |
— | — | @@ -351,12 +351,12 @@ |
352 | 352 | return '0' + num; |
353 | 353 | } |
354 | 354 | return num; |
355 | | - } |
| 355 | + }; |
356 | 356 | var dt = new Date(); |
357 | 357 | descText+='|Date=' + dt.getFullYear() + '-' + |
358 | 358 | pad2(dt.getMonth()+1) + '-' + |
359 | 359 | pad2(dt.getDate()) + "\n" + |
360 | | - "|Author=Last edit by [[User:" + _this.getUserName() + "]]\n" + |
| 360 | + "|Author=Published by [[User:" + _this.getUserName() + "]]\n" + |
361 | 361 | "For full editor list see history page of [[" + _this.getTitleKey() + "]] \n" + |
362 | 362 | "|Permission={{Cc-by-sa-3.0}} and {{GFDL|migration=redundant}}" + "\n" + |
363 | 363 | "}}"; |
— | — | @@ -418,7 +418,7 @@ |
419 | 419 | 'filename': _this.getVideoFileName(), |
420 | 420 | 'comment': 'Published [[' + _this.getTitleKey() + ']] : ' + saveSummary, |
421 | 421 | 'ignorewarnings' : true |
422 | | - } |
| 422 | + }; |
423 | 423 | // Return the apiUrl and request |
424 | 424 | callback( _this.getApiUrl(), request ); |
425 | 425 | }); |
Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | } |
38 | 38 | |
39 | 39 | //mwReqParam['debug'] = false; |
40 | | -//mwUseScriptLoader = true; |
| 40 | +mwUseScriptLoader = true; |
41 | 41 | //mwRemoteVersion = Math.random(); |
42 | 42 | |
43 | 43 | // Setup up some globals to wrap mwEmbed mw.ready and mw.setConfig functions |