shaka-player
shaka-player copied to clipboard
Intercepting non-fatal errors during .load()
Have you read the Tutorials? yes
Have you read the FAQ and checked for duplicate open issues? yes
What version of Shaka Player are you using? 4.2.1
Please ask your question We have a specific issue where we want to skip retry logic and fail immediately if a VOD manifest request responds with 404. We've been unable to find a way of making this possible. What we've tried:
- registerResponseFilter() -> response filters do not get access to 40X responses
- player.load().catch() -> catch does not trigger until all retries have been made and a fatal error is thrown
- player.addEventListener("error", ...) -> this is too late to start listening to manifest request errors
- we've not found a way to listen to RetryEvent
- we don't create our own instance of NetworkingEngine so cannot provide it with a onDownloadFailed argument
There seems to be no obvious way of getting access to severity: 1
network errors during the load call. We want retries for other types of manifest failures, but on a 404 we know that we can fail immediately.
Found out by reading the source that NetworkingEngine extends FakeEventTarget, and as such has a .addEventListener method, and it has the request type and the shaka error, which allows us to create custom logic around non-fatal errors.
Is there an easier way of achieveing what we're trying to do than parsing the error object in the RetryEvent? Like getting 40X responses to pass through response filters.