Closed apeengggg closed 4 months ago
iam using vuejs3, with core ui template
You can only use the camera in a secure context (https or localhost): https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
You can only use the camera in a secure context (https or localhost): https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
so how to allow it in http ?
I have tried entering the url into => chrome://flags/#unsafely-treat-insecure-origin-as-secure
but the camera still isn't showing
The detection of insecure context is hardcoded here: https://github.com/gruhn/vue-qrcode-reader/blob/504e46d2d01c70fce4679740294849b12e18f325/src/misc/camera.ts#L32-L40
So chrome://flags/#unsafely-treat-insecure-origin-as-secure
is not gonna work.
Do you have a reason to serve this in an insecure context?
The detection of insecure context is hardcoded here:
So
chrome://flags/#unsafely-treat-insecure-origin-as-secure
is not gonna work.Do you have a reason to serve this in an insecure context?
i dont have spesific reason to serve that in an insecure origin, what should i check ?
i dont have spesific reason to serve that in an insecure origin, what should i check ?
Sorry I don't understand your question. I was asking your use case?
If you're deploying the service to end users, you'll need an SSL certificate because it's very unsafe to getUserMedia
in an insecure context.
For local development and testing, localhost
is required, or check the README to learn how to test your service on your mobile device without https.
If you really want chrome://flags/#unsafely-treat-insecure-origin-as-secure
to work. You can fork or patch the vue-qrcode-reader
to comment out this piece of detection code: https://github.com/gruhn/vue-qrcode-reader/blob/504e46d2d01c70fce4679740294849b12e18f325/src/misc/camera.ts#L32-L40 And set your insecure origin in the chrome flags page.
This issue has been marked as stale. If there is no further activity it will be closed.
I have tried locally and successfully displayed the camera and read QR, when I deploy to the server, the camera does not appear, how do I solve it? I don't use https