Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error activating microphone in google Chrome

Im trying to enable microphone to allow user record audio, but I get this error:

Uncaught TypeError: Cannot read property 'getUserMedia' of undefined at activateMicrophone

navigator.mediaDevices.getUserMedia({audio: true, video:false})
            .then(stream => {
                handlerFunction(stream, $audioSelect.siblings(".recordedAudio"));
                $(".record").prop("disabled", false);
            })
like image 398
pzsette Avatar asked Nov 05 '19 17:11

pzsette


People also ask

Why is my microphone not working on Google Chrome?

Restart your Chrome browser, then re-open Chrome microphone settings (chrome://settings/content/microphone) and toggle back on 'Ask before accessing', as shown below.


1 Answers

Grabbing navigator.mediaDevices as of Chrome 74 requires a secure context.

https://developer.mozilla.org/en-US/docs/Web/API/Navigator/mediaDevices

This means that non https:// requests will return an undefined object.

For more information on this change: https://w3c.github.io/mediacapture-main/#local-content

like image 185
Bitz Avatar answered Nov 13 '22 09:11

Bitz