fix changing resolution for multi part videos, fixes #1491
This commit is contained in:
parent
47aa05b9bc
commit
11b9301337
1 changed files with 15 additions and 5 deletions
|
@ -253,7 +253,9 @@ Ox.VideoElement = function(options, self) {
|
||||||
if (self.video) {
|
if (self.video) {
|
||||||
self.$video.hide();
|
self.$video.hide();
|
||||||
self.video.pause();
|
self.video.pause();
|
||||||
self.video.currentTime = 0;
|
if(self.video.readyState >= self.video.HAVE_METADATA) {
|
||||||
|
self.video.currentTime = 0;
|
||||||
|
}
|
||||||
volume = self.video.volume;
|
volume = self.video.volume;
|
||||||
muted = self.video.muted;
|
muted = self.video.muted;
|
||||||
}
|
}
|
||||||
|
@ -429,14 +431,22 @@ Ox.VideoElement = function(options, self) {
|
||||||
src <f> get/set source
|
src <f> get/set source
|
||||||
@*/
|
@*/
|
||||||
that.src = function() {
|
that.src = function() {
|
||||||
var ret;
|
var ret, src;
|
||||||
if (arguments.length == 0) {
|
if (arguments.length == 0) {
|
||||||
ret = self.video.src;
|
ret = self.video.src;
|
||||||
} else {
|
} else {
|
||||||
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];
|
console.log(self.currentPart, self.$video[self.currentPart], self.$video);
|
||||||
self.$video.each(function(i, video) {
|
//fixme: get rid of this to make use of browser caching
|
||||||
|
// but in all browsers except firefox,
|
||||||
|
// loadedmetadata fires only once per src
|
||||||
|
src = self.options.src[self.currentPart];
|
||||||
|
if (src.length > 0 && Ox.startsWith(Ox.parseURL(src).protocol, 'http')) {
|
||||||
|
src += '?' + Ox.uid();
|
||||||
|
}
|
||||||
|
self.$video[0].src = src;
|
||||||
|
self.items[0].$videos.forEach(function($video, i) {
|
||||||
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
|
||||||
|
@ -445,7 +455,7 @@ Ox.VideoElement = function(options, self) {
|
||||||
if (src.length > 0 && Ox.startsWith(Ox.parseURL(src).protocol, 'http')) {
|
if (src.length > 0 && Ox.startsWith(Ox.parseURL(src).protocol, 'http')) {
|
||||||
src += '?' + Ox.uid();
|
src += '?' + Ox.uid();
|
||||||
}
|
}
|
||||||
video.src = src;
|
$video[0].src = src;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue