Exoplayer: How to keep the minimumBufferMs short initially and later increase it

Created on 16 Aug 2019  路  5Comments  路  Source: google/ExoPlayer

How to keep the minimumBufferMs short initially so that track starts playing immediately and increase it later so that we have enough data in buffer to play if connection gets lost.

question

All 5 comments

This issue does not seem to follow the issue template. Make sure you provide all the required information.

try to understand how DefaultLoadControl and setBufferDurationsMs works

what you wanna is a very low bufferForPlaybackMs a bigger minBufferMs (bigger than bufferForPlaybackMs) and even bigger maxBufferMs (bigger than minBufferMs), no need to change anything later just to understand how to use setBufferDurationsMs at the start of it playback, bufferForPlaybackAfterRebufferMs can be equal to bufferForPlaybackMs.

you can use player.getTotalBufferedDuration() to see the buffer state.

@fgl27 is there any obvious drawback of setting bufferForPlaybackMs lower , say 500(ms)?

Is something you need to test, depends on what you wanna to play and how reliable is the connection to it.

I have tested lower values and I don't see a noticeable difference from 100 to 1000 in relation to how fast it starts.

But I do notice a problem when it doesn't work when the buffer is to low, as the buffer is so small it may loop doing this when you first start playing something... Buffering > starting playing > instantly buffer is depleted > buffering > stay like this for ever...

This is a issue of a "lag" on the connection that may happen on any internet connection randomly.

So test and if is something that may be affected by internet, you can add a simple way to change the value from the user side.

@fgl27 thank you for the quick response. it helped.

Was this page helpful?
0 / 5 - 0 ratings