# HG changeset patch # User verrierj # Date 1328020861 -3600 # Node ID f48e7b755b61f375d827ad64c23889e8485ecf39 # Parent b0da8cecb6b36065121c295a6a1b5be2aa247c4a# Parent 501c005917394468865fbffcabba428baf31b781 Merge with 501c005917394468865fbffcabba428baf31b781 diff -r b0da8cecb6b3 -r f48e7b755b61 src/ldt/ldt/static/ldt/js/LdtPlayer-release.js --- a/src/ldt/ldt/static/ldt/js/LdtPlayer-release.js Tue Jan 31 15:40:42 2012 +0100 +++ b/src/ldt/ldt/static/ldt/js/LdtPlayer-release.js Tue Jan 31 15:41:01 2012 +0100 @@ -1486,6 +1486,8 @@ } + /* this signal sends as an extra argument the position in the video. + As far as I know, this argument is not provided by popcorn */ this.trigger("seeked", event.offset); }; @@ -2351,9 +2353,8 @@ if ( !history.pushState ) { return false; } - - - if (IriSP.null_or_undefined(time)) { + + if (IriSP.null_or_undefined(time) || typeof(time) != "number") { var ntime = this._Popcorn.currentTime().toFixed(2) } else { var ntime = time.toFixed(2); @@ -2497,6 +2498,16 @@ IriSP.AnnotationsListWidget.prototype.ajaxRedraw = function(timecode) { + /* the seeked signal sometimes passes an argument - depending on if we're using + our popcorn lookalike or the real thing - if it's the case, use it as it's + more precise than currentTime which sometimes contains the place we where at */ + if (IriSP.null_or_undefined(timecode) || typeof(timecode) != "number") { + var tcode = this._Popcorn.currentTime(); + } else { + var tcode = timecode; + } + + /* the platform gives us a special url - of the type : http://path/{media}/{begin}/{end} we double the braces using regexps and we feed it to mustache to build the correct url we have to do that because the platform only knows at run time what view it's displaying. @@ -2507,11 +2518,11 @@ var media_id = this._serializer.currentMedia()["id"]; var duration = +this._serializer.currentMedia().meta["dc:duration"]; - var begin_timecode = (Math.floor(this._Popcorn.currentTime()) - 300) * 1000; + var begin_timecode = (Math.floor(tcode) - 300) * 1000; if (begin_timecode < 0) begin_timecode = 0; - var end_timecode = (Math.floor(this._Popcorn.currentTime()) + 300) * 1000; + var end_timecode = (Math.floor(tcode) + 300) * 1000; if (end_timecode > duration) end_timecode = duration;