W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2011

[whatwg] TextTrackCueList methods for adding/removing/editing cues

From: Rodger Combs <rodger.combs@gmail.com>
Date: Sun, 19 Jun 2011 20:26:00 -0500
Message-ID: <847B6A4C-9DFC-4E14-9CB2-AD8B26D5114C@gmail.com>
There are a few possible cases when JavaScript may need to add, remove, read, or modify a cue from a <track>:
1. A web-based caption editor
2. Parsing captions from an external non-WebVTT file (retrieved with XHR, EventSource [for live videos], WebSocket, etc.)
3. Live translating of captions using an external translation API
4. Probably more that I'm not thinking of
Adding a set of methods to the TextTrackCueList for cue modification could be useful. Here's an example interface:

TextTrackCue addCue(in double startTime, in double endTime, in DOMString text, in optional DOMString[] flags);
void removeCue(in TextTrackCue);
void removeCueById(in DOMString id);

Also, I recommend that in TextTrackCue, startTime, endTime, and pauseOnExit are made non-readonly, and that "attribute DOMString text;" is added to the interface.

So, thoughts?
Received on Sunday, 19 June 2011 18:26:00 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:06 UTC