diff --git a/hello-world/angular/angular.json b/hello-world/angular/angular.json index 5b45adf1..7dce69c2 100644 --- a/hello-world/angular/angular.json +++ b/hello-world/angular/angular.json @@ -91,5 +91,8 @@ } } } + }, + "cli": { + "analytics": false } } diff --git a/hello-world/angular/src/app/video-capture/video-capture.component.ts b/hello-world/angular/src/app/video-capture/video-capture.component.ts index 2e671a7d..6899107a 100644 --- a/hello-world/angular/src/app/video-capture/video-capture.component.ts +++ b/hello-world/angular/src/app/video-capture/video-capture.component.ts @@ -73,6 +73,7 @@ export class VideoCaptureComponent { // Open camera and start scanning single barcode. await this.cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); if (this.isDestroyed) { throw Error(componentDestroyedErrorMsg); } diff --git a/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/decodeVideo.js b/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/decodeVideo.js index 5376d891..dc427e12 100644 --- a/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/decodeVideo.js +++ b/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/decodeVideo.js @@ -37,6 +37,7 @@ window.startVideoDecode = async () => { // Open camera and start scanning single barcode. await cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); await cvRouter.startCapturing("ReadSingleBarcode"); } catch (ex) { let errMsg = ex.message || ex; diff --git a/hello-world/electron/action.js b/hello-world/electron/action.js index 8aedf5da..bc57a592 100644 --- a/hello-world/electron/action.js +++ b/hello-world/electron/action.js @@ -66,6 +66,7 @@ Dynamsoft.Core.CoreModule.loadWasm(["DBR"]); // Open camera and start scanning single barcode. await cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); await cvRouter.startCapturing("ReadSingleBarcode"); } catch (ex) { let errMsg = ex.message || ex; diff --git a/hello-world/es6.html b/hello-world/es6.html index ce73336e..a65ee63c 100644 --- a/hello-world/es6.html +++ b/hello-world/es6.html @@ -77,6 +77,7 @@

Hello World for ES6 (Decode via Camera)

// Open camera and start scanning single barcode. await cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); await cvRouter.startCapturing("ReadSingleBarcode"); } catch (ex) { let errMsg = ex.message || ex; diff --git a/hello-world/hello-world.html b/hello-world/hello-world.html index b7943359..1d6b91e9 100644 --- a/hello-world/hello-world.html +++ b/hello-world/hello-world.html @@ -70,6 +70,7 @@

Hello World (Decode via Camera)

// Open camera and start scanning single barcode. await cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); await cvRouter.startCapturing("ReadSingleBarcode"); } catch (ex) { let errMsg = ex.message || ex; diff --git a/hello-world/native-ts/index.ts b/hello-world/native-ts/index.ts index 3fefa386..fc61aff4 100644 --- a/hello-world/native-ts/index.ts +++ b/hello-world/native-ts/index.ts @@ -64,6 +64,7 @@ let cvRouter: CaptureVisionRouter; // Open camera and start scanning single barcode. await cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); await cvRouter.startCapturing("ReadSingleBarcode"); } catch (ex: any) { let errMsg = ex.message || ex; diff --git a/hello-world/next/components/VideoCapture/VideoCapture.tsx b/hello-world/next/components/VideoCapture/VideoCapture.tsx index 89c6aac8..5603af78 100644 --- a/hello-world/next/components/VideoCapture/VideoCapture.tsx +++ b/hello-world/next/components/VideoCapture/VideoCapture.tsx @@ -69,6 +69,7 @@ function VideoCapture() { // Open camera and start scanning single barcode. await cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); if (isDestroyed) { throw Error(componentDestroyedErrorMsg); } diff --git a/hello-world/nuxt/components/VideoCapture.client.vue b/hello-world/nuxt/components/VideoCapture.client.vue index 88a9cc5a..70d22b30 100644 --- a/hello-world/nuxt/components/VideoCapture.client.vue +++ b/hello-world/nuxt/components/VideoCapture.client.vue @@ -59,6 +59,7 @@ onMounted(async () => { // Open camera and start scanning single barcode. await cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); if (isDestroyed) { throw Error(componentDestroyedErrorMsg); } await cvRouter.startCapturing("ReadSingleBarcode"); if (isDestroyed) { throw Error(componentDestroyedErrorMsg); } diff --git a/hello-world/pwa/helloworld-pwa.html b/hello-world/pwa/helloworld-pwa.html index 5c666009..a0966aaf 100644 --- a/hello-world/pwa/helloworld-pwa.html +++ b/hello-world/pwa/helloworld-pwa.html @@ -82,6 +82,7 @@

Hello World for PWA

// Open camera and start scanning single barcode. await cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); await cvRouter.startCapturing("ReadSingleBarcode"); } catch (ex) { let errMsg = ex.message || ex; diff --git a/hello-world/pwa/service-worker.js b/hello-world/pwa/service-worker.js index 3997be48..4ebc2de2 100644 --- a/hello-world/pwa/service-worker.js +++ b/hello-world/pwa/service-worker.js @@ -1,12 +1,12 @@ const engineResourcePaths = { std: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-std@1.4.10/dist/", dip: "https://cdn.jsdelivr.net/npm/dynamsoft-image-processing@2.4.20/dist/", - core: "https://cdn.jsdelivr.net/npm/dynamsoft-core@3.4.20/dist/", - license: "https://cdn.jsdelivr.net/npm/dynamsoft-license@3.4.20/dist/", - cvr: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-router@2.4.21/dist/", + core: "https://cdn.jsdelivr.net/npm/dynamsoft-core@3.4.21/dist/", + license: "https://cdn.jsdelivr.net/npm/dynamsoft-license@3.4.21/dist/", + cvr: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-router@2.4.22/dist/", dbr: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader@10.4.20/dist/", dce: "https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@4.1.0/dist/", - utility: "https://cdn.jsdelivr.net/npm/dynamsoft-utility@1.4.20/dist/", + utility: "https://cdn.jsdelivr.net/npm/dynamsoft-utility@1.4.21/dist/", }; // Files to cache diff --git a/hello-world/react-hooks/src/components/VideoCapture/VideoCapture.tsx b/hello-world/react-hooks/src/components/VideoCapture/VideoCapture.tsx index 494a322d..2a16f529 100644 --- a/hello-world/react-hooks/src/components/VideoCapture/VideoCapture.tsx +++ b/hello-world/react-hooks/src/components/VideoCapture/VideoCapture.tsx @@ -69,6 +69,7 @@ function VideoCapture() { // Open camera and start scanning single barcode. await cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); if (isDestroyed) { throw Error(componentDestroyedErrorMsg); } diff --git a/hello-world/react/src/components/VideoCapture/VideoCapture.tsx b/hello-world/react/src/components/VideoCapture/VideoCapture.tsx index 013963fb..e20c7c6d 100644 --- a/hello-world/react/src/components/VideoCapture/VideoCapture.tsx +++ b/hello-world/react/src/components/VideoCapture/VideoCapture.tsx @@ -67,6 +67,7 @@ class VideoCapture extends React.Component { // Open camera and start scanning single barcode. await this.cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); if (this.isDestroyed) { throw Error(componentDestroyedErrorMsg); } diff --git a/hello-world/requirejs.html b/hello-world/requirejs.html index 9ffe2cdc..9a4a15ee 100644 --- a/hello-world/requirejs.html +++ b/hello-world/requirejs.html @@ -80,6 +80,7 @@

Hello World for RequireJS (Decode via Camera)

// Open camera and start scanning single barcode. await cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); await cvRouter.startCapturing("ReadSingleBarcode"); } catch (ex) { let errMsg = ex.message || ex; diff --git a/hello-world/svelte/src/components/VideoCapture.svelte b/hello-world/svelte/src/components/VideoCapture.svelte index 9db2c92f..0b171a41 100644 --- a/hello-world/svelte/src/components/VideoCapture.svelte +++ b/hello-world/svelte/src/components/VideoCapture.svelte @@ -68,6 +68,7 @@ // Open camera and start scanning single barcode. await cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); if (isDestroyed) { throw Error(componentDestroyedErrorMsg); } diff --git a/hello-world/vue/src/components/VideoCapture.vue b/hello-world/vue/src/components/VideoCapture.vue index f17e619c..ed4eddf0 100644 --- a/hello-world/vue/src/components/VideoCapture.vue +++ b/hello-world/vue/src/components/VideoCapture.vue @@ -59,6 +59,7 @@ onMounted(async () => { // Open camera and start scanning single barcode. await cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); if (isDestroyed) { throw Error(componentDestroyedErrorMsg); } await cvRouter.startCapturing("ReadSingleBarcode"); if (isDestroyed) { throw Error(componentDestroyedErrorMsg); } diff --git a/others/debug/public/index.html b/others/debug/public/index.html index b8ebbf3a..cf95ea15 100644 --- a/others/debug/public/index.html +++ b/others/debug/public/index.html @@ -141,18 +141,20 @@

Read Barcodes from Camera - Debug

let pInit = init(); document.getElementById("btn-start-capturing").addEventListener("click", async () => { - const { cameraEnhancer, cvRouter } = await pInit; + const { cameraEnhancer, cvRouter, cameraView } = await pInit; // Open camera and start scanning single barcode. await cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); await cvRouter.startCapturing("ReadSingleBarcode"); }); document.getElementById("btn-stop-capturing").addEventListener("click", async () => { - const { cameraEnhancer, cvRouter } = await pInit; + const { cameraEnhancer, cvRouter, cameraView } = await pInit; cvRouter.stopCapturing(); cameraEnhancer.close(); + cameraView.setScanLaserVisible(false); }); let switchVideoSettings = async () => { diff --git a/use-case/fill-a-form-with-barcode-reading.html b/use-case/fill-a-form-with-barcode-reading.html index 53d6698a..e6105c05 100644 --- a/use-case/fill-a-form-with-barcode-reading.html +++ b/use-case/fill-a-form-with-barcode-reading.html @@ -119,7 +119,7 @@

Click each input box to fill in!

inputsContainer.style.display = ""; loadingIndicator.style.display = "none"; - return { cameraEnhancer, cvRouter }; + return { cameraEnhancer, cvRouter, cameraView }; }; let pInit; // promise of init @@ -128,7 +128,7 @@

Click each input box to fill in!

for (let input of allInputs) { input.addEventListener("click", async function () { try { - const { cameraEnhancer, cvRouter } = await (pInit = pInit || init()); + const { cameraEnhancer, cvRouter, cameraView } = await (pInit = pInit || init()); // Define a callback for results. const resultReceiver = { @@ -150,6 +150,7 @@

Click each input box to fill in!

// Open camera and start scanning single barcode. await cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); await cvRouter.startCapturing("ReadSingleBarcode"); } catch (ex) { let errMsg = ex.message || ex; diff --git a/use-case/locate-an-item-with-barcode/index.html b/use-case/locate-an-item-with-barcode/index.html index 5b6aac20..524d1fa0 100644 --- a/use-case/locate-an-item-with-barcode/index.html +++ b/use-case/locate-an-item-with-barcode/index.html @@ -375,7 +375,6 @@
// [Optional] - Custom UI to select camera and resolution try { await cameraEnhancer.open(); - // Populate a list of cameras and the resolution const cameraList = await cameraEnhancer.getAllCameras(); // Get current camera and current resolution to set as selected @@ -410,6 +409,7 @@
return { cameraEnhancer, cvRouter, + cameraView }; }; let pInit; // promise of init @@ -425,7 +425,7 @@
const itemIdInput = document.getElementById("item-id"); try { - const { cameraEnhancer, cvRouter } = await (pInit = pInit || init()); + const { cameraEnhancer, cvRouter, cameraView } = await (pInit = pInit || init()); // Define a callback for results. resultReceiver = { @@ -520,7 +520,7 @@
closeButton.innerText = "Locate another item"; try { - const { cameraEnhancer, cvRouter } = await (pInit = pInit || init()); + const { cameraEnhancer, cvRouter, cameraView } = await (pInit = pInit || init()); // Prepare to show overlay of the item ID on the CameraView resultsContainer.innerHTML = ""; diff --git a/use-case/read-a-drivers-license/index.html b/use-case/read-a-drivers-license/index.html index 7cdd4096..9d22daae 100644 --- a/use-case/read-a-drivers-license/index.html +++ b/use-case/read-a-drivers-license/index.html @@ -194,11 +194,12 @@

Read a Driver's License

} async function switchToSingleFrameMode() { - const { cameraEnhancer, cvRouter } = await pInit; + const { cameraEnhancer, cvRouter, cameraView } = await pInit; cvRouter.stopCapturing(); cameraEnhancer.close(); cameraEnhancer.singleFrameMode = "image"; await cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); await cvRouter.startCapturing("ReadDenseBarcodes"); } @@ -208,11 +209,12 @@

Read a Driver's License

document.querySelector("#span-tip").hidden = false; cameraViewContainer.style.display = "block"; - const { cameraEnhancer, cvRouter } = await pInit; + const { cameraEnhancer, cvRouter, cameraView } = await pInit; cvRouter.stopCapturing(); cameraEnhancer.close(); cameraEnhancer.singleFrameMode = "disabled"; await cameraEnhancer.open(); + cameraView.setScanLaserVisible(true); await cvRouter.startCapturing("ReadDenseBarcodes"); messageDisplayTimer = setTimeout(() => { diff --git a/use-case/show-result-texts-on-the-video.html b/use-case/show-result-texts-on-the-video.html index a1346c11..45cf771e 100644 --- a/use-case/show-result-texts-on-the-video.html +++ b/use-case/show-result-texts-on-the-video.html @@ -164,6 +164,7 @@

Scan barcodes to display results as overlays on video

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