MyGit

v2.0.13

mebjas/html5-qrcode

版本发布时间: 2021-09-30 22:41:47

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

Version 2.0.13

Added ability to set custom width and height to the scanner with config.qrbox argument.

Now we can pass config.qrbox argument as instance of interface QrDimensions.

function onScanSuccess(decodedText, decodedResult) { /* handle success. */ }
function onScanFailure(error) { /* handle failure. */ }

let config = { fps: 10, qrbox: { width: 250, height: 250 } };

let html5QrcodeScanner = new Html5QrcodeScanner(
    "reader", config , /* verbose= */ false);
html5QrcodeScanner.render(onScanSuccess, onScanFailure);

For a rectangular QR Scanning box we can set it to something like:

// .. rest of the code
let config = { fps: 10, qrbox: { width: 400, height: 150 } };

let html5QrcodeScanner = new Html5QrcodeScanner(
    "reader", config , /* verbose= */ false);
html5QrcodeScanner.render(onScanSuccess, onScanFailure);

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

1、 html5-qrcode.min.js 386.17KB

查看:2021-09-30发行的版本