Skip to content
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

HLS - Handling low buffer and seek with no network connection #1186

Closed
jedhoffmann opened this issue Jan 25, 2016 · 4 comments
Closed

HLS - Handling low buffer and seek with no network connection #1186

jedhoffmann opened this issue Jan 25, 2016 · 4 comments
Labels

Comments

@jedhoffmann
Copy link

I'm using ExoPlayer for audio only, HLS streams. As such, we can buffer quite a bit of audio which we want to continue playing even if the network drops or the device is put into airplane mode. In general that works fine, but there are a couple of no-network scenarios I'm trying to handle:

  1. Play through buffer
  2. Attempt to seek

My approach so far has been to register listeners with DefaultLoadControl and HlsSampleSource and to move my player into something similar to a buffering state when a load error is encountered. This solves the specific use cases I mentioned, but it doesn't give me very granular understanding of why loading failed.

I realize that to some extent these are business / presentation layer concerns, but I'm wondering if there are recommended ways to address them in the context of ExoPlayer? For example, are there any ways to pause and resume loading? Is there a way to get a 'low buffer' warning before the loader kicks in?

Any insights are greatly appreciated.

@ojw28
Copy link
Contributor

ojw28 commented Jan 25, 2016

I'm a little confused. Are you basically saying that you don't want playback to fail, ever, even if there's no network? Specifically, you'd rather the player enter an indefinite buffering state until network is restored?

@jedhoffmann
Copy link
Author

That is essentially how I have it coded right now, but it's clearly not ideal. Focusing just on the scenario of playing out the buffer with no network: is there a way you would recommend monitoring the buffers so that we can stop playback if they drop below a critical level and we don't have a network to load more?

@ojw28
Copy link
Contributor

ojw28 commented Jan 25, 2016

You could probably stop the player from failing by passing a large value as minLoadableRetryCount to the HlsChunkSource constructor. You don't need to do anything special to have the player enter a buffering state when the buffer runs out; it'll do this automatically. So I think passing a large minLoadableRetryCount is all you'd need to do to achieve what you want.

@ojw28 ojw28 added the question label Jan 25, 2016
@jedhoffmann
Copy link
Author

Thanks for the suggestion. It looks like that is doing the right thing for me.

@google google locked and limited conversation to collaborators Jun 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants