Skip to content

Commit e76740b

Browse files
committed
update samples to adapt to DBR JS 9.0.0;
1 parent 480fe4c commit e76740b

16 files changed

Lines changed: 70 additions & 62 deletions

File tree

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
<body>
1313
<h1 style="font-size: 1.5em;">Read Barcodes from a Camera</h1>
1414
<button id="btn-show-scanner">Show Barcode Scanner</button>
15-
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.js"></script>
15+
<!-- <script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.js"></script> -->
16+
<script src="https://cdn.jsdelivr.net/npm/keillion-dynamsoft-javascript-barcode@0.20220317102136.0/dist/dbr.js"></script>
1617
<script>
1718
/** LICENSE ALERT - README
1819
*
@@ -43,11 +44,11 @@ <h1 style="font-size: 1.5em;">Read Barcodes from a Camera</h1>
4344
}
4445
};
4546
/*
46-
* onUnduplicatdRead is triggered only when a 'new' barcode is found.
47+
* onUniqueRead is triggered only when a 'new' barcode is found.
4748
* The amount of time that the library 'remembers' a barcode is defined by
4849
* "duplicateForgetTime" in "ScanSettings". By default it is set to 3000 ms.
4950
*/
50-
scanner.onUnduplicatedRead = (txt, result) => {
51+
scanner.onUniqueRead = (txt, result) => {
5152
alert(txt);
5253
console.log("Unique Code Found: ", result);
5354
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ <h1 style="font-size: 1.5em;">Read Barcode from Images</h1>
2424
.sp-resultText { color: #cE5E04 }
2525
#div-cvs-container canvas { border: solid 1px gray; }
2626
</style>
27-
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.js"></script>
27+
<!-- <script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.js"></script> -->
28+
<script src="https://cdn.jsdelivr.net/npm/keillion-dynamsoft-javascript-barcode@0.20220317102136.0/dist/dbr.js"></script>
2829
<script>
2930
/** LICENSE ALERT - README
3031
*

1.hello-world/3.read-video-angular/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@angular/platform-browser-dynamic": "~11.2.5",
2121
"@angular/router": "~11.2.5",
2222
"dynamsoft-javascript-barcode": "8.8.7",
23+
"keillion-dynamsoft-javascript-barcode": "0.20220318155126.0",
2324
"rxjs": "~6.6.0",
2425
"tslib": "^2.0.0",
2526
"zone.js": "~0.11.3"
@@ -43,4 +44,4 @@
4344
"tslint": "~6.1.0",
4445
"typescript": "~4.1.5"
4546
}
46-
}
47+
}
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
.component-barcode-scanner{width:100%;height:100%;min-width:640px;min-height:480px;background:#eee;position:relative;resize:both;}
2-
.dbrScanner-bg-loading{animation:1s linear infinite dbrScanner-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
3-
.dbrScanner-bg-camera{width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
4-
.dbrScanner-video{width:100%;height:100%;position:absolute;left:0;top:0;}
5-
.dbrScanner-cvs-drawarea{width:100%;height:100%;position:absolute;left:0;top:0;}
6-
.dbrScanner-cvs-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;}
7-
.dbrScanner-scanlight{width:100%;height:3%;position:absolute;animation:3s infinite dbrScanner-scanlight;border-radius:50%;box-shadow:0px 0px 2vw 1px #00e5ff;background:#fff;}
8-
.dbrScanner-sel-camera{margin:0 auto;position:absolute;left:0;top:0;}
9-
.dbrScanner-sel-resolution{position:absolute;left:0;top:20px;}
10-
.dbrScanner-msg-poweredby{position:absolute;left:50%;bottom:10%;transform:translateX(-50%);}
11-
.dbrScanner-msg-poweredby svg {height:max(3vmin,17px);fill:#FFFFFF;}
12-
@keyframes dbrScanner-rotate{from{transform:rotate(0turn);}to{transform:rotate(1turn);}}
13-
@keyframes dbrScanner-scanlight{from{top:0;}to{top:97%;}}
2+
.dce-bg-loading{animation:1s linear infinite dce-rotate;width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
3+
.dce-bg-camera{width:40%;height:40%;position:absolute;margin:auto;left:0;top:0;right:0;bottom:0;fill:#aaa;}
4+
.dce-video-container{position:absolute;left:0;top:0;width:100%;height:100%;}
5+
.dce-scanarea{width:100%;height:100%;position:absolute;left:0;top:0;}
6+
.dce-scanlight{width:100%;height:3%;position:absolute;animation:3s infinite dce-scanlight;border-radius:50%;box-shadow:0px 0px 2vw 1px #00e5ff;background:#fff;}
7+
.div-select-container{position:absolute;left:0;top:0;}
8+
.dce-sel-camera{display:block;}
9+
.dce-sel-resolution{display:block;margin-top:5px;}
10+
.dbr-msg-poweredby{position:absolute;left:50%;bottom:10%;transform:translateX(-50%);}
11+
.dbr-msg-poweredby svg {height:max(3vmin,17px);fill:#FFFFFF;}
12+
@keyframes dce-rotate{from{transform:rotate(0turn);}to{transform:rotate(1turn);}}
13+
@keyframes dce-scanlight{from{top:0;}to{top:97%;}}

1.hello-world/3.read-video-angular/src/app/barcode-scanner/barcode-scanner.component.html

Lines changed: 13 additions & 10 deletions
Large diffs are not rendered by default.

1.hello-world/3.read-video-angular/src/app/barcode-scanner/barcode-scanner.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, OnInit } from '@angular/core';
2-
import { BarcodeScanner } from 'dynamsoft-javascript-barcode'
2+
import { BarcodeScanner } from 'keillion-dynamsoft-javascript-barcode'
33
@Component({
44
selector: 'app-video-decode',
55
templateUrl: './barcode-scanner.component.html',
@@ -17,7 +17,7 @@ export class VideoDecodeComponent implements OnInit {
1717
console.log(result.barcodeText);
1818
}
1919
};
20-
scanner.onUnduplicatedRead = (txt, result) => {
20+
scanner.onUniqueRead = (txt, result) => {
2121
alert(txt);
2222
};
2323
await scanner.open();

1.hello-world/3.read-video-angular/src/app/dbr.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BarcodeReader } from 'dynamsoft-javascript-barcode';
1+
import { BarcodeReader } from 'keillion-dynamsoft-javascript-barcode';
22

33
/** LICENSE ALERT - README
44
*
@@ -14,4 +14,4 @@ import { BarcodeReader } from 'dynamsoft-javascript-barcode';
1414

1515
/** LICENSE ALERT - THE END */
1616

17-
BarcodeReader.engineResourcePath = 'https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/';
17+
BarcodeReader.engineResourcePath = 'https://cdn.jsdelivr.net/npm/keillion-dynamsoft-javascript-barcode@0.20220318155126.0/dist/';

1.hello-world/3.read-video-angular/src/app/hello-world/hello-world.component.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
margin: 2vmin auto;
3131
text-align: center;
3232
font-size: medium;
33-
height: 40vh;
33+
/* height: 40vh; */
3434
width: 80vw;
3535
}
3636

1.hello-world/3.read-video-angular/src/app/hello-world/hello-world.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component, OnInit } from '@angular/core';
22
import '../dbr'; // import side effects. The license, engineResourcePath, so on.
3-
import { BarcodeScanner } from 'dynamsoft-javascript-barcode';
3+
import { BarcodeScanner } from 'keillion-dynamsoft-javascript-barcode';
44

55
@Component({
66
selector: 'app-hello-world',

1.hello-world/4.read-video-react/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"@testing-library/react": "^11.1.0",
99
"@testing-library/user-event": "^12.1.10",
1010
"dynamsoft-javascript-barcode": "8.8.7",
11+
"keillion-dynamsoft-javascript-barcode": "0.20220318155126.0",
1112
"react": "^17.0.1",
1213
"react-dom": "^17.0.1",
1314
"react-scripts": "4.0.3",
@@ -37,4 +38,4 @@
3738
"last 1 safari version"
3839
]
3940
}
40-
}
41+
}

0 commit comments

Comments
 (0)