Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iphone error: undefined is not an object #912

Open
zackhalil opened this issue Apr 8, 2024 · 1 comment
Open

iphone error: undefined is not an object #912

zackhalil opened this issue Apr 8, 2024 · 1 comment

Comments

@zackhalil
Copy link

Describe the bug
When I start the scanner only on iphone it gives an error.

To Reproduce
let qrboxFunction = function(viewfinderWidth, viewfinderHeight) {
let minEdgePercentage = 0.85; //%
let minEdgeSize = Math.min(viewfinderWidth, viewfinderHeight);
let qrboxSize = Math.floor(minEdgeSize * minEdgePercentage);
return {
width: qrboxSize,
height: qrboxSize
};
}

  html5QrcodeScanner = new Html5QrcodeScanner("scanner", { 
     fps: 50, 
     qrbox: qrboxFunction,
     rememberLastUsedCamera: true,
     showZoomSliderIfSupported: true,
     showTorchButtonIfSupported : true,
     supportedScanTypes: [Html5QrcodeScanType.SCAN_TYPE_CAMERA]
  });

Expected behavior
expecting no error and the buttons underneath to hide and show only Stop Scanning button

Screenshots
image

Smartphone (please complete the following information):
Issue seems to be in iphone only. tested on iphone 14 pro

@zackhalil
Copy link
Author

Seems related to zoom... can workaround it by

showZoomSliderIfSupported: !(/iPad|iPhone|iPod/.test(navigator.platform))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant