Almas
Almas

Reputation: 319

How to re-ask permission to browser microphone?

How to re-ask permission to microphone in browsers?

My code is here:

function askPermission() {
  var constraints = { audio: true, video: false };

  navigator.mediaDevices
    .getUserMedia(constraints)
    .then(function(stream) {
      let audioContext = new AudioContext();
      console.log(audioContext);
    })
    .catch(function(err) {
      window.location.reload();
    });
}

Upvotes: 0

Views: 999

Answers (1)

Ivan V.
Ivan V.

Reputation: 8081

You can't.

User needs to go to browser settings and allow it manually.

More info: ask for geolocation permission again if it was denied

Upvotes: 1

Related Questions