On this page

Stuck? Open a support ticket and the barKoder team will help. Open a ticket

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:

JavaScript
Barkoder.setContinuous(true);

Alternatively via configureBarkoder:

JavaScript
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):

JavaScript
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:

JavaScript
Barkoder.setPauseDecoding(false);

in the result callback method (argument of the startScanner method).