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];
}
This is what actually worked for me, for some reason if the CGRect is CGRect.zero then if there is a button in the upper left corner in won't work..., so this one worked:
For all that just want to hide the HUD without playing any video or content don't forgot to add this:
Then those lines will work:
Swift 3
Here is a solution
Below code works for me apart from adding MPVolumeView as subview.
Just add these lines where you are making your MPVolumeView instance visible. For example : In case you have a toggle volume button
In case you have an always visible volume slider (instance of MPVolumeView).