only add uid to http urls, this breaks for file:// or blob urls

This commit is contained in:
j 2012-04-19 13:26:46 +02:00
parent 17b17707fc
commit 461cd3d686

View file

@ -91,7 +91,9 @@ Ox.VideoElement = function(options, self) {
item.$videos = src.map(function(src, i) {
// in all browsers except firefox,
// loadedmetadata fires only once per src
src += '?' + Ox.uid();
if(Ox.parseURL(src).protocol.substr(0, 4) == 'http') {
src += '?' + Ox.uid();
}
return $('<video>')
.css({position: 'absolute'})
.bind({
@ -433,12 +435,20 @@ Ox.VideoElement = function(options, self) {
self.$video[self.currentPart].src = self.options.src[self.currentPart];
self.$video.each(function(video, i) {
if (i != self.currentPart) {
video.src = self.options.src[i] + '?' + Ox.uid();
var src = self.options.src[i];
if(Ox.parseURL(src).protocol.substr(0, 4) == 'http') {
src += '?' + Ox.uid();
}
video.src = src;
}
});
} else {
Ox.forEach(self.items[0].$videos, function($video, i) {
$video[0].src = self.options.src[i] + '?' + Ox.uid();
var src = self.options.src[i];
if(Ox.parseURL(src).protocol.substr(0, 4) == 'http') {
src += '?' + Ox.uid();
}
$video[0].src = src;
});
}
ret = that;