Document Picture in Picture API Implementation for Qwik #225
mrhoodz
started this conversation in
Proposals For Qwik
Replies: 1 comment 4 replies
-
I think it would be better to make each window a separate qwik container, no? Then everything would just work. The DPIPComponent would be an inline component, it would take its children and give them to render, and then inject the generated html into the new window. Would that work? How would communication happen? Care must be taken not to pass signals and not to rely on context though. The optimizer must be made aware of this somehow so it doesn't forward signals. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is it about?
Providing developers with a simple hook and component-based approach to create floating windows with synchronized styles and state management.
What's the motivation for this proposal?
Problems Im trying to solve:
Goals Im trying to achieve:
Any other context or information I want to share:
The styling and event listeners issue is particularly challenging because the new PIP window doesn't inherit any
<script>
or<style>
tags from the parent window. This means all styles must be explicitly copied over, including:The current implementation includes a style synchronization solution, but it might need further refinement for edge cases.
Proposed Solution / Feature
What do I propose?
A reusable Qwik hook and component implementation for Chrome's Document Picture-in-Picture API that provides a simple, declarative way to create floating windows with synchronized styles and state management. The implementation handles all the complexity of style copying, state management, and event handling through a clean API.
Code examples
Links / References
For demo of default behavior here
For demo of proposed syntax and behavior here
Beta Was this translation helpful? Give feedback.
All reactions