Skip to content

Commit 4479bfb

Browse files
committed
update version to 9.0.0
1 parent afeb649 commit 4479bfb

File tree

107 files changed

+3110
-68340
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+3110
-68340
lines changed

1.hello-world/1.minimum-code.html

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,33 @@
77
<meta name="description" content="Quickly read barcodes with Dynamsoft Barcode Reader from a live camera stream.">
88
<meta name="keywords" content="camera based barcode reading">
99
<title>Dynamsoft Barcode Reader Sample - Hello World (Decoding via Camera)</title>
10-
<!--
11-
This sample makes use of the library hosted by the CDN jsDelivr. If you would rather use the
12-
library offline. Please see the guide on how to host the library:
13-
https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=latest#host-the-library-yourself-recommended
14-
-->
15-
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/dbr.js"></script>
1610
</head>
1711

1812
<body>
1913
<h1 style="font-size: 1.5em;">Read Barcodes from a Camera</h1>
2014
<button id="btn-show-scanner">Show Barcode Scanner</button>
15+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/dbr.js"></script>
2116
<script>
22-
/** LICENSE ALERT - README
23-
* The library requires a license to work, you use the API organizationID to tell the program where to fetch your license.
24-
* If the Organizaion ID is not specified, a 7-day (public) trial license will be used by default which is the case in this sample.
25-
* Note that network connection is required for this license to work.
17+
/** LICENSE ALERT - README
18+
* To use the library, you need to first specify a license key using the API "license" as shown below.
2619
*/
2720

28-
/* When using your own license, uncomment the following line and specify your Organization ID. */
21+
Dynamsoft.DBR.BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
2922

30-
Dynamsoft.DBR.organizationID = "200000";
31-
Dynamsoft.DBR.handshakeCode = "200000-dbr_js_samples";
32-
33-
/* If you don't have a license yet, you can request a trial on this page: https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&package=js&utm_source=samples */
34-
/* For more information, please refer to https://www.dynamsoft.com/license-server/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
35-
36-
/* The API "productKeys" is an alternative way to license the library, the major difference is that it does not require a network. Contact [email protected] for more information. */
37-
38-
// Dynamsoft.DBR.productKeys = "YOUR-PRODUCT-KEY";
39-
40-
/** LICENSE ALERT - THE END */
23+
/**
24+
* 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.
25+
* 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.
26+
* 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 [email protected].
27+
* LICENSE ALERT - THE END
28+
*/
4129

