0
在iOS中使用7改變閃光狀態AVCaptureDevice
時:繃閃存上AVCaptureDevice需要停止和啓動AVCaptureSEssion
if ([self.avCaptureDevice isFlashModeSupported:self.avCaptureFlashMode])
{
NSError *error = nil;
[self.avCaptureDevice lockForConfiguration:&error];
if (!error) [self.avCaptureDevice setFlashMode:self.avCaptureFlashMode];
[self.avCaptureDevice unlockForConfiguration];
}
除非AVCaptureSessions
停止,並開始與該設備將不能使用閃光燈
[self.avCaptureSession stopRunning];
[self.avCaptureSession startRunning];
這會使相機短暫閃爍變黑。是否可以在不停止/啓動會話的情況下切換閃光燈?