Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ask for microphone access #163

Open
MustafaJamal opened this issue Jun 21, 2024 · 0 comments
Open

Ask for microphone access #163

MustafaJamal opened this issue Jun 21, 2024 · 0 comments

Comments

@MustafaJamal
Copy link

MustafaJamal commented Jun 21, 2024

Hi,

In my REACT based extension(extension application is at Azure Apps & using application Url in BaseUri of extension manifest) dialog I want to ask user for microphone access, but currently I am getting access violation errors:

Error accessing microphone: DOMException: Permission denied

Here is the code:

useEffect(() => {
// I want to access for permission to use Microphone.
navigator.mediaDevices.getUserMedia({ audio: true })
.then((stream) => {
// Permission granted, do something with the microphone stream
console.error("Microphone access granted");
})
.catch((error) => {
// Permission denied or error occurred
console.error("Error accessing microphone:", error);
});
}, []);

Please let me know, what I am missing.

Thanks,
Mustafa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant