fix changing resolution(how long was that broken?), dont seek before item is loaded

This commit is contained in:
j 2013-03-02 08:56:15 +00:00
parent ccc50be7de
commit 4b0a55b43a

View file

@ -232,8 +232,7 @@ Ox.VideoElement = function(options, self) {
} }
function set() { function set() {
self.currentItem = item; self.currentItem = item;
self.currentPart = -1; setCurrentPart(self.currentPart);
setCurrentTime(0);
if (self.isPlaylist) { if (self.isPlaylist) {
that.triggerEvent('pointschange'); that.triggerEvent('pointschange');
that.triggerEvent('sizechange'); that.triggerEvent('sizechange');
@ -282,7 +281,9 @@ Ox.VideoElement = function(options, self) {
if (currentPart != self.currentPart) { if (currentPart != self.currentPart) {
setCurrentPart(currentPart); setCurrentPart(currentPart);
} }
self.video.currentTime = currentTime; if (self.video && self.video.readyState) {
self.video.currentTime = currentTime;
}
} }
function unloadPage(page) { function unloadPage(page) {
@ -435,7 +436,7 @@ Ox.VideoElement = function(options, self) {
self.options.src = Ox.isArray(arguments[0]) ? arguments[0] : [arguments[0]]; self.options.src = Ox.isArray(arguments[0]) ? arguments[0] : [arguments[0]];
if (self.loadedMetadata) { if (self.loadedMetadata) {
self.$video[self.currentPart].src = self.options.src[self.currentPart]; 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) { if (i != self.currentPart) {
var src = self.options.src[i]; var src = self.options.src[i];
//fixme: get rid of this to make use of browser caching //fixme: get rid of this to make use of browser caching