Re: TextTrackCue discussions

On 08/30/2013 07:36 PM, Silvia Pfeiffer wrote:
> They will, however, be happy to exposed the data to the JS developer
> and leave the parsing and rendering to the JS developer. This is why
> the TextTrackCue API has a .text attribute and a constructor.
>
> Your proposal takes this one step further and you suggest to have a
> generic interface for parsed cues. Such a generic interface would
> abstract away knowledge of the actual format of the cue that the
> browser parsed and just expose a HTML representation of the cues to
> the JS developer. Am I correctly interpreting your intention?
Yes, the purpose of this new interface is to abstract that information
away for JS developers.

> What would be the reason for hiding the actual format that the browser
> parsed from the JS developer? Why wouldn't we specify another
> interface for such a parsed format that is actually able to give the
> JS developer more specific information/attributes about the Cue format
> just like we did with VTTCue?
Because it's too specific. Right now JS developers can easily get the
raw cue data, but they need to know the type of cue to get anything
useful. For example, if I want to know the start time of a cue, I can
easily get it if I know that the original on-the-wire format was WebVTT.
Otherwise, I can /hope/ browser implementers will be consistent, but
there's no standard for what that attribute might be named in other cues.

> What cue formats do you see being supported by browsers as generic
> parsed cues without their own special interface?
What I want is for all of these special classes to support a common
(useful) interface, not a new special class.

That's why I proposed this:
> interface WebVTTCue : ParsedTextTrackCue {
>     attribute DOMString regionId <http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-regionid>;
>     attribute DirectionSetting <http://dev.w3.org/html5/webvtt/#dfn-directionsetting> vertical <http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-vertical>;
>     attribute boolean snapToLines <http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-snaptolines>;
>     attribute (long or AutoKeyword <http://dev.w3.org/html5/webvtt/#dfn-autokeyword>) line <http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-line>;
>     attribute long position <http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-position>;
>     attribute long size <http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-size>;
>     attribute AlignSetting <http://dev.w3.org/html5/webvtt/#dfn-alignsetting> align <http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-align>;
> };
>
> interface TTMLCue : ParsedTextTrackCue {
>     ...
> };
>
> interface CEA708Cue: ParsedTextTrackCue {
>     ...
> };

On the browser side, we always instantiate the special format-specific
class, but on the JS side, /we can assume that any presentable cue is
going to provide this interface/, and we don't need to look at the
format-specific classes unless we need them:
> interface ParsedTextTrackCue : TextTrackCue {
>     attribute DOMString id <http://www.w3.org/TR/2012/CR-html5-20121217/embedded-content-0.html#dom-texttrackcue-id>;
>     attribute double startTime <http://www.w3.org/TR/2012/CR-html5-20121217/embedded-content-0.html#dom-texttrackcue-starttime>;
>     attribute double endTime <http://www.w3.org/TR/2012/CR-html5-20121217/embedded-content-0.html#dom-texttrackcue-endtime>;
>     attribute boolean pauseOnExit <http://www.w3.org/TR/2012/CR-html5-20121217/embedded-content-0.html#dom-texttrackcue-pauseonexit>;
>     attribute DOMString text <http://www.w3.org/TR/2012/CR-html5-20121217/embedded-content-0.html#dom-texttrackcue-text>;
>     
> DocumentFragment
> <http://www.w3.org/TR/2012/CR-html5-20121217/infrastructure.html#documentfragment>
> getCueAsHTML
> <http://www.w3.org/TR/2012/CR-html5-20121217/embedded-content-0.html#dom-texttrackcue-getcueashtml>();
> attribute EventHandler
> <http://www.w3.org/TR/2012/CR-html5-20121217/webappapis.html#eventhandler>
> onenter
> <http://www.w3.org/TR/2012/CR-html5-20121217/embedded-content-0.html#handler-texttrackcue-onenter>
>
>
> ;
>     attribute EventHandler <http://www.w3.org/TR/2012/CR-html5-20121217/webappapis.html#eventhandler> onexit <http://www.w3.org/TR/2012/CR-html5-20121217/embedded-content-0.html#handler-texttrackcue-onexit>; ...
> };

Received on Friday, 6 September 2013 21:12:24 UTC