hls.js
hls.js copied to clipboard
Trigger an event when a stall is resolved
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
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.
@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.
When considering this feature, see comments in #4028 for implementation details (gap-controller) and concerns related to HTMLMediaElement "waiting" and "canplay" events.