dont set current time if not needed

This commit is contained in:
j 2013-07-14 09:34:15 +00:00
parent 76fc986e97
commit 92e49fe41a

View file

@ -287,7 +287,7 @@ Ox.VideoElement = function(options, self) {
self.video.muted = muted; self.video.muted = muted;
self.$video.css(css).show(); self.$video.css(css).show();
!self.paused && self.video.play(); !self.paused && self.video.play();
Ox.Log('Video', 'sCV', self.video.src); Ox.Log('Video', 'sCV', self.video.src, item['in']);
if (item['in']) { if (item['in']) {
setCurrentItemTime(item['in']); setCurrentItemTime(item['in']);
} }
@ -295,10 +295,12 @@ Ox.VideoElement = function(options, self) {
} }
function setCurrentItemTime(currentTime) { function setCurrentItemTime(currentTime) {
Ox.Log('Video', 'sCIT', currentTime); Ox.Log('Video', 'sCIT', currentTime, self.video.currentTime, 'delta', currentTime - self.video.currentTime);
onLoadedMetadata(self.$video, function() { if (currentTime != self.video.currentTime) {
self.video.currentTime = currentTime; onLoadedMetadata(self.$video, function() {
}); self.video.currentTime = currentTime;
});
}
} }
function setCurrentTime(time) { function setCurrentTime(time) {