Skip to content

Commit

Permalink
Introduce a generic skip action as a replacement to skipad.
Browse files Browse the repository at this point in the history
Introduce a media kind to allow marking content as either advertisement, generic and so on.
  • Loading branch information
youennf committed Dec 16, 2024
1 parent 3fbd743 commit 22f2e57
Showing 1 changed file with 46 additions and 3 deletions.
49 changes: 46 additions & 3 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ platform UI or media keys, thereby improving the user experience.
the playback has a notion of playlist.
</li>
<li>
<dfn enum-value for=MediaSessionAction>skipad</dfn>: the action's
intent is to skip the advertisement that is currently playing.
<dfn enum-value for=MediaSessionAction>skip</dfn>: the action's
intent is to skip the media item that is currently playing.
</li>
<li>
<dfn enum-value for=MediaSessionAction>stop</dfn>: the action's intent
Expand Down Expand Up @@ -740,7 +740,7 @@ enum MediaSessionAction {
"seekforward",
"previoustrack",
"nexttrack",
"skipad",
"skip",
"stop",
"seekto",
"togglemicrophone",
Expand Down Expand Up @@ -1066,6 +1066,7 @@ interface MediaMetadata {
attribute DOMString title;
attribute DOMString artist;
attribute DOMString album;
readonly attribute MediaKind kind;
attribute FrozenArray&lt;object> artwork;
[SameObject] readonly attribute FrozenArray&lt;ChapterInformation> chapterInfo;
};
Expand All @@ -1074,9 +1075,18 @@ dictionary MediaMetadataInit {
DOMString title = "";
DOMString artist = "";
DOMString album = "";
MediaKind kind = "";
sequence&lt;MediaImage> artwork = [];
sequence&lt;ChapterInformationInit> chapterInfo = [];
};

enum MediaKind {
"advertisement",
"generic",
"pregeneric",
"summary",
""
};
</pre>

<p>
Expand All @@ -1096,6 +1106,11 @@ dictionary MediaMetadataInit {
which are DOMString.
</p>

<p>
A {{MediaMetadata}} has an associated <dfn for="MediaMetadata">kind</dfn>,
which is a {{MediaKind}}.
</p>

<p>
A {{MediaMetadata}} has an associated sequence of <dfn
for="MediaMetadata">artwork images</dfn>, which is a sequence of type
Expand All @@ -1116,6 +1131,7 @@ dictionary MediaMetadataInit {
<li>Its <a for=MediaMetadata>title</a> is the empty string.</li>
<li>Its <a for=MediaMetadata>artist</a> is the empty string.</li>
<li>Its <a for=MediaMetadata>album</a> is the empty string.</li>
<li>Its <a for=MediaMetadata>kind</a> is the empty string.</li>
<li>Its <a for=MediaMetadata title='artwork image'>artwork images</a> length
is <code>0</code>.</li>
<li>Its <a for=MediaMetadata>chapter information</a> length is
Expand Down Expand Up @@ -1143,6 +1159,10 @@ dictionary MediaMetadataInit {
Set <var>metadata</var>'s {{MediaMetadata/album}} to
<var>init</var>'s {{MediaMetadataInit/album}}.
</li>
<li>
Set <var>metadata</var>'s {{MediaMetadata/kind}} to
<var>init</var>'s {{MediaMetadataInit/kind}}.
</li>
<li>
Run the <a>convert artwork algorithm</a> with <var>init</var>'s
{{MediaMetadataInit/artwork}} as <var>input</var> and set
Expand Down Expand Up @@ -1231,6 +1251,11 @@ user agent MUST run the following steps:
set the {{MediaMetadata}}'s <a for=MediaMetadata>album</a> to the given value.
</p>

<p>
The <dfn attribute for="MediaMetadata">kind</dfn> attribute reflects the
{{MediaMetadata}}'s <a for=MediaMetadata>kind</a>. On getting, it MUST return
the {{MediaMetadata}}'s <a for=MediaMetadata>kind</a>.</p>

<p>
The <dfn attribute for="MediaMetadata">artwork</dfn>
attribute reflects the {{MediaMetadata}}'s <a for="MediaMetadata">artwork
Expand Down Expand Up @@ -1329,12 +1354,14 @@ interface</h2>
interface ChapterInformation {
readonly attribute DOMString title;
readonly attribute double startTime;
readonly attribute MediaKind kind;
[SameObject] readonly attribute FrozenArray&lt;MediaImage> artwork;
};

dictionary ChapterInformationInit {
DOMString title = "";
double startTime = 0;
MediaKind kind = "";
sequence&lt;MediaImage> artwork = [];
};

Expand Down Expand Up @@ -1363,6 +1390,12 @@ dictionary ChapterInformationInit {
startTime</dfn> which is double.
</p>

<p>
A {{ChapterInformation}} has an associated <dfn
for="ChapterInformation">kind</dfn>
which is a {{MediaKind}}.
</p>

<p>
A {{ChapterInformation}} has an associated list of <dfn
for="ChapterInformation">
Expand All @@ -1387,6 +1420,10 @@ dictionary ChapterInformationInit {
for=ChapterInformation>startTime</a> is negative or greater than
[=duration=], throw a <a exception>TypeError</a>.
</li>
<li>
Set <var>chapterInfo</var>'s {{ChapterInformation/kind}} to
<var>init</var>'s {{ChapterInformationInit/kind}}.
</li>
<li>
Let {{ChapterInformationInit/artwork}} be the result of running the
<a>convert artwork algorithm</a> with <var>init</var>'s
Expand Down Expand Up @@ -1416,6 +1453,12 @@ dictionary ChapterInformationInit {
for=ChapterInformation>startTime</a>.
</p>

<p>
The <dfn attribute for="ChapterInformation">kind</dfn> attribute reflects the
{{ChapterInformation}}'s <a for=ChapterInformation>kind</a>. On getting, it
MUST return the {{ChapterInformation}}'s <a for=ChapterInformation>kind</a>.
</p>

<p>
The <dfn attribute for="ChapterInformation">artwork</dfn>
attribute reflects the {{ChapterInformation}}'s <a
Expand Down

0 comments on commit 22f2e57

Please sign in to comment.