HTMLDwebBarcodeScanningElement
WebComponentHTMLDwebBarcodeScanningElementLess than 1 minute
HTMLDwebBarcodeScanningElement is a WebComponent element that implements barcode scanning functionality.
Inherits from HTMLElement;
<dweb-barcode-scanning></dweb-barcode-scanning>
Properties
plugin
The property value is the BarcodeScannerPlugin Object;
getView
The property value is the parent element of the video element;
process
The property value is the BarcodeScannerPlugin.process() method;
stop
The property is just the BarcodeScannerPlugin.stop() method;
Methods
HTMLDwebBarcodeScanningElement.startScanning()
Starts the scanning process
HTMLDwebBarcodeScanningElement.stopScanning()
Stops the scanning process
HTMLDwebBarcodeScanningElement.getSupportedFormats()
Gets the supported formats
Events
Supports any events, no predefined events
Example
<body>
<dweb-barcode-scanning></dweb-barcode-scanning>
<button>scanner</button>
<script type="module">
import "@plaoc/plugins"
const barcodeScanner = document.querySelector("dweb-barcode-scanning")!
const btn = document.querySelector('button');
btn.addEventListener('click', async () => {
const res = await barcodeScanner.startScanning();
})
</script>
</body>
Platform Compatibility
Properties/Methods/Events | Android | iOS | Desktop-Dev | Desktop |
---|---|---|---|---|
getView | ✅ | ✅ | ✅ | X |
process | ✅ | ✅ | ✅ | X |
stop | ✅ | ✅ | ✅ | X |
startScanning | ✅ | ✅ | ✅ | X |
stopScanning | ✅ | ✅ | ✅ | X |
getSupportedFormats | ✅ | ✅ | ✅ | X |
Related Links
Powered by Waline v2.15.7