I'm in Chrome on Windows.
I would like to use the camera in my web app that with a domain, say www.example.com.
We have a dev environment called www.dev.example.com
We run the following code to get the camera video :
navigator.mediaDevices.getUserMedia({
video: {
facingMode: 'environment',
audio: !1
}
}).then(function(e) {
console.log('The camera is working');
})
in the our dev domain (www.dev.example.com) this code is working properly. However, when we change the domain to www.example.com, the code is not working any more (the exact same code). We get the error :
Uncaught (in promise) DOMException: Permission denied
We tried using Chrome Dev Console. In fact, this code works on any domain (including StackOverflow) except our domain www.example.com.
Does anyone know if there is something to check related to the domain please in order to make this code work ?
Thanks Cheers, Does anyone know how to solve that please.