Accessibility/HTML5 captions v2: Difference between revisions

Jump to navigation Jump to search
added events for itextlist
(started with itextlist and itext elements)
 
(added events for itextlist)
Line 38: Line 38:
               attribute DOMString category;
               attribute DOMString category;
               attribute DOMString active;
               attribute DOMString active;
      readonly attribute HTMLCollection allText;
      readonly attribute langName;


       // event handler  
       // event handler  
Line 50: Line 47:
The itextlist element allows authors to provide a list of alternative information text tracks that relate to a video or audio element. These tracks provide e.g. captions or subtitles in alternative languages.
The itextlist element allows authors to provide a list of alternative information text tracks that relate to a video or audio element. These tracks provide e.g. captions or subtitles in alternative languages.


The itextlist groups itext elements of the same category together. The category attribute describes what function the informative text represents and can be one of the following:
1. Attributes
 
The itextlist groups itext elements of the same category together. The "category" attribute describes what function the informative text represents and can be one of the following:
* CC: closed captions (for the deaf)
* CC: closed captions (for the deaf)
* SUB: subtitles (for i18n)
* SUB: subtitles (for i18n)
Line 66: Line 65:
The "active" attribute describes which itext element is active and can have the values "none", "auto", or the id name of a contained itext element. In case of an error, no itext element will be active. The default value is "auto", which means an itext track is selected based on the browser settings. These include the browser's language setting and its setting related to accessibility - e.g. for blind users no text is displayed, but if a TAD track is available, it will be activated in the selected language.
The "active" attribute describes which itext element is active and can have the values "none", "auto", or the id name of a contained itext element. In case of an error, no itext element will be active. The default value is "auto", which means an itext track is selected based on the browser settings. These include the browser's language setting and its setting related to accessibility - e.g. for blind users no text is displayed, but if a TAD track is available, it will be activated in the selected language.


The allText attribute allows access to all the text segments as extracted from the active itext resource.
The langName attribute exposes the full language name for the itext resource, such that a javascript developer can display it in a menu. The lang attribute of the itext elements themselves contains the actual language code which is more appropriate for automated processing.


 
2. CSS default styling based on the category attribute
Further itextlist functionality:
 
1. CSS default styling based on the category attribute


Text itself:
Text itself:
Line 98: Line 91:
   aligned with the top of the video or audio element
   aligned with the top of the video or audio element
   background-color: #333333;
   background-color: #333333;
others TBD
3. Event handlers
An active itext element will consist of a series of text elements with a start and a end time. Only one such text element is at most displayed per itextlist - the last element for which the audio or video element's currentTime is between its start and end time.
As a new such text element is displayed, the itextlist element's registered onenter callback function is called - if one such has been registered.
As the end of such a text element is reached, the itextlist element's registered onleave callback function is called - if one such has been registered.
These functions allow cues to be associated with text elements, e.g. the display of a special offer, or moving to another sentence in a full text transcript of a video.




Line 110: Line 116:


Contexts in which this element may be used:
Contexts in which this element may be used:
     In a video or audio element that is a child of a body element.
     In a itextlist element that is a child of a audio or video element.


Content model:
Content model:
Line 116: Line 122:


Content attributes:
Content attributes:
     Global attributes (include id and style)
     Global attributes (include id, class and style)
    category
     src
     src
     lang
     lang
     type
     type
     charset
     charset
    display


DOM interface:
DOM interface:
Line 128: Line 132:
     [Callable=namedItem]
     [Callable=namedItem]
     interface HTMLItextElement : HTMLElement {
     interface HTMLItextElement : HTMLElement {
              attribute DOMString category;
               attribute DOMString src;
               attribute DOMString src;
               attribute DOMString lang;
               attribute DOMString lang;
               attribute DOMString type;
               attribute DOMString type;
               attribute DOMString charset;
               attribute DOMString charset;
               attribute boolean display;
               attribute float    delay;
              attribute unsigned long stretch;


       readonly attribute boolean fetched;
       readonly attribute boolean fetched;
      readonly attribute boolean enabled;
       readonly attribute ItextError error;
       readonly attribute ItextError error;
      readonly attribute float delay;
       readonly attribute HTMLCollection allText;
       readonly attribute HTMLCollection allText;
       readonly attribute langName;
       readonly attribute langName;
Line 160: Line 162:
The charset attribute gives the character encoding of the external text resource. If the attribute is set, its value must be a valid character encoding name, must be the preferred name for that encoding, and must match the encoding given in the charset parameter of the Content-Type metadata of the external file, if any. [IANACHARSET]
The charset attribute gives the character encoding of the external text resource. If the attribute is set, its value must be a valid character encoding name, must be the preferred name for that encoding, and must match the encoding given in the charset parameter of the Content-Type metadata of the external file, if any. [IANACHARSET]


The allText attribute allows access to all the text segments as extracted from the active itext resource.
The langName attribute exposes the full language name for the itext resource, such that a javascript developer can display it in a menu. The lang attribute of the itext elements themselves contains the actual language code which is more appropriate for automated processing.




Navigation menu