I was implementing a video player with MPMoviePlayer in my iPad Application, used MPVolumeView for the volume control. My problem is that when i scroll the volume view to adjust the volume is showing the device's volume hud overlay as in the screenshot below.
How can i disable this system volume indicator hud? My code is :
@property (weak, nonatomic) IBOutlet MPVolumeView *playbackMPVolumeView;
//Customizing controller
- (void)customizeVolumeController
{
_playbackMPVolumeView.showsRouteButton = YES;
_playbackMPVolumeView.showsVolumeSlider = YES;
[_playbackMPVolumeView setVolumeThumbImage:[UIImage imageNamed:@"volume_slider_thumb.png"] forState:UIControlStateNormal];
}
I had to do the following to disable the volume overlay:
AppDeletage.m:
AppDelegate.h:
Objective C only, no Swift. Works with iOS 8.1+ (not tested earlier versions). Adding this as I struggled to implement this based on the given answers without context.
Here is the above solution in Swift. Works with Swift 2-3.
If you want hide the HUD over all app screens, use following universal code:
In case if you at some poin will need to show the Volume HUD just remove it from app.window . Enjoy :-)
AppDelegate:
The best solution I came up with for Swift 4
Add these 3 lines of code
taken this refrence from applicationMusicPlayer volume notification