1

I am trying to preload several video files from the same domain, and have run into the problem where, after a certain number have loaded, the other files will throw the "Stalled" event, and will hang there indefinitely. It appears to be related to the browser's max connections per server limit.

Is there a correct way to preload, say twenty, video files from the same domain? I have tried something similar to this, using jQuery:

var list = [list of twenty video URLs];
for(var i in list){
    var video = $('<video preload><source src="'+list[i]+'"></preload>').appendTo('#container');
    video.on('canplaythrough',function(){
        console.log('woot');
    }.on('stalled',function(){
        console.log('lame');
    }.load();
}

I've also kept a list of video files to be preloaded and stepped through each one as soon as the previous one has thrown the "canplaythrough" event, but because the video is apparently still loading after the "canplaythrough" event is emitted, those connections are still opened and later video files still stall.

DasBeret
  • 13
  • 2
  • I'll also note: If I go to one of the video files that has stalled directly in another tab, it will refuse to play until I close the tab where I am attempting to preload the other files. – DasBeret Aug 28 '13 at 16:41

0 Answers0