This page is applicable to version 8.2.3
Javascript API Reference - BarcodeReader
Initialize and Destroy Methods
Method | Description |
---|---|
createInstance() | Create a BarcodeReader object. |
destroy() | Destroy the BarcodeReader object. |
detectEnvironment() | Detect the current environment. |
isLoaded() | Check if the decoding module is loaded. |
loadWasm() | Manually load and compile the decoding WASM module. |
createInstance
Create a BarcodeReader
object.
createInstance() returns Promise
Return Value
Promise<BarcodeReader>
Sample
let reader = await Dynamsoft.BarcodeReader.createInstance();
Read barcodes from live camera
destroy
Destroy the BarcodeReader
object. Equivalent to the previous method deleteInstance()
.
destroy() returns Promise
Return Value
Promise<any>
detectEnvironment
Detect the current device environment.
detectEnvironment() returns Promise
Return Value
Promise<any>
Sample
Read barcodes from live camera
isLoaded
Check if the decoding module is loaded.
isLoaded() returns Boolean
Return Value
Boolean
Sample
Dynamsoft.BarcodeReader.isLoaded()
loadWasm
Manually load and compile the decoding module. This method can be used to preload the decoding module to avoid lengthy lazy loading.
loadWasm() returns Promise
Return Value
Promise<void>