# HG changeset patch # User hamidouk # Date 1324041527 -3600 # Node ID c0bfbc7be078e40b90c69e03ba30150d7c8c7015 # Parent 61d507c98678f003ce9f6227ff55fc30880fc085 re-bumped player. diff -r 61d507c98678 -r c0bfbc7be078 web/LdtPlayer-release.js --- a/web/LdtPlayer-release.js Fri Dec 16 12:26:56 2011 +0100 +++ b/web/LdtPlayer-release.js Fri Dec 16 14:18:47 2011 +0100 @@ -10644,8 +10644,19 @@ var duration = this._serializer.currentMedia().meta["dc:duration"] / 1000; var percent = ((time / duration) * 100).toFixed(2); + + /* we do these complicated calculations to center exactly + the position Marker */ + var pixels_to_percents = 100 / this.selector.width(); /* how much is a pixel in percents */ + var positionMarker_width = this.positionMarker.width(); + var correction = (pixels_to_percents * positionMarker_width) / 2; + + var newPos = percent - correction; + if (newPos <= 0) + newPos = 0; + this.sliderForeground.css("width", percent + "%"); - this.positionMarker.css("left", percent + "%"); + this.positionMarker.css("left", newPos + "%"); };