From 632f7237766bcab885c987ed04537f66b87f1f44 Mon Sep 17 00:00:00 2001 From: Justin Date: Sun, 27 Apr 2025 18:06:50 +0800 Subject: [PATCH 1/3] add engineResourcePath setting for self hosting --- .../blazor/hello-world-blazor/BlazorApp/wwwroot/index.html | 3 ++- foundational-api-samples/hello-world/hello-world.html | 2 ++ foundational-api-samples/hello-world/read-an-image.html | 3 ++- foundational-api-samples/others/debug/public/index.html | 3 ++- .../use-case/fill-a-form-with-barcode-reading.html | 3 ++- .../use-case/locate-an-item-with-barcode/index.html | 2 ++ .../use-case/read-a-drivers-license/index.html | 2 ++ .../use-case/show-result-texts-on-the-video.html | 3 ++- 8 files changed, 16 insertions(+), 5 deletions(-) diff --git a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/index.html b/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/index.html index 9415c937..c027782d 100644 --- a/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/index.html +++ b/foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/index.html @@ -48,7 +48,8 @@ // Optional. Used to load wasm resources in advance, reducing latency between video playing and barcode decoding. Dynamsoft.Core.CoreModule.loadWasm(["DBR"]); - + // // If the network is unstable or you prefer to self-host the SDK, uncomment the line below to define the root path of the engine files + // Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = "../../../distributables/"; // Defined globally for easy debugging. let cameraEnhancer, cvRouter; let videoModuleLoaded = false; diff --git a/foundational-api-samples/hello-world/hello-world.html b/foundational-api-samples/hello-world/hello-world.html index 16650e98..e2927e52 100644 --- a/foundational-api-samples/hello-world/hello-world.html +++ b/foundational-api-samples/hello-world/hello-world.html @@ -35,6 +35,8 @@

Hello World (Decode via Camera)

// Optional. Used to load wasm resources in advance, reducing latency between video playing and barcode decoding. Dynamsoft.Core.CoreModule.loadWasm(["DBR"]); + // // If the network is unstable or you prefer to self-host the SDK, uncomment the line below to define the root path of the engine files + // Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = "../../../distributables/"; // Defined globally for easy debugging. let cameraEnhancer, cvRouter; diff --git a/foundational-api-samples/hello-world/read-an-image.html b/foundational-api-samples/hello-world/read-an-image.html index 3d0d0ff6..cb827dde 100644 --- a/foundational-api-samples/hello-world/read-an-image.html +++ b/foundational-api-samples/hello-world/read-an-image.html @@ -35,7 +35,8 @@

Hello World (Read an Image)

// Optional. Preload "BarcodeReader" module for reading barcodes. It will save time on the initial decoding by skipping the module loading. Dynamsoft.Core.CoreModule.loadWasm(["DBR"]); - + // // If the network is unstable or you prefer to self-host the SDK, uncomment the line below to define the root path of the engine files + // Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = "../../../distributables/"; const resultsContainer = document.querySelector("#results"); let cvRouter; // an instance of CaptureVisionRouter diff --git a/foundational-api-samples/others/debug/public/index.html b/foundational-api-samples/others/debug/public/index.html index 3294d3c0..c0f335a3 100644 --- a/foundational-api-samples/others/debug/public/index.html +++ b/foundational-api-samples/others/debug/public/index.html @@ -47,7 +47,8 @@

Read Barcodes from Camera - Debug

// Preload "BarcodeReader" module for reading barcodes. It will save time on the initial decoding by skipping the module loading. Dynamsoft.Core.CoreModule.loadWasm(["DBR"]); - + // // If the network is unstable or you prefer to self-host the SDK, uncomment the line below to define the root path of the engine files + // Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = "../../../distributables/"; const init = async () => { try { // Create a `CameraEnhancer` instance for camera control and a `CameraView` instance for UI control. diff --git a/foundational-api-samples/use-case/fill-a-form-with-barcode-reading.html b/foundational-api-samples/use-case/fill-a-form-with-barcode-reading.html index c8af07e3..d2b0b64d 100644 --- a/foundational-api-samples/use-case/fill-a-form-with-barcode-reading.html +++ b/foundational-api-samples/use-case/fill-a-form-with-barcode-reading.html @@ -83,7 +83,8 @@

