I want to use the microphone to record voice from salesperson, on development environment such us localhost:9090/#/chatroom navigator.mediaDevices
works fine. But on production's environment, navigator doesn't has the mediaDevices object, it is undefined.Could any one tell me why?
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.90 Safari/537.36
let stream = null;
const constraints = {
audio: true,
};
try {
stream = await navigator.mediaDevices.getUserMedia(constraints);
/* use the stream */
this.beginRecord(stream);
this.recorder.mediaStream = stream;
} catch (err) {
/* handle the error */
// console.error(err);
}
navigator.mediadevices.getusermedia is not a function
try /catch
are inside an async function right ? – Abdelillah Aissani