Thanks for downloading Dynamsoft Barcode Reader Package!
Your download will start shortly. If your download does not begin, click here to retry.
BarcodeScanner
Initialize and Destroy MethodsMethod | Description |
---|---|
createInstance |
Create a BarcodeScanner object. |
detectEnvironment |
Detect the current environment. Inherited from the BarcodeReader class. |
isLoaded |
Check if the decoding module is loaded. Inherited from the BarcodeReader class. |
loadWasm |
Manually load and compile the decoding WASM module. Inherited from the BarcodeReader class. |
Method | Description |
---|---|
destroy |
Destroy the BarcodeScanner object. |
getUIElement |
Get HTML element containing the BarcodeScanner object. |
setUIElement |
Set HTML element containing the BarcodeScanner object. |
Create a BarcodeScanner
object. Overrides BarcodeReader.createInstance
.
createInstance() returns Promise
Promise<BarcodeScanner>
let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();
Destroy the BarcodeScanner
object. Equivalent to the previous method deleteInstance()
. Overrides BarcodeReader.destroy
.
destroy() returns Promise
Promise<any>
Get the HTML element containing the BarcodeScanner
object.
getUIElement() returns HTMLElement
HTMLElement
Set HTML element containing the BarcodeScanner
object. In v8.0, setUIElement
can be used to set an existing video stream element. The video element of the existing video stream must specify dbrScanner-existingVideo
className.
setUIElement(elementOrUrl) returns Promise
elementOrUrl: HTMLElement | string;
Promise<void>
<video class="dbrScanner-video" playsinline="true"></video>
<script>
let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();
scanner.setUIElement(document.getElementsByClassName("dbrScanner-video")[0]);
await scanner.show();
</script>
defaultUIElementURL
instead.latest version