Closed HuTieu closed 2 years ago
This sounds like an issue with webcams/getUserMedia, which I unfortunately don't know much about.
That said I believe getUserMedia calls require http (or maybe https?) to work - Are there errors in the console?
getUserMedia needs https, but to run in localhost chrome you can go to 1) chrome://flags/#unsafely-treat-insecure-origin-as-secure 2) Find the "Insecure origins treated as secure" under that. 3)Enable it and enter your local URL (example: http://192.168.0.1 or http://192.168.0.1:5500 if using live server ) 4) Restart the chrome and then refresh the page.
With my iPhone I accessed the demo app at https://cozmo.github.io/jsQR/ and successfully scanned a QR code. I then cloned the demo html page, the javascript source jsQR.js and placed them on my IIS site. I changed the source reference in the html page to the correct script source location /Scripts/jsQR.js. Now, when I accessed the demo page on my web server using the same iPhone, the page is loaded with the message to allow camera access but the camera is not open!
I have verified that the page and script loaded correctly. What am I missing? Thanks!