densen2014 / ZXingBlazor

Using ZXing Scan barcode/QR code in blazor
Apache License 2.0
93 stars 39 forks source link

Demo code worked a few times, then stopped working #15

Closed MrYossu closed 1 year ago

MrYossu commented 2 years ago

Hello, thanks for publishing this code, it's the first QR code reader I've found that actually works, or at least did for a while.

I downloaded the source code, and ran the WASM project. I clicked the [Scan] button (incorrectly named [Sacn] by the way!) and a small window popped up. I clicked the Scan button there, and it asked me to allow the app to access the camera. Once I allowed it, it showed the camera stream and recognised the QR code I held up.

This worked a few times, but then when I clicked the Scan button on the pop-up, nothing happened. No errors, the area below the Scan/Reset/Close buttons didn't show the stream from the camera, nothing.

I tried the Blazor server project and had the same issue.

Any ideas? Thanks again.

densen2014 commented 2 years ago

thanks for your message,publish need a https url,and you can pr your idea for this project, it's a open project :)

i will review your post tomorrow

MrYossu commented 2 years ago

@densen2014 Not sure what you mean about the publish url. I'm just trying to run the sample project. Also, I'm not suggesting any changes, I don't know enough about how it works. I just want to get the sample project working.

Please let me know if you have any ideas. Thanks

densen2014 commented 2 years ago

the sample projet is run in https://localhost:5002 ?

MrYossu commented 2 years ago

The WASM project ran on that URL, the server-side one ran on https://localhost:5001/, but they both had the same issue.

densen2014 commented 2 years ago

image

Running something like this in your environment?

Can you press F12 to see what error screenshot the browser outputs to me?

MrYossu commented 2 years ago

Yup, looks exactly like that, except that the box below the three buttons doesn't show the stream from the camera.

There isn't anything exciting in the browser console. I see two errors "Failed to load resource: the server responded with a status of 404 ()" for Demo.Wasm.styles.css:1 which shouldn't cause this issue, as well as the following non-error messages...

blazor.webassembly.js:1 Debugging hotkey: Shift+Alt+D (when application has focus) blazor.webassembly.js:1 blazor Loaded 21.89 MB resources This application was built with linking (tree shaking) disabled. Published applications will be significantly smaller. zxingjs.js:5 init2 zxingjs.js:14 initScan zxingjs.js:17 ZXing code reader initialized

Don't know if that helps. Thanks

Serge-N commented 1 year ago

After playing around with this Library. I say it works, both in development and production. However, it is important to note that sometimes an inbuilt camera might not cut it.

That is a 1080p on a 2 MP camera did not work. Anything above 5MP at 720p and 1080p worked like a charm. This was done on windows and android. I did not try iOS or Mac.