quagga2 icon indicating copy to clipboard operation
quagga2 copied to clipboard

LiveStream mode freezes in webview (android)

Open santycg2002 opened this issue 2 years ago • 2 comments

Hi!

I'm trying Quagga 2 (Javascript) for my web app project (Android/iOS). I have created a simple app with just a webview that shows the web application.

The problem I'm experiencing is that the image from the webcam is 'frozen' unless I touch the screen. No matter where I touch, when I touch the screen, frames are updated, but if not, the image keeps frozen.

Barcodes ARE detected with no problem, but I have to do the trick (touching the screen).

If I open the web application using Chrome browser in the Tablet, all works fine. Live stream is working fine and I don't need to touch the screen to refresh/update the frames.

It is an old tablet (Samsung Galaxy TAB A), but works fine in the Chrome browser. The problem is only in WebView.

Is it a known issue? Something I could try, maybe with different Quagga initialization config parameters (numOfWorkers, frequency, etc.)?

This is my current initialisation code:

Quagga.init({
            inputStream : {
                name : "Live",
                type : "LiveStream",
                constraints:{
                    width:{"min":640},
                    height:{"min":480},
                    aspectRatio:{"min":1,"max":100},
                    facingMode:"environment"},
                target: document.querySelector('#barcode-reader')    // Or '#yourElement' (optional)
            },
            locate:true,
            debug:false,
            locator: {
                patchSize: "medium",
                willReadFrequently: true,
                halfSample: true
            },
            decoder : {
                readers : ["code_128_reader","ean_reader","code_39_reader"],
                multiple: false
            }
        }, function(err) {
            if (err) {
                console.log(err);
                return
            }

            Quagga.start();
        });

santycg2002 avatar May 04 '23 11:05 santycg2002

Thank you for filing an issue! Please be patient. :-)

github-actions[bot] avatar May 04 '23 11:05 github-actions[bot]

hmm. Doesn't sound like something related to Quagga.

Maybe try something like https://webcamtests.com and see if there's a similar issue?

Looks like the Tab A is quite a few years old, and might've had Android 7 or 8, which I want to say is right around the absolute minimum necessary for camera to work in browser, though my memory could be wrong there. If the internal webview in that version is quite old, it could very well be a problem with that. I'm guessing that doesn't update with the Chrome version.

ericblade avatar May 04 '23 14:05 ericblade