From d3e74f85f8033ca3d6a953b1a72e7da43da671b7 Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 12 Feb 2013 12:31:13 +0530 Subject: [PATCH] video player: add internal getPositionWidth method --- source/Ox.UI/js/Video/VideoPlayer.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/Ox.UI/js/Video/VideoPlayer.js b/source/Ox.UI/js/Video/VideoPlayer.js index 233fa56b..3262fdbc 100644 --- a/source/Ox.UI/js/Video/VideoPlayer.js +++ b/source/Ox.UI/js/Video/VideoPlayer.js @@ -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); }