I want to implement the same behavior with the native camera of iOS5:
What\'s the
I call this method from viewDidAppear
-(void) startTrackingVolume
{
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil];
[[AVAudioSession sharedInstance] setActive:YES error:nil];
if (!self.volumeView) {
// put it somewhere outside the bounds of parent view
self.volumeView = [[MPVolumeView alloc] initWithFrame:CGRectMake(-100, -100, 10, 0)];
[self.volumeView sizeToFit];
}
if (!self.volumeView.superview) {
[self.view addSubview:self.volumeView];
}
}
In viewWillDisappear in call
[[AVAudioSession sharedInstance] setActive:NO error:nil];