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.
Asked
Active
Viewed 6,878 times
2 Answers
28
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

Yasha
- 1,017
- 11
- 21
-
3I guess, this should be accepted answer for the question above as this removes the rewind and forward button from the videoView – Avijeet Dec 14 '15 at 06:29
-
1I also want to remove the play icon and only want to show the seek-bar, how can i achieve this? – hasnain_ahmad Jul 12 '16 at 19:28
-
@hasnain_ahmad how to remove play pause also? – Rucha Bhatt Joshi Apr 26 '19 at 11:37
-
1@RuchaBhattJoshi that's outside of this question's concerns. but a quick google search leads me to this answer - https://stackoverflow.com/a/40364545/2475185. Hopefully it still works – Yasha Apr 26 '19 at 13:36
-
@Yasha yeah i guess so, anyways thank you so much :) – Rucha Bhatt Joshi Apr 29 '19 at 09:01
6
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.

Raghav Sood
- 81,899
- 22
- 187
- 195
-
(http://www.devdaily.com/java/jwarehouse/android/core/java/android/widget/MediaController.java.shtml).They are saying that you can by using the MediaController(Context, boolean) constructor with the boolean set to false. – user1479307 Jul 01 '12 at 15:10
-
Well, you have access to the source. Not sure why you'd want to remove a feature, but you can comment the code for those buttons out. – Raghav Sood Jul 01 '12 at 15:12
-
I havent made any buttons. I am using the standard mediacontroller that has the buttons within itself. ` mVideoView = (VideoView) findViewById(R.id.surface_view); MediaController mc = new MediaController(this); mVideoView.setMediaController(mc); ` – user1479307 Jul 01 '12 at 15:18
-