From 92e49fe41ad36605fbd68fc44c4dc14808dca0bb Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 14 Jul 2013 09:34:15 +0000 Subject: [PATCH] dont set current time if not needed --- source/Ox.UI/js/Video/VideoElement.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/source/Ox.UI/js/Video/VideoElement.js b/source/Ox.UI/js/Video/VideoElement.js index 5cbfb8bb..341c4ebb 100644 --- a/source/Ox.UI/js/Video/VideoElement.js +++ b/source/Ox.UI/js/Video/VideoElement.js @@ -287,7 +287,7 @@ Ox.VideoElement = function(options, self) { self.video.muted = muted; self.$video.css(css).show(); !self.paused && self.video.play(); - Ox.Log('Video', 'sCV', self.video.src); + Ox.Log('Video', 'sCV', self.video.src, item['in']); if (item['in']) { setCurrentItemTime(item['in']); } @@ -295,10 +295,12 @@ Ox.VideoElement = function(options, self) { } function setCurrentItemTime(currentTime) { - Ox.Log('Video', 'sCIT', currentTime); - onLoadedMetadata(self.$video, function() { - self.video.currentTime = currentTime; - }); + Ox.Log('Video', 'sCIT', currentTime, self.video.currentTime, 'delta', currentTime - self.video.currentTime); + if (currentTime != self.video.currentTime) { + onLoadedMetadata(self.$video, function() { + self.video.currentTime = currentTime; + }); + } } function setCurrentTime(time) {