401
edits
(added events for itextlist) |
(update to itext element) |
||
| Line 144: | Line 144: | ||
readonly attribute langName; | readonly attribute langName; | ||
void fetch(); | |||
DOMString currentText(currentTime); | |||
}; | }; | ||
| Line 152: | Line 151: | ||
The itext element allows authors to include a link to an external file that contains informative text about the video. The external resource is expected to consist of a sequence of time intervals with associated text and potentially layout, styling, and animation information for the text. The text is displayed as the parent audio or video element goes through its time interval, i.e. the parent's currentTime has reached the start time of the interval but has not yet reached the end time of the interval (a semi-open interval: [start,end) ). | The itext element allows authors to include a link to an external file that contains informative text about the video. The external resource is expected to consist of a sequence of time intervals with associated text and potentially layout, styling, and animation information for the text. The text is displayed as the parent audio or video element goes through its time interval, i.e. the parent's currentTime has reached the start time of the interval but has not yet reached the end time of the interval (a semi-open interval: [start,end) ). | ||
1. Interpreting the itext resource | |||
The src attribute gives the address of the external itext resource. The value of the attribute must be a valid URL identifying a text resource of the type given by the type attribute, if the attribute is present, or of the type "text/srt", if the attribute is absent. This attribute is required to enable the user agent to pick the correct parser for the file, even if it only receives a "text/plain" resource. | |||
The type attribute gives the format of the data, RFC 2046. If the attribute is present, its value must be a valid MIME type, optionally with parameters. The charset parameter must not be specified. (The default, which is used if the attribute is absent, is "text/srt".) [RFC2046] | The type attribute gives the format of the data, RFC 2046. If the attribute is present, its value must be a valid MIME type, optionally with parameters. The charset parameter must not be specified. (The default, which is used if the attribute is absent, is "text/srt".) [RFC2046] | ||
NOTE: text/srt will need to be registered as a mime type (as well as a format standardisation) | |||
The lang attribute, if present, gives the language of the linked resource. The value must be a valid RFC 3066 language code. [RFC3066] User agents will use this attribute to select between, e.g., all itext elements given for a video or audio element that belong to the same category, but represent different languages. User agents that discover upon fetching of the resource that language information associated with the resource differs from the given lang, will set an error code on the element. | The lang attribute, if present, gives the language of the linked resource. The value must be a valid RFC 3066 language code. [RFC3066] User agents will use this attribute to select between, e.g., all itext elements given for a video or audio element that belong to the same category, but represent different languages. User agents that discover upon fetching of the resource that language information associated with the resource differs from the given lang, will set an error code on the element. | ||
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] This attribute is required since many formats and in particular text/srt does not provide the charset it is encoded in within the resource and thus the user agent has no way of knowing how to interpret and represent the characters. | ||
2. Itext fetching | |||
An itext resource is not automatically fetched as the element is parsed, since there may be a sizeable number of external resources to retrieve for an individual video or audio element. It is only fetched under the following circumstances: | An itext resource is not automatically fetched as the element is parsed, since there may be a sizeable number of external resources to retrieve for an individual video or audio element. It is only fetched under the following circumstances: | ||
* if the | * if the parent itextlist element activates it or | ||
* if the fetch() function has been called on the itext element. | * if the fetch() function has been called on the itext element. | ||
Fetching an itext resource means following the src URL and retrieving the resource. Fetching the external resource must not delay the load event of the element's document. The user agent will work with the fetched itext resource as soon as it is retrieved. | Fetching an itext resource means following the src URL and retrieving the resource. Fetching the external resource must not delay the load event of the element's document. The user agent will work with the fetched itext resource as soon as it is retrieved. | ||
The "fetched" attribute will signify if the fetching process has finished. | |||
3. Itext display | |||
An activated itext resource displays its content on screen. | An activated itext resource displays its content on screen. | ||
An itext resource that has been fetched using the fetch() function is | An itext resource that has been fetched using the fetch() function is not activated until its itextlist parent activates it. In this way, itext resources can be pre-fetched. | ||
4. Itext adjustments | |||
The itext resource is synchronised to its parent audio or video element through the | The itext resource is synchronised to its parent audio or video element through the audio or video's currentTime attribute. Sometimes, synchronisation can be off. | ||
The delay | The delay and stretch attributes enables the publisher to make fixes to the timing information inside an itext resource. The "delay" attribute will start the itext resource with a delay and the "stretch" attribute will calculate a constant drift on each timing information of the itext resource. "delay" is given in seconds with 0 being the default, and "stretch" is given as a percentage with 100% the default. | ||
5. Itext errors | 5. Itext errors | ||
| Line 208: | Line 203: | ||
readonly attribute unsigned short code; | readonly attribute unsigned short code; | ||
}; | }; | ||
6. Other itext attributes | |||
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. | |||
7. Itext text extraction | |||
The currentText(currentTime) function returns the current text segment from the itext resource, i.e. the text that is active at the parent's currentTime attribute value. | |||
edits