Index: branches/js2-work/phase3/js/mwEmbed/tests/Playlist_Render.html |
— | — | @@ -44,9 +44,9 @@ |
45 | 45 | </script> |
46 | 46 | </head> |
47 | 47 | <body> |
48 | | -<!-- <playlist id="render_player" src="media/sample_smil.xml" controls="false" width="320" height="240"></playlist> --> |
| 48 | +<playlist id="render_player" src="media/sample_smil.xml" controls="false" width="320" height="240"></playlist> |
49 | 49 | |
50 | | - |
| 50 | + <!-- |
51 | 51 | <video id="render_player" |
52 | 52 | durationHint="5" |
53 | 53 | src="http://upload.wikimedia.org/wikipedia/commons/4/41/Panthera_tigris8.ogg" |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | controls="false" |
56 | 56 | poster="http://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Panthera_tigris8.ogg/mid-Panthera_tigris8.ogg.jpg"> |
57 | 57 | </video> |
58 | | - |
| 58 | + --> |
59 | 59 | |
60 | 60 | <span id="loading_text" style="position:absolute; top:320px;"> |
61 | 61 | loading render system <blink>...</blink> |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js |
— | — | @@ -1610,9 +1610,9 @@ |
1611 | 1611 | }, |
1612 | 1612 | |
1613 | 1613 | /** |
1614 | | - * Searches for related clipes from titleKey |
| 1614 | + * Searches for related clips from titleKey |
1615 | 1615 | */ |
1616 | | - getRelatedFromTitleKey:function() { |
| 1616 | + getRelatedFromTitleKey: function() { |
1617 | 1617 | var _this = this; |
1618 | 1618 | var request = { |
1619 | 1619 | //normalize the File NS (ie sometimes its present in wikiTitleKey other times not |
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/nativeEmbed.js |
— | — | @@ -182,6 +182,9 @@ |
183 | 183 | |
184 | 184 | /** |
185 | 185 | * Set the current time with a callback |
| 186 | + * |
| 187 | + * @param {Float} position Seconds to set the time to |
| 188 | + * @param {Function} callback Function called once time has been set. |
186 | 189 | */ |
187 | 190 | setCurrentTime: function( position , callback ) { |
188 | 191 | var _this = this; |
— | — | @@ -222,21 +225,8 @@ |
223 | 226 | mw.log( 'could not find video embed: ' + this.id + ' stop monitor' ); |
224 | 227 | this.stopMonitor(); |
225 | 228 | return false; |
226 | | - } |
227 | | - // don't update status if we are not the current clip |
228 | | - // (playlist leakage?) .. should move to playlist overwrite of monitor? |
229 | | - if ( this.pc ) { |
230 | | - if ( this.pc.pp.cur_clip.id != this.pc.id ) |
231 | | - return true; |
232 | | - } |
233 | | - |
234 | | - // Do a seek check (on seeked does not seem fire consistently) |
235 | | - if ( this.prevCurrentTime != -1 && this.prevCurrentTime != 0 |
236 | | - && this.prevCurrentTime < this.currentTime && this.seeking ) |
237 | | - this.seeking = false; |
238 | | - |
239 | | - this.prevCurrentTime = this.currentTime; |
240 | | - |
| 229 | + } |
| 230 | + |
241 | 231 | // update currentTime |
242 | 232 | this.currentTime = this.playerElement.currentTime; |
243 | 233 | |
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.FirefoggRender.js |
— | — | @@ -108,38 +108,32 @@ |
109 | 109 | // Start rendering |
110 | 110 | startRender: function() { |
111 | 111 | var _this = this; |
| 112 | + |
| 113 | + // Set the render time to "start_time" of the render request |
112 | 114 | this.render_time = this.start_time; |
113 | | - // get the interval from renderOptions framerate |
| 115 | + |
| 116 | + // Get the interval from renderOptions framerate |
114 | 117 | this.interval = 1 / this.renderOptions.framerate |
115 | 118 | |
| 119 | + // Set the continue rendering flag to true: |
| 120 | + this.continue_rendering = true; |
| 121 | + |
116 | 122 | // Get the player: |
117 | 123 | this.player = $j( this.player_target ).get( 0 ); |
118 | | - |
119 | | - |
120 | | - |
121 | | - // Set a target file |
122 | | - |
123 | | - // init the Render |
124 | | - mw.log( "starting render with: " + JSON.stringify( _this.renderOptions ) ); |
| 124 | + |
| 125 | + // Set a target file: |
| 126 | + mw.log( "Firefogg Render Settings:" + JSON.stringify( _this.renderOptions ) ); |
125 | 127 | this.fogg.initRender( JSON.stringify( _this.renderOptions ), 'foggRender.ogv' ); |
126 | 128 | |
127 | 129 | $j( this.target_timeStatus ).val( "loading player" ); |
128 | | - |
129 | | - |
130 | | - // add audio if we had any: |
131 | | - |
132 | | - // request a target (should support rendering to temp location too) |
133 | | - //this.fogg.saveVideoAs(); |
134 | | - |
135 | | - // set the continue rendering flag to true: |
136 | | - this.continue_rendering = true; |
137 | 130 | |
138 | | - |
| 131 | + // add audio if we had any: |
| 132 | + |
139 | 133 | // issue a load request on the player: |
140 | 134 | this.player.load(function(){ |
141 | 135 | $j( this.target_timeStatus ).val( "player ready" ); |
142 | 136 | //now issue the save video as call (to avoid running "expired" code |
143 | | - _this.fogg.saveVideoAs(); |
| 137 | + //_this.fogg.saveVideoAs(); |
144 | 138 | _this.doNextFrame(); |
145 | 139 | }); |
146 | 140 | }, |
— | — | @@ -151,7 +145,7 @@ |
152 | 146 | |
153 | 147 | _this.player.setCurrentTime( _this.render_time, function() { |
154 | 148 | //mw.log( 'addFrame:' + $j( _this.player_target ).attr( 'id' ) ); |
155 | | - _this.fogg.addFrame( $j( _this.player_target ).attr( 'id' ) ); |
| 149 | + //_this.fogg.addFrame( $j( _this.player_target ).attr( 'id' ) ); |
156 | 150 | _this.render_time += _this.interval; |
157 | 151 | if ( _this.render_time >= _this.player.getDuration() ) { |
158 | 152 | _this.doFinalRender(); |
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.PlayList.js |
— | — | @@ -294,14 +294,14 @@ |
295 | 295 | return this.pl_duration; |
296 | 296 | }, |
297 | 297 | getTimeRange:function() { |
298 | | - // playlist does not really support time request atm ( in theory in the future we could embed playlists with temporal urls) |
| 298 | + // playlist does not really support time request atm |
299 | 299 | return '0:0:0/' + mw.seconds2npt( this.getDuration() ); |
300 | 300 | }, |
301 | 301 | getDataSource:function() { |
302 | 302 | mw.log( "f:getDataSource " + this.src ); |
303 | 303 | // determine the type / first is it m3u or xml? |
304 | 304 | var pl_parent = this; |
305 | | - this.makeURLAbsolute(); |
| 305 | + this.src = mw.absoluteUrl( this.src ); |
306 | 306 | if ( this.src != null ) { |
307 | 307 | mw.getMvJsonUrl( this.src, function( data ) { |
308 | 308 | pl_parent.data = data; |
— | — | @@ -366,19 +366,6 @@ |
367 | 367 | } |
368 | 368 | } |
369 | 369 | }, |
370 | | - // simple function to make a path into an absolute url if its not already |
371 | | - makeURLAbsolute:function() { |
372 | | - if ( this.src ) { |
373 | | - if ( this.src.indexOf( '://' ) == -1 ) { |
374 | | - var purl = mw.parseUri( document.URL ); |
375 | | - if ( this.src.charAt( 0 ) == '/' ) { |
376 | | - this.src = purl.protocol + '://' + purl.host + this.src; |
377 | | - } else { |
378 | | - this.src = purl.protocol + '://' + purl.host + purl.directory + this.src; |
379 | | - } |
380 | | - } |
381 | | - } |
382 | | - }, |
383 | 370 | // set up minimal media_element emulation: |
384 | 371 | media_element: { |
385 | 372 | selected_source: { |
— | — | @@ -419,6 +406,10 @@ |
420 | 407 | } |
421 | 408 | } |
422 | 409 | }, |
| 410 | + |
| 411 | + /** |
| 412 | + * Shows the playlist player |
| 413 | + */ |
423 | 414 | showPlayer:function() { |
424 | 415 | mw.log( 'pl:showPlayer:: track length: ' + this.default_track.getClipCount() ); |
425 | 416 | var _this = this; |
— | — | @@ -809,9 +800,10 @@ |
810 | 801 | /* |
811 | 802 | * the load function loads all the clips in order |
812 | 803 | */ |
813 | | - load:function() { |
| 804 | + load:function( callback ) { |
814 | 805 | // do nothing right now) |
815 | | - alert('load pl'); |
| 806 | + //alert('load pl'); |
| 807 | + callback(); |
816 | 808 | }, |
817 | 809 | toggleMute:function() { |
818 | 810 | this.cur_clip.embed.toggleMute(); |