Re: TextTrack questions

On 01/16/2014 11:39 AM, Aaron Colwell wrote:
>
>
>     Keeping track of cues by ID would be nice, but WebVTT cues don't
>     necessarily have ID's (and as far as I know, CEA-708 cues don't
>     either).
>
>
> I was assuming that the UA would create some sort of private ID based
> on the contents of the cue and/or any other signals available to the
> format parser like a sample index. This private ID would then be used
> to keep track of whether an existing cue, modified or not, is the
> result of a previous add by the file format parser.

But the UA doesn't necessarily have any information besides the start
time, end time and text. WebVTT cues can have ID's, but it's not
required, and Matroska/WebM doesn't seem to have a Block ID:

http://www.matroska.org/technical/specs/index.html#block_structure

If we're deciding the ID just based on the start time, end time and
text, then we might as well just compare them.

> Ok. So existing WebKit behavior will add the cue again if the
> application modified it. That is likely to be surprising to the
> application developer. We definitely need clarification on what the
> proper behavior should be in the spec.
> Does this behavior take into account cues added by the application
> itself. For example if the application uses addCue
> <http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#addcue%28cue%29>()
> with data that is identical to something in the in-band track, will 2
> cues get displayed or only the one? It sounds like it would only be 1
> which also might be surprising to the developer.
In the case of WebKit, we should probably make the duplicate detection
ignore cues added via addCue(), and check if the new cue matches the
original content of a cue, not the current content. I think that would
fix both of these.


--------------050504020105090601080102
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">On 01/16/2014 11:39 AM, Aaron Colwell
      wrote:</div>
    <blockquote
cite="mid:CAA0c1bB+Cq-ZTzEyuaP9o0NGv8ChVLAgo1GrJqjk9DLEEgHPhA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote"><br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <br>
              Keeping track of cues by ID would be nice, but WebVTT cues
              don't<br>
              necessarily have ID's (and as far as I know, CEA-708 cues
              don't either).<br>
            </blockquote>
            <div><br>
            </div>
            <div>I was assuming that the UA would create some sort of
              private ID based on the contents of the cue and/or any
              other signals available to the format parser like a sample
              index. This private ID would then be used to keep track of
              whether an existing cue, modified or not, is the result of
              a previous add by the file format parser.</div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    But the UA doesn't necessarily have any information besides the
    start time, end time and text. WebVTT cues can have ID's, but it's
    not required, and Matroska/WebM doesn't seem to have a Block ID:<br>
    <br>
    <a class="moz-txt-link-freetext" href="http://www.matroska.org/technical/specs/index.html#block_structure">http://www.matroska.org/technical/specs/index.html#block_structure</a><br>
    <br>
    If we're deciding the ID just based on the start time, end time and
    text, then we might as well just compare them.<br>
    <br>
    <blockquote type="cite">
      <div>Ok. So existing WebKit behavior will add the cue again if the
        application modified it. That is likely to be surprising to the
        application developer. We definitely need clarification on what
        the proper behavior should be in the spec.</div>
      <div>Does this behavior take into account cues added by the
        application itself. For example if the application uses <a
href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#addcue%28cue%29"
          class="cremed">addCue</a>() with data that is identical to
        something in the in-band track, will 2 cues get displayed or
        only the one? It sounds like it would only be 1 which also might
        be surprising to the developer.</div>
    </blockquote>
    In the case of WebKit, we should probably make the duplicate
    detection ignore cues added via addCue(), and check if the new cue
    matches the original content of a cue, not the current content. I
    think that would fix both of these.<br>
    <br>
  </body>
</html>

--------------050504020105090601080102--

Received on Thursday, 16 January 2014 20:09:41 UTC