From d27ce4de70927c63d0c749860ed2e746ad4f4b1a Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 13 Feb 2014 06:47:10 +0000 Subject: [PATCH] fix switching resolution --- source/Ox.UI/js/Video/VideoElement.js | 15 ++++++++------- source/Ox.UI/js/Video/VideoPlayer.js | 4 ++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/source/Ox.UI/js/Video/VideoElement.js b/source/Ox.UI/js/Video/VideoElement.js index 0f779812..9dceb2cd 100644 --- a/source/Ox.UI/js/Video/VideoElement.js +++ b/source/Ox.UI/js/Video/VideoElement.js @@ -54,13 +54,6 @@ Ox.VideoElement = function(options, self) { if (update) { self.currentItem = 0; self.currentItemId = self.items[self.currentItem].id; - setCurrentVideo(function() { - that.triggerEvent('seeked'); - that.triggerEvent('durationchange', { - duration: that.duration() - }); - - }); } } if (!update) { @@ -68,6 +61,14 @@ Ox.VideoElement = function(options, self) { that.triggerEvent('durationchange', { duration: that.duration() }); + } else { + setCurrentVideo(function() { + that.triggerEvent('seeked'); + that.triggerEvent('durationchange', { + duration: that.duration() + }); + + }); } } }); diff --git a/source/Ox.UI/js/Video/VideoPlayer.js b/source/Ox.UI/js/Video/VideoPlayer.js index 2d09e272..aea8beed 100644 --- a/source/Ox.UI/js/Video/VideoPlayer.js +++ b/source/Ox.UI/js/Video/VideoPlayer.js @@ -1289,6 +1289,10 @@ Ox.VideoPlayer = function(options, self) { } else { self.loadedMetadata = true; setPosition(self.options.position); + if (self.options.paused && self.playOnLoad) { + self.playOnLoad = false; + togglePaused('button'); + } } that.triggerEvent('durationchange', { duration: self.options.duration