Skip to content

Commit a576a4b

Browse files
Faqs added
1. version mismatch 2. app switching issue
1 parent d0909a1 commit a576a4b

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
---
3+
layout: default-layout
4+
title: How can I prevent my browser from freezing or showing a grey screen when I switch between apps and return to it?
5+
keywords: Dynamsoft Barcode Reader, FAQ, tech basic, frozen screen, grey screen
6+
description: How can I prevent my browser from freezing or showing a grey screen when I switch between apps and return to it?
7+
needAutoGenerateSidebar: false
8+
---
9+
10+
# How can I prevent my browser from freezing or showing a grey screen when I switch between apps and return to it?
11+
12+
[<< Back to FAQ index](index.md)
13+
14+
When using the camerenhancer sdk, you may encounter an issue where switching to another app and then returning to the browser results in a frozen or grey screen. To address this, utilize a workaround in the form of the following code snippet:
15+
16+
```javascript
17+
window.addEventListener("visibilitychange", () => {
18+
if (document.visibilityState === "hidden") {
19+
if (router && cameraEnhancer) {
20+
router.stopCapturing().then(() => {
21+
cameraEnhancer.close();
22+
});
23+
}
24+
} else if (document.visibilityState === "visible") {
25+
if (router && cameraEnhancer) {
26+
cameraEnhancer.open().then(status => {
27+
router.startCapturing("DetectDocumentBoundaries_Default");
28+
});
29+
}
30+
}
31+
});
32+
```
33+
34+
This code essentially closes the camera and releases associated resources when the user exits the browser. It then reopens the camera when the user returns to the browser, ensuring a smoother experience.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
layout: default-layout
3+
title: JavaScript - Dynamsoft Capture Vision FAQ
4+
keywords: faq, javascript, dcv
5+
description: Dynamsoft Capture Vision FAQ - JavaScript
6+
needAutoGenerateSidebar: false
7+
noTitleIndex: true
8+
---
9+
10+
# FAQ - JavaScript
11+
12+
1. [How can I prevent my browser from freezing or showing a grey screen when I switch between apps and return to it?](app-switching-issue.html)
13+
14+
2. [Why am I encountering errors like "r.taskSet.intermediateResultUnits is not iterable" when using frameworks like React or Angular with Dynamsoft packages?](version-mismatch.html)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
---
3+
layout: default-layout
4+
title: Why am I encountering errors like "r.taskSet.intermediateResultUnits is not iterable" when using frameworks like React or Angular with Dynamsoft packages?
5+
keywords: Dynamsoft Capture Vision, FAQ, version, mismatch, taskset
6+
description: Why am I encountering errors like "r.taskSet.intermediateResultUnits is not iterable" when using frameworks like React or Angular with Dynamsoft packages?
7+
needAutoGenerateSidebar: false
8+
---
9+
10+
# Why am I encountering errors like "r.taskSet.intermediateResultUnits is not iterable" when using frameworks like React or Angular with Dynamsoft packages?
11+
12+
[<< Back to FAQ index](index.md)
13+
14+
Topic: Resolving Version Mismatch Issues in Dynamsoft Packages
15+
16+
Resolution:
17+
18+
When using a framework like React or Angular with Dynamsoft packages, it's crucial to ensure that the version number of each Dynamsoft package listed in the `package.json` file matches the version number defined in the `engineResourcePaths` generally found defined in the cvr.ts file if you have followed the samples for developement.
19+
20+
In the `engineResourcePaths` configuration, make sure to include the correct version numbers for each Dynamsoft package mentioned in `package.json`. Here's an example of how to define the engineResourcePaths with the correct version numbers:
21+
22+
```javascript
23+
Dynamsoft.Core.CoreModule.engineResourcePaths = {
24+
std: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-std@<std_version>/dist/",
25+
dip: "https://cdn.jsdelivr.net/npm/dynamsoft-image-processing@<dip_version>/dist/",
26+
core: "https://cdn.jsdelivr.net/npm/dynamsoft-core@<core_version>/dist/",
27+
license: "https://cdn.jsdelivr.net/npm/dynamsoft-license@<license_version>/dist/",
28+
cvr: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-router@<cvr_version>/dist/",
29+
dbr: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader@<dbr_version>/dist/",
30+
dce: "https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@<dce_version>/dist/"
31+
};
32+
```
33+
Replace <std_version>, <dip_version>, <core_version>, <license_version>, <cvr_version>, <dbr_version>, and <dce_version> with the appropriate version numbers corresponding to each Dynamsoft package.
34+
35+
```javascript
36+
//some lines from package.json
37+
"dependencies": {
38+
...
39+
"dynamsoft-barcode-reader": "<dbr_version>",
40+
"dynamsoft-camera-enhancer": "<dce_version>",
41+
"dynamsoft-capture-vision-router": "<cvr_version>",
42+
"dynamsoft-core": "<core_version>",
43+
"dynamsoft-license": "<license_version>",
44+
"dynamsoft-utility": "<utility_version>",
45+
}
46+
```
47+
48+
By following these steps and maintaining consistency in version numbers between `package.json` and `engineResourcePaths`, you can mitigate version mismatch errors and ensure the proper functioning of Dynamsoft packages within your framework-based application.

0 commit comments

Comments
 (0)