1

我有cams哪个是 AVCaptureDevice,我确定闪光灯已关闭,但现在我需要关闭相机噪音,有没有办法做到这一点?

NSArray* cams = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
    AVCaptureDevice* device = nil;
    if(isBackCamera)
    {
        device = [possibleCameras objectAtIndex:0];
    }
    else
    {
        device = [possibleCameras objectAtIndex:1];
    }

    device.flashMode = AVCaptureFlashModeOff;
4

2 回答 2

0

我认为苹果不允许你这样做

于 2012-11-15T03:50:09.353 回答
0

在使用以下代码以编程方式截取屏幕截图时,我能够禁用/静音相机快门声音。确认可以在 iPhone 5 上的 iOS8.3 上工作,并在 App Store 中接受。

MPVolumeView* volumeView = [[MPVolumeView alloc] init];
//find the volumeSlider
UISlider* volumeViewSlider = nil;
for (UIView *view in [volumeView subviews]){
    if ([view.class.description isEqualToString:@"MPVolumeSlider"]){
        volumeViewSlider = (UISlider*)view;
        break;
    }
}

[volumeViewSlider setValue:0.0f animated:YES];
[volumeViewSlider sendActionsForControlEvents:UIControlEventTouchUpInside];
于 2015-07-29T14:17:51.157 回答