Chrome HTML5 Videos stop working if too many tabs are open - Memory issue?

html, memory, video

Solution

Exactly how many `video` tags to you have? What do they look like? Do they include `preload='none'` attribute? Are the source videos all on the server?

I ask because if you have more than six `video` tags on a single page pointing to the same source server then you could be experiencing "connection starvation":

- Chrome allows only six open connections to a single server (based on DNS name in the URL)

- the html5 `video` tag's preload attribute default value is `'auto'`

- Chrome's auto behavior is to preload some data and leave the connection open ready to pull more data for the video

So, with more than six video tags on a single page pointing to a single server, the videos will not play. To resolve this particular problem, set the `preload` attribute to `'none'`

Problem

I'm using jQuery to dynamically write `<video>` objects, and running videojs to init them. After I play a video, SOMETIMES when I try to play it again, it just won't play, and from that point on, even after refreshing the page, no videos will play. Each time, the `<video>` object renders, but the video just doesn't play. Nothing is written to the console. There don't appear to be any errors. Restarting Chrome resolves the issue, but only momentarily. After playing a few videos, the issue comes back again. I found that closing other tabs in Chrome does indeed fix the problem, so it appears to be some kind of memory issue. I'm running Chrome 19.0.1084.46

Original source