instascan icon indicating copy to clipboard operation
instascan copied to clipboard

No cameras found on my android

Open fannlock opened this issue 6 years ago • 9 comments

It work on my laptop webcam, but not work on my android..... But your demo work on my android device.

1895496375

fannlock avatar May 23 '18 08:05 fannlock

https:// nedded

demimurych avatar May 27 '18 01:05 demimurych

I tried with a self-signed cert after loading up https://localhost:8443 via my android inside chrome debugger's remote devices, I still can't see the camera. No errors or anything. I thought that https would fix it but apparently not. Also the demo works on android/chrome but not my version.

ralyodio avatar Jun 03 '18 11:06 ralyodio

Have you also checked your Content Security Policy settings?

md8n avatar Jun 07 '18 02:06 md8n

Not sure how do I check this?

ralyodio avatar Jun 07 '18 02:06 ralyodio

If you are using the Chrome Remote Debugger - then a CSP violation will show up. A CSP is a list of clauses covering different kinds of content - these are separated by semi-colons. Then each clause you have the type of content, followed by a space delimited list of terms. So something like this (I've formatted it to be a little more readable):

Have a look at MDN for more info.

md8n avatar Jun 07 '18 03:06 md8n

And it dropped the content - I'll try again:

    <meta http-equiv="Content-Security-Policy" content="
        default-src https://codepush.azurewebsites.net * gap://ready file:;
        style-src 'self' 'unsafe-inline' *;
        script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: *;
        img-src data: 'unsafe-inline' blob: *;
        worker-src blob:;
        child-src blob:;">

md8n avatar Jun 07 '18 03:06 md8n

For a barcode scanner you'll almost certainly need blob: defined for script-src, img-src and worker-src, and probably also child-src

md8n avatar Jun 07 '18 03:06 md8n

My implementation doesn't work in android 7. It works fine in 4, 6, 8

ralyodio avatar Jun 11 '18 06:06 ralyodio

i have the same issue.. no cameras found in my mobile android.. plss help how to fix

jordanmarvin avatar May 03 '19 16:05 jordanmarvin