CyberWake
Committed by GitHub

Fix: iOS front camera switching crash issue

@@ -138,7 +138,7 @@ public class MobileScanner: NSObject, AVCaptureVideoDataOutputSampleBufferDelega @@ -138,7 +138,7 @@ public class MobileScanner: NSObject, AVCaptureVideoDataOutputSampleBufferDelega
138 if device.isFocusModeSupported(.continuousAutoFocus) { 138 if device.isFocusModeSupported(.continuousAutoFocus) {
139 device.focusMode = .continuousAutoFocus 139 device.focusMode = .continuousAutoFocus
140 } 140 }
141 - if #available(iOS 15.4, *) { 141 + if #available(iOS 15.4, *) , device.isFocusModeSupported(.autoFocus){
142 device.automaticallyAdjustsFaceDrivenAutoFocusEnabled = false 142 device.automaticallyAdjustsFaceDrivenAutoFocusEnabled = false
143 } 143 }
144 device.unlockForConfiguration() 144 device.unlockForConfiguration()