Skip to content

Commit dd37d72

Browse files
Add EnterPictureInPictureReason (#362)
This adds EnterPictureInPictureReason to the MediaSessionActionDetails for the enterpictureinpicture action, based on the discussions surrounding #358
1 parent 32f3e12 commit dd37d72

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

index.bs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,12 @@ enum MediaSessionAction {
767767
"voiceactivity"
768768
};
769769

770+
enum MediaSessionEnterPictureInPictureReason {
771+
"other",
772+
"useraction",
773+
"contentoccluded"
774+
};
775+
770776
callback MediaSessionActionHandler = undefined(MediaSessionActionDetails details);
771777

772778
[Exposed=Window]
@@ -1521,6 +1527,7 @@ dictionary MediaSessionActionDetails {
15211527
double seekTime;
15221528
boolean fastSeek;
15231529
boolean isActivating;
1530+
MediaSessionEnterPictureInPictureReason enterPictureInPictureReason;
15241531
};
15251532

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

1575+
When the <a>media session action</a> is {{MediaSessionAction/enterpictureinpicture}},
1576+
the <dfn dict-member for="MediaSessionActionDetails">enterPictureInPictureReason</dfn>
1577+
<a>dictionary member</a> MUST be provided and is the reason the UA has triggered this
1578+
action.
1579+
1580+
{{enterPictureInPictureReason}} can have one of the following values:
1581+
<ul>
1582+
<li>
1583+
<dfn enum-value for="MediaSessionEnterPictureInPictureReason">other</dfn>: the reason for entering picture-in-picture is not one of the existing enum values
1584+
</li>
1585+
<li>
1586+
<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)
1587+
</li>
1588+
<li>
1589+
<dfn enum-value for="MediaSessionEnterPictureInPictureReason">contentoccluded</dfn>: the user agent is requesting picture-in-picture because the page has become occluded.
1590+
This can happen in various cases like tab switching or tab minimization.
1591+
</li>
1592+
</ul>
1593+
15681594
<h2 id="permissions-policy">Permissions Policy Integration</h2>
15691595

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

0 commit comments

Comments
 (0)