Some checks failed
CI - 4NK Node / Code Quality (push) Failing after 31s
CI - 4NK Node / Unit Tests (push) Failing after 29s
CI - 4NK Node / Integration Tests (push) Successful in 26s
CI - 4NK Node / Security Tests (push) Failing after 28s
CI - 4NK Node / Docker Build & Test (push) Failing after 10s
CI - 4NK Node / Documentation Tests (push) Successful in 4s
CI - 4NK Node / Performance Tests (push) Successful in 33s
CI - 4NK Node / Notify (push) Failing after 2s
14 lines
543 B
JavaScript
Executable File
14 lines
543 B
JavaScript
Executable File
function onScanSuccess(decodedText, decodedResult) {
|
|
// handle the scanned code as you like, for example:
|
|
console.log(`Code matched = ${decodedText}`, decodedResult);
|
|
}
|
|
|
|
function onScanFailure(error) {
|
|
// handle scan failure, usually better to ignore and keep scanning.
|
|
// for example:
|
|
console.warn(`Code scan error = ${error}`);
|
|
}
|
|
|
|
let html5QrcodeScanner = new Html5QrcodeScanner('reader', { fps: 10, qrbox: { width: 250, height: 250 } }, /* verbose= */ false);
|
|
html5QrcodeScanner.render(onScanSuccess, onScanFailure);
|