From 4b0a55b43aa2fc7b1a38d7074ee63d5b788b4247 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 2 Mar 2013 08:56:15 +0000 Subject: [PATCH] fix changing resolution(how long was that broken?), dont seek before item is loaded --- source/Ox.UI/js/Video/VideoElement.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/Ox.UI/js/Video/VideoElement.js b/source/Ox.UI/js/Video/VideoElement.js index f9aa13ee..35cee274 100644 --- a/source/Ox.UI/js/Video/VideoElement.js +++ b/source/Ox.UI/js/Video/VideoElement.js @@ -232,8 +232,7 @@ Ox.VideoElement = function(options, self) { } function set() { self.currentItem = item; - self.currentPart = -1; - setCurrentTime(0); + setCurrentPart(self.currentPart); if (self.isPlaylist) { that.triggerEvent('pointschange'); that.triggerEvent('sizechange'); @@ -282,7 +281,9 @@ Ox.VideoElement = function(options, self) { if (currentPart != self.currentPart) { setCurrentPart(currentPart); } - self.video.currentTime = currentTime; + if (self.video && self.video.readyState) { + self.video.currentTime = currentTime; + } } function unloadPage(page) { @@ -435,7 +436,7 @@ Ox.VideoElement = function(options, self) { self.options.src = Ox.isArray(arguments[0]) ? arguments[0] : [arguments[0]]; if (self.loadedMetadata) { self.$video[self.currentPart].src = self.options.src[self.currentPart]; - self.$video.each(function(video, i) { + self.$video.each(function(i, video) { if (i != self.currentPart) { var src = self.options.src[i]; //fixme: get rid of this to make use of browser caching