# HG changeset patch # User cavaliet # Date 1328526578 -3600 # Node ID 7bb62216b289599c8bf25e56fc066a435e2ec421 # Parent a69f1af2fe47a8e792340b8aa707e5993ef79cc2# Parent d2c99cb0318702424690dd9239b22af5b5216ba5 Merge with d2c99cb0318702424690dd9239b22af5b5216ba5 diff -r a69f1af2fe47 -r 7bb62216b289 src/ldt/ldt/static/ldt/js/LdtPlayer-release.js --- a/src/ldt/ldt/static/ldt/js/LdtPlayer-release.js Mon Feb 06 12:08:21 2012 +0100 +++ b/src/ldt/ldt/static/ldt/js/LdtPlayer-release.js Mon Feb 06 12:09:38 2012 +0100 @@ -2901,7 +2901,8 @@ var duration = +this._serializer.currentMedia().meta["dc:duration"]; var currentChapter = this._serializer.currentChapitre(currentTime); - if (IriSP.null_or_undefined(currentChapter)) { + + if (IriSP.null_or_undefined(currentChapter)) { var left = this.selector.width() / 2; var width = this.selector.width() / 10; } else { @@ -2909,8 +2910,10 @@ var width = (currentChapter.end / duration) * this.selector.width() - left; } - this.sliceLeft = left; - this.sliceWidth = width; + // slider position and length is kept in percents. + this.sliceLeft = (left / this.selector.width()) * 100; + this.sliceWidth = (width / this.selector.width()) * 100; + this._Popcorn.trigger("IriSP.SliceWidget.position", [left, width]); this._Popcorn.listen("IriSP.SliceWidget.zoneChange", IriSP.wrap(this, this.handleSliderChanges)); this._Popcorn.trigger("IriSP.SliceWidget.show"); @@ -3067,18 +3070,20 @@ if (this.cinecast_version) { annotation["begin"] = Math.round(this._Popcorn.currentTime() * 1000 - duration_part); - annotation["end"] = Math.round(this._Popcorn.currentTime() * 1000 + duration_part); - if (annotation["begin"] < 0) - annotation["begin"] = 0; - - if (annotation["end"] > this._serializer.currentMedia().meta["dc:duration"]) - annotation["end"] = this._serializer.currentMedia().meta["dc:duration"]; - + annotation["end"] = Math.round(this._Popcorn.currentTime() * 1000 + duration_part); } else { var duration = +this._serializer.currentMedia().meta["dc:duration"]; annotation["begin"] = +((duration * (this.sliceLeft / 100)).toFixed(0)); annotation["end"] = +((duration * ((this.sliceWidth + this.sliceLeft) / 100)).toFixed(0)); } + + // boundary checks + if (annotation["begin"] < 0) + annotation["begin"] = 0; + + if (annotation["end"] > this._serializer.currentMedia().meta["dc:duration"]) + annotation["end"] = this._serializer.currentMedia().meta["dc:duration"]; + annotation["type"] = this._serializer.getContributions(); if (typeof(annotation["type"]) === "undefined") diff -r a69f1af2fe47 -r 7bb62216b289 web/static/media/.keepme diff -r a69f1af2fe47 -r 7bb62216b289 web/static/site/.keepme