html5-qrcode icon indicating copy to clipboard operation
html5-qrcode copied to clipboard

Full screen by set aspectRatio doesn't work on iPhone 13

Open weihaopeng opened this issue 2 years ago • 2 comments

Describe the bug I have read #82, then set my config to the code below, when I test the app on iPhoneX with iOS 14.7.1, it's full-screen. Then I test it on iPhone 13 with iOS 15.0.2, it doesn't seem to work.

To Reproduce Steps to reproduce the behavior:

  1. Main code:
    const html5QrCode = new Html5Qrcode('scan-render');
    const height = document.body.offsetHeight
    const width = document.body.offsetWidth
    const minWidth = Math.min(height, width)
    const config = { fps: 10, qrbox: { width: minWidth * 0.667, height: minWidth * 0.667 }, aspectRatio: Math.ceil((height / width) * 100) / 100 }
    const qrcodeSuccess = (decodedText, decodedResult) => ({ console.log('success', decodedText, decodedResult) })
    html5QrCode.start({facingMode: {exact: 'environment'}}, config, qrcodeSuccess, (error) => {})
    
  2. What I see in iPhone 13 with iOS 15.0.2, the black area is a mask.

Expected behavior The video completely fill my screen.

Smartphone (please complete the following information):

  • UA: Mozilla/5.0 (iPhone; CPU iPhone OS 15_0_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Mobile/15E148 Safari/604.1

weihaopeng avatar Jun 22 '22 08:06 weihaopeng

did you debug width and height result? maybe it differs that before....

ROBERT-MCDOWELL avatar Jun 23 '22 13:06 ROBERT-MCDOWELL

did you debug width and height result? maybe it differs that before....

I'll try. But I think it doesn't matter. Because the main app mounts long time before when I call the start function.

weihaopeng avatar Jun 29 '22 07:06 weihaopeng