Skip to content

A cross platform HTML5 QR code reader. See end to end implementation at: https://scanapp.org

License

Notifications You must be signed in to change notification settings

heyizhiyuan/html5-qrcode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Html5-QRCode-Cv

Scanning only QR code with Html5Qrcode

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>
  );
}

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

No packages published

Languages

  • TypeScript 98.8%
  • Other 1.2%