Access Teams App iframe content using getDisplayMedia

Naveen Pai 1 Reputation point
2021-10-01T22:13:59.687+00:00

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!

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,032 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
2,822 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Prasad-MSFT 5,616 Reputation points Microsoft Vendor
    2021-10-04T06:23:12.997+00:00

    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://learn.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.

    1 person found this answer helpful.