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

Camera window freezes on iPhone/iPad #500

Closed
cc13com opened this issue May 31, 2023 · 4 comments
Closed

Camera window freezes on iPhone/iPad #500

cc13com opened this issue May 31, 2023 · 4 comments

Comments

@cc13com
Copy link

cc13com commented May 31, 2023

Hello,

I tested with quagga and quagga2 with the same issue. On my Google Pixel 7 all is fine and working as expected. Tested from the browser and installed as an PWA application on my phone.

As soon as I test on iPhone 13 or iPad the reader is working only if I run my "app" in the Safari browser. But if I install the app as a PWA application on the iPhone/iPad the camera window freezes if I run the quagga script. I can see the picture taken from the camera but still frozen. It's not showing the live content.

@github-actions
Copy link

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

@ericblade
Copy link
Owner

ericblade commented May 31, 2023

Sounds very strongly like an iOS problem. But... what is your configuration you're passing to Quagga.init? what iOS version?

I'm not sure if anything in the PWA config might apply.. possibly...

It wasn't until I think the most recent iOS release that camera was even supported outside of Safari in WebView, and that might still be in beta.. i don't track what's going on with iOS much since I don't have any iOS things

@cc13com
Copy link
Author

cc13com commented Jun 1, 2023

If I remember right it was working on an older iOS/Safari version.

My init/config looks like:

init: function(regionID, attribute1, width, height) {
        var self = this;
        regionID = regionID;
        barcodeItem = attribute1;
        l_width = width;
        l_height = height;

        console.log('init: ' + regionID);

        Quagga.init(this.config, function(err) {
            if (err) {
                return self.handleError(err);
            }
            Quagga.start();
        });
    },
    handleError: function(err) {
        console.log(err);
    },
    config: {
        inputStream: {
            target: scannerCamEl,
            type : "LiveStream",
            constraints: {
                // width: {min: l_width},
                width: 320,
                height: 240,
                facingMode: "environment"
                //aspectRatio: {min: 1, max: 2}
            }
        },
        locator: {
            patchSize: "medium",
            halfSample: true
        },
        numOfWorkers: 2,
        frequency: 10,
        decoder: {
            readers : [{
                format: "ean_reader",
                config: {}
            }]
        },
        locate: true
    }

@ericblade
Copy link
Owner

hmm. can you tell if your code is still running? i'm not sure what on device debugging capabilities th ere are, but I'd presume there's some way to debug on device, and you could get the logs or something to see if it's actually doing anything at all.

It wouldn't surprise me if this is some sort of bugged out optimization that is supposed to make pages that aren't focused not render, but it's affecting an actually focused page. ugh.

There were tons and tons and tons of problems like this in WebKit when I used it last.

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

2 participants