Skip to content
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

Trigger an event when a stall is resolved #4273

Open
toschlog opened this issue Aug 18, 2021 · 3 comments · May be fixed by #6941
Open

Trigger an event when a stall is resolved #4273

toschlog opened this issue Aug 18, 2021 · 3 comments · May be fixed by #6941

Comments

@toschlog
Copy link

Is your feature request related to a problem? Please describe.

My player puts up a "Buffering..." message when it gets a BUFFER_STALLED_ERROR. But I have no idea when to stop drawing the error because there's no event when the stall is resolved.

Describe the solution you'd like

In gap-controller.ts in the function poll(), trigger an event right after this.stallReported is set to false. Something like this:

this.trigger(Events.STALL_RESOLVED);

`
I'd be happy to do this myself if that's cool.

Thanks.

Additional context

No response

@toschlog toschlog added Feature proposal Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Aug 18, 2021
@toschlog
Copy link
Author

toschlog commented Aug 18, 2021

Or will the video element 'playing' event be triggered when the stall is resolved? I looked at the code and it doesn't seem like it would.

@robwalch robwalch removed the Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. label Jul 19, 2022
@robwalch
Copy link
Collaborator

@toschlog "waiting" signals when the video element is trying to play but it cannot (this is not just on stalls, but also when loading or seeking). The "canplay" event signals that there is enough buffer for playback to resume. You can also poll the video element readyState as these events fire when that state changes. readyState was sometimes incorrect in IE under certain circumstances, but hopefully that is no longer a concern.

@robwalch
Copy link
Collaborator

When considering this feature, see comments in #4028 for implementation details (gap-controller) and concerns related to HTMLMediaElement "waiting" and "canplay" events.

@robwalch robwalch moved this to Top priorities in HLS.js Release Planning and Backlog Dec 1, 2022
@robwalch robwalch added this to the 1.6.0 milestone Sep 30, 2023
robwalch added a commit that referenced this issue Jan 4, 2025
- Improve stall detection and reporting using "waiting" event timing
- Add `config.detectStallWithCurrentTimeMs` with a default of 1250 to configure stall detection when currentTime does not advance while playing without a "waiting" event
- Implement STALL_RESOLVED event - fires after "playing", "seeked", or "ended" event following BUFFER_STALLED_ERROR (Resolves #4273)
- Add BufferInfo to stall-related errors (BUFFER_STALLED_ERROR, BUFFER_NUDGE_ON_STALL, BUFFER_SEEK_OVER_HOLE)
- Add `stalled.start` performance timing to BUFFER_STALLED_ERROR
- Add `buffered` time range array to BufferInfo
- Only perform BUFFER_NUDGE_ON_STALL when needed (multiple buffered time ranges)
- Fix seek on start without play() request (regression in dev)
@robwalch robwalch linked a pull request Jan 4, 2025 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

2 participants