diff -r f7de8a24fc74 -r 1997dae651c6 src/js/modules/mediafragment.js --- a/src/js/modules/mediafragment.js Tue Feb 14 17:13:44 2012 +0100 +++ b/src/js/modules/mediafragment.js Tue Feb 14 17:14:57 2012 +0100 @@ -40,7 +40,7 @@ this._serializer.sync(IriSP.wrap(this, function() { this.lookupAnnotation.call(this, annotationId); })); - } + } } }; @@ -62,6 +62,9 @@ } else { var ntime = time.toFixed(2); } + + // used to relay the new hash to the embedder + this._Popcorn.trigger("IriSP.Mediafragment.hashchange", "#t=" + ntime); splitArr = window.location.href.split( "#" ) history.replaceState( {}, "", splitArr[0] + "#t=" + ntime ); @@ -76,10 +79,15 @@ if ( !history.pushState ) { return false; } + + + // used to relay the new hash to the embedder + this._Popcorn.trigger("IriSP.Mediafragment.hashchange", "#id=" + annotationId); 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); };