Event for VideoView playback state or MediaController play/pause

If you’re using the MediaController in combination with a VideoView, it should be relatively easy to extend the latter and add your own listener to it. The custom VideoView would then look something like this in its most basic form: public class CustomVideoView extends VideoView { private PlayPauseListener mListener; public CustomVideoView(Context context) { super(context); } … Read more

Custom UI on exoplayer sample

Customizing the ExoPlayer’s UI is pretty simple. If you look at the ExoPlayer source, the layout res directory contains the file exo_player_control_view.xml that points to (includes) another layout – exo_playback_control_view. Copy the contents of the layout resource – exo_playback_control_view.xml Create a Layout Resource file with any name of your choice – eg: custom_exo_playback_control_view.xml. Paste the … Read more

Android back button and MediaController

Based on the source code, this should work: Extend MediaController (for the purposes of this answer, call it RonnieMediaController) Override dispatchKeyEvent() in RonnieMediaController Before chaining to the superclass, check for KeyEvent.KEYCODE_BACK, and if that is encountered, tell your activity to finish() Use RonnieMediaController instead of MediaController with your VideoView Personally, I’d just leave it alone, … Read more

how to create custom UI for android MediaController

I had the same problem on a recent project and ended up creating a custom implementation based on the stock MediaController. It adds a fullscreen button at the far right, but even if that’s not what you want this class should be a good starting point. Code: VideoControllerView.java – http://pastebin.com/1V63aVSg media_controller.xml – http://pastebin.com/rS4xqMej Image resources: … Read more

How to put media controller button on notification bar?

Here is the example above done correctly to the new API In your main, when you want to start a notification instantiate the class: NotificationPanel nPanel = new NotificationPanel(MyActivity); And when you want to cancel notification: (as it is an onGoing notification) nPanel.notificationCancel(); Then create the class for the notification caller: public class NotificationPanel { … Read more