Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no 'auto focus' feature #64

Open
smalltask opened this issue Oct 20, 2023 · 1 comment
Open

no 'auto focus' feature #64

smalltask opened this issue Oct 20, 2023 · 1 comment

Comments

@smalltask
Copy link

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
Copy link
Author

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);
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant