Custom UI on exoplayer sample
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
Android MediaController custom graphics
The best will be to copy source code of MediaController and change layout according to Your needs. Not easy but the best way :)
You can also try get
ImageButton mRewButton;
by reflection and try to change it but i will not recommend that. Here is how this can be done:
try {
Field field = mediaController.getClass().getDeclaredField("mRewButton");
field.setAccessible(true);
Object value = field.get(mediaController);
if (value instanceof ImageButton) {
// do some changes here
((ImageButton) value).setImageResource(R.mipmap.ic_launcher);
}
} catch (NoSuchFieldException e) {
//handle errors gently
e.printStackTrace();
} catch (IllegalAccessException e) {
//handle errors gently
e.printStackTrace();
}
Just make sure that before that Your controller is initialized. Result looks like this:
Related Topics
Navigation Drawer Semi-Transparent Over Status Bar Not Working
Fragments Onresume from Back Stack
How to Take Camera Capture Without a Preview from a Service or Thread
How to Send Broadcast from One App to Another App
How to Change Textcolor in Alertdialog
Gradle Failed to Resolve Library in Android Studio
How to Parse Same Name Tag in Android Xml Dom Parsing
How to Share a Single Library Source Across Multiple Projects
Apache Httpclient on Android Producing Certpathvalidatorexception (Issuername != Subjectname)
Creating a Softkeyboard with Multiple/Alternate Characters Per Key
Navigationview and Custom Layout
Android: How to Change Checkbox Size
Starting the Android Emulator in Sdk Tools, Revision 12
Android Get Screenshot of All Listview Items