google / google/ExoPlayer

Support providing a secondary or fallback url to the player

Open
#6,422 2 comments 0 reactions 1 assignee Assigned to @marcbaechinger View on GitHub
enhancement low priority
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

### [REQUIRED] Searched documentation and issues
SimpleExoplayer docs and also looked at LoadErrorHandlingPolicy but this does not help me solve the problem.

### [REQUIRED] Question
Is there is a way to pass a fallback or secondary m3u8 to exoplayer. Though, I can handle this externally as well but trying to find if exoplayer has an option. I receive 2 URLs(m3u8) from the server, primary and secondary. We try to start the playback with primary URL and if there is an error after retrying 3 times, we try to play from secondary url and if that errors out after 3 retries, we throw a player exception. Is there some API or class I can use to make this bit seamless.

Currently, I am listening to
```override fun onPlayerError(error: ExoPlaybackException?)``` and once I receive that, I start the fallback mechanism.
Also, I think MediaSource already uses `DefaultLoadErrorHandlingPolicy` which retries the loading for 3 times and then throw an error, so I think exoplayer already handles my retrying requirement. Only thing I am looking, in that case, is if there is a way to pass secondary or fallback URL.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.