Skip to content
Open
Changes from 8 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
87 changes: 84 additions & 3 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,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 @@ -751,7 +751,7 @@ enum MediaSessionAction {
"seekforward",
"previoustrack",
"nexttrack",
"skipad",
"skip",
"stop",
"seekto",
"togglemicrophone",
Expand Down Expand Up @@ -1079,6 +1079,7 @@ interface MediaMetadata {
attribute DOMString title;
attribute DOMString artist;
attribute DOMString album;
readonly attribute MediaKind kind;
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 'kind' attribute is marked as readonly in the interface but can be set through MediaMetadataInit. This inconsistency could confuse API consumers about whether the property is mutable after construction.

Copilot uses AI. Check for mistakes.
attribute FrozenArray&lt;object> artwork;
[SameObject] readonly attribute FrozenArray&lt;ChapterInformation> chapterInfo;
};
Expand All @@ -1087,9 +1088,21 @@ dictionary MediaMetadataInit {
DOMString title = "";
DOMString artist = "";
DOMString album = "";
MediaKind kind = "";
sequence&lt;MediaImage> artwork = [];
sequence&lt;ChapterInformationInit> chapterInfo = [];
};

enum MediaKind {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we add a section describing what these mean? "advertisement" is obvious to me, but the rest are not so obvious

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I updated the enum and added some description.
Let's discuss this enum.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does the implementation make use of these values, e.g., in a default action handler? I'm wondering if an enum is needed and we could let the web app set any value it wants, using DOMString.

Also, a web app might want to skip between chapters, so do we need similar on ChapterInformation?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

kind could influence UA UI (whether displaying a skip button, for how long, skip button label customisation to Skip intro for instance...). An arbitrary DOMString might add complexity and would disallow feature detection.

do we need similar on ChapterInformation?

Right, this PR adds kind to ChapterInformation as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes sense, thanks.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This list may be a bit too specific, for example BBC might want to offer a skip to next news item, skip to next song, or whatever.

"advertisement",
"closing-credits",
"cold-open-scene",
"opening-credits",
"post-credits-scene",
"summary",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Instead of summary, recap might be a better word? It matches current impl via content providers and recap more closely matches this element's description.

"content",
""
Copy link
Copy Markdown
Member

@marcoscaceres marcoscaceres Jan 14, 2025

Choose a reason for hiding this comment

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

Maybe let's just call this "content" ? or "other".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed it to other, note that the default value of the dictionary kind value is also updated.

};
</pre>

<p>
Expand All @@ -1109,6 +1122,46 @@ dictionary MediaMetadataInit {
which are DOMString.
</p>

<p>
A {{MediaMetadata}} has an associated <dfn for="MediaMetadata">kind</dfn>,
which is a {{MediaKind}}, which can have one of the following value:
Comment thread
youennf marked this conversation as resolved.
</p>
<ul>
<li>
<dfn enum-value for=MediaKind>advertisement</dfn>: the media content represents advertisments.
Comment thread
chrisn marked this conversation as resolved.
Outdated
</li>
<li>
<dfn enum-value for=MediaKind>closing-credits</dfn>: the media content represents closing credits,
typically happening at the end of a video.
</li>
<li>
<dfn enum-value for=MediaKind>cold-open-scene</dfn>: the media content represents a cold open scene,
typically happening at the very beginning of a video, before opening credits.
</li>
<li>
<dfn enum-value for=MediaKind>opening-credits</dfn>: the media content represents opening credits,
typically happening at the beginning of a video.
</li>
<li>
<dfn enum-value for=MediaKind>post-credits-scene</dfn>: the media content represents a post credits scene,
typically happening after the closing credits.
</li>
<li>
<dfn enum-value for=MediaKind>summary</dfn>: the media content represents a summary,
typically happening at the beginning of a TV series episode and summarizing past episodes.
</li>
<li>
<dfn enum-value for=MediaKind>content</dfn>: the media content represents the main media content,
like a song or a TV series episode..
Comment thread
chrisn marked this conversation as resolved.
Outdated
</li>
<li>
the empty string: the default value of media content, it represents any other value of a part of media content.
</li>
</ul>
<p class=note>
This enumeration is experimental and is subject to changes.
</p>
Comment thread
youennf marked this conversation as resolved.

<p>
A {{MediaMetadata}} has an associated sequence of <dfn
for="MediaMetadata">artwork images</dfn>, which is a sequence of type
Expand All @@ -1130,6 +1183,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 All @@ -1156,6 +1210,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 @@ -1245,6 +1303,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 @@ -1344,12 +1407,14 @@ interface</h2>
interface ChapterInformation {
readonly attribute DOMString title;
readonly attribute double startTime;
readonly attribute MediaKind kind;
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.

Similar to MediaMetadata, the 'kind' attribute is readonly in ChapterInformation but can be set through ChapterInformationInit, creating potential confusion about mutability.

Copilot uses AI. Check for mistakes.
[SameObject] readonly attribute FrozenArray&lt;MediaImage> artwork;
};

dictionary ChapterInformationInit {
DOMString title = "";
double startTime = 0;
MediaKind kind = "";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same question here about whether it should be "other"

sequence&lt;MediaImage> artwork = [];
};

Expand All @@ -1373,6 +1438,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 @@ -1397,6 +1468,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 @@ -1425,6 +1500,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