# HG changeset patch # User hamidouk # Date 1328007526 -3600 # Node ID e9ee522253959535e9e1741f09fdec55b6a97283 # Parent ec1f7aa873f4bda397166996807c50edda0474cf fixed seeking bug. diff -r ec1f7aa873f4 -r e9ee52225395 src/js/modules/mediafragment.js --- a/src/js/modules/mediafragment.js Tue Jan 31 11:58:26 2012 +0100 +++ b/src/js/modules/mediafragment.js Tue Jan 31 11:58:46 2012 +0100 @@ -40,7 +40,10 @@ } }; -IriSP.MediaFragment.prototype.updateTime = function() { +/** handler for the seeked signal. It may have or may have not an argument. + @param time if not undefined, the time we're seeking to +*/ +IriSP.MediaFragment.prototype.updateTime = function(time) { if (this.mutex === true) { return; } @@ -50,8 +53,15 @@ return false; } + + if (IriSP.null_or_undefined(time)) { + var ntime = this._Popcorn.currentTime().toFixed(2) + } else { + var ntime = time.toFixed(2); + } + splitArr = window.location.href.split( "#" ) - history.replaceState( {}, "", splitArr[0] + "#t=" + this._Popcorn.currentTime().toFixed( 2 ) ); + history.replaceState( {}, "", splitArr[0] + "#t=" + ntime ); }; @@ -67,6 +77,7 @@ splitArr = window.location.href.split( "#" ) history.replaceState( {}, "", splitArr[0] + "#id=" + annotationId); + // reset the mutex afterwards to prevent the module from reacting to his own changes. window.setTimeout(function() { _this.mutex = false }, 50); }; diff -r ec1f7aa873f4 -r e9ee52225395 src/js/pop.js --- a/src/js/pop.js Tue Jan 31 11:58:26 2012 +0100 +++ b/src/js/pop.js Tue Jan 31 11:58:46 2012 +0100 @@ -198,7 +198,7 @@ } - this.trigger("seeked"); + this.trigger("seeked", event.offset); }; IriSP.PopcornReplacement.player.prototype.__playHandler = function(event) {