w3c / webvtt

WebVTT Standard
https://w3c.github.io/webvtt/
Other
103 stars 40 forks source link

Add a kind sub-type differentiator to new WebVTT ATTRIBUTES block #525

Open cookiecrook opened 2 months ago

cookiecrook commented 2 months ago

Add a kind sub-type differentiator to VTT ATTRIBUTES block (Depends on #511, prerequisite to #512)

With #511, WebVTT will unambiguously have a way to clarify the kind of VTT (captions, descriptions, metadata, etc) in alignment with the HTML track element's kind attribute. However, there isn't yet a way to differentiate between subtypes of metadata, or subtypes of other kinds including descriptions. This (or another solution) seems necessary for parsing in order to solve the following use cases and more.

Metadata kind sub-types:

Caption or Description sub-types:

Since the ATTRIBUTES block is new for Issue #511 and PR #523, I decided to keep this complication out of the first PR with the goal of easing review. discussion, and progress.

cookiecrook commented 2 months ago

In case the commented blocks need to be removed entirely from PR #523, adding them here.

One additional key rule in the "WebVTT attributes block parsing" algorithm:

<dt>If the key name is "<code>type</code>" (TODO: For clarity, should this be "subkind" or "kind_subtype" instead?)</dt>
<dd>Process the value according to the <a>WebVTT type attribute parsing rules</a>.

And the new "WebVTT type attribute attribute parsing" algorithm the prior rule referenced:

<p>The <dfn>WebVTT type attribute parsing rules</dfn> consist of the following algorithm.</p>

<ol algorithm="WebVTT type attribute attribute parsing">
 <li>TODO: This could reference a new TBD W3C Note or Evergreen list of acknowledged kind subtypes, along with a reference to the specification for each, which clarify the usage or define further parsing rules of each type. For example:
  <ul>
   <li>metadata subtype: time-coded video poster thumbnails (<a href="https://github.com/w3c/webvtt/issues/511#issuecomment-1487497644">common de facto use for preview scrubbing</a> but no spec exists)</li>
   <li>metadata subtype: <a href="https://github.com/w3c/webvtt/issues/512">WebVTT Issue 512: time-coded flash metadata</a></li>
   <li>metadata subtype: <a href="https://github.com/w3ctag/design-reviews/issues/952">video chapter times, thumbnails, and titles</a>
   <li>caption or description subtype: text equivalent of audio description dialogue audio track (<a href="https://www.w3.org/2022/09/14-audio-descriptions-minutes.html">VTT descriptions rendered on braille displays</a> used by blind and deafblind individuals)</li>
   <li>etc.</li>
  </ul>
 </li>
</ol>
cookiecrook commented 2 months ago

In https://github.com/w3c/webvtt/issues/511#issuecomment-1714494386, @andreastai suggested that the new attribute (bikeshed name type or subkind?) be considered for an additional attribute on the HTML track element like the others.