equal
deleted
inserted
replaced
10642 |
10642 |
10643 var time = this._Popcorn.currentTime(); |
10643 var time = this._Popcorn.currentTime(); |
10644 |
10644 |
10645 var duration = this._serializer.currentMedia().meta["dc:duration"] / 1000; |
10645 var duration = this._serializer.currentMedia().meta["dc:duration"] / 1000; |
10646 var percent = ((time / duration) * 100).toFixed(2); |
10646 var percent = ((time / duration) * 100).toFixed(2); |
|
10647 |
|
10648 /* we do these complicated calculations to center exactly |
|
10649 the position Marker */ |
|
10650 var pixels_to_percents = 100 / this.selector.width(); /* how much is a pixel in percents */ |
|
10651 var positionMarker_width = this.positionMarker.width(); |
|
10652 var correction = (pixels_to_percents * positionMarker_width) / 2; |
|
10653 |
|
10654 var newPos = percent - correction; |
|
10655 if (newPos <= 0) |
|
10656 newPos = 0; |
|
10657 |
10647 this.sliderForeground.css("width", percent + "%"); |
10658 this.sliderForeground.css("width", percent + "%"); |
10648 this.positionMarker.css("left", percent + "%"); |
10659 this.positionMarker.css("left", newPos + "%"); |
10649 |
10660 |
10650 }; |
10661 }; |
10651 |
10662 |
10652 IriSP.SliderWidget.prototype.backgroundClickHandler = function(event) { |
10663 IriSP.SliderWidget.prototype.backgroundClickHandler = function(event) { |
10653 /* this piece of code is a little bit convoluted - here's how it works : |
10664 /* this piece of code is a little bit convoluted - here's how it works : |