Dynamsoft / barcode-reader-javascript

Dynamsoft Barcode Reader JavaScript SDK for package managers. PDF417, QR Code, DataMatrix, MaxiCode and more are supported.
https://www.dynamsoft.com/barcode-reader/sdk-javascript/
Other
175 stars 109 forks source link

iOS 17.4.1 Error: Failed to play video. Timeout. #147

Open DaryaSuv opened 6 months ago

DaryaSuv commented 6 months ago

Hello, Could you take a look on issue I'm facing with dynamsoft-barcode-reader

Full list of installed dependencies and versions: "dynamsoft-barcode-reader": "10.0.21", "dynamsoft-camera-enhancer": "4.0.1", "dynamsoft-capture-vision-router": "2.0.32", "dynamsoft-capture-vision-std": "1.0.0", "dynamsoft-core": "3.0.33", "dynamsoft-image-processing": "2.0.30", "dynamsoft-license": "3.0.40", "dynamsoft-utility": "1.0.21",

Case: The integration was made fully according to the react-hook sample. Barcode scanner component is set up in modal window. For the first load of modal window with barcode scanner 'request for access to camera' message is shown -> scanning works as expected. But if i will close this modal window with scanner, lock phone for 1-2 minutes, unlock and try to open scanner one more time, 'request for access to camera' message is shown -> error appears, scanning not working.

Please take a look on the screenshots:

image image

Thank you in advance

Keillion commented 6 months ago

It's a known issue in iOS17.4.1. iOS needs more time to open camera now.

Solution 1

Pls update dynamsoft-camera-enhancer to 4.0.3 in package.json.

npm i dynamsoft-camera-enhancer@4.0.3 -E

Update engineResourcePaths:

CoreModule.engineResourcePaths.dce = "https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@4.0.3/dist/"

Solution 2

If you encounter code incompatibility, you can completely remove all dependencies of dynamsoft, and use dynamsoft-barcode-reader-bundle@10.2.1000 instead.

npm i dynamsoft-barcode-reader-bundle@10.2.1000 -E

Update engineResourcePaths:

CoreModule.engineResourcePaths = {
  std: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-std@1.2.10/dist/",
  dip: "https://cdn.jsdelivr.net/npm/dynamsoft-image-processing@2.2.30/dist/",
  core: "https://cdn.jsdelivr.net/npm/dynamsoft-core@3.2.30/dist/",
  license: "https://cdn.jsdelivr.net/npm/dynamsoft-license@3.2.21/dist/",
  cvr: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-router@2.2.30/dist/",
  dbr: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader@10.2.10/dist/",
  dce: "https://cdn.jsdelivr.net/npm/dynamsoft-camera-enhancer@4.0.3/dist/"
};
DaryaSuv commented 6 months ago

Thank you a lot, all works fine