Is there a way to turn off camera when Barcodereader scan success?
I’m assign data on scan success but if I try to dispose Barcodereader or Camera to stop or turn off, the next error appears “Cannot read property ‘stopContinuousDecode’ of undefined”
How can I do it?
Thanks in advance
I tried my project as https. When I try it on the computer, the camera view is displayed and it can read barcodes. Although the camera access is open in the iphone 11 safari application, there is no image in camera1. I am sharing the iPhone screen image in the attachment.
Thanks for the response Levie.
I run your attached sample, but the result is the same. I can’t stop or turn off the camera.
I have run your example 4 minutes ago, I left the application in the background and the camera is still on. If I kept using the application, it would keep running all the time.
The need to use dispose on the camera, is because we inferred that performing this action would turn off, but it is not.
I think there should be an option to turn the camera on or off whenever you want, and not let it stay on for as long as you close the browser or leave the application.
Thanks.
I’ve logged the exception that’s thrown as issue #2606. A fix will be available in the next build!
Thanks for your help!
Levie
Hello,
I’ll need to look and see why that error is thrown. It shouldn’t be, but…
You don’t need to Dispose the Camera or BarcodeReader to turn off the scanning. The BarcodeReader component has a property “ScanMode” that when set to AutomaticOnce will only report the first Barcode it finds.
You can then reset this and use it again by calling BarcodeReader.ResetScanner().
Please give the attached sample a try and let me know if you run into any issues with it. It demonstrates the different ScanModes.
Best,
Levie
Please login first to submit.