mediacontroller

how to create custom UI for android MediaController

筅森魡賤 提交于 2019-11-26 04:59:39
问题 I want to customize the controls in the MediaController for my video player. I want to swap out the image for the play button, change the skin, change the color, ect. Is there a known way of doing this? Thanks 回答1: 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

How to put media controller button on notification bar?

末鹿安然 提交于 2019-11-26 04:12:38
问题 I am creating a music player application. I want to show the media controller on notification bar while my application is running in background. It looks like Google player. How to do this? 回答1: For getting media player controller in your app simply follow this: Call this method in your MainActivity public void showNotification(View view){ new MyNotification(this); finish(); } Create a new MynotificationClass public class MyNotification extends Notification { private Context ctx; private