Table of contents
Swift
Objective-C

How to get rid of the delay when opening the camera?

« Back to FAQ index

1. Invoke loadWasm in advance

Dynamsoft.DBR.BarcodeReader.loadWasm();

2. Pre-open the camera in advance

Run the following code before calling createInstance.

navigator.mediaDevices.getUserMedia({video: true}).then(mediaStream=>{
  mediaStream.getTracks().forEach((track) => {
    track.stop();
  });
}, err=>{});

3. Skip Camera inspection(use default camera)

scanner.ifSkipCameraInspection = true;

Is this page helpful?

YesYes NoNo