videosdk-live / videosdk-rtc-react-prebuilt-ui

Open Source code of Video SDK RTC Prebuilt SDK.

Home Page:https://docs.videosdk.live/docs/guide/prebuilt-video-and-audio-calling/getting-started

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mic, webcam and screenshare not working if used in iframe

MrSurana opened this issue · comments

Issue

If I build and load this prebuilt inside an iframe, I am unable to enable mic or webcam, and also the screenshare button does not work.

How to recreate:

  1. Build or run the project and load it inside iframe:

    <iframe src="http://localhost:3000"></iframe>
  2. Click on the screenshare button in navbar.

Resolution

Include the allowusermedia and allow attributes as shown below in the iframe element.

<iframe 
  allowusermedia 
  allowfullscreen 
  allow="camera *; microphone *; fullscreen; display-capture; allow-same-origin; allow-presentation; encrypted-media; midi; encrypted-media"
>
</iframe>