const checkMicrophoneAccess = async () => {
try {
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
stream.getTracks().forEach((track) => track.stop());
localStorage.setItem("isMicAllowed", true);
} catch (error) {
console.log(error)
}
};
while trying to turn on automatically, getting error of “NotAllowedError: Permission denied”
How can I enable microphone access in a browser automatically from a React.js frontend application without showing the browser’s default pop-up? For example, the Google Meet web application uses its own custom pop-up to manage microphone access across all browsers like Chrome, Safari etc. I need a similar flow, ideally a silent enabling process.