library for reading QR codes from the webcam
npm install qrreader3rd party dependency: jsqr (
``javascript
// import
import QRReader from 'QRReader';
// init
const qrCodeReader = new QRReader();
const videoElement = document.getElementById('video');
// start Capture
start() {
qrCodeReader.startCapture(videoElement)
.then(console.log)
.catch(console.log);
}
// cancel Capture
onCancelClick() {
qrCodeReader.stopCapture();
}
``