调用闪光灯

AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];

[device lockForConfiguration:nil];

if (device.torchMode == AVCaptureTorchModeOff) {

[device setTorchMode: AVCaptureTorchModeOn];

}else{

[device setTorchMode: AVCaptureTorchModeOff];

}

[device unlockForConfiguration];

你可能感兴趣的:(调用闪光灯)