androidmediacontrollerexoplayer

Custom UI on exoplayer sample


** I really need help if you don't know anything don't give me a negative point :| if something bother you comment**

I want to write custom UI for my player in Exoplayer(change button of pause play or add new buttons like player speed next and etc) .

I use Exoplayer sample from github and before add code to my original project, I want to test the custom UI on official sample.

I read pages in Stackoverflow and tuts+ about custom UI but I really confused!

why change some buttons image or change their place must be so difficult :) how i can handle this?

EDIT

this is the sample https://github.com/google/ExoPlayer/tree/master/demo

I read these two article:

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 could start with the MediaController class that is included in Android" and I ask this question because i can't do this steps on exoplayer library and tutorial is written for default media player


Solution

  • Actually the code of involking play & pause methods are in class PlayerControl.

    If you don't want to use default Android media controller UI, just don't use the MediaController class, create your own UI in your layout file with custom play & pause button and bind the actions with the button's onClickListener.

    To play the video, call exoPlayer.setPlayWhenReady(true);

    And to pause: call exoPlayer.setPlayWhenReady(false);

    It's similar problem with how to create custom UI for android MediaController