QuickReference

The barcode scanner makes use of the Quagga javascript library.

We have chosen to only capture EAN barcodes at present.


Quick Start Code

In your pages page.js file, include the barcode scanner script. If you want to keep a reference to your barcode scanner, add a variable to hold it.

OpenForum.includeScript("/OpenForum/AddOn/BarcodeScanner/BarcodeScanner.js"); var barcodeScanner;

Within your OpenForum init function, request a barcode scanner, passing it the element where you want the video feed to be displayed and the function you want called when a barcode has been detected.

If you want to keep a reference to your barcode scanner, add a callback function to recieve a reference to the created scanner.

The scanner will immediately start scanning for barcodes. When one is found, the callback function will be called passing in the code.

OpenForum.init = function() { BarcodeScanner.getScanner( document.getElementById("yourElement"), lookup, function(scanner) { barcodeScanner = scanner; });