|
1 | | -import DBR from "dynamsoft-javascript-barcode"; |
| 1 | +import { BarcodeReader } from "dynamsoft-javascript-barcode"; |
2 | 2 |
|
3 | | -/** LICENSE ALERT - README |
4 | | - * |
5 | | - * The library requires a license to work. |
6 | | - * If the license is not specified, a free public trial license will be used by default which is the case in this sample. |
7 | | - * Note that network connection is required for the public license to work. |
8 | | - * For more info, please check https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=8.8.7&utm_source=github#specify-the-license or contact support@dynamsoft.com. |
| 3 | +/** LICENSE ALERT - README |
| 4 | + * To use the library, you need to first specify a license key using the API "license" as shown below. |
9 | 5 | */ |
10 | 6 |
|
11 | | -/* When using your own license, uncomment the following line and specify your license. */ |
12 | | - |
13 | | -// DBR.BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING"; |
14 | | - |
15 | | -/** LICENSE ALERT - THE END */ |
| 7 | +BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9'; |
| 8 | + |
| 9 | +/** |
| 10 | + * You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days. |
| 11 | + * Note that if you downloaded this sample from Dynamsoft while logged in, the above license key may already be your own 30-day trial license. |
| 12 | + * For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.0.0&utm_source=github#specify-the-license or contact support@dynamsoft.com. |
| 13 | + * LICENSE ALERT - THE END |
| 14 | + */ |
16 | 15 |
|
17 | | -DBR.BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/"; |
| 16 | +BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/"; |
18 | 17 |
|
19 | 18 | let pScanner = null; |
20 | 19 | if (document.getElementById('readBarcode')) { |
21 | 20 | document.getElementById('readBarcode').onclick = async function() { |
22 | 21 | try { |
23 | | - const scanner = await (pScanner = pScanner || DBR.BarcodeScanner.createInstance()); |
| 22 | + const scanner = await (pScanner = pScanner || BarcodeScanner.createInstance()); |
24 | 23 | scanner.onFrameRead = results => { |
25 | 24 | console.log("Barcodes on one frame:"); |
26 | 25 | for (let result of results) { |
|
0 commit comments