Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide device Volume HUD view while adjusitng volume with MPVolumeView slider

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.

enter image description here

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];
}
like image 346
Alex Andrews Avatar asked Jun 27 '14 05:06

Alex Andrews


2 Answers

Swift 3

let volumeView = MPVolumeView(frame: .zero)
view.addSubview(volumeView)
like image 58
dimohamdy Avatar answered Sep 18 '22 17:09

dimohamdy


Here is a solution

CGRect frame = CGRectMake(-1000, -1000, 100, 100);
MPVolumeView *volumeView = [[MPVolumeView alloc] initWithFrame:frame];
[volumeView sizeToFit];
[self.view addSubview:volumeView];
like image 34
Hardik Thakkar Avatar answered Sep 20 '22 17:09

Hardik Thakkar