Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,12 @@ enum MediaSessionAction {
"voiceactivity"
};

enum MediaSessionEnterPictureInPictureReason {
"other",
"useraction",
"contentoccluded"
};

callback MediaSessionActionHandler = undefined(MediaSessionActionDetails details);

[Exposed=Window]
Expand Down Expand Up @@ -1521,6 +1527,7 @@ dictionary MediaSessionActionDetails {
double seekTime;
boolean fastSeek;
boolean isActivating;
MediaSessionEnterPictureInPictureReason enterPictureInPictureReason;
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field enterPictureInPictureReason should be marked as optional since it's only relevant for the enterpictureinpicture action. Consider adding a question mark to make it MediaSessionEnterPictureInPictureReason? enterPictureInPictureReason; to clearly indicate it's optional for other actions.

Suggested change
MediaSessionEnterPictureInPictureReason enterPictureInPictureReason;
MediaSessionEnterPictureInPictureReason? enterPictureInPictureReason;

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the opposite of the suggestion I received from another reviewer, so not sure what to make of it

};

</pre>
Expand Down Expand Up @@ -1565,6 +1572,25 @@ of [=pausing all input sources=] and the <a>media session action</a>
is {{MediaSessionAction/togglecamera}}, {{MediaSessionAction/togglemicrophone}}
or {{MediaSessionAction/togglescreenshare}}.

When the <a>media session action</a> is {{MediaSessionAction/enterpictureinpicture}},
the <dfn dict-member for="MediaSessionActionDetails">enterPictureInPictureReason</dfn>
<a>dictionary member</a> MUST be provided and is the reason the UA has triggered this
action.

{{enterPictureInPictureReason}} can have one of the following values:
<ul>
<li>
<dfn enum-value for="MediaSessionEnterPictureInPictureReason">other</dfn>: the reason for entering picture-in-picture is not one of the existing enum values
</li>
<li>
<dfn enum-value for="MediaSessionEnterPictureInPictureReason">useraction</dfn>: the user has taken an explicit action to enter picture-in-picture (e.g. clicking a picture-in-picture button in the user agent UI)
</li>
<li>
<dfn enum-value for="MediaSessionEnterPictureInPictureReason">contentoccluded</dfn>: the user agent is requesting picture-in-picture because the page has become occluded.
This can happen in various cases like tab switching or tab minimization.
</li>
</ul>

<h2 id="permissions-policy">Permissions Policy Integration</h2>

This specification defines a [=policy-controlled feature=] identified by the
Expand Down