mebjas / html5-qrcode

A cross platform HTML5 QR code reader. See end to end implementation at: https://scanapp.org
https://qrcode.minhazav.dev
Apache License 2.0
4.93k stars 963 forks source link

Error getting userMedia, error = NotReadableError:Could not start video source #764

Open Yyuanbo opened 1 year ago

Yyuanbo commented 1 year ago

Describe the bug I think this is the same error as reported in #483,Open webpages using wechat, In my iqooz5 is running android 11, this error occurs when I get the CAMERA ID after getCameras() and execute start(). The same will not happen with my Huawei running Android 11.I would appreciate a good way to solve this problem

To Reproduce Steps to reproduce the behavior: Open webpages using wechat in VIVO iqooz5 phones and run getCameras() and start().

Smartphone (please complete the following information):

I'll leave the whole code here:

this.html5QrCode.start(
              this.cameraId,
              {
                fps: 10,
                qrbox: 250, 
                facingMode: "environment",
                aspectRatio: 1.777778, 
                focusMode:"continuous",
                formatsToSupport:[
                  Html5QrcodeSupportedFormats.QR_CODE,
                  Html5QrcodeSupportedFormats.UPC_A,
                  Html5QrcodeSupportedFormats.UPC_E,
                  Html5QrcodeSupportedFormats.UPC_EAN_EXTENSION,
                ],
                advanced:[
                  {zoom: 1.5},
                ],
                experimentalFeatures:{
                  useBarCodeDetectorIfSupported:true,
                }
            },
            qrCodeMessage => {},
            errorMessage => {}
    ).catch(err => {
    // Start failed, handle it. 
})
ROBERT-MCDOWELL commented 1 year ago

if wechat monopolize the camera so you have no way to use the camera on another webpage on Android.

Yyuanbo commented 1 year ago

if wechat monopolize the camera so you have no way to use the camera on another webpage on Android.

The camera is not occupied, QQ browser can be opened in IQOO Z5 device, but wechat will appear this error