Skip to content

Infinite pending request (Chrome) #455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SBoudrias opened this issue Apr 22, 2013 · 16 comments
Closed

Infinite pending request (Chrome) #455

SBoudrias opened this issue Apr 22, 2013 · 16 comments

Comments

@SBoudrias
Copy link

Hi, I found an issue with some infinite pending request on Chrome. This seems related to the HTML5 video elements has it happens on Video-js, but also any other HTML5 video player I can found out there (media-element, etc)

I explained the bug more clearly over StackOverflow: http://stackoverflow.com/questions/16137381/html5-video-element-request-stay-pending-forever-on-chrome

@davewallace
Copy link

I too seem to be having this issue, the result for me being a hung Tab that I have to manually close. My stackoverflow comment below:

"When I use the direct video URL, not running through an HTML page with a video tag etc, my Chrome network tab tells me the request is made thrice with the following Statuses: "(canceled)", "(pending)", "200 OK", in that order. The mp4 loads however. In my video.js context in an HTML page, the request also happens thrice, but intermittently fails - resulting in a hung tab which I must close manually."

@elad661
Copy link

elad661 commented Jun 30, 2013

I can see this here too, only happens under Chrome

@codebakery-ch
Copy link

@heff
Copy link
Member

heff commented Nov 13, 2013

Thanks for pointing out the Chrome bug. Depending on the use case it seems like using preload="none" could help.

We also added some additional cleanup for video elements when they're disposed of, where load() is called on an empty source element like in one of the suggestions on the chrome bug thread. Not sure if that will help this case specifically.
https://github.com/videojs/video.js/blob/master/src/js/media/html5.js#L282

@timelf123
Copy link

Just had a similar bug happen and found several Chrome issues referencing this bug or something similar. In my case, the first of my elements was an mp4 in a list of ogg, webm, and flv.

For whatever reason, Chrome would choke on the mp4 file. It was encoded with x.264:

avconv -i myvideo.mp4
avconv version 0.8.9-6:0.8.9-0ubuntu0.13.10.1, Copyright (c) 2000-2013 the Libav developers
  built on Nov  9 2013 19:09:46 with gcc 4.8.1
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'myvideo':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2012-12-11 06:11:36
    encoder         : Lavf54.6.100
  Duration: 00:01:19.83, start: 0.000000, bitrate: 459 kb/s
    Stream #0.0(und): Video: h264 (High), yuv420p, 640x360 [PAR 1:1 DAR 16:9], 351 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc
    Metadata:
      creation_time   : 2012-12-11 06:11:36
    Stream #0.1(und): Audio: aac, 44100 Hz, stereo, s16, 97 kb/s
    Metadata:
      creation_time   : 2012-12-11 06:11:36

The weirdest thing is a different video, encoded the same way/matching the above output, works just fine.

We fixed (hacked) around this bug by doing the following:

  1. added preload="none"
  2. moved the <source> containing the "broken" mp4 below the webm reference.

Chrome now loads the webm video first and does not choke on the mp4.

@heff
Copy link
Member

heff commented Nov 15, 2013

@timelf123 that's odd behavior. There's some MP4 related issues with Chrome for linux, but this sounds file specific. You might try re-encoding the first file, or running it through Zencoder which can fix a number of oddities.

@heff
Copy link
Member

heff commented Mar 4, 2014

It looks like the issue is still pending in Chrome. I'm going to close this since I don't' think there's anything we can do in video.js to prevent this, but if there's any new information please post it here.

@heff heff closed this as completed Mar 4, 2014
@heff heff added bug labels Mar 4, 2014
@santihbc
Copy link

Any news on this issue?

@sebass
Copy link

sebass commented Nov 12, 2014

Still not solved.. kick.

@davewallace
Copy link

I've been following the Chrome issue for... a while now: https://code.google.com/p/chromium/issues/detail?id=234779

Follow the threads and you might find a temporary solution, but it looks like Chrome is dragging its heels on this one.

@booherbg
Copy link

Believe it or not, this works for me. I just have to execute this before any new video is added. NOTHING ELSE worked for me.

    // this hack clears up any pending socket issues. damn it chrome.
    if(window.stop !== undefined) {
        window.stop();
    } else if(document.execCommand !== undefined) {
        document.execCommand("Stop", false);
    }

@thomasbrodin
Copy link

@booherbg This worked for me too! Thanks for sharing!

@vladarsky
Copy link

@booherbg Thank you! It works!

@vin-ni
Copy link

vin-ni commented Jul 11, 2018

This didn't work for me unfortunately. (I'm using just the video tag and replacing the src dynamically)
I had to set preload to none.

@jayarjo
Copy link

jayarjo commented Jun 7, 2019

Bumped on this today. Common Chrome, employer blames this shit on me! It's bloody 2019.

Setting preload to none doesn't seem to do the thing.

@simbrams
Copy link

@jayarjo have you found a workaround for this? I'm facing the same issue in 2021.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests