r72766 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72765‎ | r72766 | r72767 >
Date:23:09, 10 September 2010
Author:dale
Status:deferred
Tags:
Comment:
don't include audio seeking in frame-by-frame playback
Modified paths:
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js
@@ -213,11 +213,13 @@
214214 break;
215215 case 'img':
216216 this.transformImageForTime( smilElement, animateTime );
217 - break;
 217+ break;
218218 case 'video':
219 - case 'audio':
220219 this.transformMediaForTime( smilElement, animateTime );
221220 break;
 221+ case 'audio':
 222+ // audio has no frame transform ( only playback )
 223+ break;
222224 }
223225 },
224226
@@ -253,30 +255,30 @@
254256 * Used to support video playback
255257 */
256258 transformMediaForPlayback: function( smilElement, animateTime ){
257 - var $vid = $j ( '#' + this.smil.getSmilElementPlayerID( smilElement ) );
 259+ var $media = $j ( '#' + this.smil.getSmilElementPlayerID( smilElement ) );
258260
259261 // Set activePlayback flag ( informs edit and buffer actions )
260262 $j( smilElement ).data('activePlayback', true)
261263
262264 // Make the video is being displayed and get a pointer to the video element:
263 - var vid = $vid.show().get( 0 );
 265+ var media = $media.show().get( 0 );
264266
265267 // Set volume to master volume
266 - vid.volume = this.smil.embedPlayer.volume;
 268+ media.volume = this.smil.embedPlayer.volume;
267269
268270 // Seek to correct time if off by more than 1 second
269271 // ( buffer delays management things insync below this range )
270272
271273 // Check the buffer if we can play this time and the video is "paused" ( if so start playback )
272274 if( this.smil.getBuffer().canPlayTime( smilElement, animateTime )
273 - && vid.paused
 275+ && media.paused
274276 ) {
275277 //mw.log( "transformMediaForPlayback:: should play:" + animateTime );
276 - vid.play();
 278+ media.play();
277279 return ;
278280 }
279281 // Else issue the initial "play" request
280 - vid.play();
 282+ media.play();
281283 },
282284
283285 /**
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js
@@ -108,7 +108,7 @@
109109 _this.currentSequencePage = _this.parseSequencerPage( smilPage );
110110 // Cache the latest serverSmil ( for local change checks )
111111 // ( save requests automatically respond with warnings on other user updates )
112 - _this.serverSmilXml =_this.currentSequencePage.sequenceXML;
 112+ _this.serverSmilXml = _this.currentSequencePage.sequenceXML ;
113113
114114 // Cache the pre / post bits
115115
@@ -121,7 +121,7 @@
122122 _this.currentSequencePage.pageStart ="\nTo edit this sequence " +
123123 '[{{fullurl:{{FULLPAGENAME}}|withJS=MediaWiki:MwEmbed.js}} enable the sequencer] for this page';
124124 }
125 - return _this.currentSequencePage.pageStart +
 125+ return _this.currentSequencePage.pageStart +
126126 "\n\n<!-- " + SEQUENCER_PAYLOADKEY + "\n" +
127127 xmlString +
128128 "\n\n " + SEQUENCER_PAYLOADKEY + " -->\n" +
@@ -139,10 +139,17 @@
140140 }
141141 // trim the output:
142142 return {
143 - 'pageStart' : pageText.substring(0, pageText.indexOf( startKey ) ),
144 - 'sequenceXML' : pageText.substring( pageText.indexOf( startKey ) + startKey.length,
145 - pageText.indexOf(endKey ) ),
146 - 'pageEnd' : pageText.substring( pageText.indexOf(endKey) + endKey.length )
 143+ 'pageStart' : $j.trim(
 144+ pageText.substring(0, pageText.indexOf( startKey ) )
 145+ ),
 146+ 'sequenceXML' : $j.trim(
 147+ pageText.substring( pageText.indexOf( startKey ) + startKey.length,
 148+ pageText.indexOf(endKey )
 149+ )
 150+ ),
 151+ 'pageEnd' : $j.trim(
 152+ pageText.substring( pageText.indexOf(endKey) + endKey.length )
 153+ )
147154 }
148155 },
149156

Status & tagging log