-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add enterpictureinpicture action #295
Conversation
Discussed in Media WG meeting 16 May 2023. Agreement that the feature is useful. Preference expressed towards having a single action rather than two separate actions (for user-initiated vs UA-initiated PiP), and to investigate defining an enum that indicates why the PiP window is being opened. Do sites need to be able to distinguish those cases, e.g., to prevent PiP in one scenario but allow in another? |
Discussed at TPAC, plan is to move forward with a reduced version of the PR (no |
@@ -749,7 +753,8 @@ enum MediaSessionAction { | |||
"togglecamera", | |||
"hangup", | |||
"previousslide", | |||
"nextslide" | |||
"nextslide", | |||
"enterpictureinpicture" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would we sort them lexicographically (not necessarily in this PR)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not actually sure what the standard practice is for enums. I'm not opposed to sorting them lexographically but the way it is now does tend to keep related values (e.g. previousslide and nextslide) together, which is a plus.
SHA: 5d4054a Reason: push, by steimelchrome Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR adds a new 'enterpictureinpicture' MediaSessionAction as proposed in issue #294.
Notably, this has an 'automatic' boolean in the given MediaSessionActionDetails. This would allow websites to distinguish between 'enterpictureinpicture' actions coming from an explicit user action (e.g. clicking a picture-in-picture button in the user agent UI) vs the user agent automatically sending the action (e.g. because the website became hidden). This would not require a user agent to ever send such an action.
I'm interested in feedback on this approach, and here are two other approaches I considered for allowing a website to distinguish between the two:
Preview | Diff