HTML — track 要素

編集の都合により,この~pageでは、 原文の ~media要素に関する各~節 から,[ `track^e 要素/`~tT$ ]のみに関わる部分を抜き出している。

【この訳に特有な表記規約】

◎表記記号

4.8.10. `track^e 要素

`分類$
なし。 ◎ None.
`この要素を利用できる文脈$
`~media要素$の子として — ただし、 同胞のどの`~flow内容$よりも前。 ◎ As a child of a media element, before any flow content.
`内容~model$
`なし$ ◎ Nothing.
`text/html における~tag省略$
`終了~tag$はない。 ◎ No end tag.
`内容~属性$
`大域~属性$ ◎ Global attributes
`kind$aT — ~tTの型 ◎ kind — The type of text track
`src$aT — 資源の~address ◎ src — Address of the resource
`srclang$aT — ~tTの言語 ◎ srclang — Language of the text track
`label$aT — 利用者に可視になる~label ◎ label — User-visible label
`default$aT — より相応しい`~tT$が他にないときに,この~trackを可能化する。 ◎ default — Enable the track if no other text track is more suitable
`~accessibilityの考慮点$
`track$AA ◎ For authors. For implementers.
`~DOM~interface$
[Exposed=Window]
interface `HTMLTrackElement@I : `HTMLElement$I {
  [`HTMLConstructor$] constructor();

  [`CEReactions$] attribute DOMString `kind$mT;
  [`CEReactions$] attribute USVString `src$mT;
  [`CEReactions$] attribute DOMString `srclang$mT;
  [`CEReactions$] attribute DOMString `label$mT;
  [`CEReactions$] attribute boolean `default$mT;

  const unsigned short `NONE$mT = 0;
  const unsigned short `LOADING$mT = 1;
  const unsigned short `LOADED$mT = 2;
  const unsigned short `ERROR$mT = 3;
  readonly attribute unsigned short `readyState$mT;

  readonly attribute `TextTrack$I `track$mT;
};

