Create a new BarcodeReader using a Configuration object.
A configuration object.
This will perform some basic checks, such as if the SDK was initialized, the browser supports the required APIs and the host element is visible and has a non-zero size. This will not access the camera yet, that happens in the BarcodeReader#initialize method.
OptionalcameraOptional app-supplied camera selector.
The callback receives a list of available cameras as its argument and must return one of the objects. In all other cases, the callback's result will be ignored and the default camera selection logic will apply
The callback must be set before calling BarcodeReader#initialize to have an effect.
OptionaldetectedApp-supplied barcode detection handler.
OptionalonOptional app-supplied error callback, invoked by the BarcodeReader if an unexpected error occurred while processing frames.
Destroy this BarcodeReader instance, making it unusable.
Promise that resolves when the BarcodeReader and its associated resources are fully destroyed.
the current visibility of this BarcodeReader instance
Initialize the BarcodeReader instance.
A promise resolving to an initialized BarcodeReader instance, or an SdkError object.
This will attempt to acquire a camera stream, so it is essential that the returned Promise is awaited, and that measures are taken so that the returned BarcodeReader instance is destroyed when it is no longer need. That will free the camera stream for subsequent use.
If you are getting camera-related initialization errors, the most likely cause is that you are attempting to initialize a BarcodeReader and the camera feed has not been released yet.
Start barcode recognition.
The BarcodeReader instance must have previously been successfully initialized using the BarcodeReader#initialize method.
Stop barcode recognition.
This will suspend camera frame processing/barcode recognition, but will not release the camera stream. If you no longer intend to use the BarcodeReader instance, call BarcodeReader#destroy afterward.
If you intend to only temporarily stop recognition of barcodes and resume later, call BarcodeReader#start again.
BarcodeReader is the primary interface of the STRICH SDK.