HLS failover does not work
See original GitHub issueAccording to HLS specification one should be able to specify multiple variant-streams, and if one of them is down the player should pick another variant-stream. This does not seem to be the case for Shaka Player. This is between a Bug report and a feature request, because it might not really be a bug that the HLS specification is not implemented fully.
From the official HLS specification: https://developer.apple.com/library/archive/referencelibrary/GettingStarted/AboutHTTPLiveStreaming/about/about.html "Fallback with Stream Alternates
Not only do alternate media playlists in your master playlist operate as bandwidth or device alternatives, the alternates also serve as failure fallbacks. If the player cannot reload the media playlist file—due to issues such as 404 errors, server crashing, or a content distributor node problem—the player attempts to switch to another compatible media playlist provided on a different server. Offering multiple media playlists with the same bandwidth, the player switches to an identical playlist, providing consistent stream performance. "
The reason we want this to reducancy to work is because we use multiple CDNs as backups, if one CDN goes down. Now if one CDN is down the whole playback will break for everyone, even as we have multiple CDNs.
Have you read the FAQ and checked for duplicate open issues?
What version of Shaka Player are you using? 2.5.0
Can you reproduce the issue with our latest release version? Yes, I can reproduce on 2.5.10
Can you reproduce the issue with the latest code from master
?
Yes, I can reproduce on 2.5.0
Are you using the demo app or your own custom app? I have tried in both, same result
If custom app, can you reproduce the issue using our demo app? I can
What browser and OS are you using? Ubuntu + multiple browsers, Google Chrome, Chromium, Firefox. Same result
For embedded devices (smart TVs, etc.), what model and firmware version are you using? No embedded device
What are the manifest and license server URIs?
Manifest uri and shaka hosting on: http://localhost:8000/ No license server
What did you do?
-
I produced two HLS manifests. One with only one working variant, and all segments available. That one worked! (just to verify nothing else was broken)
-
I modified that working HLS manifest to have two HLS variants, one working variant (same as in 1.) and one broken variant substream with missing segments.
What did you expect to happen?
Here I expect the player to play it, and automatically use the not broken variant of the HLS stream
What actually happened?
It failed the whole playback trying to fetch segments from the broken variant.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (6 by maintainers)
Top GitHub Comments
Was just discussing this feature with @bradoutlaw, and we decided this could be done relatively simply.
If we can identify redundant media playlist URLs from the master playlist alone, we could group the playlist URLs together and pass an Array to the media playlist parsing method, instead of a single URL. The parser would only fetch one playlist URL, but it could use those multiple playlist URLs as multiple base URLs in resolving relative segment URLs.
This could be a fairly small change, and relatively easy to implement. The only catch is correctly identifying redundant media playlist URLs, so we should study the HLS spec carefully to determine how this should be done.
I’m not sure what our schedule for v2.7 is yet, but we can add this to the list of candidate features. We’d be happy to help motivated members of the community work on a design and a PR, if that’s helpful. There are five of us on the team, and we’re responsible for multiple projects, so we’re a bit limited in terms of what we can get done right now.