# HG changeset patch # User hamidouk # Date 1328020687 -3600 # Node ID 501c005917394468865fbffcabba428baf31b781 # Parent 871de507aa7b22b5616e71ee0c20c2fbc4ef70f7# Parent 403f92f241441014b85e0ffaa4c71a31d7fed1ae Merge with upstream diff -r 403f92f24144 -r 501c00591739 src/ldt/ldt/static/ldt/js/LdtPlayer-release.js --- a/src/ldt/ldt/static/ldt/js/LdtPlayer-release.js Tue Jan 31 14:38:21 2012 +0100 +++ b/src/ldt/ldt/static/ldt/js/LdtPlayer-release.js Tue Jan 31 15:38:07 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;