export default function QrScanner() {
useEffect(() => {
const html5QrCode = new Html5Qrcode(
"reader", {
formatsToSupport: [Html5QrcodeSupportedFormats.QR_CODE],
opencv: {
modelAddr: "https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/wechat_qrcode"
}
}
);
const qrCodeSuccessCallback = (decodedText, decodedResult) => {
/* handle success */
console.log("decodedText:", decodedText);
};
const config = { fps: 10, qrbox: { width: 250, height: 250 } };
// If you want to prefer back camera
html5QrCode.start({ facingMode: "environment" }, config, qrCodeSuccessCallback);
return () => {
html5QrCode.stop();
}
}, [])
return (
<div>
<div id='reader'></div>
</div>
);
}
forked from mebjas/html5-qrcode
-
Notifications
You must be signed in to change notification settings - Fork 0
A cross platform HTML5 QR code reader. See end to end implementation at: https://scanapp.org
License
heyizhiyuan/html5-qrcode
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A cross platform HTML5 QR code reader. See end to end implementation at: https://scanapp.org
Resources
License
Code of conduct
Stars
Watchers
Forks
Packages 0
No packages published
Languages
- TypeScript 98.8%
- Other 1.2%