Exoplayer infinite buffer state Exoplayer infinite buffer state android android

Exoplayer infinite buffer state


In such a scenario it is advisable to release the player resources and re-prepare the player config. with the last watched duration. The Exo player will give you an error handle(event) that should be used to trigger the player release.

For releasing the resources you have to use the method:

ExoPlayer.release


Provide proper buffer size and make sure you are releasing Exo player in a proper way also use on player error(ExoPlaybackException error) method and put logs on there or send data to the firebase analytics. Sometimes it's hard to find the real cause of exoplayer getting stuck. It can be source error too or rendering error. I also got this kind of issue and sometimes it's not recoverable (2 %).In those cases I have informed the user that something went wrong please try again.


If you are using postroll ads you should update ExoPlayer to 2.11.0 (2019-12-11). As you can read in release note for that version:

HLS:Fix issue where streams could get stuck in an infinite buffering state after a `postroll` ad (#6314).

There is also useful info in link to that issue.

That's actually another bug in our dev branch that needs fixing unrelated to what's reported here. The bug reported in this issue is HLS-specific and happens because we wait for stream information after the `postroll` which never arrives as the stream already finished loading.