Click each input box to fill in!

// Preload "BarcodeReader" module for reading barcodes. It will save time on the initial decoding by skipping the module loading. Dynamsoft.Core.CoreModule.loadWasm(["DBR"]); - + // // If the network is unstable or you prefer to self-host the SDK, uncomment the line below to define the root path of the engine files + // Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = "../../../distributables/"; const inputsContainer = document.getElementById("inputs-container"); const loadingIndicator = document.getElementById("lib-load"); const cameraViewContainer = document.getElementById("camera-view-container"); diff --git a/foundational-api-samples/use-case/locate-an-item-with-barcode/index.html b/foundational-api-samples/use-case/locate-an-item-with-barcode/index.html index 1b0a2033..0d7c9a94 100644 --- a/foundational-api-samples/use-case/locate-an-item-with-barcode/index.html +++ b/foundational-api-samples/use-case/locate-an-item-with-barcode/index.html @@ -324,6 +324,8 @@
// Preload "BarcodeReader" module for reading barcodes. It will save time on the initial decoding by skipping the module loading. Dynamsoft.Core.CoreModule.loadWasm(["dbr"]); + // // If the network is unstable or you prefer to self-host the SDK, uncomment the line below to define the root path of the engine files + // Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = "../../../distributables/"; const cameraViewContainer = document.getElementById("camera-view-container"); const cameraViewTitle = document.getElementById("camera-view-title"); diff --git a/foundational-api-samples/use-case/read-a-drivers-license/index.html b/foundational-api-samples/use-case/read-a-drivers-license/index.html index 186ce37e..9687c31a 100644 --- a/foundational-api-samples/use-case/read-a-drivers-license/index.html +++ b/foundational-api-samples/use-case/read-a-drivers-license/index.html @@ -69,6 +69,8 @@

Read a Driver's License

// Preload "BarcodeReader" module for reading barcodes. It will save time on the initial decoding by skipping the module loading. Dynamsoft.Core.CoreModule.loadWasm(["DBR", "DCP"]); + // // If the network is unstable or you prefer to self-host the SDK, uncomment the line below to define the root path of the engine files + // Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = "../../../distributables/"; Dynamsoft.DCP.CodeParserModule.loadSpec("AAMVA_DL_ID"); Dynamsoft.DCP.CodeParserModule.loadSpec("AAMVA_DL_ID_WITH_MAG_STRIPE"); Dynamsoft.DCP.CodeParserModule.loadSpec("SOUTH_AFRICA_DL"); diff --git a/foundational-api-samples/use-case/show-result-texts-on-the-video.html b/foundational-api-samples/use-case/show-result-texts-on-the-video.html index 4b175b4c..481db3b0 100644 --- a/foundational-api-samples/use-case/show-result-texts-on-the-video.html +++ b/foundational-api-samples/use-case/show-result-texts-on-the-video.html @@ -64,7 +64,8 @@

Scan barcodes to display results as overlays on video

// Optional. Used to load wasm resources in advance, reducing latency between video playing and barcode decoding. Dynamsoft.Core.CoreModule.loadWasm(["DBR"]); - + // // If the network is unstable or you prefer to self-host the SDK, uncomment the line below to define the root path of the engine files + // Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = "../../../distributables/"; const resultsContainer = document.querySelector("#results"); (async () => { From 0b085b9950fbe3a69ad5b5621601f711f3e85a28 Mon Sep 17 00:00:00 2001 From: Justin Date: Mon, 28 Apr 2025 09:08:03 +0800 Subject: [PATCH 2/3] update resource path --- .../use-case/locate-an-item-with-barcode/index.html | 4 ++-- .../use-case/read-a-drivers-license/index.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/foundational-api-samples/use-case/locate-an-item-with-barcode/index.html b/foundational-api-samples/use-case/locate-an-item-with-barcode/index.html index 0d7c9a94..0e1518e3 100644 --- a/foundational-api-samples/use-case/locate-an-item-with-barcode/index.html +++ b/foundational-api-samples/use-case/locate-an-item-with-barcode/index.html @@ -308,7 +308,7 @@
- + - + - -