<?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>24930</bug_id>
          
          <creation_ts>2014-03-04 22:55:16 +0000</creation_ts>
          <short_desc>the spec defines the removetrack event as part of the MediaStream interface, but never calls out when the event should be fired</short_desc>
          <delta_ts>2014-05-08 14:16:18 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebRTC Working Group</product>
          <component>Media Capture and Streams</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></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Shijun Sun">shijuns</reporter>
          <assigned_to name="public-media-capture@w3.org">public-media-capture</assigned_to>
          <cc>adam.bergkvist</cc>
    
    <cc>public-media-capture</cc>
    
    <cc>stefan.lk.hakansson</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>101868</commentid>
    <comment_count>0</comment_count>
    <who name="Shijun Sun">shijuns</who>
    <bug_when>2014-03-04 22:55:16 +0000</bug_when>
    <thetext>The Media Capture and Streams spec defines the removetrack event as part of the MediaStream interface, but never calls out when the event should be fired.

Propose to change the following in Section 4.2.3

When the removeTrack() method is invoked, the user agent MUST run the following steps:
1. Let track be the MediaStreamTrack argument and stream this MediaStream object.
2. If stream is finished, throw an INVALID_STATE_ERR exception.
3. If track is in stream&apos;s track set, remove it.

to the following:

When the removeTrack() method is invoked, the user agent MUST run the following steps:
1. Let track be the MediaStreamTrack argument and stream this MediaStream object.
2. If track is ended, throw an INVALID_STATE_ERR exception.
3. If track is not in stream&apos;s track set, then abort these steps.
4. If track is in stream&apos;s track set, remove it, and then queue a task to fire a removetrack event.

Note: a missing step (#3) is also added and a couple typos in step #2 are fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101900</commentid>
    <comment_count>1</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2014-03-05 14:03:13 +0000</bug_when>
    <thetext>You&apos;re right about the (incorrect) state check on MediaStream before a new track is added. It&apos;s old language from the time when MediaStream could be ended. Now a MediaStream is active or inactive and new tracks can be added to an inactive stream to make it active again.

Checking the state of the MediaStreamTrack being added is a new thing, but I think it&apos;s correct to do so.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105422</commentid>
    <comment_count>2</comment_count>
    <who name="Stefan Hakansson LK">stefan.lk.hakansson</who>
    <bug_when>2014-05-08 09:21:14 +0000</bug_when>
    <thetext>Seems to be fixed in version http://dev.w3.org/2011/webrtc/editor/archives/20140507/getusermedia.html (according to the change log it was fixed in an earlier version).

Do you agree Shijun?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105434</commentid>
    <comment_count>3</comment_count>
    <who name="Shijun Sun">shijuns</who>
    <bug_when>2014-05-08 14:16:18 +0000</bug_when>
    <thetext>The spec defines a MediaStreamTrackEvent for both removetrack and addtrack. So, it is okay to say the bug is fixed.

The MediaStreamTrackEvent section (4.4) still has a couple TODO&apos;s.  I hope there is a bug to track the open issues there already.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>