Android – custom UI on exoplayer sample

**If you don't know anything, I really need help. Don't give me a negative point of view: | if something bothers your comment**

I want to write a custom UI for my player in exoplayer (change the pause button or add a new button such as player speed, etc.)

I use the exoplayer sample from GitHub. Before adding the code to my original project, I want to test the custom UI on the official sample

I read the page in stack overflow and focus on the custom UI, but I'm really confused!

Why is it so difficult to change some button images or change their positions:) how can I handle this?

edit

This is a sample https://github.com/google/ExoPlayer/tree/master/demo

I read these two articles:

http://www.brightec.co.uk/ideas/custom-android-media-controller

http://code.tutsplus.com/tutorials/create-a-music-player-on-android-user-controls –mobile-22787

According to this link, "instead of writing your own media controller from scratch, you can start with the mediacontroller class included in Android." I asked this question because I can't perform this step on the exoplayer library, and the tutorial is a media player written by default

resolvent:

Well, it took me half a day until I didn't go deep into the library code and find the following text:

To customize the layout of the playbackcontrolview throughout the application, or for some configurations only, you can define exo in the application RES / layout directory_ playback_ control_ View.xml layout file. These layouts will overwrite the layouts provided by the exoplayer library and will be widened for playbackcontrolview

Full text: https://github.com/google/ExoPlayer/blob/release-v2/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlaybackControlView.java

In addition, if you want to add a custom layout, you can specify it in playerview, as shown below:

<com.google.android.exoplayer2.ui.SimpleExoPlayerView android:id="@+id/player_view"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      app:controller_layout_id="@layout/custom_controls"/>

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>