<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>17002</bug_id>
          
          <creation_ts>2012-05-08 20:38:07 +0000</creation_ts>
          <short_desc>Specify a mechanism to determine which SourceBuffer an AudioTrack,VideoTrack, or TextTrack belong to.</short_desc>
          <delta_ts>2013-01-15 22:25:10 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>Media Source Extensions</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>tpac2012</status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>20253</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Aaron Colwell (c)">acolwell</reporter>
          <assigned_to name="Aaron Colwell (c)">acolwell</assigned_to>
          <cc>b.lund</cc>
    
    <cc>mike</cc>
    
    <cc>odinho</cc>
    
    <cc>philipj</cc>
    
    <cc>public-html-media</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>silviapfeiffer1</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>67500</commentid>
    <comment_count>0</comment_count>
    <who name="Aaron Colwell (c)">acolwell</who>
    <bug_when>2012-05-08 20:38:07 +0000</bug_when>
    <thetext>The current spec does not provide a way for a web application to determine which SourceID an AudioTrack or VideoTrack is associated with. This makes it difficult for the application to determine what the current Active ID set is.

A simple solution would be to place the SourceID in the AudioTrack.id &amp; VideoTrack.id fields along with some sort of delimiter and the format native trackID.

Some id possibilities for SourceID &apos;source1&apos; &amp; format native TrackID 2:
source1:2
source1-2
source1,2

The choice of delimiter would require escaping rules or restrictions on what characters would be allowed in sourceID strings. Currently no restrictions exist in the text.

Adding the sourceID to the id field also helps keep the id for each track unique so that Audio|VideoTrack.getTrackById() works as expected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67621</commentid>
    <comment_count>1</comment_count>
    <who name="Bob Lund">b.lund</who>
    <bug_when>2012-05-11 19:46:42 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; The current spec does not provide a way for a web application to determine
&gt; which SourceID an AudioTrack or VideoTrack is associated with. This makes it
&gt; difficult for the application to determine what the current Active ID set is.
&gt; 
&gt; A simple solution would be to place the SourceID in the AudioTrack.id &amp;
&gt; VideoTrack.id fields

What about TextTrack?

Does using the SourceId guarantee uniqueness so it can be used by getElementById()? Aren&apos;t SourceIDs only unique with respect to an instance of HTMLMediaElement?

&gt; along with some sort of delimiter and the format native
&gt; trackID.

Having the format native trackID in the VideoTrack, AudioTrack and TextTrack for in-band tracks would also be useful so that metadata about the media resource could be associated with Video, Audio and Text tracks.

