@cdjgreen I've now implemented this for the next release of Objo Studio.
The new BarcodeScanner class opens a camera preview, reads one barcode and returns the decoded text, detected format, scan status and selected camera ID. You can request another scan when you're ready for the next item.
It supports:
- UPC-A, EAN-13, EAN-8, Code 128 and QR codes.
- Camera selection, with the actual selected camera exposed through
CameraId. Your app can save that value and request it on a later visit using PreferredCameraId.
- Browser-local decoding. Camera images stay on the device; they aren't uploaded to the server for recognition.
- String results that preserve leading zeroes. UPC-A results always contain 12 digits, including when the decoder recognises the equivalent zero-prefixed EAN-13 representation.
Camera preferences belong to the relevant device, browser and site. If a saved camera is no longer available, the scanner falls back to the rear/default camera and reports the actual selection.
For focus, the scanner requests continuous autofocus when the selected camera and browser expose it. Tap-to-focus is not included in this implementation, so I'd particularly welcome feedback on focus behaviour with your devices and product labels.
I've successfully scanned the UPC-A sample on my iPhone over HTTPS. Camera access requires HTTPS when testing from a phone, even if the app is running on another computer on your local network.
I've also added a Web Barcode Scanner example under Web Apps, with sample labels, camera selection, preferred-camera handling and scan results. That should give you something practical to try when the release is available.
Thanks again for explaining the workflow and offering to test. I'd be interested to hear how it performs on your iPhone and Android devices.
Barcode detection in Web apps on Feedback