Qr
This commit is contained in:
parent
2d574ad949
commit
38a9e623a8
@ -487,9 +487,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
startScanner() {
|
startScanner() {
|
||||||
|
|
||||||
|
let qrboxFunction = function (viewfinderWidth, viewfinderHeight) {
|
||||||
|
let minEdgePercentage = 0.7; // 70%
|
||||||
|
let minEdgeSize = Math.min(viewfinderWidth, viewfinderHeight);
|
||||||
|
let qrboxSize = Math.floor(minEdgeSize * minEdgePercentage);
|
||||||
|
return {
|
||||||
|
width: qrboxSize,
|
||||||
|
height: qrboxSize
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
fps: 60,
|
fps: 60,
|
||||||
qrbox: 400
|
qrbox: qrboxFunction
|
||||||
};
|
};
|
||||||
|
|
||||||
navigator.mediaDevices.getUserMedia({ video: true })
|
navigator.mediaDevices.getUserMedia({ video: true })
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user