r60487 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60486‎ | r60487 | r60488 >
Date:01:52, 30 December 2009
Author:dale
Status:deferred
Tags:
Comment:
minor playlist comments and refactor
Modified paths:
  • /branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/nativeEmbed.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.FirefoggRender.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.PlayList.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/tests/Playlist_Render.html (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/tests/Playlist_Render.html
@@ -44,9 +44,9 @@
4545 </script>
4646 </head>
4747 <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>
4949
50 -
 50+ <!--
5151 <video id="render_player"
5252 durationHint="5"
5353 src="http://upload.wikimedia.org/wikipedia/commons/4/41/Panthera_tigris8.ogg"
@@ -54,7 +54,7 @@
5555 controls="false"
5656 poster="http://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Panthera_tigris8.ogg/mid-Panthera_tigris8.ogg.jpg">
5757 </video>
58 -
 58+ -->
5959
6060 <span id="loading_text" style="position:absolute; top:320px;">
6161 loading render system <blink>...</blink>
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -1610,9 +1610,9 @@
16111611 },
16121612
16131613 /**
1614 - * Searches for related clipes from titleKey
 1614+ * Searches for related clips from titleKey
16151615 */
1616 - getRelatedFromTitleKey:function() {
 1616+ getRelatedFromTitleKey: function() {
16171617 var _this = this;
16181618 var request = {
16191619 //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 @@
183183
184184 /**
185185 * 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.
186189 */
187190 setCurrentTime: function( position , callback ) {
188191 var _this = this;
@@ -222,21 +225,8 @@
223226 mw.log( 'could not find video embed: ' + this.id + ' stop monitor' );
224227 this.stopMonitor();
225228 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+
241231 // update currentTime
242232 this.currentTime = this.playerElement.currentTime;
243233
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.FirefoggRender.js
@@ -108,38 +108,32 @@
109109 // Start rendering
110110 startRender: function() {
111111 var _this = this;
 112+
 113+ // Set the render time to "start_time" of the render request
112114 this.render_time = this.start_time;
113 - // get the interval from renderOptions framerate
 115+
 116+ // Get the interval from renderOptions framerate
114117 this.interval = 1 / this.renderOptions.framerate
115118
 119+ // Set the continue rendering flag to true:
 120+ this.continue_rendering = true;
 121+
116122 // Get the player:
117123 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 ) );
125127 this.fogg.initRender( JSON.stringify( _this.renderOptions ), 'foggRender.ogv' );
126128
127129 $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;
137130
138 -
 131+ // add audio if we had any:
 132+
139133 // issue a load request on the player:
140134 this.player.load(function(){
141135 $j( this.target_timeStatus ).val( "player ready" );
142136 //now issue the save video as call (to avoid running "expired" code
143 - _this.fogg.saveVideoAs();
 137+ //_this.fogg.saveVideoAs();
144138 _this.doNextFrame();
145139 });
146140 },
@@ -151,7 +145,7 @@
152146
153147 _this.player.setCurrentTime( _this.render_time, function() {
154148 //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' ) );
156150 _this.render_time += _this.interval;
157151 if ( _this.render_time >= _this.player.getDuration() ) {
158152 _this.doFinalRender();
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.PlayList.js
@@ -294,14 +294,14 @@
295295 return this.pl_duration;
296296 },
297297 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
299299 return '0:0:0/' + mw.seconds2npt( this.getDuration() );
300300 },
301301 getDataSource:function() {
302302 mw.log( "f:getDataSource " + this.src );
303303 // determine the type / first is it m3u or xml?
304304 var pl_parent = this;
305 - this.makeURLAbsolute();
 305+ this.src = mw.absoluteUrl( this.src );
306306 if ( this.src != null ) {
307307 mw.getMvJsonUrl( this.src, function( data ) {
308308 pl_parent.data = data;
@@ -366,19 +366,6 @@
367367 }
368368 }
369369 },
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 - },
383370 // set up minimal media_element emulation:
384371 media_element: {
385372 selected_source: {
@@ -419,6 +406,10 @@
420407 }
421408 }
422409 },
 410+
 411+ /**
 412+ * Shows the playlist player
 413+ */
423414 showPlayer:function() {
424415 mw.log( 'pl:showPlayer:: track length: ' + this.default_track.getClipCount() );
425416 var _this = this;
@@ -809,9 +800,10 @@
810801 /*
811802 * the load function loads all the clips in order
812803 */
813 - load:function() {
 804+ load:function( callback ) {
814805 // do nothing right now)
815 - alert('load pl');
 806+ //alert('load pl');
 807+ callback();
816808 },
817809 toggleMute:function() {
818810 this.cur_clip.embed.toggleMute();

Status & tagging log