nimiq / qr-scanner

Lightweight Javascript QR Code Scanner
https://nimiq.github.io/qr-scanner/demo
MIT License
2.51k stars 537 forks source link

qr-scanner-worker wont load if there is no internet connection #206

Open Stevke7 opened 2 years ago

Stevke7 commented 2 years ago

I have an issue on my project where app has offline functionality. And when I switch off Internet connection Qr-scanner wont work. Is there a solution for this ? Thanks in advance.

qrScanner fail

sisou commented 2 years ago

The QR scanner uses a separate worker file. This file is loaded only when the QR scanner starts and is what fails to load for you. You need to include this file into your offline cached file manifest.

e-t-l commented 5 months ago

Not sure if this is the same problem, but I cloned the repo and opened index.html in a browser, hoping it would function just like an offline version of the https://nimiq.github.io/qr-scanner/demo/ static webpage. Unfortunately the video part doesn't seem to work (in fact, the browser doesn't request webcam access at all). Is this also because it's not using an HTTPS connection?

sisou commented 5 months ago

@e-t-l the camera only works when the page is served under localhost. It won't work when you just double click the HTML file. You need to serve the repository root directory locally with a Webserver, then open the page through it.