Skip to content

Commit 8be23f0

Browse files
committed
good for demo
1 parent 2ad964c commit 8be23f0

9 files changed

+65
-55
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ <h2>Minimum Code to Read Barcodes</h2>
2525

2626
/* When using your own license, uncomment the following line and specify your Organization ID. */
2727

28-
// Dynamsoft.DBR.BarcodeReader.organizationID = "YOUR-ORGANIZATION-ID";
29-
28+
Dynamsoft.DBR.BarcodeReader.organizationID = "200000";
29+
Dynamsoft.DBR.BarcodeReader.handshakeCode = "200000-dbr_js_samples";
30+
3031
/* 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=github */
3132
/* For more information, please refer to https://www.dynamsoft.com/license-tracking/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
3233

1.hello-world/2.read-an-image.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</head>
1515

1616
<body>
17-
<h2>Read An Existing Image</h2>
17+
<h2>Read Barcodes from An Existing Image</h2>
1818
<input id="ipt-file" type="file" style="margin-bottom: 2vh;" accept="image/png,image/jpeg,image/bmp,image/gif">
1919
<input type="text" id="result" title="Double click to clear!" readonly="true" class="latest-result"
2020
placeholder="The Last Read Barcode">
@@ -35,16 +35,17 @@ <h2>Read An Existing Image</h2>
3535
*/
3636

3737
/* When using your own license, uncomment the following line and specify your Organization ID. */
38-
39-
// Dynamsoft.DBR.BarcodeReader.organizationID = "YOUR-ORGANIZATION-ID";
40-
38+
39+
Dynamsoft.DBR.BarcodeReader.organizationID = "200000";
40+
Dynamsoft.DBR.BarcodeReader.handshakeCode = "200000-dbr_js_samples";
41+
4142
/* 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=github */
4243
/* For more information, please refer to https://www.dynamsoft.com/license-tracking/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
43-
44+
4445
/* 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. */
45-
46+
4647
// Dynamsoft.DBR.BarcodeReader.productKeys = "YOUR-PRODUCT-KEY";
47-
48+
4849
/** LICENSE ALERT - THE END */
4950

5051
// reader for decoding picture
@@ -79,6 +80,7 @@ <h2>Read An Existing Image</h2>
7980
}
8081
// Decode the file
8182
let results = await reader.decode(file);
83+
// Show the results
8284
let newElements = [];
8385
newElements.push(createAnSpan(file.name + ": ", "bigger"));
8486
newElements.push(document.createElement('br'));
@@ -198,4 +200,4 @@ <h2>Read An Existing Image</h2>
198200
}
199201
</style>
200202

201-
</html>
203+
</html>

2.ui-tweaking/1.read-video-show-result.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,17 @@ <h2>Use Default Camera UI</h2>
3333
*/
3434

3535
/* When using your own license, uncomment the following line and specify your Organization ID. */
36-
37-
// Dynamsoft.DBR.BarcodeReader.organizationID = "YOUR-ORGANIZATION-ID";
38-
36+
37+
Dynamsoft.DBR.BarcodeReader.organizationID = "200000";
38+
Dynamsoft.DBR.BarcodeReader.handshakeCode = "200000-dbr_js_samples";
39+
3940
/* 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=github */
4041
/* For more information, please refer to https://www.dynamsoft.com/license-tracking/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
41-
42+
4243
/* 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. */
43-
44+
4445
// Dynamsoft.DBR.BarcodeReader.productKeys = "YOUR-PRODUCT-KEY";
45-
46+
4647
/** LICENSE ALERT - THE END */
4748

