Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
yushulx committed Nov 14, 2023
1 parent 8e73762 commit 9c8df63
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions RazorBarcodeLibrary/wwwroot/barcodeJsInterop.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export function init(license) {
export function init() {
return new Promise((resolve, reject) => {
let script = document.createElement('script');
script.type = 'text/javascript';
script.src = '_content/RazorBarcodeLibrary/dbr.js';
script.onload = async () => {
resolve();
resolve();
};
script.onerror = () => {
reject();
reject();
};
document.head.appendChild(script);
});
Expand Down Expand Up @@ -72,8 +72,8 @@ export function drawCanvas(canvasId, sourceWidth, sourceHeight, results) {
canvas.height = sourceHeight;
var context = canvas.getContext('2d');
context.clearRect(0, 0, canvas.width, canvas.height);


for (var i = 0; i < results.length; ++i) {
let result = results[i];
context.beginPath();
Expand Down Expand Up @@ -136,7 +136,7 @@ export function getSourceWidth(reader) {
export function getSourceHeight(reader) {
let canvas = reader.getOriginalImageInACanvas();
return canvas.height;
}
}

export async function setVideoElement(scanner, videoId) {
if (!Dynamsoft) return;
Expand All @@ -159,7 +159,7 @@ export async function openCamera(scanner, cameraInfo) {
};
scanner.onUnduplicatedRead = (txt, result) => { };
scanner.onPlayed = function () {

}
await scanner.show();
}
Expand Down

0 comments on commit 9c8df63

Please sign in to comment.