From ac4010ffd8833fa5189dd39cc1c8adbbb8e53b83 Mon Sep 17 00:00:00 2001
From: Yiren Wang
+ A {{MediaMetadata}} has an associated list of + transcripts. +
+
A {{MediaMetadata}} is said to be an empty metadata if it is equal
to `null` or all the following conditions are true:
@@ -1143,6 +1150,7 @@ dictionary MediaMetadataInit {
is 0.
0.0.@@ -1185,6 +1193,19 @@ dictionary MediaMetadataInit { to the result of [=Create a frozen array|creating a frozen array=] from chapters. +
+ The chapterInfo attribute reflects + the {{MediaMetadata}}'s chapter information. + On getting, it MUST return the {{MediaMetadata}}'s + chapter information. On setting, it MUST set the + {{MediaMetadata}}'s chapter information to the given + value. +
+ ++ The transcripts attribute reflects + the {{MediaMetadata}}'s transcripts. On getting, + it MUST return the {{MediaMetadata}}'s transcripts. + On setting, it MUST set the {{MediaMetadata}}'s + transcripts to the given value. +
+When {{MediaMetadata}}'s title, artist, album or artwork images are modified, the user agent MUST run the + for=MediaMetadata>artist, album, + artwork images, + chapter information or + transcripts are modified, the user agent MUST run the following steps:
+[Exposed=Window]
+interface MediaTranscripts {
+ readonly attribute DOMString language;
+ [SameObject] readonly attribute FrozenArray<MediaTranscript> transcripts;
+};
+
+dictionary MediaTranscriptsInit {
+ DOMString language = "en-US";
+ sequence<MediaTranscript> transcripts = [];
+};
+
+
++ A {{MediaTranscripts}} object is a representation of transcripts for a + language, which can be used by user agents to provide transcription for the + media content. +
+ ++ A {{MediaTranscripts}} has an associated + language which is DOMString of a BCP 47 + language tag. +
+ ++ A {{MediaTranscripts}} has an associated list of + transcripts for the language. +
+ ++ To create a {{MediaTranscripts}} with init, run the + following steps: +
++ The language attribute reflects + the {{MediaTranscripts}}'s language. On getting, + it MUST return the {{MediaTranscripts}}'s + language. +
+ ++ The transcripts attribute + reflects the {{MediaTranscripts}}'s transcripts. + On getting, it MUST return the {{MediaTranscripts}}'s + transcripts. +
+ +
+enum MediaTranscriptType {
+ "subtitles",
+ "captions",
+ "descriptions",
+ "metadata",
+};
+
+[Exposed=Window]
+interface MediaTranscript {
+ readonly attribute MediaTranscriptType type;
+ readonly attribute DOMString speaker;
+ readonly attribute double startTime;
+ readonly attribute double endTime;
+ readonly attribute DOMString text;
+};
+
+dictionary MediaTranscriptInit {
+ MediaTranscriptType type = "subtitles";
+ DOMString speaker = "";
+ double startTime = 0;
+ double endTime = 0;
+ DOMString text = "";
+};
+
+
++ A {{MediaTranscript}} object is a representation of a single piece of + transcript information. +
+ ++ A {{MediaTranscript}} has an associated type + which is an enum of {{MediaTranscriptType}} to indicate the purpose of the + transcript. {{MediaTranscriptType}} can have one of the following values: +
++ A {{MediaTranscript}} has an associated + speaker which is a DOMString of the name or + character identifier for the speaker. +
+ ++ A {{MediaTranscript}} has an associated + startTime which is double. +
+ ++ A {{MediaTranscript}} has an associated + endTime which is double. +
+ ++ A {{MediaTranscript}} has an associated text + which is a DOMString of content for the transcript. +
+ ++ To create a {{MediaTranscript}} with init, run the + following steps: +
++ The type attribute reflects + the {{MediaTranscript}}'s type. On getting, + it MUST return the {{MediaTranscript}}'s type. +
+ ++ The speaker attribute reflects + the {{MediaTranscript}}'s speaker. On getting, + it MUST return the {{MediaTranscript}}'s speaker. +
+ ++ The startTime attribute reflects + the {{MediaTranscript}}'s startTime in seconds. + On getting, it MUST return the {{MediaTranscript}}'s + startTime. +
+ ++ The endTime attribute reflects + the {{MediaTranscript}}'s endTime in seconds. + On getting, it MUST return the {{MediaTranscript}}'s + endTime. +
+ ++ The text attribute reflects + the {{MediaTranscript}}'s text. On getting, + it MUST return the {{MediaTranscript}}'s text. +
+A {{MediaMetadata}} has an associated list of - chapter information. + chapter information, which is a sequence of type {{ChapterInformation}}.
A {{MediaMetadata}} has an associated list of - transcripts. + transcripts, which is a sequence of type {{MediaTranscripts}}.
@@ -1185,13 +1185,11 @@ dictionary MediaMetadataInit {
The chapterInfo attribute reflects the {{MediaMetadata}}'s chapter information. - On getting, it MUST return the {{MediaMetadata}}'s - chapter information. On setting, it MUST set the + On getting, it must return the {{MediaMetadata}}'s + chapter information. On setting, it must set the {{MediaMetadata}}'s chapter information to the given value.
@@ -1352,8 +1349,8 @@ user agent MUST run the following steps:The transcripts attribute reflects the {{MediaMetadata}}'s transcripts. On getting, - it MUST return the {{MediaMetadata}}'s transcripts. - On setting, it MUST set the {{MediaMetadata}}'s + it must return the {{MediaMetadata}}'s transcripts. + On setting, it must set the {{MediaMetadata}}'s transcripts to the given value.
@@ -1362,7 +1359,7 @@ user agent MUST run the following steps: for=MediaMetadata>artist, album, artwork images, chapter information or - transcripts are modified, the user agent MUST run the + transcripts are modified, the user agent must run the following steps:A {{MediaTranscripts}} object is a representation of transcripts for a - language, which can be used by user agents to provide transcription for the + language, which are used by user agents to provide transcription for the media content.
A {{MediaTranscripts}} has an associated - language which is DOMString of a BCP 47 - language tag. + language which is {{DOMString}} of a + [[BCP47]] language tag.
@@ -1555,33 +1552,26 @@ dictionary MediaTranscriptsInit {
- To create a {{MediaTranscripts}} with init, run the - following steps: + To create a {{MediaTranscripts}} given a {{MediaTranscriptsInit}} + init, run the following steps:
The language attribute reflects the {{MediaTranscripts}}'s language. On getting, - it MUST return the {{MediaTranscripts}}'s + it must return the {{MediaTranscripts}}'s language.
The transcripts attribute reflects the {{MediaTranscripts}}'s transcripts. - On getting, it MUST return the {{MediaTranscripts}}'s + On getting, it must return the {{MediaTranscripts}}'s transcripts.
-
enum MediaTranscriptType {
- "subtitles",
- "captions",
- "descriptions",
- "metadata",
+ "subtitles",
+ "captions",
+ "descriptions",
+ "metadata",
};
-[Exposed=Window]
-interface MediaTranscript {
- readonly attribute MediaTranscriptType type;
- readonly attribute DOMString speaker;
- readonly attribute double startTime;
- readonly attribute double endTime;
- readonly attribute DOMString text;
-};
-
-dictionary MediaTranscriptInit {
+dictionary MediaTranscript {
MediaTranscriptType type = "subtitles";
DOMString speaker = "";
double startTime = 0;
@@ -1631,14 +1612,14 @@ dictionary MediaTranscriptInit {
- A {{MediaTranscript}} object is a representation of a single piece of + The {{MediaTranscript}} dictionary is a representation of a single piece of transcript information.
- A {{MediaTranscript}} has an associated type - which is an enum of {{MediaTranscriptType}} to indicate the purpose of the - transcript. {{MediaTranscriptType}} can have one of the following values: +The type dictionary member +is used to specify the purpose of the transcript. It is an enum of +{{MediaTranscriptType}} which has one of the following values:
- A {{MediaTranscript}} has an associated - speaker which is a DOMString of the name or - character identifier for the speaker. -
- -- A {{MediaTranscript}} has an associated - startTime which is double. -
- -- A {{MediaTranscript}} has an associated - endTime which is double. -
- -- A {{MediaTranscript}} has an associated text - which is a DOMString of content for the transcript. -
- -- To create a {{MediaTranscript}} with init, run the - following steps: -
-- The type attribute reflects - the {{MediaTranscript}}'s type. On getting, - it MUST return the {{MediaTranscript}}'s type. + The speaker + dictionary member is used to specify the speaker of the transcript. + It is a {{DOMString}} of the name or character identifier of the speaker.
- The speaker attribute reflects - the {{MediaTranscript}}'s speaker. On getting, - it MUST return the {{MediaTranscript}}'s speaker. + The startTime + dictionary member is used to specify the start time of the transcript + in seconds. It should be zero or positive.
- The startTime attribute reflects - the {{MediaTranscript}}'s startTime in seconds. - On getting, it MUST return the {{MediaTranscript}}'s - startTime. + The endTime + dictionary member is used to specify the end time of the transcript in + seconds. It should be larger than {{MediaTranscript/startTime}}.
- The endTime attribute reflects - the {{MediaTranscript}}'s endTime in seconds. - On getting, it MUST return the {{MediaTranscript}}'s - endTime. -
- -- The text attribute reflects - the {{MediaTranscript}}'s text. On getting, - it MUST return the {{MediaTranscript}}'s text. + The text dictionary member + is used to specify the content of the transcript. It is a {{DOMString}}.