cozmo / jsQR

A pure javascript QR code reading library. This library takes in raw images and will locate, extract and parse any QR code found within.
https://cozmo.github.io/jsQR/
Apache License 2.0
3.64k stars 602 forks source link

jsQR not work in iframe when run on ipad #147

Closed tiepvb closed 4 years ago

tiepvb commented 4 years ago

add code in iframe with allow

<iframe allow="accelerometer *; ambient-light-sensor *; autoplay *; camera *; encrypted-media *; fullscreen *; geolocation *; gyroscope *; magnetometer *; microphone *; midi *; payment *; picture-in-picture *; speaker *; usb *; vibrate *; vr *">

on pc it's ok but ipad can't detect camera Pls help thanks!

cozmo commented 4 years ago

Since jsQR is just a function, it will work wherever javascript can run (iframe or not). What it sounds like the issue you're describing is the webcam not working in the iframe. As I mention here I'm not a webcam expert by any stretch, and as such can't really help you debug non jsQR issues unfortunately. That said it seems like there are some caveats around accessing webcam data in iframes.

If you can get the video working in an iframe without jsQR, and jsQR somehow breaks, then please let me know, but if you're just having trouble getting the video to work I'd suggest asking on stackoverflow or somewhere that will be able to help you more with webcam specific code.

Closing this issue for now but if you have a bug with jsQR please comment/re-open!