dont add ?rand to empty string in Ox.VideoElement

This commit is contained in:
j 2012-10-12 13:00:22 +02:00
parent 9916fce1f6
commit 790e0c4500

View file

@ -91,9 +91,10 @@ Ox.VideoElement = function(options, self) {
item.points = points; item.points = points;
} }
item.$videos = src.map(function(src, i) { item.$videos = src.map(function(src, i) {
// in all browsers except firefox, //fixme: get rid of this to make use of browser caching
// but in all browsers except firefox,
// loadedmetadata fires only once per src // loadedmetadata fires only once per src
if (Ox.startsWith(Ox.parseURL(src).protocol, 'http')) { if (src.length > 0 && Ox.startsWith(Ox.parseURL(src).protocol, 'http')) {
src += '?' + Ox.uid(); src += '?' + Ox.uid();
} }
return $('<video>') return $('<video>')
@ -437,7 +438,10 @@ Ox.VideoElement = function(options, self) {
self.$video.each(function(video, i) { self.$video.each(function(video, i) {
if (i != self.currentPart) { if (i != self.currentPart) {
var src = self.options.src[i]; var src = self.options.src[i];
if (Ox.startsWith(Ox.parseURL(src).protocol, 'http')) { //fixme: get rid of this to make use of browser caching
// but in all browsers except firefox,
// loadedmetadata fires only once per src
if (src.length > 0 && Ox.startsWith(Ox.parseURL(src).protocol, 'http')) {
src += '?' + Ox.uid(); src += '?' + Ox.uid();
} }
video.src = src; video.src = src;
@ -446,7 +450,10 @@ Ox.VideoElement = function(options, self) {
} else { } else {
self.items[0].$videos.forEach(function($video, i) { self.items[0].$videos.forEach(function($video, i) {
var src = self.options.src[i]; var src = self.options.src[i];
if (Ox.startsWith(Ox.parseURL(src).protocol, 'http')) { //fixme: get rid of this to make use of browser caching
// but in all browsers except firefox,
// loadedmetadata fires only once per src
if (src.length > 0 && Ox.startsWith(Ox.parseURL(src).protocol, 'http')) {
src += '?' + Ox.uid(); src += '?' + Ox.uid();
} }
$video[0].src = src; $video[0].src = src;