W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2009

[whatwg] Captions, Subtitles and the Video Element

From: Jeff Walden <jwalden+whatwg@MIT.EDU>
Date: Fri, 20 Feb 2009 15:00:58 -0800
Message-ID: <499F362A.4050703@mit.edu>
On 19.2.09 14:37, Greg Millam wrote:
>    *<video>  . . .</video>  is not necessarily a standalone tag. If the
> author desires, they can add more elements to define tracks. Whether
> this should be<caption type="format" src="..." media="caption">  or
> <source type="timedtext/format" src="...">  can vary. (I prefer
> <caption>  as it's more explicit).
>    *<caption src="foo.srt" type="caption" language="en" name="default"
> />  adds a new caption.<caption>  is standalone.
>    * Caption tags, when displayed, count as<span
> class="caption">...</span>  unless they have style associated with them
> (uncommon). So they can be tweaked via CSS. Whether by the author or
> overridden by useragent.
>
> User Agent:
>    * Implements support for<caption>  tag.

To clarify/expand the point made elsewhere in the thread, this name conflicts with the <caption> element used in tables, so you'd have to fight existing HTML parsers to be able to use this right now.  I'm not a fan of reusing names as you propose for <caption> and as is currently done with <legend> within <details>/<figure> for this reason.


>    * Media or Video elements now have additional features exposed via javascript.
>    * getCaptionList(): returns an array of caption elements.

On 19.2.09 14:46, Kristof Zelechovski wrote:
> Instead of
> 	  * getCaptionList(): returns an array of caption elements.
> Have
> 	  * getCaptions(): returns an array of caption elements.

Even more minimally than either suggestion, just a "captions" getter that returns a (non-static) NodeList; getter methods are distinctly un-DOMish.


> User Agent UI: (Only relevant if User Agent adds its own controls for media):
>    * Must be able to enable caption Elements.
>    * Preferably by a button on the UI with either "CC" or a double
> underscore (preferred).
>
> User Agent Context Menu:
>    * Must have captions, with a list to enable/disable.

I'd rather not see this required as implementers may well create better interfaces than the context menu for doing this, and making a specific requirement for a specific widget feels rather odd.  The simple requirement that there be a way to enable captions on a per-media element basis (per-page or per-user agent instance both being insufficient) seems sufficient to me; I don't really think you can mandate usability, and users won't tolerate unusable caption UI.  However, making it an implementation suggestion is fine (as you suggest for the User Agent UI part with respect to a CC/double underscore button).

Jeff
-- 
Life would be so much easier if humans had a natural affinity for remembering 128-bit integers.
Received on Friday, 20 February 2009 15:00:58 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:09 UTC