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