Enable Continuous Scanning
Continuous Scanning #
Continuous Scanning is a feature in barcode scanning applications that allows for repeated scanning of barcodes without manually restarting the scanning process after each successful scan. It is implemented by configuring the scanner to keep the session open and adjusting the delay between duplicate scans.
How to enable it?#
To add continuous scanning you can use this code:
Barkoder.setContinuous(true);
Alternatively via configureBarkoder:
let config = new Barkoder.configTypes.BarkoderConfig({
closeSessionOnResultEnabled: false
});
Barkoder.configureBarkoder(config);
To avoid sudden detection of the same barcode use (the value is in milliseconds):
Barkoder.setDuplicatesDelayMs(0);
Note that in continuous scanning, after a result is found, the decoder is paused (the camera preview will keep on running, without scanning for barcodes). To continue scanning for barcodes, you need to unpause the scanner, and you can do so with:
Barkoder.setPauseDecoding(false);
in the result callback method (argument of the startScanner method).