WICG / document-picture-in-picture

https://wicg.github.io/document-picture-in-picture/
Other
56 stars 9 forks source link

Allow opening PiP windows from iframes, not just top-level browsing context #97

Open andreasbovens opened 11 months ago

andreasbovens commented 11 months ago

Right now, attempting to open a Document PiP window from an iframe results in an error:

Failed to execute 'requestWindow' on 'DocumentPictureInPicture': Opening a PiP window is only allowed from a top-level browsing context

At Whereby, we have a strong use case for allowing this. Our customers embed our video conferencing UI as an iframe in their website. Inside this UI there is a PiP button, which, when clicked, spawns a PiP window with a combined view of people in the room. At present, the content of this PiP window is generated by combining different video streams onto a canvas, but we're keen to switch to Document PiP. However, as long as iframes cannot spawn Document PiP windows, this won't be possible...

If there are concerns around capabilities and permissions, perhaps a new picture-in-picture allow directive on the iframe could alleviate those?

andreasbovens commented 11 months ago

@beaufortfrancois any feedback? :)

beaufortfrancois commented 11 months ago

@steimelchrome and @liberato-at-chromium will certainly have thoughts on this proposal.

steimelchrome commented 11 months ago

One possible workaround is to have the top-level frame open a document pip window and put a Whereby iframe inside of it and then the document pip iframe and main window iframe can talk to each other. However, that is not great ergonomically and depends on the top-level frame doing more work than just setting a picture-in-picture permission.

I'm open to the idea. I haven't fully thought through all the implications and what would need to be changed in the spec, but I see the value and I don't think this problem is exclusive to just Whereby's use case.

saghul commented 9 months ago

👋 FWIW, we (Jitsi Meet) have exactly the same use case and would very much like to have it work within an iframe, with permission delegation if that's the chosen path.

andreasbovens commented 8 months ago

@steimelchrome what would be the next steps here?

petarminchev commented 3 days ago

Similar to our esteemed competitors, we too (Digital Samba) are providing an embedded video conferencing solution and our customers would need to open PiP from an iframe to gain value from this wonderful feature in their platforms.

Is there any progress or timeline? @steimelchrome

PiP is a highly requested feature in the video conferencing industry and use cases are very diverse. The embedded space is ready to embrace it.

Thank you!