Tuesday, 5 March 2013

HTML Track Status

I've been looking at how the track gets implemented and how WebVTT cues are loaded. This is where things are concerning the HTML element track.



interface HTMLMediaElement
readonly attribute TextTrackList textTracks
TextTrack addTextTrack(DOMString kind, optional DOMString label, optional DOMString language)

Timed Text Track Model
this describes how HTMLMediaElement deals with text tracks. it's quite extensive.

interface HTMLTrackElement
readonly attribute TextTrack track

interface TextTrackList
getter TextTrack (unsigned long index)

REPO: unknown

interface TextTrack
readonly attribute TextTrackCueList? cues
readonly attribute TextTrackCueList? activeCues
void addCue(TextTrackCue cue)
void removeCue(TextTrackCue cue)

interface TextTrackCueList
getter TextTrackCue (unsigned long index)
TextTrackCue? getCueById(DOMString id)

interface TextTrackCue
readonly attribute TextTrack? track
DocumentFragment getCueAsHTML()

The getCueAsHTML() method must convert the text track cue text to a DocumentFragment for the script's document of the entry script, using the appropriate rules for doing so. For example, for WebVTT, those rules are the WebVTT cue text parsing rules and the WebVTT cue text DOM construction rules.


Coming Changes to Specification

There are big changes coming to the track element and WebVTT. Either the TextTrackCue interface is moving to the WebVTT spec, or the parsing, DOM construction, and rendering rules will move to the HTML spec.

See this and replies: http://lists.w3.org/Archives/Public/public-texttracks/2013Feb/0005.html


Also, I'm working on rendering. Just to note, there are 5 sections to the WebVTT specification, these three are in addition to syntax and parsing.


WebVTT DOM Construction Rules:

WebVTT Rendering Rules:

WebVTT CSS Rules:

No comments:

Post a comment