Is there any way to prevent the volume indicator view form showing if you press the volume up/down hardware bottons?
It's needed for a demo app only. So the method don't need to be App Store safe.
Is there any way to prevent the volume indicator view form showing if you press the volume up/down hardware bottons?
It's needed for a demo app only. So the method don't need to be App Store safe.
IIRC, the presence of a MPVolumeView inhibits the display of the volume indicator overlay. Try sticking it the relevant view and seeing if this is the case.
Then you can try various tricks to make it effectively invisible:
All of these are theoretically detectable by MPVolumeView, but I suspect some of them will work.
It works like that:
e.g
NSString *url = [[NSBundle mainBundle]
pathForResource:@"silent" ofType:@"mp3"];
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc]
initWithContentURL:[NSURL URLWithString:url]];
[moviePlayer play];
MPVolumeView *volumeView = [[[MPVolumeView alloc] initWithFrame:
CGRectMake(0, 0, 1, 1)] autorelease];
[self.view addSubview:volumeView];
[self.view sendSubviewToBack:volumeView];