4849
// scanner for decoding video
@@ -60,7 +61,7 @@ <h2>Use Default Camera UI</h2>
6061
document.getElementById('result').addEventListener('dblclick', async () => {
6162
document.getElementById('result').value = "";
6263
});
63-
document.getElementById('showScanner').addEventListener('click', async() => {
64+
document.getElementById('showScanner').addEventListener('click', async () => {
6465
if (pScanner) (await pScanner).show();
6566
});
6667
};

2.ui-tweaking/2.read-video-no-extra-control.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ <h2>Hide Built-in Controllers</h2>
2828

2929
/* When using your own license, uncomment the following line and specify your Organization ID. */
3030

31-
// Dynamsoft.DBR.BarcodeReader.organizationID = "YOUR-ORGANIZATION-ID";
31+
Dynamsoft.DBR.BarcodeReader.organizationID = "200000";
32+
Dynamsoft.DBR.BarcodeReader.handshakeCode = "200000-dbr_js_samples";
3233

3334
/* 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=github */
3435
/* For more information, please refer to https://www.dynamsoft.com/license-tracking/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */

2.ui-tweaking/3.read-video-with-external-control.html

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,17 @@ <h2>Use External Controllers</h2>
6363
*/
6464

6565
/* When using your own license, uncomment the following line and specify your Organization ID. */
66-
67-
// Dynamsoft.DBR.BarcodeReader.organizationID = "YOUR-ORGANIZATION-ID";
68-
66+
67+
Dynamsoft.DBR.BarcodeReader.organizationID = "200000";
68+
Dynamsoft.DBR.BarcodeReader.handshakeCode = "200000-dbr_js_samples";
69+
6970
/* 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=github */
7071
/* For more information, please refer to https://www.dynamsoft.com/license-tracking/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
71-
72+
7273
/* 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. */
73-
74+
7475
// Dynamsoft.DBR.BarcodeReader.productKeys = "YOUR-PRODUCT-KEY";
75-
76+
7677
/** LICENSE ALERT - THE END */
7778

7879
// scanner for decoding video
@@ -86,18 +87,18 @@ <h2>Use External Controllers</h2>
8687
], regionIndex = 0;
8788
window.onload = async function () {
8889
document.getElementById('toggleSound').onclick = async function () {
89-
if(pScanner){
90+
if (pScanner) {
9091
(await pScanner).bPlaySoundOnSuccessfulRead = this.checked;
9192
}
9293
};
9394
document.getElementById('toggleScanLight').onclick = function () {
9495
let scanlight = document.getElementsByClassName('dbrScanner-scanlight');
95-
if(scanlight.length){
96+
if (scanlight.length) {
9697
scanlight[0].hidden = !this.checked;
9798
}
9899
};
99100
document.getElementById('toggleScanRect').onclick = async function () {
100-
if(pScanner){
101+
if (pScanner) {
101102
let scanner = await pScanner;
102103

103104
let region = scanRegions[regionIndex];
@@ -116,12 +117,12 @@ <h2>Use External Controllers</h2>
116117
}
117118
};
118119
document.getElementById('cameraList').onchange = async function () {
119-
if(pScanner){
120+
if (pScanner) {
120121
let scanner = await pScanner;
121122
let currentRes;
122-
try{
123+
try {
123124
currentRes = await scanner.setCurrentCamera(document.getElementById('cameraList').value);
124-
}catch(ex){
125+
} catch (ex) {
125126
alert('Play video failed: ' + (ex.message || ex));
126127
}
127128
updateCurrentResolution(currentRes);
@@ -179,7 +180,7 @@ <h2>Use External Controllers</h2>
179180
cameraList.options.add(opt);
180181
}
181182
let camera = await scanner.getCurrentCamera();
182-
if(camera){
183+
if (camera) {
183184
cameraList.value = camera.deviceId;
184185
currentRes = scanner.getResolution();
185186
updateCurrentResolution({

2.ui-tweaking/4.difference-video-size.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,17 @@ <h2>Enlarge the Video Stream</h2>
3131
*/
3232

3333
/* When using your own license, uncomment the following line and specify your Organization ID. */
34-
35-
// Dynamsoft.DBR.BarcodeReader.organizationID = "YOUR-ORGANIZATION-ID";
36-
34+
35+
Dynamsoft.DBR.BarcodeReader.organizationID = "200000";
36+
Dynamsoft.DBR.BarcodeReader.handshakeCode = "200000-dbr_js_samples";
37+
3738
/* 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=github */
3839
/* For more information, please refer to https://www.dynamsoft.com/license-tracking/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
39-
40+
4041
/* 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. */
41-
42+
4243
// Dynamsoft.DBR.BarcodeReader.productKeys = "YOUR-PRODUCT-KEY";
43-
44+
4445
/** LICENSE ALERT - THE END */
4546

4647
// scanner for decoding video

3.settings/initScanner.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@ window.onload = async function () {
1818
*/
1919

2020
/* When using your own license, uncomment the following line and specify your Organization ID. */
21-
22-
// Dynamsoft.DBR.BarcodeReader.organizationID = "YOUR-ORGANIZATION-ID";
23-
21+
22+
Dynamsoft.DBR.BarcodeReader.organizationID = "200000";
23+
Dynamsoft.DBR.BarcodeReader.handshakeCode = "200000-dbr_js_samples";
24+
2425
/* 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=github */
2526
/* For more information, please refer to https://www.dynamsoft.com/license-tracking/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
26-
27+
2728
/* 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. */
28-
29+
2930
// Dynamsoft.DBR.BarcodeReader.productKeys = "YOUR-PRODUCT-KEY";
30-
31+
3132
/** LICENSE ALERT - THE END */
3233

3334
loadingText.hidden = false;

4.use-case/1.fill-a-form-with-barcode-reading.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,17 @@ <h3>Click each input box to fill in!</h3>
3030
*/
3131

3232
/* When using your own license, uncomment the following line and specify your Organization ID. */
33-
34-
// Dynamsoft.DBR.BarcodeReader.organizationID = "YOUR-ORGANIZATION-ID";
35-
33+
34+
Dynamsoft.DBR.BarcodeReader.organizationID = "200000";
35+
Dynamsoft.DBR.BarcodeReader.handshakeCode = "200000-dbr_js_samples";
36+
3637
/* 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=github */
3738
/* For more information, please refer to https://www.dynamsoft.com/license-tracking/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
38-
39+
3940
/* 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. */
40-
41+
4142
// Dynamsoft.DBR.BarcodeReader.productKeys = "YOUR-PRODUCT-KEY";
42-
43+
4344
/** LICENSE ALERT - THE END */
4445

4546
// scanner for decoding video

4.use-case/2.read-a-drivers-license.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,17 @@ <h2 id='header'>Read A Driver's License <a href="#" id='readAgain' hidden onclic
3232
*/
3333

3434
/* When using your own license, uncomment the following line and specify your Organization ID. */
35-
36-
// Dynamsoft.DBR.BarcodeReader.organizationID = "YOUR-ORGANIZATION-ID";
37-
35+
36+
Dynamsoft.DBR.BarcodeReader.organizationID = "200000";
37+
Dynamsoft.DBR.BarcodeReader.handshakeCode = "200000-dbr_js_samples";
38+
3839
/* 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=github */
3940
/* For more information, please refer to https://www.dynamsoft.com/license-tracking/docs/about/licensefaq.html?ver=latest#how-to-use-a-trackable-license. */
40-
41+
4142
/* 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. */
42-
43+
4344
// Dynamsoft.DBR.BarcodeReader.productKeys = "YOUR-PRODUCT-KEY";
44-
45+
4546
/** LICENSE ALERT - THE END */
4647

4748
// scanner for decoding video

0 commit comments

Comments
 (0)