Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Cube-J committed Aug 31, 2023
1 parent bd7645f commit e2c5353
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions test-ios-wechat/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</head>
<body>
<button id="btn-open-dce">open(DCE)</button>
<button id="btn-init-dbr">init DBR</button>
<button id="btn-open-dbr">open(DBR)</button>
<button id="btn-open-origin-1">
open(Origin, using 'onloadedmetadata')
Expand Down Expand Up @@ -69,25 +70,29 @@
}
};

let scanner;
Dynamsoft.DBR.BarcodeReader._onLog = console.log;
Dynamsoft.DBR.BarcodeReader.license =
"DLS2eyJoYW5kc2hha2VDb2RlIjoiMTAxMDQ2NzM3LVRYbFhaV0pRY205cVgyUmljZyIsIm1haW5TZXJ2ZXJVUkwiOiJodHRwczovL21sdHMuZHluYW1zb2Z0LmNvbSIsIm9yZ2FuaXphdGlvbklEIjoiMTAxMDQ2NzM3Iiwic3RhbmRieVNlcnZlclVSTCI6Imh0dHBzOi8vc2x0cy5keW5hbXNvZnQuY29tIiwiY2hlY2tDb2RlIjozNDA1OTc4NTd9";

Dynamsoft.DBR.BarcodeReader.loadWasm();
// (async ()=>{
// Dynamsoft.DBR.BarcodeReader._onLog = console.log;
// console.log(Dynamsoft.DBR.BarcodeReader.version);

// Dynamsoft.DBR.BarcodeReader.license =
// "DLS2eyJoYW5kc2hha2VDb2RlIjoiMTAxMDQ2NzM3LVRYbFhaV0pRY205cVgyUmljZyIsIm1haW5TZXJ2ZXJVUkwiOiJodHRwczovL21sdHMuZHluYW1zb2Z0LmNvbSIsIm9yZ2FuaXphdGlvbklEIjoiMTAxMDQ2NzM3Iiwic3RhbmRieVNlcnZlclVSTCI6Imh0dHBzOi8vc2x0cy5keW5hbXNvZnQuY29tIiwiY2hlY2tDb2RlIjozNDA1OTc4NTd9";
const initDBR = async () => {
console.log("initing DBR...");
await Dynamsoft.DBR.BarcodeReader.loadWasm();
console.log("DBR completes initialization.");
};
document.querySelector("#btn-init-dbr").onclick = async () => {
try {
await initDBR();
} catch (e) {
const messgae = e.message || e;
console.error(messgae);
}
};

// scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();
// await scanner.setUIElement(document.querySelector("#div-dce-ui"));
// })();
document.querySelector("#btn-open-dbr").onclick = async () => {
try {
scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();
await initDBR();

let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();
await scanner.setUIElement(document.querySelector("#div-dce-ui"));

await scanner.openVideo();
Expand Down

0 comments on commit e2c5353

Please sign in to comment.