flutter_scan icon indicating copy to clipboard operation
flutter_scan copied to clipboard

no 'auto focus' feature

Open smalltask opened this issue 2 years ago • 1 comments

Environment

**Flutter version: 3.13.4 Plugin version:
Android version:
iOS version: 17.0 **Xcode version: 15.0 Device information: iOS XS MAX

there have no 'auto focus' feature

smalltask avatar Oct 20 '23 03:10 smalltask

private func autoFocusModel() {
    guard let device = AVCaptureDevice.default(for: .video) else { return }
    guard device.hasTorch else { return }
    do {
        try device.lockForConfiguration();
        
        if(device.isFocusPointOfInterestSupported && device.isFocusModeSupported(.continuousAutoFocus)) {
            device.focusPointOfInterest = self.center
            device.focusMode = .continuousAutoFocus
        }
        
        device.unlockForConfiguration();
    } catch {
        print(error);
    }
}

smalltask avatar Oct 20 '23 03:10 smalltask