On my daily development I came across the issue
navigator.mediaDevices is undefined when testing a website I’m developing on Firefox browser. While the fix for Google Chrome is widely known, I didn’t find anything about Firefox and decided to dig deeper myself. Turns out the fix is pretty simple.
- On the address bar of Firefox type about:config
- Accept and continue
- Search for insecure
- Set media.devices.insecure.enabled and media.getusermedia.insecure.enabled flag to true
That should do it!! The next time you open your website, Firefox will ask your permissions for webcam/microphone.