The code works surprisingly well and it scans pretty quickly but it doesn’t work with all types of barcodes. It has been tested with EAN-13 type barcodes. These can be generated at www.barcode-generator.org/.
Here’s a little info from WikiPedia: An EAN-13 barcode (originally European Article Number, but now renamed International Article Number even though the abbreviation EAN has been retained) is a 13 digit (12 data and 1 check) barcoding standard. The EAN-13 barcodes are used worldwide for marking products often sold at retail point of sale.
Download the source code
The script can be initialised with the following code:
The threshold and quality acceptance settings can be changed with these properties:
Please note that the demo won’t run on a local environment. Upload to a web server or try MAMP/WAMP.
This is currently not supported in Internet Explorer, Safari, iOS and Opera. Have look at the support matrix on caniuse.com.
I hope this little guide helps!