`track$e 要素は、 作者が,`~media要素$用に明示的な外部の[ 時間同期的な`~tT$ ]を指定することを許容する。 それは、 それ自体では何も`表現-$しない。 ◎ The track element allows authors to specify explicit external timed text tracks for media elements. It does not represent anything on its own.

`kind@aT 属性は,`列挙d属性$であり、 次に挙げる~keyword, とり得る状態, それらの対応付けが定義される: ◎ The kind attribute is an enumerated attribute with the following keywords and states:

~keyword 状態 概略的な記述
`subtitles@vK `Subtitles@st 音響は可用であるが解されないときに相応しくなるような,会話の音声転写nまたは翻訳 (例: `~media資源$の音声~trackの言語を解さない利用者~向けなど)。 動画~上に積層される。 ◎ Transcription or translation of the dialogue, suitable for when the sound is available but not understood (e.g. because the user does not understand the language of the media resource's audio track). Overlaid on the video.
`captions@vK `Captions@st 音響は可用でないか明瞭に聴取れないとき (例: 消音されている/環境音でかき消されている/利用者は耳が遠い) に相応しくなるような,[ 会話の[ 音声転写n/翻訳 ]/ 音響~効果 / 関連な音楽的~cue / その他の関連な音声~情報 ]。 難聴~用に適切に~labelされて動画~上に積層される。 ◎ Transcription or translation of the dialogue, sound effects, relevant musical cues, and other relevant audio information, suitable for when sound is unavailable or not clearly audible (e.g. because it is muted, drowned-out by ambient noise, or because the user is deaf). Overlaid on the video; labeled as appropriate for the hard-of-hearing.
`descriptions@vK `Descriptions@st `~media資源$の動画~成分の~textな記述であって,視覚的な成分が[ 遮られている / 可用でない / 利用-可能でない ]ときに (例:利用者は運転-中に~screenを備えない~appとヤリトリしている/盲目である), 音声~合成~用に意図されるもの。 音声として合成される。 ◎ Textual descriptions of the video component of the media resource, intended for audio synthesis when the visual component is obscured, unavailable, or not usable (e.g. because the user is interacting with the application without a screen while driving, or because the user is blind). Synthesized as audio.
`chapters@vK `Chapters@st ~scriptからの利用に意図される~track。 ~UAにより表示されない。 ◎ Tracks intended for use from script. Not displayed by the user agent.
`metadata@vK `Metadata@st

【 この訳では、 状態~名を[ 単に,~keywordの先頭の文字を大文字にしただけの名前 ]で表記することにする。 】

この属性の[ `欠落~値~用の既定の状態$は `Subtitles$st / `妥当でない値~用の既定の状態$は `Metadata$st ]とする。 ◎ The attribute's missing value default is the subtitles state, and its invalid value default is the metadata state.

`src@aT 属性は、 ~tT~dataの`~URL$を与える。 要素は、 この属性を有していなければナラナイ — 指定する値は、 `前後~空白~可の妥当かつ空でない~URL$でなければナラナイ。 ◎ The src attribute gives the URL of the text track data. The value must be a valid non-empty URL potentially surrounded by spaces. This attribute must be present.

各 `track$e 要素には `~track~URL@ が結付けられる — それは、 文字列であり,初期~時は空~文字列とする。 ◎ The element has an associated track URL (a string), initially the empty string.

`track$e 要素 %要素 の `src$aT 属性が設定されたときは、 次の手続きを走らす: ◎ When the element's src attribute is set, run these steps:

  1. %~track~URL ~LET `失敗^i ◎ Let trackURL be failure.
  2. %値 ~LET %要素 の `src$aT 属性の値 ◎ Let value be the element's src attribute value.
  3. ~IF[ %値 ~NEQ 空~文字列 ] ⇒ %~track~URL ~SET `~URLを符号化法の下で相対的に構文解析する$( %値, %要素 の`~node文書$ ) 【!#encoding-parsing-and-serializing-a-url】 ◎ If value is not the empty string, then set trackURL to the result of encoding-parsing-and-serializing a URL given value, relative to the element's node document.
  4. %要素 の`~track~URL$ ~SET %~track~URL に応じて ⇒# `失敗^i ならば空~文字列/ ~ELSE_ `~URLを直列化する$( %~track~URL ) ◎ Set the element's track URL to trackURL if it is not failure; otherwise to the empty string.

要素の`~track~URL$で識別される資源が~WebVTT~fileである場合、[ 要素の `kind$aT 属性の状態 ~NIN { `Chapters$st, `Metadata$st } ]ならば,その~fileは`~cue~textを利用する~WebVTT~file$でなければナラナイ。 `WEBVTT$r ◎ If the element's track URL identifies a WebVTT resource, and the element's kind attribute is not in the chapters metadata or metadata state, then the WebVTT file must be a WebVTT file using cue text. [WEBVTT]

`srclang@aT 属性は、 ~tT~dataの言語を与える。 指定する値は、 妥当な `BCP47$r 言語~tagでなければナラナイ。 要素は、 その `kind$aT 属性の状態 ~EQ `Subtitles$st の場合には,この属性を有していなければナラナイ。 ◎ The srclang attribute gives the language of the text track data. The value must be a valid BCP 47 language tag. This attribute must be present if the element's kind attribute is in the subtitles state. [BCP47]

要素の `~track言語@ は、[ 要素は `srclang$aT 属性を有していて,その値 ~NEQ 空~文字列ならば その値 / ~ELSE_ ε (なし) ]とする。 ◎ If the element has a srclang attribute whose value is not the empty string, then the element's track language is the value of the attribute. Otherwise, the element has no track language.

`label@aT 属性は、 ~track用に利用者が読める~titleを与える。 この~titleは、[ `kind$aT 属性の状態 ~IN { `Subtitles$st, `Captions$st, `Descriptions$st } ]を満たす~track(字幕, ~caption, 音述)が~UAの~UIに~listされるときに利用される。 ◎ The label attribute gives a user-readable title for the track. This title is used by user agents when listing subtitle, caption, and audio description tracks in their user interface.

`label$aT 属性の値に空~文字列が指定されてはナラナイ。 更には、 同じ`~media要素$の子に, ~AND↓ を満たす[ 2 つの `track$e 要素 ]が在ってはナラナイ: ◎ The value of the label attribute, if the attribute is present, must not be the empty string. Furthermore, there must not be two track element children of the same media element\

`track$e 要素の `~track~label@ は、[ 要素は `label$aT 属性を有するならば その値 / ~ELSE_ 空~文字列 ]とする。 ◎ If the element has a label attribute whose value is not the empty string, then the element's track label is the value of the attribute. Otherwise, the element's track label is an empty string.

`default@aT 属性は`真偽-属性$である。 要素がこの属性を有する場合、[ 要素が表現する~trackは、 利用者の選好により別の~trackがより適切と指示されない場合には,可能化されることになる ]ことを指示する。 ◎ The default attribute is a boolean attribute, which, if specified, indicates that the track is to be enabled if the user's preferences do not indicate that another track would be more appropriate.

同じ`~media要素$の子として ~AND↓ を満たす[ 2 つの `track$e 要素 ]が在ってはナラナイ:

  • どちらも `default$aT 属性を有する
  • 両~要素の `kind$aT 属性の状態は ~OR↓ を満たす:

    • どちらも ~IN { `Subtitles$st, `Captions$st }
    • どちらも `Descriptions$st
    • どちらも `Chapters$st
◎ Each media element must have no more than one track element child whose kind attribute is in the subtitles or captions state and whose default attribute is specified. ◎ Each media element must have no more than one track element child whose kind attribute is in the description state and whose default attribute is specified. ◎ Each media element must have no more than one track element child whose kind attribute is in the chapters metadata state and whose default attribute is specified.

注記: `default$aT 属性を有する `track$e 要素であっても,[ `kind$aT 属性の状態 ~EQ `Metadata$st ]を満たすものの個数には上限はない。 ◎ There is no limit on the number of track elements whose kind attribute is in the metadata state and whose default attribute is specified.

%track.`readyState$mT

次に挙げる数で表現される`準備度$tTを返す : ◎ Returns the text track readiness state, represented by a number from the following list:

%track.`NONE$mT (0)
`未読込み$i 状態にある。 ◎ The text track not loaded state.
%track.`LOADING$mT (1)
`読込中$i 状態にある。 ◎ The text track loading state.
%track.`LOADED$mT (2)
`読込済み$i 状態にある。 ◎ The text track loaded state.
%track.`ERROR$mT (3)
`読込失敗$i 状態にある。 ◎ The text track failed to load state.
%track.`track$mT
`track$e 要素の`~tT$を表現している `TextTrack$I ~objを返す。 ◎ Returns the TextTrack object corresponding to the text track of the track element.
`readyState@mT 取得子~手続きは ⇒ ~RET コレの`~tT$の`準備度$tTに応じて,次に定義される数-値 ⇒# `未読込み$i ならば `NONE@mT (数-値 0 )/ `読込中$i ならば `LOADING@mT (数-値 1 )/ `読込済み$i ならば `LOADED@mT (数-値 2 )/ `読込失敗$i ならば `ERROR@mT (数-値 3 ) ◎ The readyState attribute must return the numeric value corresponding to the text track readiness state of the track element's text track, as defined by the following list: • NONE (numeric value 0) •• The text track not loaded state. • LOADING (numeric value 1) •• The text track loading state. • LOADED (numeric value 2) •• The text track loaded state. • ERROR (numeric value 3) •• The text track failed to load state.
`track@mT 取得子~手続きは ⇒ ~RET コレの`~tT$を表現している `TextTrack$I ~obj ◎ The track IDL attribute must, on getting, return the track element's text track's corresponding TextTrack object.

`src@mT ~IDL属性は、 `src$aT 内容~属性を`反映する$モノトスル。

`srclang@mT ~IDL属性は、 `srclang$aT 内容~属性を`反映する$モノトスル。

`label@mT ~IDL属性は、 `label$aT 内容~属性を`反映する$モノトスル。

`default@mT ~IDL属性は、 `default$aT 内容~属性を`反映する$モノトスル。

◎ The src, srclang, label, and default IDL attributes must reflect the respective content attributes of the same name.\

`kind@mT ~IDL属性は、 `既知な値のみに制限され$る下で, `kind$aT 内容~属性を`反映する$モノトスル。 ◎ The kind IDL attribute must reflect the content attribute of the same name, limited to only known values.

次の動画には、 いくつかの言語による字幕がある: ◎ This video has subtitles in several languages:

`track-1^xCode

(最後の 2 個の `lang$a 属性は、 字幕ではなく `label$aT 属性の言語を述べるものである。 字幕の言語は `srclang$aT 属性が与える。) ◎ (The lang attributes on the last two describe the language of the label attribute, not the language of the subtitles themselves. The language of the subtitles is given by the srclang attribute.)

4.8.11. ~media要素

【 以下,この節では、 原文のこの節の内容のうち,`~tT$が主に関わる部分を述べる。 他の内容の和訳は、 別~pageにて。 】

4.8.11.8. ~media資源の再生-法

各`~media要素$は `新たに導入される~cueの~list@ を持ち、 初期~時には空になるモノトスル。 ◎ Each media element has a list of newly introduced cues, which must be initially empty.\

`~media要素$ %~media要素 の`~tT~list$に対し:

  • それを成す ある`~tT$の`~cue~list$tTに`~cue$ %~cue が追加されたときは ⇒ %~media要素 の`新たに導入される~cueの~list$に %~cue を追加するモノトスル。
  • `~tT$ %~tT が 追加されたときは ⇒ %~media要素 の`新たに導入される~cueの~list$に[ %~tT の`~cue~list$tTを成すすべての`~cue$ ]を追加するモノトスル。
◎ Whenever a text track cue is added to the list of cues of a text track that is in the list of text tracks for a media element, that cue must be added to the media element's list of newly introduced cues.\ Whenever a text track is added to the list of text tracks for a media element, all of the cues in that text track's list of cues must be added to the media element's list of newly introduced cues.\

`~media要素$ %~media要素 のうち`~posterを示して$いないものに対し,次のいずれかが生じたときは…: ◎ ↓

  • %~media要素 の`新たに導入される~cueの~list$に,新たに ~cueたちが追加されたとき ◎ When a media element's list of newly introduced cues has new cues added while the media element's show poster flag is not set, then the user agent must run the time marches on steps.
  • %~media要素 の`~tT~list$を成す`~tT$の`~cue~list$tTから,ある`~cue$が除去されたとき ◎ When a text track cue is removed from the list of cues of a text track that is in the list of text tracks for a media element, and\
  • %~media要素 の`~tT~list$から,ある`~tT$が除去されたとき ◎ whenever a text track is removed from the list of text tracks of a media element, if the media element's show poster flag is not set, then the user agent must run the time marches on steps.
  • %~media要素 の`現在の再生~位置$が(例えば,再生や~seekingに因り)変化したとき ◎ When the current playback position of a media element changes (e.g. due to playback or seeking), the user agent must run the time marches on steps.\

…次を走らすモノトスル ⇒ `~tTを時間に合わせる$( %~media要素 ) ◎ ↑

~cue~eventを発火する時機の正確度に依存する利用事例 — ~captionを動画~内の~shot変化に同期させるなど — を~supportするため、 ~UAは,当の`~media時列線$における それらの位置にアリな限り近く — 理想的には 20 ~milli秒~以内に — ~cue~eventを発火するベキである。 この手続きが走っている間に,`現在の再生~位置$が変化した場合、 手続きが完了するまで待機してから即時に,この手続きを再度走らすモノトスル。 したがって,この手続きは、[ アリな限り多く/必要なだけ ]何回も走ることになる。 ◎ To support use cases that depend on the timing accuracy of cue event firing, such as synchronizing captions with shot changes in a video, user agents should fire cue events as close as possible to their position on the media timeline, and ideally within 20 milliseconds. If the current playback position changes while the steps are running, then the user agent must wait for the steps to complete, and then must immediately rerun the steps. These steps are thus run as often as possible or needed.

注記: 1 回の反復に長時間かかる場合、 ~UAは “急いで追いつこうと” する結果,所用時間が短い`~cue$は飛ばされ, `activeCues$tt ~list内に現れなくなる。 ◎ If one iteration takes a long time, this can cause short duration cues to be skipped over as the user agent rushes ahead to "catch up", so these cues will not appear in the activeCues list.

`~tTを時間に合わせる@ ( `time marches on steps^en ) ときは、 所与の ( `~media要素$ %~media要素 ) に対し,次を走らすモノトスル: ◎ The time marches on steps are as follows:

  1. %現在の再生~位置 ~LET %~media要素 の`現在の再生~位置$ ◎ ↓
  2. %不能化されていない~cue群 ~LET 次を満たす`~cue$たちが成す集合 ⇒ [ ~cue ~IN %~media要素 の`~tT~list$を成すある`~tT$の`~cue~list$tT ]~AND[ ~cueの`~mode$tT ~NEQ `~disabled$i【! ~IN { `~hidden$i, `~showing$i }】 ] ◎ ↓
  3. ( %現在の~cue群, %他の~cue群 ) ~LET %不能化されていない~cue群 を成す`~cue$のうち,順に ( 次を満たすもの, 満たさないもの ) たちが成す~list ⇒ [ `開始~時刻$tC ~LTE %現在の再生~位置 ]~AND[ `終了~時刻$tC ~GT %現在の再生~位置 ] ◎ Let current cues be a list of cues, initialized to contain all the cues of all the hidden or showing text tracks of the media element (not the disabled ones) whose start times are less than or equal to the current playback position and whose end times are greater than the current playback position. ◎ Let other cues be a list of cues, initialized to contain all the cues of hidden and showing text tracks of the media element that are not present in current cues.

  4. %見逃した~cue群 ~LET 空~list ◎ ↓
  5. %初回か ~LET ~IS[ %~media要素 に対し,この~algoを走らせたのは初回である ] ◎ ↓
  6. %最後の時刻 ~LET %初回か に応じて ⇒# ~F ならば,前回に走らせた時点†における %~media要素 の`現在の再生~位置$ / ~T ならば, %~media要素 の初期~時における`現在の再生~位置$†† ◎ Let last time be the current playback position at the time this algorithm was last run for this media element, if this is not the first time it has run.

    【† その直後か直前か不明瞭だが、 この~algoは`現在の再生~位置$を改変しないので,どちらでも同じことと見受けられる 】【†† “~T ならば…” 以下は、 この訳による補完。 】

  7. %単調増加か ~LET ~IS[ %~media要素 の`現在の再生~位置$は、 通常の再生による通例的な単調増加のみにより, %最後の時刻 から %現在の再生~位置 まで達した ] ◎ ↓
  8. ~IF[ %初回か ~EQ ~F ]~AND[ %単調増加か ~EQ ~T ] ⇒ %見逃した~cue群 ~SET %他の~cue群 を成す`~cue$のうち,次を満たすものたちが成す~list ⇒ [ `開始~時刻$tC ~GTE %最後の時刻 ]~AND[ `終了~時刻$tC ~LTE %現在の再生~位置 ]~AND[ ~cue ~NIN %~media要素 の`新たに導入される~cueの~list$ ] ◎ If the current playback position has, since the last time this algorithm was run, only changed through its usual monotonic increase during normal playback, then let missed cues be the list of cues in other cues whose start times are greater than or equal to last time and whose end times are less than or equal to the current playback position. Otherwise, let missed cues be an empty list. ◎ Remove all the cues in missed cues that are also in the media element's list of newly introduced cues, and then\

  9. %~media要素 の`新たに導入される~cueの~list$を空にする ◎ empty the element's list of newly introduced cues.
  10. ~IF[ %単調増加か ~EQ ~T ]~AND[ ~UAは過去[ 15ms 〜 250ms ]の間に, %~media要素 に向けて `timeupdate$et ~eventをまだ発火しておらず、 そのような~event用の~event~handlerをまだ走らせていない† ] ⇒ `~media~taskを~queueする$( %~media要素, 次の手続き ) ◎ If the time was reached through the usual monotonic increase of the current playback position during normal playback, and if the user agent has not fired a timeupdate event at the element in the past 15 to 250ms and is not still running event handlers for such an event, then the user agent must queue a media element task given the media element\

    手続きは ⇒ `~eventを発火する$( %~media要素, `timeupdate$et ) ◎ to fire an event named timeupdate at the element.\

    (明示的な~seekなど,他の事例においては、 `現在の再生~位置$を変更する処理nの一環として,関連な各種~eventが発火される。) ◎ (In the other cases, such as explicit seeks, relevant events get fired as part of the overall process of changing the current playback position.)

    注記: したがって,~eventが発火される頻度は、 毎秒[ ( 1000 ~DIV 15 ) 回以下/ ( 1000 ~DIV 250 ) 回以上 (~event~handlerは 250ms より長くかからないと見做すなら) ]になる。 ~UAには、[ ~system負荷, 毎回の~event処理の平均~cost ]に基づいて,~eventの頻度を[ 動画を復号している間,~UI更新を滞りなく取扱えるまでに抑える ]よう変えることが奨励される。 ◎ The event thus is not to be fired faster than about 66Hz or slower than 4Hz (assuming the event handlers don't take longer than 250ms to run). User agents are encouraged to vary the frequency of the event based on the system load and the average cost of processing the event each time, so that the UI updates are not any more frequent than the user agent can comfortably handle while decoding the video.

  11. ~IF[ ~AND↓ ]…

    • %現在の~cue群 を成す どの`~cue$も次を満たす ⇒ その`作動中か$tC ~EQ ~T
    • %他の~cue群 を成す どの`~cue$も次を満たす ⇒ その`作動中か$tC ~NEQ ~T
    • %見逃した~cue群 は空である

    …ならば ⇒ ~RET

    ◎ If all of the cues in current cues have their text track cue active flag set, none of the cues in other cues have their text track cue active flag set, and missed cues is empty, then return.
  12. ~IF[ %単調増加か ~EQ ~T ]~AND[ %他の~cue群 を成す ある`~cue$は、 ~AND↓ を満たす ]: ◎ If the time was reached through the usual monotonic increase of the current playback position during normal playback, and there are cues in other cues that have\

    • `退出-時に静止するか$tC ~EQ ~T ◎ their text track cue pause-on-exit flag set and that\
    • [ `作動中か$tC ~EQ ~T ]~OR[ ~cue ~IN %見逃した~cue群 ] ◎ either have their text track cue active flag set or are also in missed cues,\

    …ならば ⇒ %~media要素 の `pause()$mM 手続きを`即時$に遂行する ◎ then immediately pause the media element.

    注記: 明示的な~seekなどの他の事例においては、 再生は,`~cue$の終端~時刻を過ぎても静止されない — その`退出-時に静止するか$tC ~EQ ~T であっても。 ◎ In the other cases, such as explicit seeks, playback is not paused by going past the end time of a cue, even if that cue has its text track cue pause-on-exit flag set.

  13. %影響される~track~list ~LET 空~list ◎ ↓
  14. %~event~list ~LET 空~list ◎ Let events be a list of tasks, initially empty.\

    %~event~list を成す各~itemは、 ( 手続き, `~tT$, `~cue$, 時刻 ) が成す~tupleであり,その手続きを走らす`~task$を表現する。 時刻は、 これらの`~task$を~queueする前に,この~listを~sortするために利用される。 ◎ Each task in this list will be associated with a text track, a text track cue, and a time, which are used to sort the list before the tasks are queued. ◎ Let affected tracks be a list of text tracks, initially empty.

    以下において `~eventを準備する@ と記された所では、 所与の ( %~event名, %~cue, %時刻 ) に対し,次を走らす: ◎ When the steps below say to prepare an event named event for a text track cue target with a time time, the user agent must run these steps:

    1. %~track ~LET %~cue が属する`~tT$ ◎ Let track be the text track with which the text track cue target is associated.
    2. %手続き ~SET 次を走らす手続き ⇒ `~eventを発火する$( %~cue を表現している `TextTrackCue$I ~obj, %~event名 ) ◎ Create a task to fire an event named event at target.
    3. %~event~list に~tuple ( %手続き, %~track, %~cue, %時刻 ) を追加する ◎ Add the newly created task to events, associated with the time time, the text track track, and the text track cue target.
    4. %影響される~track~list に %~track を追加する ◎ Add track to affected tracks.
  15. %見逃した~cue群 を成す ~EACH( `~cue$ %~cue ) に対し ⇒ `~eventを準備する$( `enter$et, %~cue, %~cue の`開始~時刻$tC ) ◎ For each text track cue in missed cues, prepare an event named enter for the TextTrackCue object with the text track cue start time.
  16. %他の~cue群 を成す ~EACH( `~cue$ %cue ) に対し ⇒ ~IF[ %cue の`作動中か$tC ~EQ ~T ]~OR[ %cue ~IN %見逃した~cue群 ] ⇒ `~eventを準備する$( `exit$et , %~cue, `max^op( %~cue の`終了~時刻$tC, %~cue の`開始~時刻$tC ) ) ◎ For each text track cue in other cues that either has its text track cue active flag set or is in missed cues, prepare an event named exit for the TextTrackCue object with the later of the text track cue end time and the text track cue start time.
  17. %現在の~cue群 を成す ~EACH( `~cue$ %cue ) に対し ⇒ ~IF[ %cue の`作動中か$tC ~NEQ ~T ] ⇒ `~eventを準備する$( `enter$et, %~cue, %~cue の`開始~時刻$tC ) ◎ For each text track cue in current cues that does not have its text track cue active flag set, prepare an event named enter for the TextTrackCue object with the text track cue start time.
  18. %~event~list を成す~itemたちを,その時刻の昇順に~sortする — 同じ時刻を持つ~itemどうしは ⇒ それらの`~cue$たちの`~cue順序$で~sortする — 同じ【!`~cue順序$】`~cue$を持つ~itemどうしは ⇒ 手続きにて `enter$et ~eventを発火するものを `exit$et ~eventを発火するものより前にする ◎ Sort the tasks in events in ascending time order (tasks with earlier times first). ◎ Further sort tasks in events that have the same time by the relative text track cue order of the text track cues associated with these tasks. ◎ Finally, sort tasks in events that have the same time and same text track cue order by placing tasks that fire enter events before those that fire exit events.
  19. %~event~list を成す ~EACH( %~item ) に対し ⇒ `~media~taskを~queueする$( %~media要素, %~item の手続き ) ◎ Queue a media element task given the media element for each task in events, in list order.
  20. %影響される~track~list から重複する`~tT$を除去した上で、 %~media要素 の`~tT~list$に`~tT$が現れる順序で~sortする ◎ Sort affected tracks in the same order as the text tracks appear in the media element's list of text tracks, and remove duplicates.
  21. %影響される~track~list を成す ~EACH( `~tT$ %~tT ) に対し ⇒ `~media~taskを~queueする$( %~media要素, 次の手続き ) ◎ For each text track in affected tracks, in the list order, queue a media element task given the media element\

    手続きは:

    1. `~eventを発火する$( %~tT を表現している `TextTrack$I ~obj, `cuechange$et )
    2. ~IF[ %~tT に対応する `track$e 要素 %track はある ] ⇒ `~eventを発火する$( %track, `cuechange$et )
    ◎ to fire an event named cuechange at the TextTrack object, and, if the text track has a corresponding track element, to then fire an event named cuechange at the track element as well.
  22. %現在の~cue群 を成す ~EACH( %~cue ) に対し ⇒ %~cue の`作動中か$tC ~SET ~T ◎ ↓
  23. %他の~cue群 を成す ~EACH( %~cue ) に対し ⇒ %~cue の`作動中か$tC ~SET ~F ◎ Set the text track cue active flag of all the cues in the current cues, and unset the text track cue active flag of all the cues in the other cues.
  24. %影響される~track~list を成す ~EACH( %~tT ) に対し ⇒ ~IF[ %~tT の`~mode$tT ~EQ `~showing$i ] ⇒ %~tT の`具現化を更新するための規則$を走らす 【!例えば,~WebVTTに基づく`~tT$に対しては、`~WebVTT~tTの表示を更新するための規則$になる`WEBVTT$r】 — その際には、[ %~tT の`言語$tT ~NEQ 空~文字列 ]ならば,それを~fallback言語として供する ◎ Run the rules for updating the text track rendering of each of the text tracks in affected tracks that are showing, providing the text track's text track language as the fallback language if it is not the empty string.\ (不要) For example, for text tracks based on WebVTT, the rules for updating the display of WebVTT text tracks. [WEBVTT]

【!上の~algoの目的においては、`~cue~list$tTを成す`~cue$に限り,`~tT$の一部を成すものと見なされる* not merely `~tT$に結付けられているだけでは。】 ◎ (不要) For the purposes of the algorithm above, a text track cue is considered to be part of a text track only if it is listed in the text track list of cues, not merely if it is associated with the text track.

4.8.11.11. 時間同期的な~tT
4.8.11.11.1. ~tT~model

各`~media要素$には、 `~tT~list@ と称される[ `~tT@ たちが成す~group ]が結付けられる【!*】。 それらの`~tT$は、 次に従って~sortされる: ◎ A media element can have a group of associated text tracks, known as the media element's list of text tracks. The text tracks are sorted as follows:

  1. `~media要素$の子である各 `track$e 要素に対応する`~tT$ — `~tree順序$による。 ◎ The text tracks corresponding to track element children of the media element, in tree order.
  2. `addTextTrack()$mM ~methodを利用して追加された`~tT$ — それらが追加された順序による。 ◎ Any text tracks added using the addTextTrack() method, in the order they were added, oldest first.
  3. `~media資源に特有な~tT$ (`~media資源$内の~dataに対応する`~tT$) — `~media資源$の形式~仕様に定義される順序による。 ◎ Any media-resource-specific text tracks (text tracks corresponding to data in the media resource), in the order defined by the media resource's format specification.

各`~tT$は、 次に挙げるものからなる: ◎ A text track consists of:

`種類@tT ◎ The kind of text track
~trackは~UAによりどう取扱われるか裁定する。 ◎ This decides how the track is handled by the user agent.\
種類は、 次に挙げるいずれかの文字列で表現される ⇒# `subtitles@l, `captions@l, `descriptions@l, `chapters@l, `metadata@l ◎ The kind is represented by a string. The possible strings are: • subtitles • captions • descriptions • chapters • metadata
`~tT$が ある `track$e 要素に対応する事例では、 `種類$tTは動的に変化し得る。 ◎ The kind of track can change dynamically, in the case of a text track corresponding to a track element.
`~label@tT ◎ A label
ヒトが読める文字列 — 利用者が~trackを識別するために意図される。 ◎ This is a human-readable string intended to identify the track for the user.
`~tT$が ある `track$e 要素に対応する事例では、 `~label$tTは動的に変化し得る。 ◎ The label of a track can change dynamically, in the case of a text track corresponding to a track element.
~UAは,`~label$tTが空~文字列のときは、 自身の~UIにおける利用-用に適切な~labelを,~tTの他の~propから(例:~tTの種類や言語)自動的に生成するベキである。 この自動的に生成される~labelは、 ~APIには公開されない。 ◎ When a text track label is the empty string, the user agent should automatically generate an appropriate label from the text track's other properties (e.g. the kind of text track and the text track's language) for use in its user interface. This automatically-generated label is not exposed in the API.
`帯域内~metadata~track配送~型@ ◎ An in-band metadata track dispatch type
これは、 `~media資源$から抽出された文字列である — 特定的には帯域内~metadata~track用に[ そのような~trackが文書~内の異なる~scriptに配送されることになる ]のを可能化するため。 ◎ This is a string extracted from the media resource specifically for in-band metadata tracks to enable such tracks to be dispatched to different scripts in the document.
例えば,~web上で~stream化され,~webに特有な対話的~特能で増補された伝統的な~TV局の放送は、[ ~~広告, ~game~showの間の ~trivia~game~data, ~sports~gameの間の ~playerの状態, 料理番組の間の ~recipe情報, 等々 ]用の~metadataを伴う~tTを含み得る。 各 番組が[ 開始するに伴い,新たな~trackが追加される/ 終止するに伴い,~trackが~streamから除去される ]こともある — ~UAは、 各~trackが追加されるに伴い,[ この属性の値を利用して,それを専用の~script~moduleに束縛する ]こともできる。 ◎ For example, a traditional TV station broadcast streamed on the web and augmented with web-specific interactive features could include text tracks with metadata for ad targeting, trivia game data during game shows, player states during sports games, recipe information during food programs, and so forth. As each program starts and ends, new tracks might be added or removed from the stream, and as each one is added, the user agent could bind them to dedicated script modules using the value of this attribute.
帯域内~metadata~tT用~以外では、 `帯域内~metadata~track配送~型$は空~文字列とする。 この値が異なる~media形式~用にどう拡充されるかは、 `~media資源に特有な~tTを公開する手続き$にて述べられる。 ◎ Other than for in-band metadata text tracks, the in-band metadata track dispatch type is the empty string. How this value is populated for different media formats is described in steps to expose a media-resource-specific text track.
`言語@tT ◎ A language
~tTの~cueたちを成す言語を表現している文字列 ( BCP 47 言語~tag)。 `BCP47$r ◎ This is a string (a BCP 47 language tag) representing the language of the text track's cues. [BCP47]
`~tT$が ある `track$e 要素に対応する事例では、 `言語$tTは動的に変化し得る。 ◎ The language of a text track can change dynamically, in the case of a text track corresponding to a track element.
`準備度@tT ◎ A readiness state

次に挙げるいずれか: ◎ One of the following:

`未読込み@i ◎ Not loaded
~tTの~cueたちは,まだ得されていないことを指示する。 ◎ Indicates that the text track's cues have not been obtained.
`読込中@i ◎ Loading
~tTは読込中にあり,これまで致命的な~errorには遭遇していないことを指示する。 ~trackには、 構文解析器により,更に~cueが追加されるかもしれない。 ◎ Indicates that the text track is loading and there have been no fatal errors encountered so far. Further cues might still be added to the track by the parser.
`読込済み@i ◎ Loaded
~tTは致命的~errorなしに読込まれたことを指示する。 ◎ Indicates that the text track has been loaded with no fatal errors.
`読込失敗@i ◎ Failed to load
~tTは可能化されたが、 ~UAがそれを得しようと試みたとき,何らかの仕方で失敗したことを指示する (例: `~URLを符号化法の下で相対的に構文解析する$のに失敗した / ~network~error/ ~tTの形式は未知である)。 その~cueたちのうち一部または全部は、 欠落って得されない見込みが高い。 ◎ Indicates that the text track was enabled, but when the user agent attempted to obtain it, this failed in some way (e.g., URL could not be parsed, network error, unknown text track format). Some or all of the cues are likely missing and will not be obtained.
`~tT$の`準備度$tTは、 それが得されるに伴い,動的に変化する。 ◎ The readiness state of a text track changes dynamically as the track is obtained.
`~mode@tT ◎ A mode

次に挙げるいずれか: ◎ One of the following:

`~disabled@i (不能化されている) ◎ Disabled
~tTは作動中でないことを指示する。 ~DOM内の~trackを公開する目的~以外においては、 ~UAは~tTを無視する。 作動中になる~cueは無く, 発火される~eventは無く, ~UAは~cueを得しようと試みないことになる。 ◎ Indicates that the text track is not active. Other than for the purposes of exposing the track in the DOM, the user agent is ignoring the text track. No cues are active, no events are fired, and the user agent will not attempt to obtain the track's cues.
`~hidden@i (隠されている) ◎ Hidden
~tTは作動中であるが、 ~UAは その~cueは作動化して表示していないことを指示する。 ~trackの~cueを得しようとする試みは,まだ為されていない場合、 ~UAは,直ちにそれを遂行することになる。 ~UAは、[ 作動中であって,それに則って~eventが発火されることになる,~cueたち ]が成す~listを保守している。 ◎ Indicates that the text track is active, but that the user agent is not actively displaying the cues. If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily. The user agent is maintaining a list of which cues are active, and events are being fired accordingly.
`~showing@i (示している) ◎ Showing

~tTは作動中であることを指示する。 ~trackの~cueを得しようとする試みは,まだ為されていない場合、 ~UAは,直ちにそれを遂行することになる。 ~UAは[ 作動中であって,それに則って~eventが発火されることになる,~cueたち ]が成す~listを保守している。 加えて,~tTの`種類$tTに応じて:

  • `subtitles$l / `captions$l ⇒ ~cueたちは動画~上に適切に積層されている
  • `descriptions$l ⇒ ~UAは、 利用者~向けに~cueたちを視覚的でない様式で可用にしている
  • `chapters$l ⇒ ~UAは、 次のような仕組みで,利用者~向けに~cueたちを可用にしている ⇒ 利用者は、 ある~cueを選定することにより,`~media資源$内のどの地点にも~navigateできる
◎ Indicates that the text track is active. If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily. The user agent is maintaining a list of which cues are active, and events are being fired accordingly. In addition, for text tracks whose kind is subtitles or captions, the cues are being overlaid on the video as appropriate; for text tracks whose kind is descriptions, the user agent is making the cues available to the user in a non-visual fashion; and for text tracks whose kind is chapters, the user agent is making available to the user a mechanism by which the user can navigate to any point in the media resource by selecting a cue.
`~cue~list@tT ◎ A list of zero or more cues
`~cue$たちが成す~list。 ◎ A list of text track cues,\ ↓along with rules for updating the text track rendering. For example, for WebVTT, the rules for updating the display of WebVTT text tracks. [WEBVTT]
`~cue~list$tTの内容は、 `~tT$の`準備度$tTが まだ[ `未読込み$i / `読込中$i ]にある間に, あるいは~DOM操作に因り,動的に変化し得る。 ◎ The list of cues of a text track can change dynamically, either because the text track has not yet been loaded or is still loading, or due to DOM manipulation.
(`~cue~list$tTを成す各~cueの) `具現化を更新するための規則@
例えば,~WebVTT用には、 `~WebVTT~tTの表示を更新するための規則$になる。 `WEBVTT$r ◎ ↑
【 何を入力にとり, 何を行うことになるか,などの具体的な詳細は、 この仕様には述べられていない。 【!(`~media要素$に関係するどこかの節で,間接的に何か述べている箇所はあるかもしれないが)】 また,原文では`~cue~list$tTに結付けられるが、 常に`~tT$を介して~accessされるので,この訳では直に~tTに結付けるよう単純~化している。 】

各`~tT$には、 それを表現している `TextTrack$I ~objがある。 【一対一に対応する。】 ◎ Each text track has a corresponding TextTrack object.


各`~media要素$には、 次に挙げるものが結付けられる:

  • `処理待ち~tT~list@ ⇒ ~list — 初期~時は空とする。
  • `構文解析器にて阻まれているか@ ⇒ 真偽値 — 初期~時は ~F とする。
  • `自動的な~tT選定は遂行-済みか@ ⇒ 真偽値 — 初期~時は ~F とする。
◎ Each media element has a list of pending text tracks, which must initially be empty, a blocked-on-parser flag, which must initially be false, and a did-perform-automatic-track-selection flag, which must also initially be false.

`処理待ち~tT~listを拡充する@ ときは、 所与の ( `~media要素$ %~media要素 ) に対し,次を走らすモノトスル ⇒ %~media要素 の`~tT~list$を成す ~EACH( `~tT$ %~tT ) に対し ⇒ ~IF[ %~tT の`~mode$tT ~NEQ `~disabled$i ]~AND[ %~tT の`準備度$tT ~EQ `読込中$i ] ⇒ %~media要素 の`処理待ち~tT~list$に %~tT を追加する ◎ When the user agent is required to populate the list of pending text tracks of a media element, the user agent must add to the element's list of pending text tracks each text track in the element's list of text tracks whose text track mode is not disabled and whose text track readiness state is loading.

`処理待ち~tT~list$ %~list を成す`~tT$ %~tT に対し,次のいずれかが生じたときは、 %~list から %~tT を除去するモノトスル:

  • %~tT は,ある `track$e 要素に対応していて、 その要素の親が変化したとき
  • %~tT の`準備度$tTが[ `読込済み$i/`読込失敗$i ]に変化したとき
◎ Whenever a track element's parent node changes, the user agent must remove the corresponding text track from any list of pending text tracks that it is in. ◎ Whenever a text track's text track readiness state changes to either loaded or failed to load, the user agent must remove it from any list of pending text tracks that it is in.

ある[ `~HTML構文解析器$/`~XML構文解析器$ ]により`~media要素$ %~media要素 が作成されたときは、 次を走らすモノトスル ⇒ %~media要素 の`構文解析器にて阻まれているか$ ~SET ~T ◎ When a media element is created by an HTML parser or XML parser, the user agent must set the element's blocked-on-parser flag to true.\

`~media要素$ %~media要素 が[ `~HTML構文解析器$/`~XML構文解析器$ ]の`~open要素~stack$から~popされ除かれたときは、 次を走らすモノトスル ⇒# `自動的な~tT選定~用の利用者-選好を尊守する$( %~media要素 ); `処理待ち~tT~listを拡充する$( %~media要素 ); %~media要素 の`構文解析器にて阻まれているか$ ~SET ~F ◎ When a media element is popped off the stack of open elements of an HTML parser or XML parser, the user agent must honor user preferences for automatic text track selection, populate the list of pending text tracks, and set the element's blocked-on-parser flag to false.

`~media要素$の`~tT$は、 次を満たすならば `準備済み@i とされる ⇒ [ その`処理待ち~tT~list$は空である ]~AND[ その`構文解析器にて阻まれているか$ ~EQ ~F ] ◎ The text tracks of a media element are ready when both the element's list of pending text tracks is empty and the element's blocked-on-parser flag is false.

各`~media要素$は `~tT変更~通知は処理待ちか@ を持ち、 初期~時には ~F をとるモノトスル。 ◎ Each media element has a pending text track change notification flag, which must initially be unset.

`~media要素$ %~media要素 の`~tT~list$を成す`~tT$の`~mode$tTが変化したときは、 次の手続きを走らすモノトスル: ◎ Whenever a text track that is in a media element's list of text tracks has its text track mode change value, the user agent must run the following steps for the media element:

  1. ~IF[ %~media要素 の`~tT変更~通知は処理待ちか$ ~EQ ~T ] ⇒ ~RET ◎ If the media element's pending text track change notification flag is set, return.
  2. %~media要素 の`~tT変更~通知は処理待ちか$ ~SET ~T ◎ Set the media element's pending text track change notification flag.
  3. `~media~taskを~queueする$( %~media要素, 次の手続き ) ◎ Queue a media element task given the media element to run these steps:

    手続きは:

    1. %~media要素 の`~tT変更~通知は処理待ちか$ ~SET ~F ◎ Unset the media element's pending text track change notification flag.
    2. `~eventを発火する$( %~media要素 の `textTracks$mM 属性が返す~obj, `change$et ) ◎ Fire an event named change at the media element's textTracks attribute's TextTrackList object.
  4. ~IF[ %~media要素 は`~posterを示して$いない ] ⇒ `~tTを時間に合わせる$( %~media要素 ) ◎ If the media element's show poster flag is not set, run the time marches on steps.

この節に挙げた`~task$用の`~task~source$は、 `~DOM操作~task~source$とする。 【と記されているが、明示的に`~media要素~event~task~source$を利用するよう更新されている。】 ◎ The task source for the tasks listed in this section is the DOM manipulation task source.


`~cue@ ( `text track cue^en †)は、 特定0の時刻に現れて,別の時刻に消える~text — 一例として,字幕/~caption用のそれ — に対応する,[ `~tT$内の時間に感応する~data ]が成す単位である。 ◎ A text track cue is the unit of time-sensitive data in a text track, corresponding for instance for subtitles and captions to the text that appears at a particular time and disappears at another time.

【† この訳では、 一律に “~cue” と略記する(他の複合語も含め)。 “~tT用の~cueでない~cue” は、 この~pageには現れない。 】【 ~cueは,カタカナで記すと `queue^en の訳 “キュー” と同じ表記になるので、 この訳では原語のまま記すことにする。 】

各`~cue$は、 次に挙げるものからなる: ◎ Each text track cue consists of:

`識別子@tC ◎ An identifier
任意な文字列。 ◎ An arbitrary string.
`開始~時刻@tC ◎ A start time
~cueが適用される`~media~data$の範囲が始まる時刻を,小数も含み得る秒数で述べる。 ◎ The time, in seconds and fractions of a second, that describes the beginning of the range of the media data to which the cue applies.
`終了~時刻@tC ◎ An end time
~cueが適用される`~media~data$の範囲が終端する時刻を,小数も含み得る秒数で述べる — ただし、 `無限界な~cue$に対しては,正な `Infinity^jv になる。 ◎ The time, in seconds and fractions of a second, that describes the end of the range of the media data to which the cue applies, or positive Infinity for an unbounded text track cue.
`退出-時に静止するか@tC ◎ A pause-on-exit flag
~cueが適用される範囲の終端に達したとき、 `~media資源$の再生は静止するかどうかを指示する真偽値。 ◎ A boolean indicating whether playback of the media resource is to pause when the end of the range to which the cue applies is reached.
形式に特有な何らかの追加的な~data ◎ Some additional format-specific data
形式~用の必要に応じて、 追加的な~field — ~cueを成す実際の~dataを含め。 例えば~WebVTTには、 ~cueの 書字方向, 等々がある。 `WEBVTT$r ◎ Additional fields, as needed for the format, including the actual data of the cue. For example, WebVTT has a text track cue writing direction and so forth. [WEBVTT]

`無限界な~cue@ ( `unbounded text track cue^en )とは、 `終了~時刻$tCが正な `Infinity^jv に設定された`~cue$を指す。 作動中な`無限界な~cue$は、 通常の再生の間に,`現在の再生~位置$の通例的な単調増加を通して作動中でなくなることはない (例:終了~時刻が公告されていない[ ある~live~event内の~chapter ]用の~metadata~cue)。 ◎ An unbounded text track cue is a text track cue with a text track cue end time set to positive Infinity. An active unbounded text track cue cannot become inactive through the usual monotonic increase of the current playback position during normal playback (e.g. a metadata cue for a chapter in a live event with no announced end time.)

[ `開始~時刻$tC/`終了~時刻$tC ]は、 負にもなり得る (`現在の再生~位置$は負になり得ないので、 終了~時刻が負な~cueは作動中になり得ないが)。 ◎ The text track cue start time and text track cue end time can be negative. (The current playback position can never be negative, though, so cues entirely before time zero cannot be active.)

各`~cue$には、 対応する `TextTrackCue$I ~objがある (より特定的には、 `TextTrackCue$I を継承する~obj — 例えば,~WebVTT~cueは、 `VTTCue$I ~interfaceを利用する `WEBVTT$r )。 `~cue$の~memory内での表現は、 この `TextTrackCue$I ~APIを通して動的に変化し得る。 ◎ Each text track cue has a corresponding TextTrackCue object (or more specifically, an object that inherits from TextTrackCue — for example, WebVTT cues use the VTTCue interface). A text track cue's in-memory representation can be dynamically changed through this TextTrackCue API. [WEBVTT]

各`~cue$には、 `具現化を更新するための規則$が結付けられる — それは、 ~cueの種類ごとに,それ用の仕様により定義される。 この規則は、 当の~cueを表現している~objが[ `addCue()$tt ~methodを利用して `TextTrack$I ~objに追加される ]ときに,特定的に利用される。 ◎ A text track cue is associated with rules for updating the text track rendering, as defined by the specification for the specific kind of text track cue. These rules are used specifically when the object representing the cue is added to a TextTrack object using the addCue() method.

加えて、 各`~cue$は,次に挙げる動的な情報も有する: ◎ In addition, each text track cue has two pieces of dynamic information:

`作動中か@tC ◎ The active flag
初期~時には ~F になるモノトスル。 ◎ This flag must be initially unset.\
これは、 次を確保するために利用される ⇒ 当の~cueが[ 作動中になる/作動中でなくなる ]とき、 ~eventが適切に発火され,常に~~正しい~cueが具現化される ◎ The flag is used to ensure events are fired appropriately when the cue becomes active or inactive, and to make sure the right cues are rendered.

次が生じたときは、 同期的に ~F にするモノトスル:

  • 当の~cueが,ある`~tT$の`~cue~list$tTを成している下で ⇒# ~cue~listから当の~cueが除去されたとき/ 当の~tTの`~mode$tTが `~disabled$i に変化したとき
  • 前項の~tTが,ある`~media要素$の`~tT~list$を成している下で ⇒# ~tTが,~tT~listから除去されたとき/ ~media要素 の `readyState$mM が, `HAVE_NOTHING$mM に戻るよう変化したとき
◎ The user agent must synchronously unset this flag\ whenever the text track cue is removed from its text track's text track list of cues;\ whenever the text track itself is removed from its media element's list of text tracks or\ has its text track mode changed to disabled;\ and whenever the media element's readyState is changed back to HAVE_NOTHING.\

上に挙げた~~出来事により,[ 1 個以上の`~cue$の`作動中か$tCが, ~F に変化した ]ときは、 ~UAは — そうなる~cueすべてに対し,そうした後に — 次を満たす各`~tT$に対し…:

  • その`~mode$tTは、 その~~出来事の直前においては `~showing$i であった
  • その`~cue~list$tTは、 変化したいずれかの~cueを含む

…その`具現化を更新するための規則$ — 例えば、 ~WebVTTに基づく`~tT$用には`~WebVTT~tTの表示を更新するための規則$ — を適用するモノトスル。 `WEBVTT$r

◎ When the flag is unset in this way for one or more cues in text tracks that were showing prior to the relevant incident, the user agent must, after having unset the flag for all the affected cues, apply the rules for updating the text track rendering of those text tracks. For example, for text tracks based on WebVTT, the rules for updating the display of WebVTT text tracks. [WEBVTT]
`表示~状態@tC ◎ The display state
これは、 ~cueたちを一貫した位置に保つために,具現化~modelを成す一部として利用される。 ◎ This is used as part of the rendering model, to keep cues in a consistent position.\
初期~時は空になるモノトスル。 ◎ It must initially be empty.\
~cueの`作動中か$tCが ~F になったときは、 `表示~状態$tCを空にするモノトスル。 ◎ Whenever the text track cue active flag is unset, the user agent must empty the text track cue display state.

`~media要素$の`~tT~list$を成す各`~tT$の`~cue~list$tTを成す`~cue$たちの順序は、 次に従って決定される `~cue順序@ に従うモノトスル: ◎ The text track cues of a media element's text tracks are ordered relative to each other in the text track cue order, which is determined as follows:\

  1. 異なる`~tT$の`~cue~list$tT内にある`~cue$どうしは、 `~tT~list$における`~tT$の順序に従う。 ◎ first group the cues by their text track, with the groups being sorted in the same order as their text tracks appear in the media element's list of text tracks;\
  2. 同じ`~tT$の`~cue~list$tTを成す`~cue$たちの順序は、 次に従うモノトスル: ◎ ↓

    1. `開始~時刻$tCが早いもの順に~sortする ◎ then, within each group, cues must be sorted by their start time, earliest first;\
    2. `開始~時刻$tCが一致するものどうしは、 `終了~時刻$tCが遅いもの順に~sortする ◎ then, any cues with the same start time must be sorted by their end time, latest first;\
    3. `終了~時刻$tCも一致するものどうしは、 `~cue~list$tTに追加された順序で~sortする (なので、 例えば,~WebVTT~fileからの~cueたちは、 初期~時には~cueたちが~file内に~listされた順序になる)。 `WEBVTT$r ◎ and finally, any cues with identical end times must be sorted in the order they were last added to their respective text track list of cues, oldest first (so e.g. for cues from a WebVTT file, that would initially be the order in which the cues were listed in the file). [WEBVTT]
4.8.11.11.2. 帯域内~tTの~source法

`~media資源に特有な~tT@ とは、[ `~media資源$内に見出される~data ]に対応する`~tT$である。 ◎ A media-resource-specific text track is a text track that corresponds to data found in the media resource.

そのような~dataを処理して具現化するための規則は、 関連な仕様に定義される — 例えば,`~media資源$は動画であるなら、 その動画~形式の仕様。 一部の旧来の形式~用の詳細は、 `Sourcing In-band Media Resource Tracks from Media Containers into HTML^cite `INBAND$r 【!~media容器から~HTMLの中への帯域内~media資源~trackの~source法】 に見出せる。 ◎ Rules for processing and rendering such data are defined by the relevant specifications, e.g. the specification of the video format if the media resource is a video. Details for some legacy formats can be found in Sourcing In-band Media Resource Tracks from Media Containers into HTML. [INBAND]

所与の`~media要素$ %~media要素 用の`~media資源$が[ ~UAが認識して~supportする,`~tT$に等価な~data %関連な~data ]を包含するときは、 次に与える `~media資源に特有な~tTを公開する手続き@ を走らすモノトスル。 ◎ When a media resource contains data that the user agent recognizes and supports as being equivalent to a text track, the user agent runs the steps to expose a media-resource-specific text track with the relevant data, as follows.

  1. %新-~tT ~LET 新たな`~tT$ ◎ ↓
  2. %新-~tT に,それを表現している新たな `TextTrack$I ~obj, および %関連な~data を結付ける — %新-~tT は、 `~media資源に特有な~tT$になる。 ◎ Associate the relevant data with a new text track and its corresponding new TextTrack object. The text track is a media-resource-specific text track.
  3. %新-~tT の[ `種類$tT, `~label$tT, `言語$tT ]を %関連な~data の意味論に基づいて,関連な仕様に定義されるとおりに設定する — %関連な~data 内に~labelが無い場合、 `~label$tTは空~文字列に設定する ◎ Set the new text track's kind, label, and language based on the semantics of the relevant data, as defined by the relevant specification. If there is no label in that data, then the label must be set to the empty string.
  4. %新-~tT の`具現化を更新するための規則$ ~SET 当の形式~用に適切なそれ ◎ Associate the text track list of cues with the rules for updating the text track rendering appropriate for the format in question.
  5. ~IF[ %新-~tT の`種類$tT ~IN { `chapters$l, `metadata$l } ] ⇒ %新-~tT の`帯域内~metadata~track配送~型$ ~SET `~media資源$の型に応じて: ◎ If the new text track's kind is chapters or metadata, then set the text track in-band metadata track dispatch type as follows, based on the type of the media resource:

    Ogg ~file `OGGSKELETONHEADERS$r ◎ If the media resource is an Ogg file
    `Name^i ~header~fieldの値 ◎ The text track in-band metadata track dispatch type must be set to the value of the Name header field. [OGGSKELETONHEADERS]
    WebM ~file `WEBMCG$r ◎ If the media resource is a WebM file
    `CodecID^c 要素の値 ◎ The text track in-band metadata track dispatch type must be set to the value of the CodecID element. [WEBMCG]
    MPEG-2 ~file `MPEG2$r ◎ If the media resource is an MPEG-2 file

    次を走らせた結果:

    1. %~stream型 ~LET "stream_type" ~fieldの[ 8-bit 無符号~整数として解釈される値 ] — これは、 ~fileの `program map section^en 内で, %新-~tT の型を述べる ◎ Let stream type be the value of the "stream_type" field describing the text track's type in the file's program map section, interpreted as an 8-bit unsigned integer.\
    2. %長さ ~LET 同じ `program map section^en 内の, %新-~tT 用の "ES_info_length" ~fieldの値で与えられる整数 — `Generic coding of moving pictures and associated audio information^cite【!*】 により定義される ◎ Let length be the value of the "ES_info_length" field for the track in the same part of the program map section, interpreted as an integer as defined by Generic coding of moving pictures and associated audio information.\
    3. %記述子~byte列 ~LET 前~段の "ES_info_length" ~fieldに後続している %長さ 個の~byte ◎ Let descriptor bytes be the length bytes following the "ES_info_length" field.\
    4. ~RET [ %~stream型, %記述子~byte列 ]を連結した結果の~byte列を,~hexadecimalにおいて`~ASCII~hex数字(大文字)$を利用して表出した結果 ◎ The text track in-band metadata track dispatch type must be set to the concatenation of the stream type byte and the zero or more descriptor bytes bytes, expressed in hexadecimal using ASCII upper hex digits. [MPEG2]
    MPEG-4 ~file `MPEG4$r ◎ If the media resource is an MPEG-4 file

    次を走らせた結果:

    1. %stsd ~LET 次に該当するものは[ 在るならば それ/ 無いならば ε ] ⇒ [[[[ ~fileを成す最初の `moov^c ~box ]内の[ %新-~tT 用の `trak^c ~box ]を成す最初の `mdia^c ~box ]を成す最初の `minf^c ~box ]を成す最初の `stbl^c ~box ]を成す最初の `stsd^c ~box
    2. ~IF[ %stsd ~EQ ε ] ⇒ ~RET 空~文字列
    3. %mime_format ~LET 次に該当するものは[ 在るならば その値/ 無いならば ε ] ⇒ [ %stsd を成す最初の `mett^c ~box ]を成す最初の `mime_format^c ~field
    4. ~IF[ %mime_format ~NEQ ε ] ⇒ ~RET 次の連結 ⇒# `mett^l, `0020^U `SPACE^cn, %mime_format
    5. ~IF[ %stsd を成す `mett^c ~boxは在る ] ⇒ ~RET 空~文字列
    6. %namespace ~LET 次に該当するものは[ 在るならば その値/ 無いならば ε ] ⇒ [ %stsd を成す最初の `metx^c ~box ]を成す最初の `namespace^c ~field
    7. ~IF[ %namespace ~NEQ ε ] ⇒ ~RET 次の連結 ⇒# `metx^l, `0020^U `SPACE^cn, %namespace
    8. ~RET 空~文字列
    ◎ Let the first stsd box of the first stbl box of the first minf box of the first mdia box of the text track's trak box in the first moov box of the file be the stsd box, if any.\ ◎ If the file has no stsd box, or if the stsd box has neither a mett box nor a metx box, then the text track in-band metadata track dispatch type must be set to the empty string.\ ◎ Otherwise, if the stsd box has a mett box then the text track in-band metadata track dispatch type must be set to the concatenation of the string "mett", a U+0020 SPACE character, and the value of the first mime_format field of the first mett box of the stsd box, or the empty string if that field is absent in that box.\ ◎ Otherwise, if the stsd box has no mett box but has a metx box then the text track in-band metadata track dispatch type must be set to the concatenation of the string "metx", a U+0020 SPACE character, and the value of the first namespace field of the first metx box of the stsd box, or the empty string if that field is absent in that box. [MPEG4]
  6. %新-~tT の`~cue~list$tTを,これまでに構文解析された~cueたちで — § ~cueを公開するための指針 に従って — 拡充する — この~listを,必要に応じて動的に更新し始める ◎ Populate the new text track's list of cues with the cues parsed so far, following the guidelines for exposing cues, and begin updating it dynamically as necessary.
  7. %新-~tT の`準備度$tT ~SET `読込済み$i ◎ Set the new text track's readiness state to loaded.
  8. %新-~tT の`~mode$tT ~SET [ 利用者の選好, %関連な~data 用の関連な仕様の要件 ]に整合する~mode ◎ Set the new text track's mode to the mode consistent with the user's preferences and the requirements of the relevant specification for the data.

    一例として,作動中な字幕が他に無く,これは強制d字幕~track (音声~trackの首な言語で字幕を与えているが、 実際には[ 別の言語における音声 ]用に限られる字幕~track) である場合、 それらの字幕は,ここで作動化されることもある。 ◎ For instance, if there are no other active subtitles, and this is a forced subtitle track (a subtitle track giving subtitles in the audio track's primary language, but only for audio that is actually in another language), then those subtitles might be activated here.

  9. %~media要素 の`~tT~list$に %新-~tT を追加する ◎ Add the new text track to the media element's list of text tracks.
  10. `~eventを発火する$( %~media要素 の `textTracks$mM 属性が返す~obj, `addtrack$et, `TrackEvent$I ) — 次のように初期化して ⇒# `track$m 属性 ~SET %新-~tT を表現している `TextTrack$I ~obj ◎ Fire an event named addtrack at the media element's textTracks attribute's TextTrackList object, using TrackEvent, with the track attribute initialized to the text track's TextTrack object.
4.8.11.11.3. 帯域外~tTの~source法

`track$e 要素を作成したときは、 以下に従って設定される新たな`~tT$ — 以下では、 “要素に対応する~tT” と称される — (および,その~tTを表現している新たな `TextTrack$I ~obj) を結付けるモノトスル。 この~tTの: ◎ When a track element is created, it must be associated with a new text track (with its value set as defined below) and its corresponding new TextTrack object.

  • `種類$tTは、 次の表tの 1 列目に与える要素の `kind$aT 属性の状態に応じて,同じ行の 2 列目に与えられる文字列になるとする: ◎ The text track kind is determined from the state of the element's kind attribute according to the following table; for a state given in a cell of the first column, the kind is the string given in the second column:

    状態 文字列
    `Subtitles$st `subtitles$l
    `Captions$st `captions$l
    `Descriptions$st `descriptions$l
    `Chapters$st `chapters$l
    `Metadata$st `metadata$l
  • `~label$tTは、 要素の`~track~label$になるとする。 ◎ The text track label is the element's track label.
  • `言語$tTは、 要素の`~track言語$が[ 非 ε ならばそれ/ ε ならば空~文字列 ]になるとする。 ◎ The text track language is the element's track language, if any, or the empty string otherwise.

`track$e 要素の[ `kind$aT / `label$aT / `srclang$aT ]属性が[ 設定-/変更-/除去- ]された(順不同)ときは、 `~tT$の[ `種類$tT/`~label$tT/`言語$tT ]も,上の定義に則って更新するモノトスル。 ◎ As the kind, label, and srclang attributes are set, changed, or removed, the text track must update accordingly, as per the definitions above.

`~track~URL$に対する変更は、 下に与える~algoにて取扱われる。 ◎ Changes to the track URL are handled in the algorithm below.

この`~tT$の: ◎ ↓

  • `準備度$tTは、 初期~時には `未読込み$i になるとする。 ◎ The text track readiness state is initially not loaded,\
  • `~mode$tTは、 初期~時には `~disabled$i になるとする。 ◎ and the text track mode is initially disabled.
  • `~cue~list$tTは、 初期~時には空とする。 これは、 参照先の~fileが構文解析されるとき,動的に改変される。 ◎ The text track list of cues is initially empty. It is dynamically modified when the referenced file is parsed.\
  • `具現化を更新するための規則$は、 初期~時には ε (未設定)とする。 これは、 【`~cue~list$tTに最初に`~cue$が追加されるとき,その~fileの】 形式~用に適切なそれになる — ~WebVTT用には、 これは`~WebVTT~tTの表示を更新するための規則$になる。 `WEBVTT$r ◎ Associated with the list are the rules for updating the text track rendering appropriate for the format in question; for WebVTT, this is the rules for updating the display of WebVTT text tracks. [WEBVTT]

`track$e 要素 %track の親が変化したときは: ◎ ↓

  • 新たな親は,ある`~media要素$ %~media要素 であるならば、 次を走らすモノトスル: ◎ When a track element's parent element changes and the new parent is a media element, then the user agent must\

    1. %~media要素 の`~tT~list$に %track に対応する`~tT$を追加する ◎ add the track element's corresponding text track to the media element's list of text tracks,\
    2. `~media~taskを~queueする$( %~media要素, 次の手続き ) ◎ and then queue a media element task given the media element\

      手続きは ⇒ `~eventを発火する$( %~media要素 の `textTracks$mM 属性が返す~obj, `addtrack$et, `TrackEvent$I ) — 次のように初期化して ⇒# `track$m 属性 ~SET `~tT$を表現している `TextTrack$I ~obj ◎ to fire an event named addtrack at the media element's textTracks attribute's TextTrackList object, using TrackEvent, with the track attribute initialized to the text track's TextTrack object.

  • 以前の親は,ある`~media要素$ %~media要素 であったならば、 次を走らすモノトスル: ◎ When a track element's parent element changes and the old parent was a media element, then the user agent must\

    1. %~media要素 の`~tT~list$から %track に対応する`~tT$を除去する ◎ remove the track element's corresponding text track from the media element's list of text tracks,\
    2. `~media~taskを~queueする$( %~media要素, 次の手続き ) ◎ and then queue a media element task given the media element\

      手続きは ⇒ `~eventを発火する$( %~media要素 の `textTracks$mM 属性が返す~obj, `removetrack$et, `TrackEvent$I ) — 次のように初期化して ⇒# `track$m 属性 ~SET `~tT$を表現している `TextTrack$I ~obj ◎ to fire an event named removetrack at the media element's textTracks attribute's TextTrackList object, using TrackEvent, with the track attribute initialized to the text track's TextTrack object.

【 親が~media要素から別の~media要素に変化した場合に,どちらの~algoを先に走らすかは、 述べられていない。 】


`track$e 要素に対応する`~tT$が,ある`~media要素$ %~media要素 の`~tT~list$に追加されたときは、 次を走らすモノトスル ⇒ `~media~taskを~queueする$( %~media要素, 次の手続き ) ◎ When a text track corresponding to a track element is added to a media element's list of text tracks, the user agent must queue a media element task given the media element

手続きは: ◎ to run the following steps for the media element:

  1. ~IF[ %~media要素 の`構文解析器にて阻まれているか$ ~EQ ~T ] ⇒ ~RET ◎ If the element's blocked-on-parser flag is true, then return.
  2. ~IF[ %~media要素 の`自動的な~tT選定は遂行-済みか$ ~EQ ~T ] ⇒ ~RET ◎ If the element's did-perform-automatic-track-selection flag is true, then return.
  3. `自動的な~tT選定~用の利用者-選好を尊守する$( %~media要素 ) ◎ Honor user preferences for automatic text track selection for this element.

`自動的な~tT選定~用の利用者-選好を尊守する@ ときは、 所与の ( `~media要素$ %~media要素 ) に対し,次の手続きを走らすモノトスル: ◎ When the user agent is required to honor user preferences for automatic text track selection for a media element, the user agent must run the following steps:

  1. `自動的な~tT選定を遂行する$( %~media要素, { `subtitles$l, `captions$l } ) ◎ Perform automatic text track selection for subtitles and captions.
  2. `自動的な~tT選定を遂行する$( %~media要素, { `descriptions$l } ) ◎ Perform automatic text track selection for descriptions.
  3. %~media要素 の`~tT~list$を成す ~EACH( `~tT$ %~tT ) に対し ⇒ ~IF[ %~tT の`種類$tT ~IN { `chapters$l, `metadata$l } ]~AND[ %~tT に対応する `track$e 要素は `default$aT 属性を有する ]~AND[ %~tT の`~mode$tT ~EQ `~disabled$i ] ⇒ %~tT の`~mode$tT ~SET `~hidden$i ◎ If there are any text tracks in the media element's list of text tracks whose text track kind is chapters or metadata that correspond to track elements with a default attribute set whose text track mode is set to disabled, then set the text track mode of all such tracks to hidden
  4. %~media要素 の`自動的な~tT選定は遂行-済みか$ ~SET ~T ◎ Set the element's did-perform-automatic-track-selection flag to true.

`自動的な~tT選定を遂行する@ ときは、 所与の ( `~media要素$ %~media要素, `種類$tTたちが成す集合 %種類~群 ) に対し,次の手続きを走らす: ◎ When the steps above say to perform automatic text track selection for one or more text track kinds, it means to run the following steps:

  1. %候補~群 ~LET 新たな`~list$ ◎ ↓
  2. %~media要素 の`~tT~list$を成す ~EACH( %~tT ) に対し ⇒ ~IF[ %~tT の`種類$tT ~IN %種類~群 ] ⇒ %候補~群 に %~tT を`付加する$ ◎ Let candidates be a list consisting of the text tracks in the media element's list of text tracks whose text track kind is one of the kinds that were passed to the algorithm, if any, in the order given in the list of text tracks.
  3. ~IF[ %候補~群 は空である ] ⇒ ~RET ◎ If candidates is empty, then return.
  4. %候補~群 を成す ~EACH( %~tT ) に対し ⇒ ~IF[ %~tT の`~mode$tT ~EQ `~showing$i ] ⇒ ~RET ◎ If any of the text tracks in candidates have a text track mode set to showing, return.
  5. ~IF[ %候補~群 を成すある`~tT$ %~tT は、 利用者が,その[ `種類$tT, `言語$tT, `~label$tT ]に基づいて可能化する関心を表出したものである ] ⇒# %~tT の`~mode$tT ~SET `~showing$i; ~RET ◎ If the user has expressed an interest in having a track from candidates enabled based on its text track kind, text track language, and text track label, then set its text track mode to showing.

    【 該当する~tTは、 複数あったとしても, (何らかの実装定義な方式で) 一つに絞り込まれたものと見做されている。 】

    例えば、 利用者は,次に挙げる効果を成す~browser選好を設定することもある: ◎ For example, the user could have set a browser preference to the effect of\

    • “アリなときは、 ~Frenchによる~captionを求む” ◎ "I want French captions whenever possible", or\
    • “~title内に “実況解説” を伴う字幕~trackがある場合、 それを可能化する” ◎ "If there is a subtitle track with 'Commentary' in the title, enable it", or\
    • “音述~trackが可用なら,それらのうち 1 つ — `Swiss German^en が理想的だが、 無ければ[ `Standard Swiss German^en/ `Standard German^en ] — を可能化する” ◎ "If there are audio description tracks available, enable one, ideally in Swiss German, but failing that in Standard Swiss German or Standard German".
  6. %候補~群 を成す ~EACH( %~tT ) に対し ⇒ ~IF[ %~tT に対応する `track$e 要素は `default$aT 属性を有する ]~AND[ %~tT の`~mode$tT ~EQ `~disabled$i ] ⇒# %~tT の`~mode$tT ~SET `~showing$i; ~RET ◎ Otherwise, if there are any text tracks in candidates that correspond to track elements with a default attribute set whose text track mode is set to disabled, then set the text track mode of the first such track to showing.

`track$e 要素 %track において,次に挙げるいずれかが生じたときは ⇒# %track が作成されたとき/ %track に対応する`~tT$の`~mode$tT が変化したとき/ %track の親が変化して,ある`~media要素$になったとき ◎終 次を走らすモノトスル ⇒ `~track処理~modelを開始する$( %track ): ◎ When a text track corresponding to a track element experiences any of the following circumstances, the user agent must start the track processing model for that text track and its track element: • The track element is created. • The text track has its text track mode changed. • The track element's parent element changes and the new parent is a media element.

`~track処理~modelを開始する@ ときは、 所与の ( `track$e 要素 %track ) に対し,次の~algoを走らすモノトスル: ◎ When a user agent is to start the track processing model for a text track and its track element, it must run the following algorithm.\ This algorithm interacts closely with the event loop mechanism; in particular, it has a synchronous section (which is triggered as part of the event loop algorithm). The steps in that section are marked with ⌛.

  1. %~tT ~LET %track に対応する`~tT$
  2. ~IF[ この~algoの別の~instanceが %track 用に現在~走っている ] ⇒ ~RET (その~algoに %track を~careさせる。) ◎ If another occurrence of this algorithm is already running for this text track and its track element, return, letting that other algorithm take care of this element.
  3. ~IF[ %~tT の`~mode$tT ~EQ `~disabled$i【! ~NIN { `~hidden$i, `~showing$i }】 ] ⇒ ~RET ◎ If the text track's text track mode is not set to one of hidden or showing, then return.
  4. ~IF[ %track の親は`~media要素$でない ] ⇒ ~RET ◎ If the text track's track element does not have a media element as a parent, return.
  5. この段は、 `並列的$に走らす ⇒ ~WHILE 無条件 ⇒ 下に定義する `~trackを処理する^i 下位-手続き 【!allowing whatever caused these steps to run to continue.】

    【 この段は、 %track が存続する限り,終了しないことになる。 】

    (この段は、 `~event~loop$の仕組みと緊密にヤリトリする — 特に,`同期区間$があり、 その仕組みを成す~algoの一部として誘発される)。 【!そのような区間を成す各~段には ⌛ 印が付与される。】

    ◎ Run the remainder of these steps in parallel, allowing whatever caused these steps to run to continue. ◎ ↑↑

`~trackを処理する^i 下位-手続きは: ◎ Top:\

  1. 次の手続きを`同期区間$として,`安定~状態を待受ける$: 【!(`同期区間$を成す各~段には ⌛ 印が付与される。)】 ◎ Await a stable state. The synchronous section consists of the following steps. (The steps in the synchronous section are marked with ⌛.)

    1. %~tT の`準備度$tT ~SET `読込中$i ◎ ⌛ Set the text track readiness state to loading.
    2. %~URL ~LET %track の`~track~URL$ ◎ ⌛ Let URL be the track URL of the track element.
    3. %~CORS設定群~状態 ~LET [ %track の親は`~media要素$であるならば その `crossorigin$aM 内容~属性の状態 / ~ELSE_ `~CORSなし$st ] ◎ ⌛ If the track element's parent is a media element then let corsAttributeState be the state of the parent media element's crossorigin content attribute. Otherwise, let corsAttributeState be No CORS.

    【!`同期区間$はここで終端し,以降の手続きは`並列的$に継続する】 ◎ End the synchronous section, continuing the remaining steps in parallel.

  2. ~IF[ %~URL ~NEQ 空~文字列 ]: ◎ If URL is not the empty string, then:

    1. %要請 ~LET `~CORSになり得る要請を作成する$( %~URL, `track^l, %~CORS設定群~状態, `同一-生成元~fallbackあり^i ) ◎ Let request be the result of creating a potential-CORS request given URL, "track", and corsAttributeState, and with the same-origin fallback flag set.
    2. %要請 の ⇒# `~client$rq ~SET %track の`~node文書$に`関連な設定群~obj$, `起動元~種別$rq ~SET `track^l ◎ Set request's client to the track element's node document's relevant settings object. ◎ Set request's initiator type to "track".
    3. %要請 を`~fetchする$ ◎ Fetch request.

    ~fetching~algoにより,`~network用~task~source$から`~queueされ$た各`~task$ — 以下では、 `~network~task^i と総称する — は、 処理する~dataを~fetchするに伴い,資源の型を決定するモノトスル。 資源の型は~supportする~tT形式でない場合、 下に述べるように 読込nは失敗することになる。 他の場合、 資源の~dataが受信されるに伴い,それを — その構文解析器の出力~用に利用している`~cue~list$tTと伴に — 適切な構文解析器(例:`~WebVTT構文解析器$ `WEBVTT$r )へ渡すモノトスル。 ◎ The tasks queued by the fetching algorithm on the networking task source to process the data as it is being fetched must determine the type of the resource. If the type of the resource is not a supported text track format, the load will fail, as described below. Otherwise, the resource's data must be passed to the appropriate parser (e.g., the WebVTT parser) as it is received, with the text track list of cues being used for that parser's output. [WEBVTT]

    適切な構文解析器は、 各 `~network~task^i が走る間に,~networkから受信した~dataで`~cue~list$tTを増分的に更新することになる。 ◎ The appropriate parser will incrementally update the text track list of cues during these networking task source tasks, as each such task is run with whatever data has been received from the network).

    この仕様は、 各~tTの~MIME型を[ 検査するかどうか, その方法 ]や,実際の~file~dataを利用して~file型を[ ~sniffするかどうか, その方法 ]については,現時点では何も述べない。 実装者たちの意図nは,この問題mについて相違するので、 当を得た解決策が何になるかは不明瞭である。 ここでの要件が無い下では、 ~HTTP仕様による[ `Content-Type^h ~headerに従うとする,厳密な要件 ]に従うとする: ◎ This specification does not currently say whether or how to check the MIME types of text tracks, or whether or how to perform file type sniffing using the actual file data. Implementers differ in their intentions on this matter and it is therefore unclear what the right solution is. In the absence of any requirement here, the HTTP specifications' strict requirement to follow the Content-Type header prevails\

    “`Content-Type^h ~headerは、 下層の~dataの~MIME型( `media type^en )を指定する” … “その~headerが ~MIME型を与えてない場合,その場合に限り、 受信者は,その内容/[ 資源を識別するために利用された~URIの~file名~拡張子(たち) ]の検分を介して,~MIME型を推測しようと試みてもヨイ。” ◎ ("Content-Type specifies the media type of the underlying data." ... "If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource.").

    【 この引用文は、 旧~HTTP仕様( RFC 2616 )によるもの。 現在の~HTTP仕様による要件は、 `Content-Type$h を見よ。 】

    • 何らかの理由で~fetchingに失敗した (例:~network~error/ ~serverは~error~codeを返した/ ~CORSに失敗した)または[ %~URL ~EQ 空~文字列 ]の場合 ⇒ `要素~taskを~queueする$( `~DOM操作~task~source$, %track, 次の手続き ) ◎ If fetching fails for any reason (network error, the server returns an error code, CORS fails, etc.), or if URL is the empty string, then queue an element task on the DOM manipulation task source given the media element\

      手続きは ⇒# `準備度$tT ~SET `読込失敗$i; `~eventを発火する$( %track, `error$et ) ◎ to first change the text track readiness state to failed to load and then fire an event named error at the track element.

    • ~fetchingは失敗しなかったが,[ 資源の型は~supportされる~tT形式でない場合/ 得られた~fileを成功裡に処理できなかった場合 (例:当の形式は~XML形式で,~fileには[ 検出して,~appへ報告することが `XML^cite により要求される ]ような整形式性~errorがある) ] ⇒ そのような問題が見出された `~network~task^i にて,次を走らすモノトスル ⇒# `準備度$tT ~SET `読込失敗$i; `~eventを発火する$( %track, `error$et ) ◎ If fetching does not fail, but the type of the resource is not a supported text track format, or the file was not successfully processed (e.g., the format in question is an XML format and the file contained a well-formedness error that XML requires be detected and reported to the application), then the task that is queued on the networking task source in which the aforementioned problem is found must\ change the text track readiness state to failed to load and fire an event named error at the track element.
    • ~fetchingは失敗しなかった, かつ ~fileは成功裡に処理された場合 ⇒ すべての `~network~task^i が~dataの構文解析を完遂した後に,次を走らすモノトスル ⇒# `準備度$tT ~SET `読込済み$i; `~eventを発火する$( %track, `load$et ) ◎ If fetching does not fail, and the file was successfully processed, then the final task that is queued by the networking task source, after it has finished parsing the data, must change the text track readiness state to loaded, and fire an event named load at the track element.
    • ~fetchingが進行中な間に,次のいずれかが生じた場合…: ◎ If, while fetching is ongoing, either:

      • [ %~tT の`~mode$tT ~NEQ `~disabled$i【! ~IN { `~hidden$i, `~showing$i }】 ]が満たされている間に, `~track~URL$は %~URL 以外に変化した ◎ the track URL changes so that it is no longer equal to URL, while the text track mode is set to hidden or showing; or
      • [ `~track~URL$ ~NEQ %~URL ]が満たされている間に, %~tT の`~mode$tTは `~disabled$i 以外【![`~hidden$i / `~showing$i]】に変化した ◎ the text track mode changes to hidden or showing, while the track URL is not equal to URL

      …場合、 `~fetching$を中止するモノトスル: ◎ ...then the user agent must abort fetching,\

      1. その~algoにより生成された処理待ち`~task$を破棄する (特に,~URLが変化した時点以降には、 `~cue~list$tTには,それ以上~cueを追加しない) ◎ discarding any pending tasks generated by that algorithm (and in particular, not adding any cues to the text track list of cues after the moment the URL changed), and then\
      2. `要素~taskを~queueする$( `~DOM操作~task~source$, %track, 次の手続き ) ◎ queue an element task on the DOM manipulation task source given the track element\

        手続きは ⇒# `準備度$tT ~SET `読込失敗$i; `~eventを発火する$( %track, `error$et ) ◎ that first changes the text track readiness state to failed to load and then fires an event named error at the track element.

  3. 次が満たされるまで待機する ⇒ `準備度$tT ~NEQ `読込中$i ◎ Wait until the text track readiness state is no longer set to loading.
  4. 次が満たされるまで待機する ⇒ [ `~track~URL$ ~NEQ %~URL ]~AND[ `~mode$tT ~NEQ `~disabled$i【! ~IN { `~hidden$i, `~showing$i }】 ] ◎ Wait until the track URL is no longer equal to URL, at the same time as the text track mode is set to hidden or showing. ◎ Jump to the step labeled top.

`track$e 要素の `src$aT 属性が[ 設定-/変更-/除去- ]されたときは、 要素の`~tT$の`~cue~list$tTを`即時$に空にするモノトスル。 (これはまた、 上の~algoが[ それまでに所与の~URLを利用して得された資源からの~cue ]を追加するのを止める。) ◎ Whenever a track element has its src attribute set, changed, or removed, the user agent must immediately empty the element's text track's text track list of cues. (This also causes the algorithm above to stop adding cues from the resource being obtained using the previously given URL, if any.)

4.8.11.11.4. 様々な形式における~cueを`~cue$として公開するための指針

~HTML~UAにより処理する目的において,特定の形式の~cueたちをどう解釈するかは、 その形式により定義される。 そのような仕様が無い下では、 この節が一部の拘束を供する — 実装は、 そのような形式を,それらの拘束に整合するように公開しようと試みることができる。 ◎ How a specific format's text track cues are to be interpreted for the purposes of processing by an HTML user agent is defined by that format. In the absence of such a specification, this section provides some constraints within which implementations can attempt to consistently expose such formats.

~HTMLの`~tT$~modelを~supportするため、 時間同期的な~dataは,各~data単位ごとに`~cue$に変換される。 当の形式の特能から[ この仕様にて定義される`~cue$を成す ある側面 ]への対応付けが定義されない所では、 実装は,対応付けが[ 上で定義した`~cue$を成す当の側面の定義にも,次に挙げる拘束にも整合する ]ことを確保するモノトスル: ◎ To support the text track model of HTML, each unit of timed data is converted to a text track cue. Where the mapping of the format's features to the aspects of a text track cue as defined in this specification are not defined, implementations must ensure that the mapping is consistent with the definitions of the aspects of a text track cue as defined above, as well as with the following constraints:

`識別子$tC ◎ The text track cue identifier
当の形式に,~~個々の~cue識別子を成す明らかな相似物が無い場合、 空~文字列に設定されるベキである。 ◎ Should be set to the empty string if the format has no obvious analogue to a per-cue identifier.
`退出-時に静止するか$tC ◎ The text track cue pause-on-exit flag
~F に設定されるベキである。 ◎ Should be set to false.
4.8.11.11.5. ~tT~API
4.8.11.11.5.1. `TextTrackList^I
[Exposed=Window]
interface `TextTrackList@I : `EventTarget$I {
  readonly attribute unsigned long `length$ttL;
  `getter$ttL `TextTrack$I (unsigned long %index);
  `TextTrack$I? `getTrackById$ttL(DOMString %id);

  attribute `EventHandler$I `onchange$m;
  attribute `EventHandler$I `onaddtrack$m;
  attribute `EventHandler$I `onremovetrack$m;
};
%textTracks = %media.`textTracks$mM
`~media要素$に結付けられた`~tT$たち — すなわち、 要素の`~tT~list$ — を表現している `TextTrackList$I ~objを返す。 【この項は、この訳による補完。】
%textTracks.`length$ttL
`~media要素$の`~tT~list$を成す(例: `track$e 要素からの)`~tT$たちの個数を返す。 ◎ Returns the number of text tracks associated with the media element (e.g. from track elements). This is the number of text tracks in the media element's list of text tracks.
%textTracks[ %n ]
`~media要素$の`~tT~list$を成す %n 番の`~tT$を表現している `TextTrack$I ~objを返す。 ◎ Returns the TextTrack object representing the nth text track in the media element's list of text tracks.
%textTrack = %textTracks.`getTrackById(id)$ttL
所与の %id を`識別子$tTに伴う `TextTrack$I ~objが[ 在れば それ/ 無ければ ~NULL ]を返す ◎ Returns the TextTrack object with the given identifier, or null if no track has that identifier.

`TextTrackList$I ~objは、 `~tT$の~listを,動的に更新される`~tT~list$と同じ順序で表現する。 ◎ A TextTrackList object represents a dynamically updating list of text tracks in a given order.

`~media要素$の `textTracks@mM 取得子~手続きは ⇒ ~RET コレの`~tT~list$を表現している `TextTrackList$I ~obj — ~objを成す各 `TextTrack$I ~objは、 `~tT~list$を成す各`~tT$を同じ順序で表現するモノトスル。 【~media要素の~IDLに指定されるように,常に同じ~objを返す。】 ◎ The textTracks attribute of media elements must return a TextTrackList object representing the TextTrack objects of the text tracks in the media element's list of text tracks, in the same order as in the list of text tracks.
`length@ttL 取得子~手続きは ⇒ ~RET コレが表現する`~tT~list$を成す`~tT$の個数 ◎ The length attribute of a TextTrackList object must return the number of text tracks in the list represented by the TextTrackList object.

`getter@ttL においては: ◎ ↓

  • 所与の時点でコレが`~supportする~prop~index$は、 0 以上, [ コレが表現する`~tT~list$を成す`~tT$の個数 ]未満とする ◎ The supported property indices of a TextTrackList object at any instant are the numbers from zero to the number of text tracks in the list represented by the TextTrackList object minus one, if any. If there are no text tracks in the list, there are no supported property indices.
  • 所与の~index %~index 用にコレの`有index~propの値を決定する$ときは、 次を返すモノトスル ⇒ コレが表現する`~tT~list$を成す %~index 番の`~tT$を表現している `TextTrack$I ~obj ◎ To determine the value of an indexed property of a TextTrackList object for a given index index, the user agent must return the indexth text track in the list represented by the TextTrackList object.
`getTrackById(id)@ttL ~method~手続きは ⇒ ~RET コレが表現する`~tT~list$内に次を満たす`~tT$は[ 在るならば それらのうち最初のものを表現している `TextTrack$I ~obj/ 無いならば ~NULL ] ⇒ その`識別子$tT ~EQ %id ◎ The getTrackById(id) method must return the first TextTrack in the TextTrackList object whose id IDL attribute would return a value equal to the value of the id argument. When no tracks match the given argument, the method must return null.
4.8.11.11.5.2. `TextTrack^I
enum `TextTrackMode@I { `disabled$l, `hidden$l, `showing$l };
enum `TextTrackKind@I { `subtitles$l, `captions$l, `descriptions$l, `chapters$l, `metadata$l };

[Exposed=Window]
interface `TextTrack@I : `EventTarget$I {
  readonly attribute `TextTrackKind$I `kind$tt;
  readonly attribute DOMString `label$tt;
  readonly attribute DOMString `language$tt;

  readonly attribute DOMString `id$tt;
  readonly attribute DOMString `inBandMetadataTrackDispatchType$tt;

  attribute `TextTrackMode$I `mode$tt;

  readonly attribute `TextTrackCueList$I? `cues$tt;
  readonly attribute `TextTrackCueList$I? `activeCues$tt;

  undefined `addCue$tt(`TextTrackCue$I %cue);
  undefined `removeCue$tt(`TextTrackCue$I %cue);

  attribute `EventHandler$I `oncuechange$m;
};
%textTrack = %media.`addTextTrack( kind [, label [, language ] ] )$mM
新たな `TextTrack$I ~objを作成して, `~media要素$の`~tT~list$に追加した上で返す。 ◎ Creates and returns a new TextTrack object, which is also added to the media element's list of text tracks.
%textTrack.`kind$tt
%textTrack の`種類$tTを与える文字列を返す。 ◎ Returns the text track kind string.
%textTrack.`label$tt
%textTrack に`~label$tTが[ 在るならば それ/ 無いならば空~文字列 ]を返す。 (無い場合,この~objが利用者に公開されるときには、 ~objの他の属性から生成される~custom~labelが,おそらく必要になることを指示する)。 ◎ Returns the text track label, if there is one, or the empty string otherwise (indicating that a custom label probably needs to be generated from the other attributes of the object if the object is exposed to the user).
%textTrack.`language$tt
%textTrack の`言語$tTを与える文字列を返す。 ◎ Returns the text track language string.
%textTrack.`id$tt
%textTrack の~IDを返す。 ◎ Returns the ID of the given track.
%textTrack が帯域内~track【`~media資源に特有な~tT$】であって、 当の形式が`~media素片の構文$を~supportする場合、 これは, `素片$urlに利用し得る~IDであって, `getTrackById()$ttL ~methodで利用できるものになる。 ◎ For in-band tracks, this is the ID that can be used with a fragment if the format supports media fragment syntax, and that can be used with the getTrackById() method.
%textTrack がある `track$e 要素に対応するならば、 これは要素の~IDになる。 ◎ For TextTrack objects corresponding to track elements, this is the ID of the track element.
%textTrack.`inBandMetadataTrackDispatchType$tt
`帯域内~metadata~track配送~型$を与える文字列を返す。 ◎ Returns the text track in-band metadata track dispatch type string.
%textTrack.`mode$tt [ = %value ]
%textTrack の`~mode$tTに応じて,次で与えられる文字列を返す ⇒# `~disabled$i ならば `disabled$l / `~hidden$i ならば `hidden$l / `~showing$i ならば `showing$l ◎ Returns the text track mode, represented by a string from the following list: • "disabled" •• The text track disabled mode. • "hidden" •• The text track hidden mode. • "showing" •• The text track showing mode.
設定して,~modeを変更できる。 ◎ Can be set, to change the mode.
%textTrack.`cues$tt
%textTrack の`~cue~list$tTを `TextTrackCueList$I ~objとして返す。 ◎ Returns the text track list of cues, as a TextTrackCueList object.
%textTrack.`activeCues$tt
%textTrack の`~cue~list$tTを成す`~cue$のうち,現在~作動中なものたち (すなわち,`現在の再生~位置$より前に開始して,より後に終止するそれら) を `TextTrackCueList$I ~objとして返す。 ◎ Returns the text track cues from the text track list of cues that are currently active (i.e. that start before the current playback position and end after it), as a TextTrackCueList object.
%textTrack.`addCue(cue)$tt
%textTrack の`~cue~list$tTに,所与の~cueを追加する。 ◎ Adds the given cue to textTrack's text track list of cues.
%textTrack.`removeCue(cue)$tt
%textTrack の`~cue~list$tTから所与の~cueを除去する。 ◎ Removes the given cue from textTrack's text track list of cues.

`~media要素$の `addTextTrack(kind, label, language)@mM ~method~手続きは: ◎ The addTextTrack(kind, label, language) method of media elements, when invoked, must run the following steps:

  1. %~tT ~LET 新たな`~tT$ — その ⇒# `種類$tT ~SET %種類, `~label$tT ~SET %~label, `言語$tT ~SET %言語, `準備度$tT ~SET `読込済み$i, `~mode$tT ~SET `~hidden$i, `~cue~list$tT ~SET 空~list, `具現化を更新するための規則$ ~SET ε† ◎ Create a new TextTrack object. ◎ Create a new text track corresponding to the new object, and set its text track kind to kind, its text track label to label, its text track language to language, its text track readiness state to the text track loaded state, its text track mode to the text track hidden mode, and its text track list of cues to an empty list.

    † `具現化を更新するための規則$は、 `~cue~list$tTに最初に`~cue$が追加される時点で,恒久的に設定されることになる。 ◎ Initially, the text track list of cues is not associated with any rules for updating the text track rendering. When a text track cue is added to it, the text track list of cues has its rules permanently set accordingly.

  2. コレの`~tT~list$に %~tT を追加する ◎ Add the new text track to the media element's list of text tracks.
  3. %~tT~obj ~LET %~tT を表現している新たな `TextTrack$I ~obj ◎ ↓↑
  4. `~media~taskを~queueする$( コレ, 次の手続き ) ◎ Queue a media element task given the media element\

    手続きは ⇒ `~eventを発火する$( コレの `textTracks$mM 属性が返す~obj, `addtrack$et, `TrackEvent$I ) — 次のように初期化して ⇒# `track$m 属性 ~SET %~tT~obj ◎ to fire an event named addtrack at the media element's textTracks attribute's TextTrackList object, using TrackEvent, with the track attribute initialized to the new text track's TextTrack object.

  5. ~RET %~tT~obj ◎ Return the new TextTrack object.

`kind@tt 取得子~手続きは ⇒ ~RET コレが表現する`~tT$の`種類$tT ◎ The kind attribute must return the text track kind of the text track that the TextTrack object represents.
`label@tt 取得子~手続きは ⇒ ~RET コレが表現する`~tT$の`~label$tT ◎ The label attribute must return the text track label of the text track that the TextTrack object represents.
`language@tt 取得子~手続きは ⇒ ~RET コレが表現する`~tT$の`言語$tT ◎ The language attribute must return the text track language of the text track that the TextTrack object represents.
`id@tt 取得子~手続きは ⇒ ~RET コレが表現する`~tT$の`識別子$tT ◎ The id attribute returns the track's identifier,\

所与の %~tT の `識別子@tT は、 次を走らせた結果になるとする:

  1. ~IF[ %~tT はある `track$e 要素に対応する ] ⇒ ~IF[ その要素は `id$a 属性を有する ] ⇒ ~RET その属性の値
  2. ~ELIF ( %~tT は帯域内~track【`~media資源に特有な~tT$】である) ⇒ ~IF[ その`~media資源$にて、 %~tT 用の識別子は指定されている ] ⇒ ~RET その識別子 — その`~media資源$の形式が`~media素片の構文$を~supportする場合、 この識別子は[ そのような`素片$urlを成す~track次元において,ある~trackの名前として利用された場合に、 当の~trackを可能化することになる ]ような識別子になるモノトスル
  3. ~RET 空~文字列
◎ if it has one, or the empty string otherwise. For tracks that correspond to track elements, the track's identifier is the value of the element's id attribute, if any. For in-band tracks, the track's identifier is specified by the media resource. If the media resource is in a format that supports media fragment syntax, the identifier returned for a particular track must be the same identifier that would enable the track if used as the name of a track in the track dimension of such a fragment.
`inBandMetadataTrackDispatchType@tt 取得子~手続きは ⇒ ~RET コレが表現する`~tT$の`帯域内~metadata~track配送~型$ ◎ The inBandMetadataTrackDispatchType attribute must return the text track in-band metadata track dispatch type of the text track that the TextTrack object represents.
`mode@tt 取得子~手続きは ⇒ ~RET コレが表現する`~tT$の`~mode$tTに応じて,次で与えられる文字列 ⇒# `~disabled$i ならば `disabled@l / `~hidden$i ならば `hidden@l / `~showing$i ならば `showing@l ◎ The mode attribute, on getting, must return the string corresponding to the text track mode of the text track that the TextTrack object represents, as defined by the following list: • "disabled" •• The text track disabled mode. • "hidden" •• The text track hidden mode. • "showing" •• The text track showing mode.
`mode$tt 設定子~手続きは: ⇒ 【!if the new value isn't equal to what the attribute would currently return】 コレが表現する`~tT$の`~mode$tT ~SET 所与の値に応じて ⇒# `disabled$l ならば `~disabled$i/ `hidden$l ならば `~hidden$i/ `showing$l ならば `~showing$i ◎ On setting, if the new value isn't equal to what the attribute would currently return, the new value must be processed as follows: • If the new value is "disabled" •• Set the text track mode of the text track that the TextTrack object represents to the text track disabled mode. • If the new value is "hidden" •• Set the text track mode of the text track that the TextTrack object represents to the text track hidden mode. • If the new value is "showing" •• Set the text track mode of the text track that the TextTrack object represents to the text track showing mode.

`cues@tt 取得子~手続きは:

  1. ~IF[ コレが表現する`~tT$の`~mode$tT ~EQ `~disabled$i ] ⇒ ~RET ~NULL
  2. ~RET コレが表現する`~tT$の`~cue~list$tTを成す`~cue$のうち[ `終了~時刻$tC ~GTE `~script開始-時におけるアリな最も早い位置$ ]を満たすものが成す集合を,`~cue順序$で表現する`~live$な `TextTrackCueList$I ~obj
◎ If the text track mode of the text track that the TextTrack object represents is not the text track disabled mode, then the cues attribute must return a live TextTrackCueList object that represents the subset of the text track list of cues of the text track that the TextTrack object represents whose end times occur at or after the earliest possible position when the script started, in text track cue order. Otherwise, it must return null.\

各 `TextTrack$I ~objに対し、 この取得子は, `TextTrackCueList$I ~objを返す場合には 毎回~同じ~objを返すモノトスル。 ◎ For each TextTrack object, when an object is returned, the same TextTrackCueList object must be returned each time.

`~script開始-時におけるアリな最も早い位置@ は、 `~event~loop$が最後に`最初の段$に達した時点における`アリな最も早い位置$とする。 ◎ The earliest possible position when the script started is whatever the earliest possible position was the last time the event loop reached step 1.

`activeCues@tt 取得子~手続きは:

  1. ~IF[ コレが表現する`~tT$の`~mode$tT ~EQ `~disabled$i ] ⇒ ~RET ~NULL
  2. ~RET コレが表現する`~tT$の`~cue~list$tTを成す`~cue$のうち[ `作動中かどうかは~script開始-時に設定された$もの ]が成す集合を,`~cue順序$で表現する`~live$な `TextTrackCueList$I ~obj
◎ If the text track mode of the text track that the TextTrack object represents is not the text track disabled mode, then the activeCues attribute must return a live TextTrackCueList object that represents the subset of the text track list of cues of the text track that the TextTrack object represents whose active flag was set when the script started, in text track cue order. Otherwise, it must return null.\

各 `TextTrack$I ~objに対し、 この取得子は, `TextTrackCueList$I ~objを返す場合には 毎回~同じ~objを返すモノトスル。 ◎ For each TextTrack object, when an object is returned, the same TextTrackCueList object must be returned each time.

次を満たす`~cue$が `作動中かどうかは~script開始-時に設定された@ とされる ⇒ `~event~loop$が最後に`最初の段$に達した時点で,その`作動中か$tC ~EQ ~T ◎ A text track cue's active flag was set when the script started if its text track cue active flag was set the last time the event loop reached step 1.

`addCue(cue)@tt ~method~手続きは: ◎ The addCue(cue) method of TextTrack objects, when invoked, must run the following steps:

  1. %~tT ~LET コレが表現する`~tT$ ◎ ↓
  2. %~cue~list ~LET %~tT の`~cue~list$tT ◎ ↓
  3. ~IF[ %~tT の`具現化を更新するための規則$ ~EQ ε ] ⇒ %~tT の`具現化を更新するための規則$ ~SET %cue 用に適切なそれ ◎ If the text track list of cues does not yet have any associated rules for updating the text track rendering, then associate the text track list of cues with the rules for updating the text track rendering appropriate to cue.
  4. ~IF[ %~tT の`具現化を更新するための規則$は、 %cue 用に適切なそれと同じ規則でない ] ⇒ ~THROW `InvalidStateError$E ◎ If text track list of cues' associated rules for updating the text track rendering are not the same rules for updating the text track rendering as appropriate for cue, then throw an "InvalidStateError" DOMException.
  5. ~IF[ %cue ~IN %~cue~list ] ⇒ %~cue~list から %cue を除去する ◎ If the given cue is in a text track list of cues, then remove cue from that text track list of cues.
  6. %~cue~list に %cue を追加する ◎ Add cue to the TextTrack object's text track's text track list of cues.

`removeCue(cue)@tt ~method~手続きは: ◎ The removeCue(cue) method of TextTrack objects, when invoked, must run the following steps:

  1. %~cue~list ~LET コレが表現する`~tT$の`~cue~list$tT ◎ ↓
  2. ~IF[ %cue ~NIN %~cue~list ] ⇒ ~THROW `NotFoundError$E ◎ If the given cue is not in the TextTrack object's text track's text track list of cues, then throw a "NotFoundError" DOMException.
  3. %~cue~list から %cue を除去する ◎ Remove cue from the TextTrack object's text track's text track list of cues.

この例では、[ 多数の音響~効果を包含している音響~file内にある,特定の音響~効果を再生する ]ために, `audio$e 要素が利用される。 ~browserが何らかの~scriptを走らすのに多忙な場合でも、 正確に~clipの終端で終止するよう音声を静止するために,~cueが利用される。 ~pageが[ ~scriptが音声を静止するのに依拠して ]いて,~browserは[ その~scriptを指定された正確な時刻に走らすことが可能でない ]場合には、 その次の~clipの開始が聞こえるかもしれない。 ◎ In this example, an audio element is used to play a specific sound-effect from a sound file containing many sound effects. A cue is used to pause the audio, so that it ends exactly at the end of the clip, even if the browser is busy running some script. If the page had relied on script to pause the audio, then the start of the next clip might be heard if the browser was not able to run the script at the exact time specified.

var %sfx = new Audio('sfx.wav');
var %sounds = %sfx.addTextTrack('metadata');

/* 
~~目的の音響を追加する
◎
add sounds we care about
 */
function addFX(%start, %end, %name) {
  var %cue = new VTTCue(%start, %end, '');
  %cue.id = %name;
  %cue.pauseOnExit = true;
  %sounds.addCue(%cue);
}
addFX(12.783, 13.612, 'ワン');
addFX(13.612, 15.091, 'ニャン');

function playSound(%id) {
  %sfx.currentTime = %sounds.getCueById(id).startTime;
  %sfx.play();
}

/* 
できるだけ~~早く “ワン” を再生する
◎
play a bark as soon as we can
 */
%sfx.oncanplaythrough = function () {
  playSound('ワン');
}
/* 
利用者が~pageから去ろうとしたとき、
“ニャン” を再生して,~~留まるようお願いする。
◎
meow when the user tries to leave, and have the browser ask them to stay
 */
window.onbeforeunload = function (%e) {
  playSound('ニャン');
  %e.preventDefault();
}
4.8.11.11.5.3. `TextTrackCueList^I
[Exposed=Window]
interface `TextTrackCueList@I {
  readonly attribute unsigned long `length$ttCL;
  `getter$ttCL `TextTrackCue$I (unsigned long %index);
  `TextTrackCue$I? `getCueById$ttCL(DOMString %id);
};
%cuelist.`length$ttCL
この~cue~listを成す`~cue$の個数を返す。 ◎ Returns the number of cues in the list.
%cuelist[ %index ]
この~cue~listの %index 番にある`~cue$を返す。 ~cueたちは、 `~cue順序$で~sortされる。 ◎ Returns the text track cue with index index in the list. The cues are sorted in text track cue order.
%cuelist.`getCueById(id)$ttCL
`識別子$tC %id を伴う,`~cue順序$で最初の`~cue$を返す。 ◎ Returns the first text track cue (in text track cue order) with text track cue identifier id.
次のいずれかの場合は ~NULL を返す ⇒ 所与の識別子を伴う~cueは無い/ 引数 ~EQ 空~文字列 ◎ Returns null if none of the cues have the given identifier or if the argument is the empty string.

`TextTrackCueList$I ~objは、 `~cue$の~listを,動的に更新される`~cue~list$tTと同じ順序で表現する。 ◎ A TextTrackCueList object represents a dynamically updating list of text track cues in a given order.

`length@ttCL 取得子~手続きは ⇒ ~RET コレが表現する`~cue~list$tTを成す`~cue$の個数 ◎ The length attribute must return the number of cues in the list represented by the TextTrackCueList object.

`getter@ttCL においては: ◎ ↓

  • 所与の時点でコレが`~supportする~prop~index$は、 0 以上[ コレが表現する`~cue~list$tTを成す`~cue$の個数 ]未満とする ◎ The supported property indices of a TextTrackCueList object at any instant are the numbers from zero to the number of cues in the list represented by the TextTrackCueList object minus one, if any. If there are no cues in the list, there are no supported property indices.
  • 所与の~index %~index 用にコレの`有index~propの値を決定する$ときは、 次を返すモノトスル ⇒ コレが表現する`~cue~list$tTを成す %~index 番の`~cue$を表現している `TextTrackCue$I ~obj ◎ To determine the value of an indexed property for a given index index, the user agent must return the indexth text track cue in the list represented by the TextTrackCueList object.

`getCueById(id)@ttCL ~method~手続きは:

  1. ~IF[ %id ~EQ 空~文字列 ] ⇒ ~RET ~NULL
  2. コレが表現する`~cue~list$tTを成す ~EACH( `~cue$ %~cue ) に対し ⇒ ~IF[ %~cue の`識別子$tC ~EQ %id ] ⇒ ~RET %~cue
  3. ~RET ~NULL
◎ The getCueById(id) method, when called with an argument other than the empty string, must return the first text track cue in the list represented by the TextTrackCueList object whose text track cue identifier is id, if any, or null otherwise. If the argument is the empty string, then the method must return null.
4.8.11.11.5.4. `TextTrackCue^I
[Exposed=Window]
interface `TextTrackCue@I : `EventTarget$I {
  readonly attribute `TextTrack$I? `track$ttC;

  attribute DOMString `id$ttC;
  attribute double `startTime$ttC;
  attribute unrestricted double `endTime$ttC;
  attribute boolean `pauseOnExit$ttC;

  attribute `EventHandler$I `onenter$m;
  attribute `EventHandler$I `onexit$m;
};
%cue.`track$ttC
この`~cue$が属する `TextTrack$I ~objが[ 在るならば それ/ 無いならば ~NULL ]を返す ◎ Returns the TextTrack object to which this text track cue belongs, if any, or null otherwise.
%cue.`id$ttC [ = %value ]
`識別子$tCを返す。 ◎ Returns the text track cue identifier.
設定できる。 ◎ Can be set.
%cue.`startTime$ttC [ = %value ]
`開始~時刻$tCを秒数で返す。 ◎ Returns the text track cue start time, in seconds.
設定できる。 ◎ Can be set.
%cue.`endTime$ttC [ = %value ]
`終了~時刻$tCを秒数で返す。 ◎ Returns the text track cue end time, in seconds.
`無限界な~cue$に対しては、 正な `Infinity^jv を返す。 ◎ Returns positive Infinity for an unbounded text track cue.
設定できる。 ◎ Can be set.
%cue.`pauseOnExit$ttC [ = %value ]
`退出-時に静止するか$tCを返す。 ◎ Returns true if the text track cue pause-on-exit flag is set, false otherwise.
設定できる。 ◎ Can be set.
`track@ttC 取得子~手続きは ⇒ ~RET [ コレが表現する`~cue$は、 ある`~tT$の`~cue~list$tTに属する ]ならば,その`~tT$を表現している `TextTrack$I ~obj / ~ELSE_ ~NULL ◎ The track attribute, on getting, must return the TextTrack object of the text track in whose list of cues the text track cue that the TextTrackCue object represents finds itself, if any; or null otherwise.
`id@ttC 取得子~手続きは ⇒ ~RET コレが表現する`~cue$の`識別子$tC ◎ The id attribute, on getting, must return the text track cue identifier of the text track cue that the TextTrackCue object represents.\
`id$ttC 設定子~手続きは ⇒ コレが表現する`~cue$の`識別子$tC ~SET 所与の値 ◎ On setting, the text track cue identifier must be set to the new value.
`startTime@ttC 取得子~手続きは ⇒ ~RET コレが表現する`~cue$の`開始~時刻$tCを秒数で表した結果 ◎ The startTime attribute, on getting, must return the text track cue start time of the text track cue that the TextTrackCue object represents, in seconds.\

`startTime$ttC 設定子~手続きは:

  1. `開始~時刻$tC ~SET 所与の値を秒数に解釈した結果
  2. ~IF[ ある`~media要素$ %要素 が在って,コレが表現する`~cue$ ~IN %要素 の`~tT~list$を成す ある`~tT$の`~cue~list$tT ]~AND[ %要素 は`~posterを示して$いない ] ⇒ `~tTを時間に合わせる$( %要素 )
◎ On setting, the text track cue start time must be set to the new value, interpreted in seconds; then, if the TextTrackCue object's text track cue is in a text track's list of cues, and that text track is in a media element's list of text tracks, and the media element's show poster flag is not set, then run the time marches on steps for that media element.
`endTime@ttC 取得子~手続きは ⇒ ~RET コレが表現する`~cue$の`終了~時刻$tCを[ 秒数/ 正な `Infinity^jv ]で表した結果 ◎ The endTime attribute, on getting, must return the text track cue end time of the text track cue that the TextTrackCue object represents, in seconds or positive Infinity.\

`endTime$ttC 設定子~手続きは:

  1. ~IF[ 所与の値 ~IN { 負な `Infinity^jv, `NaN^jv } ] ⇒ ~THROW `TypeError$E
  2. コレが表現する`~cue$の`終了~時刻$tC ~SET 所与の値を[ 秒数/ 正な `Infinity^jv ]に解釈した結果
  3. ~IF[ ある`~media要素$ %要素 が在って,コレが表現する`~cue$ ~IN %要素 の`~tT~list$を成すある`~tT$の`~cue~list$tT ]~AND[ %要素 は`~posterを示して$いない ] ⇒ `~tTを時間に合わせる$( %要素 )
◎ On setting, if the new value is negative Infinity or a Not-a-Number (NaN) value, then throw a TypeError exception. Otherwise, the text track cue end time must be set to the new value. Then, if the TextTrackCue object's text track cue is in a text track's list of cues, and that text track is in a media element's list of text tracks, and the media element's show poster flag is not set, then run the time marches on steps for that media element.
`pauseOnExit@ttC 取得子~手続きは ⇒ ~RET コレが表現する`~cue$の`退出-時に静止するか$tC ◎ The pauseOnExit attribute, on getting, must return true if the text track cue pause-on-exit flag of the text track cue that the TextTrackCue object represents is set; or false otherwise.\
`pauseOnExit$ttC 設定子~手続きは ⇒ コレが表現する`~cue$の`退出-時に静止するか$tC ~SET 所与の値 ◎ On setting, the text track cue pause-on-exit flag must be set if the new value is true, and must be unset otherwise.
4.8.11.11.6. ~tT~APIを成す~obj用の~event~handler

`TextTrackList$I ~interfaceを実装するどの~objも、 次に挙げる`~event~handler$(および対応する`~event~handler~event型$)を,`~event~handler~IDL属性$として~supportするモノトスル: ◎ The following are the event handlers that (and their corresponding event handler event types) that must be supported, as event handler IDL attributes, by all objects implementing the TextTrackList interface:

`~event~handler$ `~event~handler~event型$
`onchange@m `change$et
`onaddtrack@m `addtrack$et
`onremovetrack@m `removetrack$et

`TextTrack$I ~interfaceを実装するどの~objも、 次に挙げる`~event~handler$(および対応する`~event~handler~event型$)を,`~event~handler~IDL属性$として~supportするモノトスル: ◎ The following are the event handlers that (and their corresponding event handler event types) that must be supported, as event handler IDL attributes, by all objects implementing the TextTrack interface:

`~event~handler$ `~event~handler~event型$
`oncuechange@m `cuechange$et

`TextTrackCue$I ~interfaceを実装するどの~objも、 次に挙げる`~event~handler$(および対応する`~event~handler~event型$)を,`~event~handler~IDL属性$として~supportするモノトスル: ◎ The following are the event handlers (and their corresponding event handler event types) that must be supported, as event handler IDL attributes, by all objects implementing the TextTrackCue interface:

`~event~handler$ `~event~handler~event型$
`onenter@m `enter$et
`onexit@m `exit$et
4.8.11.11.7. ~metadata~tT用の最善な実施
◎非規範的

~tTは、 ~media~dataに関係している~dataを[ 対話的な/増補された ]~view用に格納するために利用できる。 ◎ Text tracks can be used for storing data relating to the media data, for interactive or augmented views.

例えば,~sports放送を示している~pageは、 現在の~scoreについての情報を含むこともできる。 あるロボコンが~liveで~streamされているとする。 画像には、 次のように~scoreを積層することもできる: ◎ For example, a page showing a sports broadcast could include information about the current score. Suppose a robotics competition was being streamed live. The image could be overlaid with the scores, as follows:

`_practice1@

利用者が動画~内の任意な地点へ~seekするたびに,~score表示が正しく具現化されるようにするためには、 ~score用の各~metadata~cueを,適切な長さにする必要がある。 例えば,上の~frameには、[ 対戦~番号を与え,対戦の長さまで居残る~cue ], [ 青チームの~scoreが変化するまで居残る~cue ], [ 赤チームの~scoreが変化するまで居残る~cue ]が 1 個ずつあることになろう。 動画が~live~eventの~streamである場合、 右下における時刻は、 ある~cueに基づくのではなく,現在の動画~時刻から自動的に導出されるものと~~想定されることになる。 しかしながら,動画が~highlightであった場合、 それを成す各~cueにて与えられ得る。 ◎ In order to make the score display render correctly whenever the user seeks to an arbitrary point in the video, the metadata text track cues need to be as long as is appropriate for the score. For example, in the frame above, there would be maybe one cue that lasts the length of the match that gives the match number, one cue that lasts until the blue alliance's score changes, and one cue that lasts until the red alliance's score changes. If the video is just a stream of the live event, the time in the bottom right would presumably be automatically derived from the current video time, rather than based on a cue. However, if the video was just the highlights, then that might be given in cues also.

~WebVTT~file内で これを成す素片が,どの様な見かけになるかを次に示す: ◎ The following shows what fragments of this could look like in a WebVTT file:

WEBVTT

...

05:10:00.000 --> 05:12:15.000
matchtype:予選
matchnumber:37

...

05:11:02.251 --> 05:11:17.198
赤:78

05:11:03.672 --> 05:11:54.198
青:66

05:11:17.198 --> 05:11:25.912
赤:80

05:11:25.912 --> 05:11:26.522
赤:83

05:11:26.522 --> 05:11:26.982
赤:86

05:11:26.982 --> 05:11:27.499
赤:89

...

ここでの要点は、 ~cueの情報が[ 関連な~eventが適用される時間の長さにわたる ]ように与えられることに注意。 代わりに,~scoreの変化~時に、 長さ 0 (あるいは, 0 に近い長さ)の~cueとして~scoreが与えられた場合 — 例えば 05:11:17.198 の所で “赤に 2 点を加算する”, 05:11:25.912 の所で “赤に 3 点を加算する”, 等々のように — 問題が発生する: ~~第一に,~seekingを実装するのは、 ずっと難しくなる — ~scriptは、 どの通知も見逃さないよう,~cueたちが成す~list全体を調べ尽くす必要があるので。 加えて,~cueが短い場合、 それが作動中にあることは — 特定的に~listenしない限り — ~scriptからは,決して見えない可能性もある。 ◎ The key here is to notice that the information is given in cues that span the length of time to which the relevant event applies. If, instead, the scores were given as zero-length (or very brief, nearly zero-length) cues when the score changes, for example saying "red+2" at 05:11:17.198, "red+3" at 05:11:25.912, etc, problems arise: primarily, seeking is much harder to implement, as the script has to walk the entire list of cues to make sure that no notifications have been missed; but also, if the cues are short it's possible the script will never see that they are active unless it listens to them specifically.

作者には,この方式で~cueたちを利用するときは、 `cuechange$et ~eventを利用して,現在の注釈を更新することが奨励される。 (特に, `timeupdate$et ~eventを利用するのは適切とは言えない。 なぜなら、 ~cueが変化しないときでも作業を要することに加え,もっと重要なこととして — `timeupdate$et ~eventは~rateが制限されるので — 当の~metadata~cueが作動中になってから表示が更新されるまでの待時間が長くなるので。) ◎ When using cues in this manner, authors are encouraged to use the cuechange event to update the current annotations. (In particular, using the timeupdate event would be less appropriate as it would require doing work even when the cues haven't changed, and, more importantly, would introduce a higher latency between when the metadata cues become active and when the display is updated, since timeupdate events are rate-limited.)

4.8.11.16. ~event要覧
◎非規範的

【 この節では、 原文のこの節の内容のうち,~tTのみに関わる~eventについて述べる。 他の内容の和訳は、 別~pageにて (特に, `addtrack$et, `removetrack$et, `timeupdate$et ~eventは、 そこに述べられる)。 】

この節に挙げるどの~eventも, `Event$I ~interfaceを利用する。 【原文の表tには “~interface” 列があるが、この訳では,その列を省略してこの一文に集約する。】

次に挙げる~eventは、[ `TextTrack$I ~obj / `track$e 要素 ]に向けて発火される: ◎ The following event fires on TextTrack objects and track elements:

~event名 発火-時機
`cuechange@et ~track内の 1 個~以上の~cueにおいて作動中かどうかが変化したとき。 ◎ One or more cues in the track have become active or stopped being active.

次に挙げる~eventは、 `track$e 要素に向けて発火される: ◎ The following events fire on track elements:

~event名 発火-時機
`error@et ~track~dataを~fetchしている間に~errorが生じた, または 資源の型は~supportされない~tT形式である。 ◎ An error occurs while fetching the track data or the type of the resource is not supported text track format.
`load@et ~track~dataは~fetchされ,成功裡に処理された。 ◎ A track data has been fetched and successfully processed.

次に挙げる~eventは、 `TextTrackCue$I ~objに向けて発火される: ◎ The following events fire on TextTrackCue objects:

~event名 発火-時機
`enter@et ~cueは作動中になった。 ◎ The cue has become active.
`exit@et ~cueは作動中でなくなった。 ◎ The cue has stopped being active.