Forum Discussion

ChristopherEdling's avatar
ChristopherEdling
Copper Contributor
Nov 23, 2023

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: TrueNew Teams, granted permission: FalseOld Teams, granted permission: TrueOld Teams, granted permission: False
promptpromptgrantedgranted 

 

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: TrueNew Teams, granted permission: FalseOld Teams, granted permission: TrueOld Teams, granted permission: False
"getUserMedia audio works" sometimes "DOMException: Failed due to shutdown"DOMException: Permission deniedNo outputNo output

 

Test3:

 

navigator.mediaDevices.enumerateDevices().then(devices => {
  devices.forEach((device) => {
    console.log(JSON.stringify(device.toJSON()));
  });
})

 

Result3:

New Teams, granted permission: TrueNew Teams, granted permission: FalseOld Teams, granted permission: TrueOld Teams, granted permission: False
Empty listEmpty listList of alot of devicesList 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

Resources