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:
-
Build or run the project and load it inside iframe:
<iframe src="http://localhost:3000"></iframe>
-
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>