question

NaveenPai-5588 avatar image
0 Votes"
NaveenPai-5588 asked ChetanSharmamsft-3456 commented

Access Teams App iframe content using getDisplayMedia

Hey,
I'm trying to build a Teams App and want to add the ability to record the content within the app iframe.

To do this, I'm trying to use getDisplayMedia Web API. However, when I package and try to use this app in Teams, for some reason, the popup asking for screen share permission doesn't come up and the app does not function.

Why would this be? Do I need to define something special in the manifest.json to allow getDisplayMedia to work?

Help much appreciated!


office-teams-windows-itprooffice-teams-app-dev
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@NaveenPai-5588

As we are mainly responsible for general question of Microsoft Teams, your question is more related to Teams development. So I will also remove teams tag from your thread. Thanks for your understanding!

1 Vote 1 ·

1 Answer

Prasad-MSFT avatar image
1 Vote"
Prasad-MSFT answered ChetanSharmamsft-3456 commented

Update your Teams app manifest.json file by adding the devicePermissions property and specifying media. It allows your app to ask for requisite permissions from users before they start using the camera to capture the image, open the gallery to select an image to submit as an attachment, or use the microphone to record the conversation.

 "devicePermissions": [
     "media",
 ],

Please follow below link for more details:
https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/device-capabilities/mobile-camera-image-permissions#error-handling


Thanks,
Prasad Das


If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Prasad-MSFT Thanks for the reply. My devicePermissions in manifest.json has "devicePermissions" : [ "midi", "openExternal", "media", "notifications"] but it does not help the issue.

Also, note that the link you've given is about the getMedia API which is for loading a media file but I'm trying to use the getDisplayMedia API to record the teams app content instead.






0 Votes 0 ·

The APIs supported by Microsoft Teams are mentioned in this doc. For other APIs you can raise UserVoice


0 Votes 0 ·

@NaveenPai-5588 - Could you please confirm if your issue has resolved with above suggestion or still looking for any help?

0 Votes 0 ·