r72746 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72745‎ | r72746 | r72747 >
Date:20:29, 10 September 2010
Author:dale
Status:deferred
Tags:
Comment:
* fixed monitor issue for sequencer
* fixed non-sequencer xml page preservation
Modified paths:
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/binPlayers/kaltura-player/kdp3.swf (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerNative.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/kskin/mw.style.PlayerSkinKskin.css (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBuffer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js
@@ -518,6 +518,8 @@
519519 );
520520 }
521521 })
 522+ // Strip any links for thumbs of player
 523+ $htmlLayout.find('a').attr('href', '#');
522524 }
523525
524526
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js
@@ -50,12 +50,13 @@
5151 // var relativeTime = time - smilElement.parentTimeOffset;
5252 var relativeTime = time - $j( smilElement ).data ( 'startOffset' );
5353 switch( _this.smil.getRefType( smilElement ) ){
 54+ case 'auido':
5455 case 'video':
55 - var vid = $j ( '#' + _this.smil.getSmilElementPlayerID( smilElement ) ).get( 0 );
56 - var vidTime = ( !vid || !vid.currentTime )? 0 : vid.currentTime;
57 - //mw.log( "getPlaybackSyncDelta:: video time should be: " + relativeTime + ' video time is: ' + vidTime );
 56+ var media = $j ( '#' + _this.smil.getSmilElementPlayerID( smilElement ) ).get( 0 );
 57+ var mediaTime = ( !media || !media.currentTime )? 0 : media.currentTime;
 58+ //mw.log( "getPlaybackSyncDelta:: mediaeo time should be: " + relativeTime + ' video time is: ' + vidTime );
5859
59 - var syncOffset = ( relativeTime -vidTime );
 60+ var syncOffset = ( relativeTime -mediaTime );
6061 if( syncOffset > maxOutOfSync ){
6162 maxOutOfSync = syncOffset;
6263 }
@@ -92,7 +93,8 @@
9394 // Check for special playback types that for playback animation action:
9495 if( this.smil.getRefType( smilElement ) == 'video'
9596 ||
96 - this.smil.getRefType( smilElement ) == 'audio' ){
 97+ this.smil.getRefType( smilElement ) == 'audio' )
 98+ {
9799 this.transformMediaForPlayback( smilElement, animateTime );
98100 }
99101
@@ -186,13 +188,17 @@
187189 * Transform Element in an inner animation loop
188190 */
189191 transformAnimateFrame: function( smilElement, animateTime ){
190 - // Video has no inner animation per-frame transforms
191 - if( this.smil.getRefType( smilElement ) != 'video' ){
 192+ // Audio / Video has no inner animation per-frame transforms
 193+ if( this.smil.getRefType( smilElement ) != 'video'
 194+ &&
 195+ this.smil.getRefType( smilElement ) != 'audio'
 196+ ){
192197 this.transformElement( smilElement, animateTime );
193198 }
194199 // Update the smil Element transition:
195200 this.smil.getTransitions().transformTransitionOverlay( smilElement, animateTime );
196201 },
 202+
197203 /**
198204 * Transform a smil element for a requested time.
199205 *
@@ -209,7 +215,8 @@
210216 this.transformImageForTime( smilElement, animateTime );
211217 break;
212218 case 'video':
213 - this.transformVideoForTime( smilElement, animateTime );
 219+ case 'audio':
 220+ this.transformMediaForTime( smilElement, animateTime );
214221 break;
215222 }
216223 },
@@ -219,24 +226,24 @@
220227 * @param {Element} smilElement Smil video element to be transformed
221228 * @param {time} animateTime Relative time to be transformed
222229 */
223 - transformVideoForTime: function( smilElement, animateTime, callback ){
 230+ transformMediaForTime: function( smilElement, animateTime, callback ){
224231 // Get the video element
225232 var assetId = this.smil.getSmilElementPlayerID( smilElement );
226233 var vid = $j ( '#' + assetId ).get( 0 );
227234
228 - var videoSeekTime = animateTime;
 235+ var mediaSeekTime = animateTime;
229236 //Add the clipBegin if set
230237 if( $j( smilElement ).attr( 'clipBegin') &&
231238 this.smil.parseTime( $j( smilElement ).attr( 'clipBegin') ) )
232239 {
233 - videoSeekTime += this.smil.parseTime( $j( smilElement ).attr( 'clipBegin') );
 240+ mediaSeekTime += this.smil.parseTime( $j( smilElement ).attr( 'clipBegin') );
234241 }
235242
236 - //mw.log( "SmilAnimate::transformVideoForTime:" + assetId + " ct:" +vid.currentTime + ' should be: ' + videoSeekTime );
 243+ //mw.log( "SmilAnimate::transformMediaForTime:" + assetId + " ct:" +vid.currentTime + ' should be: ' + mediaSeekTime );
237244
238245 // Register a buffer ready callback
239 - this.smil.getBuffer().mediaBufferSeek( smilElement, videoSeekTime, function() {
240 - //mw.log( "transformVideoForTime:: seek complete ")
 246+ this.smil.getBuffer().mediaBufferSeek( smilElement, mediaSeekTime, function() {
 247+ //mw.log( "transformMediaForTime:: seek complete ")
241248 if( callback )
242249 callback();
243250 });
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js
@@ -396,9 +396,9 @@
397397 );
398398 // Links go to a new window and are disable when smaller than player size
399399 $html.find('a').each( function(inx, link ){
400 - // escape link output as to not include scirpt execution
 400+ // Escape link output as to not include scirpt execution
401401 $j(link).attr('href',
402 - mw.escapeQuotesHTML( $j(link).attr('href') )
 402+ mw.escapeQuotesHTML( $j(link).attr('href') )
403403 )
404404 });
405405
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js
@@ -49,7 +49,7 @@
5050 /**
5151 * Put the embed player into the container
5252 */
53 - doEmbedPlayer: function() {
 53+ doEmbedHTML: function() {
5454 var _this = this;
5555
5656 // check if we have already embed the player:
@@ -57,10 +57,10 @@
5858 return;
5959 }
6060 this.smilPlayerEmbedded = true;
61 - mw.log("EmbedPlayerSmil::doEmbedPlayer: " + this.id + " time:" + this.smilPlayTime ) ;
 61+ mw.log("EmbedPlayerSmil::doEmbedHTML: " + this.id + " time:" + this.smilPlayTime ) ;
6262
6363 this.setCurrentTime( this.smilPlayTime, function(){
64 - mw.log("EmbedPlayerSmil::doEmbedPlayer:: render callback ready " );
 64+ mw.log("EmbedPlayerSmil::doEmbedHTML:: render callback ready " );
6565 });
6666 },
6767
@@ -148,10 +148,7 @@
149149 */
150150 play: function( playSegmentEndTime ){
151151 var _this = this;
152 - mw.log(" EmbedPlayerSmil::play " + _this.smilPlayTime + ' to ' + playSegmentEndTime + ' pause time: ' + this.smilPauseTime );
153 -
154 - // Set thumbnail_disp to false
155 - this.thumbnail_disp = false;
 152+ mw.log(" EmbedPlayerSmil::play " + _this.smilPlayTime + ' to ' + playSegmentEndTime + ' pause time: ' + this.smilPauseTime );
156153
157154 // Update clock start time
158155 _this.clockStartTime = new Date().getTime()
@@ -184,6 +181,9 @@
185182 // Zero out the pause time:
186183 _this.smilPauseTime = 0;
187184
 185+ // Set thumbnail_disp to false
 186+ this.thumbnail_disp = false;
 187+
188188 // Start up monitor:
189189 _this.monitor();
190190 });
@@ -236,7 +236,7 @@
237237 */
238238 monitor: function(){
239239 // Get a local variable of the new target time:
240 - //mw.log("smilPlayer::monitor: isPlaying:" + this.isPlaying() + ' pausedForBuffer:' + this.pausedForBuffer + ' playtime:' + this.smilPlayTime);
 240+ //mw.log("smilPlayer::monitor: isPlaying:" + this.isPlaying() + ' is stoped: ' + this.isStopped() + ' pausedForBuffer:' + this.pausedForBuffer + ' playtime:' + this.smilPlayTime);
241241
242242 // Check if we reached playSegmentEndTime and pause playback
243243 if( this.playSegmentEndTime && this.smilPlayTime >= this.playSegmentEndTime ) {
@@ -289,8 +289,7 @@
290290 // Issue an animate time request with monitorDelta
291291 this.smil.animateTime( this.smilPlayTime, this.monitorRate );
292292 }
293 -
294 -
 293+
295294 this.parent_monitor();
296295 },
297296
@@ -350,7 +349,7 @@
351350 return ;
352351 }
353352 // If no thumb could be found use the first frame of smil:
354 - this.doEmbedPlayer();
 353+ this.doEmbedHTML();
355354 },
356355
357356 /**
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBuffer.js
@@ -129,7 +129,7 @@
130130 // Loop on loading until all elements are loaded
131131 setTimeout( function(){
132132 if( _this.getBufferedPercent() == 1 ){
133 - mw.log( "smilBuffer::continueBufferLoad:: done loading buffer ");
 133+ mw.log( "smilBuffer::continueBufferLoad:: done loading buffer for " + bufferTime);
134134 return ;
135135 }
136136 // get the percentage buffered, translated into buffer time and call continueBufferLoad with a timeout
@@ -159,24 +159,25 @@
160160 // Start "loading" the asset (for now just video )
161161 // but in theory we could set something up with large images / templates etc.
162162 switch( this.smil.getRefType( smilElement ) ){
 163+ case 'audio':
163164 case 'video':
164 - var vid = $j( '#' + this.smil.getSmilElementPlayerID( smilElement ) ).get(0);
165 - if( !vid ){
 165+ var media = $j( '#' + this.smil.getSmilElementPlayerID( smilElement ) ).get(0);
 166+ if( !media ){
166167 break;
167168 }
168169 // The load request does not work very well instead .play() then .pause() and seek when on display
169 - // vid.load();
 170+ // media.load();
170171 // Since we can't use "load" across html5 implementations do some hacks:
171 - if( vid.paused && this.getVideoPercetLoaded( smilElement ) == 0 ){
 172+ if( media.paused && this.getMediaPercetLoaded( smilElement ) == 0 ){
172173 // Issue the load / play request
173 - vid.play();
174 - vid.volume = 0;
 174+ media.play();
 175+ media.volume = 0;
175176 // XXX seek to clipBegin if provided ( we don't need to load before that point )
176177 } else {
177178 //mw.log("loadElement:: pause video: " + this.smil.getSmilElementPlayerID( smilElement ));
178179 // else we have some percentage loaded pause playback
179180 //( should continue to load the asset )
180 - vid.pause();
 181+ media.pause();
181182 }
182183 break;
183184 }
@@ -188,11 +189,12 @@
189190 getElementPercentLoaded: function( smilElement ){
190191 switch( this.smil.getRefType( smilElement ) ){
191192 case 'video':
192 - return this.getVideoPercetLoaded( smilElement );
 193+ case 'audio':
 194+ return this.getMediaPercetLoaded( smilElement );
193195 break;
194196 }
195197 // for other ref types check if element is in the dom
196 - // xxx todo hook into image loader hook
 198+ // xxx todo hook into image / template loaders
197199 if( $j( '#' + this.smil.getSmilElementPlayerID( smilElement ) ).length == 0 ){
198200 return 0;
199201 } else {
@@ -203,7 +205,7 @@
204206 /**
205207 * Get the percentage of a video asset that has been loaded
206208 */
207 - getVideoPercetLoaded: function ( smilElement ){
 209+ getMediaPercetLoaded: function ( smilElement ){
208210 var _this = this;
209211 var assetId = this.smil.getSmilElementPlayerID( smilElement );
210212 var $vid = $j( '#' + assetId );
@@ -362,7 +364,7 @@
363365 }
364366 // Check if _this.videoLoadedPercent is in range of duration
365367 // xxx might need to take into consideration startOfsset
366 - if( _this.getVideoPercetLoaded( smilVideoElement ) > vid.duration / time ){
 368+ if( _this.getMediaPercetLoaded( smilVideoElement ) > vid.duration / time ){
367369 return true;
368370 }
369371 // not likely that the video is loaded for the requested time, return false
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js
@@ -128,7 +128,6 @@
129129 if ( $j( element ).attr( "id" ) == '' ) {
130130 $j( element ).attr( "id", 'v' + ( rewriteElementCount++ ) );
131131 }
132 -
133132 // Add an absolute positioned loader
134133 $j( element )
135134 .getAbsoluteOverlaySpinner()
@@ -163,10 +162,10 @@
164163 'mw.style.EmbedPlayer',
165164 '$j.cookie',
166165 // Add JSON lib if browsers does not define "JSON" natively
167 - 'JSON'
 166+ 'JSON',
 167+ '$j.widget'
168168 ],
169 - [
170 - '$j.widget',
 169+ [
171170 '$j.ui.mouse',
172171 '$j.fn.menu',
173172 'mw.style.jquerymenu',
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -167,6 +167,9 @@
168168 //( Global default via config EmbedPlayer.OverlayControls in module loader.js)
169169 "overlayControls" : true,
170170
 171+ // Attribute to use 'native' controls
 172+ "usenativecontrols" : false,
 173+
171174 // ROE url ( for xml based metadata )
172175 // also see: http://wiki.xiph.org/ROE
173176 "roe" : null,
@@ -302,7 +305,7 @@
303306 var height = ( attributes.height )? attributes.height : '100%';
304307 }
305308
306 - mw.log('EmbedPlayer:: set loading background img' + posterSrc);
 309+ mw.log('EmbedPlayer:: set loading background: ' + posterSrc);
307310 $j( playerElement ).append(
308311 $j( '<img />' )
309312 .attr( 'src', posterSrc)
@@ -332,9 +335,10 @@
333336 // Make sure we have user preference setup ( for setting preferences on video selection )
334337 mw.setupUserConfig( function() {
335338 // Add each selected element to the player manager:
336 - $j( playerSelect ).each( function( index, playerElement) {
 339+ $j( playerSelect ).each( function( index, playerElement) {
337340 // Make sure the video tag was not generated by our library:
338341 if( $j( playerElement ).hasClass( 'nativeEmbedPlayerPid' ) ){
 342+ $j('#loadingSpinner_' + $j( playerElement ).attr('id') ).hide();
339343 mw.log( 'EmbedPlayer::$j.embedPlayer skip embedPlayer gennerated video: ' + playerElement );
340344 } else {
341345 addedToPlayerManager = true;
@@ -519,7 +523,8 @@
520524 */
521525 waitForMetaCheck: function( playerElement ){
522526 var waitForMeta = false;
523 -
 527+ if( !playerElement )
 528+ return ;
524529 // If we don't have a native player don't wait for metadata
525530 if( !mw.EmbedTypes.players.isSupportedPlayer( 'oggNative') &&
526531 !mw.EmbedTypes.players.isSupportedPlayer( 'h264Native' ) )
@@ -603,8 +608,7 @@
604609 }
605610
606611 // Check if we are using native controls ( should keep the video embed around )
607 - // "wrap" the player interface
608 - if( playerInterface.useNativeControls() ) {
 612+ if( playerInterface.shouldUseNativeControls() ) {
609613 $j( targetElement )
610614 .attr('id', playerInterface.pid )
611615 .after(
@@ -623,7 +627,7 @@
624628
625629 // If we don't already have a loadSpiner add one:
626630 if( $j('#loadingSpinner_' + playerInterface.id ).length == 0 ){
627 - if( playerInterface.useNativeControls() ) {
 631+ if( playerInterface.shouldUseNativeControls() ) {
628632 $j( targetElement )
629633 .getAbsoluteOverlaySpinner()
630634 .attr('id', 'loadingSpinner_' + playerInterface.id )
@@ -1419,7 +1423,7 @@
14201424 }
14211425
14221426 // Hide "controls" if using native player controls:
1423 - if( this.useNativeControls() ){
 1427+ if( this.shouldUseNativeControls() ){
14241428 _this.controls = false;
14251429 }
14261430
@@ -1580,7 +1584,7 @@
15811585 */
15821586 resizePlayer: function( size , animate){
15831587 this.width = size.width;
1584 - this.hegith = size.height;
 1588+ this.height = size.height;
15851589 if( animate ){
15861590 $j(this).animate(size);
15871591 this.$interface.animate( size );
@@ -1978,56 +1982,9 @@
19791983 */
19801984 setCurrentTime: function( time, callback ) {
19811985 mw.log( 'Error: base embed setCurrentTime can not frame serve (override via plugin)' );
1982 - },
 1986+ },
19831987
19841988 /**
1985 - * Setup the embed player
1986 - * issues a loading request
1987 - */
1988 - doEmbedPlayer: function() {
1989 - mw.log( 'EmbedPlayer::doEmbedPlayer::' + this.selectedPlayer.id );
1990 - //mw.log( 'thum disp:' + this.thumbnail_disp );
1991 - var _this = this;
1992 -
1993 - var doEmbedPlayerLocal = function(){
1994 - // Set "loading" here ( if displaying controls )
1995 - if( ! _this.useNativeControls() ){
1996 - $j( _this ).html(
1997 - $j( '<div />' )
1998 - .css({
1999 - 'color' : 'black',
2000 - 'width' : _this.width + 'px',
2001 - 'height' : _this.height + 'px'
2002 - })
2003 - );
2004 - }
2005 -
2006 - // Reset some play state flags:
2007 - _this.bufferStartFlag = false;
2008 - _this.bufferEndFlag = false;
2009 -
2010 - // Make sure the player is
2011 - mw.log( 'EmbedPlayer::performing embed for ' + _this.id );
2012 - };
2013 -
2014 - // If no binded events, run the local doEmbedPlayer function directly:
2015 - if( $j( this ).data('events').length == 0 ){
2016 - doEmbedPlayerLocal();
2017 - } else {
2018 - // Trigger the doEmbedPlayer event / hook with callback
2019 - $j( this ).trigger( 'doEmbedPlayerEvent', function(){
2020 - //done
2021 - doEmbedPlayerLocal();
2022 - });
2023 - }
2024 -
2025 - // mw.log('should embed:' + embed_code);
2026 - _this.doEmbedHTML()
2027 - },
2028 -
2029 -
2030 -
2031 - /**
20321989 * On clip done action. Called once a clip is done playing
20331990 */
20341991 onClipDone: function() {
@@ -2100,7 +2057,7 @@
21012058 this.controlBuilder.addControlBindings();
21022059
21032060 // Once the thumbnail is shown run the mediaReady trigger (if not using native controls)
2104 - if( !this.useNativeControls() ){
 2061+ if( !this.shouldUseNativeControls() ){
21052062 mw.log("mediaLoaded");
21062063 $j( this ).trigger( 'mediaLoaded' );
21072064 }
@@ -2378,7 +2335,7 @@
23792336 var style_atr = '';
23802337
23812338
2382 - if( this.useNativeControls() ){
 2339+ if( this.shouldUseNativeControls() ){
23832340 this.showNativePlayer();
23842341 return ;
23852342 }
@@ -2419,7 +2376,11 @@
24202377 * @returns boolean true if the mwEmbed player interface should be used
24212378 * false if the mwEmbed player interface should not be used
24222379 */
2423 - useNativeControls: function() {
 2380+ shouldUseNativeControls: function() {
 2381+ if( this.usenativecontrols === true ){
 2382+ return true;
 2383+ }
 2384+
24242385 if( mw.getConfig('EmbedPlayer.NativeControls') === true ) {
24252386 return true;
24262387 }
@@ -2447,31 +2408,31 @@
24482409 // Remove the player loader spinner if it exists
24492410 $j('#loadingSpinner_' + this.id ).remove();
24502411
 2412+
24512413 // Check if we need to refresh mobile safari
2452 - /*var mobileSafairNeedsRefresh = false;
2453 - if( $j( '#' + this.pid ).attr('controls') === false ){
2454 - mobileSafairNeedsRefresh = true;
2455 - }*/
 2414+ var mobileSafairNeedsRefresh = false;
24562415
2457 - // For now always refersh ( buggy display control behavior in iPad )
2458 - mobileSafairNeedsRefresh = true;
24592416
24602417 // Unhide the original video element
2461 - $j( '#' + this.pid )
2462 - .css( {
2463 - 'position' : 'absolute'
2464 - } )
2465 - .show()
2466 - .attr('controls', 'true');
 2418+ if( !$j( '#' + this.pid ).hasClass('PlayerThemer') ){
 2419+ $j( '#' + this.pid )
 2420+ .css( {
 2421+ 'position' : 'absolute'
 2422+ } )
 2423+ .show()
 2424+ .attr('controls', 'true');
 2425+
 2426+ mobileSafairNeedsRefresh = true;
 2427+ }
24672428
24682429 // iPad does not handle video tag update for attributes like "controls"
24692430 // so we have to do a full replace ( if controls are not included initially )
24702431 if( mw.isMobileSafari() && mobileSafairNeedsRefresh ) {
24712432 var source = this.mediaElement.getSources( 'video/h264' )[0];
2472 - if( ! source.src ){
 2433+ if( source && ! source.src ){
24732434 mw.log( 'Error: should have caught no playable sources for mobile safari earlier' );
2474 - }
2475 -
 2435+ }
 2436+
24762437 var videoAttribues = {
24772438 'id' : _this.pid,
24782439 'poster': _this.poster,
@@ -2693,7 +2654,8 @@
26942655 */
26952656 play: function() {
26962657 var _this = this;
2697 - mw.log( "EmbedPlayer:: play" );
 2658+ mw.log( "EmbedPlayer:: play" );
 2659+
26982660 // Hide any overlay:
26992661 this.controlBuilder.closeMenuOverlay();
27002662
@@ -2702,17 +2664,24 @@
27032665 if ( !this.selectedPlayer ) {
27042666 mw.log( 'no selectedPlayer' );
27052667 this.showPluginMissingHTML();
 2668+ return;
27062669 } else {
27072670 this.thumbnail_disp = false;
2708 - this.paused = false;
2709 - this.doEmbedPlayer();
 2671+ this.doEmbedHTML();
27102672 }
27112673 } else {
27122674 // the plugin is already being displayed
2713 - this.paused = false; // make sure we are not "paused"
27142675 this.seeking = false;
27152676 }
27162677
 2678+ // Run play hook (if we were previously in paused state )
 2679+ if( this.paused ){
 2680+ this.paused = false;
 2681+ mw.log("trigger play event::");
 2682+ $j( this ).trigger( 'play' );
 2683+ }
 2684+
 2685+
27172686 this.$interface.find('.play-btn span')
27182687 .removeClass( 'ui-icon-play' )
27192688 .addClass( 'ui-icon-pause' );
@@ -2724,15 +2693,8 @@
27252694 _this.pause();
27262695 } )
27272696 .attr( 'title', gM( 'mwe-embedplayer-pause_clip' ) );
2728 -
2729 -
2730 - // Run play hook:
2731 - mw.log("playEvent");
2732 - $j( this ).trigger( 'playEvent' );
 2697+
27332698
2734 - // Start monitor
2735 - this.monitor();
2736 -
27372699 // If we previously finished playing this clip run the "replay hook"
27382700 if( this.donePlayingCount > 0 ) {
27392701 mw.log("replayEvent");
@@ -2758,12 +2720,12 @@
27592721 */
27602722 pause: function( event ) {
27612723 var _this = this;
 2724+ // only trigger the pause event if not already in paused state:
27622725 if( this.paused === false ){
27632726 this.paused = true;
27642727 mw.log('EmbedPlayer:trigger pause');
27652728 $j( this ).trigger('pause');
2766 - }
2767 - mw.log('mwEmbed:embedPlayer::pause() ');
 2729+ }
27682730
27692731 // update the ctrl "paused state"
27702732 this.$interface.find('.play-btn span' )
@@ -2813,8 +2775,6 @@
28142776 this.showThumbnail();
28152777 this.bufferedPercent = 0; // reset buffer state
28162778 this.controlBuilder.setStatus( this.getTimeRange() );
2817 - // stop monitor:
2818 - this.monitorInterval = null;
28192779
28202780 // Reset the playhead
28212781 mw.log("EmbedPlayer::Stop:: Reset play head")
@@ -2869,7 +2829,8 @@
28702830 // Update the playerElement volume
28712831 this.setPlayerElementVolume( percent );
28722832
2873 - //mw.log(" setVolume:: " + percent + ' this.volume is: ' + this.volume);
 2833+ //mw.log(" setVolume:: " + percent + ' this.volume is: ' + this.volume);
 2834+ $j( this ).trigger('volumeChanged', percent );
28742835 },
28752836
28762837 /**
@@ -2998,7 +2959,7 @@
29992960
30002961 // Update currentTime via embedPlayer
30012962 _this.currentTime = _this.getPlayerElementTime();
3002 -
 2963+
30032964 // Update any offsets from server seek
30042965 if( _this.serverSeekTime && _this.supportsURLTimeEncoding ){
30052966 _this.currentTime = _this.serverSeekTime + _this.getPlayerElementTime()
@@ -3010,8 +2971,9 @@
30112972
30122973 // Check if volume was set outside of embed player function
30132974 //mw.log( ' this.volume: ' + _this.volume + ' prev Volume:: ' + _this.previousVolume );
3014 - if( _this.volume != _this.previousVolume ) {
 2975+ if( _this.volume != _this.previousVolume ) {
30152976 _this.setInterfaceVolume( _this.volume );
 2977+ $j( this ).trigger('volumeChanged', _this.volume );
30162978 }
30172979
30182980 // Update the previous volume
@@ -3022,7 +2984,7 @@
30232985
30242986 // update the mute state from the player element
30252987 if( _this.muted != _this.getPlayerElementMuted() ){
3026 - mw.log("monitor:: muted does not match embed player" );
 2988+ mw.log("monitor:: muted does not mach embed player" );
30272989 _this.toggleMute();
30282990 // Make sure they match:
30292991 _this.muted = _this.getPlayerElementMuted();
@@ -3075,17 +3037,21 @@
30763038 }
30773039
30783040 // Call monitor at 250ms interval. ( use setInterval to avoid stacking monitor requests )
3079 - if( ! this.isStopped() ) {
 3041+ //mw.log("EmbedPlayer::monitor: continue?:" + !this.isStopped() + ' monitorInterval: ' + this.monitorInterval );
 3042+ if( ! this.isStopped() ) {
30803043 if( !this.monitorInterval ){
 3044+
30813045 this.monitorInterval = setInterval( function(){
3082 - if( _this.monitor )
 3046+ mw.log("monitorInterval!!");
 3047+ if( _this.monitor ){
30833048 _this.monitor();
 3049+ }
30843050 }, this.monitorRate )
30853051 }
30863052 } else {
3087 - //mw.log("EmbedPlayer::monitor: player is stoped, stop monitor")
30883053 // If stopped "stop" monitor:
30893054 clearInterval( this.monitorInterval );
 3055+ this.monitorInterval = 0;
30903056 }
30913057
30923058 //mw.log('trigger:monitor:: ' + this.currentTime );
@@ -3116,6 +3082,7 @@
31173083 $buffer.css({
31183084 "width" : ( this.bufferedPercent * 100 ) + '%'
31193085 });
 3086+ $j( this ).trigger( 'updateBufferPercent', this.bufferedPercent );
31203087 } else {
31213088 $buffer.css( "width", '0px' );
31223089 }
@@ -3139,12 +3106,14 @@
31403107 *
31413108 * @param {Float} perc Value between 0 and 1 for position of playhead
31423109 */
3143 - updatePlayHead: function( perc ) {
 3110+ updatePlayHead: function( perc ) {
31443111 $playHead = this.$interface.find( '.play_head' );
31453112 if ( this.controls && $playHead.length != 0 ) {
31463113 var val = parseInt( perc * 1000 );
31473114 $playHead.slider( 'value', val );
3148 - }
 3115+ }
 3116+ // @@todo should fix this name:
 3117+ $j(this).trigger('updatePlayHeadPercent', perc);
31493118 },
31503119
31513120 /**
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/kskin/mw.style.PlayerSkinKskin.css
@@ -319,7 +319,7 @@
320320 height: 15px;
321321 overflow: hidden;
322322 padding-left: 2px;
323 - width: 100%;
 323+ width: 95%;
324324 }
325325
326326 .menu-screen.menu-share button {
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js
@@ -1604,11 +1604,10 @@
16051605 'w' : 100,
16061606 'o' : function( ctrlObj ) {
16071607 return $j( '<div />' )
1608 - .addClass( "ui-widget time-disp" )
1609 - .append(
1610 - ctrlObj.embedPlayer.getTimeRange()
1611 - )
1612 -
 1608+ .addClass( "ui-widget time-disp" )
 1609+ .append(
 1610+ ctrlObj.embedPlayer.getTimeRange()
 1611+ )
16131612 }
16141613 },
16151614
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/binPlayers/kaltura-player/kdp3.swf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerNative.js
@@ -57,10 +57,14 @@
5858 doEmbedHTML : function () {
5959 var _this = this;
6060
 61+ // Reset some play state flags:
 62+ _this.bufferStartFlag = false;
 63+ _this.bufferEndFlag = false;
 64+
6165 mw.log( "native play url:" + this.getSrc() + ' startOffset: ' + this.start_ntp + ' end: ' + this.end_ntp );
6266
6367 // Check if using native controls and already the "pid" is already in the DOM
64 - if( this.useNativeControls && $j( '#' + this.pid ).length &&
 68+ if( this.shouldUseNativeControls() && $j( '#' + this.pid ).length &&
6569 typeof $j( '#' + this.pid ).get(0).play != 'undefined' ) {
6670 _this.postEmbedJS();
6771 return ;
@@ -435,7 +439,7 @@
436440 // No vid loaded
437441 mw.log( 'native::load() ... doEmbed' );
438442 this.onlyLoadFlag = true;
439 - this.doEmbedPlayer();
 443+ this.doEmbedHTML();
440444 this.onLoadedCallback = callback;
441445 } else {
442446 // Should not happen offten
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js
@@ -142,7 +142,7 @@
143143 'pageStart' : pageText.substring(0, pageText.indexOf( startKey ) ),
144144 'sequenceXML' : pageText.substring( pageText.indexOf( startKey ) + startKey.length,
145145 pageText.indexOf(endKey ) ),
146 - 'pageEnd' : pageText.substring( pageText.indexOf(endKey) )
 146+ 'pageEnd' : pageText.substring( pageText.indexOf(endKey) + endKey.length )
147147 }
148148 },
149149

Status & tagging log