question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HLS failover does not work

See original GitHub issue

According 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?

  1. 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)

  2. 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:closed
  • Created 3 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
joeyparrishcommented, Oct 21, 2020

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.

1reaction
joeyparrishcommented, Apr 30, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HLS streaming primary/backup failover issue - Wowza
The video player (hlsjs) is supposed to switch stream if the first stream becomes anavailable. But it does not work because the timestamps...
Read more >
HLS Failover issues - Roku Developer Program
When playing HLS content, the player expects exactly one stream URL pointing to a manifest that defines all the variants for that content....
Read more >
Facilitate HLS player switching to failover/backup streams
Apple HLS stack supports switching to failover/backup streams if it cannot retrieve any streams of the primary set. For Apple HLS devices, ...
Read more >
Survive CDN failures with Redundant Streams | Mux blog
The solution to this problem is usually referred to "mid stream CDN ... Since failover between the HLS redundant streams is implemented on ......
Read more >
Backup or redundant HLS stream - Nuevodevel.com
Some of users may not know about it, may not understand how it works or how to setup failover for his HLS stream....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found