-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Question: Can Shaka player ignore the retry parameters on 401/403 status codes. #620
Comments
That's a great question. I'm sure we could come up with a way to skip retries. I'll have to think about the design a little. |
Issue #620 Change-Id: I6b659acdccf5d893022f3474b45020482f543550
The new design is for networking scheme plugins to return a RECOVERABLE severity when it should retry and CRITICAL severity when it shouldn't. So you can either write your own HTTP plugin or modify the existing one to do this. Another option would be to write a shim between the For example: function MyHttpPlugin(uri, request, requestType) {
return shaka.net.HttpPlugin(uri, request, requestType).catch(function(error) {
if (error.code == shaka.util.Error.Code.BAD_HTTP_STATUS &&
(error.data[1] == 401 || error.data[1] == 403)) {
// NetworkingEngine should not retry the request.
error.severity = shaka.util.Error.Severity.CRITICAL;
}
throw error;
});
}
shaka.net.NetworkingEngine.registerScheme('http', MyHttpPlugin);
shaka.net.NetworkingEngine.registerScheme('https', MyHttpPlugin); |
@TheModMaker, I recommend we do this directly in the standard HTTP plugin. It would not make sense to retry on a 401 or 403, so we should return CRITICAL for that. |
@londonshliach So now we will not retry for 401/403. If you want a more general filtering logic, you can still do what I described above. |
Great. |
Is there a way for me to tell Shaka player to ignore the retry parameters, and throw and Error, if it receives a 401 / 403 status code?
I host my videos on Amazon CloudFront and the files are private. My manifest URL is an API endpoint that generates temporary signed URLs for all the video segments.
The signed URLs expire after an hour and once that happens I will have to reload the manifest and get new signed URLs.
Some of my users will not have very good internet connections so I want to set the retry parameters so that Shaka player will retry a few times if there is a problem with the internet connection.
However, I don't want Shaka player to retry the download if it receives a response with a 401 / 403 status code (as retrying those requests will certainly fail). In that case, I want Shaka player to reload the manifest and get new URLs for the video segments.
So is there a way to tell Shaka player to retry the download if there is a network problem, but to restart (or just throw an error,) if it receives a 401 / 403 response?
Is there a way for me to pass a function to Shaka player that will get the response and decide whether to retry or not?
Thanks for the help.
The text was updated successfully, but these errors were encountered: