re-bumped player.
authorhamidouk
Fri, 16 Dec 2011 14:18:47 +0100
changeset 10 c0bfbc7be078
parent 9 61d507c98678
child 11 cdfe29ce64da
re-bumped player.
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 + "%");
 
 };