Skip to content

Commit 632f723

Browse files
committed
add engineResourcePath setting for self hosting
1 parent 373e4a2 commit 632f723

File tree

8 files changed

+16
-5
lines changed

8 files changed

+16
-5
lines changed

foundational-api-samples/hello-world/blazor/hello-world-blazor/BlazorApp/wwwroot/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848

4949
// Optional. Used to load wasm resources in advance, reducing latency between video playing and barcode decoding.
5050
Dynamsoft.Core.CoreModule.loadWasm(["DBR"]);
51-
51+
// // 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
52+
// Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = "../../../distributables/";
5253
// Defined globally for easy debugging.
5354
let cameraEnhancer, cvRouter;
5455
let videoModuleLoaded = false;

foundational-api-samples/hello-world/hello-world.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ <h1>Hello World (Decode via Camera)</h1>
3535

3636
// Optional. Used to load wasm resources in advance, reducing latency between video playing and barcode decoding.
3737
Dynamsoft.Core.CoreModule.loadWasm(["DBR"]);
38+
// // 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
39+
// Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = "../../../distributables/";
3840
// Defined globally for easy debugging.
3941
let cameraEnhancer, cvRouter;
4042

foundational-api-samples/hello-world/read-an-image.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ <h1>Hello World (Read an Image)</h1>
3535

3636
// Optional. Preload "BarcodeReader" module for reading barcodes. It will save time on the initial decoding by skipping the module loading.
3737
Dynamsoft.Core.CoreModule.loadWasm(["DBR"]);
38-
38+
// // 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
39+
// Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = "../../../distributables/";
3940
const resultsContainer = document.querySelector("#results");
4041

4142
let cvRouter; // an instance of CaptureVisionRouter

foundational-api-samples/others/debug/public/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ <h1 style="font-size: 1.5em">Read Barcodes from Camera - Debug</h1>
4747

4848
// Preload "BarcodeReader" module for reading barcodes. It will save time on the initial decoding by skipping the module loading.
4949
Dynamsoft.Core.CoreModule.loadWasm(["DBR"]);
50-
50+
// // 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
51+
// Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = "../../../distributables/";
5152
const init = async () => {
5253
try {
5354
// Create a `CameraEnhancer` instance for camera control and a `CameraView` instance for UI control.

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ <h3>Click each input box to fill in!</h3>
8383

8484
// Preload "BarcodeReader" module for reading barcodes. It will save time on the initial decoding by skipping the module loading.
8585
Dynamsoft.Core.CoreModule.loadWasm(["DBR"]);
86-
86+
// // 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
87+
// Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = "../../../distributables/";
8788
const inputsContainer = document.getElementById("inputs-container");
8889
const loadingIndicator = document.getElementById("lib-load");
8990
const cameraViewContainer = document.getElementById("camera-view-container");

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ <h6 id="camera-switch-notification"></h6>
324324

325325
// Preload "BarcodeReader" module for reading barcodes. It will save time on the initial decoding by skipping the module loading.
326326
Dynamsoft.Core.CoreModule.loadWasm(["dbr"]);
327+
// // 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
328+
// Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = "../../../distributables/";
327329

328330
const cameraViewContainer = document.getElementById("camera-view-container");
329331
const cameraViewTitle = document.getElementById("camera-view-title");

foundational-api-samples/use-case/read-a-drivers-license/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ <h1>Read a Driver's License</h1>
6969

7070
// Preload "BarcodeReader" module for reading barcodes. It will save time on the initial decoding by skipping the module loading.
7171
Dynamsoft.Core.CoreModule.loadWasm(["DBR", "DCP"]);
72+
// // 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
73+
// Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = "../../../distributables/";
7274
Dynamsoft.DCP.CodeParserModule.loadSpec("AAMVA_DL_ID");
7375
Dynamsoft.DCP.CodeParserModule.loadSpec("AAMVA_DL_ID_WITH_MAG_STRIPE");
7476
Dynamsoft.DCP.CodeParserModule.loadSpec("SOUTH_AFRICA_DL");

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ <h3>Scan barcodes to display results as overlays on video</h3>
6464

6565
// Optional. Used to load wasm resources in advance, reducing latency between video playing and barcode decoding.
6666
Dynamsoft.Core.CoreModule.loadWasm(["DBR"]);
67-
67+
// // 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
68+
// Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = "../../../distributables/";
6869
const resultsContainer = document.querySelector("#results");
6970

7071
(async () => {

0 commit comments

Comments
 (0)