Not able to make the component works on Chrome
valr13 opened this issue · 4 comments
Hello,
I've an issue to make the webcam component works on Chrome Android.
It seems no cameras are detected, on Firefox it works great.
Otherwise, I used the example of the demo:
https://github.com/VinceG/vue-web-cam/blob/master/demo/src/main.vue
@valr13 can you help troubleshoot this? how will i be able to test this and see what's wrong? Does it output anything to the console?
After some searches, I found the way to resolve the issue.
Starting with Chrome 47, getUserMedia() requests are only allowed from secure origins: HTTPS or localhost.
https://developers.google.com/web/updates/2015/10/chrome-47-webrtc?hl=en
So for Vuejs, I just needed to allow HTTPS instead of HTTP. It is possible to do that by creating or updating the vue.config.js
in the root folder of the project.
module.exports = { devServer: { https: true } }
Thanks @valr13