I have an application which is javascript and HTML to be delivered with about 500 short (18MB) videos on 2 physical discs. I'm making an ajax request to check a file exists before displaying it, if it does not I prompt the user to insert the other disc.
video.innerHTML = "<p class=\"no-video\">Working...</p>";
$.ajax({
url: "movies/"+num+".mp4",
type: "HEAD",
success: function(){showVideo(num);},
error: function(){video.innerHTML = "<p class=\"no-video\">Please insert the other disk and click <a href=\"javascript:showLot("+num+")\">ok</a></p>";}
});
This works fine in Firefox, but takes about a minute to figure out the file is actually there in IE (if the file is missing it is fast), I'm assuming this is because IE does not respect type: "HEAD"
but it still should not take that long to load an 18MB file from DVD.
I'll have to test more browsers next.
Does anyone have any suggestions?
(would prefer not to have to re-load the HTML when the disc is swapped)