Indicate HTTP Status Code on networkError Errors #5339
Labels
Feature proposal
Needs Triage
If there is a suspected stream issue, apply this label to triage if it is something we should fix.
Is your feature request related to a problem? Please describe.
In implementing an HLS player, I've found that hls.js will continue to request segments/playlists for as long as the ___MaxRetry configuration values allows.
However, it's possible that the HTTP code can indicate if the stream is still valid or not. i.e. a 503 may indicate that the server is busy and that's recoverable so it should keep retrying (following backoff header if it doesn't already). But a 404 could be interpreted by the player as a indicator that the stream has ended (which is true in the case of my HLS server).
Describe the solution you'd like
I would suggest adding information about the HTTP response in the object given to the error event callback of type networkError.
Minimally, it should include the HTTP status code.
This would allow my player implementation, after a sustained network stall, to make a more informed decision, and could stop the process of needlessly retrying a stream that is gone much before the maxRetries are exhausted.
Additional context
Nevertheless, a great library!
The text was updated successfully, but these errors were encountered: