W3C home > Mailing lists > Public > public-html@w3.org > September 2013

Re: TextTrackCue discussions

From: Brendan Long <self@brendanlong.com>
Date: Fri, 20 Sep 2013 14:02:56 -0600
Message-ID: <523CA9F0.5000000@brendanlong.com>
To: Glenn Adams <glenn@skynav.com>
CC: Silvia Pfeiffer <silviapfeiffer1@gmail.com>, Philip J├Ągenstedt <philipj@opera.com>, Simon Pieters <simonp@opera.com>, "HTML WG (public-html@w3.org)" <public-html@w3.org>, Eric Carlson <eric.carlson@apple.com>
On 09/20/2013 11:44 AM, Glenn Adams wrote:
>
> On Fri, Sep 20, 2013 at 5:13 AM, Silvia Pfeiffer
> <silviapfeiffer1@gmail.com <mailto:silviapfeiffer1@gmail.com>> wrote:
>
>     On Fri, Sep 20, 2013 at 5:49 PM, Philip J├Ągenstedt
>     <philipj@opera.com <mailto:philipj@opera.com>> wrote:
>     > What would the text property contain when the browser doesn't
>     know the
>     > encoding?
>
>     Return an empty string. That can also be used by the JS dev to know
>     that they need to look at the .data ArrayBuffer.
>
>
> No. It should return null. As Simon points out, an empty string is a
> legitimate value for a cue.
I agree with this. Returning an empty string is ambiguous, and null is
explicit.

> However, I would suggest not to inherit TTMLCue from RawCue, since as
> Simon pointed out earlier, you'd like JS devs to be able to do
>
>    var raw_cue = cue instanceof RawCue;
>
> to detect that a cue is not taken care of by the UA. If TTMLCue
> inherits from it, that doesn't work.
I'd argue that JS developers should check for behaviour instead of
types. If you want to know if a cue has an HTML representation, you
should check if getCueAsHTML() exists. Since .data should exist in every
cue type, it would be good if it was included in an interface as high-up
as possible. Adding it to RawCue may be dangerous though, since if we
wanted to change RawCue, it would automatically change TTMLCue, which
could lead to situations that we don't want. I find it hard to imagine a
situation where a RawCue would have any information that a TTMLCue
wouldn't though..

Received on Friday, 20 September 2013 20:03:38 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:46:05 UTC