Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Google Chrome Pending network calls on html5 video -- fix

Google Chrome Pending video status

There's an outstanding bug in Google Chrome where video resources aren't properly closed after download, so the socket limit gets maxed and subsequent videos (and all ajax calls) hang.

I tried, with no success:

  • Removing the tag after unload (in an attempt to force the resource to be released)
  • All combinations of preload, auto, controls etc.
  • Manual remove() of the video player
  • Add a unique timestamp to the src= to force reloading

Nothing worked, except finally -- via a random stack overflow thread -- this seems to work:

if(window.stop !== undefined) {
} else if(document.execCommand !== undefined) {
    document.execCommand("Stop", false);

But it only works if I put this in my "sync" function, which runs every 500ms. So it basically has to be run continuously. But it seems to clear it all out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment