APIs & Integrations

snorreks
Member

CRM Card iframe should allow display-capture

I am trying to open a iframe dialog that will record screen, cam and microphone.
Camera and microphone is working, but screen recording throws error:
DOMException: Failed to execute 'getDisplayMedia' on 'MediaDevices': Access to the feature "display-capture" is disallowed by permission policy.

0 Upvotes
2 Replies 2
himanshurauthan
Thought Leader | Elite Partner
Thought Leader | Elite Partner

CRM Card iframe should allow display-capture

Hello @snorreks 

The error message you received, "DOMException: Failed to execute 'getDisplayMedia' on 'MediaDevices': Access to the feature 'display-capture' is disallowed by permission policy," indicates that the browser has restricted access to the screen recording feature.

Make sure that the HubSpot CRM site and the site hosting the iframe dialog are both served over HTTPS. Some browsers only allow screen recording functionality on secure (HTTPS) origins.

Request explicit permission from the user to access their screen by using the navigator.mediaDevices.getDisplayMedia method. This prompts the user to grant permission for screen recording.

navigator.mediaDevices.getDisplayMedia({ video: true })
  .then((stream) => {
    // Use the stream for screen recording
  })
  .catch((error) => {
    // Handle the error
  });

 

Ensure that your application's privacy policy explicitly mentions the use of screen recording and how the captured data will be handled. Some users may be concerned about privacy when granting screen recording permissions.

Confirm that the browser you are using supports the getDisplayMedia method for screen recording. Different browsers may have varying levels of support and may impose additional restrictions.



Digital Marketing & Inbound Expert In Growth Hacking Technology
0 Upvotes
snorreks
Member

CRM Card iframe should allow display-capture

Thanks for the quick reply @himanshurauthan!

Let me clarify where we are embedding the iframe. We are using the CRM Cards through CRM Extensions API. So hubspot sends a request to our webhook, where we have an primaryAction to open a iframe in hubspot.
I believe that hubspot's predefined iframe is not allowing display-capture https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permissions-Policy/display-captureibBh0zWwUlKCCxa0.pngJoq0U8MZNfmN2Ylz.png

<iframe src="{uri}" allow="camera; microphone; display-capture" ...>
0 Upvotes