Skip to content

Commit bbfd6d6

Browse files
Merge pull request #22 from chaudharynikhil7/main
Added FAQ section to the capture vision docs
2 parents bd8d4fb + 1a4abb5 commit bbfd6d6

File tree

3 files changed

+95
-0
lines changed

3 files changed

+95
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
layout: default-layout
3+
title: How can I prevent my browser from freezing or showing a grey screen when I switch between apps and return to it?
4+
keywords: Dynamsoft Barcode Reader, FAQ, tech basic, frozen screen, grey screen
5+
description: How can I prevent my browser from freezing or showing a grey screen when I switch between apps and return to it?
6+
needAutoGenerateSidebar: false
7+
---
8+
9+
# How can I prevent my browser from freezing or showing a grey screen when I switch between apps and return to it?
10+
11+
[<< Back to FAQ index](index.md)
12+
13+
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:
14+
15+
```javascript
16+
window.addEventListener("visibilitychange", () => {
17+
if (document.visibilityState === "hidden") {
18+
if (router && cameraEnhancer) {
19+
router.stopCapturing().then(() => {
20+
cameraEnhancer.close();
21+
});
22+
}
23+
} else if (document.visibilityState === "visible") {
24+
if (router && cameraEnhancer) {
25+
cameraEnhancer.open().then(status => {
26+
router.startCapturing("DetectDocumentBoundaries_Default");
27+
});
28+
}
29+
}
30+
});
31+
```
32+
33+
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.

programming/javascript/faq/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
permalink: /faq/index.html
8+
9+
---
10+
11+
# FAQ - JavaScript
12+
13+
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)
14+
15+
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: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
layout: default-layout
3+
title: Why am I encountering errors like "r.taskSet.intermediateResultUnits is not iterable" when using frameworks like React or Angular with Dynamsoft packages?
4+
keywords: Dynamsoft Capture Vision, FAQ, version, mismatch, taskset
5+
description: Why am I encountering errors like "r.taskSet.intermediateResultUnits is not iterable" when using frameworks like React or Angular with Dynamsoft packages?
6+
needAutoGenerateSidebar: false
7+
---
8+
9+
# Why am I encountering errors like "r.taskSet.intermediateResultUnits is not iterable" when using frameworks like React or Angular with Dynamsoft packages?
10+
11+
[<< Back to FAQ index](index.md)
12+
13+
Topic: Resolving Version Mismatch Issues in Dynamsoft Packages
14+
15+
Resolution:
16+
17+
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.
18+
19+
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:
20+
21+
```javascript
22+
Dynamsoft.Core.CoreModule.engineResourcePaths = {
23+
std: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-std@<std_version>/dist/",
24+
dip: "https://cdn.jsdelivr.net/npm/dynamsoft-image-processing@<dip_version>/dist/",
25+
core: "https://cdn.jsdelivr.net/npm/dynamsoft-core@<core_version>/dist/",
26+
license: "https://cdn.jsdelivr.net/npm/dynamsoft-license@<license_version>/dist/",
27+
cvr: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-router@<cvr_version>/dist/",
28+
dbr: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader@<dbr_version>/dist/",
29+
dce: "https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@<dce_version>/dist/"
30+
};
31+
```
32+
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.
33+
34+
```javascript
35+
//some lines from package.json
36+
"dependencies": {
37+
...
38+
"dynamsoft-barcode-reader": "<dbr_version>",
39+
"dynamsoft-camera-enhancer": "<dce_version>",
40+
"dynamsoft-capture-vision-router": "<cvr_version>",
41+
"dynamsoft-core": "<core_version>",
42+
"dynamsoft-license": "<license_version>",
43+
"dynamsoft-utility": "<utility_version>",
44+
}
45+
```
46+
47+
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)