Skip to content

Commit 63b4e29

Browse files
authored
Merge pull request #8 from Dynamsoft/master
merge from master
2 parents 3a7e060 + 91010a2 commit 63b4e29

File tree

21 files changed

+249
-415
lines changed

21 files changed

+249
-415
lines changed

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

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
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-
-->
1510
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.js"></script>
1611
</head>
1712

@@ -20,32 +15,26 @@ <h1 style="font-size: 1.5em;">Read Barcodes from a Camera</h1>
2015
<button id="btn-show-scanner">Show Barcode Scanner</button>
2116
<script>
2217
/** 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.
18+
*
19+
* The library requires a license to work.
20+
* If the license is not specified, a free public trial license will be used by default which is the case in this sample.
21+
* Note that network connection is required for the public license to work.
22+
* 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.
2623
*/
2724

28-
/* When using your own license, uncomment the following line and specify your Organization ID. */
25+
/* When using your own license, uncomment the following line and specify your license. */
2926

30-
// Dynamsoft.DBR.organizationID = "YOUR-ORGANIZATION-ID";
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 support@dynamsoft.com for more information. */
36-
37-
// Dynamsoft.DBR.productKeys = "YOUR-PRODUCT-KEY";
27+
// Dynamsoft.DBR.BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING";
3828

3929
/** LICENSE ALERT - THE END */
4030

4131
let pScanner = null;
4232
document.getElementById('btn-show-scanner').onclick = async function() {
4333
try {
44-
pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance();
45-
let scanner = await pScanner;
34+
const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());
4635
/*
4736
* onFrameRead is triggered after the library finishes reading a frame.
48-
* There can be one or multiple barcodes on each frame.
37+
* There can be multiple barcodes on one frame.
4938
*/
5039
scanner.onFrameRead = results => {
5140
console.log("Barcodes on one frame:");

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

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,17 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
1616
<button id='readBarcode'>Read Barcode via Camera</button>
1717
<script>
1818
/** 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.
19+
*
20+
* The library requires a license to work.
21+
* If the license is not specified, a free public trial license will be used by default which is the case in this sample.
22+
* Note that network connection is required for the public license to work.
23+
* 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.
2224
*/
2325

24-
/* When using your own license, uncomment the following line and specify your Organization ID. */
25-
26-
// Dynamsoft.DBR.organizationID = "YOUR-ORGANIZATION-ID";
27-
28-
/* 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 */
29-
/* For more information, please refer to https://www.dynamsoft.com/license-server/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
30-
31-
/* The API "productKeys" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
32-
33-
// Dynamsoft.DBR.productKeys = "YOUR-PRODUCT-KEY";
26+
/* When using your own license, uncomment the following line and specify your license. */
3427

28+
// Dynamsoft.DBR.BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING";
29+
3530
/** LICENSE ALERT - THE END */
3631

3732
let pScanner = null;

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

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,24 @@ <h1 style="font-size: 1.5em;">Hello World for RequireJS</h1>
1919
BarcodeScanner
2020
}) {
2121
/** 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.
22+
*
23+
* The library requires a license to work.
24+
* If the license is not specified, a free public trial license will be used by default which is the case in this sample.
25+
* Note that network connection is required for the public license to work.
26+
* 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.
2527
*/
2628

27-
/* When using your own license, uncomment the following line and specify your Organization ID. */
28-
29-
// DBR.organizationID = "YOUR-ORGANIZATION-ID";
30-
31-
/* 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 */
32-
/* For more information, please refer to https://www.dynamsoft.com/license-server/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
33-
34-
/* The API "productKeys" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
35-
36-
// DBR.productKeys = "YOUR-PRODUCT-KEY";
29+
/* When using your own license, uncomment the following line and specify your license. */
3730

31+
// BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING";
32+
3833
/** LICENSE ALERT - THE END */
3934

40-
DBR.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/";
35+
BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/";
4136
let pScanner = null;
4237
document.getElementById('readBarcode').onclick = async function() {
4338
try {
44-
let scanner = await (pScanner = pScanner || DBR.BarcodeScanner.createInstance());
39+
let scanner = await (pScanner = pScanner || BarcodeScanner.createInstance());
4540
scanner.onFrameRead = results => {
4641
console.log("Barcodes on one frame:");
4742
for (let result of results) {

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

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
import DBR from "dynamsoft-javascript-barcode";
22

33
/** LICENSE ALERT - README
4-
* The library requires a license to work, you use the API organizationID to tell the program where to fetch your license.
5-
* 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.
6-
* Note that network connection is required for this license to work.
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.
79
*/
810

9-
/* When using your own license, uncomment the following line and specify your Organization ID. */
11+
/* When using your own license, uncomment the following line and specify your license. */
1012

11-
// Dynamsoft.DBR.organizationID = "YOUR-ORGANIZATION-ID";
12-
13-
/* 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 */
14-
/* For more information, please refer to https://www.dynamsoft.com/license-server/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
15-
16-
/* The API "productKeys" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
17-
18-
// Dynamsoft.DBR.productKeys = "YOUR-PRODUCT-KEY";
13+
// DBR.BarcodeReader.license = "YOUR-ORGANIZATION-ID or YOUR-HANDSHAKECODE or AN-OFFLINE-LICENSE or ANY-OTHER-TYPE-OF-SUPPORTED-LICENSE-STRING";
1914

2015
/** LICENSE ALERT - THE END */
2116

22-
DBR.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/";
17+
DBR.BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/";
2318

2419
let pScanner = null;
2520
if (document.getElementById('readBarcode')) {

0 commit comments

Comments
 (0)