Julian Steenbakker
Committed by GitHub

Merge pull request #545 from CyberWake/iOS_Front_Camera_Fix

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()