Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android remove Fastforward and rewind buttons from mediaplayer

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

like image 939
user1479307 Avatar asked Jul 01 '12 14:07

user1479307


2 Answers

When creating a MediaController, make sure to set the boolean to false in the constructor:

MediaController mediaController = new MediaController(this, false);

From the documentation:

The "rewind" and "fastforward" buttons are shown unless requested otherwise by using the MediaController(Context, boolean) constructor with the boolean set to false

like image 166
Yasha Avatar answered Oct 25 '22 12:10

Yasha


If you're trying to remove the buttons from a MediaPlayer than is not part of your app, this is impossible. You cannot mess with other apps' code. Some of them may allow you to pass this as an intent extra while launching them, but the majority probably won't.

If it is part of your app, just comment out the code related to the buttons.

EDIT: From the MediaController documentation:

  • The "rewind" and "fastforward" buttons are shown unless requested otherwise by using the MediaController(Context, boolean) constructor with the boolean set to false

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

like image 37
Raghav Sood Avatar answered Oct 25 '22 12:10

Raghav Sood