Open mairh opened 7 years ago
In case you haven't seen it, see this note about compatibility. According to #54, it looks like WebRTC compat will be present in iOS 11, which I definitely want to support.
Scanning a user-supplied image is definitely possible and something I've thought about, but it just ended up being a lower-priority feature. It's mostly about updating the API to support other sources besides the camera.
Unfortunately, I can't think of any one-line hack to add this yourself since the camera, scanner, and analyzer are pretty entangled. Mostly, it comes down to the canvas that the Analyzer
uses as a source (see scanner.js).
Let's keep this issue open for tracking this feature.
But I noticed if you don't get a good photo of the QR-Code then it will fail. That's why video[Instascan] is much better so if the first frame didn't get it the next one might be at a better angle for it to work. Making me think if I should make it work to take a photo and a video.
If any one knows how to improve this code please comment.
Just fyi, in iOS11 beta the <video />
element needs attribute playsinline
. Seemed to be a bug for awhile but now that it's out of beta soon idk...
https://github.com/PaulKinlan/qrcode/commit/b79718b2391969b2291db93ba388b4c2b2f3f9d4
In many mobile browsers (in my case iPhone - running iOS 10.3.3) mobile camera is not accessible when opening the demo site / instascan in general.
Do you have any plan to support switching to manual file upload from gallery and decode the barcode when the camera is not accessible?