&gt; 
&gt; Some id possibilities for SourceID &apos;source1&apos; &amp; format native TrackID 2:
&gt; source1:2
&gt; source1-2
&gt; source1,2
&gt; 
&gt; The choice of delimiter would require escaping rules or restrictions on what
&gt; characters would be allowed in sourceID strings. Currently no restrictions
&gt; exist in the text.
&gt; 
&gt; Adding the sourceID to the id field also helps keep the id for each track
&gt; unique so that Audio|VideoTrack.getTrackById() works as expected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67685</commentid>
    <comment_count>2</comment_count>
    <who name="Aaron Colwell (c)">acolwell</who>
    <bug_when>2012-05-14 20:55:28 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; (In reply to comment #0)
&gt; &gt; The current spec does not provide a way for a web application to determine
&gt; &gt; which SourceID an AudioTrack or VideoTrack is associated with. This makes it
&gt; &gt; difficult for the application to determine what the current Active ID set is.
&gt; &gt; 
&gt; &gt; A simple solution would be to place the SourceID in the AudioTrack.id &amp;
&gt; &gt; VideoTrack.id fields
&gt; 
&gt; What about TextTrack?

I accidentally forgot to mention TextTrack, but now that I&apos;m looking at the HTML5 spec, it appears that TextTrack doesn&apos;t have an id attribute like AudioTrack and VideoTrack do. It isn&apos;t clear to me why this is. Perhaps an oversight?

I agree TextTrack should be included, but we should resolve the lack of id attribute before updating the Summary for this bug.

&gt; 
&gt; Does using the SourceId guarantee uniqueness so it can be used by
&gt; getElementById()? Aren&apos;t SourceIDs only unique with respect to an instance of
&gt; HTMLMediaElement?

I wasn&apos;t aware that you could fetch AudioTrack or VideoTrack objects by using getElementById(). Please point me to the relevant spec text.

You are right though that SourceIDs are only unique with within a specific HTMLMediaElement. I was under the assumption that AudioTrack.id and VideoTrack.id only needed to be unique within the HTMLMediaElement. Could you point me to text in the spec that indicates it must be globally unique within the document. I can&apos;t seem to find it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67710</commentid>
    <comment_count>3</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2012-05-15 09:03:11 +0000</bug_when>
    <thetext>getElementById should certainly not find AudioTrack, VideoTrack or TextTrack, as they are not HTML elements at all. AFAICT, the main purpose of exposing id on audio and video tracks if for integration with Media Fragments.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67755</commentid>
    <comment_count>4</comment_count>
    <who name="Aaron Colwell (c)">acolwell</who>
    <bug_when>2012-05-15 17:06:16 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; getElementById should certainly not find AudioTrack, VideoTrack or TextTrack,
&gt; as they are not HTML elements at all. AFAICT, the main purpose of exposing id
&gt; on audio and video tracks if for integration with Media Fragments.

Ok good this matches my understanding as well. 

The Media Fragment spec and HTML5 spec appear to be out of sync. The HTML5 spec indicates that AudioTrack.id &amp; VideoTrack.id contain the strings that should be used in the &apos;track dimension&apos; of the fragment URI (http://dev.w3.org/html5/spec/media-elements.html#dom-audiotrack-id). The &quot;Track Dimension&quot; text and example in the Media Fragments spec seems to imply that the &apos;label&apos; attributes on these objects should be use for the track dimension (http://www.w3.org/2008/WebVideo/Fragments/WD-media-fragments-spec/#naming-track). It seems to me that the Media Fragment spec is wrong here. 

Do you agree with this interpretation? If so I think it means 2 bugs need to be filed. One to update the text of Media Fragment spec to reference id instead of label. A second one would be filed to add an id attribute to TextTrack so it matches AudioTrack &amp; VideoTrack.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67776</commentid>
    <comment_count>5</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2012-05-16 04:22:58 +0000</bug_when>
    <thetext>I&apos;ve forwarded the bug to the Media Fragments WG</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67777</commentid>
    <comment_count>6</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2012-05-16 05:06:05 +0000</bug_when>
    <thetext>I suggest resolving the addition of &quot;id&quot; to TextTrack as part of this bug, in particular if we require a strict string pattern on these identifiers.

I&apos;d also suggest resolving what to extract from in-band tracks into the identifier as part of this bug. This will be different per encapsulation format.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72139</commentid>
    <comment_count>7</comment_count>
    <who name="Aaron Colwell (c)">acolwell</who>
    <bug_when>2012-08-13 18:44:49 +0000</bug_when>
    <thetext>Now that the object-orient API changes are done, it&apos;s time to update the proposal for this bug. Here is the simplest think I can think of.

Add the following method to the MediaSource object.

partial interface MediaSource {
  SourceBuffer? getSoureBufferByTrackId(DOMString id);
}

- id can be a VideoTrack.id, AudioTrack.id, or TextTrack.id(when that is speced.)
- The MediaSource will ensure that the id values in all of the XXXTrack objects it provides data for are unique.
- This method returns null if the id is not associated with any tracks created by this MediaSource object.
- Throws an INVALID_ACCESS_ERR exception if id is null or empty.
- Throws an INVALID_STATE_ERR exception if called in the &quot;closed&quot; state.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74433</commentid>
    <comment_count>8</comment_count>
    <who name="Adrian Bateman [MSFT]">adrianba</who>
    <bug_when>2012-09-25 15:23:51 +0000</bug_when>
    <thetext>From http://lists.w3.org/Archives/Public/public-html-media/2012Sep/0025.html:
&gt; 6. Should I change the proposed fix to Bug 17002 to the following so the
&gt; solution is independent of the id field?
&gt; 
&gt; partial interface MediaSource {
&gt;   SourceBuffer? getSourceBuffer(VideoTrack videoTrack);
&gt;   SourceBuffer? getSourceBuffer(AudioTrack audioTrack);
&gt;   SourceBuffer? getSourceBuffer(TextTrack textTrack);
&gt; }

As mentioned on the call today, I&apos;d prefer the id string if we can make it work, but we (Microsoft) are in the middle of researching the multi-track aspects as will have a more thought out opinion soon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79407</commentid>
    <comment_count>9</comment_count>
    <who name="Adrian Bateman [MSFT]">adrianba</who>
    <bug_when>2012-12-04 15:54:47 +0000</bug_when>
    <thetext>(In reply to comment #8)
&gt; From
&gt; http://lists.w3.org/Archives/Public/public-html-media/2012Sep/0025.html:
&gt;
&gt; 6. Should I change the proposed fix to Bug 17002 to the following so the
&gt;
&gt; solution is independent of the id field?
&gt; 
&gt; partial interface MediaSource
&gt; {
&gt;   SourceBuffer? getSourceBuffer(VideoTrack videoTrack);
&gt;  
&gt; SourceBuffer? getSourceBuffer(AudioTrack audioTrack);
&gt;   SourceBuffer?
&gt; getSourceBuffer(TextTrack textTrack);
&gt; }

Discussed at TPAC F2F. We will use the object based methods described here. This removes the dependency on bug 18960.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79733</commentid>
    <comment_count>10</comment_count>
    <who name="Aaron Colwell (c)">acolwell</who>
    <bug_when>2012-12-08 01:30:51 +0000</bug_when>
    <thetext>Changes committed
http://dvcs.w3.org/hg/html-media/rev/ee6e8ae9337c</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81423</commentid>
    <comment_count>11</comment_count>
    <who name="Aaron Colwell (c)">acolwell</who>
    <bug_when>2013-01-15 19:26:30 +0000</bug_when>
    <thetext>Reopening to replace getSourceBuffer() with read-only sourceBuffer attribute proposed in 
http://lists.w3.org/Archives/Public/public-html-media/2013Jan/0007.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81446</commentid>
    <comment_count>12</comment_count>
    <who name="Aaron Colwell (c)">acolwell</who>
    <bug_when>2013-01-15 22:25:10 +0000</bug_when>
    <thetext>Changes committed.
https://dvcs.w3.org/hg/html-media/rev/fd2a58eec443</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>