amazon-chime-sdk-js
amazon-chime-sdk-js copied to clipboard
How to notify user if they deny(or remove during the meeting) mic/camera permissions from the browser?
What are you trying to do?
When user joins for the first time, we invoke getUserMedia and get access to mic and camera from the browser. Everything is fine. How can we notify the users
- if they don't decline the prompt during the first prompt while starting a meeting?
- if they remove the granted permissions during the meeting? Is there any event I can subscribe to and then notify user to grant the permissions again?
What documentation have you looked at so far?
README.md, Amazon Chime SDK Developer Guide, Github issues, stackoverflow.com
@RidipDe @vidya-mohan @nicklera1 @ajselvar @ajselvar-work @michhyun1
@abhijeet-toptal We currently do not have any events to detect this. You could try to do polling with query permission to detect when the permission becomes denied.
new IntervalScheduler(1000).start(async () => {
await navigator.permissions.query({ name: 'microphone' });
await navigator.permissions.query({ name: 'camera' });
});
Thanks for your reply @ltrung, but as an enhancement we can do something like this:
navigator.permissions.query({name: 'microphone'}).then(function(permissionStatus) {
console.log('microphone permission state is ', permissionStatus.state);
permissionStatus.onchange = function() {
console.log('microphone permission state has changed to ', this.state);
};
});