Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
andreasbovens opened this issue Sep 27, 2023 · 13 comments
Labels
enhancement New feature or request

Comments

@andreasbovens
Copy link

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
Copy link
Author

@beaufortfrancois any feedback? :)

@beaufortfrancois
Copy link
Contributor

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

@steimelchrome
Copy link
Collaborator

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
Copy link

saghul commented Dec 4, 2023

👋 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
Copy link
Author

@steimelchrome what would be the next steps here?

@steimelchrome steimelchrome added the enhancement New feature or request label Feb 6, 2024
@petarminchev
Copy link

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!

@dascope
Copy link

dascope commented Sep 12, 2024

@beaufortfrancois, @steimelchrome anything you can do to move this forward? it's 12 months since @andreasbovens (edited, sorry!) originally reported this and this is a real problem for many of our users. Thank you!

@andreasbovens
Copy link
Author

I was the one who reported it ;) but yes indeed: keen to see this move forward. It prevents us (Whereby) from adopting this feature.

@steimelchrome
Copy link
Collaborator

Hi everyone. We definitely agree that the ergonomics of having the top frame open a pip window for you are not great. It's something we've discussed as needed in the future, but it's a large enough technical lift that we haven't had time to tackle it yet. We will probably work on this next year. Thanks for showing interest in this enhancement since that helps us prioritize

@Andrews54757
Copy link

Andrews54757 commented Oct 5, 2024

One possible workaround is to have the top-level frame open a document pip window and put a Whereby iframe inside of it

Because moving an iframe in the DOM causes it to reload, there is a loss of state when using Document Picture in Picture this way. I would appreciate methods to use document picture in picture without necessarily reloading iframe elements for situations where one may want to use multiple iframes in a document picture in picture window.

@jsilvawbc
Copy link

The challenge of enabling Document Picture-in-Picture (PiP) windows from iframes is highlighted by numerous contributors in the developer community.

Services like Whereby, Jitsi Meet, and Digital Samba, embed video conferencing UI inside iframes on their clients' websites.

There's a strong demand for allowing these iframes to open Document PiP windows.

Current Limitation: Attempting to open a Document PiP from an iframe results in an error because it's only allowed from a top-level browsing context. This restriction hinders the shift from using canvas-based PiP to more efficient Document PiP.

Permission Delegation: Implement a new directive that allows iframes in specific contexts to manage their own PiP windows. This could involve adding a picture-in-picture allow attribute to iframes.

Technical Challenges: The technical challenge involves making significant changes to the browser's handling of iframes and their permissions, which requires careful consideration of security and privacy implications.

Community Interest: Significant interest from various companies indicates a strong use case, which may help prioritize this feature in future development roadmaps.

Discussion with Browser Vendors: Engaging with browser vendors, such as the Chrome team, to explore feasibility and specs modification needed for this enhancement.

Thanks.

@taf2
Copy link

taf2 commented Dec 4, 2024

Additionally almost any Salesforce application would never be able to use this feature because salesforce visualforce, opencti all sandbox applications in an embedded iframe...

@OrionCodeDev
Copy link

it's will be awesome if we can do Document PiP in iframe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

10 participants