HTML — メディア要素( video, audio )

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

◎表記記号

4.8.2. `source^e 要素

【 この節では、 原文のこの節における`~media要素$のみに関わる部分を述べる。 他の内容は、 `別~page@~HEimages#the-source-element$にて。 】

`source$e 要素 %source の親が`~media要素$である場合、 以下に述べる要件も課される: ◎ The remainder of the requirements depend on whether the parent is a picture element or a media element: ◎ • The source element's parent is a media element

`source$e 用の`~HTML要素~挿入-時の手続き$は、 所与の ( %挿入される~node ) に対し: ◎ The source HTML element insertion steps, given insertedNode, are:

  1. %親 ~LET %挿入される~node の親
  2. ~IF[ %親 は`~media要素$である ] ⇒ ~IF[ %親 は `src$aM 属性を有さない ]~AND[ %親 の `networkState$mM の値 ~EQ `NETWORK_EMPTY$mM ] ⇒ %親 の`資源~選定~algo$を呼出す ◎ If insertedNode's parent is a media element that has no src attribute and whose networkState has the value NETWORK_EMPTY, then invoke that media element's resource selection algorithm.
  3. ~IF[ %親 は `picture$e 要素である ] ⇒ 【この段の内容は、`別~page@~HEimages#the-source-element$にて。】 ◎ If insertedNode's next sibling is an img element and its parent is a picture element, then, count this as a relevant mutation for the img element.

`src@m ~IDL属性は、 `src$aM 内容~属性を`反映する$モノトスル。 ◎ The IDL attributes src, type, srcset, sizes and media must reflect the respective content attributes of the same name.

作者は,[ 供した~media資源のうち いずれかは,~UAが具現化-可能になる ]ことが定かでない場合には、[ 最後の `source$e 要素~上で `error$et ~eventを~listenする ]ことで[ ~fallback用の挙動 ]を誘発できる: ◎ If the author isn't sure if user agents will all be able to render the media resources provided, the author can listen to the error event on the last source element and trigger fallback behavior:

<script>
 function fallback(%video) {
   /* 
`video$e をその内容に置換する
◎
replace <video> with its contents
 */
   while (%video.hasChildNodes()) {
     if (%video.firstChild instanceof HTMLSourceElement)
       %video.removeChild(%video.firstChild);
     else
       %video.parentNode.insertBefore(%video.firstChild, %video);
   }
   %video.parentNode.removeChild(%video);
 }
</script>
<video controls autoplay>
 <source src='video.mp4' type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
 <source src='video.ogv' type='video/ogg; codecs="theora, vorbis"'
         onerror="fallback(parentNode)">
 ...
</video>

4.8.8. `video^e 要素

`分類$
`~flow内容$/`句ng内容$/`埋込d内容$/[ 要素が `controls$aM 属性を有する場合に限り, `対話的~内容$ ]/`可触~内容$ ◎ Flow content. ◎ Phrasing content. ◎ Embedded content. ◎ If the element has a controls attribute: Interactive content. ◎ Palpable content.
`この要素を利用できる文脈$
`埋込d内容$が期待される所。 ◎ Where embedded content is expected.
`内容~model$

次の順による並び:

  1. 要素が `src$aM 属性を有さない場合に限り, 0 個以上の `source$e 要素
  2. 0 個以上の `track$e 要素
  3. `透過的な内容$

ただし,子孫に`~media要素$は含まないとする。

◎ If the element has a src attribute: zero or more track elements, then transparent, but with no media element descendants. ◎ If the element does not have a src attribute: zero or more source elements, then zero or more track elements, then transparent, but with no media element descendants.
`text/html における~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
`src$aM — 資源の~address ◎ src — Address of the resource
`crossorigin$aM — 要素が非同一-生成元~要請をどう取扱うか ◎ crossorigin — How the element handles crossorigin requests
`poster$aV — 動画~再生に先立って示す~poster~frame ◎ poster — Poster frame to show prior to video playback
`preload$aM — `~media資源$に必要と見込まれる~buffer量の~hintを与える ◎ preload — Hints how much buffering the media resource will likely need
`autoplay$aM — ~pageが読込まれ次第,`~media資源$を自動的に開始できるかどうかの~hintを与える ◎ autoplay — Hint that the media resource can be started automatically when the page is loaded
`playsinline$aV — 要素の再生~区画の中に動画~内容を表示するよう,~UAに促す ◎ playsinline — Encourage the user agent to display video content within the element's playback area
`loop$aM — `~media資源$を~loopするかどうか ◎ loop — Whether to loop the media resource
`muted$aM — `~media資源$を既定で消音するかどうか ◎ muted — Whether to mute the media resource by default
`controls$aM — ~UA~controlを示す ◎ controls — Show user agent controls
`width$a — 横~寸法 ◎ width — Horizontal dimension
`height$a — 縦~寸法 ◎ height — Vertical dimension
`~accessibilityの考慮点$
`video$AA ◎ For authors. For implementers.
`~DOM~interface$
[Exposed=Window]
interface `HTMLVideoElement@I : `HTMLMediaElement$I {
  [`HTMLConstructor$] constructor();

  [`CEReactions$] attribute unsigned long `width$m;
  [`CEReactions$] attribute unsigned long `height$m;
  readonly attribute unsigned long `videoWidth$mV;
  readonly attribute unsigned long `videoHeight$mV;
  [`CEReactions$] attribute USVString `poster$mV;
  [`CEReactions$] attribute boolean `playsInline$mV;
};

`video$e 要素は 動画や映画, および ~captionを伴う音声~file を再生するために利用される。 ◎ A video element is used for playing videos or movies, and audio files with captions.

`video$e 要素の内側に、 内容を供してもヨイ。 ~UAは、 この内容を利用者に示すベキでない — それは、[ `video$e を~supportしない旧~web~browser ]用に[ その利用者に当の動画~内容に~accessする方法を伝える~text ]を示せるようにすることが意図されている。 ◎ Content may be provided inside the video element. User agents should not show this content to the user; it is intended for older web browsers which do not support video, so that text can be shown to the users of these older browsers informing them of how to access the video contents.

注記: 特に,この内容は、 ~accessibilityの懸念に取組むために意図されるものではない。 [ 視覚/聴覚 において,部分的または全部的に, 物理的または認知的な障害 ]を抱える利用者~向けに 動画~内容を~access可能にするための,様々な特能が可用である。 [ ~caption/手話~track/音述 ]は、 動画~stream内に埋込める。 ~captionは、 `track$e 要素を利用して 外部~fileとして供することもできる。 音述は、 `track$e 要素を利用して,~UAにより発話に合成される~textを内容とする`~WebVTT~file$を参照して埋込める。 ~WebVTTは、 ~chapter~titleを供するためにも利用できる。 ~media要素をまったく利用しない利用者~向けには、 単純に,音声転写その他の~textな代替への~linkを `video$e 要素~周りの注釈文に供せる。 `WEBVTT$r ◎ In particular, this content is not intended to address accessibility concerns. To make video content accessible to the partially sighted, the blind, the hard-of-hearing, the deaf, and those with other physical or cognitive disabilities, a variety of features are available. Captions can be provided, either embedded in the video stream or as external files using the track element. Sign-language tracks can be embedded in the video stream. Audio descriptions can be embedded in the video stream or in text form using a WebVTT file referenced using the track element and synthesized into speech by the user agent. WebVTT can also be used to provide chapter titles. For users who would rather not use a media element at all, transcripts or other textual alternatives can be provided by simply linking to them in the prose near the video element. [WEBVTT]

`video$e 要素は、 表向きは動画~dataを`~media~data$とする`~media要素$であり, 場合によっては音声~dataが結付けられる。 ◎ The video element is a media element whose media data is ostensibly video data, possibly with associated audio data.

次に挙げる属性は、 `すべての~media要素に共通な属性$である ⇒# `src$aM, `crossorigin$aM, `preload$aM, `autoplay$aM, `loop$aM, `muted$aM, `controls$aM ◎ The src, crossorigin, preload, autoplay, loop, muted, and controls attributes are the attributes common to all media elements.

`poster@aV 属性は、 動画~dataが可用でない間に~UAが示せる画像~fileの`~URL$を与える。 指定する値は、 `前後~空白~可の妥当かつ空でない~URL$でなければナラナイ。 ◎ The poster attribute gives the URL of an image file that the user agent can show while no video data is available. The attribute, if present, must contain a valid non-empty URL potentially surrounded by spaces.

`video$e 要素 %video に指定された資源が利用されることになる場合、[ %video の作成-時 / %video の `poster$aV 属性が[ 設定- / 変更- / 除去- ]されたときには,~UAは %video の `~poster~frame@ を次を走らせた結果にするモノトスル ( %video は`~posterを示して$いようがいまいが) (結果の ε は、 `~poster~frame$はないことを表す): ◎ If the specified resource is to be used, then, when the element is created or when the poster attribute is set, changed, or removed, the user agent must run the following steps to determine the element's poster frame (regardless of the value of the element's show poster flag):

  1. ~IF[ %video 用に走らせている,この~algoの既存の~instanceがある ] ⇒ その~instanceを中止する (`~poster~frame$は変更せずに) ◎ If there is an existing instance of this algorithm running for this video element, abort that instance of this algorithm without changing the poster frame.
  2. %poster ~LET %video は `poster$aV 属性を[ 有するならば その値 / 有さないならば ε ]
  3. ~IF[ %poster ~IN { ε, 空~文字列 } ] ⇒ ~RET ε ◎ If the poster attribute's value is the empty string or if the attribute is absent, then there is no poster frame; return.
  4. %~URL ~LET `~URLを符号化法の下で相対的に構文解析する$( %poster, 要素の`~node文書$ ) ◎ Let url be the result of encoding-parsing a URL given the poster attribute's value, relative to the element's node document.
  5. ~IF[ %~URL ~EQ `失敗^i ] ⇒ ~RET ε この場合、~poster~frameは無い。 ◎ If url is failure, then return. There is no poster frame.
  6. %要請 ~LET 新たな`要請$ — その ⇒# `~URL$rq ~SET %~URL, `~client$rq ~SET 要素の`~node文書$に`関連な設定群~obj$, `行先$rq ~SET `image^l, `資格証~mode$rq ~SET `include^l, `起動元~種別$rq ~SET `video^l, `~URL資格証を利用するか$rq ~SET ~T ◎ Let request be a new request whose URL is url, client is the element's node document's relevant settings object, destination is "image", initiator type is "video", credentials mode is "include", and whose use-URL-credentials flag is set.
  7. %要請 を`~fetchする$ ◎ Fetch request.\

    これは、 %video の`~node文書$の`~load~eventを遅延する$モノトスル。 ◎ This must delay the load event of the element's node document.

  8. ~IF[ 何らかの画像が得された ] ⇒ ~RET その画像 ◎ If an image is thus obtained, the poster frame is that image.\
  9. ~RET ε ◎ Otherwise, there is no poster frame.

注記: `poster$aV 属性が与える`~poster~frame$は、 どの様な動画なのか見当を利用者に与える,動画の代表~frameになることが意図される (概して,最初の方にある空内容でない~frame) ◎ The image given by the poster attribute, the poster frame, is intended to be a representative frame of the video (typically one of the first non-blank frames) that gives the user an idea of what the video is like.

`playsinline@aV 属性は、 `真偽-属性$であり,次を~UAに~~指示する~hintとして~~働く ⇒ 在るならば、 その動画は,既定では文書~内に “~inline” に — すなわち,要素の再生~区画に拘束される下で — 表示されるべきである — 全~screenに, あるいは 独立かつ~resize可能な~UIwindow内にではなく。 ◎ The playsinline attribute is a boolean attribute. If present, it serves as a hint to the user agent that the video ought to be displayed "inline" in the document by default, constrained to the element's playback area, instead of being displayed fullscreen or in an independent resizable window.

注記: `playsinline$aV 属性が無いことが、 動画は既定で全~screenに表示することを含意するわけではない。 ~~実際、 ほとんどの~UAは,すべての動画を既定で~inlineに再生することを選んでいる — そのような~UAにおいては、 `playsinline$aV 属性の効果はない。 ◎ The absence of the playsinline attribute does not imply that the video will display fullscreen by default. Indeed, most user agents have chosen to play all videos inline by default, and in such user agents the playsinline attribute has no effect.


`video$e 要素 %video が所与の時点で表現するものは、 その時点で次を走らせた結果として定義される: ◎ A video element represents what is given for the first matching condition in the list below:

  1. %readyState ~LET %video の`readyState$mM 属性~値 ◎ ↓
  2. %~poster ~LET %video の`~poster~frame$ ◎ ↓
  3. ~IF[ ~OR↓ (すなわち,可用な動画~dataは無い) ]… ◎ When no video data is available (\

    • %readyState ~EQ `HAVE_NOTHING$mM ◎ the element's readyState attribute is either HAVE_NOTHING, or\
    • [ %readyState ~EQ `HAVE_METADATA$mM ]~AND[ 動画~dataはまったく得されてない ] ◎ HAVE_METADATA but no video data has yet been obtained at all, or\
    • [ %readyState ~NIN { `HAVE_NOTHING$mM, `HAVE_METADATA$mM } ]~AND[ %video の`~media資源$に動画~channelはない ]] ◎ the element's readyState attribute is any subsequent value but the media resource does not have a video channel)

    …ならば ⇒ ~RET [ %~poster ~NEQ ε ならば %~poster / ~ELSE_ `生来な寸法$を伴わない`透明な黒$ ] ◎ The video element represents its poster frame, if any, or else transparent black with no natural dimensions.

  4. ~Assert: %video の`~media資源$に動画~channelはある
  5. %paused ~LET %video の `paused$mM ◎ ↓
  6. %描画-済み~frame ~LET 最後に描画された動画の~frame ◎ ↓
  7. %現~frame ~LET [ `現在の再生~位置$に対応する動画の~frameが可用なら それ / ~ELSE_ ε ] ◎ ↓
  8. ~IF[ %paused ~EQ ~T ]:

    1. ~IF[ %現~frame は動画の最初の~frameである ]~AND[ %video は`~posterを示して$いる ]~AND[ %~poster ~NEQ ε ] ⇒ ~RET %~poster
    2. ~IF[ %現~frame ~NEQ ε ] ⇒ ~RET %現~frame
    3. ~RET %描画-済み~frame (例: 動画は~seek中か~buffer中にある)
    ◎ When the video element is paused, the current playback position is the first frame of video, and the element's show poster flag is set ◎ • The video element represents its poster frame, if any, or else the first frame of the video. ◎ When the video element is paused, and the frame of video corresponding to the current playback position is not available (e.g. because the video is seeking or buffering) ◎ ↓When the video element is neither potentially playing nor paused (e.g. when seeking or stalled) ◎ • The video element represents the last frame of the video to have been rendered. ◎ When the video element is paused ◎ • The video element represents the frame of video corresponding to the current playback position.
  9. ~ELIF[ ~NOT %video は`再生-中になり得る$ (例: 動画は ~seek中か停滞している) ] ⇒ ~RET %描画-済み~frame ◎ ↑
  10. ~RET %現~frame ( %video には動画~channelがあって`再生-中になり得る$) — この時点で: ◎ Otherwise (the video element has a video channel and is potentially playing)

    • %video は、 絶え間なく~~更新され続ける`現在の再生~位置$にある動画の~frameを`表現-$する。 ◎ The video element represents the frame of video at the continuously increasing "current" position.\
    • `現在の再生~位置$が変化して,%描画-済み~frame が動画~内の`現在の再生~位置$に対応する~frameでなくなったときは、 新たな~frameを描画するモノトスル。 ◎ When the current playback position changes such that the last frame rendered is no longer the frame corresponding to the current playback position in the video, the new frame must be rendered.

動画の~frameは、 `~event~loop$が最後に`最初の段$に達した時点で`選択されている動画~track$から得するモノトスル。 ◎ Frames of video must be obtained from the video track that was selected when the event loop last reached step 1.

注記: 特定0の再生~位置に 動画~stream内のどの~frameが対応するかは、 動画~streamの形式により定義される。 ◎ Which frame in a video stream corresponds to a particular playback position is defined by the video stream's format.

`video$e 要素は、 上述に加え,次に挙げるものも`表現-$する: ◎ The video element also represents\

`~media資源$に結付けられた音声が再生される場合は、 `現在の再生~位置$に同期するよう,要素の`実効~media音量$で再生するモノトスル。 ~UAは、[ `~event~loop$が最後に`最初の段$に達した時点で, `可能化されて@#dom-audiotrack-enabled$いる音声~track ]からの音声を再生するモノトスル。 ◎ Any audio associated with the media resource must, if played, be played synchronized with the current playback position, at the element's effective media volume. The user agent must play the audio from audio tracks that were enabled when the event loop last reached step 1.

上に加えて、 ~UAは,利用者に~message ( “~buffer中”, “動画まだ読込まれてない”, “~error” など,より詳細な情報) を供してヨイ — ~textや~iconを動画や他の要素の再生~区画~上に積層する,あるいは別の適切な方式で。 ◎ In addition to the above, the user agent may provide messages to the user (such as "buffering", "no video loaded", "error", or more detailed information) by overlaying text or icons on the video or other areas of the element's playback area, or in another appropriate manner.

動画を描画できない~UAは、 要素が[ 外部の動画~再生~utility / 動画~data自体 ]への~linkを`表現-$するようにしてもヨイ。 ◎ User agents that cannot render the video may instead make the element represent a link to an external video playback utility or to the video data itself.

`video$e 要素の`~media資源$に動画~channelがある場合、 要素は,次のような`塗り~source$を供する:

  • ( 横幅, 縦幅 ) は`~media資源$の ( `生来な横幅$vD, `生来な縦幅$vD )
  • 外観は [ `現在の再生~位置$に対応する動画の~frameが可用ならば それ / ~ELSE_(例:動画は~seek中か~buffer中)その前の外観があれば それ / ~ELSE_(例:動画はまだ最初の~frameの読込中にある)黒一色 ]
◎ When a video element's media resource has a video channel, the element provides a paint source whose width is the media resource's natural width, whose height is the media resource's natural height, and whose appearance is the frame of video corresponding to the current playback position, if that is available, or else (e.g. when the video is seeking or buffering) its previous appearance, if any, or else (e.g. because the video is still loading the first frame) blackness.

%video.`videoWidth$mV
%video.`videoHeight$mV
これらの属性は、[ 寸法が既知ならば動画の生来な寸法 / ~ELSE_ 0 ]を返す。 ◎ These attributes return the natural dimensions of the video, or 0 if the dimensions are not known.

`~media資源$の `生来な横幅@vD / `生来な縦幅@vD は、 その資源に利用されている形式により定義される[ 資源の寸法, 縦横比, `clean aperture^en†, 解像度, 等々 ]を織り込んだ後の時点での,`~CSS~pixel$数による資源の寸法とする。 `anamorphic^en 形式††が,[ “正しい” 寸法に~~復元するための,縦横比を動画~dataの寸法に適用する方法 ]を定義していない場合、 ~UAは、 一方の寸法は変えないまま他方の寸法を増やすことにより,縦横比を適用するモノトスル。 ◎ The natural width and natural height of the media resource are the dimensions of the resource in CSS pixels after taking into account the resource's dimensions, aspect ratio, clean aperture, resolution, and so forth, as defined for the format used by the resource. If an anamorphic format does not define how to apply the aspect ratio to the video data's dimensions to obtain the "correct" dimensions, then the user agent must apply the ratio by increasing one dimension and leaving the other unchanged.

【† 動画の符号化処理の都合により縁に現れる “ゴミ” が見えなくなるよう切り~~落とすための, “きれいな” 区画。 】【†† 円柱レンズで縦横いずれかの方向に圧縮して撮影された形式の動画 】

[ `videoWidth@mV/ `videoHeight@mV ]取得子~手続きは:

  1. ~IF[ コレの `readyState$mM 属性 ~EQ `HAVE_NOTHING$mM ] ⇒ ~RET 0
  2. ~RET `~CSS~pixel$数による動画の[ `videoWidth^m 用には `生来な横幅$vD / `videoHeight^m 用には `生来な縦幅$vD ]
◎ The videoWidth IDL attribute must return the natural width of the video in CSS pixels. The videoHeight IDL attribute must return the natural height of the video in CSS pixels. If the element's readyState attribute is HAVE_NOTHING, then the attributes must return 0.

`~media要素$ %要素 が表現する動画の[ `生来な横幅$vD / `生来な縦幅$vD ]が変化したときは (例えば,`選択されている動画~track$が変化したときも含む)、 ~UAは,次を走らすモノトスル ⇒ ~IF[ %要素 の `readyState$mM 属性 ~NEQ `HAVE_NOTHING$mM ] ⇒ `~media~taskを~queueする$( %要素, 次の手続き ) ◎ Whenever the natural width or natural height of the video changes (including, for example, because the selected video track was changed), if the element's readyState attribute is not HAVE_NOTHING, the user agent must queue a media element task given the media element to\

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

`video$e 要素は、 `寸法~属性$を~supportする。 ◎ The video element supports dimension attributes.

~style規則が無い下でも、 動画~内容は,[ その縦横比は保全しつつ,要素の再生~区画に完全に収まるような最~大~sizeで、 区画の中央に示される ]ように描画されるベキである。 したがって,要素の再生~区画と動画とで縦横比が合致しない場合、 再生~区画~内に動画が占めない部位が生じることになる — その部位は何も表現しない。 ◎ In the absence of style rules to the contrary, video content should be rendered inside the element's playback area such that the video content is shown centered in the playback area at the largest possible size that fits completely within it, with the video content's aspect ratio being preserved. Thus, if the aspect ratio of the playback area does not match the aspect ratio of the video, the video will be shown letterboxed or pillarboxed. Areas of the element's playback area that do not contain the video represent nothing.

注記: ~CSSを実装する~UAにおいては、 上の要件は, `§ 具現化にて示唆される~style規則@~HTMLrendering#video-object-fit$ を利用して実装できる。 ◎ In user agents that implement CSS, the above requirement can be implemented by using the style rule suggested in the Rendering section.

`video$e 要素の再生~区画の[ `生来な横幅$, `生来な縦幅$ ]は: ◎ ↓

`既定の~obj~size$は、 `~CSS~pixel$数で 横幅 300, 縦幅 150 とする。 `CSSIMAGES$r ◎ The default object size is a width of 300 CSS pixels and a height of 150 CSS pixels. [CSSIMAGES]


~UAは[ 開閉可能な~caption, 音述~track, 動画~streamに結付けられた他の追加的な~data ]の表示の[ 可能化-, 不能化- ]を制御する~controlを供するベキである — そのような特能もまた、 ~pageの通常の描画には干渉しないベキである。 ◎ User agents should provide controls to enable or disable the display of closed captions, audio description tracks, and other additional data associated with the video stream, though such features should, again, not interfere with the page's normal rendering.

~UAは、 利用者がより相応しい方式で動画~内容を見れるようにしてもヨイ — [ 全~screenや 独立かつ~resize可能な~UIwindow ]内など。 ~UAは、 そのような視聴v~modeを動画の再生-時に既定で誘発してもヨイ — `playsinline$aV 属性が指定されているときは,そうするベキでないが。 他の~UI特能と同じく,これを可能化する~controlは、 ~UAが`~UIを公開する$ときを除き,~pageの通常の描画に干渉するベキでない。 しかしながら,そのような独立な視聴v~modeにおいては、 ~UAは, `controls$aM 属性が無い下でも全部的な~UIを可視にしてヨイ。 ◎ User agents may allow users to view the video content in manners more suitable to the user, such as fullscreen or in an independent resizable window. User agents may even trigger such a viewing mode by default upon playing a video, although they should not do so when the playsinline attribute is specified. As with the other user interface features, controls to enable this should not interfere with the page's normal rendering unless the user agent is exposing a user interface. In such an independent viewing mode, however, user agents may make full user interfaces visible, even if the controls attribute is absent.

動画~再生-時に利用者~体験を損ないかねない~system特能がある場合、 ~UAは,それを~~抑制してもヨイ — 例えば~UAは、 動画の再生が進捗-中にある間は,~screensaverを不能化することもできる。 ◎ User agents may allow video playback to affect system features that could interfere with the user's experience; for example, user agents could disable screensavers while video playback is in progress.


`poster@mV ~IDL属性は、 `poster$aV 内容~属性を`反映する$モノトスル。 ◎ The poster IDL attribute must reflect the poster content attribute.

`playsInline@mV ~IDL属性は、 `playsinline$aV 内容~属性を`反映する$モノトスル。 ◎ The playsInline IDL attribute must reflect the playsinline content attribute.

動画を正しく再生するのに失敗したことを検出する方法の一例: ◎ This example shows how to detect when a video has failed to play correctly:

<script>
 function failed(%e) {
   /* 
動画の再生に失敗した
—  その原因についての~messageを示す
◎
video playback failed - show a message saying why
 */
   switch (%e.target.error.code) {
     case %e.target.error.MEDIA_ERR_ABORTED:
       alert('動画の再生を中止しましたね。');
       break;
     case %e.target.error.MEDIA_ERR_NETWORK:
       alert('~network~errorのため、
動画~downloadの中途で失敗しました。');
       break;
     case %e.target.error.MEDIA_ERR_DECODE:
       alert('動画の再生を中止しました。動画~dataに問題があるか,動画はこの~browserが~supportしない特能を利用しています。');
       break;
     case %e.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED:
       alert('~serverまたは~networkに問題があるか,形式が未~supportなため、
動画を読込めませんでした。');
       break;
     default:
       alert('未知な~errorが生じました。');
       break;
   }
 }
</script>
<p><video src="tgif.vid" autoplay controls onerror="failed(event)"></video></p>
<p><a href="tgif.vid">Download the video file</a>.</p>

4.8.9. `audio^e 要素

`分類$
`~flow内容$/`句ng内容$/`埋込d内容$/[ 要素が `controls$aM 属性を有する場合に限り,`対話的~内容$ ] /[ 要素が `controls$aM 属性を有する場合に限り,`可触~内容$ ] ◎ Flow content. ◎ Phrasing content. ◎ Embedded content. ◎ If the element has a controls attribute: Interactive content. ◎ If the element has a controls attribute: Palpable content.
`この要素を利用できる文脈$
`埋込d内容$が期待される所。 ◎ Where embedded content is expected.
`内容~model$

次の順による並び:

  1. 要素が `src$aM 属性を有さない場合に限り, 0 個以上の `source$e 要素
  2. 0 個以上の `track$e 要素
  3. `透過的な内容$

ただし,子孫に`~media要素$は含まないとする。

◎ If the element has a src attribute: zero or more track elements, then transparent, but with no media element descendants. ◎ If the element does not have a src attribute: zero or more source elements, then zero or more track elements, then transparent, but with no media element descendants.
`text/html における~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
`src$aM — 資源の~address ◎ src — Address of the resource
`crossorigin$aM — 要素が非同一-生成元~要請をどう取扱うか ◎ crossorigin — How the element handles crossorigin requests
`preload$aM — `~media資源$に必要と見込まれる~buffer量の~hintを与える ◎ preload — Hints how much buffering the media resource will likely need
`autoplay$aM — ~pageが読込まれ次第,`~media資源$を自動的に開始できるかどうかの~hintを与える ◎ autoplay — Hint that the media resource can be started automatically when the page is loaded
`loop$aM — `~media資源$を~loopするかどうか ◎ loop — Whether to loop the media resource
`muted$aM — `~media資源$を既定で消音するかどうか ◎ muted — Whether to mute the media resource by default
`controls$aM — ~UA~controlを示す ◎ controls — Show user agent controls
`~accessibilityの考慮点$
`audio$AA ◎ For authors. For implementers.
`~DOM~interface$
[Exposed=Window,
`LegacyFactoryFunction$=`Audio$m(optional DOMString %src)]
interface `HTMLAudioElement@I : `HTMLMediaElement$I {
  [`HTMLConstructor$] constructor();
};

`audio$e 要素は、 音響または音声の~streamを`表現-$する。 ◎ An audio element represents a sound or audio stream.

`audio$e 要素の内側に内容が供されてもヨイ。 ~UAは、 この内容を利用者に示すベキでない — それは、[ `audio$e を~supportしない旧~web~browser ]用に[ その利用者に当の音声~内容に~accessする方法を伝える~text ]を示せるようにすることが意図されている。 ◎ Content may be provided inside the audio element. User agents should not show this content to the user; it is intended for older web browsers which do not support audio, so that text can be shown to the users of these older browsers informing them of how to access the audio contents.

注記: 特に、 この内容は[ ~accessibilityの懸念に取組むために意図されるもの ]ではない。 [ 聴覚において,部分的または全部的に, 物理的または認知的な障害 ]を抱える利用者~向けに 音声~内容を~access可能にするための,様々な特能が可用である。 ~captionや手話~動画が可用なら、 `audio$e 要素に代えて `video$e 要素を利用して音声を再生すれば,利用者に視覚的な代替も~~供せるようになる。 `track$e 要素と `~WebVTT~file$を利用して~chapter~titleを供すれば、 ~naviを援助できる。 当然ながら、 単純に,音声転写その他の~textな代替への~linkを `audio$e 要素~周りの注釈文に供することもできる。 `WEBVTT$r ◎ In particular, this content is not intended to address accessibility concerns. To make audio content accessible to the deaf or to those with other physical or cognitive disabilities, a variety of features are available. If captions or a sign language video are available, the video element can be used instead of the audio element to play the audio, allowing users to enable the visual alternatives. Chapter titles can be provided to aid navigation, using the track element and a WebVTT file. And, naturally, transcripts or other textual alternatives can be provided by simply linking to them in the prose near the audio element. [WEBVTT]

`audio$e 要素は、 表向きは音声~dataを`~media~data$とする`~media要素$である。 ◎ The audio element is a media element whose media data is ostensibly audio data.

次に挙げる属性は、 `すべての~media要素に共通な属性$である ⇒# `src$aM, `crossorigin$aM, `preload$aM, `autoplay$aM, `loop$aM, `muted$aM, `controls$aM ◎ The src, crossorigin, preload, autoplay, loop, muted, and controls attributes are the attributes common to all media elements.

%audio = new `Audio( [ url ] )$m
新たな `audio$e 要素を返す。 %url 引数は、 与えられていれば, `src$aM 属性に設定される。 ◎ Returns a new audio element, with the src attribute set to the value passed in the argument, if applicable.

`Audio(src)@m ~methodは、 `HTMLAudioElement$I ~objを作成する旧来の~factory関数である ( `createElement()$m などの~DOMによる~factory~methodに加えて供されている)。 その~method~手続きは: ◎ A legacy factory function is provided for creating HTMLAudioElement objects (in addition to the factory methods from DOM such as createElement()): Audio(src).\ When invoked, the legacy factory function must perform the following steps:

  1. %文書 ~LET `現在の大域~obj$に`結付けられた文書$ ◎ Let document be the current global object's associated Document.
  2. %audio ~LET `要素を作成する$( %文書, `audio$e, `~HTML名前空間$ ) ◎ Let audio be the result of creating an element given document, audio, and the HTML namespace.
  3. %audio の`属性~値を設定する$( "`preload$aM", "`auto$v" ) ◎ Set an attribute value for audio using "preload" and "auto".
  4. ~IF[ %src は与えられている ] ⇒ %audio の`属性~値を設定する$( "`src$aM", %src ) (~UAは %audio 用の`資源~選定~algo$を`呼出す@#concept-media-load-algorithm-at-creation$ことになる。) ◎ If src is given, then set an attribute value for audio using "src" and src. (This will cause the user agent to invoke the object's resource selection algorithm before returning.)
  5. ~RET %audio ◎ Return audio.

4.8.10. `track^e 要素

【 この節の内容は、 `別~page@~HEtrack#the-track-element$にて。 】

4.8.11. ~media要素

`HTMLMediaElement$I ~obj (この仕様における `audio$e / `video$e ) は、 単に `~media要素@ とも呼ばれる。 ◎ HTMLMediaElement objects (audio and video, in this specification) are simply known as media elements.

enum `CanPlayTypeResult@I { "" /* `空~文字列$cP */, `maybe$l, `probably$l };

typedef (`MediaStream$I or `MediaSource$I or `Blob$I) `MediaProvider@I;

[Exposed=Window]
interface `HTMLMediaElement@I : `HTMLElement$I {

  // ~error状態
  readonly attribute `MediaError$I? `error$mM;

  // ~network状態
  [`CEReactions$] attribute USVString `src$mM;
  attribute `MediaProvider$I? `srcObject$mM;
  readonly attribute USVString `currentSrc$mM;
  [`CEReactions$] attribute DOMString? `crossOrigin$mM;
  const unsigned short `NETWORK_EMPTY$mM = 0;
  const unsigned short `NETWORK_IDLE$mM = 1;
  const unsigned short `NETWORK_LOADING$mM = 2;
  const unsigned short `NETWORK_NO_SOURCE$mM = 3;
  readonly attribute unsigned short `networkState$mM;
  [`CEReactions$] attribute DOMString `preload$mM;
  readonly attribute `TimeRanges$I `buffered$mM;
  undefined `load$mM();
  `CanPlayTypeResult$I `canPlayType$mM(DOMString %type);

  // 準備状態
  const unsigned short `HAVE_NOTHING$mM = 0;
  const unsigned short `HAVE_METADATA$mM = 1;
  const unsigned short `HAVE_CURRENT_DATA$mM = 2;
  const unsigned short `HAVE_FUTURE_DATA$mM = 3;
  const unsigned short `HAVE_ENOUGH_DATA$mM = 4;
  readonly attribute unsigned short `readyState$mM;
  readonly attribute boolean `seeking$mM;

  // 再生~状態
  attribute double `currentTime$mM;
  undefined `fastSeek$mM(double %time);
  readonly attribute unrestricted double `duration$mM;
  `object$ `getStartDate$mM();
  readonly attribute boolean `paused$mM;
  attribute double `defaultPlaybackRate$mM;
  attribute double `playbackRate$mM;
  attribute boolean `preservesPitch$mM;
  readonly attribute `TimeRanges$I `played$mM;
  readonly attribute `TimeRanges$I `seekable$mM;
  readonly attribute boolean `ended$mM;
  [`CEReactions$] attribute boolean `autoplay$mM;
  [`CEReactions$] attribute boolean `loop$mM;
  `Promise$<undefined> `play$mM();
  undefined `pause$mM();

  // 各種~control
  [`CEReactions$] attribute boolean `controls$mM;
  attribute double `volume$mM;
  attribute boolean `muted$mM;
  [`CEReactions$] attribute boolean `defaultMuted$mM;

  // 各種~track
  [SameObject] readonly attribute `AudioTrackList$I `audioTracks$mM;
  [SameObject] readonly attribute `VideoTrackList$I `videoTracks$mM;
  [SameObject] readonly attribute `TextTrackList$I `textTracks$mM;
  `TextTrack$I `addTextTrack$mM(`TextTrackKind$I %kind, optional DOMString %label = "", optional DOMString %language = "");
};

`~media要素~属性@ — `src$aM, `crossorigin$aM, `preload$aM, `autoplay$aM, `loop$aM, `muted$aM, `controls$aM — は、 この節にて定義され,すべての`~media要素$に適用される。 ◎ The media element attributes, src, crossorigin, preload, autoplay, loop, muted, and controls, apply to all media elements. They are defined in this section.

`~media要素$は、 利用者に[ 音声~data / 動画&音声~data ]を呈示するために利用される。 この~dataは、 この節においては `~media~data@ と称される — この節は[ 音声, 動画 ]用の`~media要素$に等しく適用されるので。 用語 `~media資源@ は、 ~media~dataの完全な集合を指すために利用される — 例えば、 完全な[ 動画/音声 ]~file。 ◎ Media elements are used to present audio data, or video and audio data, to the user. This is referred to as media data in this section, since this section applies equally to media elements for audio or for video. The term media resource is used to refer to the complete set of media data, e.g. the complete video file, or complete audio file.

各`~media資源$には、 `生成元@mR が結付けられる — それは、 次に挙げるいずれかをとり,初期~時は `none^l に設定されるとする ⇒ `none^l / `multiple^l / `rewritten^l / `生成元$ ◎ A media resource has an associated origin, which is either "none", "multiple", "rewritten", or an origin. It is initially set to "none".

各`~media資源$は、 複数の[ 音声/動画 ]~trackを持ち得る。 `~media要素$の目的における`~media資源$の[ 動画~data / 音声~data ]は、 `~event~loop$が最後に`最初の段$に達した時点で,要素の[ `videoTracks$mM / `audioTracks$mM ]属性が与える[ 現在~選択されている~trackのそれ(もしあれば) / 現在~可能化されている~trackのそれら(もしあれば)を混合した結果 ]に限られる。 ◎ A media resource can have multiple audio and video tracks. For the purposes of a media element, the video data of the media resource is only that of the currently selected track (if any) as given by the element's videoTracks attribute when the event loop last reached step 1, and the audio data of the media resource is the result of mixing all the currently enabled tracks (if any) given by the element's audioTracks attribute when the event loop last reached step 1.

注記: `audio$e, `video$e 両~要素とも[ 音声, 動画 ]の両者に利用できる。 この 2 つの主な相違は、 単純に,視覚的な内容(動画や~captionなど)用の再生~区画が[ `audio$e 要素にはなく, `video$e 要素にはある ]ことである。 ◎ Both audio and video elements can be used for both audio and video. The main difference between the two is simply that the audio element has no playback area for visual content (such as video or captions), whereas the video element does.

各`~media要素$には、 一意な `~media要素~event~task~source@ がある。 【すなわち,要素ごとに別々な`~task~source$を成す。】 ◎ Each media element has a unique media element event task source.

`~media~taskを~queueする@ ときは、 所与の ( `~media要素$ %要素, 何かを遂行する一連の段 %手続き ) に対し,次を走らす ⇒ `要素~taskを~queueする$( %要素 の`~media要素~event~task~source$, %要素, %手続き ) ◎ To queue a media element task with a media element element and a series of steps steps, queue an element task on the media element's media element event task source given element and steps.
4.8.11.1. ~error~code
%media.`error$mM
要素の現在の~error状態を表現している `MediaError$I ~objを返す。 ◎ Returns a MediaError object representing the current error state of the element.
~errorが生じてなければ ~NULL を返す。 ◎ Returns null if there is no error.

各`~media要素$には、 ~error状態sが結付けられる — それは、 要素がその`資源~選定~algo$が最後に呼出されてから遭遇した最後の~errorを記録する。 ◎ All media elements have an associated error status, which records the last error the element encountered since its resource selection algorithm was last invoked.\

`error@mM 取得子~手続きは:

  1. ~IF[ コレにおいて~errorは まだ生じていない ] ⇒ ~RET ~NULL
  2. ~RET コレにおいて最後に生じた~error用に作成された `MediaError$I ~obj
◎ The error attribute, on getting, must return the MediaError object created for this last error, or null if there has not been an error.
[Exposed=Window]
interface `MediaError@I {
  const unsigned short `MEDIA_ERR_ABORTED$mE = 1;
  const unsigned short `MEDIA_ERR_NETWORK$mE = 2;
  const unsigned short `MEDIA_ERR_DECODE$mE = 3;
  const unsigned short `MEDIA_ERR_SRC_NOT_SUPPORTED$mE = 4;

  readonly attribute unsigned short `code$mE;
  readonly attribute DOMString `message$mE;
};
%media.`error$mM.`code$mE
現在の~errorの~error~codeを,下に挙げるいずれかの値として返す。 ◎ Returns the current error's error code, from the list below.
%media.`error$mM.`message$mE
遭遇した~error条件に特有な診断用の参考~messageを返す。 ~messageと~message形式は、 一般には,~UAごとに一様でない。 そのような~messageは可用でない場合、 空~文字列が返される。 ◎ Returns a specific informative diagnostic message about the error condition encountered. The message and message format are not generally uniform across different user agents. If no such message is available, then the empty string is returned.

各 `MediaError$I ~objは、 文字列である `~message@ , および 次のいずれかをとる `~code@ を持つ: ◎ Every MediaError object has a message, which is a string, and a code, which is one of the following:

`MEDIA_ERR_ABORTED@mE (数-値 1 )
`~media資源$の~fetchingは、 利用者の要請に応じて~UAにより中止された。 ◎ The fetching process for the media resource was aborted by the user agent at the user's request.
`MEDIA_ERR_NETWORK@mE (数-値 2 )
資源は利用-可能であると確立された後、 何らかの~network~errorにより,~UAによる`~media資源$の~fetchingは停止された。 ◎ A network error of some description caused the user agent to stop fetching the media resource, after the resource was established to be usable.
`MEDIA_ERR_DECODE@mE (数-値 3 )
資源は利用-可能であると確立された後、 `~media資源$を復号する際に,何らかの~errorが生じた。 ◎ An error of some description occurred while decoding the media resource, after the resource was established to be usable.
`MEDIA_ERR_SRC_NOT_SUPPORTED@mE (数-値 4 )
[ `src$aM 属性 / `アテガわれている~media提供元~obj$ ]により指示された`~media資源$は、 相応しくなかった。 ◎ The media resource indicated by the src attribute or assigned media provider object was not suitable.

`新たな~MediaError@ を作成するときは、 所与の ( 上に挙げたいずれかの値をとる~error~code %~code ) に対し,次のように設定された新たな `MediaError$I ~objを返す: ◎ To create a MediaError, given an error code which is one of the above values, return a new MediaError object\

  • `~code$ ~SET %~code ◎ whose code is the given error code and\
  • `~message$ ~SET 当の~error条件を生じさせたものについて~UAが給せる詳細が[ あれば それを表す文字列 / なければ 空~文字列 ] ◎ whose message is a string containing any details the user agent is able to supply about the cause of the error condition, or the empty string if the user agent is unable to supply such details.\

    この文字列は、 %~code を介してすでに可用な情報を超えるものがない場合は,空~文字列になるモノトスル — 例えば、 単純に~codeを文字列に翻訳した結果にはしないモノトスル。 ◎ This message string must not contain only the information already available via the supplied error code; for example, it must not simply be a translation of the code into a string format. If no additional information is available beyond that provided by the error code, the message must be set to the empty string.

`code@mE 取得子~手続きは ⇒ ~RET コレの`~code$ ◎ The code getter steps are to return this's code.
`message@mE 取得子~手続きは ⇒ ~RET コレの`~message$ ◎ The message getter steps are to return this's message.
4.8.11.2. ~media資源の所在

`~media要素$の `src@aM 内容~属性は、 利用者に示す~media資源(動画や音声)の`~URL$を与える。 指定する値は、 `前後~空白~可の妥当かつ空でない~URL$を包含しなければナラナイ。 ◎ The src content attribute on media elements gives the URL of the media resource (video, audio) to show. The attribute, if present, must contain a valid non-empty URL potentially surrounded by spaces.

`~media要素$が `itemprop$a 属性を有する場合、 `src$aM 属性も指定しなければナラナイ。 ◎ If the itemprop attribute is specified on the media element, then the src attribute must also be specified.

`~media要素$の `crossorigin@aM 内容~属性は`~CORS設定群~属性$である。 ◎ The crossorigin content attribute on media elements is a CORS settings attribute.

`~media要素$ %要素 の `src$aM 属性に対しては、 ~UAは: ◎ ↓

  • %要素 の作成-時に, %要素 は `src$aM 属性を有していた場合、 `即時$に次を呼出すモノトスル ⇒ %要素 の`資源~選定~algo$ ◎ If a media element is created with a src attribute, the user agent must immediately invoke the media element's resource selection algorithm.
  • %要素 の `src$aM 属性が[ 設定-/変更- ]されたときは、 次を呼出すモノトスル ⇒ `~media要素~読込n~algo$( %要素 ) ◎ If a src attribute of a media element is set or changed, the user agent must invoke the media element's media element load algorithm.\

    ( `src$aM 属性が`除去された^emときは、 これは行わない — 子に `source$e 要素が在っても。) ◎ (Removing the src attribute does not do this, even if there are source elements present.)

`src@mM ~IDL属性は、 `src$aM 内容~属性を`反映する$モノトスル。 ◎ The src IDL attribute on media elements must reflect the content attribute of the same name.

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

`~media提供元~obj@ は、 `~URL$とは別々に`~media資源$を表現できる~objである。 [ `MediaStream$I / `MediaSource$I / `Blob$I ]~objは、 `~media提供元~obj$である。 ◎ A media provider object is an object that can represent a media resource, separate from a URL. MediaStream objects, MediaSource objects, and Blob objects are all media provider objects.

各`~media要素$に `アテガわれている~media提供元~obj@ は、 要素にアテガわれ得る`~media提供元~obj$であり,なければ ε とする。 `~media要素$の作成-時には ε とする。 ◎ Each media element can have an assigned media provider object, which is a media provider object. When a media element is created, it has no assigned media provider object.

%media.`srcObject$mM [ = %source ]
`~media要素$に`~media提供元~obj$をアテガえるようにする。 ◎ Allows the media element to be assigned a media provider object.
%media.`currentSrc$mM
[[ 現在の`~media資源$はある ]~AND[ その`~URL$はある ]ならば それ / ~ELSE_ 空~文字列 ]を返す。 ◎ Returns the URL of the current media resource, if any. ◎ Returns the empty string when there is no media resource, or it doesn't have a URL.

`currentSrc@mM ~IDL属性は、 初期~時には空~文字列になるモノトスル。 その値は、 下に定義される`資源~選定~algo$により変更される。 ◎ The currentSrc IDL attribute must initially be set to the empty string. Its value is changed by the resource selection algorithm defined below.

`srcObject@mM 取得子~手続きは ⇒ ~RET [ コレに`アテガわれている~media提供元~obj$ ~NEQ ε ならば それ / ~ELSE_ ~NULL ] ◎ The srcObject IDL attribute, on getting, must return the element's assigned media provider object, if any, or null otherwise.\

`srcObject$mM 設定子~手続きは: ◎ On setting,\

  1. コレに`アテガわれている~media提供元~obj$ ~SET 所与の値 ◎ it must set the element's assigned media provider object to the new value, and then\
  2. `~media要素~読込n~algo$( コレ ) ◎ invoke the element's media element load algorithm.

注記: `~media資源$を指定する仕方には、 ~~優先される順に[ `srcObject$mM ~IDL属性, `src$aM 内容~属性, `source$e 要素 ]がある。 ◎ There are three ways to specify a media resource: the srcObject IDL attribute, the src content attribute, and source elements. The IDL attribute takes priority, followed by the content attribute, followed by the elements.

4.8.11.3. ~MIME型

`~media資源$は、 その`型^em — 特定的には、 `~MIME型$, および 事例によっては ~codecs ~parameter — を通して記述され得る。 ( ~codecs ~parameterが許容されるかどうかは、 ~MIME型に依存する。) `RFC6381$r ◎ A media resource can be described in terms of its type, specifically a MIME type, in some cases with a codecs parameter. (Whether the codecs parameter is allowed or not depends on the MIME type.) [RFC6381]

型は、 通例的にはいくぶん不完全な記述である。 例えば `video/mpeg^l は、 容器の型が何であるかを除き,何も言わない。 `video/mp4; codecs="avc1.42E01E, mp4a.40.2"^l の様な型でも,実際の~bitrateの様な情報は含まない (含むのは最大~bitrateのみ)。 したがって~UAは、 所与の型に対し その型の~mediaが再生-可能かどうかについては,[ (様々な確度で)`できるかもしれない^emか,確定的に`できない^emか ]しか知り得ないことが多い。 ◎ Types are usually somewhat incomplete descriptions; for example "video/mpeg" doesn't say anything except what the container type is, and even a type like "video/mp4; codecs="avc1.42E01E, mp4a.40.2"" doesn't include information like the actual bitrate (only the maximum bitrate). Thus, given a type, a user agent can often only know whether it might be able to play media of that type (with varying levels of confidence), or whether it definitely cannot play media of that type.

~UAが資源を確定的に~supportしない型は、 `~UAが具現化できないと知る型@ とされる — 例えば、 認識できない容器~型や,~supportしない~codecが挙げられている型など。 ◎ A type that the user agent knows it cannot render is one that describes a resource that the user agent definitely does not support, for example because it doesn't recognize the container type, or it doesn't support the listed codecs.

~parameterを伴わない`~MIME型$ `application/octet-stream$mt は、 常に`~UAが具現化できないと知る型$になる。 `~media資源$になり得るものに この型が付与されているときは、[ 明示的な`~Content-Type~metadata$ ]を欠くものと等価に扱うモノトスル。 ◎ The MIME type "application/octet-stream" with no parameters is never a type that the user agent knows it cannot render. User agents must treat that type as equivalent to the lack of any explicit Content-Type metadata when it is used to label a potential media resource.

注記: ここでは、 ~parameterを伴わない `~MIME型$ `application/octet-stream$mt のみが特別に扱われる — ~parameterが現れる場合、 他の`~MIME型$と同様に扱われることになる。 これは、[ 未知な `~MIME型$ ~parameterは無視されるベキである ]とする規則からの逸脱である。 ◎ Only the MIME type "application/octet-stream" with no parameters is special-cased here; if any parameter appears with it, it will be treated just like any other MIME type. This is a deviation from the rule that unknown MIME type parameters should be ignored.

%media.`canPlayType(type)$mM
~UAが所与の型の~media資源を再生できる確度に基づいて,[ 空~文字列(否定的~応答), `maybe^l, `probably^l ]のいずれかを返す。 ◎ Returns the empty string (a negative response), "maybe", or "probably" based on how confident the user agent is that it can play media resources of the given type.

`canPlayType(type)@mM ~method~手続きは: ◎ The canPlayType(type) method must return\

  1. ~IF[ %type は`~UAが具現化できないと知る型$である ]~OR[ %型 ~EQ `application/octet-stream$mt ] ⇒ ~RET `空~文字列@cP ◎ the empty string if type is a type that the user agent knows it cannot render or is the type "application/octet-stream";\
  2. ~IF[ ~UAは、 %type が表現する`~media資源$がコレに利用されたなら,~~十分な確度で具現化できる ] ⇒ ~RET `probably@l ◎ it must return "probably" if the user agent is confident that the type represents a media resource that it can render if used in with this audio or video element; and\
  3. ~RET `maybe@l ◎ it must return "maybe" otherwise.\

実装者には、 %type を~supportしないか~supportする~~十分な確度がない限り, `maybe$l を返すことが奨励される。 一般に,~UAは、 ~codecs ~parameterを許容する型に対しては,その~parameterが無い場合は 決して `probably$l を返すベキでない。 ◎ Implementers are encouraged to return "maybe" unless the type can be confidently established as being supported or not. Generally, a user agent should never return "probably" for a type that allows the codecs parameter if that parameter is not present.

次の~scriptは、[ ~UAは(架空の)新たな形式を~supportするか否か ]を~testして,[ `video$e 要素を利用するかどうか ]を動的に裁定する: ◎ This script tests to see if the user agent supports a (fictional) new format to dynamically decide whether to use a video element:

`mime-types-1^xCode

注記: `source$e 要素の `type$aS 属性を用いれば、 ~UAが具現化できない形式を利用している資源に対しては,~downloadを避けれるようになる。 ◎ The type attribute of the source element allows the user agent to avoid downloading resources that use formats it cannot render.

4.8.11.4. ~network状態
%media.`networkState$mM
要素~用の~network活動についての現在の状態を,下に挙げるいずれかの~codeとして返す。 ◎ Returns the current state of network activity for the element, from the codes in the list below.

`~media要素$は、 ~networkとヤリトリする。 その現在の~network活動は `networkState$mM 属性で表現される。 ◎ As media elements interact with the network, their current network activity is represented by the networkState attribute.\

`networkState@mM 取得子は、 コレの現在の~network状態を,次のいずれか値として返す: ◎ On getting, it must return the current network state of the element, which must be one of the following values:

`NETWORK_EMPTY@mM (数-値 0 )
コレはまだ初期化されていない。 すべての属性は、 それぞれの初期~状態にある。 ◎ The element has not yet been initialized. All attributes are in their initial states.
`NETWORK_IDLE@mM (数-値 1 )
コレの`資源~選定~algo$は作動中にあり,`~media資源$を選択したが、 現時点では,実際には~networkを利用していない。 ◎ The element's resource selection algorithm is active and has selected a resource, but it is not actually using the network at this time.
`NETWORK_LOADING@mM (数-値 2 )
~UAは能動的に~dataを~downloadしようと試行している。 ◎ The user agent is actively trying to download data.
`NETWORK_NO_SOURCE@mM (数-値 3 )
コレの`資源~選定~algo$は作動中にあるが、 利用する`~media資源$はまだ見出されてない。 ◎ The element's resource selection algorithm is active, but it has not yet found a resource to use.

`networkState$mM 属性の値がいつ変化するか,および どの~eventを発火して その状態~変化を指示するかは、 下に定義される`資源~選定~algo$にて正確に述べる。 ◎ The resource selection algorithm defined below describes exactly when the networkState attribute changes value and what events fire to indicate changes in this state.

4.8.11.5. ~media資源の読込n法
%media.`load()$mM
この`~media要素$を設定し直して、 白紙状態から,新たな`~media資源$を選択して読込nを開始させる。 ◎ Causes the element to reset and start selecting and loading a new media resource from scratch.
`load()@mM ~method~手続きは ⇒ `~media要素~読込n~algo$( コレ )

各`~media要素$は、 次に挙げるものを有する:

  • `自動再生~可能か@ ⇒ 真偽値 — 初期~時は ~T とする。
  • `~load~event遅延-中か@ ⇒ 真偽値 — 初期~時は ~F とする。

    ~T をとる間は、 当の要素は,その文書の`~load~eventを遅延する$モノトスル ( ~T から ~F に変化したときは、 要素は`~load~eventを遅延する$のをやめることになる。 ~F から ~T に変化したときは、 まだ発火されていなければ,要素は`~load~eventを遅延する$ことになる)。

  • `現在~停滞-中か@ ⇒ 真偽値 — 初期~時は ~F とする。
◎ All media elements have a can autoplay flag, which must begin in the true state, and a delaying-the-load-event flag, which must begin in the false state. While the delaying-the-load-event flag is true, the element must delay the load event of its document. ◎ When the load() method on a media element is invoked, the user agent must run the media element load algorithm. ◎ A media element has an associated boolean is currently stalled, which is initially false.

`~media要素~読込n~algo@ は、 所与の ( `~media要素$ %要素 ) に対し,次を走らす: ◎ The media element load algorithm consists of the following steps.

  1. %要素 の`現在~停滞-中か$ ~SET ~F ◎ Set this element's is currently stalled to false.
  2. %要素 用にすでに走らせている`資源~選定~algo$の~instanceがあれば,それを中止する ◎ Abort any already-running instance of the resource selection algorithm for this element.
  3. %処理待ち~taskたち ~LET[ ある`~task~queue$内の, %要素 の`~media要素~event~task~source$から~queueされた`~task$ ]すべてからなる,~queueされた順による~list ◎ Let pending tasks be a list of all tasks from the media element's media element event task source in one of the task queues. ◎ ↓
  4. %処理待ち~taskたち を成す ~EACH( %~task ) に対し ⇒ ~IF[ %~task は[[ `再生待ち~promiseたちを解決する$ / `再生待ち~promiseたちを却下する$ ]ものである ] ⇒ それらの~promiseたちを即時に[ 解決-/却下- ]する ◎ For each task in pending tasks that would resolve pending play promises or reject pending play promises, immediately resolve or reject those promises in the order the corresponding tasks were queued.
  5. %処理待ち~taskたち を成す ~EACH( %~task ) に対し ⇒ %~task をその`~task~queue$から除去する ◎ Remove each task in pending tasks from its task queue

    注記: 基本的に,~media要素が新たな資源の読込ngを開始したときは、 処理待ち~eventや~callbackは破棄され,[ 解決-/却下- ]待ちの~promiseたちは即時に[ 解決-/却下- ]される。 ◎ Basically, pending events and callbacks are discarded and promises in-flight to be resolved/rejected are resolved/rejected immediately when the media element starts loading a new resource.

  6. ~IF[ %要素 の `networkState$mM ~IN { `NETWORK_LOADING$mM, `NETWORK_IDLE$mM } ] ⇒ `~media~taskを~queueする$( %要素, 次の手続き ) ◎ If the media element's networkState is set to NETWORK_LOADING or NETWORK_IDLE, queue a media element task given the media element to\

    手続きは ⇒ `~eventを発火する$( %要素, `abort$et ) ◎ fire an event named abort at the media element.
  7. ~IF[ %要素 の`networkState$mM ~NEQ `NETWORK_EMPTY$mM ]: ◎ If the media element's networkState is not set to NETWORK_EMPTY, then:

    1. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ Queue a media element task given the media element to\

      手続きは ⇒ `~eventを発火する$( %要素, `emptied$et ) ◎ fire an event named emptied at the media element.
    2. ~IF[ %要素 用に進捗-中にある~fetchingがある ] ⇒ ~UAはそれを停止するベキである ◎ If a fetching process is in progress for the media element, the user agent should stop it.
    3. ~IF[ %要素 に`アテガわれている~media提供元~obj$は `MediaSource$I ~objである ] ⇒ それを`~detach$する ◎ If the media element's assigned media provider object is a MediaSource object, then detach it.
    4. `~media資源に特有な~trackを忘れる$( %要素 ) ◎ Forget the media element's media-resource-specific tracks.
    5. `readyState$mM ~SET `HAVE_NOTHING$mM ◎ If readyState is not set to HAVE_NOTHING, then set it to that state.
    6. ~IF[ %要素 の `paused$mM 属性 ~EQ ~F ]: ◎ If the paused attribute is false, then:

      1. %要素 の `paused$mM 属性 ~SET ~T ◎ Set the paused attribute to true.
      2. `再生待ち~promiseたちを却下する$( %要素 の`再生待ち~promiseたちを取り出す$, `AbortError$E 例外 ) ◎ Take pending play promises and reject pending play promises with the result and an "AbortError" DOMException.
    7. ~IF[ `seeking$mM ~EQ ~T ] ⇒ `seeking$mM ~SET ~F ◎ If seeking is true, set it to false.
    8. %要素 の`現在の再生~位置$ ~SET 0 ◎ Set the current playback position to 0.
    9. %前~位置 ~LET %要素 の`公式的な再生~位置$ ◎ ↓
    10. %要素 の`公式的な再生~位置$ ~SET 0 ◎ Set the official playback position to 0.
    11. ~IF[ %前~位置 ~NEQ 0 ] ⇒ `~media~taskを~queueする$( %要素, 次の手続き ) ◎ If this changed the official playback position, then queue a media element task given the media element to\

      手続きは ⇒ `~eventを発火する$( %要素, `timeupdate$et ) ◎ fire an event named timeupdate at the media element.
    12. `時列線~offset$ ~SET `NaN^jv ◎ Set the timeline offset to Not-a-Number (NaN).
    13. %要素 の `duration$mM 属性 ~SET `NaN^jv ◎ Update the duration attribute to Not-a-Number (NaN).

      注記: ~UAは、 この段による時間長の変化に対しては, `durationchange$et ~eventを`発火しない@#durationChange$ことになる。 ◎ The user agent will not fire a durationchange event for this particular change of the duration.

  8. %要素 の `playbackRate$mM 属性 ~SET %要素 の `defaultPlaybackRate$mM 属性の値 ◎ Set the playbackRate attribute to the value of the defaultPlaybackRate attribute.
  9. %要素 の `error$mM 属性 ~SET ~NULL ◎ Set the error attribute to null\
  10. %要素 の `自動再生~可能か$ ~SET ~T ◎ and the can autoplay flag to true.
  11. %要素 の`資源~選定~algo$を呼出す ◎ Invoke the media element's resource selection algorithm.

    注記: 以前に %要素 用に再生していた`~media資源$があれば,この時点で停止する。 ◎ Playback of any previously playing media resource for this element stops.

`~media要素$ %要素 の `資源~選定~algo@ は、 次に従う — この~algoは:

  • 常に`~task$の一部として呼出され、 `並列的$に実行される。
  • いくつかの`同期区間$があり,`~event~loop$の仕組みと~~緊密にヤリトリする (同期区間は、 `~event~loop$~algoの一部として誘発される)。 同期区間は、 記号 ⌛ が付与された段で指示され (そのような段の中に入子にされた各~段も同期区間の一部を成す), “以降は `並列的$に継続する” と記された段に達した所で終える ( ~GOTO で終えるとは限らないことに注意)。
  • この~algoは、 通常通り ~RET する代わりに[ 自身, または それが呼出す`~media資源~fetch~algo$, または それにより~queueされる~task ]により中止されることもある。 そのような箇所は、 “資源~選定~algoを `中止-@ する” という句で指示される。 また、 一部の事例では,(~event~loopが滅するまで)永遠に走り続ける。 【! ある~taskがこの~algoを中止する前に~queueされた,別の未処理の~taskがどう取扱われるかは、はっきりしない】
◎ The resource selection algorithm for a media element is as follows. This algorithm is always invoked as part of a task, but one of the first steps in the algorithm is to return and continue running the remaining steps in parallel. In addition, this algorithm interacts closely with the event loop mechanism; in particular, it has synchronous sections (which are triggered as part of the event loop algorithm). Steps in such sections are marked with ⌛.
  1. %要素 の `networkState$mM 属性 ~SET `NETWORK_NO_SOURCE$mM ◎ Set the element's networkState attribute to the NETWORK_NO_SOURCE value.
  2. %要素 の`~posterを示すか$ ~SET ~T ◎ Set the element's show poster flag to true.
  3. %要素 の`~load~event遅延-中か$ ~SET ~T ◎ Set the media element's delaying-the-load-event flag to true (this delays the load event).
  4. 以降の記号 ⌛ が付与された段を`同期区間$として、 `安定~状態を待受ける$: ◎ Await a stable state, allowing the task that invoked this algorithm to continue. The synchronous section consists of all the remaining steps of this algorithm until the algorithm says the synchronous section has ended. (Steps in synchronous sections are marked with ⌛.)

    1. ⌛ ~IF[ %要素 の`構文解析器にて阻まれているか$ ~EQ ~F ] ⇒ `処理待ち~tT~listを拡充する$ ◎ ⌛ If the media element's blocked-on-parser flag is false, then populate the list of pending text tracks.
    2. ⌛ %GOTO~label ~LET ε ◎ ↓
    3. ⌛ ~IF[ %要素 に`アテガわれている~media提供元~obj$ ~NEQ ε ] ⇒ %GOTO~label ~SET `~obj^i ◎ ⌛ If the media element has an assigned media provider object, then let mode be object.
    4. ⌛ ~ELIF[ %要素 は `src$aM 属性を有する ] ⇒ %GOTO~label ~SET `属性^i ◎ ⌛ Otherwise, if the media element has no assigned media provider object but has a src attribute, then let mode be attribute.
    5. ⌛ ~ELIF[ %要素 の子である `source$e 要素はある ] ⇒ %GOTO~label ~SET `子たち^i ◎ ⌛ Otherwise, if the media element does not have an assigned media provider object and does not have a src attribute, but does have a source element child, then let mode be children and let candidate be the first such source element child in tree order.
    6. ⌛ ~ELSE: ◎ ⌛ Otherwise the media element has no assigned media provider object and has neither a src attribute nor a source element child:

      1. %要素 の `networkState$mM ~SET `NETWORK_EMPTY$mM ◎ ⌛ Set the networkState to NETWORK_EMPTY.
      2. %要素 の`~load~event遅延-中か$ ~SET ~F ◎ ⌛ Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
      3. 以降は `並列的$に継続する ◎ End the synchronous section\
      4. ~RET ◎ and return.
    7. ⌛ %要素 の`networkState$mM ~SET `NETWORK_LOADING$mM ◎ ⌛ Set the media element's networkState to NETWORK_LOADING.
    8. ⌛ `~media~taskを~queueする$( %要素, 次の手続き ) ◎ ⌛ Queue a media element task given the media element to\

      手続きは ⇒ `~eventを発火する$( %要素, `loadstart$et ) ◎ fire an event named loadstart at the media element.
    9. ⌛ ~GOTO %GOTO~label ◎ Run the appropriate steps from the following list:
  5. `~obj^i: ◎ If mode is object

    1. ⌛ %要素 の `currentSrc$mM 属性 ~SET 空~文字列 ◎ ⌛ Set the currentSrc attribute to the empty string.
    2. 以降は `並列的$に継続する ◎ End the synchronous section, continuing the remaining steps in parallel.
    3. `~media資源~fetch~algo$( %要素, %要素 に`アテガわれている~media提供元~obj$ ) ◎ Run the resource fetch algorithm with the assigned media provider object. If that algorithm returns without aborting this one, then the load failed.
    4. ~GOTO `失敗^i ◎ ↓↓Failed with media provider: Reaching this step indicates that the media resource failed to load. Take pending play promises and queue a media element task given the media element to run the dedicated media source failure steps with the result. ◎ Wait for the task queued by the previous step to have executed. ◎ Return. The element won't attempt to load another resource until this algorithm is triggered again.
  6. `属性^i: ◎ If mode is attribute

    1. ⌛ %~URL ~LET `失敗^i ◎ ↓
    2. ⌛ %src ~LET %要素 の `src$aM 属性の値 ◎ ↓
    3. ⌛ ~IF[ %src ~NEQ 空~文字列 ] ⇒ %~URL ~SET %要素 の `src$aM 属性が最後に変化した時点において,次を遂行したとするときの結果† ⇒ `~URLを符号化法の下で相対的に構文解析する$( %src, %要素 の`~node文書$ )

      【† すなわち、 変化した後における `base$e 要素に対する変更は影響しない。 】

      ◎ ⌛ If the src attribute's value is the empty string, then end the synchronous section, and jump down to the failed with attribute step below. ◎ ⌛ Let urlRecord be the result of encoding-parsing a URL given the src attribute's value, relative to the media element's node document when the src attribute was last changed.
    4. ⌛ ~IF[ %~URL ~NEQ `失敗^i ] ⇒ %要素 の `currentSrc$mM 属性 ~SET `~URLを直列化する$( %~URL ) ◎ ⌛ If urlRecord is not failure, then set the currentSrc attribute to the result of applying the URL serializer to urlRecord.
    5. 以降は `並列的$に継続する ◎ End the synchronous section, continuing the remaining steps in parallel.
    6. ~IF[ %~URL ~NEQ `失敗^i ] ⇒ `~media資源~fetch~algo$( %要素, %~URL ) ◎ If urlRecord is not failure, then run the resource fetch algorithm with urlRecord.\
    7. ~GOTO `失敗^i ◎ If that algorithm returns without aborting this one, then the load failed. ◎ ↓
  7. `失敗^i : ◎ Failed with attribute:\

    1. ~Assert: この`資源~選定~algo$は`中止-$されていない (~media資源の読込nに失敗したか,`~media資源~fetch~algo$は呼出されなかった) ◎ Reaching this step indicates that the media resource failed to load or that urlRecord is failure.\
    2. %~promise~list ~LET %要素 の`再生待ち~promiseたちを取り出す$ ◎ Take pending play promises and\
    3. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ queue a media element task given the media element to\

      手続きは ⇒ `専用の~media~source失敗~手続き$( %要素, %~promise~list) ◎ run the dedicated media source failure steps with the result.
    4. 前~段により~queueされた`~task$が実行し終えるまで待機する ◎ Wait for the task queued by the previous step to have executed.
    5. ~RET — %要素 は、 この~algoが再び誘発されるまで,別の資源を読込もうと試みないことになる。 ◎ Return. The element won't attempt to load another resource until this algorithm is triggered again.
  8. `子たち^i: ◎ Otherwise (mode is children)

    1. ⌛ %~pointer ~LET ~NULL ( “仮想の先頭” を表す) — この~pointerは:

      • ~NULL でないときは、 %要素 のある子~nodeを保持する。
      • この手続きが走っている間に %~pointer ( ~NEQ ~NULL )が %要素 の子でなくなったときは、 %~pointer は,子でなくなる直前における %~pointer の`直前の同胞?$に更新されるとする ( ~NULL にもなり得る)。
      • 以下における, %~pointer の `直後の同胞^i は、[ %~pointer ~NEQ ~NULL ならば %~pointer の`直後の同胞?$ / ~ELSE_ %要素 の`最初の子?$ ]を指すとする( ~NULL にもなり得る)。
      • 以下において, “次の候補を得る” と記された所では、 次の手続きを走らせた結果に評価されるとする:

        1. ~WHILE[ %~pointer の`直後の同胞^i ~NEQ ~NULL ]:

          1. %~pointer ~SET %~pointer の`直後の同胞^i
          2. ~IF[ %~pointer は `source$e 要素である ] ⇒ ~RET %~pointer
        2. ~RET ε
      ◎ ⌛ Let pointer be a position defined by two adjacent nodes in the media element's child list, treating the start of the list (before the first child in the list, if any) and end of the list (after the last child in the list, if any) as nodes in their own right. One node is the node before pointer, and the other node is the node after pointer. Initially, let pointer be the position between the candidate node and the next node, if there are any, or the end of the list, if it is the last node. ◎ As nodes are inserted and removed into the media element, pointer must be updated as follows: ◎ If a new node is inserted between the two nodes that define pointer ◎ • Let pointer be the point between the node before pointer and the new node. In other words, insertions at pointer go after pointer. ◎ If the node before pointer is removed • Let pointer be the point between the node after pointer and the node before the node after pointer. In other words, pointer doesn't move relative to the remaining nodes. ◎ If the node after pointer is removed • Let pointer be the point between the node before pointer and the node after the node before pointer. Just as with the previous case, pointer doesn't move relative to the remaining nodes. ◎ Other changes don't affect pointer.
    2. ⌛ %候補 ~LET 次の候補を得る ◎ ↑↑
    3. ⌛ `候補を処理する^i ⇒ %~URL ~LET 次の手続きを走らせた結果

      手続きは:

      1. %src ~LET [ %候補 は `src$aM 属性を有するならば その値 / ~ELSE_ ε ]
      2. ~IF[ %src ~IN { ε, 空~文字列 } ] ⇒ ~RET `失敗^i
      3. ~IF[ %候補 は `media$aS 属性を有する ]~AND[ その値は`環境に合致して$いない ] ⇒ ~RET `失敗^i
      4. ~IF[ %候補 は `type$aS 属性を有する ]~AND[ その値を`~MIME型$として( ~codecs ~parameterがあれば,それも織り込んだ上で)構文解析した結果は,`~UAが具現化できないと知る型$を表現する ] ⇒ ~RET `失敗^i
      5. ~RET %要素 の `src$aM 属性が最後に変化した時点において,次を遂行したとするときの結果† ⇒ `~URLを符号化法の下で相対的に構文解析する$( %src, %候補 の`~node文書$ )

        【† すなわち、 変化した後における `base$e 要素に対する変更は影響しない。 】

      ◎ ⌛ Process candidate: If candidate does not have a src attribute, or if its src attribute's value is the empty string, then end the synchronous section, and jump down to the failed with elements step below. ◎ ⌛ If candidate has a media attribute whose value does not match the environment, then end the synchronous section, and jump down to the failed with elements step below. ◎ ⌛ Let urlRecord be the result of encoding-parsing a URL given candidate's src attribute's value, relative to candidate's node document when the src attribute was last changed. ◎ ⌛ If urlRecord is failure, then end the synchronous section, and jump down to the failed with elements step below. ◎ ⌛ If candidate has a type attribute whose value, when parsed as a MIME type (including any codecs described by the codecs parameter, for types that define that parameter), represents a type that the user agent knows it cannot render, then end the synchronous section, and jump down to the failed with elements step below.
    4. ⌛ ~IF[ %~URL ~NEQ `失敗^i ] ⇒ %要素 の `currentSrc$mM 属性 ~SET `~URLを直列化する$( %~URL ) ◎ ⌛ Set the currentSrc attribute to the result of applying the URL serializer to urlRecord.
    5. 以降は `並列的$に継続する ◎ End the synchronous section, continuing the remaining steps in parallel.
    6. ~IF[ %~URL ~NEQ `失敗^i ]:

      1. `~media資源~fetch~algo$( %要素, %~URL )
      2. ~Assert:この`資源~選定~algo$は`中止-$されていない
      ◎ Run the resource fetch algorithm with urlRecord. If that algorithm returns without aborting this one, then the load failed.
    7. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ Failed with elements: Queue a media element task given the media element to\

      手続きは ⇒ `~eventを発火する$( %候補, `~errorS$et ) ◎ fire an event named error at candidate.
    8. 以降を`同期区間$として,`安定~状態を待受ける$ ◎ Await a stable state. The synchronous section consists of all the remaining steps of this algorithm until the algorithm says the synchronous section has ended. (Steps in synchronous sections are marked with ⌛.)
    9. ⌛ `~media資源に特有な~trackを忘れる$( %要素 ) ◎ ⌛ Forget the media element's media-resource-specific tracks.
    10. ⌛ `次の候補を見出す^i ⇒ %候補 ~SET 次の候補を得る ◎ ⌛ Find next candidate: Let candidate be null. ◎ ⌛ Search loop: If the node after pointer is the end of the list, then jump to the waiting step below. ◎ ⌛ If the node after pointer is a source element, let candidate be that element. ◎ ⌛ Advance pointer so that the node before pointer is now the node that was after pointer, and the node after pointer is the node after the node that used to be after pointer, if any. ◎ ⌛ If candidate is null, jump back to the search loop step. Otherwise, jump back to the process candidate step.
    11. ⌛ ~IF[ %候補 ~NEQ ε ] ⇒ ~GOTO `候補を処理する^i ◎ ↑
    12. ⌛ %要素 の`networkState$mM 属性 ~SET `NETWORK_NO_SOURCE$mM ◎ ⌛ Waiting: Set the element's networkState attribute to the NETWORK_NO_SOURCE value.
    13. ⌛ %要素 の`~posterを示すか$ ~SET ~T ◎ ⌛ Set the element's show poster flag to true.
    14. ⌛ `~media~taskを~queueする$( %要素, 次の手続き ) ◎ ⌛ Queue a media element task given the media element to\

      手続きは ⇒ %要素 の`~load~event遅延-中か$ ~SET ~F ◎ set the element's delaying-the-load-event flag to false. This stops delaying the load event.
    15. 以降は `並列的$に継続する ◎ End the synchronous section, continuing the remaining steps in parallel.
    16. [ %~pointer の`直後の同胞^i ~NEQ ~NULL ]になるまで待機する (この段は永遠に待機するかもしれない) ◎ Wait until the node after pointer is a node other than the end of the list. (This step might wait forever.)
    17. 以降を`同期区間$として,`安定~状態を待受ける$ ◎ Await a stable state. The synchronous section consists of all the remaining steps of this algorithm until the algorithm says the synchronous section has ended. (Steps in synchronous sections are marked with ⌛.)
    18. ⌛ %要素 の`~load~event遅延-中か$ ~SET ~T ◎ ⌛ Set the element's delaying-the-load-event flag back to true (this delays the load event again, in case it hasn't been fired yet).
    19. ⌛ `networkState$mM ~SET `NETWORK_LOADING$mM ◎ ⌛ Set the networkState back to NETWORK_LOADING.
    20. ⌛ ~GOTO `次の候補を見出す^i ◎ ⌛ Jump back to the find next candidate step above.

`専用の~media~source失敗~手続き@ は、 所与の ( `~media要素$ %要素, ~promise~list %~promise~list ) に対し,次を走らす: ◎ The dedicated media source failure steps with a list of promises promises are the following steps:

  1. %要素 の `error$mM 属性 ~SET `新たな~MediaError$( `MEDIA_ERR_SRC_NOT_SUPPORTED$mE ) ◎ Set the error attribute to the result of creating a MediaError with MEDIA_ERR_SRC_NOT_SUPPORTED.
  2. `~media資源に特有な~trackを忘れる$( %要素 ) ◎ Forget the media element's media-resource-specific tracks.
  3. %要素 の `networkState$mM 属性 ~SET `NETWORK_NO_SOURCE$mM ◎ Set the element's networkState attribute to the NETWORK_NO_SOURCE value.
  4. %要素 の`~posterを示すか$ ~SET ~T ◎ Set the element's show poster flag to true.
  5. `~eventを発火する$( %要素, `~errorM$et ) ◎ Fire an event named error at the media element.
  6. `再生待ち~promiseたちを却下する$( %~promise~list, `NotSupportedError$E 例外 ) ◎ Reject pending play promises with promises and a "NotSupportedError" DOMException.
  7. %要素 の`~load~event遅延-中か$ ~SET ~F ◎ Set the element's delaying-the-load-event flag to false. This stops delaying the load event.

`~media資源を検証yする@ ときは、 所与の ( `応答$ %応答, `~media資源$ %資源, %~byte範囲 ) に対し: ◎ To verify a media response given a response response, a media resource resource,\

  1. ~Assert: %~byte範囲 は、 次に挙げるいずれかである ⇒# `資源~全体^i / ( 数, 数 ) からなる~tuple / ( 数, `終端まで^i ) からなる~tuple ◎ and "entire resource" or a (number, number or "until end") tuple byteRange:
  2. ~IF[ %応答 は`~network~error$である ] ⇒ ~RET ~F ◎ If response is a network error, then return false.
  3. ~IF[ %~byte範囲 ~EQ `資源~全体^i ] ⇒ ~RET ~T ◎ If byteRange is "entire resource", then return true.
  4. %内部~応答 ~LET %応答 の`安全でない応答$ ◎ Let internalResponse be response's unsafe response.
  5. ~IF[ %内部~応答 の`状態s$rs ~EQ `200^hst ] ⇒ ~RET ~T ◎ If internalResponse's status is 200, then return true.
  6. ~IF[ %内部~応答 の`状態s$rs ~NEQ `206^hst ] ⇒ ~RET ~F ◎ If internalResponse's status is not 206, then return false.
  7. ~IF[ %内部~応答 から`内容~範囲~値を抽出-$した結果 ~EQ `失敗^i ] ⇒ ~RET ~F ◎ If the result of extracting content-range values from internalResponse is failure, then return false.

    注記: 抽出された結果は利用されず、 特に, %~byte範囲 とは比較されないことに注意。 なので、 この段は, `Content-Range$h ~headerの構文上の検証としてしか~serveしない — [ 応答の `Content-Range$h 値, 要請の `Range$h 値 ]による範囲が合致しない場合でも,失敗とは見なされない。 ◎ Note that the extracted values are not used, and in particular are not compared to byteRange. So this step serves as syntactic validation of the `Content-Range` header, but if the `Content-Range` values on the response mismatch the `Range` values on the request, that is not considered a failure.

  8. %生成元 ~LET %内部~応答 の`~URL$rsに応じて ⇒# ~NULL ならば `rewritten^l / ~ELSE_ ~URLの`生成元$url ◎ Let origin be "rewritten" if internalResponse's URL is null; otherwise internalResponse's URL's origin.
  9. %前回の生成元 ~LET %資源 の`生成元$mR ◎ Let previousOrigin be resource's origin.
  10. ~IF[ ~OR↓ ]… ◎ If any of the following are true:

    • %前回の生成元 ~EQ `none^l ◎ previousOrigin is "none";
    • %生成元 ~EQ %前回の生成元 ~EQ `rewritten^l ◎ origin and previousOrigin are "rewritten"; or
    • [ %生成元, %前回の生成元 は どちらも`生成元$である ]~AND[ ( %生成元, %前回の生成元 ) は`同一-生成元$である ] ◎ origin and previousOrigin are origins, and origin is same origin with previousOrigin,

    …ならば ⇒ %資源 の`生成元$mR ~SET %生成元 ◎ then set resource's origin to origin.

  11. ~ELIF[ %応答 は`~CORS非同一-生成元$である ] ⇒ ~RET ~F ◎ Otherwise, if response is CORS-cross-origin, then return false.
  12. ~ELSE ⇒ %資源 の`生成元$mR ~SET `multiple^l ◎ Otherwise, set resource's origin to "multiple".

    注記: 上の ~IF 節を成す各~段は、 範囲~headerを伴う不透明な応答が[ 異なる生成元からの他の応答と一緒に接ぎ合されても,情報は漏洩されない ]ことを確保する。 ◎ This ensures that opaque responses with range headers do not leak information by being patched together with other responses from different origins.

  13. ~RET ~T ◎ Return true.

