r103531 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103530‎ | r103531 | r103532 >
Date:00:12, 18 November 2011
Author:dale
Status:ok
Tags:
Comment:
renamed doEmbedHTML to embedPlayerHTML and doSeek to seek
Modified paths:
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js (modified) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerGeneric.js (modified) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerJava.js (modified) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerKplayer.js (modified) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerNative.js (modified) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerVlc.js (modified) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.processEmbedPlayers.js (modified) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js (modified) (history)

Diff [purge]

Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerGeneric.js
@@ -22,7 +22,7 @@
2323 * @return {String}
2424 * embed code for generic ogg plugin
2525 */
26 - doEmbedHTML: function() {
 26+ embedPlayerHTML: function() {
2727 $( this ).html(
2828 '<object type="application/ogg" ' +
2929 'width="' + this.getWidth() + '" height="' + this.getHeight() + '" ' +
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
@@ -168,7 +168,7 @@
169169 // for more on CMML see: http://wiki.xiph.org/CMML
170170 'cmmlData': null,
171171
172 - // Stores the seek time request, Updated by the doSeek function
 172+ // Stores the seek time request, Updated by the seek function
173173 'serverSeekTime' : 0,
174174
175175 // If the embedPlayer is current 'seeking'
@@ -672,23 +672,23 @@
673673 /**
674674 * Get the plugin embed html ( should be implemented by embed player interface )
675675 */
676 - doEmbedHTML: function() {
677 - return 'Error: function doEmbedHTML should be implemented by embed player interface ';
 676+ embedPlayerHTML: function() {
 677+ return 'Error: function embedPlayerHTML should be implemented by embed player interface ';
678678 },
679679
680680 /**
681681 * Seek function ( should be implemented by embedPlayer interface
682 - * playerNative, playerKplayer etc. ) embedPlayer doSeek only handles URL
 682+ * playerNative, playerKplayer etc. ) embedPlayer seek only handles URL
683683 * time seeks
684684 */
685 - doSeek: function( percent ) {
 685+ seek: function( percent ) {
686686 var _this = this;
687687
688688 this.seeking = true;
689689
690690 // See if we should do a server side seek ( player independent )
691691 if ( this.supportsURLTimeEncoding() ) {
692 - mw.log( 'EmbedPlayer::doSeek:: updated serverSeekTime: ' + mw.seconds2npt ( this.serverSeekTime ) +
 692+ mw.log( 'EmbedPlayer::seek:: updated serverSeekTime: ' + mw.seconds2npt ( this.serverSeekTime ) +
693693 ' currentTime: ' + _this.currentTime );
694694 // make sure we need to seek:
695695 if( _this.currentTime == _this.serverSeekTime ){
@@ -1475,7 +1475,7 @@
14761476 this.posterDisplayed = false;
14771477 // Hide any button if present:
14781478 this.$interface.find( '.play-btn-large' ).remove();
1479 - this.doEmbedHTML();
 1479+ this.embedPlayerHTML();
14801480 }
14811481 }
14821482
@@ -1783,7 +1783,7 @@
17841784 _this.currentTime + " javascript based currentTime update to " +
17851785 seekPercent + ' == ' + _this.currentTime );
17861786 _this.previousTime = _this.currentTime;
1787 - this.doSeek( seekPercent );
 1787+ this.seek( seekPercent );
17881788 }
17891789 }
17901790 },
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js
@@ -1963,9 +1963,9 @@
19641964 var perc = ui.value / 1000;
19651965 // Set seek time (in case we have to do a url seek)
19661966 embedPlayer.seek_time_sec = mw.npt2seconds( embedPlayer.jump_time, true );
1967 - mw.log( 'do jump to: ' + embedPlayer.jump_time + ' perc:' + perc + ' sts:' + embedPlayer.seek_time_sec );
 1967+ mw.log( 'PlayerControlsBuilder:: Seek to: ' + embedPlayer.jump_time + ' perc:' + perc + ' sts:' + embedPlayer.seek_time_sec );
19681968 ctrlObj.setStatus( gM( 'mwe-embedplayer-seeking' ) );
1969 - embedPlayer.doSeek( perc );
 1969+ embedPlayer.seek( perc );
19701970 }
19711971 }
19721972 };
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerJava.js
@@ -29,7 +29,7 @@
3030 /**
3131 * Output the the embed html
3232 */
33 - doEmbedHTML: function () {
 33+ embedPlayerHTML: function () {
3434 var _this = this;
3535 mw.log( "java play url:" + this.getSrc( this.seek_time_sec ) );
3636
@@ -141,15 +141,15 @@
142142 *
143143 * @param {Float} percentage Percentage to seek into the stream
144144 */
145 - doSeek: function( percentage ) {
 145+ seek: function( percentage ) {
146146 mw.log( 'java:seek:p: ' + percentage + ' : ' + this.supportsURLTimeEncoding() + ' dur: ' + this.getDuration() + ' sts:' + this.seek_time_sec );
147147 this.getPlayerElement();
148148
149149 if ( this.supportsURLTimeEncoding() ) {
150 - this.parent_doSeek( percentage );
 150+ this.parent_seek( percentage );
151151 } else if ( this.playerElement ) {
152152 // do a (generally broken) local seek:
153 - mw.log( "Cortado seek is not very accurate :: doSeek::" + ( percentage * parseFloat( this.getDuration() ) ) );
 153+ mw.log( "Cortado seek is not very accurate :: seek::" + ( percentage * parseFloat( this.getDuration() ) ) );
154154 this.playerElement.currentTime = ( percentage * parseFloat( this.getDuration() ) );
155155 } else {
156156 this.doPlayThenSeek( percentage );
@@ -172,7 +172,7 @@
173173 _this.getPlayerElement();
174174 // if we have .jre ~in theory~ we can seek (but probably not)
175175 if ( _this.playerElement ) {
176 - _this.doSeek( perc );
 176+ _this.seek( perc );
177177 } else {
178178 // try to get player for 10 seconds:
179179 if ( rfsCount < 200 ) {
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.processEmbedPlayers.js
@@ -35,7 +35,7 @@
3636 *
3737 * _this.checkPlayerSources()
3838 * _this.setupSourcePlayer()
39 - * _this.inheritEmbedPlayer()
 39+ * _this.updatePlaybackInterface()
4040 * _this.selectedPlayer.load()
4141 * _this.showPlayer()
4242 *
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerVlc.js
@@ -37,7 +37,7 @@
3838 /**
3939 * Get embed HTML
4040 */
41 - doEmbedHTML: function() {
 41+ embedPlayerHTML: function() {
4242 var _this = this;
4343 $( this ).html(
4444 '<object classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" ' +
@@ -123,10 +123,10 @@
124124 *
125125 * @param {Float} percent Seek to this percent of the stream
126126 */
127 - doSeek : function( percent ) {
 127+ seek : function( percent ) {
128128 this.getPlayerElement();
129129 if ( this.supportsURLTimeEncoding() ) {
130 - this.parent_doSeek( percent );
 130+ this.parent_seek( percent );
131131 } else if ( this.playerElement ) {
132132 this.seeking = true;
133133 mw.log( "do vlc http seek to: " + percent )
@@ -156,7 +156,7 @@
157157 var newState = _this.playerElement.input.state;
158158 // if playing we are ready to do the
159159 if ( newState == 3 ) {
160 - _this.doSeek( percent );
 160+ _this.seek( percent );
161161 } else {
162162 // try to get player for 10 seconds:
163163 if ( rfsCount < 200 ) {
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerNative.js
@@ -84,7 +84,7 @@
8585 /**
8686 * Return the embed code
8787 */
88 - doEmbedHTML : function () {
 88+ embedPlayerHTML : function () {
8989 var _this = this;
9090
9191 // Reset some play state flags:
@@ -231,8 +231,8 @@
232232 *
233233 * @param {Float} percentage
234234 */
235 - doSeek: function( percentage ) {
236 - mw.log( 'Native::doSeek p: ' + percentage + ' : ' + this.supportsURLTimeEncoding() + ' dur: ' + this.getDuration() + ' sts:' + this.seek_time_sec );
 235+ seek: function( percentage ) {
 236+ mw.log( 'Native::seek p: ' + percentage + ' : ' + this.supportsURLTimeEncoding() + ' dur: ' + this.getDuration() + ' sts:' + this.seek_time_sec );
237237 this.seeking = true;
238238
239239 // Run the onSeeking interface update
@@ -246,7 +246,7 @@
247247 this.doNativeSeek( percentage );
248248 } else {
249249 // We support URLTimeEncoding call parent seek:
250 - this.parent_doSeek( percentage );
 250+ this.parent_seek( percentage );
251251 }
252252 } else if ( this.playerElement && this.playerElement.duration ) {
253253 // (could also check bufferedPercent > percentage seek (and issue oggz_chop request or not)
@@ -555,7 +555,7 @@
556556 // No vid loaded
557557 mw.log( 'native::load() ... doEmbed' );
558558 this.onlyLoadFlag = true;
559 - this.doEmbedHTML();
 559+ this.embedPlayerHTML();
560560 this.onLoadedCallback = callback;
561561 } else {
562562 // Should not happen offten
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayerKplayer.js
@@ -32,7 +32,7 @@
3333 /**
3434 * Write the Embed html to the target
3535 */
36 - doEmbedHTML : function() {
 36+ embedPlayerHTML : function() {
3737 var _this = this;
3838
3939 mw.log("kPlayer:: embed src::" + _this.getSrc());
@@ -216,17 +216,17 @@
217217 * @param {Float}
218218 * percentage Percentage of total stream length to seek to
219219 */
220 - doSeek: function( percentage ) {
 220+ seek: function( percentage ) {
221221 var _this = this;
222222 var seekTime = percentage * this.getDuration();
223 - mw.log( 'EmbedPlayerKalturaKplayer:: doSeek: ' + percentage + ' time:' + seekTime );
 223+ mw.log( 'EmbedPlayerKalturaKplayer:: seek: ' + percentage + ' time:' + seekTime );
224224 if (this.supportsURLTimeEncoding()) {
225225
226226 // Make sure we could not do a local seek instead:
227227 if (!(percentage < this.bufferedPercent
228228 && this.playerElement.duration && !this.didSeekJump)) {
229229 // We support URLTimeEncoding call parent seek:
230 - this.parent_doSeek( percentage );
 230+ this.parent_seek( percentage );
231231 return;
232232 }
233233 }

Status & tagging log