Forum Discussion
Device permissions (Microphone, Video) in New Teams on Mac not working
Hi
I have a tab app that need access to microphone and video.
In the manifest file I have added:
"devicePermissions": [
"media"
]
and in Teams I have granted permission as follow:
I have written som Javascript to check the permission but I'm not sure how this is supposed to work.
I have tested this on Mac, I cannot access Teams developer tools om my test Windows PC.
This is my tests and results:
Test1:
navigator.permissions.query({name: 'microphone'}).then(permission => {
console.log(permission.state);
});
Result1:
New Teams, granted permission: True | New Teams, granted permission: False | Old Teams, granted permission: True | Old Teams, granted permission: False |
prompt | prompt | granted | granted |
Test2:
navigator.mediaDevices.getUserMedia({audio: true})
.then(mediaStream => {
if(mediaStream) {
console.log("getUserMedia audio works");
}
else{
console.log("getUserMedia audio faild");
}
})
.catch(error => {
console.error(error)
});
Result2:
New Teams, granted permission: True | New Teams, granted permission: False | Old Teams, granted permission: True | Old Teams, granted permission: False |
"getUserMedia audio works" sometimes "DOMException: Failed due to shutdown" | DOMException: Permission denied | No output | No output |
Test3:
navigator.mediaDevices.enumerateDevices().then(devices => {
devices.forEach((device) => {
console.log(JSON.stringify(device.toJSON()));
});
})
Result3:
New Teams, granted permission: True | New Teams, granted permission: False | Old Teams, granted permission: True | Old Teams, granted permission: False |
Empty list | Empty list | List of alot of devices | List of alot of devices |
What is the correct way of checking/setting microphone permission (both classic and new Teams)?
How can I access developer tools on Windows PC (both classic and new Teams) to test this?
Thanks in advance
/Christopher Edling
- SaiPratap-MSFTMicrosoft
ChristopherEdling - We are able to repro this issue, we have raised bug for the same. We will inform you once we get any update.
- ChristopherEdlingCopper ContributorI can see in newer versions of Teams that this now seems to work.
Would be nice to get some kind of summary feedback.
And when to use what methods.
Thanks
- SaiPratap-MSFTMicrosoft
ChristopherEdling - Thanks for reporting your issue. We will check this and update you soon.