A QR Code Reader Web Component. A custom event makes it easy to get notified about new reads.
This repository was forked from https://github.com/educastellano/qr-reader. It is using the jsqrcode lib.
Feel free to send me any issues or pull requests!
Check our the Demo.
This is a highly experimental piece of software. To the best of my knowledge the QR reader only works on recent Chrome browsers (Desktop and Mobile on Android) and was tested with Chrome >= 48.0.
As simple as that:
<link rel="import" href="qr-reader.html">
<qr-reader autostart></qr-reader>
<script>
var qrReader = document.querySelector('qr-reader');
qrReader.addEventListener("qr-code-read", function(e) {
alert(e.detail);
});
</script>
Instead of defining the autostart
attribute feel free to call qrReader.startScan()
whenever your application is
ready to scan.