diff --git a/index.bs b/index.bs index 0aa28bc..26c4218 100644 --- a/index.bs +++ b/index.bs @@ -1090,6 +1090,7 @@ interface MediaMetadata { attribute DOMString album; attribute FrozenArray<object> artwork; [SameObject] readonly attribute FrozenArray<ChapterInformation> chapterInfo; + [SameObject] readonly attribute FrozenArray<MediaTranscripts> transcripts; }; dictionary MediaMetadataInit { @@ -1098,6 +1099,7 @@ dictionary MediaMetadataInit { DOMString album = ""; sequence<MediaImage> artwork = []; sequence<ChapterInformationInit> chapterInfo = []; + sequence<MediaTranscriptsInit> transcripts = []; }; @@ -1128,7 +1130,12 @@ dictionary MediaMetadataInit {
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, which is a sequence of type {{MediaTranscripts}}.
@@ -1143,6 +1150,7 @@ dictionary MediaMetadataInit {
is 0.
0.0.@@ -1177,13 +1185,23 @@ 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 + {{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 are used by user agents to provide transcription for the + media content. +
+ ++ A {{MediaTranscripts}} has an associated + language which is {{DOMString}} of a + [[BCP47]] language tag. +
+ ++ A {{MediaTranscripts}} has an associated list of + transcripts for the language. +
+ ++ 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 + language. +
+ ++ The transcripts attribute + reflects the {{MediaTranscripts}}'s transcripts. + On getting, it must return the {{MediaTranscripts}}'s + transcripts. +
+ +
+enum MediaTranscriptType {
+ "subtitles",
+ "captions",
+ "descriptions",
+ "metadata",
+};
+
+dictionary MediaTranscript {
+ MediaTranscriptType type = "subtitles";
+ DOMString speaker = "";
+ double startTime = 0;
+ double endTime = 0;
+ DOMString text = "";
+};
+
+
++ The {{MediaTranscript}} dictionary is a representation of a single piece of + transcript information. +
+ ++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: +
++ 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 startTime + dictionary member is used to specify the start time of the transcript + in seconds. It should be zero or positive. +
+ ++ The endTime + dictionary member is used to specify the end time of the transcript in + seconds. It should be larger than {{MediaTranscript/startTime}}. +
+ ++ The text dictionary member + is used to specify the content of the transcript. It is a {{DOMString}}. +
+