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
This sample demonstrates how to use the `BarcodeScanner` API from the [Dynamsoft Barcode Reader JavaScript SDK](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/) to scan **multiple barcodes continuously** from a video stream in a web application.
7
+
8
+
### ✨ Features
9
+
10
+
- Scan multiple 1D/2D barcodes
11
+
- Live video decoding using `BarcodeScanner` component
12
+
- Easy integration into your web application
13
+
- UI rendered into a customizable container
14
+
15
+
### 🔧 How It Works
16
+
17
+
The sample uses the `BarcodeScanner` class to launch a scanner and decode barcodes from a camera stream. The key configuration includes:
18
+
19
+
-**License Key** – Required to activate the SDK.
20
+
-**`engineResourcePaths`** – Points to required resources hosted on a CDN or locally.
21
+
-**UI container** – An HTML element where the scanner is rendered.
- This sample scans **multiple unique barcodes**, you can configure `scanMode` to change the behavior to scan one single barcode.
50
+
- To avoid network-related loading issues, consider hosting all required resources locally.
51
+
52
+
## 🛒 2. Cart Builder
53
+
54
+
This sample simulates a shopping experience where users scan barcodes to add items to a dynamic cart.
55
+
56
+
### ✨ Features
57
+
58
+
- Scan multiple 1D/2D barcodes
59
+
- Live video decoding using `BarcodeScanner` component
60
+
- Floating and draggable scanner window.
61
+
- Dynamic cart updates on each scan.
62
+
63
+
### 🔧 How It Works
64
+
65
+
The scanning logic mirrors the Hello World sample, but scanned results populate the cart instead of just displaying in the result view.
66
+
67
+
The UI features a "Scan Barcode" button, a styled cart, and basic interactivity with vanilla JavaScript and CSS.
68
+
69
+
A list of 20 dummy products is used, with each scan randomly adding a product to the cart showing its name, shortened barcode, and price.
70
+
71
+
## 📄 See other BarcodeScanner samples
72
+
73
+
Multiple samples are provided for single barcode scanning. These samples can be easily adapted to scan multiple unique barcodes by simply updating the `config` object.
74
+
75
+
*[**Hello World**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode): Scan single barcode from video stream with minimum code in JavaScript.
76
+
*[**Hello World in Angular**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/angular): Read single barcode from camera in an Angular application.
77
+
*[**Hello World in React**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/react): Read single barcode from camera in a React application.
78
+
*[**Hello World in Vue**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/barcode-scanner-api-samples/scan-single-barcode/vue): Read single barcode from camera in a Vue application.
0 commit comments