TypeError: navigator.getUserMedia is not a function
error in Firefox
TypeError: navigator.getUserMedia is not a function

Try using navigator.mediaDevices.getUserMedia()
On Wed, Oct 16, 2019 at 3:27 AM PratikBalar [email protected] wrote:
error in Firefox
TypeError: navigator.getUserMedia is not a function
[image: Screenshot (280)] https://user-images.githubusercontent.com/41847153/66901741-e9933500-f01c-11e9-9ace-681293a2dd56.png
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/WebDevSimplified/Face-Detection-JavaScript/issues/9?email_source=notifications&email_token=AJPAR257VKZ5Q44ECNAE54LQO3GAFA5CNFSM4JBIAJ3KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HSC2ICA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJPAR25OLUFLUOMFAJWNAATQO3GAFANCNFSM4JBIAJ3A .
.... is not a function

What version of firefox are you using? Maybe this API is not available in your version.
On Wed, Oct 16, 2019 at 8:38 AM PratikBalar [email protected] wrote:
.... is not a function [image: Screenshot (281)] https://user-images.githubusercontent.com/41847153/66924472-53750400-f048-11e9-9003-e768543e55d7.png
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/WebDevSimplified/Face-Detection-JavaScript/issues/9?email_source=notifications&email_token=AJPAR23ODDO3HR7RLFJ4ZQLQO4KNPA5CNFSM4JBIAJ3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBMQM3A#issuecomment-542705260, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJPAR264FARKBCRBAA2SCRLQO4KNPANCNFSM4JBIAJ3A .
i.m using Firefox 69 .but i also tried it in chrome (Chrome 77 on Windows 10) and .....

getUserMedia() is a promises so you have to use .then()
navigator.mediaDevices.getUserMedia().then((stream)=> {})
You need to make sure you pass parameters to the getUserMedia function like I did in the code. That is why you are getting your first error.
navigator.mediaDevices.getUserMedia({video: {}}) .then((stream)=> {video.srcObject = stream;}, (err)=> console.error(err));
navigator.mediaDevices.getUserMedia({video: {}}) .then((stream)=> {video.srcObject = stream;}, (err)=> console.error(err));
Had the same error in FireFox, and this fix worked for me!
working in chrome but still not working in firefox (v69.0.1).

You must have on secure context
The getUserMedia() method is only available in secure contexts. A secure context is one the browser is reasonably confident contains a document which was loaded securely, using HTTPS/TLS, and has limited exposure to insecure contexts. If a document isn't loaded in a secure context, the navigator.mediaDevices property is undefined, making access to getUserMedia() impossible.
Attempting to access getUserMedia() in this situation will result in a TypeError.
https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
When I run the project on localhost it runs fine. But when I host it on my server instance then try to run it, then it gives this error. Any idea why its behaving like that?
Chrome is requiring secure origins (HTTPS) for getUserMedia.
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
When I run the project on localhost it runs fine. But when I host it on my server instance then try to run it, then it gives this error. Any idea why its behaving like that?
are you on HTTPS? I mean the domain on your server? it should be on https for it to work.
When I run the project on localhost it runs fine. But when I host it on my server instance then try to run it, then it gives this error. Any idea why its behaving like that?
are you on HTTPS? I mean the domain on your server? it should be on https for it to work.
My server is https but still not working and working fine on localhost