This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25250 - Ended track should not be added to MediaStream, when addTrack() is invoked for and ended track.
Summary: Ended track should not be added to MediaStream, when addTrack() is invoked fo...
Status: RESOLVED WONTFIX
Alias: None
Product: WebRTC Working Group
Classification: Unclassified
Component: Media Capture and Streams (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Adam Bergkvist
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-03 17:18 UTC by Kiran
Modified: 2014-04-10 08:09 UTC (History)
3 users (show)

See Also:


Attachments

Description Kiran 2014-04-03 17:18:08 UTC
When section 4.2.3 [1] addTrack() is invoked, if that track is already ended, it should not be added to a MediaStream.

The steps for addTrack() should be modified as below to make it sync with 4.2 (Adding tracks when MediaStream constructor is invoked
"If track has ended, then abort these steps and continue with the next track (if any).")


1. Let track be the MediaStreamTrack argument and stream this MediaStream object.

2. If track has ended, then abort these steps.

3. If track is already in stream's track set, then abort these steps.

4. Add track to stream's track set.

(step 2 is the newly added step).

[1] http://dev.w3.org/2011/webrtc/editor/getusermedia.html#dom-mediastreamtrack-enabled
Comment 1 Kiran 2014-04-04 04:52:18 UTC
As per Martin comments [1], 

if the resolution is to remove the dependency of track state while adding a track to MediaStream, then the text in 4.2 of [2] should be changed by removing step-2
 
"2. If track has ended, then abort these steps and continue with the next track (if any)."

[1] http://lists.w3.org/Archives/Public/public-media-capture/2014Apr/0075.html
[2] http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediastream
Comment 2 Stefan Hakansson LK 2014-04-04 07:21:57 UTC
Assigning to Adam (who has promised to do some bug fixing!).
Comment 3 Stefan Hakansson LK 2014-04-04 07:32:49 UTC
Already fixed in the current Ed's draft: http://dev.w3.org/2011/webrtc/editor/archives/20140321/getusermedia.html#methods
Comment 4 Kiran 2014-04-04 07:59:10 UTC
addTrack() is upto mark but
Step 2 in MediaStream constructor(4.2 MediaStream)[1], which is specifying not to add ended track, is still present as shown below. 

Run the following sub steps for each MediaStreamTrack in the array:

1. Add track: Let track be the MediaStreamTrack about to be processed.

2. If track has ended, then abort these steps and continue with the next track (if any).

3. Add track to stream's track set.

Which is required to be removed (As per comment 2).

The new steps should be as follows (removing step 2).
1. Add track: Let track be the MediaStreamTrack about to be processed.

2. Add track to stream's track set.

[1] http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediastream
Comment 5 Adam Bergkvist 2014-04-10 07:57:24 UTC
I agree that we should stick with one approach here.
Comment 6 Adam Bergkvist 2014-04-10 08:09:16 UTC
Updated MediaStream() constructor as Kiran proposed.

https://github.com/fluffy/webrtc-w3c/commit/1b6070e125689b281ece573d7086ad153c8d28c6

Closing this bug as WONTFIX (since we're not fixing what the bug title says).