video player: add internal getPositionWidth method

This commit is contained in:
rolux 2013-02-12 12:31:13 +05:30
parent 17bdb6ccd9
commit d3e74f85f8

View file

@ -735,9 +735,7 @@ Ox.VideoPlayer = function(options, self) {
} else if (control == 'position') {
self.positionWidth = 48
+ !!self.options.showMilliseconds * 2
+ self.options.showMilliseconds * 6;
self.positionWidth = getPositionWidth();
self.$position = Ox.Element({
tooltip: self.options.type == 'play' ? 'Position'
@ -1415,6 +1413,11 @@ Ox.VideoPlayer = function(options, self) {
}
}
function getPositionWidth() {
return 48 + !!self.options.showMilliseconds * 2
+ self.options.showMilliseconds * 6;
}
function getPosterMarkerCSS() {
self.videoCSS = getVideoCSS();
var left = Math.floor((self.videoCSS.width - self.videoCSS.height) / 2),
@ -1541,7 +1544,7 @@ Ox.VideoPlayer = function(options, self) {
self.options.controlsBottom.reduce(function(prev, curr) {
return prev + (
curr == 'timeline' || curr == 'space' ? 0 :
curr == 'position' ? self.positionWidth : 16
curr == 'position' ? getPositionWidth() : 16
);
}, 0);
}