Skip to content

Commit

Permalink
split details dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
youennf committed Feb 16, 2024
1 parent 358dbea commit 0c51d1d
Showing 1 changed file with 50 additions and 42 deletions.
92 changes: 50 additions & 42 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1361,58 +1361,66 @@ should always be positive.

dictionary MediaSessionActionDetails {
required MediaSessionAction action;
};

dictionary MediaSessionSeekActionDetails : MediaSessionActionDetails {
double seekOffset;
double seekTime;
};

dictionary MediaSessionSeekToActionDetails : MediaSessionActionDetails {
required double seekTime;
boolean fastSeek;
};

dictionary MediaSessionCaptureActionDetails : MediaSessionActionDetails {
boolean isActivating;
};

</pre>

The {{MediaSessionActionHandler}} MUST be run with the <var>details</var>
parameter which is represented by a dictionary inherited from
{{MediaSessionActionDetails}}.

The <dfn dict-member for="MediaSessionActionDetails">action</dfn> <a>dictionary
member</a>
is used to specify the <a>media session action</a> that the
{{MediaSessionActionHandler}} is associated with.

The <dfn dict-member for="MediaSessionActionDetails">seekOffset</dfn>
<a>dictionary member</a> MAY be provided when the <a>media session action</a>
is {{MediaSessionAction/seekbackward}} or
{{MediaSessionAction/seekforward}}. It is the time in seconds
to move the playback time by. If present, it should always be positive.
If it is not provided then the site should choose
a sensible time (e.g. a few seconds).

When the <a>media session action</a> is {{MediaSessionAction/seekto}}:

parameter whose dictionary type is:
<ul>
<li>
The <dfn dict-member for="MediaSessionActionDetails">seekTime</dfn>
<a>dictionary member</a> MUST be provided and is the time in seconds to
move the playback time to.
</li>

<li>
The <dfn dict-member for="MediaSessionActionDetails">fastSeek</dfn>
<a>dictionary member</a> MAY be provided and will be true if the
[=media session action|action=] is being called multiple times
as part of a sequence and this is not the last call in that sequence.
</li>
<li>{{MediaSessionActionDetails}} for {{MediaSessionAction/play}}.</li>
<li>{{MediaSessionActionDetails}} for {{MediaSessionAction/pause}}.</li>
<li>{{MediaSessionSeekActionDetails}} for {{MediaSessionAction/seekbackward}}.</li>
<li>{{MediaSessionSeekActionDetails}} for {{MediaSessionAction/seekforward}}.</li>
<li>{{MediaSessionActionDetails}} for {{MediaSessionAction/previoustrack}}.</li>
<li>{{MediaSessionActionDetails}} for {{MediaSessionAction/nexttrack}}.</li>
<li>{{MediaSessionActionDetails}} for {{MediaSessionAction/skipad}}.</li>
<li>{{MediaSessionActionDetails}} for {{MediaSessionAction/stop}}.</li>
<li>{{MediaSessionSeekToActionDetails}} for {{MediaSessionAction/seekto}}.</li>
<li>{{MediaSessionCaptureActionDetails}} for {{MediaSessionAction/togglemicrophone}}.</li>
<li>{{MediaSessionCaptureActionDetails}} for {{MediaSessionAction/togglecamera}}.</li>
<li>{{MediaSessionActionDetails}} for {{MediaSessionAction/hangup}}.</li>
<li>{{MediaSessionActionDetails}} for {{MediaSessionAction/previousslide}}.</li>
<li>{{MediaSessionActionDetails}} for {{MediaSessionAction/nextslide}}.</li>
<li>{{MediaSessionActionDetails}} for {{MediaSessionAction/enterpictureinpicture}}.</li>
</ul>

When the <a>media session action</a> is {{MediaSessionAction/togglemicrophone}}
or {{MediaSessionAction/togglecamera}}:

<ul>
<li>
The <dfn dict-member for="MediaSessionActionDetails">isActivating</dfn>
<a>dictionary member</a> SHOULD be provided and will be <code>false</code>
if the user agent is about to [=pausing all input sources|pause all input sources=]
related to the [=media session action|action=] and <code>true</code> otherwise.
</li>
</ul>
The <dfn dict-member for="MediaSessionActionDetails">action</dfn>
<a>dictionary member</a> is used to specify the <a>media session action</a>
that the {{MediaSessionActionHandler}} is associated with.

The <dfn dict-member for="MediaSessionSeekActionDetails">seekOffset</dfn>
<a>dictionary member</a> is the time in seconds to move the playback time by.
If present, it should always be positive. If it is not provided then the site
should choose a sensible time (e.g. a few seconds).

The <dfn dict-member for="MediaSessionSeekToActionDetails">seekTime</dfn>
<a>dictionary member</a> is the time in seconds to move the playback time to.

The <dfn dict-member for="MediaSessionActionSeekToDetails">fastSeek</dfn>
<a>dictionary member</a> will be true if the seek [=media session action|action=]
is being called multiple times as part of a sequence and this is not the last
call in that sequence.

The <dfn dict-member for="MediaSessionActionCaptureDetails">isActivating</dfn>
<a>dictionary member</a> will be <code>false</code> if the user agent is about
to [=pausing all input sources|pause all input sources=] related to the capture
[=media session action|action=] and <code>true</code> otherwise.
This <a>dictionary member</a> MUST be present if the user agent implements a
policy of [=pausing all input sources=].

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

Expand Down

0 comments on commit 0c51d1d

Please sign in to comment.