Open mklepaczewski opened 9 months ago
@mklepaczewski this is certainly possible. Before we add this, would you mind explaining the use case you have in mind?
@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.
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.
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.
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?
@markbackman Yes, that will do, thank you.
@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 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.
Thank you, looking forward to this feature.
Reopening as our tests showed that the proposed solution by @markbackman indeed doesn't work due to the issue reported by @Zupken
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.