fixed seeking for player.
authorhamidouk
Tue, 31 Jan 2012 12:46:00 +0100
changeset 487 bf64db9fc5da
parent 486 71835c06c302
child 488 403f92f24144
child 489 871de507aa7b
fixed seeking for player.
src/ldt/ldt/static/ldt/js/LdtPlayer-release.js
--- a/src/ldt/ldt/static/ldt/js/LdtPlayer-release.js	Tue Jan 31 11:41:52 2012 +0100
+++ b/src/ldt/ldt/static/ldt/js/LdtPlayer-release.js	Tue Jan 31 12:46:00 2012 +0100
@@ -1486,7 +1486,7 @@
      
    }
   
-  this.trigger("seeked");  
+  this.trigger("seeked", event.offset);  
 };
 
 IriSP.PopcornReplacement.player.prototype.__playHandler = function(event) {
@@ -2339,7 +2339,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;
   }
@@ -2349,8 +2352,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 );
 };