`~media資源~fetch~algo@ は、 所与の ( `~media要素$ %要素, [ `~URL$ / `~media提供元~obj$ ] %入力 ) に対し,次を走らす: ◎ The resource fetch algorithm for a media element and a given URL record or media provider object is as follows:

  1. ( %~URL, %~media提供元~obj, %現~media資源 ) ~LET ( ε, ~NULL, ε ) ◎ ↓
  2. %入力 に応じて:

    • `~media提供元~obj$である ⇒ %~media提供元~obj ~SET %入力
    • `~URL$である:

      1. %~URL ~SET %入力
      2. %~media提供元~obj ~SET %~URL の`~blob~URL~entry$url
      3. ~IF[ %~media提供元~obj は`~media提供元~obj$でない ] ⇒# %~media提供元~obj ~SET ~NULL; %現~media資源 ~SET %~URL から得られることになる資源
    ◎ If the algorithm was invoked with media provider object or a URL record whose blob URL entry is a blob URL entry whose object is a media provider object, then let mode be local. Otherwise let mode be remote. ◎ If mode is remote, then let the current media resource be the resource given by the URL record passed to this algorithm;\
  3. ~IF[ %~media提供元~obj ~NEQ ~NULL ] ⇒ %現~media資源 ~SET %~media提供元~obj が与える資源 ◎ otherwise, let the current media resource be the resource given by the media provider object.\
  4. %要素 の`~media資源$ ~SET %現~media資源 ◎ Either way, the current media resource is now the element's media resource.
  5. %要素 の`処理待ち~tT~list$から `~media資源に特有な~tT$をすべて除去する ◎ Remove all media-resource-specific text tracks from the media element's list of pending text tracks, if any.
  6. ~IF[ %~media提供元~obj ~EQ ~NULL ]: ◎ Run the appropriate steps from the following list: ◎ If mode is remote

    1. 任意選択で、 次の手続きを走らす — これは[ 利用者から明示的に要請されるまで,~UAは資源を~fetchしようと試みない ]ことを意図する場合に期待される挙動になる (例: `preload$aM 属性の `none$v ~keywordを実装する仕方として): ◎ Optionally, run the following substeps. This is the expected behavior if the user agent intends to not attempt to fetch the resource until the user requests it explicitly (e.g. as a way to implement the preload attribute's none keyword).

      1. %要素 の `networkState$mM ~SET `NETWORK_IDLE$mM ◎ Set the networkState to NETWORK_IDLE.
      2. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ Queue a media element task given the media element to\

        手続きは ⇒ `~eventを発火する$( %要素, `suspend$et ) ◎ fire an event named suspend at the element.
      3. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ Queue a media element task given the media element to\

        手続きは ⇒ %要素 の`~load~event遅延-中か$ ~SET ~F ◎ set the element's delaying-the-load-event flag to false. This stops delaying the load event.
      4. 前~段の~taskが走るまで待機する ◎ Wait for the task to be run.
      5. `実装定義$な~eventを待機する (例:利用者は %要素 の再生を始めるよう要請している。) ◎ Wait for an implementation-defined event (e.g., the user requesting that the media element begin playback).
      6. %要素 の`~load~event遅延-中か$ ~SET ~T ◎ Set the element's delaying-the-load-event flag back to true (this delays the load event again, in case it hasn't been fired yet).
      7. %要素 の `networkState$mM ~SET `NETWORK_LOADING$mM ◎ Set the networkState to NETWORK_LOADING.
    2. %行先 ~LET %要素 に応じて ⇒# `audio$e 要素であるならば `audio^l / `video$e 要素であるならば `video^l ◎ Let destination be "audio" if the media element is an audio element, or "video" otherwise.
    3. %要請 ~LET `~CORSになり得る要請を作成する$( %~URL, %行先, %要素 の`crossorigin$aM【!#attr-script-crossorigin】 内容~属性の現在の状態 ) ◎ Let request be the result of creating a potential-CORS request given current media resource's URL record, destination, and the current state of media element's crossorigin content attribute.
    4. %要請 の ⇒# `~client$rq ~SET %要素 の`~node文書$に`関連な設定群~obj$, `起動元~種別$rq ~SET %行先 ◎ Set request's client to the media element's node document's relevant settings object. ◎ Set request's initiator type to destination.
    5. %~byte範囲 ~LET [ `~media~data$内の欠落~data ]を満足するために要求される~byte範囲 — 次に挙げるいずれかの値をとる:

      • `資源~全体^i ⇒ 当の資源を全部的に~fetchする。
      • ~tuple ( 数, `終端まで^i ) ⇒ ある~byte~offsetから終端までを~fetchする。
      • ~tuple ( 数, 数 ) ⇒ 2 つの~byte~offsetの合間を成す範囲を~fetchする。

      どれをとるかは`実装定義$であり,[ ~codec/~network条件/他の経験則 ]に依拠し得るが、 ~UAは,上に挙げた どれを行うものと決定してもヨイ。

      ◎ Let byteRange, which is "entire resource" or a (number, number or "until end") tuple, be the byte range required to satisfy missing data in media data. This value is implementation-defined and may rely on codec, network conditions or other heuristics. The user-agent may determine to fetch the resource in full, in which case byteRange would be "entire resource", to fetch from a byte offset until the end, in which case byteRange would be (number, "until end"), or to fetch a range between two byte offsets, im which case byteRange would be a (number, number) tuple representing the two offsets.
    6. ~IF[ %~byte範囲 ~NEQ `資源~全体^i ]: ◎ If byteRange is not "entire resource", then:

      1. ~IF[ %~byte範囲[ 1 ] ~EQ `終端まで^i ] ⇒ `範囲~headerを追加する$( %要請, %~byte範囲[ 0 ] ) ◎ If byteRange[1] is "until end" then add a range header to request given byteRange[0].
      2. ~ELSE ⇒ `範囲~headerを追加する$( %要請, %~byte範囲[ 0 ], %~byte範囲[ 1 ] ) ◎ Otherwise, add a range header to request given byteRange[0] and byteRange[1].
    7. %要請 を`~fetchする$ — 次を与える下で: ◎ Fetch request, with\

      • `応答の処理n$i ~SET 所与の ( `応答$ %応答 ) に対し,次を走らす手続き: ◎ processResponse set to the following steps given response response:

        1. %大域~obj ~LET %要素 の`~node文書$に`関連な大域~obj$ ◎ Let global be the media element's node document's relevant global object.
        2. %~mediaを更新する ~LET 次を走らす手続き ⇒ `~media~taskを~queueする$( %要素, 次の手続き ) ◎ Let updateMedia be to queue a media element task given the media element to\

          手続きは ⇒ 下に与える`~media~data処理~手続き~list$を走らす ◎ run the first appropriate steps from the media data processing steps list below.\

          (このためには、 新たな~taskが利用される — 下に述べる作業が、 `~network用~task~source$を利用せずに, 適切な`~media要素~event~task~source$から生じるようにするため。) ◎ (A new task is used for this so that the work described below occurs relative to the appropriate media element event task source rather than using the networking task source.)

        3. %~media終了~時の処理n ~LET 次を走らす手続き: ◎ Let processEndOfMedia be the following step:\

          1. ~IF[ 当の~fetchingは — ~media~dataの復号-時も含めて — ~errorを伴わずに完了した ]~AND[ すべての~dataは、 ~network~accessを伴わずに~UAに可用である ] ⇒ この`資源~選定~algo$を`中止-$する 【!move on to the final step below】 ◎ If the fetching process has completes without errors, including decoding the media data, and if all of the data is available to the user agent without network access, then, the user agent must move on to the final step below.\

            これは、 決して起こらないかもしれない — 例 ⇒# ~web~radioなどの無限な資源を~streamしているとき / 資源は ~UAが~dataを~cacheする能より長い場合 ◎ This might never happen, e.g. when streaming an infinite resource such as web radio, or if the resource is longer than the user agent's ability to cache data.

        4. ~IF[ `~media資源を検証yする$( %応答, %現在の~media資源, %~byte範囲 ) の結果 ~EQ ~F ] ⇒ ~RET ◎ If the result of verifying response given the current media resource and byteRange is false, then abort these steps.
        5. 【!~ELSE】 `本体を増分的に読取る$( ↓ ) ⇒# %応答 の`本体$rs, %~mediaを更新する, %~media終了~時の処理n, 何もしない~algo, %大域~obj ◎ Otherwise, incrementally read response's body given updateMedia, processEndOfMedia, an empty algorithm, and global.
        6. この流儀で得された %応答 の`安全でない応答$の内容で`~media~data$を更新する。 ◎ Update the media data with the contents of response's unsafe response obtained in this fashion.\

          %応答 は、[ `~CORS同一-生成元$, `~CORS非同一-生成元$ ]どちらにもなり得る — それに応じて、 次に影響する: ◎ response can be CORS-same-origin or CORS-cross-origin; this affects\

          • `~media~data$内で参照された字幕は~APIに公開されるかどうか。 ◎ whether subtitles referenced in the media data are exposed in the API and,\
          • `video$e 要素に対しては、 当の動画が `canvas$e 上に描かれるとき,その `canvas^e は~taintedになるかどうか。 ◎ for video elements, whether acanvas gets tainted when the video is drawn on it.

      `~media要素の停滞-制限時間@ は、 `実装定義$な長さの時間であり,およそ 3 秒にするベキである。 ◎ The media element stall timeout is an implementation-defined length of time, which should be about three seconds.\

      所与の時点で %要素 が`~media~data$を得しようと能動的に試みていて,その時点からこの制限時間~内に~dataを受信するのに失敗した場合、 次を行うモノトスル ⇒ `~media~taskを~queueする$( %要素, 次の手続き ) ◎ When a media element that is actively attempting to obtain media data has failed to receive any data for a duration equal to the media element stall timeout, the user agent must queue a media element task given the media element\

      手続きは: ◎ to:

      1. `~eventを発火する$( %要素, `stalled$et ) ◎ fire an event named stalled at the element.
      2. %要素 の`現在~停滞-中か$ ~SET ~T ◎ Set the element's is currently stalled to true.

      ~UAは、 利用者が`~media~data$の~downloadを[ 選択的に阻む/低速にする ]ことを許容してヨイ: ◎ User agents may allow users to selectively block or slow media data downloads.\

      • %要素 の~downloadがまるごと阻まれたときは ⇒ ~UAは,それが停滞したかのように動作するモノトスル (接続が~closeされたかのように動作するのではなく)。 ◎ When a media element's download has been blocked altogether, the user agent must act as if it was stalled (as opposed to acting as if the connection was closed).\
      • ~UAは、 ~downloadの~rateを自動的に減速してもヨイ — 例えば、 同じ帯域幅を共有している他の接続との兼ね合いで。 ◎ The rate of the download may also be throttled automatically by the user agent, e.g. to balance the download with other connections sharing the same bandwidth.

      ~UAは、 いつでも,資源の~downloadを休止するものと裁定してヨイ — 例えば,次のいずれかに該当するときなど: ◎ User agents may decide to not download more content at any time, e.g.\

      • 1 ~~時間の~media資源を 5 分だけ~bufferした後,利用者が資源を再生するかどうか裁定するのを待機している間 【下の注記も見よ】 ◎ after buffering five minutes of a one hour media resource, while waiting for the user to decide whether to play the resource or not,\
      • 対話的な資源に対し,利用者が入力するまで待機している間 ◎ while waiting for user input in an interactive resource, or\
      • 利用者が~pageから~navigateして離れたとき ◎ when the user navigates away from the page.\

      資源の~downloadを休止する場合、 ~UAは,次に従うモノトスル: ◎ \

      • 休止-時には ⇒ `~media~taskを~queueする$( %要素, 次の手続き ) ◎ When a media element's download has been suspended, the user agent must queue a media element task given the media element to\

        手続きは:

        1. %要素 の `networkState$mM 属性 ~SET `NETWORK_IDLE$mM
        2. `~eventを発火する$( %要素, `suspend$et )
        ◎ set the networkState to NETWORK_IDLE and fire an event named suspend at the element.\
      • 再開-時には ⇒ `~media~taskを~queueする$( %要素, 次の手続き ) ◎ If and when downloading of the resource resumes, the user agent must queue a media element task given the media element to\

        手続きは ⇒ %要素 の `networkState$mM 属性 ~SET `NETWORK_LOADING$mM ◎ set the networkState to NETWORK_LOADING.\

      休止してから再開するまでの間(これらの~taskを~queueする合間)は、 読込nは休止される (なので、 上で述べたとおり, `progress$et ~eventは発火されない)。 ◎ Between the queuing of these tasks, the load is suspended (so progress events don't fire, as described above).

      注記: `autoplay$aM 属性が無い下でも、 `preload$aM 属性は,~buffer量に関して作者が~~適切と~~考えている~hintを供する。 ◎ The preload attribute provides a hint regarding how much buffering the author thinks is advisable, even in the absence of the autoplay attribute.

      ~UAは、 ~downloadを完全に休止するものと裁定した場合は — 例えば、 利用者から再生を開始するよう指示されるまで,以降の内容は~downloadせずに待機する場合 — 次を行うモノトスル ⇒ `~media~taskを~queueする$( %要素, 次の手続き )

      手続きは ⇒ %要素 の`~load~event遅延-中か$ ~SET ~F
      ◎ When a user agent decides to completely suspend a download, e.g., if it is waiting until the user starts playback before downloading any further content, the user agent must queue a media element task given the media element to set the element's delaying-the-load-event flag to false. This stops delaying the load event.

      上の手続きは,要請を発行するための~algoを与えるが、 ~UAは — とりわけ、 ~error条件に面したときには — ここに与える拘束に従う下で【!besides those exact ones】,他の手段を利用してもヨイ。 例えば、 ~serverへ接続し直しても,~streaming~protocolに切替えてもヨイ。 ~UAが[ 資源を~error含みと見なして,上の手続きの~error分岐の中へ続行する ]のは、 当の資源を~fetchしようと試行するのをあきらめた場合に限るモノトスル。 ◎ Although the above steps give an algorithm for issuing requests, the user agent may use other means besides those exact ones, especially in the face of error conditions. For example, the user agent may reconnect to the server or switch to a streaming protocol. The user agent must only consider the resource erroneous, and proceed into the error branches of the above steps, if the user agent has given up trying to fetch the resource.

      `~media資源$の形式を決定するときは、 ~UAは,`音声や動画を特定的に~sniffするための規則$を利用するモノトスル。 ◎ To determine the format of the media resource, the user agent must use the rules for sniffing audio and video specifically.

      読込nが休止されていない間は(下を見よ)、 ~UAは ⇒ [ 毎 350ms (±200ms)ごと / ~byteが受信される度 ]のうち,`低頻度^emの方で ⇒ `~media~taskを~queueする$( %要素, 次の手続き ) ◎ While the load is not suspended (see below), every 350ms (±200ms) or for every byte received, whichever is least frequent, queue a media element task given the media element\

      手続きは: ◎ to:

      1. `~eventを発火する$( 要素, `progress$et ) ◎ fire an event named progress at the element.
      2. %要素 の`現在~停滞-中か$ ~SET ~F ◎ Set the element's is currently stalled to false.

      ~UAは、[ `~media資源$の ある部分を得するためには,依然として~networkに~accessする必要があり得る間 ]は,この段に留まり続けるモノトスル。 ◎ While the user agent might still need network access to obtain parts of the media resource, the user agent must remain on this step.

      例えば,~UAは、 動画の前半を破棄した場合は,この段に留まり続けることになる — `再生は終止して$いるとしても、 利用者には始端へ~seekして戻る機会cが常にあるので。 事実,この状況において`再生は終止して$いるときは、 先に述べたように,~UAは `suspend$et ~eventを発火することになる。 ◎ For example, if the user agent has discarded the first half of a video, the user agent will remain at this step even once the playback has ended, because there is always the chance the user will seek back to the start. In fact, in this situation, once playback has ended, the user agent will end up firing a suspend event, as described earlier.

  7. ~ELSE ( %~media提供元~obj ~NEQ ~NULL ): ◎ Otherwise (mode is local)

    • %現~media資源 により述べられる資源があれば,それが`~media~data$を包含する。 それは`~CORS同一-生成元$である。 ◎ The resource described by the current media resource, if any, contains the media data. It is CORS-same-origin.
    • ~UAは、 `~media資源$の形式を次に従って決定するモノトスル:

      • %現~media資源 が生の~data~streamである場合 (例: `File$I ~objからの) ⇒ `音声や動画を特定的に~sniffするための規則$を利用する
      • 他の場合(~data~streamは予め復号-済みである) ⇒ 形式は、 関連な仕様により与えられるそれとする
      ◎ If the current media resource is a raw data stream (e.g. from a File object), then to determine the format of the media resource, the user agent must use the rules for sniffing audio and video specifically. Otherwise, if the data stream is pre-decoded, then the format is the format given by the relevant specification.
    • %現~media資源 用に新たな~dataが可用になる度に ⇒ `~media~taskを~queueする$( %要素, 次の手続き ) ◎ Whenever new data for the current media resource becomes available, queue a media element task given the media element to\

      手続きは ⇒ `~media~data処理~手続き~list$() ◎ run the first appropriate steps from the media data processing steps list below.
    • %現~media資源 は永続的に尽きた時点で (例: `Blob$I のすべての~byteは処理-済みになった): ◎ When the current media resource is permanently exhausted (e.g. all the bytes of a Blob have been processed),\

      1. ~IF[ 復号-時に~errorは生じていない ] ⇒ この`資源~選定~algo$を`中止-$する 【!GOTO Final step】 ◎ if there were no decoding errors, then the user agent must move on to the final step below.\

      これは、 決して起こらないかもしれない — 例えば %現~media資源 は `MediaStream$I である場合。 ◎ This might never happen, e.g. if the current media resource is a MediaStream.

      【 復号-時に~errorが生じた場合の取扱いは、 `~media~data処理~手続き~list$に織り込み済み? 】

    `~media~data処理~手続き~list@ は、 次に従うモノトスル: ◎ The media data processing steps list is as follows:

    `~media~data$は,~network~errorに因り まったく~fetchできず、 ~UAは資源を~fetchしようと試行するのをあきらめたときは: ◎ If the media data cannot be fetched at all, due to network errors, causing the user agent to give up trying to fetch the resource
    `~media~data$は~fetchできたが、 まったく具現化できないことが~~判明したときは: ◎ If the media data can be fetched but is found by inspection to be in an unsupported format, or can otherwise not be rendered at all

    すなわち、 次のいずれかに該当する場合: ◎ ↓

    • [ ~UAが %現~media資源 は利用-可能かどうか確立する前 ]に生じた,[ ~DNS~error/ ~HTTP[ `4xx^hst / `5xx^hst ]~error(あるいは,他の~protocolにおける等価なもの)/ 他の致命的な~network~error ] ◎ DNS errors, HTTP 4xx and 5xx errors (and equivalents in other protocols), and other fatal network errors that occur before the user agent has established whether the current media resource is usable,\
    • ~fileは ~UAが~supportしない容器~形式を利用している ◎ as well as the file using an unsupported container format, or\
    • すべての~dataは、 ~UAが~supportしない ~codecs ~parameterを利用している ◎ using unsupported codecs for all the data,\

    次を実行するモノトスル: ◎ must cause the user agent to execute the following steps:

    1. ~fetchingを取消すベキである ◎ The user agent should cancel the fetching process.
    2. この`~media資源~fetch~algo$を終えて、 `資源~選定~algo$へ ~RET する ◎ Abort this subalgorithm, returning to the resource selection algorithm.
    `~media資源$に音声~trackが見出されたときは: ◎ If the media resource is found to have an audio track
    1. %音声~track ~LET その音声~trackを表現する,新たな `AudioTrack$I ~obj ◎ Create an AudioTrack object to represent the audio track.
    2. %~track~list ~LET %要素 の`audioTracks$mM 属性が与える `AudioTrackList$I ~obj ◎ ↓
    3. %~track~list を %音声~track で更新する ◎ Update the media element's audioTracks attribute's AudioTrackList object with the new AudioTrack object.
    4. ~IF[ ~OR↓ ]… ◎ Let enable be unknown.

      • %音声~track は、 次のいずれかに該当する音声~trackである:

        • [ %現~media資源 / %~URL ]が,可能化するよう特に指示している音声~trackたち
        • ~UAが[ 利用者の体験を改善するために,特定の音声~trackの選択を手助けする情報 ]を有している下での,それらの音声~trackたち
        ◎ If either the media resource or the URL of the current media resource indicate a particular set of audio tracks to enable, or if the user agent has information that would facilitate the selection of specific audio tracks to improve the user's experience, then: if this audio track is one of the ones to enable, then set enable to true, otherwise, set enable to false.

        これは,`~media素片の構文$により誘発され得るが、 他にも,例えば[ ~UAが、 ~stereo音声~trackとしてに代えて, 5.1 ~surround音響のそれを選択したとき ]に誘発される。 ◎ This could be triggered by media fragment syntax, but it could also be triggered e.g. by the user agent selecting a 5.1 surround sound audio track over a stereo audio track.

      • %~track~list 内には `可能化されている音声~track$はまだない ◎ If enable is still unknown, then, if the media element does not yet have an enabled audio track, then set enable to true, otherwise, set enable to false.

      …ならば ⇒ %音声~track を可能化する ◎ If enable is true, then enable this audio track, otherwise, do not enable this audio track.

    5. `~eventを発火する$( %~track~list, `addtrack$et, `TrackEvent$I ) — 次のように初期化して ⇒ `track$m 属性 ~SET %音声~track ◎ Fire an event named addtrack at this AudioTrackList object, using TrackEvent, with the track attribute initialized to the new AudioTrack object.
    `~media資源$に動画~trackが見出されたときは: ◎ If the media resource is found to have a video track
    1. %動画~track ~LET その動画~trackを表現する,新たな `VideoTrack$I ~obj ◎ Create a VideoTrack object to represent the video track.
    2. %~track~list ~LET %要素 の`videoTracks$mM 属性が与える `VideoTrackList$I ~obj ◎ ↓
    3. %~track~list を %動画~track で更新する ◎ Update the media element's videoTracks attribute's VideoTrackList object with the new VideoTrack object.
    4. ~IF[ ~OR↓ ]… ◎ Let enable be unknown.

      • %動画~track は、 次のいずれかに該当する動画~trackのうち最初のものである:

        • [ %現~media資源 / %~URL ]が,可能化するよう特に指示している動画~trackたち
        • ~UAが,利用者の体験を改善するために[ 特定の動画~trackの選択を手助けするような情報 ]を有している下での、 それら動画~trackたち
        ◎ If either the media resource or the URL of the current media resource indicate a particular set of video tracks to enable, or if the user agent has information that would facilitate the selection of specific video tracks to improve the user's experience, then: if this video track is the first such video track, then set enable to true, otherwise, set enable to false.

        これもまた`~media素片の構文$により誘発され得る。 ◎ This could again be triggered by media fragment syntax.

      • %~track~list 内には `選択されている動画~track$はまだない ◎ If enable is still unknown, then, if the media element does not yet have a selected video track, then set enable to true, otherwise, set enable to false.

      …ならば: ◎ If enable is true, then\

      1. ~IF[ すでに選択されている動画~trackはある ] ⇒ それを未選択にする — この場合、 `change^et ~eventが`発火されることになる@#toggle-video-track$。 ◎ select this track and unselect any previously selected video tracks, otherwise, do not select this video track. If other tracks are unselected, then a change event will be fired.
      2. %動画~track を選択する ◎ ↑
    5. `~eventを発火する$( %~track~list, `addtrack$et, `TrackEvent$I ) — 次のように初期化して ⇒ `track$m 属性 ~SET %動画~track ◎ Fire an event named addtrack at this VideoTrackList object, using TrackEvent, with the track attribute initialized to the new VideoTrack object.
    `~media資源$の[ 時間長, 寸法, その他の~metadata ]を決定するに十分な`~media~data$が~fetchされたときは: ◎ Once enough of the media data has been fetched to determine the duration of the media resource, its dimensions, and other metadata
    これは、 当の資源が利用-可能であることを指示する。 ◎ This indicates that the resource is usable.\

    ~UAは、 次に従うモノトスル: ◎ The user agent must follow these substeps:

    1. %~media時列線 ~LET `~media~data$に基づいて,`~media時列線を確立-$した結果の時列線 — [ `現在の再生~位置$, `アリな最も早い位置$ ]の目的において ◎ Establish the media timeline for the purposes of the current playback position and the earliest possible position, based on the media data.
    2. `時列線~offset$ ~SET `~media資源$は %~media時列線 内の時刻 0 に対応する明示的な時刻&日付を与えているならば それ / ~ELSE_ `NaN^jv ] ◎ Update the timeline offset to the date and time that corresponds to the zero time in the media timeline established in the previous step, if any. If no explicit time and date is given by the media resource, the timeline offset must be set to Not-a-Number (NaN).
    3. ( `現在の再生~位置$, `公式的な再生~位置$ ) ~SET ( `アリな最も早い位置$, `アリな最も早い位置$ ) ◎ Set the current playback position and the official playback position to the earliest possible position.
    4. %要素 の `duration$mM 属性 ~SET %~media時列線 上の,資源の最後の~frameの時刻が[ 既知ならば それ / 既知でなければ正な `Infinity^jv (例: 原則的に無限な~stream) ] ◎ Update the duration attribute with the time of the last frame of the resource, if known, on the media timeline established above. If it is not known (e.g. a stream that is in principle infinite), update the duration attribute to the value positive Infinity.

      注記: ~UAは、 この時点で,`次を行うことになる@#durationChange$ ⇒ `~media~taskを~queueする$( %要素, 次の手続き ) ⇒ `~eventを発火する$( %要素, `durationchange$et ) ◎ The user agent will queue a media element task given the media element to fire an event named durationchange at the element at this point.

    5. ~IF[ %要素 は `video$e 要素である ]: ◎ For video elements,\

      1. %要素 の[ `videoWidth$mV, `videoHeight$mV ]属性を設定する ◎ set the videoWidth and videoHeight attributes, and\
      2. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ queue a media element task given the media element to\

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

      注記: 寸法が後で変化した場合、 更に `resize$et ~eventが発火されることになる。 ◎ Further resize events will be fired if the dimensions subsequently change.

    6. %要素 の `readyState$mM 属性 ~SET `HAVE_METADATA$mM ◎ Set the readyState attribute to HAVE_METADATA.

      注記: この段で `readyState$mM 属性を設定する一部として、 `loadedmetadata$et ~eventが`発火されることになる@#fire-loadedmetadata$。 ◎ A loadedmetadata DOM event will be fired as part of setting the readyState attribute to a new value.

    7. %~seek済みか ~LET ~F ◎ Let jumped be false.
    8. ~IF[ %要素 の`既定の再生~開始~位置$ ~GT 0 ]:

      1. `~seekする$( その時刻 )
      2. %~seek済みか ~SET ~T
      ◎ If the media element's default playback start position is greater than zero, then seek to that time, and let jumped be true.
    9. %要素 の`既定の再生~開始~位置$ ~SET 0 ◎ Let the media element's default playback start position be zero.
    10. %初期~再生~位置 ~LET 0 ◎ Let the initial playback position be zero.
    11. ~IF[[ %現~media資源 / %~URL ]は、 特定0の開始~時刻 %t を指示している ]: ◎ If either the media resource or the URL of the current media resource indicate a particular start time, then\

      1. %初期~再生~位置 ~SET %t ◎ set the initial playback position to that time and,\
      2. ~IF[ %~seek済みか ~EQ ~F ] ⇒ `~seekする$( %t ) ◎ if jumped is still false, seek to that time.

      例えば,~media形式が`~media素片の構文$を~supportする場合、 `素片$urlを利用して,始端~位置を指示できる。 ◎ For example, with media formats that support media fragment syntax, the fragment can be used to indicate a start position.

    12. ~IF[ `可能化されている音声~track$はまだない ] ⇒ 音声~track 【どの?】 を可能化する — これは、 `change^et ~eventを`発火させる@#toggle-audio-track$ことになる。 ◎ If there is no enabled audio track, then enable an audio track. This will cause a change event to be fired.
    13. ~IF[ `選択されている動画~track$はなだない ] ⇒ 動画~track 【どの?】を選択する — これは、 `change^et ~eventを`発火させる@#toggle-video-track$ことになる。 ◎ If there is no selected video track, then select a video track. This will cause a change event to be fired.

    %要素 の `readyState$mM 属性 `HAVE_CURRENT_DATA$mM に達したときは、 `loadeddata^et ~eventを`発火した後に@#fire-loadeddata$ ⇒ %要素 の`~load~event遅延-中か$ ~SET ~F ◎ Once the readyState attribute reaches HAVE_CURRENT_DATA, after the loadeddata event has been fired, set the element's delaying-the-load-event flag to false. This stops delaying the load event.

    注記: 各`~media資源$用の~metadataを依然として~fetchしている間, ~network利用量を抑制しようと試みている~UAは、 `前に述べた規則@#resourceSuspend$に従って,この時点で~bufferするのも停止することになる — それは、 `networkState$mM 属性を `NETWORK_IDLE$mM 値に切替えて, `suspend$et ~eventの発火することを孕む。 ◎ A user agent that is attempting to reduce network usage while still fetching the metadata for each media resource would also stop buffering at this point, following the rules described previously, which involve the networkState attribute switching to the NETWORK_IDLE value and a suspend event firing.

    注記: ~UAには、 再生する前に,`~media資源$の時間長を決定して この段を遂げることが`要求される^em。 ◎ The user agent is required to determine the duration of the media resource and go through this step before playing.

    `~media資源$全体が~fetchされたときは(復号-前にもなり得る): ◎ Once the entire media resource has been fetched (but potentially before any of it has been decoded)
    1. `~eventを発火する$( %要素, `progress$et ) ◎ Fire an event named progress at the media element.
    2. %要素 の `networkState$mM ~SET `NETWORK_IDLE$mM
    3. `~eventを発火する$( %要素, `suspend$et ) ◎ Set the networkState to NETWORK_IDLE and fire an event named suspend at the media element.

    ~UAは、 `~media~data$の一部でも破棄して,それを再び得するために~network活動を再開する必要が生じた場合、 次を行うモノトスル ⇒ `~media~taskを~queueする$( %要素, 次の手続き ) ◎ If the user agent ever discards any media data and then needs to resume the network activity to obtain it again, then it must queue a media element task given the media element to\

    手続きは ⇒ %要素 の `networkState$mM ~SET `NETWORK_LOADING$mM ◎ set the networkState to NETWORK_LOADING.

    注記: ~UAが読込んだ`~media資源$を保てる場合、 この~algoは`中止-$されることになる。 ◎ If the user agent can keep the media resource loaded, then the algorithm will continue to its final step below, which aborts the algorithm.

    `~media~data$の一部が受信された後,接続は中断されたため、 ~UAは資源を~fetchしようと試行するのをあきらめたときは: ◎ If the connection is interrupted after some media data has been received, causing the user agent to give up trying to fetch the resource
    すなわち、 %現~media資源 は利用-可能かどうか確立された (すなわち, %要素 の`readyState$mM 属性 ~NEQ `HAVE_NOTHING$mM になった) 後に,致命的な~network~errorが生じた場合。 ◎ Fatal network errors that occur after the user agent has established whether the current media resource is usable (i.e. once the media element's readyState attribute is no longer HAVE_NOTHING)\

    次を実行するモノトスル: ◎ must cause the user agent to execute the following steps:

    1. ~UAは~fetchingを取消すベキである ◎ The user agent should cancel the fetching process.
    2. %要素 の `error$mM 属性 ~SET `新たな~MediaError$( `MEDIA_ERR_NETWORK$mE ) ◎ Set the error attribute to the result of creating a MediaError with MEDIA_ERR_NETWORK.
    3. %要素 の `networkState$mM 属性 ~SET `NETWORK_IDLE$mM ◎ Set the element's networkState attribute to the NETWORK_IDLE value.
    4. %要素 の`~load~event遅延-中か$ ~SET ~F ◎ Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
    5. `~eventを発火する$( %要素, `~errorM$et ) ◎ Fire an event named error at the media element.
    6. この`資源~選定~algo$を`中止-$する ◎ Abort the overall resource selection algorithm.
    `~media~data$は破損しているときは: ◎ If the media data is corrupted
    すなわち、 ~UAが %現~media資源 は利用-可能かどうか確立した (すなわち, %要素 の`readyState$mM 属性は `HAVE_NOTHING$mM でなくなった) 後に,`~media~data$の復号-時に致命的な~errorが生じた場合。 ◎ Fatal errors in decoding the media data that occur after the user agent has established whether the current media resource is usable (i.e. once the media element's readyState attribute is no longer HAVE_NOTHING)\

    次を実行するモノトスル: ◎ must cause the user agent to execute the following steps:

    1. ~UAは~fetchingを取消すベキである ◎ The user agent should cancel the fetching process.
    2. %要素 の `error$mM 属性 ~SET `新たな~MediaError$( `MEDIA_ERR_DECODE$mE ) ◎ Set the error attribute to the result of creating a MediaError with MEDIA_ERR_DECODE.
    3. %要素 の `networkState$mM 属性 ~SET `NETWORK_IDLE$mM ◎ Set the element's networkState attribute to the NETWORK_IDLE value.
    4. %要素 の`~load~event遅延-中か$ ~SET ~F ◎ Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
    5. `~eventを発火する$( %要素, `~errorM$et ) ◎ Fire an event named error at the media element.
    6. この`資源~選定~algo$を`中止-$する ◎ Abort the overall resource selection algorithm.
    `~media~data$の~fetchingは 利用者により中止されたときは: ◎ If the media data fetching process is aborted by the user
    利用者により~fetchingが中止される例としては、 利用者が “停止-” ~buttonを押したときが挙げられる。 ◎ The fetching process is aborted by the user, e.g. because the user pressed a "stop" button,\

    ~UAは、 次の手続きを実行するモノトスル。 この手続きは、[ この手続き 【を走らせている手続き?】 が走っている間に `load()$mM ~method自身が呼出された場合 ]には生じない — 上の手続き【どれ?】がその種の中止-を取扱うので。 ◎ the user agent must execute the following steps. These steps are not followed if the load() method itself is invoked while these steps are running, as the steps above handle that particular kind of abort.

    1. ~UAは~fetchingを取消すベキである ◎ The user agent should cancel the fetching process.
    2. `error$mM 属性 ~SET `新たな~MediaError$( `MEDIA_ERR_ABORTED$mE ) ◎ Set the error attribute to the result of creating a MediaError with MEDIA_ERR_ABORTED.
    3. `~eventを発火する$( %要素, `abort$et ) ◎ Fire an event named abort at the media element.
    4. ~IF[ %要素 の`readyState$mM 属性~値 ~EQ `HAVE_NOTHING$mM ]: ◎ If the media element's readyState attribute has a value equal to HAVE_NOTHING,\

      1. %要素 の `networkState$mM 属性 ~SET `NETWORK_EMPTY$mM ◎ set the element's networkState attribute to the NETWORK_EMPTY value,\
      2. %要素 の`~posterを示すか$ ~SET ~T ◎ set the element's show poster flag to true, and\
      3. `~eventを発火する$( %要素, `emptied$et ) ◎ fire an event named emptied at the element.
    5. ~ELSE ⇒ %要素 の`networkState$mM 属性 ~SET `NETWORK_IDLE$mM ◎ Otherwise, set the element's networkState attribute to the NETWORK_IDLE value.
    6. %要素 の`~load~event遅延-中か$ ~SET ~F ◎ Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
    7. この`資源~選定~algo$を`中止-$する ◎ Abort the overall resource selection algorithm.
    `~media~data$を~fetchできたが,その一部に具現化できないものがあるときは: ◎ If the media data can be fetched but\

    すなわち,次のいずれかに該当するが、 それでも再生はできるとき: ◎ \

    • ~fetchできたが、 致命的でない~errorまたは利用が生じた ◎ has non-fatal errors or uses, in part,\
    • ~dataの一部に~UAが~supportしない ~codecs ~parameterがあるため、 ~UAは内容を完全に正しく具現化できない ◎ codecs that are unsupported, preventing the user agent from rendering the content completely correctly but not preventing playback altogether
    • ~serverは、 部分的には利用-可能だが最適には具現化できない~dataを返している ◎ The server returning data that is partially usable but cannot be optimally rendered\
    ~UAは、 自身が取扱える~dataだけ具現化して,残りは無視するモノトスル。 ◎ must cause the user agent to render just the bits it can handle, and ignore the rest.
    `~media資源$が[ ~UAが~supportする,`~media資源に特有な~tT$ ]を宣言していることが見出されたときは: ◎ If the media resource is found to declare a media-resource-specific text track that the user agent supports

    ~IF[ `~media~data$は`~CORS同一-生成元$である ] ⇒ 関連な~dataで`~media資源に特有な~tTを公開する手続き$を走らす ◎ If the media data is CORS-same-origin, run the steps to expose a media-resource-specific text track with the relevant data.

    注記: 非同一-生成元の動画は、 その字幕を公開しない — そうすると、 敵対的~siteが,利用者の~intranet上の機密的な動画から字幕を読取るような攻撃を許容することになるので。 ◎ Cross-origin videos do not expose their subtitles, since that would allow attacks such as hostile sites reading subtitles from confidential videos on a user's intranet.

    【!~media~data処理~手続き~list ここまで】
  8. `最終-段^i: … 【この訳では、原文のこの段に代えて,`中止-$を利用している。】 ◎ Final step: If the user agent ever reaches this step (which can only happen if the entire resource gets loaded and kept available): abort the overall resource selection algorithm.

`~media資源に特有な~trackを忘れる@ ときは、 所与の ( `~media要素$ %要素 ) に対し,次を走らすモノトスル: ◎ When a media element is to forget the media element's media-resource-specific tracks, the user agent must\

  1. %要素 の`~tT~list$から`~media資源に特有な~tT$すべてを除去する ◎ remove from the media element's list of text tracks all the media-resource-specific text tracks, then\
  2. %要素 の `audioTracks$mM 属性が~~保持する `AudioTrackList$I ~objを空にする ◎ empty the media element's audioTracks attribute's AudioTrackList object, then\
  3. %要素 の `videoTracks$mM 属性が~~保持する `VideoTrackList$I ~objを空にする ◎ empty the media element's videoTracks attribute's VideoTrackList object.\

~event(特に, `removetrack$et ~event)は、 この手続きの一部として発火されることはない — 代わりに,これを呼出した各種~algoにより発火される[ `~errorM$et, `emptied$et ]~eventを利用できる。 ◎ No events (in particular, no removetrack events) are fired as part of this; the error and emptied events, fired by the algorithms that invoke this one, can be used instead.


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

~keyword 状態
`auto@v `自動的@st
空~文字列
`none@v `なし@st
`metadata@v `~metadata@st
◎ Keyword|State|\

これら各~状態についての概略的な記述は: ◎ Brief description

`自動的$st ◎ auto|Automatic|\
次を~UAに~hintする ⇒ 利用者の必要性を~~最優先にできる — ~serverに【~downloadが無駄になる】~riskを負わすことなく, 資源~全体を楽観的に~downloadできるまでに。 ◎ Hints to the user agent that the user agent can put the user's needs first without risk to the server, up to and including optimistically downloading the entire resource. ◎ (the empty string)|↑|↑
`なし$st ◎ none|None|\

次のいずれかであることを~UAに~hintする: ◎ Hints to the user agent that either\

  • 作者は、[ 利用者は~media資源が必要になる ]ものとは期待していない。 ◎ the author does not expect the user to need the media resource, or\
  • ~serverは、[ 不必要な流通を最小~化する ]よう求めている。 ◎ that the server wants to minimize unnecessary traffic.\
この状態は、 次に関する~hintは,供さない ⇒ ~bufferingが開始されるときに備えて (例: 利用者が “再生-” を叩いた), ~media資源をどの程度~積極的に実際に~downloadするか ◎ This state does not provide a hint regarding how aggressively to actually download the media resource if buffering starts anyway (e.g. once the user hits "play").
`~metadata$st ◎ metadata|Metadata|\
次を~UAに~hintする ⇒ 作者は,[ 利用者は~media資源が必要になる ]ものと期待してはいないが、 当の資源の~metadata(寸法, ~track~list, 時間長, 等々)に加えて, 最初の少数の~frameも~fetchすることも適理になる。 ◎ Hints to the user agent that the author does not expect the user to need the media resource, but that fetching the resource metadata (dimensions, track list, duration, etc.), and maybe even the first few frames, is reasonable.\
当の~media要素の `readyState$mM 属性は、 ~UAが精確に~metadataだけしか~fetchしなければ `HAVE_METADATA$mM になるが、 概して一部の~frameも得されることになり,おそらく[ `HAVE_CURRENT_DATA$mM / `HAVE_FUTURE_DATA$mM ]になる。 ◎ If the user agent precisely fetches no more than the metadata, then the media element will end up with its readyState attribute set to HAVE_METADATA; typically though, some frames will be obtained as well and it will probably be HAVE_CURRENT_DATA or HAVE_FUTURE_DATA.\
~media資源の再生-中においては、[ 帯域幅は狭いと見なされている ]ことを~UAに~hintする — 例えば、[ ~~安定的な再生は保守しつつ,~media~dataをアリな限り低速な~rateで得する ]よう,~downloadを減速することを示唆する。 ◎ When the media resource is playing, hints to the user agent that bandwidth is to be considered scarce, e.g. suggesting throttling the download so that the media data is obtained at the slowest possible rate that still maintains consistent playback.

[ `欠落~値~用の既定の状態$/`妥当でない値~用の既定の状態$ ]は、 `実装定義$とする — [ ~server負荷を抑制すること, 最適な利用者~体験を供すること ]の妥協点として, `~metadata$st 状態が示唆されるが。 ◎ The attribute's missing value default and invalid value default are both implementation-defined, though the Metadata state is suggested as a compromise between reducing server load and providing an optimal user experience.

この属性は、 `~media資源$が[ ~bufferされている/再生され始めた ]後でも変更できる — 上に挙げた各~状態についての概略的な記述は、 そのことを念頭に解釈するとする。 ◎ The attribute can be changed even once the media resource is being buffered or played; the descriptions in the table above are to be interpreted with that in mind.

注記: 作者は、 利用者が再生し始めてから,この属性を[ `none$v / `metadata$v ]から `auto$v へ動的に切替えるかもしれない。 例えば,多数の動画がある~pageでは、[ 多くの動画は,要請されない限り~downloadしないが、 `要請されたなら^em,積極的に~downloadする ]よう指示するために利用されるかもしれない。 ◎ Authors might switch the attribute from "none" or "metadata" to "auto" dynamically once the user begins playback. For example, on a page with many videos this might be used to indicate that the many videos are not to be downloaded unless requested, but that once one is requested it is to be downloaded aggressively.

`preload$aM 属性は、[ 何が利用者~体験にとって最善になるか ]についての~hintを,作者が~UAに供するために意図されている。 ~UAは、 この属性をまるごと無視してもヨイ — 例えば、[ 明示的な利用者-選好/可用な~接続性 ]に基づいて。 ◎ The preload attribute is intended to provide a hint to the user agent about what the author thinks will lead to the best user experience. The attribute may be ignored altogether, for example based on explicit user preferences or based on the available connectivity.

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

注記: `autoplay$aM 属性は、 `preload$aM 属性を上書きし得る ( `preload$aM 属性が与える~hintに関わらず、 当の~mediaの再生-時には,それに先立って~bufferしているはずなので)。 しかしながら、 両者とも含めることは~errorではない。 ◎ The autoplay attribute can override the preload attribute (since if the media plays, it naturally has to buffer first, regardless of the hint given by the preload attribute). Including both is not an error, however.


%media.`buffered$mM
~UAが~bufferした`~media資源$の一連の範囲を表現する `TimeRanges$I ~objを返す。 ◎ Returns a TimeRanges object that represents the ranges of the media resource that the user agent has buffered.

`buffered@mM 取得子~手続きは ⇒ ~RET 次を表現する,静的かつ`正規化-済み$な新たな `TimeRanges$I ~obj ⇒ ~UAが現時点で~bufferした`~media資源$の一連の範囲 ◎ The buffered attribute must return a new static normalized TimeRanges object that represents the ranges of the media resource, if any, that the user agent has buffered, at the time the attribute is evaluated.\

  • ~UAは、 ~media~streamに対し,これを手間のかかる検分でしか決定できない場合でも,可用な範囲を正確aに決定するモノトスル。 ◎ Users agents must accurately determine the ranges available, even for media streams where this can only be determined by tedious inspection.

    注記: これは概して, 0 を起点とする単独の範囲になるが、 例えば~UAの~seekingに呼応して ~HTTP `Range^h 要請を利用する場合,複数の範囲にもなり得る。 ◎ Typically this will be a single range anchored at the zero point, but if, e.g. the user agent uses HTTP range requests in response to seeking, then there could be multiple ranges.

  • ~UAは、 以前に~bufferした~dataを破棄してヨイ。 ◎ User agents may discard previously buffered data.

    注記: したがって,ある時点で `buffered$mM 属性が返す~objが表現する範囲たちのいずれかに含まれる時刻~位置は、 後の時点で返されるものには含まれないかもしれない。 ◎ Thus, a time position included within a range of the objects return by the buffered attribute at one time can end up being not included in the range(s) of objects returned by the same attribute at later times.

属性~取得子が毎回 新たな~objを返すのは不良な~patternであるが、 今更それを変更するのは高くつくので,そうなっている。 そのようなふるまいは、 新たな~APIには複製されない。 ◎ Returning a new object each time is a bad pattern for attribute getters and is only enshrined here as it would be costly to change it. It is not to be copied to new APIs.

4.8.11.6. ~media資源の中への~offset
%media.`duration$mM
`~media資源$の長さを秒数で返す。 `~media資源$の始端が時刻 0 と見做される。 ◎ Returns the length of the media resource, in seconds, assuming that the start of the media resource is at time zero.
時間長は可用でなければ `NaN^jv を返す。 ◎ Returns NaN if the duration isn't available.
無限界~stream用には `Infinity^jv を返す。 ◎ Returns Infinity for unbounded streams.
%media.`currentTime$mM [ = %value ]
`公式的な再生~位置$を秒数で返す。 ◎ Returns the official playback position, in seconds.
設定して,所与の時刻に~seekできる。 ◎ Can be set, to seek to the given time.

`~media資源$は、 `~media時列線@ ( `media timeline^en )を持つ。 それは、 時刻(秒数)を`~media資源$内の位置に対応付ける。 時列線の原点は、 それに定義される最も早い位置になり, 時列線の時間長( `duration^en )は、 それに定義される最後の位置になる。 ◎ A media resource has a media timeline that maps times (in seconds) to positions in the media resource. The origin of a timeline is its earliest defined position. The duration of a timeline is its last defined position.

`~media時列線を確立-@ するときは: ◎ Establishing the media timeline:\

  • `~media資源$が,何らかの方法で,原点が負でない時列線を明示的に指定する場合 (すなわち、 各~frameに特定の時刻~offsetを与えていて, 最初の~frameには 0 以上の~offsetを与えている) ⇒ `~media時列線$はその時列線にされるベキである (`~media資源$が時列線を指定できるかどうかは、 `~media資源$の形式に依存する)。 ◎ if the media resource somehow specifies an explicit timeline whose origin is not negative (i.e. gives each frame a specific time offset and gives the first frame a zero or positive offset), then the media timeline should be that timeline. (Whether the media resource can specify a timeline or not depends on the media resource's format.)\
  • `~media資源$が明示的な開始~時刻`と日付^emを指定する場合 ⇒ その日時が `~media時列線$における~offset 0 の地点と見なされるベキである — `getStartDate()$mM ~methodは、 この`時列線~offset$による日時を公開することになる。 ◎ If the media resource specifies an explicit start time and date, then that time and date should be considered the zero point in the media timeline; the timeline offset will be the time and date, exposed using the getStartDate() method.

`~media資源$の時列線は不連続である場合、 ~UAは資源の始端に利用される時列線を資源~全体にまたがるように拡張するモノトスル — 下層の`~media~data$は順不同, あるいは時刻~codeが重合している場合でも、 `~media資源$の`~media時列線$は, (下に定義される)`アリな最も早い位置$から開始して線形に増加するように。 ◎ If the media resource has a discontinuous timeline, the user agent must extend the timeline used at the start of the resource across the entire resource, so that the media timeline of the media resource increases linearly starting from the earliest possible position (as defined below), even if the underlying media data has out-of-order or even overlapping time codes.

例えば、 1 個の動画~file内に 2 個の連結された~clipがあって,動画の形式は両~clipの元の時刻による時列線 — 例えば[ 00:15 〜 00:29, 00:05 〜 00:38 ] — を公開しているかもしれない。 ~UAは、 それらの時刻は公開せず,単独の動画として[ 00:15 〜 00:29, 00:29 〜 01:02 ]を公開することになる。 ◎ For example, if two clips have been concatenated into one video file, but the video format exposes the original times for the two clips, the video data might expose a timeline that goes, say, 00:15..00:29 and then 00:05..00:38. However, the user agent would not expose those times; it would instead expose the times as 00:15..00:29 and 00:29..01:02, as a single video.

◎追跡路 `~media資源$に明示的な時列線が無いような稀な事例においては、 `~media時列線$の 時刻 0 は,`~media資源$の最初の~frameに対応するベキである。 `~media資源$が明示的な計時~情報を — ~frame時間長すら — まったく伴わないようなもっと稀な事例においては、 ~UAは,各~frameに対応する時刻を`実装定義$な方式で決定するモノトスル。 ◎ (This is a tracking vector.) In the rare case of a media resource that does not have an explicit timeline, the zero time on the media timeline should correspond to the first frame of the media resource. In the even rarer case of a media resource with no explicit timings of any kind, not even frame durations, the user agent must itself determine the time for each frame in an implementation-defined manner.

注記: 明示的な時列線は伴わないが,明示的な~frame時間長は伴う~file形式の例としては、 Animated GIF 形式が挙げられる。 明示的な時列線を まったく伴わない~file形式の例としては、 JPEG-push 形式が挙げられる ( JPEG ~frameを伴う `multipart/x-mixed-replace$mt — MJPEG ~stream用の形式として利用されることが多い)。 ◎ An example of a file format with no explicit timeline but with explicit frame durations is the Animated GIF format. An example of a file format with no explicit timings at all is the JPEG-push format (multipart/x-mixed-replace with JPEG frames, often used as the format for MJPEG streams).

`~media資源$ %資源 に計時~情報が伴われない事例では、 ~UAは,時刻 0 を次に与える時刻に対応させるベキである: ◎ If, in the case of a resource with no timing information,\

  • にもかかわらず,[ ~serverが元々供した最初の~frameより早い地点 ]へ~seekできることになる場合 ⇒ %資源 内の~seek可能な最も早い時刻 ◎ the user agent will nonetheless be able to seek to an earlier point than the first frame originally provided by the server, then the zero time should correspond to the earliest seekable time of the media resource;\
  • 他の場合 ⇒ ~serverから受信された最初の~frame (~UAが %資源 内の~streamを受信し始めた地点)。 ◎ otherwise, it should correspond to the first frame received from the server (the point in the media resource at which the user agent began receiving the stream).

注記: これを書いている時点では、[ ~serverにより送信された最初の~frameより前の~frameへの~seek法を~supportしつつ,明示的な~frame時刻~offsetを欠く ]ような,既知な形式はない。 ◎ At the time of writing, there is no known format that lacks explicit frame time offsets yet still supports seeking to a frame before the first frame sent by the server.

ある TV 放送局からの,次のような~streamを考える: ◎ Consider a stream from a TV broadcaster, which\

  • 10 月の金曜日の昼過ぎから~streamingを始める ◎ begins streaming on a sunny Friday afternoon in October, and\
  • 接続してくるどの~UAに対しても,常に同じ~media時列線~上の~media~dataを送信する ◎ always sends connecting user agents the media data on the same media timeline,\
  • その時刻 0 はこの~streamの始端に設定されている ◎ with its zero time set to the start of this stream.\

何ヶ月か後にこの~streamへ接続している~UAは、 自身が受信する最初の~frameの時刻が秒~数で何千何百万になることを見出すことになる。 `getStartDate()$mM ~methodは,常に放送を開始した日付を返すことになる。 これにより,~controllerは,自身の `scrubber^en 【音声の区間を選択するための~UI】 内に実~時刻(例: “午後 2:30”) — 放送~~開始に相対的な時刻(例: “8 ヶ月, 4 ~~時間, 12分 23 秒” )ではなく — を表示できるようになる。 ◎ Months later, user agents connecting to this stream will find that the first frame they receive has a time with millions of seconds. The getStartDate() method would always return the date that the broadcast started; this would allow controllers to display real times in their scrubber (e.g. "2:30pm") rather than a time relative to when the broadcast began ("8 months, 4 hours, 12 minutes, and 23 seconds").

ある~serverにより放送される,次のような~streamを考える: ◎ Consider a stream that\

  • いくつかの断片が連結された動画を運んでいる ◎ carries a video with several concatenated fragments, broadcast by a server\
  • 特定の時刻を要請するのを~UAに許容せず,単に動画~dataを予め決定された順序で~streamする ◎ that does not allow user agents to request specific times but instead just streams the video data in a predetermined order,\
  • 最初の~frameは常に,時刻 0 の~frameとして識別されるよう送達される。 ◎ with the first frame delivered always being identified as the frame with time zero.\

~UAがこの~streamに接続して,時刻印[ 2010-03-20 23:15:00 UTC 〜 2010-03-21 00:05:00 UTC ], [ 2010-02-12 14:25:00 UTC 〜 2010-02-12 14:35:00 UTC ]を受持つものと定義された断片を受信した場合、 これを 0 秒から開始して 3600 秒( 1 ~~時間)へ拡張する`~media時列線$を伴わせて公開することになる。 ~streaming~serverは 2 個目の~clipの終端で切断されると見做すなら、 `duration$mM 属性は 3600 を返し, `getStartDate()$mM ~methodは 2010-03-20 23:15:00 UTC に対応する時刻を表す `Date$I ~objを返すことになる。 ◎ If a user agent connects to this stream and receives fragments defined as covering timestamps 2010-03-20 23:15:00 UTC to 2010-03-21 00:05:00 UTC and 2010-02-12 14:25:00 UTC to 2010-02-12 14:35:00 UTC, it would expose this with a media timeline starting at 0s and extending to 3,600s (one hour). Assuming the streaming server disconnected at the end of the second clip, the duration attribute would then return 3,600. The getStartDate() method would return a Date object with a time corresponding to 2010-03-20 23:15:00 UTC.\

その一方,別の~UAが 5 分~後に接続した場合、 その~UAは,時刻印[ 2010-03-20 23:20:00 UTC 〜 2010-03-21 00:05:00 UTC ], [ 2010-02-12 14:25:00 UTC 〜 2010-02-12 14:35:00 UTC ]を受持つ断片を(だいたいは)受信することになり、 0 秒から開始して 3300 秒( 55 分間)へ拡張する`~media時列線$を伴わせて,これを公開することになる。 この事例では、 `getStartDate()$mM ~methodは, 2010-03-20 23:20:00 UTC に対応する時刻を表す `Date$I ~objを返すことになる。 ◎ However, if a different user agent connected five minutes later, it would (presumably) receive fragments covering timestamps 2010-03-20 23:20:00 UTC to 2010-03-21 00:05:00 UTC and 2010-02-12 14:25:00 UTC to 2010-02-12 14:35:00 UTC, and would expose this with a media timeline starting at 0s and extending to 3,300s (fifty five minutes). In this case, the getStartDate() method would return a Date object with a time corresponding to 2010-03-20 23:20:00 UTC.

この両~例とも, `seekable$mM 属性は~controllerが~UI内に実際に表示したいと求める一連の範囲を与えることになる — ~serverが任意の時刻への~seek法を~supportしない場合、 これは概して,[ ~UAが~streamへ接続した瞬間の時刻から,~UAが直近に得した~frameまで ]の範囲になる。 しかしながら,~UAがより早い情報を破棄し始めた場合、 実際の範囲はより短くなるかもしれない。 ◎ In both of these examples, the seekable attribute would give the ranges that the controller would want to actually display in its UI; typically, if the servers don't support seeking to arbitrary times, this would be the range of time from the moment the user agent connected to the stream up to the latest frame that the user agent has obtained; however, if the user agent starts discarding earlier information, the actual range might be shorter.

いずれの事例であれ,~UAは、[ `~media時列線$を確立したときは,それを利用している`アリな最も早い位置$は 0 以上になる ]ことを確保するモノトスル。 ◎ In any case, the user agent must ensure that the earliest possible position (as defined below) using the established media timeline, is greater than or equal to zero.

`~media時列線$には、 時計も結付けられる。 どの時計が利用されるかは~UAにより定義され,`~media資源$ に依存してもヨイが、 それは利用者の~wall時計 【局所時間帯?】 に近似するベキである。 ◎ The media timeline also has an associated clock. Which clock is used is user-agent defined, and may be media resource-dependent, but it should approximate the user's wall clock.

各`~media要素$には、 次に挙げるものが結付けられる — 初期~時には(すなわち,`~media~data$が無い下では)、 括弧~内に与える値に設定するモノトスル: ◎ ↓

`現在の再生~位置@ ( 0 秒 )
`~media時列線$上の時刻。 ◎ Media elements have a current playback position, which must initially (i.e. in the absence of media data) be zero seconds. The current playback position is a time on the media timeline.
`公式的な再生~位置@ ( 0 秒 )
これは、 ~scriptを走らせている間は安定に保たれるような,`現在の再生~位置$の近似である。 ◎ Media elements also have an official playback position, which must initially be set to zero seconds. The official playback position is an approximation of the current playback position that is kept stable while scripts are running.
`既定の再生~開始~位置@ ( 0 秒 )
この時刻は、 ~mediaが読込まれる前であっても,要素を~seekできるようにするために利用される。 ◎ Media elements also have a default playback start position, which must initially be set to zero seconds. This time is used to allow the element to be seeked even before the media is loaded.
`~posterを示すか@ ( ~T )
~UAが `video$e 要素~用に,いつ[ 動画~内容に代えて,~poster~frameを示す ]かどうかを制御するために利用される。 “`~posterを示して$[ いる/いない ]” という句は、 この値が[ ~T/~F ]であることを意味する。 ◎ Each media element has a show poster flag. When a media element is created, this flag must be set to true. This flag is used to control when the user agent is to show a poster frame for a video element instead of showing the video contents.
`currentTime@mM 取得子~手続きは ⇒ ~RET 次を秒数で表出する値 ⇒# コレの`既定の再生~開始~位置$は 0 でないならば それ / ~ELSE_ コレの`公式的な再生~位置$ ◎ The currentTime attribute must, on getting, return the media element's default playback start position, unless that is zero, in which case it must return the element's official playback position. The returned value must be expressed in seconds.\

`currentTime$mM 設定子~手続きは: ◎ On setting,\

  1. ~IF[ コレの`readyState$mM ~EQ `HAVE_NOTHING$mM ] ⇒ コレの`既定の再生~開始~位置$ ~SET 所与の値 ◎ if the media element's readyState is HAVE_NOTHING, then it must set the media element's default playback start position to the new value;\
  2. ~ELSE:

    1. コレの`公式的な再生~位置$ ~SET 所与の値
    2. `~seekする$( 所与の値を秒数として解釈した結果 )
    ◎ otherwise, it must set the official playback position to the new value and then seek to the new value. The new value must be interpreted as being in seconds.

`~media資源$は~streaming資源である場合、 ~bufferから失効した後は,~UAは資源のある部分を得せないかもしれない。 同様に,`~media資源$の`~media時列線$は、 0 から開始しないこともあるかもしれない。 `アリな最も早い位置@ は、 `~media時列線$上の時刻であって,~UAがいつでも再び得せるような[ ~stream/資源 ]内の最も早い位置とする。 ◎ If the media resource is a streaming resource, then the user agent might be unable to obtain certain parts of the resource after it has expired from its buffer. Similarly, some media resources might have a media timeline that doesn't start at zero. The earliest possible position is the earliest position in the stream or resource that the user agent can ever obtain again. It is also a time on the media timeline.

注記: `アリな最も早い位置$は、 ~APIにおいては明示的には公開されない。 それは、 `seekable$mM 属性が返す `TimeRanges$I ~objが表す範囲~listが[ 空でなければ その最初の範囲の開始~時刻 / 空ならば `現在の再生~位置$ ]に対応する。 ◎ The earliest possible position is not explicitly exposed in the API; it corresponds to the start time of the first range in the seekable attribute's TimeRanges object, if any, or the current playback position otherwise.

%要素 の`アリな最も早い位置$が変化したときは、 次を走らすモノトスル: ◎ When the earliest possible position changes, then:\

  • ~IF[ `現在の再生~位置$は`アリな最も早い位置$より前 ] ⇒ `~seekする$( `アリな最も早い位置$ ) ◎ if the current playback position is before the earliest possible position, the user agent must seek to the earliest possible position;\
  • ~ELIF[ %要素 向けの `timeupdate$et ~eventは、[ 過去 15ms 〜 250ms においては発火されていない ]~AND[ それ用の~event~handlerは現在~走っていない ]] ⇒ `~media~taskを~queueする$( %要素, 次の手続き ) ◎ otherwise, 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 to\

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

注記: 上の要件と[ `~clipの~metadataが既知になった@#getting-media-metadata$ときから効き始める,`~media資源~fetch~algo$における要件 ]があるので、[ `現在の再生~位置$ ~LT `アリな最も早い位置$ ]になることは、 決してない。 ◎ Because of the above requirement and the requirement in the resource fetch algorithm that kicks in when the metadata of the clip becomes known, the current playback position can never be less than the earliest possible position.

~UAは、 どの時点であれ,[ ある[ 音声/動画 ]~track %~track は終止した ]かつ[ %~track に関係しているすべての`~media~data$は、 `~media時列線$を成す[ `アリな最も早い位置$`より前^emにある部分 ]に対応する ]ことが~~判明したときは、 次を行ってヨイ: ◎ If at any time the user agent learns that an audio or video track has ended and all media data relating to that track corresponds to parts of the media timeline that are before the earliest possible position, the user agent may\

  1. ~Assert: %~track は、 ある`~media要素$ %要素 の[ `audioTracks$mM / `videoTracks$mM ]属性が返す[ `AudioTrackList$I / `VideoTrackList$I ]~obj %~track~list 内のある[ `AudioTrack$I / `VideoTrack$I ]~objで表現されている ◎ ↓
  2. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ queue a media element task given the media element to run these steps:

    手続きは:

    1. %~track~list から %~track を除去する ◎ Remove the track from the audioTracks attribute's AudioTrackList object or the videoTracks attribute's VideoTrackList object as appropriate.
    2. `~eventを発火する$( %~track~list, `removetrack$et, `TrackEvent$I ) — 次のように初期化して ⇒ `track$m 属性 ~SET %~track ◎ Fire an event named removetrack at the media element's aforementioned AudioTrackList or VideoTrackList object, using TrackEvent, with the track attribute initialized to the AudioTrack or VideoTrack object representing the track.

`duration@mM 取得子~手続きは:

  1. ~IF[ コレに可用な`~media~data$はない ] ⇒ ~RET `NaN^jv
  2. ~IF[ `~media資源$は有限界と既知でない (例: ~streaming~radio/終了~時刻は公告されていない~live-event) ] ⇒ ~RET 正な `Infinity^jv
  3. ~RET 秒数による,コレの`~media時列線$上のコレの`~media資源$の終了~時刻
◎ The duration attribute must return the time of the end of the media resource, in seconds, on the media timeline. If no media data is available, then the attributes must return the Not-a-Number (NaN) value. If the media resource is not known to be bounded (e.g. streaming radio, or a live event with no announced end time), then the attribute must return the positive Infinity value.

~UAは、 `~media資源$の時間長を,[ `~media~data$のどこか一部でも再生する / `readyState$mM を `HAVE_METADATA$mM 以上の値に設定する ]より前に決定するモノトスル — そのためには資源の複数の部分を~fetchする必要がある場合でも。 ◎ The user agent must determine the duration of the media resource before playing any part of the media data and before setting readyState to a value greater than or equal to HAVE_METADATA, even if doing so requires fetching multiple parts of the resource.

`~media要素$ %要素 の`~media資源$ %資源 の長さが既知な値に変化したとき (例:未知から既知へ/以前に確立された長さから新たな長さへ変化したとき) は、 ~UAは次を走らすモノトスル: ◎ When the length of the media resource changes to a known value (e.g. from being unknown to known, or from a previously established length to a new length) the user agent must\

  1. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ queue a media element task given the media element to\

    手続きは ⇒ `~eventを発火する$( %要素, `durationchange$et ) (この~eventは、 新たな~media資源の読込n時の一環として,時間長が設定し直されたときは発火されない。) ◎ fire an event named durationchange at the media element. (The event is not fired when the duration is reset as part of loading a new media resource.)\
  2. %終端 ~LET %資源 の終端の時刻 ◎ \
  3. ~IF[ 時間長の変化により[ `現在の再生~位置$ ~GT %終端 ]になった ] ⇒ `~seekする$( %終端 ) ◎ If the duration is changed such that the current playback position ends up being greater than the time of the end of the media resource, then the user agent must also seek to the time of the end of the media resource.

“無限” ~streamが何らかの理由で終止する場合、 時間長は 正な `Infinity^jv から~stream内の最後の[ ~frame/~sample ]時刻に変化して, `durationchange$et ~eventは同様に発火されることになる。 ~UAが`~media資源$の時間長を精確に決定する代わりに初期~時に見積もっていて,後で新たな情報に基づいて見積もりを改訂した場合、 時間長は変化して `durationchange$et ~eventは発火されることになる。 ◎ If an "infinite" stream ends for some reason, then the duration would change from positive Infinity to the time of the last frame or sample in the stream, and the durationchange event would be fired. Similarly, if the user agent initially estimated the media resource's duration instead of determining it precisely, and later revises the estimate based on new information, then the duration would change and the durationchange event would be fired.

一部の動画~fileは、 `時列線~offset@ と呼ばれる,`~media時列線$内の時刻 0 に対応する,明示的な日時も持つ。 それは、 初期~時には `NaN^jv に設定するモノトスル。 ◎ Some video files also have an explicit date and time corresponding to the zero time in the media timeline, known as the timeline offset. Initially, the timeline offset must be set to Not-a-Number (NaN).

`getStartDate()@mM ~method~手続きは ⇒ ~RET 現在の`時列線~offset$を表現している`新たな~Date~obj$ ◎ The getStartDate() method must return a new Date object representing the current timeline offset.

`loop@aM 属性は,`真偽-属性$であり、 指定された場合,`~media要素$が終端に達したときには`~media資源$の始端へ~seekして戻ることを指示する。 ◎ The loop attribute is a boolean attribute that, if specified, indicates that the media element is to seek back to the start of the media resource upon reaching the end.

`loop@mM ~IDL属性は、 `loop$aM 内容~属性を`反映する$モノトスル。 ◎ The loop IDL attribute must reflect the content attribute of the same name.

4.8.11.7. 準備状態
%media.`readyState$mM
コレの`現在の再生~位置$の具現化に関する,現在の状態を表出する値を、 下に挙げる~codeとして返す。 ◎ Returns a value that expresses the current state of the element with respect to rendering the current playback position, from the codes in the list below.

各`~media要素$は、 次に挙げるいずれかを値にとる `準備状態^i を持つ。 それは、 `現在の再生~位置$に具現化する準備済み度合いを述べる。 与えられた特定0の時刻における~media要素の準備状態は、 要素の状態を述べている最~大~値になる: ◎ Media elements have a ready state, which describes to what degree they are ready to be rendered at the current playback position. The possible values are as follows; the ready state of a media element at any particular time is the greatest value describing the state of the element:

`HAVE_NOTHING@mM (数-値 0 )

次を指示する: ◎ ↓

  • `~media資源$に関する可用な情報はない。 ◎ No information regarding the media resource is available.\
  • コレの`現在の再生~位置$用の~dataは可用でない。 ◎ No data for the current playback position is available.\
[ コレの `networkState$mM 属性 ~EQ `NETWORK_EMPTY$mM ]ならば、 常に `HAVE_NOTHING$mM 状態にある。 ◎ Media elements whose networkState attribute are set to NETWORK_EMPTY are always in the HAVE_NOTHING state.
`HAVE_METADATA@mM (数-値 1 )

次を指示する:

  • コレの資源の時間長が可用になるに十分な資源は得され、 コレが `video$e 要素である場合は,動画の寸法も可用である。 ◎ Enough of the resource has been obtained that the duration of the resource is available. In the case of a video element, the dimensions of the video are also available. \
  • コレの`現在の再生~位置$用の直の`~media~data$は可用でない。 ◎ No media data is available for the immediate current playback position.
`HAVE_CURRENT_DATA@mM (数-値 2 )

次を指示する: ◎ ↓

  • コレの`現在の再生~位置$用の直の~dataは可用である。 ◎ Data for the immediate current playback position is available, but.\
  • ~UAは,コレの`現在の再生~位置$を`再生~方向$へ進めるために十分な~dataを有していない — `再生~方向$に得せる~dataはもうないか、 進めるためには即時に `HAVE_METADATA$mM 状態へ復帰する必要がある。 ◎ either not enough data is available that the user agent could successfully advance the current playback position in the direction of playback at all without immediately reverting to the HAVE_METADATA state, or there is no more data to obtain in the direction of playback.\

例えば動画においては、 これは次のいずれかに対応する: ◎ For example, in video this corresponds to\

  • コレの`現在の再生~位置$が現在の~frameの終端にある下で、 ~UAには現在の~frameからの~dataはあるが,次~frameのそれはない。 ◎ the user agent having data from the current frame, but not the next frame, when the current playback position is at the end of the current frame;\
  • `再生は終止して$いるとき ◎ and to when playback has ended.
`HAVE_FUTURE_DATA@mM (数-値 3 )

次を指示する: ◎ ↓

  • コレの`現在の再生~位置$用の直の~dataは可用である。 ◎ Data for the immediate current playback position is available, as well as \
  • ~UAは、 コレの`現在の再生~位置$を少なくとも少しは`再生~方向$へ進めるに十分な~dataを有していて、 進めるために即時に `HAVE_METADATA$mM 状態へ復帰する必要はない。 ◎ enough data for the user agent to advance the current playback position in the direction of playback at least a little without immediately reverting to the HAVE_METADATA state, and\
  • ~tTは `準備済み$i にある。 ◎ the text tracks are ready.\

例えば動画においては、 これは次のいずれかに対応する ◎ For example, in video this corresponds to\

  • ~UAは、 少なくとも,[ `現在の再生~位置$の時刻を挟む,現在の~frameと次~frame ]用の~dataを有する。 ◎ the user agent having data for at least the current frame and the next frame when the current playback position is at the instant in time between the two frames, or to\
  • ~UAは、 現在の~frame用の[ 動画~data, 音声~data ]を有する — コレの`現在の再生~位置$が ある~frameの途中にあるとき,少なくとも 少しは再生し続けれるだけの。 ◎ the user agent having the video data for the current frame and audio data to keep playing at least a little when the current playback position is in the middle of a frame.\
`再生は終止して$いる場合、 コレの`現在の再生~位置$は決して進めれないので,この状態になり得ない。 ◎ The user agent cannot be in this state if playback has ended, as the current playback position can never advance in this case.
`HAVE_ENOUGH_DATA@mM (数-値 4 )

`HAVE_FUTURE_DATA$mM 状態に述べたすべての条件は満たされることに 加えて、 次のいずれかの条件も満たされることを指示する: ◎ All the conditions described for the HAVE_FUTURE_DATA state are met, and, in addition, either of the following conditions is also true:

  • ~UAは、[ 次が満たされるような~rateで,~dataは~fetchされている ]ものと見積もっている ⇒ コレの`現在の再生~位置$からコレの `playbackRate$mM で進めた場合に、 再生が`~media資源$の終端に達する前に,可用な~dataが尽きることはない ◎ The user agent estimates that data is being fetched at a rate where the current playback position, if it were to advance at the element's playbackRate, would not overtake the available data before playback reaches the end of the media resource.
  • ~UAは、 これ以上~待機して再生を遅延しても,~dataは得されず何の利得もない状態になった (例えば、~bufferは満杯であるかもしれない)。 ◎ The user agent has entered a state where waiting longer will not result in further data being obtained, and therefore nothing would be gained by delaying playback any further. (For example, the buffer might be full.)

注記: 実施においては、 `HAVE_METADATA$mM と `HAVE_CURRENT_DATA$mM との相違は些細である。 ~~実際にこの相違が関連するのは、 `video$e 要素を `canvas$e 上に塗るときに限られる — そこでは、 何かが描かれるとき( `HAVE_CURRENT_DATA$mM 以上)と何も描かれないとき( `HAVE_METADATA$mM 以下)とが判別される。 同様に、 `HAVE_CURRENT_DATA$mM (現在の~frameしかない)と `HAVE_FUTURE_DATA$mM (少なくともこの~frameと次がある)との相違も,些細にもなり得る (極端な場合,~frame は 1 個しかないとき)。 その区別が~~実際に関わるのは、 ~pageが “~frame刻みの” ~navi用~UIを供するときに限られる。 ◎ In practice, the difference between HAVE_METADATA and HAVE_CURRENT_DATA is negligible. Really the only time the difference is relevant is when painting a video element onto a canvas, where it distinguishes the case where something will be drawn (HAVE_CURRENT_DATA or greater) from the case where nothing is drawn (HAVE_METADATA or less). Similarly, the difference between HAVE_CURRENT_DATA (only the current frame) and HAVE_FUTURE_DATA (at least this frame and the next) can be negligible (in the extreme, only one frame). The only time that distinction really matters is when a page provides an interface for "frame-by-frame" navigation.

`~media要素$ %要素 の準備状態が %旧~状態 から %新~状態 へ変化したときは、 次の手続きに従うモノトスル: ◎ When the ready state of a media element whose networkState is not NETWORK_EMPTY changes, the user agent must follow the steps given below: ◎ Apply the first applicable set of substeps from the following list:

  1. ~IF[ %要素 の `networkState$mM ~EQ `NETWORK_EMPTY$mM ] ⇒ ~RET ◎ ↑
  2. ~IF[ %旧~状態 ~EQ `HAVE_NOTHING$mM ]~AND[ %新~状態 ~EQ `HAVE_METADATA$mM ]: ◎ If the previous ready state was HAVE_NOTHING, and the new ready state is HAVE_METADATA

    1. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ Queue a media element task given the media element to\

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

      注記: この~taskを走らす前に,適切になるなら、 `video$e 要素は,`~event~loop$の仕組みの一部として,具現化-時に~resizeされるよう更新されることになる。 ◎ Before this task is run, as part of the event loop mechanism, the rendering will have been updated to resize the video element if appropriate.

    2. ~RET
  3. ~IF[ %旧~状態 ~EQ `HAVE_METADATA$mM ]~AND[ %新~状態 ~GTE `HAVE_CURRENT_DATA$mM ]: ◎ If the previous ready state was HAVE_METADATA and the new ready state is HAVE_CURRENT_DATA or greater

    1. ~IF[ %要素 に対し生じたのは `load()$mM ~algoが最後に呼出されてから初回である ] ⇒ `~media~taskを~queueする$( %要素, 次の手続き )

      手続きは ⇒ `~eventを発火する$( %要素, `loadeddata$et )
      ◎ If this is the first time this occurs for this media element since the load() algorithm was last invoked, the user agent must queue a media element task given the media element to fire an event named loadeddata at the element.
    2. ~IF[ %新~状態 ~EQ `HAVE_CURRENT_DATA$mM ] ⇒ ~RET ◎ If the new ready state is HAVE_FUTURE_DATA or HAVE_ENOUGH_DATA, then the relevant steps below must then be run also.
  4. ~IF[ %旧~状態 ~GTE `HAVE_FUTURE_DATA$mM ]~AND[ %新~状態 ~LTE `HAVE_CURRENT_DATA$mM ]: ◎ If the previous ready state was HAVE_FUTURE_DATA or more, and the new ready state is HAVE_CURRENT_DATA or less

    1. ~IF[ `readyState$mM 属性が変化する前は, %要素 は`再生-中になり得る$であった ]: ◎ If the media element was potentially playing before its readyState attribute changed to a value lower than HAVE_FUTURE_DATA, and\

      1. ~IF[ %要素 は ~OR↓ を満たしている ]…

        • `再生は終止して$いる
        • `~errorに因り停止され$ている
        • `利用者-ヤリトリ用に静止され$ている
        • `帯域内~内容~用に静止され$ている

        …ならば ⇒ ~RET

        ◎ the element has not ended playback, and playback has not stopped due to errors, paused for user interaction, or paused for in-band content, the user agent must\
      2. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ queue a media element task given the media element to\

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

        手続きは ⇒ `~eventを発火する$( %要素, `waiting$et ) ◎ fire an event named waiting at the element.
    2. ~RET
  5. ~IF[ %旧~状態 ~LTE `HAVE_CURRENT_DATA$mM ]~AND[ %新~状態 ~EQ `HAVE_FUTURE_DATA$mM ]: ◎ If the previous ready state was HAVE_CURRENT_DATA or less, and the new ready state is HAVE_FUTURE_DATA

    1. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ The user agent must queue a media element task given the media element to\

      手続きは ⇒ `~eventを発火する$( %要素, `canplay$et ) ◎ fire an event named canplay at the element.
    2. ~IF[ %要素 の`paused$mM 属性 ~EQ ~F ] ⇒ `再生-中について通知する$( %要素 ) ◎ If the element's paused attribute is false, the user agent must notify about playing for the element.
    3. ~RET
  6. ~IF[ %新~状態 ~EQ `HAVE_ENOUGH_DATA$mM ]: ◎ If the new ready state is HAVE_ENOUGH_DATA

    1. ~IF[ %旧~状態 ~LTE `HAVE_CURRENT_DATA$mM ]: ◎ If the previous ready state was HAVE_CURRENT_DATA or less, the user agent must\

      1. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ queue a media element task given the media element to\

        手続きは ⇒ `~eventを発火する$( %要素, `canplay$et ) ◎ fire an event named canplay at the element, and,\
      2. ~IF[ %要素 の`paused$mM 属性 ~EQ ~F ] ⇒ `再生-中について通知する$( %要素 ) ◎ if the element's paused attribute is false, notify about playing for the element.
    2. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ The user agent must queue a media element task given the media element to\

      手続きは ⇒ `~eventを発火する$( %要素, `canplaythrough$et ) ◎ fire an event named canplaythrough at the element.
    3. ~IF[ %要素 は`自動再生に適格$でない ] ⇒ ~RET ◎ If the element is not eligible for autoplay, then the user agent must abort these substeps.
    4. 任意選択で、 次のいずれか一つを行う:

      • ~RET (何もしない)
      • 下の手続き (A) を走らす
      • ~IF[ %要素 は `video$e 要素である ] ⇒ %要素 が`表示域に交差-$しているかどうか観測し始めた上で,下の規則 (B) に従う
      ◎ The user agent may run the following substeps: ◎ ↓

      手続き (A) は、 次で与えられる:

      1. `paused$mM 属性 ~SET ~F ◎ Set the paused attribute to false.
      2. ~IF[ %要素 の`~posterを示すか$ ~EQ ~T ]:

        1. %要素 の`~posterを示すか$ ~SET ~F
        2. `~tTを時間に合わせる$( %要素 )
        ◎ If the element's show poster flag is true, set it to false and run the time marches on steps.
      3. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ Queue a media element task given the element to\

        手続きは ⇒ `~eventを発火する$( %要素, `play$et ) ◎ fire an event named play at the element.
      4. `再生-中について通知する$( %要素 ) ◎ Notify about playing for the element.

      規則 (B) は、 次で与えられる: ◎ Alternatively, if the element is a video element,\

      • %要素 が`表示域に交差-$し始めたときは ⇒ ~IF[ その時点で, %要素 は`自動再生に適格$である ] ⇒ 上の手続き (A) を走らす ◎ the user agent may start observing whether the element intersects the viewport. When the element starts intersecting the viewport, if the element is still eligible for autoplay, run the substeps above.\
      • %要素 は`表示域に交差-$しなくなったときは、 任意選択で ⇒ ~IF[ その時点で,[ %要素 の`自動再生~可能か$ ~EQ ~T ]~AND[ %要素 は `autoplay$aM 属性を有する ]] ⇒ 下の手続き (C) を走らす ◎ Optionally, when the element stops intersecting the viewport, if the can autoplay flag is still true and the autoplay attribute is still specified, run the following substeps:

      手続き (C) は、 次で与えられる:

      1. `内部~静止-手続き$( %要素 ) ◎ Run the internal pause steps and\
      2. `自動再生~可能か$ ~SET ~T ◎ set the can autoplay flag to true.
      3. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ Queue a media element task given the element to\

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

      注記: [ `自動再生~可能か$ ~EQ ~T ]の間は、 %要素 が`表示域に交差-$[ し始める/しなくなる ]たびに,[ 再生する/静止する ]ための手続きも走らされ得る。 ◎ The substeps for playing and pausing can run multiple times as the element starts or stops intersecting the viewport, as long as the can autoplay flag is true.

      注記: ~UAは、 自動再生を~supportする必要はない。 また、 ~UAには,そのことに関する利用者-選好を尊守することが示唆される。 作者には、 ~scriptを利用して動画~再生-を強制するのでなく、 `autoplay$aM 属性を利用して,利用者が欲する挙動に上書きできるようにすることが督促される。 ◎ User agents do not need to support autoplay, and it is suggested that user agents honor user preferences on the matter. Authors are urged to use the autoplay attribute rather than using script to force the video to play, so as to allow the user to override the behavior if so desired.

注記: ~media要素の準備状態は、 これらの状態を不連続に~~飛び移ることもあり得る。 例えば, `HAVE_METADATA$mM から — `HAVE_CURRENT_DATA$mM, `HAVE_FUTURE_DATA$mM を~~飛ばして — `HAVE_ENOUGH_DATA$mM へ~~直に~~飛ぶなど。 ◎ It is possible for the ready state of a media element to jump between these states discontinuously. For example, the state of a media element can jump straight from HAVE_METADATA to HAVE_ENOUGH_DATA without passing through the HAVE_CURRENT_DATA and HAVE_FUTURE_DATA states.

`readyState@mM 取得子~手続きは ⇒ ~RET 上に述べた,コレの現在の準備状態を述べる値 ◎ The readyState IDL attribute must, on getting, return the value described above that describes the current ready state of the media element.

`autoplay@aM 属性は、 `真偽-属性$である。 在るときは、 ~UAは (上の~algoで述べたように),可能になり次第,`~media資源$の再生を自動的に始めることになる。 【! *?without stopping】 ◎ The autoplay attribute is a boolean attribute. When present, the user agent (as described in the algorithm described herein) will automatically begin playback of the media resource as soon as it can do so without stopping.

注記: 作者には、 ~scriptを利用して自動的な再生を誘発せずに `autoplay$aM 属性を利用することが督促される。 そうすれば利用者は自動的な再生を欲さないとき — 例: ~screen~readerを利用しているとき — には上書きできるようになるので。 作者には、 自動的な再生の挙動を まったく利用しない代わりに,利用者が再生を明示的に開始するのを~UAに待機させることを考慮することも奨励される。 ◎ Authors are urged to use the autoplay attribute rather than using script to trigger automatic playback, as this allows the user to override the automatic playback when it is not desired, e.g. when using a screen reader. Authors are also encouraged to consider not using the automatic playback behavior at all, and instead to let the user agent wait for the user to start playback explicitly.

`autoplay@mM ~IDL属性は、 `autoplay$aM 内容~属性を`反映する$モノトスル。 ◎ The autoplay IDL attribute must reflect the content attribute of the same name.

4.8.11.8. ~media資源の再生-法
%media.`paused$mM
再生は静止されて[ いれば ~T / いなければ ~F ]を返す。 ◎ Returns true if playback is paused; false otherwise.
%media.`ended$mM
再生は`~media資源$の終端に[ 達したならば ~T / ~ELSE_ ~F ]を返す。 ◎ Returns true if playback has reached the end of the media resource.
%media.`defaultPlaybackRate$mM [ = %value ]
利用者が`~media資源$を早送り/逆行していないときの,再生の既定の~rateを返す。 ◎ Returns the default rate of playback, for when the user is not fast-forwarding or reversing through the media resource.
設定して,再生の既定の~rateを変更できる。 ◎ Can be set, to change the default rate of playback.
この既定の~rateは,再生には直接的な効果はないが、 利用者が早送り~modeに切替えた後に通常の再生~modeに戻ったときは,再生~rateも既定の~rateに戻ることになることが期待される。 ◎ The default rate has no direct effect on playback, but if the user switches to a fast-forward mode, when they return to the normal playback mode, it is expected that the rate of playback will be returned to the default rate of playback.
%media.`playbackRate$mM [ = %value ]
現在の再生~rateを返す。 通常の速度は 1.0 。 ◎ Returns the current rate playback, where 1.0 is normal speed.
設定して,再生の~rateを変更できる。 ◎ Can be set, to change the rate of playback.
%media.`preservesPitch$mM
`playbackRate$mM (再生~rate)が 1.0 でない間も,音高を保全するよう調整されるならば ~T を返す。 既定では ~T を返す。 ◎ Returns true if pitch-preserving algorithms are used when the playbackRate is not 1.0. The default value is true.
~F に設定して、 `~media資源$の音声の音高が `playbackRate$mM に応じて変化するようにさせられる。 これは、 審美的または処理能の理由で有用になる。 ◎ Can be set to false to have the media resource's audio pitch change up or down depending on the playbackRate. This is useful for aesthetic and performance reasons.
%media.`played$mM
~UAが再生した`~media資源$の範囲たちを表現する, `TimeRanges$I ~objを返す。 ◎ Returns a TimeRanges object that represents the ranges of the media resource that the user agent has played.
%media.`play()$mM
`paused$mM 属性を ~F に設定する。 加えて、 必要yなら,`~media資源$を読込んで再生を始める。 再生が終止していた場合、 始端から開始し直すことになる。 ◎ Sets the paused attribute to false, loading the media resource and beginning playback if necessary. If the playback had ended, will restart it from the start.
%media.`pause()$mM
`paused$mM 属性を ~T に設定する。 加えて、 必要yなら,`~media資源$を読込む。 ◎ Sets the paused attribute to true, loading the media resource if necessary.

`paused@mM ~IDL属性は、 コレは静止されているかどうかを表現する。 初期~時には ~T になるモノトスル。 ◎ The paused attribute represents whether the media element is paused or not. The attribute must initially be true.

`~media要素$は、 ~OR↓ を満たしている間は, `阻まれて@ いるとされる:

  • `readyState$mM 属性 ~IN { `HAVE_NOTHING$mM, `HAVE_METADATA$mM, `HAVE_CURRENT_DATA$mM }
  • `利用者-ヤリトリ用に静止され$ている
  • `帯域内~内容~用に静止され$ている
◎ A media element is a blocked media element if its readyState attribute is in the HAVE_NOTHING state, the HAVE_METADATA state, or the HAVE_CURRENT_DATA state, or if the element has paused for user interaction or paused for in-band content.

`~media要素$は、 ~AND↓ を満たしている間は, `再生-中になり得る@ とされる:

  • `paused$mM 属性 ~EQ ~F
  • `再生は終止して$いない
  • 再生は`~errorに因り停止され$ていない
  • `阻まれて$いない
◎ A media element is said to be potentially playing when its paused attribute is false, the element has not ended playback, playback has not stopped due to errors, and the element is not a blocked media element.

注記: `再生-中になり得る$要素は、[ その `readyState$mM 属性が `HAVE_FUTURE_DATA$mM 未満の値に変化した ]ことに因る結果,再生を停止したときには, `waiting$et ~eventが `発火され得る@#fire-waiting-when-waiting$。 ◎ A waiting DOM event can be fired as a result of an element that is potentially playing stopping playback due to its readyState attribute changing to a value lower than HAVE_FUTURE_DATA.

`~media要素$は、 ~AND↓ を満たしている間は, `自動再生に適格@ とされる: ◎ A media element is said to be eligible for autoplay when all of the following are true:

  • `自動再生~可能か$ ~EQ ~T ◎ its can autoplay flag is true;
  • `paused$mM 属性 ~EQ ~T ◎ its paused attribute is true;
  • `autoplay$aM 属性を有している ◎ it has an autoplay attribute specified;
  • `閲覧~文脈~sandbox化( 自動的な特能 )~flag$ ~NIN 要素の`~node文書$の`作動中な~sandbox法~flag集合$ ◎ its node document's active sandboxing flag set does not have the sandboxed automatic features browsing context flag set; and
  • 要素の`~node文書$には `autoplay$l 特能の`利用は許容されて$いる ◎ its node document is allowed to use the "autoplay" feature.

`~media要素$は、[ ~UA, および~systemが現在の文脈において~media再生を許容する ]ならば, `再生は許容されて@ いるとされる。 ◎ A media element is said to be allowed to play if the user agent and the system allow media playback in the current context.

注記: 例えば~UAは、 `~media要素$の `Window^I は`一過な作動化を有して$いるときに限り, 再生を許容することもできるが、 `消音-$されている間は,例外的に再生を許容することもできる。 ◎ For example, a user agent could allow playback only when the media element's Window object has transient activation, but an exception could be made to allow playback while muted.

`~media要素$は、 ~AND↓ を満たしている間は, `再生は終止して@ いるとされる: ◎ A media element is said to have ended playback when:

  • `readyState$mM 属性 ~GTE `HAVE_METADATA$mM ◎ The element's readyState attribute is HAVE_METADATA or greater, and
  • ~OR↓: ◎ Either:

    • ~AND↓:

      • `現在の再生~位置$は`~media資源$の終端にある ◎ The current playback position is the end of the media resource, and
      • `再生~方向$ ~EQ 順方向 ◎ The direction of playback is forwards, and
      • `loop$aM 属性を有していない ◎ The media element does not have a loop attribute specified.
    • ~AND↓: ◎ Or:

      • `現在の再生~位置$は`アリな最も早い位置$である ◎ The current playback position is the earliest possible position, and
      • `再生~方向$ ~EQ 逆方向 ◎ The direction of playback is backwards.
`ended@mM 取得子~手続きは ⇒ ~RET ~IS[ 最後に`~event~loop$の`最初の段$に達した時点で 次が満たされていた ] ⇒ [ コレの`再生は終止して$いる ]~AND[ コレの`再生~方向$ ~EQ 順方向 ] ◎ The ended attribute must return true if, the last time the event loop reached step 1, the media element had ended playback and the direction of playback was forwards, and false otherwise.

`~media要素$は、 ~AND↓ を満たしている間は, `~errorに因り停止され@ ているとされる:

  • `readyState$mM 属性 ~GTE `HAVE_METADATA$mM
  • ~UAは要素の`~media~data$の処理している間に `致命的でない~errorに遭遇した@#non-fatal-media-error$
  • その~errorに因り,`現在の再生~位置$にある内容を再生できなくなった
◎ A media element is said to have stopped due to errors when the element's readyState attribute is HAVE_METADATA or greater, and the user agent encounters a non-fatal error during the processing of the media data, and due to that error, is not able to play the content at the current playback position.

`~media要素$は、 ~AND↓ を満たしている間は, `利用者-ヤリトリ用に静止され@ ているとされる:

  • `paused$mM 属性 ~EQ ~F
  • `readyState$mM 属性 ~IN { `HAVE_FUTURE_DATA$mM, `HAVE_ENOUGH_DATA$mM }
  • `~media資源$内の[ 利用者が再生を継続するかどうか選択する必要がある ]地点に達した
◎ A media element is said to have paused for user interaction when its paused attribute is false, the readyState attribute is either HAVE_FUTURE_DATA or HAVE_ENOUGH_DATA and the user agent has reached a point in the media resource where the user has to make a selection for the resource to continue.

`~media要素$は、 `再生は終止して$いると同時に`利用者-ヤリトリ用に静止され$ていることもあり得る。 ◎ It is possible for a media element to have both ended playback and paused for user interaction at the same time.

`再生-中になり得る$`~media要素$ %要素 が`利用者-ヤリトリ用に静止され$たため,再生-を停止したときは、 次を行うモノトスル ⇒ `~media~taskを~queueする$( %要素, 次の手続き ) ◎ When a media element that is potentially playing stops playing because it has paused for user interaction, the user agent must queue a media element task given the media element to\

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

`~media要素$は、 ~AND↓ を満たしている間は, `帯域内~内容~用に静止され@ ているとされる:

  • `paused$mM 属性 ~EQ ~F
  • `readyState$mM 属性 ~IN { `HAVE_FUTURE_DATA$mM, `HAVE_ENOUGH_DATA$mM }
  • ~UAは、 次のいずれかを再生するために,`~media資源$の再生を休止している:

    • `~media資源$に一時的に留められた,長さ 0 でない内容
    • `~media資源$のある区分に一時的に留められた,その区分より長い内容
◎ A media element is said to have paused for in-band content when its paused attribute is false, the readyState attribute is either HAVE_FUTURE_DATA or HAVE_ENOUGH_DATA and the user agent has suspended playback of the media resource in order to play content that is temporally anchored to the media resource and has a nonzero length, or to play content that is temporally anchored to a segment of the media resource but has a length longer than that segment.

`~media要素$が`帯域内~内容~用に静止され$ることになる例としては、 ~UAが外部の~WebVTT~fileから `Descriptions$st を再生していて、 ある~cue用に生成された合成された発話の長さが`開始~時刻$tCから`終了~時刻$tCまでの時間より長い場合が挙げられる。 ◎ One example of when a media element would be paused for in-band content is when the user agent is playing audio descriptions from an external WebVTT file, and the synthesized speech generated for a cue is longer than the time between the text track cue start time and the text track cue end time.


`~media要素$ %要素 の[ `再生~方向$ ~EQ 順方向 ]の下で, %要素 の`現在の再生~位置$が`~media資源$の終端に達したときは、 次の手続きに従うモノトスル: ◎ When the current playback position reaches the end of the media resource when the direction of playback is forwards, then the user agent must follow these steps:

  1. ~IF[ %要素 は `loop$aM 属性を有する ]:

    1. `~seekする$( `~media資源$の`アリな最も早い位置$ )
    2. ~RET
    ◎ If the media element has a loop attribute specified, then seek to the earliest possible position of the media resource and return.
  2. ~Assert: 上で定義したように, %要素 の `ended$mM ~IDL属性は、 `~event~loop$が`最初の段$に戻った時点から ~T を返すようになる。 ◎ As defined above, the ended IDL attribute starts returning true once the event loop returns to step 1.
  3. `~media~taskを~queueする$( %要素, 次の手続き ): ◎ Queue a media element task given the media element and the following steps:

    手続きは:

    1. `~eventを発火する$( %要素, `timeupdate$et ) ◎ Fire an event named timeupdate at the media element.
    2. ~IF[ %要素 の`再生は終止して$いる ]~AND[ %要素 の`再生~方向$ ~EQ 順方向 ]~AND[ %要素 の `paused$mM ~EQ ~F ]: ◎ If the media element has ended playback, the direction of playback is forwards, and paused is false, then:

      1. %要素 の `paused$mM 属性 ~SET ~T ◎ Set the paused attribute to true.
      2. `~eventを発火する$( %要素, `pause$et ) ◎ Fire an event named pause at the media element.
      3. `再生待ち~promiseたちを却下する$( %要素 の`再生待ち~promiseたちを取り出す$, `AbortError$E 例外 ) ◎ Take pending play promises and reject pending play promises with the result and an "AbortError" DOMException.
    3. `~eventを発火する$( %要素, `ended$et ) ◎ Fire an event named ended at the media element.

[ `再生~方向$ ~EQ 逆方向 ]の下で,`現在の再生~位置$が`~media資源$ %要素 の`アリな最も早い位置$に達した†ときは、 次を行うモノトスル ⇒ `~media~taskを~queueする$( %要素, 次の手続き ) ◎ When the current playback position reaches the earliest possible position of the media resource when the direction of playback is backwards, then the user agent must only queue a media element task given the media element to\

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

注記†: この “達した” は、 通常の再生によるものに限られない。 一例として、 `~seeking$を介しても達し得る。 ◎ The word "reaches" here does not imply that the current playback position needs to have changed during normal playback; it could be via seeking, for instance.


`defaultPlaybackRate@mM 属性は、 `~media資源$に欲される再生-速度を その内在的~速度からの倍数として与える。 その: ◎ The defaultPlaybackRate attribute gives the desired speed at which the media resource is to play, as a multiple of its intrinsic speed. The attribute is mutable:\

  • 取得子~手続きは、 最後に設定された値を返す — 初期~時には 1.0 に設定されるとする。 ◎ on getting it must return the last value it was set to, or 1.0 if it hasn't yet been set;\
  • 設定子~手続きは、 この属性を所与の値に設定する。 ◎ on setting the attribute must be set to the new value.

注記: `defaultPlaybackRate$mM は、 利用者に`~UIを公開する$ときに~UAにより利用される。 ◎ The defaultPlaybackRate is used by the user agent when it exposes a user interface to the user.

`playbackRate@mM 属性は、 実効~再生~rateを,`~media資源$の内在的~速度の倍数として与える — それが,この資源を再生する速度になる。 この値 ~NEQ `defaultPlaybackRate$mM の場合、[ 利用者は[ 高速な順方向/低速~motion ]再生などの特能を利用している ]ことを含意する。 その: ◎ The playbackRate attribute gives the effective playback rate, which is the speed at which the media resource plays, as a multiple of its intrinsic speed. If it is not equal to the defaultPlaybackRate, then the implication is that the user is using a feature such as fast forward or slow motion playback. The attribute is mutable:\

  • 取得子~手続きは、 最後に設定された値を返す — 初期~時には 1.0 に設定されているとする。 ◎ on getting it must return the last value it was set to, or 1.0 if it hasn't yet been set;\
  • 設定子~手続きは: ◎ on setting, the user agent must follow these steps:

    1. ~IF[ ~UAは 所与の値を~supportしない ] ⇒ ~THROW `NotSupportedError$E ◎ If the given value is not supported by the user agent, then throw a "NotSupportedError" DOMException.
    2. `playbackRate$mM ~SET 所与の値 ◎ Set playbackRate to the new value, and\
    3. ~IF[ コレは`再生-中になり得る$ ] ⇒ 再生~速度を変更する ◎ if the element is potentially playing, change the playback speed.

`~media要素$ %要素 の [ `defaultPlaybackRate$mM / `playbackRate$mM ]属性の値が変化したときは (~scriptにより設定されようが,~UAにより直に変更されようが (例:利用者からの制御に呼応して))、 ~UAは,次に従うモノトスル: ◎ When the defaultPlaybackRate or playbackRate attributes change value (either by being set by script or by being changed directly by the user agent, e.g. in response to user control) the user agent must\

  • `~media~taskを~queueする$( %要素, 次の手続き ) ◎ queue a media element task given the media element to\

    手続きは ⇒ `~eventを発火する$( %要素, `ratechange$et ) ◎ fire an event named ratechange at the media element.\
  • 再生が知覚-可能なほど途切れたり消音されないよう,滑らかに処理する。 【特に、音高を保全している場合。】 ◎ The user agent must process attribute changes smoothly and must not introduce any perceivable gaps or muting of playback in response.

`preservesPitch@mM 属性は、 再生の間,音声は元の音高が保全されるよう調整されるかどうかを表現する ( ~T ならば保全される):

  • 取得子~手続きは、 最後に設定された値を返す — 初期~時には ~T に設定されるモノトスル。
  • 設定子~手続きは、 この属性を所与の値に設定する。 再生-中に値が変更されても、 再生が知覚-可能なほど途切れたり消音されないよう切替えるモノトスル。
◎ The preservesPitch getter steps are to return true if a pitch-preserving algorithm is in effect during playback. The setter steps are to correspondingly switch the pitch-preserving algorithm on or off, without any perceivable gaps or muting of playback. By default, such a pitch-preserving algorithm must be in effect (i.e., the getter will initially return true).

`played@mM 取得子~手続きは ⇒ ~RET 次を表現する,静的かつ`正規化-済み$な新たな `TimeRanges$I ~obj ⇒ 現時点における,コレの`~media資源$の`~media時列線$上の[ 通常の再生の間に、 通例的に`現在の再生~位置$が単調に増加して達した,一連の範囲 ] ◎ The played attribute must return a new static normalized TimeRanges object that represents the ranges of points on the media timeline of the media resource reached through the usual monotonic increase of the current playback position during normal playback, if any, at the time the attribute is evaluated.

属性~取得子が毎回 新たな~objを返すのは不良な~patternであるが、 今更それを変更するのは高くつくので,そうなっている。 そのようなふるまいは、 新たな~APIには複製されない。 ◎ Returning a new object each time is a bad pattern for attribute getters and is only enshrined here as it would be costly to change it. It is not to be copied to new APIs.


各 `~media要素$は `再生待ち~promise~list@ を持つ — 初期~時には空になるモノトスル。 ◎ Each media element has a list of pending play promises, which must initially be empty.

`~media要素$ %要素 の `再生待ち~promiseたちを取り出す@ ときは、 次を走らすモノトスル: ◎ To take pending play promises for a media element, the user agent must run the following steps:

  1. %~promise~list ~LET %要素 の`再生待ち~promise~list$の複製 ◎ Let promises be an empty list of promises. ◎ Copy the media element's list of pending play promises to promises.
  2. %要素 の`再生待ち~promise~list$を空にする ◎ Clear the media element's list of pending play promises.
  3. ~RET %~promise~list ◎ Return promises.

`~media要素$用の `再生待ち~promiseたちを解決する@ ときは、 所与の ( ~promise~list %~promise~list ) に対し,次を走らすモノトスル ⇒ %~promise~list を成す ~EACH( %~promise ) に対し ⇒ `undefined^jv で %~promise を解決する ◎ To resolve pending play promises for a media element with a list of promises promises, the user agent must resolve each promise in promises with undefined.

`~media要素$用の `再生待ち~promiseたちを却下する@ ときは、 所与の ( ~promise~list %~promise~list, 例外~名 %~error ) に対し,次を走らすモノトスル ⇒ %~promise~list を成す ~EACH( %~promise ) に対し ⇒ %~error 例外で %~promise を却下する ◎ To reject pending play promises for a media element with a list of promise promises and an exception name error, the user agent must reject each promise in promises with error.

`再生-中について通知する@ ときは、 所与の ( `~media要素$ %要素 ) に対し,次を走らすモノトスル: ◎ To notify about playing for a media element, the user agent must run the following steps:

  1. %~promise~list ~LET %要素 の`再生待ち~promiseたちを取り出す$ ◎ Take pending play promises and let promises be the result.
  2. `~media~taskを~queueする$( %要素, 次の手続き ): ◎ Queue a media element task given the element and the following steps:

    手続きは:

    1. `~eventを発火する$( %要素, `playing$et ) ◎ Fire an event named playing at the element.
    2. `再生待ち~promiseたちを解決する$( %~promise~list ) ◎ Resolve pending play promises with promises.

`play()@mM ~method~手続きは: ◎ When the play() method on a media element is invoked, the user agent must run the following steps.

  1. ~IF[ コレの`再生は許容されて$いない ] ⇒ ~RET `却下される~promise$( `NotAllowedError$E 例外 ) ◎ If the media element is not allowed to play, then return a promise rejected with a "NotAllowedError" DOMException.
  2. %error ~LET コレの `error$mM 属性~値
  3. ~IF[ %error ~NEQ ~NULL ]~AND[ %error の`~code$ ~EQ `MEDIA_ERR_SRC_NOT_SUPPORTED$mE ] ⇒ ~RET `却下される~promise$( `NotSupportedError$E 例外 ) ◎ If the media element's error attribute is not null and its code is MEDIA_ERR_SRC_NOT_SUPPORTED, then return a promise rejected with a "NotSupportedError" DOMException.

    注記: これは、 `専用の~media~source失敗~手続き$を走らせたことを意味する。 再生は、[ `~media要素~読込n~algo$により `error$mM 属性が ~NULL にされる ]まで,アリでない。 ◎ This means that the dedicated media source failure steps have run. Playback is not possible until the media element load algorithm clears the error attribute.

  4. %~promise ~LET 新たな~promise ◎ Let promise be a new promise and\
  5. `再生待ち~promise~list$に %~promise を付加する ◎ append promise to the list of pending play promises.
  6. `内部~再生-手続き$( コレ ) ◎ Run the internal play steps for the media element.
  7. ~RET %~promise ◎ Return promise.

`内部~再生-手続き@ は、 所与の ( `~media要素$ %要素【! media element → 要素 】 ) に対し,次を走らす: ◎ The internal play steps for a media element are as follows:

  1. ~IF[ %要素 の `networkState$mM 属性~値 ~EQ `NETWORK_EMPTY$mM ] ⇒ %要素 の`資源~選定~algo$を呼出す ◎ If the media element's networkState attribute has the value NETWORK_EMPTY, invoke the media element's resource selection algorithm.
  2. ~IF[ %要素 の`再生は終止して$いる ]~AND[ %要素 の`再生~方向$ ~EQ 順方向 ] ⇒ `~seekする$( %要素 の`~media資源$の`アリな最も早い位置$ ) ◎ If the playback has ended and the direction of playback is forwards, seek to the earliest possible position of the media resource.

    注記: これは、 ~UAに`次を行わせることになる@#seekUpdate$ ⇒ %要素 に向けて `timeupdate$et ~eventを発火する~taskを~queueする ◎ This will cause the user agent to queue a media element task given the media element to fire an event named timeupdate at the media element.

  3. %準備状態 ~LET %要素 の `readyState$mM 属性~値
  4. ~IF[ %要素 の `paused$mM 属性~値 ~EQ ~T ]: ◎ If the media element's paused attribute is true, then:

    1. %要素 の `paused$mM 属性 ~SET ~F ◎ Change the value of paused to false.
    2. ~IF[ %要素 の`~posterを示すか$ ~EQ ~T ]: ◎ If the show poster flag is true,\

      1. %要素 の`~posterを示すか$ ~SET ~F ◎ set the element's show poster flag to false and\
      2. `~tTを時間に合わせる$( %要素 ) ◎ run the time marches on steps.
    3. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ Queue a media element task given the media element to\

      手続きは ⇒ `~eventを発火する$( %要素, `play$et ) ◎ fire an event named play at the element.
    4. ~IF[ %準備状態 ~IN { `HAVE_NOTHING$mM, `HAVE_METADATA$mM, `HAVE_CURRENT_DATA$mM } ] ⇒ `~media~taskを~queueする$( %要素, 次の手続き ) ◎ If the media element's readyState attribute has the value HAVE_NOTHING, HAVE_METADATA, or HAVE_CURRENT_DATA, queue a media element task given the media element to\

      手続きは ⇒ `~eventを発火する$( %要素, `waiting$et ) ◎ fire an event named waiting at the element.
    5. ~ELSE ( %準備状態 ~IN { `HAVE_FUTURE_DATA$mM, `HAVE_ENOUGH_DATA$mM } ) ⇒ `再生-中について通知する$( %要素 ) ◎ Otherwise, the media element's readyState attribute has the value HAVE_FUTURE_DATA or HAVE_ENOUGH_DATA: notify about playing for the element.
  5. ~ELIF[ %準備状態 ~IN { `HAVE_FUTURE_DATA$mM, `HAVE_ENOUGH_DATA$mM } ]: ◎ Otherwise, if the media element's readyState attribute has the value HAVE_FUTURE_DATA or HAVE_ENOUGH_DATA,\

    1. %~promise~list ~LET %要素 の`再生待ち~promiseたちを取り出す$ ◎ take pending play promises and\
    2. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ queue a media element task given the media element to\

      手続きは ⇒ `再生待ち~promiseたちを解決する$( %~promise~list ) ◎ resolve pending play promises with the result.

    注記: %要素 はすでに再生-中にあるが、 ~queueされた~taskが走る前に,再生待ち~promiseが却下されることもあり得る。 ◎ The media element is already playing. However, it's possible that promise will be rejected before the queued task is run.

  6. %要素 の`自動再生~可能か$ ~SET ~F ◎ Set the media element's can autoplay flag to false.
~UAは、 `~media要素$ %要素 を静止するよう要求されたとき【いつ要求されたものとされる?】は、 次を走らすモノトスル ⇒ %要素 上の `pause$mM ~method手続き() ◎ When the pause() method is invoked, and when the user agent is required to pause the media element, the user agent must run the following steps:

`pause()@mM ~method~手続きは: ◎ ↑

  1. ~IF[ コレの`networkState$mM 属性~値 ~EQ `NETWORK_EMPTY$mM ] ⇒ コレの`資源~選定~algo$を呼出す ◎ If the media element's networkState attribute has the value NETWORK_EMPTY, invoke the media element's resource selection algorithm.
  2. `内部~静止-手続き$( コレ ) ◎ Run the internal pause steps for the media element.

`内部~静止-手続き@ は、 所与の ( `~media要素$ %要素 ) に対し,次に従う: ◎ The internal pause steps for a media element are as follows:

  1. %要素 の`自動再生~可能か$ ~SET ~F ◎ Set the media element's can autoplay flag to false.
  2. ~IF[ %要素 の`paused$mM 属性 ~EQ ~T ] ⇒ ~RET ◎ If the media element's paused attribute is false, run the following steps:
  3. %要素 の`paused$mM 属性 ~SET ~T ◎ Change the value of paused to true.
  4. %~promise~list ~LET %要素 の`再生待ち~promiseたちを取り出す$ ◎ Take pending play promises and let promises be the result.
  5. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ Queue a media element task given the media element and the following steps:

    手続きは:

    1. `~eventを発火する$( %要素, `timeupdate$et ) ◎ Fire an event named timeupdate at the element.
    2. `~eventを発火する$( %要素, `pause$et ) ◎ Fire an event named pause at the element.
    3. %要素 の`再生待ち~promiseたちを却下する$( %~promise~list, `AbortError$E 例外 ) ◎ Reject pending play promises with promises and an "AbortError" DOMException.
  6. %要素 の`公式的な再生~位置$ ~SET `現在の再生~位置$ ◎ Set the official playback position to the current playback position.

要素の `再生~方向@ は、[ `playbackRate$mM ~GTE 0 ならば順方向 / ~ELSE_ 逆方向 ]とする。 ◎ If the element's playbackRate is positive or zero, then the direction of playback is forwards. Otherwise, it is backwards.

`~media要素$ %要素 は、[ `再生-中になり得る$ ]~AND[ %要素 の`~node文書$は`全部的に作動中$である ]下では、 %要素 の`現在の再生~位置$は,[ `~media時列線$の時計の単位~時間 ~EQ ( ~mediaの単位~時間 × %要素 の `playbackRate$mM ) ]になるように,単調に増加するモノトスル。 (この仕様は,これを常に `増加-^i と記しているが、 実際には,要素の `playbackRate$mM が負である場合は`減少-^emになる。) ◎ When a media element is potentially playing and its Document is a fully active Document, its current playback position must increase monotonically at the element's playbackRate units of media time per unit time of the media timeline's clock. (This specification always refers to this as an increase, but that increase could actually be a decrease if the element's playbackRate is negative.)

注記: 要素の `playbackRate$mM は 0.0 にもなり得る。 その事例では、 再生が静止されていなくても`現在の再生~位置$は移動しない ( `paused$mM ~T にはならず, `pause$et ~eventは発火されない)。 ◎ The element's playbackRate can be 0.0, in which case the current playback position doesn't move, despite playback not being paused (paused doesn't become true, and the pause event doesn't fire).

注記: この仕様は、 ~UAが適切な再生~rateをどう達成するかは定義しない。 それは、 可用な~protocolや~mediaに依存して,概ね可能にもなり得る — ~UAが~serverと折衝して、 ~clientが実際に何~frameか[ 落さずに済む/補間せずに済む ]よう,~serverに~media~dataを適切な~rateで供してもらえれば (~rateが変更されてから,~serverが~streamの再生~rateを更新するまでの期間は別として)。 ◎ This specification doesn't define how the user agent achieves the appropriate playback rate — depending on the protocol and media available, it is plausible that the user agent could negotiate with the server to have the server provide the media data at the appropriate rate, so that (except for the period between when the rate is changed and when the server updates the stream's playback rate) the client doesn't actually have to drop or interpolate any frames.

どの時点であれ,~UAが`安定~状態を待受ける$ときは、 `公式的な再生~位置$は,`現在の再生~位置$に設定するモノトスル。 ◎ Any time the user agent provides a stable state, the official playback position must be set to the current playback position.

次のいずれかに該当する間は、 音声は`消音-$するモノトスル。 ◎ ↓

  • `再生~方向$ ~EQ 逆方向 ◎ While the direction of playback is backwards, any corresponding audio must be muted.\
  • 要素の `playbackRate$mM は,~UAが音声を有用に再生できないほど低過ぎるか高過ぎる ◎ While the element's playbackRate is so low or so high that the user agent cannot play audio usefully, the corresponding audio must also be muted.\

[ 要素の `playbackRate$mM ~NEQ 1.0 ]の間は、 音声を速めたり遅めるときに[ 元の音高を保全するような音高~調整 ]を[ 要素の `preservesPitch$mM ]が[ ~T をとる間は適用する/ ~F をとる間は適用しない ]モノトスル。 ◎ If the element's playbackRate is not 1.0 and preservesPitch is true, the user agent must apply pitch adjustment to preserve the original pitch of the audio. Otherwise, the user agent must speed up or slow down the audio without any pitch adjustment.

`~media要素$が`再生-中になり得る$ときは、 その音声~dataは,要素の`実効~media音量$で`現在の再生~位置$に同期するよう再生するモノトスル。 ~UAは、 `~event~loop$が最後に`最初の段$に達した時点で可能化されている音声~trackからの音声を再生するモノトスル。 ◎ When a media element is potentially playing, its audio data played must be synchronized with the current playback position, at the element's effective media volume. The user agent must play the audio from audio tracks that were enabled when the event loop last reached step 1.

`~media要素$用の音声は、 `再生-中になり得る$ときを除き,再生されないモノトスル。 ◎ When a media element is not potentially playing, audio must not play for the element.

`~media要素$が[ `再生-中になり得る$ ]~AND[ `文書~内$にない ]間は、 動画は再生しないモノトスルが、 音声~成分は,あるならば再生するベキである。 ~media要素は、 それへの参照がすべて除去されたとしても,それだけでは再生-は停止しないモノトスル — ~media要素が~garbage収集されてもヨイのは、 それ以上~要素の音声を再生できなくなって以降に限られる。 ◎ Media elements that are potentially playing while not in a document must not play any video, but should play any audio component. Media elements must not stop playing just because all references to them have been removed; only once a media element is in a state where no further audio could ever be played by that element may the element be garbage collected.

注記: 要素への明示的な参照は存在しなくとも,要素が音声を再生することはあり得る — そのような要素は、 依然として能動的に再生していない場合でも: 一例として、[ 静止されなくなったが,内容を~bufferする待機-中に停滞したか、 あるいは,~bufferしていて再生を始めるような `suspend$et ~event~listenerがある ]こともある。 ~media要素の`~media資源$に音声~trackが伴われない場合でも、 その`~media資源$を変更するような~event~listenerがあった場合,最終的に再び音声を再生できることもある。 ◎ It is possible for an element to which no explicit references exist to play audio, even if such an element is not still actively playing: for instance, it could be unpaused but stalled waiting for content to buffer, or it could be still buffering, but with a suspend event listener that begins playback. Even a media element whose media resource has no audio tracks could eventually play audio again if it had an event listener that changes the media resource.


【 この箇所に記されていた`~tT$に関連な記述 ( “`~tTを時間に合わせる$” ~algo他) は、 編集の都合により, `別~page@~HEtrack#playing-the-media-resource$にて。 】


注記: `~media要素$の`~node文書$が`全部的に作動中$でなくなった場合、 文書が再び作動中になるまで,`再生は停止する@#media-playback$ことになる。 ◎ If the media element's node document stops being a fully active document, then the playback will stop until the document is active again.

`~media要素$ %要素 が`文書から除去され$たときは、 次を走らすモノトスル: ◎ When a media element is removed from a Document, the user agent must run the following steps:

  1. 次の手続きを`同期区間$として,`安定~状態を待受ける$ (これは、 %要素 を除去した`~task$を継続できるようにする): ◎ Await a stable state, allowing the task that removed the media element from the Document to continue. The synchronous section consists of all the remaining steps of this algorithm. (Steps in the synchronous section are marked with ⌛.)

    1. ~IF[ %要素 は`文書~内$にない ] ⇒ ~RET ◎ ⌛ If the media element is in a document, return.
    2. `内部~静止-手続き$( %要素 ) ◎ ⌛ Run the internal pause steps for the media element.
4.8.11.9. ~seek法
%media.`seeking$mM
~UAは現在~seekしているならば ~T を返す。 ◎ Returns true if the user agent is currently seeking.
%media.`seekable$mM
`~media資源$の一連の範囲のうち,~UAが~seek可能なものからなる~listを表現する, `TimeRanges$I ~objを返す。 ◎ Returns a TimeRanges object that represents the ranges of the media resource to which it is possible for the user agent to seek.
%media.`fastSeek(time)$mM
精度と引き換えに速度を得るよう,アリな限り高速に、 所与の %time の近くへ~seekする。 (精確な時刻へ~seekするためには `currentTime$mM 属性を利用すること。) ◎ Seeks to near the given time as fast as possible, trading precision for speed. (To seek to a precise time, use the currentTime attribute.)
~media資源がまだ読込まれてない場合、 何もしない。 ◎ This does nothing if the media resource has not been loaded.

`seeking@mM 属性は、 初期~時には ~F になるモノトスル。 ◎ The seeking attribute must initially have the value false.

`fastSeek(time)@mM ~method~手続きは ⇒ `~seekする$( %time, ~T( “速度優先” ) ) ◎ The fastSeek(time) method must seek to the time given by time, with the approximate-for-speed flag set.

`~media要素$ %要素 の`~media資源$ %資源 内の特定0の再生~位置へ `~seekする@ ときは、 所与の ( %新たな再生~位置, 真偽値 %速度優先か(省略時は ~F ) ) に対し,次を走らすモノトスル: ◎ When the user agent is required to seek to a particular new playback position in the media resource, optionally with the approximate-for-speed flag set, it means that the user agent must run the following steps. 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). Steps in that section are marked with ⌛.

  1. %要素 の`~posterを示すか$ ~SET ~F ◎ Set the media element's show poster flag to false.
  2. ~IF[ %要素 の`readyState$mM ~EQ `HAVE_NOTHING$mM ] ⇒ ~RET ◎ If the media element's readyState is HAVE_NOTHING, return.
  3. ~IF[ %要素 の `seeking$mM 属性 ~EQ ~T ] ⇒ この~algoの別の~instanceがすでに走っている — その~instanceを,それが完了するのを待機せずに中止する ◎ If the element's seeking IDL attribute is true, then another instance of this algorithm is already running. Abort that other instance of the algorithm without waiting for the step that it is running to complete.
  4. %要素 の `seeking$mM 属性 ~SET ~T ◎ Set the seeking IDL attribute to true.
  5. ~IF[ この~algoは、 ~scriptによる ~IDL[ ~method~call / 属性の設定子 ]に呼応して呼出されている ] ⇒ ~RET (その~scriptを継続させる) — ただし ⇒ この手続きの以降も`並列的$に走らす — ただし ⇒ この~algoの以下に現れる,`安定~状態を待受ける$箇所は、 この~algoの別の~instanceが呼出された場合,それにより いつでも中止され得る。 ◎ If the seek was in response to a DOM method call or setting of an IDL attribute, then continue the script. The remainder of these steps must be run in parallel. With the exception of the steps marked with ⌛, they could be aborted at any time by another instance of this algorithm being invoked.
  6. ~IF[ %新たな再生~位置 ~GT %資源 の終端 ] ⇒ %新たな再生~位置 ~SET %資源 の終端 ◎ If the new playback position is later than the end of the media resource, then let it be the end of the media resource instead.
  7. ~IF[ %新たな再生~位置 ~LT `アリな最も早い位置$ ] ⇒ %新たな再生~位置 ~SET `アリな最も早い位置$ ◎ If the new playback position is less than the earliest possible position, let it be that position instead.
  8. %現~位置 ~LET `現在の再生~位置$ ◎ ↓
  9. %範囲~list ~LET %要素 の `seekable$mM 属性~値 ◎ ↓
  10. ~IF[ %範囲~list は空である ]:

    1. %要素 の `seeking$mM ~SET ~F
    2. ~RET
    ◎ ↓
  11. ~IF[ 【! (possibly now changed)】 %新たな再生~位置 は %範囲~list 内のどの範囲にも入らない ] ⇒ %新たな再生~位置 ~SET [[ %範囲~list 内の各 範囲の始端, 終端 ]のうち, %新たな再生~位置 に最も近いもの† ]のうち, %現~位置 に最も近い位置

    († 一意に決まるとは限らない — %新たな再生~位置 がある範囲の終端と次の範囲の始端のちょうど真中にある場合、 その終端, 始端の 2 つがこの条件を満たす )

    ◎ If the (possibly now changed) new playback position is not in one of the ranges given in the seekable attribute, then let it be the position in one of the ranges given in the seekable attribute that is the nearest to the new playback position. If two positions both satisfy that constraint (i.e. the new playback position is exactly in the middle between two ranges in the seekable attribute) then use the position that is closest to the current playback position. If there are no ranges given in the seekable attribute then set the seeking IDL attribute to false and return.
  12. ~IF[ %速度優先か ~EQ ~T ] ⇒ %新たな再生~位置 を調整する — 再生を速やかに再開できる, かつ 結果の %調整-済み位置 が次を満すように: ◎ If the approximate-for-speed flag is set, adjust the new playback position to a value that will allow for playback to resume promptly.\

    • %新たな再生~位置 ~LT %現~位置 のときは ⇒ %調整-済み位置 ~LT %現~位置 ◎ If new playback position before this step is before current playback position, then the adjusted new playback position must also be before the current playback position.\
    • %新たな再生~位置 ~GT %現~位置 のときは ⇒ %調整-済み位置 ~GT %現~位置 ◎ Similarly, if the new playback position before this step is after current playback position, then the adjusted new playback position must also be after the current playback position.

    例えば~UAは — 復号する時刻を費やさずに済むよう — ~key~frame近くに留めて、 再生を再開する前に,中間の~frameを破棄することもできる。 ◎ For example, the user agent could snap to a nearby key frame, so that it doesn't have to spend time decoding then discarding intermediate frames before resuming playback.

  13. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ Queue a media element task given the media element to\

    手続きは ⇒ `~eventを発火する$( %要素, `seeking$et ) ◎ fire an event named seeking at the element.
  14. `現在の再生~位置$ ~SET %新たな再生~位置 ◎ Set the current playback position to the new playback position.

    注記: %要素 は~seekingを開始する直前では`再生-中になり得る$であったが,~seekingにより %要素 の `readyState$mM 属性が `HAVE_FUTURE_DATA$mM 未満の値に変化した場合、 %要素 に向けて, `waiting$et ~eventが`発火される@#fire-waiting-when-waiting$ことになる。 ◎ If the media element was potentially playing immediately before it started seeking, but seeking caused its readyState attribute to change to a value lower than HAVE_FUTURE_DATA, then a waiting event will be fired at the element.

    注記: この段は,`現在の再生~位置$を設定するので、 即時に他の条件を誘発し得る — 再生において “`~media資源の終端に達した@#reaches-the-end$” ときに関する規則(~loopingを取扱う~logicの一部)など — ~UAが実際には その位置(次の段にて決定される)用の~media~dataを具現化できるとしても,その前に。 ◎ This step sets the current playback position, and thus can immediately trigger other conditions, such as the rules regarding when playback "reaches the end of the media resource" (part of the logic that handles looping), even before the user agent is actually able to render the media data for that position (as determined in the next step).

    注記: `currentTime$mM 属性は、 `現在の再生~位置$ではなく,`公式的な再生~位置$を返す。 したがって、 この~algoとは別に,~script実行の前に更新される。 ◎ The currentTime attribute returns the official playback position, not the current playback position, and therefore gets updated before script execution, separate from this algorithm.

  15. ~UAが,[ %新たな再生~位置 に対する`~media~data$が可用かどうかを確立して,その位置を再生するに十分な~dataを復号する ]まで、 待機する ◎ Wait until the user agent has established whether or not the media data for the new playback position is available, and, if it is, until it has decoded enough data to play back that position.
  16. 次の一連の段を`同期区間$として,`安定~状態を待受ける$: ◎ Await a stable state. The synchronous section consists of all the remaining steps of this algorithm. (Steps in the synchronous section are marked with ⌛.)

    1. %要素 の `seeking$mM ~IDL属性 ~SET ~F ◎ ⌛ Set the seeking IDL attribute to false.
    2. `~tTを時間に合わせる$( %要素 ) ◎ ⌛ Run the time marches on steps.
    3. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ ⌛ Queue a media element task given the media element to\

      手続きは ⇒ `~eventを発火する$( %要素, `timeupdate$et ) ◎ fire an event named timeupdate at the element.
    4. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ ⌛ Queue a media element task given the media element to\

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

`seekable@mM 取得子~手続きは ⇒ ~RET 次を表現する,静的かつ`正規化-済み$な新たな `TimeRanges$I ~obj ⇒ 現時点で~UAが~seekできるような,コレの`~media資源$の一連の範囲 ◎ The seekable attribute must return a new static normalized TimeRanges object that represents the ranges of the media resource, if any, that the user agent is able to seek to, at the time the attribute is evaluated.

注記: ~UAは、 `~media資源$内のどこへでも~seekできる場合 — 例えば単純な映画~fileで,~UA, ~serverとも ~HTTP `Range^h 要請を~supportする場合 — この属性は、 次のような 1 個の範囲からなる~objを返すことになる: 始端 ~EQ 最初の~frameの時刻(`アリな最も早い位置$, 概して 0 ), 終端 ~EQ [ 始端 ~PLUS `duration$mM 属性の値 ](最後の~frameの時刻に等しくなり,正な `Infinity^jv にもなり得る)。 ◎ If the user agent can seek to anywhere in the media resource, e.g. because it is a simple movie file and the user agent and the server support HTTP Range requests, then the attribute would return an object with one range, whose start is the time of the first frame (the earliest possible position, typically zero), and whose end is the same as the time of the first frame plus the duration attribute's value (which would equal the time of the last frame, and might be positive Infinity).

注記: 範囲は、 変化し続けるかもしれない。 例えば、 ~UAが無限~streamにて~sliding-windowを~bufferしている場合。 これは、 一例を挙げれば,~live TV を~~流している DVR に見られる挙動である。 ◎ The range might be continuously changing, e.g. if the user agent is buffering a sliding window on an infinite stream. This is the behavior seen with DVRs viewing live TV, for instance.

属性~取得子が毎回 新たな~objを返すのは不良な~patternであるが、 今更それを変更するのは高くつくので,そうなっている。 そのようなふるまいは、 新たな~APIには複製されない。 ◎ Returning a new object each time is a bad pattern for attribute getters and is only enshrined here as it would be costly to change it. It is not to be copied to new APIs.

~UAは、 何が~seek可能になるかについて,~~相応に柔軟かつ楽観的な~viewを採用するベキである。 ~UAはまた、 高速な~seek法を可能化するため,アリな所では近過去の内容を~bufferするベキである。 ◎ User agents should adopt a very liberal and optimistic view of what is seekable. User agents should also buffer recent content where possible to enable seeking to be fast.

一例として、 ~HTTP `Range^h 要請を~supportしない ある~HTTP~serverから~serveされている巨大な動画~fileを考える。 ~browserは、 現在および後続な~frame用に得された~dataのみを~bufferすることにより,これを実装する`こともできる^em — まったく~seekできないことにして (再生を開始し直すことによる始端への~seekは別として)。 しかしながら、 これでは拙い実装になる。 高~品質な実装は、 内容の最後の数~分を~bufferして (あるいは~storageが十分あればもっと)、 利用者が何か面白いものを再~視聴するため,その箇所へすぐに戻れるようにすることに加え、 必要yなら,~fileを始端から再度~読込んで任意の箇所へ~seekできるようにするであろう — 後者は前者より低速だが、 それでも[ より早い,未~bufferの箇所を得るだけのために、 動画を開始し直して初めからくまなく視聴する ]よりは簡便になる。 ◎ For instance, consider a large video file served on an HTTP server without support for HTTP Range requests. A browser could implement this by only buffering the current frame and data obtained for subsequent frames, never allow seeking, except for seeking to the very start by restarting the playback. However, this would be a poor implementation. A high quality implementation would buffer the last few minutes of content (or more, if sufficient storage space is available), allowing the user to jump back and rewatch something surprising without any latency, and would in addition allow arbitrary seeking by reloading the file from the start if necessary, which would be slower but still more convenient than having to literally restart the video and watch it all the way through just to get to an earlier unbuffered spot.

`~media資源$は、 内部的に~scriptを含む/対話的なこともあるかもしれない。 したがって`~media要素$は,~~不連続に再生され得る。 これが起こった場合、 ~UAは,`現在の再生~位置$が不連続に変化する度に, (関連な~eventが発火されるよう)`~seeking$用の~algoが利用されていたかのように動作するモノトスル。 ◎ Media resources might be internally scripted or interactive. Thus, a media element could play in a non-linear fashion. If this happens, the user agent must act as if the algorithm for seeking was used whenever the current playback position changes in a discontinuous fashion (so that the relevant events fire).

4.8.11.10. 複数の~media~trackを伴う~media資源

`~media資源$には、 複数の[ 動画/音声 ]~trackも埋込まれ得る。 例えば、 首な[ 動画/音声 ]~trackに加えて,[ 外国語吹替え / ~directorによる実況 / 音述 / 代替~angle / 積層された手話 ]など。 ◎ A media resource can have multiple embedded audio and video tracks. For example, in addition to the primary video and audio tracks, a media resource could have foreign-language dubbed dialogues, director's commentaries, audio descriptions, alternative angles, or sign-language overlays.

%media.`audioTracks$mM
`~media資源$に可用な一連の音声~trackを表現している `AudioTrackList$I ~objを返す。 ◎ Returns an AudioTrackList object representing the audio tracks available in the media resource.
%media.`videoTracks$mM
`~media資源$に可用な一連の動画~trackを表現している `VideoTrackList$I ~objを返す。 ◎ Returns a VideoTrackList object representing the video tracks available in the media resource.
`audioTracks@mM 取得子~手続きは ⇒ ~RET コレの`~media資源$に可用な一連の音声~trackを表現している,`~live$な `AudioTrackList$I ~obj ◎ The audioTracks attribute of a media element must return a live AudioTrackList object representing the audio tracks available in the media element's media resource.
`videoTracks@mM 取得子~手続きは ⇒ ~RET コレの`~media資源$に可用な一連の動画~trackを表現している,`~live$な `VideoTrackList$I ~obj ◎ The videoTracks attribute of a media element must return a live VideoTrackList object representing the video tracks available in the media element's media resource.

注記: [ `AudioTrackList$I / `VideoTrackList$I ]~objは`~media要素$ごとに, 1 個に限られる — 要素の中に別の`~media資源$が読込まれた場合でも,これらの~objが再利用される (が、[ `AudioTrack$I / `VideoTrack$I ]~objはそうでない)。 ◎ There are only ever one AudioTrackList object and one VideoTrackList object per media element, even if another media resource is loaded into the element: the objects are reused. (The AudioTrack and VideoTrack objects are not, though.)

4.8.11.10.1. `AudioTrackList^I / `VideoTrackList^I ~obj

前~節に定義した属性は[ `AudioTrackList$I / `VideoTrackList$I ]~interfaceを利用する。 ◎ The AudioTrackList and VideoTrackList interfaces are used by attributes defined in the previous section.

[Exposed=Window]
interface `AudioTrackList@I : `EventTarget$I {
  readonly attribute unsigned long `length$mA;
  `getter$m `AudioTrack$I (unsigned long %index);
  `AudioTrack$I? `getTrackById$mA(DOMString %id);

  attribute `EventHandler$I `onchange$m;
  attribute `EventHandler$I `onaddtrack$m;
  attribute `EventHandler$I `onremovetrack$m;
};

[Exposed=Window]
interface `AudioTrack@I {
  readonly attribute DOMString `id$mA;
  readonly attribute DOMString `kind$mA;
  readonly attribute DOMString `label$mA;
  readonly attribute DOMString `language$mA;
  attribute boolean `enabled$mA;
};

[Exposed=Window]
interface `VideoTrackList@I : `EventTarget$I {
  readonly attribute unsigned long `length$mV;
  `getter$m `VideoTrack$I (unsigned long %index);
  `VideoTrack$I? `getTrackById$mV(DOMString %id);
  readonly attribute long `selectedIndex$mV;

  attribute `EventHandler$I `onchange$m;
  attribute `EventHandler$I `onaddtrack$m;
  attribute `EventHandler$I `onremovetrack$m;
};

[Exposed=Window]
interface `VideoTrack@I {
  readonly attribute DOMString `id$mV;
  readonly attribute DOMString `kind$mV;
  readonly attribute DOMString `label$mV;
  readonly attribute DOMString `language$mV;
  attribute boolean `selected$mV;
};
%media.`audioTracks$mM.`length$mA
%media.`videoTracks$mM.`length$mV
~list内にある~trackの個数を返す。 ◎ Returns the number of tracks in the list.
%audioTrack = %media.`audioTracks$mM[%index]
%videoTrack = %media.`videoTracks$mM[%index]
指定された[ `AudioTrack$I, `VideoTrack$I ]~objを返す。 ◎ Returns the specified AudioTrack or VideoTrack object.
%audioTrack = %media.`audioTracks$mM.`getTrackById(id)$mA
%videoTrack = %media.`videoTracks$mM.`getTrackById(id)$mV
所与の識別子を有する[ `AudioTrack$I, `VideoTrack$I ]~objが[ あれば それ / なければ ~NULL ]を返す。 ◎ Returns the AudioTrack or VideoTrack object with the given identifier, or null if no track has that identifier.
%audioTrack.`id$mA
%videoTrack.`id$mV
所与の~trackの識別子を返す。 これは、 形式が`~media素片の構文$を~supportするならば,`素片$urlにて利用できるような識別子にでき、 また `getTrackById()^m ~methodにも利用できる。 ◎ Returns the ID of the given track. 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.
%audioTrack.`kind$mA
%videoTrack.`kind$mV
所与の~trackの分類を返す。 `アリな~track分類@#dom-TrackList-getKind-categories$は、 下に与える。 ◎ Returns the category the given track falls into. The possible track categories are given below.
%audioTrack.`label$mA
%videoTrack.`label$mV
[ 所与の~trackの~labelが既知ならばそれ / ~ELSE_ 空~文字列 ]を返す。 ◎ Returns the label of the given track, if known, or the empty string otherwise.
%audioTrack.`language$mA
%videoTrack.`language$mV
[ 所与の~trackの言語が既知ならばそれ / ~ELSE_ 空~文字列 ]を返す。 ◎ Returns the language of the given track, if known, or the empty string otherwise.
%audioTrack.`enabled$mA [ = %value ]
[ 所与の~trackは作動中ならば ~T / ~ELSE_ ~F ]を返す。 ◎ Returns true if the given track is active, and false otherwise.
設定して,この~trackは可能化されるかどうかを変更できる。 複数の音声~trackが同時に可能化された場合、 それらは混合される。 ◎ Can be set, to change whether the track is enabled or not. If multiple audio tracks are enabled simultaneously, they are mixed.
%media.`videoTracks$mM.`selectedIndex$mV
現在~選択されている~trackが[ あれば その~index / なければ −1 ]を返す。 ◎ Returns the index of the currently selected track, if any, or −1 otherwise.
%videoTrack.`selected$mV [ = %value ]
[ 所与の~trackは作動中ならば ~T / ~ELSE_ ~F ]を返す。 ◎ Returns true if the given track is active, and false otherwise.
設定して,~trackは選択されるかどうかを変更できる。 選択される動画~trackの個数は 0 〜 1 個であり、 ある~trackが選択されたときは,前に選択されていた別の~trackは未選択にされる。 ◎ Can be set, to change whether the track is selected or not. Either zero or one video track is selected; selecting a new track while a previous one is selected will unselect the previous one.

`AudioTrackList$I ~objは、 0 個~以上の音声~trackからなる動的な~listを表現する。 それらの~trackのうち, 0 個~以上を同時に可能化できる。 各~音声~trackは `AudioTrack$I ~objで表現される。 ◎ An AudioTrackList object represents a dynamic list of zero or more audio tracks, of which zero or more can be enabled at a time. Each audio track is represented by an AudioTrack object.

`VideoTrackList$I ~objは、 0 個~以上の動画~trackからなる動的な~listを表現する。 それらの~trackのうち, 0 〜 1 個を同時に選択できる。 各~動画~trackは `VideoTrack$I ~objで表現される。 ◎ A VideoTrackList object represents a dynamic list of zero or more video tracks, of which zero or one can be selected at a time. Each video track is represented by a VideoTrack object.

[ `AudioTrackList$I / `VideoTrackList$I ]~obj内の~trackたちの順序は、 一貫して,次で定義される `自然な順序^i にするモノトスル:

  • `~media資源$の形式により定義される順序がある場合 ⇒ その順序
  • 他の場合 ⇒ `~media資源$内で~trackが宣言された順序。
◎ Tracks in AudioTrackList and VideoTrackList objects must be consistently ordered. If the media resource is in a format that defines an order, then that order must be used; otherwise, the order must be the relative order in which the tracks are declared in the media resource. The order used is called the natural order of the list.

注記: これらの~objを成す各~trackの~indexは、 常に~list順に付番され( 0 が先頭),`~media資源$に動的に~trackが[ 追加-/除去- ]されるに伴い変化する。 `~media資源$がまるごと変更された場合、 以前の~trackすべては除去され,新たな~trackに置換されることになる。 ◎ Each track in one of these objects thus has an index; the first has the index 0, and each subsequent track is numbered one higher than the previous one. If a media resource dynamically adds or removes audio or video tracks, then the indices of the tracks will change dynamically. If the media resource changes entirely, then all the previous tracks will be removed and replaced with new tracks.

[ `AudioTrackList^I の `length@mA / `VideoTrackList^I の `length@mV ]取得子~手続きは ⇒ ~RET 現時点でコレが表現する~trackの個数 ◎ The AudioTrackList length and VideoTrackList length attribute getters must return the number of tracks represented by their objects at the time of getting.

コレが`~supportする~prop~index$は、 0 以上, [ コレが表現する一連の~trackの個数 ]未満とする。 ◎ The supported property indices of AudioTrackList and VideoTrackList objects at any instant are the numbers from zero to the number of tracks represented by the respective object minus one, if any tracks are represented. If an AudioTrackList or VideoTrackList object represents no tracks, it has no supported property indices.

コレにおける,所与の~indexに対する`有index~propの値を決定する$ときは、 コレ内の~index番の~trackを表現する[ `AudioTrack$I / `VideoTrack$I ]~objを返すモノトスル。 ◎ To determine the value of an indexed property for a given index index in an AudioTrackList or VideoTrackList object list, the user agent must return the AudioTrack or VideoTrack object that represents the indexth track in list.

`AudioTrackList^I の `getTrackById(id)@mA ~method~手続きは ⇒ ~RET コレ内に次を満たす `AudioTrack$I ~objは[ 在るならば それらのうち(上に定義した,自然な順序で)最初のもの/ 無いならば ~NULL ] ⇒ 識別子 ~EQ %id ◎ ↓
`VideoTrackList^I の `getTrackById(id)@mV ]~method~手続きは ⇒ ~RET コレ内に次を満たす `VideoTrack$I ~objは[ 在るならば それらのうち(上に定義した,自然な順序で)最初のもの/ 無いならば ~NULL ] ⇒ 識別子 ~EQ %id ◎ The AudioTrackList getTrackById(id) and VideoTrackList getTrackById(id) methods must return the first AudioTrack or VideoTrack object (respectively) in the AudioTrackList or VideoTrackList object (respectively) whose identifier is equal to the value of the id argument (in the natural order of the list, as defined above). When no tracks match the given argument, the methods must return null.

各[ `AudioTrack$I / `VideoTrack$I ]~objは、 `~media資源$の特定の~trackを表現する。 各~trackは、[ 識別子, 分類, ~label, 言語 ]を持ち得る。 【!*いずれも,持たない場合は ε とする】 ~trackのこれらの側面は、 ~trackが存続する限り永続的とする — ~trackが`~media資源$の[ `AudioTrackList$I / `VideoTrackList$I ]~objから除去されても,それらの側面は変化しない。 ◎ The AudioTrack and VideoTrack objects represent specific tracks of a media resource. Each track can have an identifier, category, label, and language. These aspects of a track are permanent for the lifetime of the track; even if a track is removed from a media resource's AudioTrackList or VideoTrackList objects, those aspects do not change.

加えて,各 `AudioTrack$I ~objは、[ 可能化されている, 不能化されている ]のいずれかの状態をとり得る。 `AudioTrack$I の作成-時には、 不能化されているモノトスル。 `~media資源~fetch~algo$はこれを上書きし得る。 ◎ In addition, AudioTrack objects can each be enabled or disabled; this is the audio track's enabled state. When an AudioTrack is created, its enabled state must be set to false (disabled). The resource fetch algorithm can override this.

同様に, `VideoTrackList$I ~objにおいては、 0 個または 1 個の `VideoTrack$I ~objを選択できる。 【! video track's selection state】 `VideoTrack$I の作成-時には、 未選択になるモノトスル。 これは、 `~media資源~fetch~algo$により上書きされ得る。 ◎ Similarly, a single VideoTrack object per VideoTrackList object can be selected, this is the video track's selection state. When a VideoTrack is created, its selection state must be set to false (not selected). The resource fetch algorithm can override this.

[ `AudioTrack^I の `id@mA / `VideoTrack^I の `id@mV ]取得子~手続きは ⇒ ~RET コレの識別子は[ あるならば それ / ないならば 空~文字列 ] ◎ The AudioTrack id and VideoTrack id attributes must return the identifier of the track, if it has one, or the empty string otherwise.\

`~media資源$の形式が`~media素片の構文$を~supportする場合、 返される識別子は,[ `素片$urlの~track次元~内で~trackの名前として利用された場合に,その~trackを可能化することになるもの ]と同じにするモノトスル `INBAND$r ◎ 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. [INBAND]

例えば~Ogg~fileにおいては、 これは、 ~trackの Name header field になる。 `OGGSKELETONHEADERS$r ◎ For example, in Ogg files, this would be the Name header field of the track. [OGGSKELETONHEADERS]

[ `AudioTrack^I の `kind@mA / `VideoTrack^I の `kind@mV ]取得子~手続きは ⇒ ~RET コレの分類(以下に与える)は[ あるならば それ / ないならば 空~文字列 ] ◎ The AudioTrack kind and VideoTrack kind attributes must return the category of the track, if it has one, or the empty string otherwise.

~trackの分類は、 下の表tの 1 列目に与えるいずれかの文字列のうち,[ コレが表現する`~media資源$内の~track ]に最も適切なものになる — それは、 当の~trackに含まれる~metadataから決定される,表tの 2, 3 列目に与える “定義”, “適用-対象” ]に基づく。 “適用-対象” は、[ 音声, 動画 ]のうち,どれが分類に適用されるかを表す — [ 音声/動画 ]~trackのみに適用される分類が適切になるのは[ 音声/動画 ]~trackに限られ,そのような分類を返せるのは[ `AudioTrack$I / `VideoTrack$I ] ~objに限られるモノトスル。 ◎ The category of a track is the string given in the first column of the table below that is the most appropriate for the track based on the definitions in the table's second and third columns, as determined by the metadata included in the track in the media resource. The cell in the third column of a row says what the category given in the cell in the first column of that row applies to; a category is only appropriate for an audio track if it applies to audio tracks, and a category is only appropriate for video tracks if it applies to video tracks. Categories must only be returned for AudioTrack objects if they are appropriate for audio, and must only be returned for VideoTrack objects if they are appropriate for video.

関連な~metadata情報を与えるのは、 ~media資源の~~種類に応じて[ ~Ogg `OGGSKELETONHEADERS$r ならば ~trackの Role header field / ~DASH `DASH$r ならば Role 要素 / ~WebM `WEBMCG$r ならば(現時点では) FlagDefault 要素 ]になる。 更なる詳細は、 `Sourcing In-band Media Resource Tracks from Media Containers into HTML^cite `INBAND$r にある。 ◎ For Ogg files, the Role header field of the track gives the relevant metadata. For DASH media resources, the Role element conveys the information. For WebM, only the FlagDefault element currently maps to a value. Sourcing In-band Media Resource Tracks from Media Containers into HTML has further details. [OGGSKELETONHEADERS] [DASH] [WEBMCG] [INBAND]

[ `AudioTrack^I の `kind$mA / `VideoTrack^I の `kind$mV ]が返す値。 ◎ Return values for AudioTrack's kind and VideoTrack's kind
分類 ◎ Category 定義 ◎ Definition 適用-対象 ◎ Applies to... 例 ◎ Examples
"`alternative@vT" 主~track用にアリな代替 — 例えば 歌の異なる~take(音声) / 異なる~angle(動画) ◎ A possible alternative to the main track, e.g. a different take of a song (audio), or a different angle (video). 音声/動画 ◎ Audio and video.
  • ~Ogg: `audio/alternate^l / `video/alternate^l
  • ~DASH: `alternate^l ~roleを有していて,[ `main^l, `commentary^l ~role(動画) / `dub^l ~role(音声) ]は有さないもの(他の~roleは無視される)。
◎ Ogg: "audio/alternate" or "video/alternate"; DASH: "alternate" without "main" and "commentary" roles, and, for audio, without the "dub" role (other roles ignored).
"`captions@vT" 主~動画~trackに~captionが焼付けられた~version。 (旧来の内容~用 — 新たな内容は~tTを利用することになる。) ◎ A version of the main video track with captions burnt in. (For legacy content; new content would use text tracks.) 動画のみ ◎ Video only.
  • ~DASH:[ `caption^l, `main^l ]両~roleを有するもの(他の~roleは無視される)。
◎ DASH: "caption" and "main" roles together (other roles ignored).
"`descriptions@vT" 動画~trackの音述。 ◎ An audio description of a video track. 音声のみ ◎ Audio only.
  • ~Ogg: `audio/audiodesc^l 。
◎ Ogg: "audio/audiodesc".
"`main@vT" 首な[ 音声/動画 ]~track。 ◎ The primary audio or video track. 音声/動画 ◎ Audio and video.
  • ~Ogg: `audio/main^l / `video/main^l
  • ~WebM: `FlagDefault^l 要素が設定されているもの
  • ~DASH: `main^l ~roleを有していて[ `caption^l, `subtitle^l, `dub^l ]~roleは有さないもの(他の~roleは無視される)。
◎ Ogg: "audio/main" or "video/main"; WebM: the "FlagDefault" element is set; DASH: "main" role without "caption", "subtitle", and "dub" roles (other roles ignored).
"`main-desc@vT" 音述が混合された首な音声~track。 ◎ The primary audio track, mixed with audio descriptions. 音声のみ ◎ Audio only.
  • MPEG-2 内の AC3 音声: `TS: bsmod=2^c, `full_svc=1^c
◎ AC3 audio in MPEG-2 TS: bsmod=2 and full_svc=1.
"`sign@vT" 音声~trackの手話~解釈。 ◎ A sign-language interpretation of an audio track. 動画のみ ◎ Video only.
  • ~Ogg: `video/sign^l
◎ Ogg: "video/sign".
"`subtitles@vT" 主~動画~trackに字幕が焼付けられた~version。 (旧来の内容~用 — 新たな内容は~tTを利用することになる。) ◎ A version of the main video track with subtitles burnt in. (For legacy content; new content would use text tracks.) 動画のみ ◎ Video only.
  • ~DASH:[ `subtitle^l , `main^l ]両~roleを有するもの (他の~roleは無視される)。
◎ DASH: "subtitle" and "main" roles together (other roles ignored).
"`translation@vT" 主~音声~trackの翻訳された~version。 ◎ A translated version of the main audio track. 音声のみ ◎ Audio only.
  • ~Ogg: `audio/dub^l
  • ~DASH:[ `dub^l, `main^l ]両~roleを有するもの (他の~roleは無視される)。
◎ Ogg: "audio/dub". DASH: "dub" and "main" roles together (other roles ignored).
"`commentary@vT" 首な[ 音声/動画 ]~trackの実況 — 例:~directorによる実況。 ◎ Commentary on the primary audio or video track, e.g. a director's commentary. 音声/動画 ◎ Audio and video.
  • ~DASH: `commentary^l ~roleを有していて, `main^l ~roleは有さないもの (他の~roleは無視される)。
◎ DASH: "commentary" role without "main" role (other roles ignored).
`空~文字列@vT0 明示的な種類はない,または コレの~metadataが与える種類は~UAにより認識されていない。 ◎ No explicit kind, or the kind given by the track's metadata is not recognized by the user agent. 音声/動画 ◎ Audio and video.
[ `AudioTrack^I の `label@mA / `VideoTrack^I の `label@mV ]取得子~手続きは ⇒ ~RET コレの~labelは[ あるならば それ / ないならば 空~文字列 ] `INBAND$r ◎ The AudioTrack label and VideoTrack label attributes must return the label of the track, if it has one, or the empty string otherwise. [INBAND]

[ `AudioTrack^I の `language@mA / `VideoTrack^I の `language@mV ]取得子~手続きは ⇒ ~RET コレの言語の BCP 47 言語~tagは[ あるならば それ / ないならば 空~文字列 ]

~UAは,その言語を BCP 47 言語~tagとして表出できない場合 (例えば、 当の`~media資源$の形式における言語~情報は自由形の文字列で,解釈は定義されていないなど)、 空~文字列を返すモノトスル — コレの言語はなかったかのように。 `INBAND$r ◎ The AudioTrack language and VideoTrack language attributes must return the BCP 47 language tag of the language of the track, if it has one, or the empty string otherwise. If the user agent is not able to express that language as a BCP 47 language tag (for example because the language information in the media resource's format is a free-form string without a defined interpretation), then the method must return the empty string, as if the track had no language. [INBAND]

`AudioTrack^I の `enabled@mA 取得子~手続きは ⇒ ~RET ~IS[ コレは現在~可能化されている ] ◎ The AudioTrack enabled attribute, on getting, must return true if the track is currently enabled, and false otherwise.\

`AudioTrack^I の `enabled$mA 設定子~手続きは ⇒ 所与の値に応じて ⇒# ~T ならば コレを可能化する / ~F ならば コレを不能化する ◎ On setting, it must enable the track if the new value is true, and disable it otherwise.\

(コレがもはや `AudioTrackList$I ~objに属さなくなった場合、 コレを[ 可能化-/不能化- ]しても,単に取得子が返す値が変化する他に効果はない。) ◎ (If the track is no longer in an AudioTrackList object, then the track being enabled or disabled has no effect beyond changing the value of the attribute on the AudioTrack object.)

`AudioTrackList$I ~obj %~track~list 内の音声~trackが[ 不能化-/可能化- ]されているかどうか変化したときは、 ~UAは次を行うモノトスル ⇒ `~media~taskを~queueする$( %要素, 次の手続き ) ◎ Whenever an audio track in an AudioTrackList that was disabled is enabled, and whenever one that was enabled is disabled, the user agent must queue a media element task given the media element to\

手続きは ⇒ `~eventを発火する$( %~track~list, `change$et ) ◎ fire an event named change at the AudioTrackList object.

音声~trackが`~media時列線$における特定0の位置に対し[ ~dataを伴わない/存在しない ]場合、 その時列線~上の地点においては無音と解釈するモノトスル。 ◎ An audio track that has no data for a particular position on the media timeline, or that does not exist at that position, must be interpreted as being silent at that point on the timeline.

`VideoTrackList^I の `selectedIndex@mV 取得子~手続きは ⇒ ~RET コレ内に現在~選択されている~trackは ⇒# あれば その~index / なければ −1 ◎ The VideoTrackList selectedIndex attribute must return the index of the currently selected track, if any. If the VideoTrackList object does not currently represent any tracks, or if none of the tracks are selected, it must instead return −1.
`VideoTrack^I の `selected@mV 取得子~手続きは ⇒ ~RET ~IS[ コレは現在~選択されている ] ◎ The VideoTrack selected attribute, on getting, must return true if the track is currently selected, and false otherwise.\

`VideoTrack^I の `selected$mV 設定子~手続きは:

  1. 所与の値に応じて ⇒# ~T ならばコレを選択する/ ~F ならばコレを未選択にする
  2. ~IF[ 所与の値 ~EQ ~T ]~AND[ コレは ある `VideoTrackList$I に属する ] ⇒ その~list内の他のすべての `VideoTrack$I ~objは未選択にする

(コレが `VideoTrackList$I ~objに属さなくなった場合、 コレを選択しようが未選択にしようが,取得子が返す値が変化する他に効果はない。)

◎ On setting, it must select the track if the new value is true, and unselect it otherwise. If the track is in a VideoTrackList, then all the other VideoTrack objects in that list must be unselected. (If the track is no longer in a VideoTrackList object, then the track being selected or unselected has no effect beyond changing the value of the attribute on the VideoTrack object.)

ある`~media要素$ %要素 の 【 `videoTracks$mM 属性が返す】 `VideoTrackList$I ~obj %~track~list 内で選択されている~trackが変化したときは (他が選択されずに未選択にされた場合も含む)、 ~UAは,次に従うモノトスル: ◎ Whenever a track in a VideoTrackList that was previously not selected is selected, and whenever the selected track in a VideoTrackList is unselected without a new track being selected in its stead, the user agent must\

  • `~media~taskを~queueする$( %要素, 次の手続き ) ◎ queue a media element task given the media element to\

    手続きは ⇒ `~eventを発火する$( %~track~list, `change$et ) ◎ fire an event named change at the VideoTrackList object.\
  • 前項の~taskは、[ %要素 に向けて `resize$et ~eventを発火する`~task$ ]があれば,それより前に~queueする。 ◎ This task must be queued before the task that fires the resize event, if any.

動画~trackは、 `~media時列線$上の特定0の位置に~dataを伴わない地点においては,次のように解釈するモノトスル: ◎ A video track that has no data for a particular position on the media timeline must be interpreted as\

  • `透明な黒$である。 ◎ being transparent black at that point on the timeline,\
  • 寸法は、 その位置より前に その~track用の~dataが[ あれば その最後の~frame / なければ 最初の~frame ]と同じ。 ◎ with the same dimensions as the last frame before that position, or, if the position is before all the data for that track, the same dimensions as the first frame for that track.\
  • ~trackが現在の位置にまったく存在しない場合、[ 存在しているが,~dataは無い ]ものと扱う。 ◎ A track that does not exist at all at the current position must be treated as if it existed but had no data.

一例として、 動画に再生の 1 ~~時間~後から導入される~trackがある場合、 利用者がその~trackを選択してから始端に戻ったときは、 ~UAは,その~trackが[ `~media資源$の始端から開始していて,1 ~~時間~過ぎるまでは単純に透明である ]かのように動作することになる。 ◎ For instance, if a video has a track that is only introduced after one hour of playback, and the user selects that track then goes back to the start, then the user agent will act as if that track started at the start of the media resource but was simply transparent until one hour in.


[ `AudioTrackList$I / `VideoTrackList$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 AudioTrackList and VideoTrackList interfaces:

`~event~handler$ `~event~handler~event型$
`onchange@m `change$et
`onaddtrack@m `addtrack$et
`onremovetrack@m `removetrack$et
4.8.11.10.2. 特定の 音声/動画 ~trackの宣言的な選択-法

~scriptは, `audioTracks$mM / `videoTracks$mM 属性で どの~trackを再生するベキか選択できるが、 当の`~media資源$の`~URL$の`素片$url内に 指定することでも,特定の~trackを宣言的に選択できる。 `素片$urlの形式は、 その`~media資源$の`~MIME型$に依存する。 `RFC2046$r `URL$r ◎ The audioTracks and videoTracks attributes allow scripts to select which track should play, but it is also possible to select specific tracks declaratively, by specifying particular tracks in the fragment of the URL of the media resource. The format of the fragment depends on the MIME type of the media resource. [RFC2046] [URL]

この例では、 `~media素片の構文$を~supportする形式を利用する動画が, 既定の動画~trackに代えて,代替な~angle `Alternative^l が可能化される仕方で埋込まれている。 ◎ In this example, a video that uses a format that supports media fragment syntax is embedded in such a way that the alternative angles labeled "Alternative" are enabled instead of the default video track.

`declarative-1^xCode
4.8.11.11. 時間同期的な~tT

【 この節の内容の和訳は、 `別~page@~HEtrack#timed-text-tracks$にて。 】

4.8.11.12. ~URLによる~trackの種類の識別-法

他の仕様や形式は、 次のために`~URL$が必要になる場合には, `about_html-kind$sc `~URL$を利用しなければナラナイ:

  • [ `AudioTrack^I の `kind$mA / `VideoTrack^I の `kind$mV ]~IDL属性から返される値を識別する
  • ~tTの`種類$tTを識別する
◎ Other specifications or formats that need a URL to identify the return values of the AudioTrack kind or VideoTrack kind IDL attributes, or identify the kind of text track, must use the about:html-kind URL.
4.8.11.13. ~UI

`controls@aM 属性は`真偽-属性$であり、 在る場合,作者は[ ~scriptによる~controllerは供さないで,~UAに自前の~control一式を供させたい ]こと指示する。 ◎ The controls attribute is a boolean attribute. If present, it indicates that the author has not provided a scripted controller and would like the user agent to provide its own set of controls.

`~media要素$において[ 属性が在る / 要素~用の`~scriptingは不能化されて$いる ]場合、 ~UAは利用者に `~UIを公開する@ ベキである。 この~UIは、 次に挙げる特能を含むベキである: ◎ If the attribute is present, or if scripting is disabled for the media element, then the user agent should expose a user interface to the user. This user interface should include features to\

  • 再生を始める
  • 再生を静止する
  • 内容の任意の位置へ~seekする (内容が それを~supportするならば)
  • 音量を変更する
  • 開閉可能な~caption/埋込d手話~trackの表示を変更する
  • 異なる音声~trackたちを選択する/音述をオンにする
  • ~media内容をより相応しい方式で利用者に示す (例えば、 動画を[ 全~screen/独立かつ~resize可能な~UIwindow内 ]に示す)
◎ begin playback, pause playback, seek to an arbitrary position in the content (if the content supports arbitrary seeking), change the volume, change the display of closed captions or embedded sign-language tracks, select different audio tracks or turn on audio descriptions, and show the media content in manners more suitable to the user (e.g. fullscreen video or in an independent resizable window).\

他の~controlも可用にされてヨイ。 ◎ Other controls may also be made available.

属性が無い下でも、 ~UAは~media資源の再生に影響する~control (例:再生- / 静止- / ~seek法 / ~track選択 / 音量~control) を供してもヨイが、 そのような特能は,~pageの通常の具現化に干渉するベキでない。 そのような特能は、 例えば[ `~media要素$の文脈~menu / ~platform~media~UIkey / ~remote-control ]内に公開できる。 ~UAは、 上に述べたとおり単純に利用者に`~UIを公開する$ことにより, これを実装してもヨイ ( `controls$aM 属性を有していたかのように)。 ◎ Even when the attribute is absent, however, user agents may provide controls to affect playback of the media resource (e.g. play, pause, seeking, track selection, and volume controls), but such features should not interfere with the page's normal rendering. For example, such features could be exposed in the media element's context menu, platform media keys, or a remote control. The user agent may implement this simply by exposing a user interface to the user as described above (as if the controls attribute was present).

~UAが~controlを`~media要素$に重ねて表示することにより,利用者に`~UIを公開する$場合、 ~UAは、[ 【!原文誤 user agent】 利用者が,この~interfaceとヤリトリしている間 ]は,利用者~対話~eventを抑止するベキである。 (例えば,利用者が動画の再生~controlを~clickした場合、 ~pageの要素に向けて `mousedown$et ~event等々が同時に発火されることはない。) ◎ If the user agent exposes a user interface to the user by displaying controls over the media element, then the user agent should suppress any user interaction events while the user agent is interacting with this interface. (For example, if the user clicks on a video's playback control, mousedown events and so forth would not simultaneously be fired at elements on the page.)

~UAが公開する~UI特能は (特定的には: 再生を[ 開始する/停止する/静止する/再開pする ]/ ~seekする/ 再生~rateを変更する/ 早送りする/早戻しする/ ~tTを[ ~listする/可能化する/不能化する ]/ 音声の音量を[ 消音する/変更する ]ための)、 アリな所では — 例えば,同じ~eventすべてが発火されるよう — 上に述べた~DOM~APIの用語を通して実装するモノトスル。 ◎ Where possible (specifically, for starting, stopping, pausing, and unpausing playback, for seeking, for changing the rate of playback, for fast-forwarding or rewinding, for listing, enabling, and disabling text tracks, and for muting or changing the volume of the audio), user interface features exposed by the user agent must be implemented in terms of the DOM API described above, so that, e.g., all the same events fire.

早送り/早戻しなどの特能は、 `playbackRate$mM 属性のみを変更するように実装するモノトスル ( `defaultPlaybackRate$mM 属性ではなく)。 ◎ Features such as fast-forward or rewind must be implemented by only changing the playbackRate attribute (and not the defaultPlaybackRate attribute).

~seekingは、[ `~media要素$の`~media時列線$内の,要請された位置へ`~seekする$こと ]を通して実装するモノトスル。 ~media資源に対しては、[ 利用者が~seek~barなどの近似-位置~UIを操作するのに呼応して,~seekするとき ]に,任意の位置への~seekingが低速になる所では、 ~UAには, %速度優先か に ~T を利用することが奨励される。 ◎ Seeking must be implemented in terms of seeking to the requested position in the media element's media timeline. For media resources where seeking to an arbitrary position would be slow, user agents are encouraged to use the approximate-for-speed flag when seeking in response to the user manipulating an approximate position interface such as a seek bar.

`controls@mM ~IDL属性は、 `controls$aM 内容~属性を`反映する$モノトスル。 ◎ The controls IDL attribute must reflect the content attribute of the same name.


%media.`volume$mM [ = %value ]
現在の再生~音量を,範囲[ 0.0 (無音)以上, 1.0 (最大音)以下 ]の数として返す。 ◎ Returns the current playback volume, as a number in the range 0.0 to 1.0, where 0.0 is the quietest and 1.0 the loudest.
設定して,音量を変更できる。 ◎ Can be set, to change the volume.
[ 0.0 ~LTE 所与の値 ~LTE 1.0 ]でない場合、 `IndexSizeError$E 例外が投出される。 ◎ Throws an "IndexSizeError" DOMException if the new value is not in the range 0.0 .. 1.0.
%media.`muted$mM [ = %value ]
音声は消音され, `volume$mM 属性を上書きしているならば ~T / ~ELSE_ ( `volume$mM 属性は尊守されている) ~F を返す。 ◎ Returns true if audio is muted, overriding the volume attribute, and false if the volume attribute is being honored.
設定して,音声は消音されるかどうか変更できる。 ◎ Can be set, to change whether the audio is muted or not.

`~media要素$は、 範囲[ 0.0 (無音)以上, 1.0 (最大音)以下 ]の小数をとり得る `再生~音量@ を持つ。 音量は、 初期~時には 1.0 にされるベキである。 が,~UAは、[ ~siteごとなどに基づく複数~sessionにまたがって,最後に設定された値 ]を覚えて,音量を他の値から開始してもヨイ。 ◎ A media element has a playback volume, which is a fraction in the range 0.0 (silent) to 1.0 (loudest). Initially, the volume should be 1.0, but user agents may remember the last set value across sessions, on a per-site basis or otherwise, so the volume may start at other values.

`volume@mM 取得子~手続きは ⇒ ~RET コレの音声~部の`再生~音量$ ◎ The volume IDL attribute must return the playback volume of any audio portions of the media element.\

`volume$mM 設定子~手続きは:

  1. ~IF[ 0.0 ~LTE 所与の値 ~LTE 1.0 ] ⇒ コレの`再生~音量$ ~SET 所与の値
  2. ~ELSE ⇒ ~THROW `IndexSizeError$E 例外
◎ On setting, if the new value is in the range 0.0 to 1.0 inclusive, the media element's playback volume must be set to the new value. If the new value is outside the range 0.0 to 1.0 inclusive, then, on setting, an "IndexSizeError" DOMException must be thrown instead.

`~media要素$はまた, `消音-@ され得る。 要素を消音している何かがあれば、 それは消音される (例えば,`再生~方向$が逆方向である間は、 要素は消音される)。 ◎ A media element can also be muted. If anything is muting the element, then it is muted. (For example, when the direction of playback is backwards, the element is muted.)

`muted@mM 取得子~手続きは、 最後に設定された値を返す。 `~media要素$の作成-時には,要素が `muted$aM 内容~属性を有するならば ~T に設定されるベキである。 他の場合、 ~UAは値を利用者が選好する値に設定してヨイ (例えば,~siteごとなどに基づく複数~sessionにまたがって最後に設定された値を覚えておくなど)。 この属性が ~T に設定されている間は、 `~media要素$を`消音-$するモノトスル。 ◎ The muted IDL attribute must return the value to which it was last set. When a media element is created, if the element has a muted content attribute specified, then the muted IDL attribute should be set to true; otherwise, the user agents may set the value to the user's preferred value (e.g. remembering the last set value across sessions, on a per-site basis or otherwise). While the muted IDL attribute is set to true, the media element must be muted.

`~media要素$ %要素 の[ `volume$mM / `muted$mM ]~IDL属性が返す値が変化したときは、 ~UAは次を走らすモノトスル: ◎ Whenever either of the values that would be returned by the volume and muted IDL attributes change, the user agent must\

  1. `~media~taskを~queueする$( %要素, 次の手続き ) ◎ queue a media element task given the media element to\

    手続きは ⇒ `~eventを発火する$( %要素, `volumechange$et ) ◎ fire an event named volumechange at the media element.\
  2. ~IF[ %要素 には`再生は許容されて$いない ] ⇒ `内部~静止-手続き$( %要素 ) ◎ Then, if the media element is not allowed to play, the user agent must run the internal pause steps for the media element.

各~UAには、 `音量は~lockされたか@ が結付けられる。 その値は、 `実装定義$な真偽値であり, `再生~音量$が効果を発揮するかどうかを決定する。 ◎ A user agent has an associated volume locked (a boolean). Its value is implementation-defined and determines whether the playback volume takes effect.

`~media要素$ %要素 の `実効~media音量@ は、 次に従って決定される: ◎ An element's effective media volume is determined as follows:

  1. ~IF[ %要素 の音量を上書きするよう,利用者から指示されている ] ⇒ ~RET 利用者から欲された音量 ◎ If the user has indicated that the user agent is to override the volume of the element, then return the volume desired by the user.
  2. ~IF[ ~UAの`音量は~lockされたか$ ~EQ ~T ] ⇒ ~RET ~system【~UAが稼働している~OSの】音量 ◎ If the user agent's volume locked is true, then return the system volume.
  3. ~IF[ %要素 の音声~出力は`消音-$されている ] ⇒ ~RET 0 ◎ If the element's audio output is muted, then return zero.
  4. ~RET %要素 の音声~部の`再生~音量$ ◎ Let volume be the playback volume of the audio portions of the media element, in range 0.0 (silent) to 1.0 (loudest).

`実効~media音量$は、 範囲 0.0 〜 1.0 に相対的な聴感音量として,次のように解釈されるとする:

  • 0.0 は無音に対応する。
  • 1.0 は最大音に対応する。
  • 数が大きいほど増大するが、 線形にそうなる必要はない。
◎ Return volume, interpreted relative to the range 0.0 to 1.0, with 0.0 being silent, and 1.0 being the loudest setting, values in between increasing in loudness. The range need not be linear.\

最大音~設定は、 例えば,利用者が音量に~~上限を設定していたときなど,~systemの最大音~設定より低くされてもヨイ。 ◎ The loudest setting may be lower than the system's loudest possible setting; for example the user could have set a maximum volume.

`~media要素$上の `muted@aM 内容~属性は、 `真偽-属性$であり,`~media資源$の音声~出力の既定の状態を制御する。 それは、 利用者-選好を上書きするものになり得る。 ◎ The muted content attribute on media elements is a boolean attribute that controls the default state of the audio output of the media resource, potentially overriding user preferences.

`defaultMuted@mM ~IDL属性は、 `muted$aM 内容~属性を`反映する$モノトスル。 ◎ The defaultMuted IDL attribute must reflect the muted content attribute.

注記: この属性には動的な効果はない (要素の既定の状態のみを制御する)。 ◎ This attribute has no dynamic effect (it only controls the default state of the element).

次の動画(広告)は,自動再生するが、 利用者をいらつかせないよう,音響なしにそれを行うことに加え、 利用者が音響ありに切り替えれるようにする。 ~UAは、 利用者-ヤリトリを伴わずに消音されなくなったときは,動画を静止できる。 ◎ This video (an advertisement) autoplays, but to avoid annoying users, it does so without sound, and allows the user to turn the sound on. The user agent can pause the video if it's unmuted without a user interaction.

`user-interface-1^xCode
4.8.11.14. 時刻~範囲

`TimeRanges$I ~objは、 一連の[ 時刻の範囲(期間) ]からなる~list — 範囲~list — を表現する。 ◎ Objects implementing the TimeRanges interface represent a list of ranges (periods) of time.

[Exposed=Window]
interface `TimeRanges@I {
  readonly attribute unsigned long `length$m;
  double `start$m(unsigned long %index);
  double `end$m(unsigned long %index);
};
%media.`length$m
範囲~listの~sizeを返す。 ◎ Returns the number of ranges in the object.
%time = %~media.`start(index)$m
範囲~list内の %index 番の範囲の始端の時刻を返す。 ◎ Returns the time for the start of the range with the given index.
[ %index ~GTE 範囲~listの~size ]の場合、 `IndexSizeError$E 例外が投出される。 ◎ Throws an "IndexSizeError" DOMException if the index is out of range.
%time = %media.`end(index)$m
範囲~list内の %index 番の範囲の終端の時刻を返す。 ◎ Returns the time for the end of the range with the given index.
[ %index ~GTE 範囲~listの~size ]の場合、 `IndexSizeError$E 例外が投出される。 ◎ Throws an "IndexSizeError" DOMException if the index is out of range.
`length@m 取得子~手続きは ⇒ ~RET コレが表現する範囲~listの~size ◎ The length IDL attribute must return the number of ranges represented by the object.

[ `start(index)@m / `end(index)@m ]~method~手続きは:

  1. ~IF[ %index ~GTE コレが表現する範囲~listの~size ] ⇒ ~THROW `IndexSizeError$E
  2. %位置 ~LET コレが表現する範囲~list内の %index 番の範囲の[ `start()$m に対しては始端 / `end()$m に対しては終端 ]
  3. ~RET コレが受持つ時列線の始端から,秒数で %位置 を測定した結果
◎ The start(index) method must return the position of the start of the indexth range represented by the object, in seconds measured from the start of the timeline that the object covers. ◎ The end(index) method must return the position of the end of the indexth range represented by the object, in seconds measured from the start of the timeline that the object covers. ◎ These methods must throw "IndexSizeError" DOMExceptions if called with an index argument greater than or equal to the number of ranges represented by the object.

`TimeRanges$I ~objが `正規化-済み@ とは、 それが表現する範囲たちが,次の判定基準を順守することを意味する: ◎ When a TimeRanges object is said to be a normalized TimeRanges object, the ranges it represents must obey the following criteria:

  • どの 2 つの範囲 %A, %B に対しても, %A の方が %B より早いならば ⇒ %A の終端 ~LT %B の始端

    【“より早い( `earlier^en )”: おそらく,範囲の~list内でより早い — 時間的に早いではなく。】

    ◎ The start of a range must be greater than the end of all earlier ranges.
  • どの範囲 %A に対しても ⇒ %A の始端 ~LTE %A の終端 ◎ The start of a range must be less than or equal to the end of that same range.

言い換えれば、 そのような~obj内の一連の範囲は,互いに[ 順序付けられ, 重合しない, 触れてない (隣接する範囲どうしは 1 個のより大きい範囲に~~集約される) ]。 範囲は空(ある瞬間の時刻のみを参照している)にもなり得る — 例えば`~media要素$が静止されたとき,~UAが`~media資源$の現在の~frame以外のすべてを破棄した事例において、 現在~bufferされている唯一の~frameを指示するため。 ◎ In other words, the ranges in such an object are ordered, don't overlap, and don't touch (adjacent ranges are folded into one bigger range). A range can be empty (referencing just a single moment in time), e.g. to indicate that only one frame is currently buffered in the case that the user agent has discarded the entire media resource except for the current frame, when a media element is paused.

`TimeRanges$I ~objの一連の範囲は両端を含むモノトスル。 ◎ Ranges in a TimeRanges object must be inclusive.

したがって,ある範囲の終端は、 後続する隣接する(触れているが重合していない)範囲の始端に等しくなる。 同様に, 0 を起点に時列線~全体を受持つ範囲に対しては、 始端は 0 に等しくなり,終端は時列線の時間長に等しくなる。 ◎ Thus, the end of a range would be equal to the start of a following adjacent (touching but not overlapping) range. Similarly, a range covering a whole timeline anchored at zero would have a start equal to zero and an end equal to the duration of the timeline.

`~media要素$ %要素 の[ `buffered$mM / `seekable$mM / `played$mM ]~IDL属性が返す~objは、 %要素 の`~media時列線$と同じ時列線を利用するモノトスル。 ◎ The timelines used by the objects returned by the buffered, seekable and played IDL attributes of media elements must be that element's media timeline.

4.8.11.15. `TrackEvent^I ~interface
[Exposed=Window]
interface `TrackEvent@I : `Event$I {
  constructor(DOMString type, optional `TrackEventInit$I %eventInitDict = {});

  readonly attribute (`VideoTrack$I or `AudioTrack$I or `TextTrack$I)? `track$m;
};

dictionary `TrackEventInit@I : `EventInit$I {
  (`VideoTrack$I or `AudioTrack$I or `TextTrack$I)? track = null;
};
%event.`track$m
この~eventに関係する~track~obj ( `TextTrack$I / `AudioTrack$I / `VideoTrack$I )を返す。 ◎ Returns the track object (TextTrack, AudioTrack, or VideoTrack) to which the event relates.
`track@m 取得子~手続きは、 初期化-時の値を返す。 それは、 ~eventの文脈~情報を表現する。 ◎ The track attribute must return the value it was initialized to. It represents the context information for the event.
4.8.11.16. ~event要覧
◎非規範的

【 この節に挙げられていた~eventのうち,`~tT$のみに関わるものについては、 編集の都合により, `別~page@~HEtrack#mediaevents$に分けている。 】

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

上に述べた処理~modelの一部として、 次に挙げる~eventが`~media要素$に向けて発火される: ◎ The following events fire on media elements as part of the processing model described above:

~event名 発火-時機 事前条件
`loadstart@et ~UAは、 `資源~選定~algo$の一環として,`~media~data$を探し始めた。 ◎ The user agent begins looking for media data, as part of the resource selection algorithm. `networkState$mM ~EQ `NETWORK_LOADING$mM ◎ networkState equals NETWORK_LOADING
`progress@et ~UAは`~media~data$を~fetchしている。 ◎ The user agent is fetching media data. `networkState$mM ~EQ `NETWORK_LOADING$mM ◎ networkState equals NETWORK_LOADING
`suspend@et ~UAは`~media~data$を意図的に現在~fetchしていない。 ◎ The user agent is intentionally not currently fetching media data. `networkState$mM ~EQ `NETWORK_IDLE$mM ◎ networkState equals NETWORK_IDLE
`abort@et `~media~data$が完全に~downloadされる前に,~UAは~errorに因らずに~fetchするのを停止した。 ◎ The user agent stops fetching the media data before it is completely downloaded, but not due to an error. [ `error$mM ~NEQ ~NULL ]~AND[ `error$mM の`~code$ ~EQ `MEDIA_ERR_ABORTED$mE ]~AND[ `networkState$mM ~EQ [ `NETWORK_EMPTY$mM または `NETWORK_IDLE$mM — どちらに ~EQ かは、 ~downloadがいつ中止されたかに依存する ]] ◎ error is an object with the code MEDIA_ERR_ABORTED. networkState equals either NETWORK_EMPTY or NETWORK_IDLE, depending on when the download was aborted.
`~errorM@et `~media~data$を~fetchしている間に~errorが生じた, または 資源の型は~supportされない~media形式である。 ◎ An error occurs while fetching the media data or the type of the resource is not a supported media format. [ `error$mM ~NEQ ~NULL ]~AND[ `error$mM の`~code$ ~GTE `MEDIA_ERR_NETWORK$mE ]~AND[ `networkState$mM ~EQ [ `NETWORK_EMPTY$mM または `NETWORK_IDLE$mM — どちらに ~EQ かは、 ~downloadがいつ中止されたかに依存する ]] ◎ error is an object with the code MEDIA_ERR_NETWORK or higher. networkState equals either NETWORK_EMPTY or NETWORK_IDLE, depending on when the download was aborted.
`emptied@et `~media要素$の `networkState$mM 値は、 他の値から `NETWORK_EMPTY$mM に切替わった (報告されつつある読込nの間に致命的な~errorが生じたか, `load()$mM ~methodは`資源~選定~algo$を走らせている間に呼出されたために)。 ◎ A media element whose networkState was previously not in the NETWORK_EMPTY state has just switched to that state (either because of a fatal error during load that's about to be reported, or because the load() method was invoked while the resource selection algorithm was already running). `networkState$mM ~EQ `NETWORK_EMPTY$mM — すべての~IDL属性は,それぞれの初期~状態にある。 ◎ networkState is NETWORK_EMPTY; all the IDL attributes are in their initial states.
`stalled@et ~UAは、 `~media~data$を~fetchしようと試行しているが、 ~dataは期待通りに入手できていない。 ◎ The user agent is trying to fetch media data, but data is unexpectedly not forthcoming. `networkState$mM ~EQ `NETWORK_LOADING$mM ◎ networkState is NETWORK_LOADING.
`loadedmetadata@et ~UAは`~media資源$の時間長と寸法を決定した所にあり、 ~tTは `準備済み$i にある。 ◎ The user agent has just determined the duration and dimensions of the media resource and the text tracks are ready. [ `readyState$mM ~GTE `HAVE_METADATA$mM ]でない状態から初めてそうなった ◎ readyState is newly equal to HAVE_METADATA or greater for the first time.
`loadeddata@et [ ~UAは`現在の再生~位置$にある`~media~data$を具現化できる ]でない状態から初めてそうなった ◎ The user agent can render the media data at the current playback position for the first time. [ `readyState$mM ~GTE `HAVE_CURRENT_DATA$mM ]でない状態から初めてそうなった ◎ readyState newly increased to HAVE_CURRENT_DATA or greater for the first time.
`canplay@et ~UAは`~media~data$の再生を再開できるが、 今~再生が開始された場合,[ 現在の再生~rateのままでは、 停止して内容を更に~bufferしない限り,`~media資源$を終端までは具現化できない ]と見積もっている。 ◎ The user agent can resume playback of the media data, but estimates that if playback were to be started now, the media resource could not be rendered at the current playback rate up to its end without having to stop for further buffering of content. [ `readyState$mM ~GTE `HAVE_FUTURE_DATA$mM ]でない状態からそうなった ◎ readyState newly increased to HAVE_FUTURE_DATA or greater.
`canplaythrough@et ~UAは、 今~再生が開始された場合でも,[ 現在の再生~rateのままでも、 停止して内容を更に~bufferせずに,`~media資源$は終端まで具現化できる ]と見積もっている。 ◎ The user agent estimates that if playback were to be started now, the media resource could be rendered at the current playback rate all the way to its end without having to stop for further buffering. [ `readyState$mM ~EQ `HAVE_ENOUGH_DATA$mM ]でない状態からそうなった ◎ readyState is newly equal to HAVE_ENOUGH_DATA.
`playing@et `~media~data$を欠くこと因り,再生は[ 静止-/遅延- ]されていたが、 その後,開始-準備済みにある。 ◎ Playback is ready to start after having been paused or delayed due to lack of media data. [[ `readyState$mM ~GTE `HAVE_FUTURE_DATA$mM ]~AND[ `paused$mM ~EQ ~F ]]でない状態からそうなった。 この~eventが発火されても,要素は`再生-中になり得る$ようになったとは限らない — 例: 要素は[ `利用者-ヤリトリ用に静止され$/ `帯域内~内容~用に静止され$ ]ているとき。 ◎ readyState is newly greater than or equal to HAVE_FUTURE_DATA and paused is false, or paused is newly false and readyState is greater than or equal to HAVE_FUTURE_DATA. Even if this event fires, the element might still not be potentially playing, e.g. if the element is paused for user interaction or paused for in-band content.
`waiting@et 再生は次~frameが可用でないため停止されたが、 ~UAは,そのうち可用になると期待している。 ◎ Playback has stopped because the next frame is not available, but the user agent expects that frame to become available in due course. [ `readyState$mM ~LTE `HAVE_CURRENT_DATA$mM ]~AND[ `paused$mM ~EQ ~F ]~AND[[ `seeking$mM ~EQ ~T ]~OR[ `現在の再生~位置$は `buffered$mM 内のどの範囲にも包含されていない ]]。 [ `paused$mM ~EQ ~F ]でなくとも,再生は他の理由により停止されることもあり得るが、 この~eventは,そのような理由では発火されない (加えて、 それらの状況が解決されても, `playing$et ~eventが別々に発火されることはない) — 例えば: `再生は終止して$いる / 再生は`~errorに因り停止され$ている / 要素は`利用者-ヤリトリ用に静止され$ている / 要素は`帯域内~内容~用に静止され$ている。 ◎ readyState is less than or equal to HAVE_CURRENT_DATA, and paused is false. Either seeking is true, or the current playback position is not contained in any of the ranges in buffered. It is possible for playback to stop for other reasons without paused being false, but those reasons do not fire this event (and when those situations resolve, a separate playing event is not fired either): e.g., playback has ended, or playback stopped due to errors, or the element has paused for user interaction or paused for in-band content.
`seeking@et [ `seeking$mM ~IDL属性は ~T に変化した ]~AND[ ~UAは新たな位置への~seekingを開始した ]。 ◎ The seeking IDL attribute changed to true, and the user agent has started seeking to a new position.
`seeked@et `現在の再生~位置$が変化した後に, `seeking$mM ~IDL属性は ~F に変化した。 ◎ The seeking IDL attribute changed to false after the current playback position was changed.
`ended@et `~media資源$の終端に達したため、 再生を停止した。 ◎ Playback has stopped because the end of the media resource was reached. [ `currentTime$mM ~EQ `~media資源$の終端 ]~AND[ `ended$mM ~EQ ~T ] ◎ currentTime equals the end of the media resource; ended is true.
`durationchange@et `duration$mM 属性が直前に更新された。 ◎ The duration attribute has just been updated.
`timeupdate@et `現在の再生~位置$は、 通常の再生の一部として,とりわけ~~特徴的な仕方で — 例えば不連続に — 変化した。 ◎ The current playback position changed as part of normal playback or in an especially interesting way, for example discontinuously.
`play@et 静止されていた要素は、 再生され始めた。 [ `play()$mM ~methodが返った後 / `autoplay$aM 属性により再生を始めさせたとき ]に,発火される。 ◎ The element is no longer paused. Fired after the play() method has returned, or when the autoplay attribute has caused playback to begin. `paused$mM 値は新たに ~F になった。 ◎ paused is newly false.
`pause@et 要素は静止された。 `pause()$mM ~methodが返った後に発火される。 ◎ The element has been paused. Fired after the pause() method has returned. `paused$mM は新たに ~T になった。 ◎ paused is newly true.
`ratechange@et [ `defaultPlaybackRate$mM / `playbackRate$mM ]属性が直前に更新された。 ◎ Either the defaultPlaybackRate or the playbackRate attribute has just been updated.
`resize@et [ `videoWidth$mV / `videoHeight$mV ]属性が直前に更新された。 ◎ One or both of the videoWidth and videoHeight attributes have just been updated. [ `~media要素$は `video$e 要素である ]~AND[ `readyState$mM ~NEQ `HAVE_NOTHING$mM ] ◎ Media element is a video element; readyState is not HAVE_NOTHING
`volumechange@et [ `volume$mM / `muted$mM ]属性が変化した。 関連な属性の設定子が返った後に発火される。 ◎ Either the volume attribute or the muted attribute has changed. Fired after the relevant attribute's setter has returned.

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

~event名 発火-時機
`~errorS@et `~media~data$を~fetchしている間に~errorが生じた, または 資源の型は~supportされない~media形式である。 ◎ An error occurs while fetching the media data or the type of the resource is not a supported media format.

次に挙げる~eventは、[ `AudioTrackList$I / `VideoTrackList$I / `TextTrackList$I ]~objに向けて発火される: ◎ The following events fire on AudioTrackList, VideoTrackList, and TextTrackList objects:

~event名 ~interface 発火-時機
`change@et `Event$I ~track~list内の 1 個~以上の~trackが[ 可能化-/不能化- ]されたとき。 ◎ One or more tracks in the track list have been enabled or disabled.
`addtrack@et `TrackEvent$I ~track~listに~trackが追加されたとき。 ◎ A track has been added to the track list.
`removetrack@et `TrackEvent$I ~track~listから~trackが除去されたとき。 ◎ A track has been removed from the track list.
4.8.11.17. ~securityと~privacy上の考慮点

`video$e / `audio$e 要素における 主な~securityや~privacy上の含意は、 非同一-生成元の~mediaを埋込む能に~~由来する。 この脅威は、 敵対的~内容から被害者~pageへ流れることも,その逆~方向へ流れることもある。 ◎ The main security and privacy implications of the video and audio elements come from the ability to embed media cross-origin. There are two directions that threats can flow: from hostile content to a victim page, and from a hostile page to victim content.


被害者~pageが敵対的~内容を埋込む場合の脅威は、 当の内容が~scriptを含んでいて,それを埋込んでいる `Document$I とヤリトリしようと試みることにより生じる。 これを避けるため、 ~UAは,[ そのような内容は、 埋込んでいる~pageに~accessし得ない ]ことを確保するモノトスル。 ~media内容~DOM概念を利用している事例では、[ 埋込まれた内容は、 自前の無関係な`~top-level辿可能$に属している ]かのように扱うモノトスル。 ◎ If a victim page embeds hostile content, the threat is that the content might contain scripted code that attempts to interact with the Document that embeds the content. To avoid this, user agents must ensure that there is no access from the content to the embedding page. In the case of media content that uses DOM concepts, the embedded content must be treated as if it was in its own unrelated top-level traversable.

一例として、 `video$e 要素~内に~SVG~animationが埋込まれた場合、 ~UAは,外縁~pageの~DOMへの~accessは与えないことになる。 ~SVG資源~内の~scriptの視点からは、 ~SVG~fileは,孤立な~top-level辿可能~内にあるかのように現れることになる。 ◎ For instance, if an SVG animation was embedded in a video element, the user agent would not give it access to the DOM of the outer page. From the perspective of scripts in the SVG resource, the SVG file would appear to be in a lone top-level browsing context with no parent.


敵対的~pageが被害者~内容を埋込む場合の脅威は、 埋込んでいる~pageが,さもなければ~accessできない情報を当の内容から得せるときに生じる。 ~APIは一部の情報 — その~mediaの存在, その[ 型, 時間長, ~size ], その~hostの処理能~特性 — については公開する。 そのような情報も~~問題になり得るが、 実施においては, `img$e 要素を利用しても およそ同じ情報を得せるので、 受容-可能と判断されている。 ◎ If a hostile page embeds victim content, the threat is that the embedding page could obtain information from the content that it would not otherwise have access to. The API does expose some information: the existence of the media, its type, its duration, its size, and the performance characteristics of its host. Such information is already potentially problematic, but in practice the same information can more or less be obtained using the img element, and so it has been deemed acceptable.

しかしながら,~UAが内容の中の~metadata — 字幕など — を更に公開した場合、 より有意に敏感な情報も得せるようになる。 したがって,そのような情報は、 動画~資源が~CORSを利用する場合に限り公開される。 作者は、 `crossorigin$aM 属性で~CORSを可能化できる。 `FETCH$r ◎ However, significantly more sensitive information could be obtained if the user agent further exposes metadata within the content, such as subtitles. That information is therefore only exposed if the video resource uses CORS. The crossorigin attribute allows authors to enable CORS. [FETCH]

この制約がなければ、 攻撃者は、 企業内~networkの中で走らせている利用者を ~siteを訪問するよう騙して,企業の~intranet内の 以前に漏洩された所在から動画を読込ませるよう試みることも可能になる。 そのような動画が新製品の機密的な計画を含んでいた場合、 字幕を読取れることにより,機密性に深刻な抜け穴を~~呈することになる。 ◎ Without this restriction, an attacker could trick a user running within a corporate network into visiting a site that attempts to load a video from a previously leaked location on the corporation's intranet. If such a video included confidential plans for a new product, then being able to read the subtitles would present a serious confidentiality breach.

4.8.11.18. ~media要素を利用する作者~向けの最善な実施
◎非規範的

音声や動画の資源を,~set-top-boxや携帯~電話などの小さい機器で再生するときは、 ~hardware資源の制限に拘束されることが多い。 例えば機器は、 同時に 3 個の動画までしか~supportしないかもしれない。 この理由から、 再生し終えた`~media要素$に保持されている資源を解放するのは,良い実施になる — [ ~garbage収集されるよう,要素への参照をすべて除去すること ]に特に気を付けるか,あるいはもっと良いのは、 要素の `src$aM 属性を空~文字列に設定するか,あるいは[ `srcObject$mM が ~NULL 以外に設定された事例では、 代わりに それを ~NULL に設定する ]ことにより。 ◎ Playing audio and video resources on small devices such as set-top boxes or mobile phones is often constrained by limited hardware resources in the device. For example, a device might only support three simultaneous videos. For this reason, it is a good practice to release resources held by media elements when they are done playing, either by being very careful about removing all references to the element and allowing it to be garbage collected, or, even better, by setting the element's src attribute to an empty string. In cases where srcObject was set, instead set the srcObject to null.

同様に,再生~rateが正確に 1.0 でない下では、[ ~hardware / ~software / 形式 ]の制限により,動画~frameが落とされたり, 音声が震える/消音されることもある。 ◎ Similarly, when the playback rate is not exactly 1.0, hardware, software, or format limitations can cause video frames to be dropped and audio to be choppy or muted.

4.8.11.19. ~media要素の実装者~向けの最善な実施
◎非規範的

`~media要素$~APIの様々な側面を正確aにどう実装するかは、 実装の品質における課題と見なされる。 ◎ How accurately various aspects of the media element API are implemented is considered a quality-of-implementation issue.

例えば `buffered$mM 属性を実装するとき、 ~bufferされた一連の範囲を 実装がどこまで精確に報告するかは、 ~UAが~dataをどこまで注意深く検分するかに依存する。 ~APIは,一連の範囲を一連の時刻として報告するが、 ~dataは~byte~streamで得されるので、 可変~bitrateの~streamを受信している~UAが精確な時刻を決定するためには,すべての~dataを実際に復号するしかないかもしれない。 ~UAには,これを行うことは要求されないが、 代わりに見積もりを返せる (例えば,それまでの平均~bitrateに基づいて) — それは、 情報がより多く可用になるに伴い,改訂され続ける。 ◎ For example, when implementing the buffered attribute, how precise an implementation reports the ranges that have been buffered depends on how carefully the user agent inspects the data. Since the API reports ranges as times, but the data is obtained in byte streams, a user agent receiving a variable-bitrate stream might only be able to determine precise times by actually decoding all of the data. User agents aren't required to do this, however; they can instead return estimates (e.g. based on the average bitrate seen so far) which get revised as more information becomes available.

一般~規則として、 ~UAには楽観的になるより保守的になることが督促される。 例えば、 全部~bufferされていないのに,そうであるかのように報告するのは、 不良になる。 ◎ As a general rule, user agents are urged to be conservative rather than optimistic. For example, it would be bad to report that everything had been buffered when it had not.

実装~品質に関する別の課題は、 ~codecが順方向への再生~用にしか設計されてないときに,動画を逆方向に再生することであろう (例えば、 ~key-frameはまばらで,~~合間の各~frameは前の~frameからの差分しか持たない)。 ~UAは、 例えば ~key-frameしか示さないような拙い仕事を行うこともできるが、 もっと作り込めば — 例えば、 動画の順方向にある部分を実際に復号して,完全な~frameたちを格納してから、 逆方向に再生するなど — より良い仕事を行う実装になる。 ◎ Another quality-of-implementation issue would be playing a video backwards when the codec is designed only for forward playback (e.g. there aren't many key frames, and they are far apart, and the intervening frames only have deltas from the previous frame). User agents could do a poor job, e.g. only showing key frames; however, better implementations would do more work and thus do a better job, e.g. actually decoding parts of the video forwards, storing the complete frames, and then playing the frames backwards.

同様に,実装は、 いつでも,~bufferされた~dataを落とすことが許容されるが (~UAが,得した~media~dataすべてを~media要素が存続する限り保ち続ける要件はない)、 それもまた実装~品質の課題になる。 周りの~dataすべてを保つに足る資源がある~UAには、 そうすることが奨励される — その方が利用者~体験はより良くなるので。 例えば,利用者が~live~streamを視聴している場合、 ~UAは,~live動画しか見れなくすることもできるが、 ~UAが全部を~bufferして,[ より早い素材へ~seekする / 静止する / 順方向や逆方向に再生する ], 等々を利用できた方が良くなる。 ◎ Similarly, while implementations are allowed to drop buffered data at any time (there is no requirement that a user agent keep all the media data obtained for the lifetime of the media element), it is again a quality of implementation issue: user agents with sufficient resources to keep all the data around are encouraged to do so, as this allows for a better user experience. For example, if the user is watching a live stream, a user agent could allow the user only to view the live video; however, a better user agent would buffer everything and allow the user to seek through the earlier material, pause it, play it forwards and backwards, etc.


静止されている`~media要素$が`文書から除去され$, 次回に`~event~loop$の`最初の段$に達する前に挿入し直されなかったときは、 資源が拘束されている実装には,`~media要素$に利用されているすべての~hardware資源 (動画~plane, ~network用の資源, ~data~bufferなど) を解放する機会を~~活用することが奨励される (それでも,後で再生を開始し直す事例もあるので、 ~UAは再生~位置, 等々は保ち続ける必要があるが)。 ◎ When a media element that is paused is removed from a document and not reinserted before the next time the event loop reaches step 1, implementations that are resource constrained are encouraged to take that opportunity to release all hardware resources (like video planes, networking resources, and data buffers) used by the media element. (User agents still have to keep track of the playback position and so forth, though, in case playback is later restarted.)