Index: branches/js2-work/phase3/js/mwEmbed/tests/Firefogg_GUI.html |
— | — | @@ -4,7 +4,8 @@ |
5 | 5 | <title>Firefogg - Make Ogg Video in your Browser</title> |
6 | 6 | <script type="text/javascript" src="../jsScriptLoader.php?class=window.jQuery,mwEmbed"></script> |
7 | 7 | <!-- <script type="text/javascript" src="../mwEmbed.js?debug=true"></script> --> |
8 | | -<style type="text/css" media="all">body { |
| 8 | +<style type="text/css" media="all"> |
| 9 | +body { |
9 | 10 | margin: 0; |
10 | 11 | padding: 0; |
11 | 12 | font-family: Vera Sans, sans-serif; |
Index: branches/js2-work/phase3/js/mwEmbed/includes/cache/README |
— | — | @@ -1,10 +0,0 @@ |
2 | | -This folder holds cached versions of grouped script requests |
3 | | - |
4 | | -Be sure to enable write access by your web-server to this directory. |
5 | | - |
6 | | -You can empty this directory at any time and should not be a problem. |
7 | | - |
8 | | - |
9 | | -For convenience in releases I include embedPlayerAll.min.js for performance |
10 | | -static version deployment where you might not have php available. |
11 | | - |
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/loader.js |
— | — | @@ -1,7 +1,6 @@ |
2 | 2 | /* |
3 | 3 | * Loader for libAddMedia module: |
4 | 4 | */ |
5 | | - |
6 | 5 | // Scope everything in "mw" ( keeps the global namespace clean ) |
7 | 6 | ( function( mw ) { |
8 | 7 | |
— | — | @@ -37,7 +36,7 @@ |
38 | 37 | var request = [ |
39 | 38 | [ |
40 | 39 | 'mw.UploadForm', |
41 | | - '$j.ui' |
| 40 | + '$j.ui' |
42 | 41 | ], |
43 | 42 | [ |
44 | 43 | '$j.ui.datepicker' |
— | — | @@ -129,7 +128,7 @@ |
130 | 129 | mw.load( request, function() { |
131 | 130 | callback( 'AddMedia.FirefoggGUI' ); |
132 | 131 | }); |
133 | | - } ); |
| 132 | + } ); |
134 | 133 | |
135 | 134 | mw.addModuleLoader( 'AddMedia.firefoggRender', function( callback ) { |
136 | 135 | mw.load( [ |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/kplayerEmbed.js |
— | — | @@ -81,9 +81,9 @@ |
82 | 82 | postEmbedJS:function() { |
83 | 83 | var _this = this; |
84 | 84 | this.getPlayerElement(); |
85 | | - |
86 | | - //alert( this.playerElement ); |
| 85 | + |
87 | 86 | if( this.playerElement && this.playerElement.addJsListener ) { |
| 87 | + mw.log( 'flash:postEmbedJS::'); |
88 | 88 | |
89 | 89 | // Add KDP listeners |
90 | 90 | _this.bindPlayerFunction( 'doPause', 'onPause' ); |
— | — | @@ -167,14 +167,16 @@ |
168 | 168 | |
169 | 169 | /** |
170 | 170 | * Issues a seek to the playerElement |
| 171 | + * @param {Float} percentage Percentage of total stream length to seek to |
171 | 172 | */ |
172 | | - doSeek: function( prec ) { |
| 173 | + doSeek: function( percentage ) { |
173 | 174 | var _this = this; |
174 | 175 | if( this.playerElement ) { |
175 | | - var seek_time = prec * this.getDuration(); |
| 176 | + var seekTime = percentage * this.getDuration(); |
176 | 177 | |
177 | 178 | // Issue the seek to the flash player: |
178 | | - this.playerElement.sendNotification('doSeek', seek_time); |
| 179 | + this.playerElement.sendNotification('doSeek', seekTime); |
| 180 | + |
179 | 181 | // Kdp is missing seek done callback |
180 | 182 | setTimeout(function() { |
181 | 183 | _this.seeking= false; |
— | — | @@ -185,12 +187,48 @@ |
186 | 188 | } |
187 | 189 | this.monitor(); |
188 | 190 | |
189 | | - // Run the onSeek interface update |
190 | | - this.onSeek(); |
| 191 | + // Run the onSeeking interface update |
| 192 | + this.ctrlBuilder.onSeek(); |
191 | 193 | }, |
192 | 194 | |
193 | 195 | /** |
| 196 | + * Seek in a existing stream |
| 197 | + * |
| 198 | + * @param {Float} percentage Percentage of the stream to seek to between 0 and 1 |
| 199 | + */ |
| 200 | + doPlayThenSeek: function( percentage ) { |
| 201 | + mw.log( 'flash::doPlayThenSeek::' ); |
| 202 | + var _this = this; |
| 203 | + // issue the play request |
| 204 | + this.play(); |
| 205 | + |
| 206 | + // let the player know we are seeking |
| 207 | + _this.seeking = true; |
| 208 | + |
| 209 | + var getPlayerCount = 0; |
| 210 | + var readyForSeek = function() { |
| 211 | + _this.getPlayerElement(); |
| 212 | + // if we have duration then we are ready to do the seek ( flash can't seek untill there is some buffer ) |
| 213 | + if ( _this.playerElement && _this.playerElement.sendNotification && _this.getDuration() && _this.bufferedPercent ) { |
| 214 | + var seekTime = percentage * _this.getDuration(); |
| 215 | + // Issue the seek to the flash player: |
| 216 | + _this.playerElement.sendNotification('doSeek', seekTime); |
| 217 | + } else { |
| 218 | + // Try to get player for 20 seconds: |
| 219 | + if ( getPlayerCount < 400 ) { |
| 220 | + setTimeout( readyForSeek, 50 ); |
| 221 | + getPlayerCount++; |
| 222 | + } else { |
| 223 | + mw.log( 'Error:doPlayThenSeek failed' ); |
| 224 | + } |
| 225 | + } |
| 226 | + } |
| 227 | + readyForSeek(); |
| 228 | + }, |
| 229 | + |
| 230 | + /** |
194 | 231 | * Issues a volume update to the playerElement |
| 232 | + * @param {Float} percentage Percentage to update volume to |
195 | 233 | */ |
196 | 234 | updateVolumen: function( percentage ) { |
197 | 235 | if( this.playerElement && this.playerElement.sendNotification ){ |
— | — | @@ -213,7 +251,7 @@ |
214 | 252 | }, |
215 | 253 | |
216 | 254 | /** |
217 | | - * function called by falsh when download bytes changes |
| 255 | + * function called by flash applet when download bytes changes |
218 | 256 | */ |
219 | 257 | onBytesDownloadedChange: function( data, id){ |
220 | 258 | this.bytesLoaded = data.newValue; |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/loader.js |
— | — | @@ -146,7 +146,7 @@ |
147 | 147 | //$j( element ).hide(); |
148 | 148 | }); |
149 | 149 | // Load the embedPlayer module ( then run queued hooks ) |
150 | | - mw.load( 'EmbedPlayer', function ( ) { |
| 150 | + mw.load( 'EmbedPlayer', function ( ) { |
151 | 151 | // Rewrite the rewritePlayerTags with the |
152 | 152 | $j( mw.getConfig( 'rewritePlayerTags' ) ).embedPlayer(); |
153 | 153 | // Run the setup callback now that we have setup all the players |
— | — | @@ -201,7 +201,7 @@ |
202 | 202 | playerSkins[ mw.valid_skins[ n ] ] = true; |
203 | 203 | } |
204 | 204 | } |
205 | | - mw.runHook( 'LoaderEmbedPlayerVisitTag', playerElement ); |
| 205 | + $j( mw ).trigger( 'LoaderEmbedPlayerVisitTag', playerElement ); |
206 | 206 | } ); |
207 | 207 | |
208 | 208 | // Add the player skins css and js to the load request: |
— | — | @@ -229,7 +229,7 @@ |
230 | 230 | } |
231 | 231 | |
232 | 232 | // Run the EmbedPlayer loader hook ( so that modules can add dependencies to the request ) |
233 | | - mw.runHook( 'LoaderEmbedPlayerUpdateRequest', dependencyRequest[ 0 ] ); |
| 233 | + $j( mw ).trigger( 'LoaderEmbedPlayerUpdateRequest', [ dependencyRequest[ 0 ] ] ); |
234 | 234 | |
235 | 235 | |
236 | 236 | // Load the video libs: |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js |
— | — | @@ -240,7 +240,7 @@ |
241 | 241 | * Rewrites all tags via a given selector |
242 | 242 | * |
243 | 243 | * @param [ Optional ] {Object} attributes The embedPlayer options for the given video interface. |
244 | | - * Attributes Object can inclue any key value pair that would otherwise be |
| 244 | + * Attributes Object can inclued any key value pair that would otherwise be |
245 | 245 | * an attribute in the html element. |
246 | 246 | * |
247 | 247 | * also see: mw.getConfig( 'embedPlayerAttributes' ) |
— | — | @@ -282,7 +282,7 @@ |
283 | 283 | /** |
284 | 284 | * EmbedPlayerManager |
285 | 285 | * |
286 | | -* Mannages calls to embed video interfaces |
| 286 | +* Manages calls to embed video interfaces |
287 | 287 | */ |
288 | 288 | var EmbedPlayerManager = function( ) { |
289 | 289 | // Create a Player Manage |
— | — | @@ -361,7 +361,9 @@ |
362 | 362 | // Load any skins we need then swap in the interface |
363 | 363 | mw.load( skinClassRequest, function() { |
364 | 364 | // Set the wait for meta flag |
365 | | - var waitForMeta = _this.waitForMetaCheck( element ); |
| 365 | + var waitForMeta = _this.waitForMetaCheck( element ); |
| 366 | + |
| 367 | + // We should move all playlist handling to add-in |
366 | 368 | switch( element.tagName.toLowerCase() ) { |
367 | 369 | case 'playlist': |
368 | 370 | // Make sure we have the necessary playlist libs loaded: |
— | — | @@ -2628,7 +2630,7 @@ |
2629 | 2631 | */ |
2630 | 2632 | isPlaying : function() { |
2631 | 2633 | if ( this.thumbnail_disp ) { |
2632 | | - // in stoped state |
| 2634 | + // in stopped state |
2633 | 2635 | return false; |
2634 | 2636 | } else if ( this.paused ) { |
2635 | 2637 | // paused state |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/nativeEmbed.js |
— | — | @@ -130,7 +130,7 @@ |
131 | 131 | * |
132 | 132 | * @param {Float} percentage |
133 | 133 | */ |
134 | | - doSeek:function( percentage ) { |
| 134 | + doSeek: function( percentage ) { |
135 | 135 | mw.log( 'native:seek:p: ' + percentage + ' : ' + this.supportsURLTimeEncoding() + ' dur: ' + this.getDuration() + ' sts:' + this.seek_time_sec ); |
136 | 136 | // @@todo check if the clip is loaded here (if so we can do a local seek) |
137 | 137 | if ( this.supportsURLTimeEncoding() ) { |