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();
});
}