Skip to content

Commit ed1dab0

Browse files
authored
Merge pull request #221 from Dynamsoft/_dev
UPDATE
2 parents 83351aa + 5b707bf commit ed1dab0

File tree

21 files changed

+36
-13
lines changed

21 files changed

+36
-13
lines changed

hello-world/angular/angular.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,8 @@
9191
}
9292
}
9393
}
94+
},
95+
"cli": {
96+
"analytics": false
9497
}
9598
}

hello-world/angular/src/app/video-capture/video-capture.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export class VideoCaptureComponent {
7373

7474
// Open camera and start scanning single barcode.
7575
await this.cameraEnhancer.open();
76+
cameraView.setScanLaserVisible(true);
7677
if (this.isDestroyed) {
7778
throw Error(componentDestroyedErrorMsg);
7879
}

hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/decodeVideo.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ window.startVideoDecode = async () => {
3737

3838
// Open camera and start scanning single barcode.
3939
await cameraEnhancer.open();
40+
cameraView.setScanLaserVisible(true);
4041
await cvRouter.startCapturing("ReadSingleBarcode");
4142
} catch (ex) {
4243
let errMsg = ex.message || ex;

hello-world/electron/action.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Dynamsoft.Core.CoreModule.loadWasm(["DBR"]);
6666

6767
// Open camera and start scanning single barcode.
6868
await cameraEnhancer.open();
69+
cameraView.setScanLaserVisible(true);
6970
await cvRouter.startCapturing("ReadSingleBarcode");
7071
} catch (ex) {
7172
let errMsg = ex.message || ex;

hello-world/es6.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ <h1>Hello World for ES6 (Decode via Camera)</h1>
7777

7878
// Open camera and start scanning single barcode.
7979
await cameraEnhancer.open();
80+
cameraView.setScanLaserVisible(true);
8081
await cvRouter.startCapturing("ReadSingleBarcode");
8182
} catch (ex) {
8283
let errMsg = ex.message || ex;

hello-world/hello-world.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ <h1>Hello World (Decode via Camera)</h1>
7070

7171
// Open camera and start scanning single barcode.
7272
await cameraEnhancer.open();
73+
cameraView.setScanLaserVisible(true);
7374
await cvRouter.startCapturing("ReadSingleBarcode");
7475
} catch (ex) {
7576
let errMsg = ex.message || ex;

hello-world/native-ts/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ let cvRouter: CaptureVisionRouter;
6464

6565
// Open camera and start scanning single barcode.
6666
await cameraEnhancer.open();
67+
cameraView.setScanLaserVisible(true);
6768
await cvRouter.startCapturing("ReadSingleBarcode");
6869
} catch (ex: any) {
6970
let errMsg = ex.message || ex;

hello-world/next/components/VideoCapture/VideoCapture.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ function VideoCapture() {
6969

7070
// Open camera and start scanning single barcode.
7171
await cameraEnhancer.open();
72+
cameraView.setScanLaserVisible(true);
7273
if (isDestroyed) {
7374
throw Error(componentDestroyedErrorMsg);
7475
}

hello-world/nuxt/components/VideoCapture.client.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ onMounted(async () => {
5959
6060
// Open camera and start scanning single barcode.
6161
await cameraEnhancer.open();
62+
cameraView.setScanLaserVisible(true);
6263
if (isDestroyed) { throw Error(componentDestroyedErrorMsg); }
6364
await cvRouter.startCapturing("ReadSingleBarcode");
6465
if (isDestroyed) { throw Error(componentDestroyedErrorMsg); }

hello-world/pwa/helloworld-pwa.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ <h1>Hello World for PWA</h1>
8282

8383
// Open camera and start scanning single barcode.
8484
await cameraEnhancer.open();
85+
cameraView.setScanLaserVisible(true);
8586
await cvRouter.startCapturing("ReadSingleBarcode");
8687
} catch (ex) {
8788
let errMsg = ex.message || ex;

hello-world/pwa/service-worker.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
const engineResourcePaths = {
22
std: "https://cdn.jsdelivr.net/npm/[email protected]/dist/",
33
dip: "https://cdn.jsdelivr.net/npm/[email protected]/dist/",
4-
core: "https://cdn.jsdelivr.net/npm/[email protected].20/dist/",
5-
license: "https://cdn.jsdelivr.net/npm/[email protected].20/dist/",
6-
cvr: "https://cdn.jsdelivr.net/npm/[email protected].21/dist/",
4+
core: "https://cdn.jsdelivr.net/npm/[email protected].21/dist/",
5+
license: "https://cdn.jsdelivr.net/npm/[email protected].21/dist/",
6+
cvr: "https://cdn.jsdelivr.net/npm/[email protected].22/dist/",
77
dbr: "https://cdn.jsdelivr.net/npm/[email protected]/dist/",
88
dce: "https://cdn.jsdelivr.net/npm/[email protected]/dist/",
9-
utility: "https://cdn.jsdelivr.net/npm/[email protected].20/dist/",
9+
utility: "https://cdn.jsdelivr.net/npm/[email protected].21/dist/",
1010
};
1111

1212
// Files to cache

hello-world/react-hooks/src/components/VideoCapture/VideoCapture.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ function VideoCapture() {
6969

7070
// Open camera and start scanning single barcode.
7171
await cameraEnhancer.open();
72+
cameraView.setScanLaserVisible(true);
7273
if (isDestroyed) {
7374
throw Error(componentDestroyedErrorMsg);
7475
}

hello-world/react/src/components/VideoCapture/VideoCapture.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class VideoCapture extends React.Component {
6767

6868
// Open camera and start scanning single barcode.
6969
await this.cameraEnhancer.open();
70+
cameraView.setScanLaserVisible(true);
7071
if (this.isDestroyed) {
7172
throw Error(componentDestroyedErrorMsg);
7273
}

hello-world/requirejs.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ <h1>Hello World for RequireJS (Decode via Camera)</h1>
8080

8181
// Open camera and start scanning single barcode.
8282
await cameraEnhancer.open();
83+
cameraView.setScanLaserVisible(true);
8384
await cvRouter.startCapturing("ReadSingleBarcode");
8485
} catch (ex) {
8586
let errMsg = ex.message || ex;

hello-world/svelte/src/components/VideoCapture.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
6969
// Open camera and start scanning single barcode.
7070
await cameraEnhancer.open();
71+
cameraView.setScanLaserVisible(true);
7172
if (isDestroyed) {
7273
throw Error(componentDestroyedErrorMsg);
7374
}

hello-world/vue/src/components/VideoCapture.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ onMounted(async () => {
5959
6060
// Open camera and start scanning single barcode.
6161
await cameraEnhancer.open();
62+
cameraView.setScanLaserVisible(true);
6263
if (isDestroyed) { throw Error(componentDestroyedErrorMsg); }
6364
await cvRouter.startCapturing("ReadSingleBarcode");
6465
if (isDestroyed) { throw Error(componentDestroyedErrorMsg); }

others/debug/public/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,20 @@ <h1 style="font-size: 1.5em">Read Barcodes from Camera - Debug</h1>
141141
let pInit = init();
142142

143143
document.getElementById("btn-start-capturing").addEventListener("click", async () => {
144-
const { cameraEnhancer, cvRouter } = await pInit;
144+
const { cameraEnhancer, cvRouter, cameraView } = await pInit;
145145

146146
// Open camera and start scanning single barcode.
147147
await cameraEnhancer.open();
148+
cameraView.setScanLaserVisible(true);
148149
await cvRouter.startCapturing("ReadSingleBarcode");
149150
});
150151

151152
document.getElementById("btn-stop-capturing").addEventListener("click", async () => {
152-
const { cameraEnhancer, cvRouter } = await pInit;
153+
const { cameraEnhancer, cvRouter, cameraView } = await pInit;
153154

154155
cvRouter.stopCapturing();
155156
cameraEnhancer.close();
157+
cameraView.setScanLaserVisible(false);
156158
});
157159

158160
let switchVideoSettings = async () => {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ <h3>Click each input box to fill in!</h3>
119119
inputsContainer.style.display = "";
120120
loadingIndicator.style.display = "none";
121121

122-
return { cameraEnhancer, cvRouter };
122+
return { cameraEnhancer, cvRouter, cameraView };
123123
};
124124

125125
let pInit; // promise of init
@@ -128,7 +128,7 @@ <h3>Click each input box to fill in!</h3>
128128
for (let input of allInputs) {
129129
input.addEventListener("click", async function () {
130130
try {
131-
const { cameraEnhancer, cvRouter } = await (pInit = pInit || init());
131+
const { cameraEnhancer, cvRouter, cameraView } = await (pInit = pInit || init());
132132

133133
// Define a callback for results.
134134
const resultReceiver = {
@@ -150,6 +150,7 @@ <h3>Click each input box to fill in!</h3>
150150

151151
// Open camera and start scanning single barcode.
152152
await cameraEnhancer.open();
153+
cameraView.setScanLaserVisible(true);
153154
await cvRouter.startCapturing("ReadSingleBarcode");
154155
} catch (ex) {
155156
let errMsg = ex.message || ex;

use-case/locate-an-item-with-barcode/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ <h6 id="camera-switch-notification"></h6>
375375
// [Optional] - Custom UI to select camera and resolution
376376
try {
377377
await cameraEnhancer.open();
378-
379378
// Populate a list of cameras and the resolution
380379
const cameraList = await cameraEnhancer.getAllCameras();
381380
// Get current camera and current resolution to set as selected
@@ -410,6 +409,7 @@ <h6 id="camera-switch-notification"></h6>
410409
return {
411410
cameraEnhancer,
412411
cvRouter,
412+
cameraView
413413
};
414414
};
415415
let pInit; // promise of init
@@ -425,7 +425,7 @@ <h6 id="camera-switch-notification"></h6>
425425

426426
const itemIdInput = document.getElementById("item-id");
427427
try {
428-
const { cameraEnhancer, cvRouter } = await (pInit = pInit || init());
428+
const { cameraEnhancer, cvRouter, cameraView } = await (pInit = pInit || init());
429429

430430
// Define a callback for results.
431431
resultReceiver = {
@@ -520,7 +520,7 @@ <h6 id="camera-switch-notification"></h6>
520520
closeButton.innerText = "Locate another item";
521521

522522
try {
523-
const { cameraEnhancer, cvRouter } = await (pInit = pInit || init());
523+
const { cameraEnhancer, cvRouter, cameraView } = await (pInit = pInit || init());
524524

525525
// Prepare to show overlay of the item ID on the CameraView
526526
resultsContainer.innerHTML = "";

use-case/read-a-drivers-license/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,12 @@ <h1>Read a Driver's License</h1>
194194
}
195195

196196
async function switchToSingleFrameMode() {
197-
const { cameraEnhancer, cvRouter } = await pInit;
197+
const { cameraEnhancer, cvRouter, cameraView } = await pInit;
198198
cvRouter.stopCapturing();
199199
cameraEnhancer.close();
200200
cameraEnhancer.singleFrameMode = "image";
201201
await cameraEnhancer.open();
202+
cameraView.setScanLaserVisible(true);
202203
await cvRouter.startCapturing("ReadDenseBarcodes");
203204
}
204205

@@ -208,11 +209,12 @@ <h1>Read a Driver's License</h1>
208209
document.querySelector("#span-tip").hidden = false;
209210
cameraViewContainer.style.display = "block";
210211

211-
const { cameraEnhancer, cvRouter } = await pInit;
212+
const { cameraEnhancer, cvRouter, cameraView } = await pInit;
212213
cvRouter.stopCapturing();
213214
cameraEnhancer.close();
214215
cameraEnhancer.singleFrameMode = "disabled";
215216
await cameraEnhancer.open();
217+
cameraView.setScanLaserVisible(true);
216218
await cvRouter.startCapturing("ReadDenseBarcodes");
217219

218220
messageDisplayTimer = setTimeout(() => {

use-case/show-result-texts-on-the-video.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ <h3>Scan barcodes to display results as overlays on video</h3>
164164

165165
// Open camera and start scanning single barcode.
166166
await cameraEnhancer.open();
167+
cameraView.setScanLaserVisible(true);
167168
await cvRouter.startCapturing("ReadBarcodes_SpeedFirst");
168169
} catch (ex) {
169170
let errMsg = ex.message || ex;

0 commit comments

Comments
 (0)