diff --git a/src/page/index.js b/src/page/index.js
index 2d3e969..1e32360 100644
--- a/src/page/index.js
+++ b/src/page/index.js
@@ -15,16 +15,18 @@ PAGES.index = {
Buscar con Aztec
`;
- const html5QrCode = new Html5Qrcode(
- qrscan, { formatsToSupport: [Html5QrcodeSupportedFormats.AZTEC] });
- const qrCodeSuccessCallback = (decodedText, decodedResult) => {
- /* handle success */
- alert(decodedText)
- html5QrCode.stop()
- };
- const config = { fps: 10, qrbox: { width: 250, height: 250 } };
+ var html5QrcodeScanner = new Html5QrcodeScanner(
+ qrscan, { fps: 10, qrbox: 250 });
- // If you want to prefer front camera
- html5QrCode.start({ facingMode: "user" }, config, qrCodeSuccessCallback);
+ function onScanSuccess(decodedText, decodedResult) {
+ // Handle on success condition with the decoded text or result.
+ alert(`Scan result: ${decodedText}`, decodedResult);
+ // ...
+ html5QrcodeScanner.clear();
+ // ^ this will stop the scanner (video feed) and clear the scan area.
+
+ }
+
+ html5QrcodeScanner.render(onScanSuccess);
}
-};
\ No newline at end of file
+}
\ No newline at end of file