navigator.mediaDevices.getUserMedia Error "DOMException"

Viewed 2042

Microphone permission granted.

I get the error "DOMException" without any detailed description when I try to run this code await navigator.mediaDevices.getUserMedia({audio: true}).

Even in console< when I run this code navigator.mediaDevices.getUserMedia({audio:true}) .then(stream => video.srcObject = stream) .catch(e => console.error(e)); I get an error "DOMException".

Why does this happen, what do I need to do?

Js, Vue.js, Chrome, MacOS Mojave.

example in console

1 Answers

MacOS Mojave has specific permissions for the camera in System Preferences. I was running into the same problem until I granted Chrome permission to use the camera. (same for audio)

Related