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

Camera cannot focus the QR code in HuaWei Device

Open Tomme-wong opened this issue 2 years ago • 8 comments

When open the scanner, the camera cannot focus the QR code.

issue

  • Device 1: Huawei nova 5T
  • Device 2: Huawei kirin 980

Is there any setting or config i can try?

Tomme-wong avatar Feb 07 '23 14:02 Tomme-wong

focusMode: "continuous"

ROBERT-MCDOWELL avatar Feb 07 '23 15:02 ROBERT-MCDOWELL

focusMode: "continuous"

html5QrCode .start( camera, config,

is this config put into camera camera setting or config object? I tested both, it doesn't work.

Also i tested the html5QrCode.applyVideoConstraints({focusMode: "continuous"}) seems not working too.

Tomme-wong avatar Feb 07 '23 16:02 Tomme-wong

I use it it in the scanner config where you put all settings like qrbox etc... here is my whole config {fps: 8, qrbox: {width: 250, height: 250}, rememberLastUsedCamera: true, disableFlip: true, aspectRatio: 1, facingMode: {exact: "environment"}, focusMode: "continuous", supportedScanTypes: [Html5QrcodeScanType.SCAN_TYPE_CAMERA,Html5QrcodeScanType.SCAN_TYPE_FILE] , formatsToSupport: [Html5QrcodeSupportedFormats.QR_CODE], showTorchButtonIfSupported: true, useBarCodeDetectorIfSupported: true, showZoomSliderIfSupported: true, defaultZoomValueIfSupported: 2}

ROBERT-MCDOWELL avatar Feb 07 '23 19:02 ROBERT-MCDOWELL

I use it it in the scanner config where you put all settings like qrbox etc... here is my whole config {fps: 8, qrbox: {width: 250, height: 250}, rememberLastUsedCamera: true, disableFlip: true, aspectRatio: 1, facingMode: {exact: "environment"}, focusMode: "continuous", supportedScanTypes: [Html5QrcodeScanType.SCAN_TYPE_CAMERA,Html5QrcodeScanType.SCAN_TYPE_FILE] , formatsToSupport: [Html5QrcodeSupportedFormats.QR_CODE], showTorchButtonIfSupported: true, useBarCodeDetectorIfSupported: true, showZoomSliderIfSupported: true, defaultZoomValueIfSupported: 2}

@ROBERT-MCDOWELL showZoomSliderIfSupported and defaultZoomValueIfSupported options are not working when we use html5QrCode.start(). It is working only with html5QrcodeScanner.render()

Does above options working for you with html5QrCode.start() ?

Topiya avatar Aug 09 '23 05:08 Topiya

I use only html5QrcodeScanner, which is built on top of the html5Qrcode class so you should find the equivalent in the docs

ROBERT-MCDOWELL avatar Aug 09 '23 11:08 ROBERT-MCDOWELL

Hello, have you resolved Huawei's inability to focus? I have also encountered this problem. May I ask how you can solve it

OrchardRX avatar May 10 '24 06:05 OrchardRX

I am using iphone 14pro camera to scan the UPC-A barcode for products scan.

However, I am getting blurry image while it is closer to the camera (kind of macro mode). Is it a persistent issue of camera being not focused in closed distance?

Is there any resolution coming on this?

Image (1)

cm080691 avatar Aug 13 '24 03:08 cm080691

Hey guys, you can try modifying the resolution to make it clear. html5Qrcode.start( { facingMode: "environment", }, { aspectRatio: 1.777778, // 16:9 focusMode: "continuous", fps: 15, videoConstraints: { facingMode: 'environment', width: 9999, // It may be useful!! }, qrbox: { width: 280, height: 280, }, },

T-mac-one avatar Aug 15 '24 06:08 T-mac-one