Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exoplayer and ProgressBar

I'm new to Android Studio and ExoPlayer I started the player to play videos but I don't know to detect if the player is buffering and show a progress bar to notify the user, any help please?

like image 761
Omar Alesharie Avatar asked Mar 14 '17 10:03

Omar Alesharie


People also ask

How do you get the progress bar on ExoPlayer?

you can simply change XML attribute show_buffering if you are using Exoplayer2. Also see PlayerView. setShowBuffering(PlayerView. ShowBuffering) for more details.

What is ExoPlayer and how to use it?

The YouTube app and many more Google’s video streaming apps use the ExoPlayer to stream and play videos. ExoPlayer is a media player library that provides a way to play media with lots of customization in your android app.

What are the pros and cons of ExoPlayer?

ExoPlayer is highly customizable and extensible, making it capable of many advanced use cases. It supports a variety of media formats, including adaptive formats such as DASH and SmoothStreaming. Note: Read more about the pros and cons in the ExoPlayer developer guide. Moderate knowledge of Android development and Android Studio

What is the API level of ExoPlayer in Android?

But ExoPlayer was introduced in Android API level 16 i.e. the Android Jelly Bean. So, you can't use ExoPlayer for API less than 16. But this is not a matter to worry about.

How many Android devices support ExoPlayer?

Almost 100% (99.2%, to be more precise) of Android devices present on the Play Store have API level 16 or more, so you can say that almost all Android devices present on Play Store, supports ExoPlayer. The video played in the MediaPlayer does not support the smooth streaming. Also, there was no support for adaptive playbacks like DASH and HSL.


1 Answers

Maybe it will be helpful to someone:

<com.google.android.exoplayer2.ui.PlayerView
        android:id="@+id/player_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@android:color/black"
        app:show_buffering="true"/>

you can simply change XML attribute show_buffering if you are using Exoplayer2.

Also see PlayerView.setShowBuffering(PlayerView.ShowBuffering) for more details.

like image 150
remain4life Avatar answered Oct 08 '22 10:10

remain4life