MyGit

V2.0.8

mebjas/html5-qrcode

版本发布时间: 2021-06-13 13:28:18

mebjas/html5-qrcode最新发布版本:v2.3.8(2023-04-15 13:48:51)

Version 2.0.8

Example usage:

Only scanning with QR code - using Html5Qrcode

const html5QrCode = new Html5Qrcode(
    "reader", { formatsToSupport: [ Html5QrcodeSupportedFormats.QR_CODE ] });
const qrCodeSuccessCallback = message => { /* handle success */ }
const config = { fps: 10, qrbox: 250 };

// If you want to prefer front camera
html5QrCode.start({ facingMode: "user" }, config, qrCodeSuccessCallback);

Scanning with QR code and bunch of UPC codes - using Html5QrcodeScanner

function onScanSuccess(qrMessage) {
    // handle the scanned code as you like, for example:
    console.log(`QR matched = ${qrMessage}`);
}

const formatsToSupport = [
    Html5QrcodeSupportedFormats.QR_CODE,
    Html5QrcodeSupportedFormats.UPC_A,
    Html5QrcodeSupportedFormats.UPC_E,
    Html5QrcodeSupportedFormats.UPC_EAN_EXTENSION,
];
const html5QrcodeScanner = new Html5QrcodeScanner(
    "reader",
    { fps: 10, qrbox: 250, formatsToSupport: formatsToSupport },
    /* verbose= */ false);
html5QrcodeScanner.render(onScanSuccess);

By default scanning with all formats supported today

function onScanSuccess(qrMessage) {
    // handle the scanned code as you like, for example:
    console.log(`QR matched = ${qrMessage}`);
}

const html5QrcodeScanner = new Html5QrcodeScanner(
    "reader", { fps: 10, qrbox: 250 }, /* verbose= */ false);
html5QrcodeScanner.render(onScanSuccess);

相关地址:原始地址 下载(tar) 下载(zip)

1、 html5-qrcode.min.js 316.21KB

查看:2021-06-13发行的版本