I have basic video chat nodeJS webapp using twilio javascript SDK
video.xyz.com
which I am trying to add in a iframe of a webapplet running on different webservice and sub domain
demo.xyz.com
Browser shows Camera and microphone access prompt when i run directly and it works fine. But inside iframe i am not able to access camera and mic.
Both webapplets are running on same port but different subdomains.
I have tried setting document.domain
on video chat app to match parent page app where iframe will be added, but didn't get that to work.
I get this error in chrome:
"Uncaught DOMException: Failed to set the 'domain' property on 'Document': Assignment is forbidden for sandboxed iframes."
I do have allow mic and camera attribute.
<iframe allow="camera; microphone" sandbox="allow-forms allow-scripts" src="https://video.xyz.com"></iframe>
What do i need to do get camera access in iframe? Which web app will need this change? Does this need CORS?
Thanks in advance. Any help would be appreciated.