File tree Expand file tree Collapse file tree 1 file changed +0
-16
lines changed
Expand file tree Collapse file tree 1 file changed +0
-16
lines changed Original file line number Diff line number Diff line change @@ -33,29 +33,13 @@ export default class extends Controller {
3333 connect ( ) {
3434 console . log ( 'Init Scanner' ) ;
3535
36- //This function ensures, that the qrbox is 70% of the total viewport
37- let qrboxFunction = function ( viewfinderWidth , viewfinderHeight ) {
38- let minEdgePercentage = 0.7 ; // 70%
39- let minEdgeSize = Math . min ( viewfinderWidth , viewfinderHeight ) ;
40- let qrboxSize = Math . floor ( minEdgeSize * minEdgePercentage ) ;
41- return {
42- width : qrboxSize ,
43- height : qrboxSize
44- } ;
45- }
46-
4736 //Try to get the number of cameras. If the number is 0, then the promise will fail, and we show the warning dialog
4837 Html5Qrcode . getCameras ( ) . catch ( ( devices ) => {
4938 document . getElementById ( 'scanner-warning' ) . classList . remove ( 'd-none' ) ;
5039 } ) ;
5140
5241 this . _scanner = new Html5QrcodeScanner ( this . element . id , {
5342 fps : 10 ,
54- qrbox : qrboxFunction ,
55- experimentalFeatures : {
56- //This option improves reading quality on android chrome
57- useBarCodeDetectorIfSupported : true
58- }
5943 } , false ) ;
6044
6145 this . _scanner . render ( this . onScanSuccess . bind ( this ) ) ;
You can’t perform that action at this time.
0 commit comments