Android removes Fastforward and rewind buttons from media player

I would like to remove the fast and rewind buttons from the mediacontroller in Android. Can anyone help me with this? I want to do this in my main activity.

+6
source share
2 answers

When creating a MediaController, remember to set the constructor to boolean false :

MediaController mediaController = new MediaController(this, false); 

From the documentation :

The "rewind" and "fast jump" buttons are displayed, unless otherwise specified, using the MediaController (Context, boolean) constructor with a boolean set to false

+24
source

If you are trying to remove buttons from MediaPlayer and not part of your application, this is not possible. You cannot communicate with the code of other applications. Some of them may allow you to convey this as an additional intention when they are launched, but most probably will not.

If this is part of your application, just comment out the code associated with the buttons.

EDIT: From a MediaController document:

  • The rewind and fast buttons are displayed unless otherwise requested using the MediaController (Context, boolean) constructor with a boolean value of false

So all you have to do is pass false in the constructor.

+6
source

Source: https://habr.com/ru/post/919429/


All Articles