-
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
Handling of redirects of HLS segment manifest #7915
Comments
@sobbe81 I think it's a bug in our HLS parser, if you have a test stream I can work on fixing it.
|
Hi, ok, I sent test stream to [email protected] |
Received, I'll be working on this throughout the day to see if my fix fixes your stream. |
Your media playlists include segment URLs that are absolute. That's why these redirects occur. So the player is working correctly. |
Hi, Could you elaborate a bit on why absolute urls matter in this case. Based on HTTP protocol or HLS spec? The player get this url https://router/index.m3u8 to an asset and it's redirected to https://server/index.m3u8. Then the asset should be requested again. Since the redirect was temporary I would argue that https://router/index.m3u8 should be requested. Or am I missing something? |
For URI resolution we use https://datatracker.ietf.org/doc/html/rfc3986 and our implementation can be seen at https://github.com/shaka-project/shaka-player/blob/main/third_party/closure-uri/uri.js#L197-L286 |
Ok I read it wrong, sorry! |
Yes, we treat all redirects internally as a 301(it doesn't matter what type of redirect it is, we only look at the uri), but in our model, internally what we have is an array of uris. So we would have [redirect, original]. If the redirect fails for any reason, we have a fallback to the original and would automatically request the original. |
Hi,
We have a setup with a component that routes traffic to different servers.
We have a main HLS manifest
https://router/foo.m3u8
That is redirected to
https://server/foo.m3u8
The main manifest contains urls to segment-manifests for example:
https://router/index.m3u8
Ant this is also redirected a server
https://server/index.m3u8
Our router component returns a 302 Found as response and Shaka directs correctly. However, when the segment manifest needs to be updated Shaka is requesting the redirected url (https://server/index.m3u8) instead of the original url (https://router/index.m3u8).
Is this expected behaviour? I would argue that the 302 Found should be interpreted as a temporary redirect and if that asset is requested again the originally url should be used. The behaviour now is more inline with the 301 Moved Permanently response.
What do you think?
The text was updated successfully, but these errors were encountered: