I don't know why, but sometimes Exoplayer
buffers my video very slowly. My server is responding properly and the internet is also fast but sometimes Exoplayer
buffers my video slowly for less than 1 second. And it buffering always after every 1-2 seconds on playing.
int MIN_BUFFER_DURATION = 3000;
int MAX_BUFFER_DURATION = 8000;
int MIN_PLAYBACK_RESUME_BUFFER = 1500;
int MIN_PLAYBACK_START_BUFFER = 500;
LoadControl loadControl = new DefaultLoadControl.Builder()
.setAllocator(new DefaultAllocator(true, 16))
.setBufferDurationsMs(MIN_BUFFER_DURATION,
MAX_BUFFER_DURATION,
MIN_PLAYBACK_START_BUFFER,
MIN_PLAYBACK_RESUME_BUFFER)
.setTargetBufferBytes(-1)
.setPrioritizeTimeOverSizeThresholds(true).createDefaultLoadControl();
TrackSelector trackSelector = new DefaultTrackSelector();
simpleExoPlayer = new ExoPlayer.Builder(this).setTrackSelector(trackSelector).setLoadControl(loadControl).build();
binding.exoPlayerView.setPlayer(simpleExoPlayer);
mediaItem = MediaItem.fromUri(getVid);
simpleExoPlayer.addMediaItem(mediaItem);
simpleExoPlayer.prepare();
simpleExoPlayer.play();
I'm testing my video in my Exoplayer and Chrome Browser player.
Chrome browserplayer plays my video 4X faster than my app
Exoplayer`? And I'm playing the same video and the same time. Someone also asked this question in exoplayer git but not got a good answer or result see their question exoplayer issue github this same issue causing me!
Does anyone know why this happens? Your answer will helpful for me.
int MIN_PLAYBACK_RESUME_BUFFER = 1500; int MIN_PLAYBACK_START_BUFFER = 500;
this is the problem @MDev. They together become 2000 which is 2 seconds. I increased the values and then, the buffer happens for a longer time. Actually, why do you need that? Any use case for min 3 seconds loading? – Manwell