Closed MikeMilzz closed 6 months ago
This happens on iPhone 13 Pro aswell
I have also experienced this issue. There is usually an autofocus enabled property in AVFoundation but Im not sure how to access it and edit it and if that is even possible. @twostraws Any help with this one please?
I'm testing another barcode scanner and here is what I did to resolve the issue. I had to limit it to iPhone because it was causing issues on iPad and macOS so be careful where you use .builtInUltraWideCamera but this will help with the focus distance.
let deviceDiscoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInUltraWideCamera, .builtInWideAngleCamera], mediaType: AVMediaType.video, position: cameraPosition)
Maybe conditionally select the camera when instantiating can solve the problem? Feel free to try to make a PR if you find something
@MikeMilzz where did you add the discoverySession in the context of the current library?
I have opened a PR that uses the Ultra Wide Camera if available for the current device as a default parameter of the CodeScanner. It's a combination of what was proposed in previous comments here.
I believe this issue was resolved with the patches above but in the meantime I've found more info that the following devices might be the more up-to-date solutions.
AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInTripleCamera, .builtInDualWideCamera, .builtInUltraWideCamera, .builtInWideAngleCamera, .builtInTrueDepthCamera], mediaType: AVMediaType.video, position: cameraPosition)
With the change in minimal focal distance on the standard camera with iPhone 14, I've found it harder to scan smaller barcodes. I have read articles about trying to force the macro camera / mode. Have others noticed the same issue or found ways around it?