Short URL: http://html5.org/r/6023
| SVN | Bug | Comment | Time (UTC) |
|---|---|---|---|
| 6023 | (commented-out) Specify TrackList.getKind(), so that we can easily add it if we can actually find a way of getting this data for more than just ogg. | 2011-04-21 23:28 |
Index: source
===================================================================
--- source (revision 6022)
+++ source (revision 6023)
@@ -31249,7 +31249,8 @@
<pre class="idl">interface <dfn>TrackList</dfn> {
readonly attribute unsigned long <span title="dom-TrackList-length">length</span>;
- DOMString <span title="dom-TrackList-getID">getID</span>(in unsigned long index);
+ DOMString <span title="dom-TrackList-getID">getID</span>(in unsigned long index);<!--
+ DOMString <span title="dom-TrackList-getKind">getKind</span>(in unsigned long index);-->
DOMString <span title="dom-TrackList-getLabel">getLabel</span>(in unsigned long index);
DOMString <span title="dom-TrackList-getLanguage">getLanguage</span>(in unsigned long index);
@@ -31287,7 +31288,15 @@
href="#hrefMEDIAFRAG">[MEDIAFRAG]</a></p>
</dd>
+<!--
+ <dt><var title="">kind</var> = <var title="">tracks</var> . <code title="dom-TrackList-getKind">getKind</code>( <var title="">index</var> )</dt>
+ <dd>
+
+ <p>Returns the category the given track falls into. The <a href="#dom-TrackList-getKind-categories">possible track categories</a> are given below.</p>
+
+ </dd>
+-->
<dt><var title="">label</var> = <var title="">tracks</var> . <code title="dom-TrackList-getLabel">getLabel</code>( <var title="">index</var> )</dt>
<dd>
@@ -31371,6 +31380,77 @@
if used as the name of a track in the track dimension of such a
fragment identifier. <a href="#refsMEDIAFRAG">[MEDIAFRAG]</a></p>
+<!--
+ <p>The <dfn title="dom-TrackList-getKind"><code>getKind(<var
+ title="">index</var>)</code></dfn> method must return the category
+ of the track with index <var title="">index</var>, if there is one.
+ If there is no such track, then the method must instead throw an
+ <code>INDEX_SIZE_ERR</code> exception.</p>
+
+ <p>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 <span>media
+ resource</span>. For Ogg files, the Role header of the track gives
+ the relevant metadata. 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.</p>
+
+ </div>
+
+ <table id="dom-TrackList-getKind-categories">
+ <caption>Return values for <code title="dom-TrackList-getKind">getKind()</code></caption>
+ <thead>
+ <tr>
+ <th>Category
+ <th>Definition
+ <th>Applies to...</th>
+ <th>Examples
+ <tbody>
+
+ <tr>
+ <td>"<dfn title="dom-TrackList-getKind-alternate"><code>alternative</code></dfn>"
+ <td>A possible alternative to the main track, e.g. a different take of a song (audio), or a different angle (video).
+ <td>Audio and video.
+ <td>Ogg: "audio/alterate" or "video/alternate".
+
+ <tr>
+ <td>"<dfn title="dom-TrackList-getKind-description"><code>description</code></dfn>"
+ <td>An audio description of a video track.
+ <td>Audio only.
+ <td>Ogg: "audio/audiodesc".
+
+ <tr>
+ <td>"<dfn title="dom-TrackList-getKind-main"><code>main</code></dfn>"
+ <td>The primary audio or video track.
+ <td>Audio and video.
+ <td>Ogg: "audio/main" or "video/main".
+
+ <tr>
+ <td>"<dfn title="dom-TrackList-getKind-sign"><code>sign</code></dfn>"
+ <td>A sign-language interpretation of an audio track.
+ <td>Video only.
+ <td>Ogg: "video/sign".
+
+ <tr>
+ <td>"<dfn title="dom-TrackList-getKind-translation"><code>translation</code></dfn>"
+ <td>A translated version of the main track.
+ <td>Audio only.
+ <td>Ogg: "audio/dub".
+
+ <tr>
+ <td>"<dfn title="dom-TrackList-getKind-none"><code></code></dfn>" (empty string)
+ <td>No explicit kind, or the kind given by the track's metadata is not recognised by the user agent.
+ <td>Audio and video.
+ <td>Any other track type or track role.
+
+ </table>
+
+ <div class="impl">
+-->
+
<p>The <dfn title="dom-TrackList-getLabel"><code>getLabel(<var
title="">index</var>)</code></dfn> method must return the label of
the track with index <var title="">index</var>, if there is one and