This is derived from html5-qrcode and in turn from jsqrcode which is in turn derived from zxing, with numberious community contributions.
This is a port to es6 with various fixes applied from the above projects, some of my own fixes, documentation, etc.
See example.html
for very rough usage.
Run npm install --save qrscan-es6
Add this to your code: import qrscan from 'qrscan
'
Starts scanning with the camera and create a video element to show. This is asynchronous, so do await qrcode.start
to capture errors.
what's being captured.
Parameters
args
Objectargs.mount
Element The DOM element to place the video in.args.scannedCallback
function When a QR code is scanned this callback is called with the string.args.debugInfoCallback
function Called with various debug info.args.debugBW
boolean If true, add a canvas below the video that shows the captured data after being converted to black and white.
Returns Object A token you should store. The token is used to stop capture.
Stop capture. This doesn't delete any generated DOM elements.
Parameters
token
Object The token returned bystart
.