You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Configuration object for initializing the BarcodeScanner instance. Refer to https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html#barcodescannerconfig
let config = {
license: "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", // Replace with your Dynamsoft license key
container: document.querySelector(".barcode-scanner-view"), // Specify where to render the scanner UI
/*
scanMode controls the scanning behavior:
- SM_MULTI_UNIQUE: Continuously scans and collects each unique barcode.
- SM_SINGLE: Stops scanning after the first barcode is detected.
*/
scanMode: Dynamsoft.EnumScanMode.SM_MULTI_UNIQUE,
// showUploadImageButton: true,
// scannerViewConfig: {
// showFlashButton: true,
// cameraSwitchControl: "toggleFrontBack",
// },
// The watermark can be removed via showPoweredByDynamsoft configuration option.
// showPoweredByDynamsoft: false,
};
// Create a new instance of the Dynamsoft Barcode Scanner
const barcodeScanner = new Dynamsoft.BarcodeScanner(config);
// Launch the scanner and handle the scanned result
barcodeScanner.launch().then((result) => {
// Display the first detected barcode's text in an alert