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

[FEATURE-REQUEST] picture-in-picture event #244

Open
mklepaczewski opened this issue Feb 25, 2024 · 10 comments
Open

[FEATURE-REQUEST] picture-in-picture event #244

mklepaczewski opened this issue Feb 25, 2024 · 10 comments
Labels
enhancement New feature or request

Comments

@mklepaczewski
Copy link

Feature request

Fire an event when the user enables picture-in-picture. Also, if possible, fire an event when the user disables it.

Why you need this

We want to apply different video settings when picture-in-picture is enabled.

@mklepaczewski mklepaczewski added the enhancement New feature or request label Feb 25, 2024
@markbackman
Copy link
Contributor

@mklepaczewski this is certainly possible. Before we add this, would you mind explaining the use case you have in mind?

@mklepaczewski
Copy link
Author

@markbackman We want to apply lower video quality settings when user enables picture-in-picture. PiP usually uses a smaller window, which provides an opportunity to save bandwidth for users on data plan.

@markbackman
Copy link
Contributor

Thanks for the info, @mklepaczewski. Is this for a custom app or Daily Prebuilt?

If it's Daily Prebuilt, the Prebuilt application is going to override any calls to updateReceiveSettings() as that's something that Prebuilt offers out of the box. Also, I wonder if this is a little more complex; the user has the ability to resize the PiP, so lowering the quality might not be the right choice. (Again, this is speaking about Daily Prebuilt.)

If this is for a custom app, there are browser level PiP APIs that I'd recommend using: https://developer.mozilla.org/en-US/docs/Web/API/Picture-in-Picture_API#events.

@mklepaczewski
Copy link
Author

Thanks for the info, @mklepaczewski. Is this for a custom app or Daily Prebuilt?

Thank you for the update.

At the moment, we still use Daily Prebuilt. We use updateSendSettings() to control video quality (it works). Our use case is a bit specific. We can rely on users not to resize the PiP or accept that quality will be low if they decide to do so. Our users stay in a call for 8-10h/day, and we must apply custom quality settings to lower bandwidth and CPU usage.

@markbackman
Copy link
Contributor

markbackman commented Mar 7, 2024

Since you're using P2P calls, are there always 2 people in a call? If so, you can listen to the enterpictureinpicture browser event, which will indicate when a PiP starts. Will that work for you?

@mklepaczewski
Copy link
Author

@markbackman Yes, that will do, thank you.

@Zupken
Copy link

Zupken commented Apr 25, 2024

@markbackman I don't think it is possible to listen to enterpictureinpicture on iframe. I created a demo demonstrating this: https://codesandbox.io/p/devbox/pfyxlp I think that listening to enterpictureinpicture isn't solution to this problem.

@markbackman
Copy link
Contributor

@markbackman I don't think it is possible to listen to enterpictureinpicture on iframe. I created a demo demonstrating this: https://codesandbox.io/p/devbox/pfyxlp I think that listening to enterpictureinpicture isn't solution to this problem.

Ahh, yes. The event doesn't bubble up to the parent frame. We can add this request to our backlog.

@Zupken
Copy link

Zupken commented Apr 26, 2024

Thank you, looking forward to this feature.

@mklepaczewski
Copy link
Author

Reopening as our tests showed that the proposed solution by @markbackman indeed doesn't work due to the issue reported by @Zupken

@mklepaczewski mklepaczewski reopened this Jun 23, 2024
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

3 participants