Reputation: 43
By default exoplayer is not showing this progress loader on video while it is loading. I have tried many codea but not working.
Upvotes: 3
Views: 5012
Reputation: 347
Use this method from the PlayerView class:
setShowBuffering(boolean showBuffering)
/**
It is also an attribute that you can set in the XML layout: show_buffering
EDIT 2021
As mentionned below by @Rohaitas Tanoli the code above is now deprecated.
Here is the updated code:
setShowBuffering(PlayerView.SHOW_BUFFERING_ALWAYS)
Upvotes: 5
Reputation: 11
Use app:show_buffering
in layout file and values are
never
= The buffering view is never shown.
always
= The buffering view is always shown when the player is in the buffering state.
when_playing
=The buffering view is shown when the player is in the buffering state and playWhenReady is true.
Here is the link https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/ui/PlayerView.html#SHOW_BUFFERING_WHEN_PLAYING
Upvotes: 1