Committed by
GitHub
Fix: iOS front camera switching crash issue
Showing
1 changed file
with
1 additions
and
1 deletions
| @@ -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() |
-
Please register or login to post a comment