I want to open permission popup for microphone if microphone permission is not granted,
navigator.permissions.query(
{ name: 'microphone' }
).then(permissionStatus => {
console.log(permissionStatus.state); // granted, denied, prompt
if(permissionStatus.state != 'granted')
{
alert('Please allow your microphone');
}
else
{
this.mic_permission=true;
}
let self=this;
permissionStatus.onchange = function(){
if(this.state!='granted')
{
self.mic_permission=false;
}
console.log("Permission changed to " + this.state);
}
using this code to check whether microphone permission is granted or not but i want to open popup also so that user can allow the microphone permission