4230
let pScanner = null;
4331
document.getElementById('btn-show-scanner').onclick = async function() {
4432
try {
45-
pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance();
46-
let scanner = await pScanner;
33+
const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());
4734
/*
4835
* onFrameRead is triggered after the library finishes reading a frame.
49-
* There can be one or multiple barcodes on each frame.
36+
* There can be multiple barcodes on one frame.
5037
*/
5138
scanner.onFrameRead = results => {
5239
console.log("Barcodes on one frame:");
@@ -55,13 +42,13 @@ <h1 style="font-size: 1.5em;">Read Barcodes from a Camera</h1>
5542
}
5643
};
5744
/*
58-
* onUnduplicatdRead is triggered only when a 'new' barcode is found.
45+
* onUniqueRead is triggered only when a 'new' barcode is found.
5946
* The amount of time that the library 'remembers' a barcode is defined by
6047
* "duplicateForgetTime" in "ScanSettings". By default it is set to 3000 ms.
6148
*/
62-
scanner.onUnduplicatedRead = (txt, result) => {
49+
scanner.onUniqueRead = (txt, result) => {
6350
alert(txt);
64-
console.log("Unique Code Found: " + result);
51+
console.log("Unique Code Found: ", result);
6552
}
6653
await scanner.show();
6754
} catch (ex) {

1.hello-world/10.read-video-pwa/helloworld-pwa.html

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,26 @@
77
<meta name="description" content="Read barcodes from camera with Dynamsoft Barcode Reader in a PWA application.">
88
<meta name="keywords" content="read barcode from camera in PWA">
99
<title>Dynamsoft Barcode Reader PWA Sample - Hello World (Decoding via Camera)</title>
10-
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/dbr.js"></script>
11-
<link rel="manifest" href="./helloworld-pwa.webmanifest">
10+
<link rel="manifest" href="./helloworld-pwa.json">
1211
</head>
1312

1413
<body>
1514
<h1 style="font-size: 1.5em;">Hello World for PWA</h1>
1615
<button id='readBarcode'>Read Barcode via Camera</button>
16+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/dbr.js"></script>
1717
<script>
18-
/** LICENSE ALERT - README
19-
* The library requires a license to work, you use the API organizationID to tell the program where to fetch your license.
20-
* If the Organizaion ID is not specified, a 7-day (public) trial license will be used by default which is the case in this sample.
21-
* Note that network connection is required for this license to work.
18+
/** LICENSE ALERT - README
19+
* To use the library, you need to first specify a license key using the API "license" as shown below.
2220
*/
2321

24-
/* When using your own license, uncomment the following line and specify your Organization ID. */
25-
26-
Dynamsoft.DBR.organizationID = "200000";
27-
Dynamsoft.DBR.handshakeCode = "200000-dbr_js_samples";
28-
29-
/* If you don't have a license yet, you can request a trial on this page: https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&package=js&utm_source=samples */
30-
/* For more information, please refer to https://www.dynamsoft.com/license-server/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
31-
32-
/* The API "productKeys" is an alternative way to license the library, the major difference is that it does not require a network. Contact [email protected] for more information. */
33-
34-
// Dynamsoft.DBR.productKeys = "YOUR-PRODUCT-KEY";
35-
36-
/** LICENSE ALERT - THE END */
22+
Dynamsoft.DBR.BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
23+
24+
/**
25+
* 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.
26+
* 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.
27+
* 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 [email protected].
28+
* LICENSE ALERT - THE END
29+
*/
3730

3831
let pScanner = null;
3932
let latestResult = null;
@@ -44,16 +37,16 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
4437
}
4538
});
4639
try {
47-
let scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());
40+
const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());
4841
scanner.onFrameRead = results => {
4942
console.log("Barcodes on one frame:");
5043
for (let result of results) {
5144
console.log(result.barcodeFormatString + ": " + result.barcodeText);
5245
}
5346
};
54-
scanner.onUnduplicatedRead = (txt, result) => {
47+
scanner.onUniqueRead = (txt, result) => {
5548
latestResult = txt;
56-
console.log("Unique Code Found: " + result);
49+
alert(txt, result);
5750
}
5851
await scanner.show();
5952
} catch (ex) {

1.hello-world/10.read-video-pwa/helloworld-pwa.webmanifest renamed to 1.hello-world/10.read-video-pwa/helloworld-pwa.json

File renamed without changes.

1.hello-world/10.read-video-pwa/service-worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const cacheName = 'helloworld-pwa';
33
const appShellFiles = [
44
'./helloworld-pwa.html',
55
'./dbr-big.png',
6-
'./helloworld-pwa.webmanifest',
6+
'./helloworld-pwa.json',
77
];
88

99
// Installing Service Worker

1.hello-world/11.read-video-requirejs.html

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,45 +13,37 @@ <h1 style="font-size: 1.5em;">Hello World for RequireJS</h1>
1313
<button id="readBarcode">show scanner</button>
1414
<script src="https://cdn.jsdelivr.net/npm/[email protected]/require.js"></script>
1515
<script>
16-
requirejs(['https://cdn.jsdelivr.net/npm/[email protected]/dist/dbr.js'], function({
17-
DBR,
16+
requirejs(['https://cdn.jsdelivr.net/npm/[email protected]/dist/dbr.js'], function({
1817
BarcodeReader,
1918
BarcodeScanner
2019
}) {
21-
/** LICENSE ALERT - README
22-
* The library requires a license to work, you use the API organizationID to tell the program where to fetch your license.
23-
* If the Organizaion ID is not specified, a 7-day (public) trial license will be used by default which is the case in this sample.
24-
* Note that network connection is required for this license to work.
20+
/** LICENSE ALERT - README
21+
* To use the library, you need to first specify a license key using the API "license" as shown below.
2522
*/
2623

27-
/* When using your own license, uncomment the following line and specify your Organization ID. */
28-
29-
DBR.organizationID = "200000";
30-
DBR.handshakeCode = "200000-dbr_js_samples";
31-
32-
/* If you don't have a license yet, you can request a trial on this page: https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&package=js&utm_source=samples */
33-
/* For more information, please refer to https://www.dynamsoft.com/license-server/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
34-
35-
/* The API "productKeys" is an alternative way to license the library, the major difference is that it does not require a network. Contact [email protected] for more information. */
36-
37-
// DBR.productKeys = "YOUR-PRODUCT-KEY";
38-
39-
/** LICENSE ALERT - THE END */
24+
BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
25+
26+
/**
27+
* 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.
28+
* 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.
29+
* 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 [email protected].
30+
* LICENSE ALERT - THE END
31+
*/
4032

41-
DBR.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/";
33+
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.0/dist/";
4234
let pScanner = null;
4335
document.getElementById('readBarcode').onclick = async function() {
4436
try {
45-
let scanner = await (pScanner = pScanner || DBR.BarcodeScanner.createInstance());
37+
const scanner = await (pScanner = pScanner || BarcodeScanner.createInstance());
4638
scanner.onFrameRead = results => {
4739
console.log("Barcodes on one frame:");
4840
for (let result of results) {
4941
console.log(result.barcodeFormatString + ": " + result.barcodeText);
5042
}
5143
};
52-
scanner.onUnduplicatedRead = (txt, result) => {
44+
scanner.onUniqueRead = (txt, result) => {
5345
alert(txt);
54-
console.log("Unique Code Found: " + result);
46+
console.log("Unique Code Found: ", result);
5547
}
5648
await scanner.show();
5749
} catch (ex) {
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<meta name="description" content="Quickly read barcodes with Dynamsoft Barcode Reader from a live camera stream.">
8+
<meta name="keywords" content="camera based barcode reading">
9+
<title>Dynamsoft Barcode Reader Sample - Hello World (Decoding via Camera)</title>
10+
</head>
11+
12+
<body>
13+
<h1 style="font-size: 1.5em;">Read Barcodes from a Camera</h1>
14+
<button id="btn-show-scanner">Show Barcode Scanner</button>
15+
<script type="module">
16+
import { BarcodeReader, BarcodeScanner } from 'https://cdn.jsdelivr.net/npm/[email protected]/dist/dbr.mjs';
17+
/** LICENSE ALERT - README
18+
* To use the library, you need to first specify a license key using the API "license" as shown below.
19+
*/
20+
21+
BarcodeReader.license = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
22+
23+
/**
24+
* 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.
25+
* 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.
26+
* 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 [email protected].
27+
* LICENSE ALERT - THE END
28+
*/
29+
30+
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/[email protected]/dist/";
31+
32+
let pScanner = null;
33+
document.getElementById('btn-show-scanner').addEventListener('click', async () => {
34+
try {
35+
const scanner = await (pScanner = pScanner || BarcodeScanner.createInstance());
36+
/*
37+
* onFrameRead is triggered after the library finishes reading a frame.
38+
* There can be one or multiple barcodes on each frame.
39+
*/
40+
scanner.onFrameRead = results => {
41+
console.log("Barcodes on one frame:");
42+
for (let result of results) {
43+
console.log(result.barcodeFormatString + ": " + result.barcodeText);
44+
}
45+
};
46+
/*
47+
* onUnduplicatdRead is triggered only when a 'new' barcode is found.
48+
* The amount of time that the library 'remembers' a barcode is defined by
49+
* "duplicateForgetTime" in "ScanSettings". By default it is set to 3000 ms.
50+
*/
51+
scanner.onUniqueRead = (txt, result) => {
52+
alert(txt);
53+
console.log("Unique Code Found: ", result);
54+
}
55+
await scanner.show();
56+
} catch (ex) {
57+
alert(ex.message);
58+
throw ex;
59+
}
60+
});
61+
</script>
62+
</body>
63+
64+
</html>

1.hello-world/12.read-video-webpack/index.html

Lines changed: 0 additions & 17 deletions
This file was deleted.

1.hello-world/12.read-video-webpack/package.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

1.hello-world/12.read-video-webpack/src/index.js

Lines changed: 0 additions & 46 deletions
This file was deleted.

1.hello-world/12.read-video-webpack/webpack.config.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)