This commit is contained in:
2024-06-17 18:20:15 +02:00
parent fb54160740
commit 2296981c35
12 changed files with 117 additions and 225 deletions

View File

@@ -10,15 +10,26 @@
const qrScanner = new QrScanner( videoElem, result => console.log('decoded qr code:', result),{},)
</script>-->
<script src="qr-scanner.umd.min.js"></script>
<script src="html5-qrcode.min.js"></script>
<script>
var videoElem = document.getElementById("videl");
const qrScanner = new QrScanner( videoElem, result => console.log('decoded qr code:', result),{},)
function onScanSuccess(decodedText, decodedResult) {
console.log(`Code matched = ${decodedText}`, decodedResult);
alert(decodedText);
}
function onScanFailure(error) {
console.warn(`code scan err = ${error}`);
}
let html5QrcodeScanner = new Html5QrcodeScanner(
"reader",
{ fps: 10, qrbox: {width: 250, height: 250}},
true /*verbose*/);
Html5QrcodeScanner.render(onScanSuccess, onScanFailure);
</script>
</head>
<body>
<video id="videl"></video>
<div id="reader" width="600px"></div>
</body>
</html>