Index: branches/MwEmbedStandAlone/modules/P2PNextTransport/P2PNextTransport.i18n.php |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | $messages = array(); |
11 | 11 | $messages['en'] = array( |
12 | 12 | "mwe-swarmtransport-stream-ogg" => "Swarm Transport p2p Ogg stream", |
13 | | - "mwe-swiftransport-stream-ogg" => "Swift Transport p2p Ogg stream", |
| 13 | + "mwe-swifttransport-stream-ogg" => "Swift Transport p2p Ogg stream", |
14 | 14 | "mwe-swarmtransport-recommend" => "To save bandwidth, please consider installing the P2P [$1 swarm transport add on]", |
15 | 15 | "mwe-embedplayer-ogg-player-swarmTransportPlayer" => "Swarm Transport player", |
16 | 16 | "mwe-embedplayer-ogg-player-swiftTransportPlayer" => "Swift Transport player", |
Index: branches/MwEmbedStandAlone/modules/P2PNextTransport/mw.P2PNextTransport.js |
— | — | @@ -32,7 +32,6 @@ |
33 | 33 | |
34 | 34 | // Bind some hooks to every player: |
35 | 35 | $j( mw ).bind( 'newEmbedPlayerEvent', function( event, embedPlayer ) { |
36 | | - |
37 | 36 | // Setup the "embedCode" binding to swap in an updated url |
38 | 37 | $j( embedPlayer ).bind( 'checkPlayerSourcesEvent', function( event, callback ) { |
39 | 38 | // Confirm P2PNextTransport add-on is available |
— | — | @@ -122,7 +121,7 @@ |
123 | 122 | mw.log("Warning: addSwarmSource: could not find video/ogg source to generate torrent from"); |
124 | 123 | callback(); |
125 | 124 | return ; |
126 | | - } |
| 125 | + } |
127 | 126 | $.each( this.getTransportObjects(), function(inx, transportObject ){ |
128 | 127 | // Setup function to run in context based on callback result |
129 | 128 | $j.getJSON( |
— | — | @@ -132,23 +131,32 @@ |
133 | 132 | }, |
134 | 133 | function( data ){ |
135 | 134 | // Check if the torrent is ready: |
136 | | - if( !data.torrent ){ |
| 135 | + if( !data.torrent && ! data ){ |
137 | 136 | mw.log( "P2PNext: ( " + transportObject.lookupUrl + " ) Torrent not ready status: " + data.status.text ); |
138 | 137 | callback( false ); |
139 | 138 | return ; |
140 | 139 | } |
141 | | - mw.log( 'SwarmTransport: addSwarmSource for: ' + source.getSrc() + "\n\nGot:" + data.torrent ); |
142 | | - // XXX need to update preference |
| 140 | + mw.log( 'P2PNextTransport: addSwarmSource for: ' + source.getSrc() + "\n\nGot:" + data.torrent ); |
| 141 | + |
| 142 | + var transportSrc = ''; |
| 143 | + // Set the source via transportObject type |
| 144 | + if( transportObject.name == 'swift'){ |
| 145 | + transportSrc = data.swift; |
| 146 | + } else { |
| 147 | + transportSrc = transportObject.protocol + data.torrent; |
| 148 | + } |
143 | 149 | embedPlayer.mediaElement.tryAddSource( |
144 | 150 | $j('<source />') |
145 | 151 | .attr( { |
146 | | - 'type' : 'video/swarmTransport', |
147 | | - 'title': gM('mwe-swarmtransport-stream-ogg'), |
148 | | - 'src': transportObject.protocol + data.torrent, |
| 152 | + 'type' : transportObject.mime, |
| 153 | + 'title': gM('mwe-' + transportObject.name + 'transport-stream-ogg' ), |
| 154 | + 'src': transportSrc, |
149 | 155 | 'default' : true |
150 | 156 | } ) |
151 | 157 | .get( 0 ) |
152 | 158 | ); |
| 159 | + // XXX need to update preference |
| 160 | + |
153 | 161 | callback( true ); |
154 | 162 | } |
155 | 163 | ); |
Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | */ |
6 | 6 | var urlparts = getRemoteEmbedPath(); |
7 | 7 | var mwEmbedHostPath = urlparts[0]; |
8 | | -var mwRemoteVersion = 'r187'; |
| 8 | +var mwRemoteVersion = 'r188'; |
9 | 9 | |
10 | 10 | // Log the mwRemote version makes it easy to debug cache issues |
11 | 11 | if( window.console ){ |
— | — | @@ -95,7 +95,7 @@ |
96 | 96 | mwAddMediaConfig = {}; |
97 | 97 | } |
98 | 98 | // Set legacy add media wizard config |
99 | | -mwAddMediaConfig['enabled_providers'] = [ 'wiki_commons', 'upload' ] |
| 99 | +mwAddMediaConfig['enabled_providers'] = [ 'wiki_commons', 'upload' ]; |
100 | 100 | |
101 | 101 | |
102 | 102 | // Legacy Add media wizard config: |
— | — | @@ -541,7 +541,7 @@ |
542 | 542 | $j( '<div />') |
543 | 543 | .css({ |
544 | 544 | 'width' : $pimg.attr('width' ), |
545 | | - 'height' :$pimg.attr( 'height' ), |
| 545 | + 'height' : $pimg.attr( 'height' ), |
546 | 546 | 'position' : 'relative', |
547 | 547 | 'background-color' : '#FFF' |
548 | 548 | }) |