hmm
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user