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 25248 - MediaStreamTrack.stop() should fire ended event.
Summary: MediaStreamTrack.stop() should fire ended event.
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: public-media-capture@w3.org
QA Contact:
URL:
Whiteboard:
Keywords:
: 25773 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-04-03 16:14 UTC by Kiran
Modified: 2014-06-25 16:44 UTC (History)
5 users (show)

See Also:


Attachments

Description Kiran 2014-04-03 16:14:38 UTC
After calling the MediaStreamTrack.stop() method, the text in 4.3.2.2 of [1]
stop mentions to set the readystate attribute to ended. But misses indicating to fire ended event.

The steps should be modified as below (step 4. is the newly added step).

1. Let track be the current MediaStreamTrack object.

2. If track has no source attached (sourceType is "none") or if the source is provided by an RTCPeerConnection, then abort these steps.

3. Set track's readyState attribute to ended.

4. Fire a simple event named ended at the track.

5. Detach track's source.


[1] http://dev.w3.org/2011/webrtc/editor/getusermedia.html
Comment 1 Kiran 2014-04-03 16:16:30 UTC
Sorry for the typo, the section is 4.3.3.2
Comment 2 Adam Bergkvist 2014-04-08 08:32:42 UTC
Not firing the event is intentional since the script is explicitly stopping the MediaStreamTrack and the readyState is immediately updated.
Comment 3 Kiran 2014-04-08 08:48:53 UTC
(In reply to Adam Bergkvist from comment #2)
> Not firing the event is intentional since the script is explicitly stopping
> the MediaStreamTrack and the readyState is immediately updated.

In section 8. Event Summary [1], it is specified that, invoking stop() is one of the reasons for firing ended event, which is conflicting to this statement "Not firing the event is intentional".

So either we have to add this event while stopping 

or

If we don't want to fire the ended event intentionally, then we have to modify the below statement to avoid conflict.



"The MediaStreamTrack object's source will no longer provide any data, either because the user revoked the permissions, or because the source device has been ejected, or because the remote peer stopped sending data, or because the stop() method was invoked."

to

"The MediaStreamTrack object's source will no longer provide any data, either because the user revoked the permissions, or because the source device has been ejected, or because the remote peer stopped sending data."



[1] http://dev.w3.org/2011/webrtc/editor/getusermedia.html#event-summary
Comment 4 Adam Bergkvist 2014-04-08 08:55:45 UTC
Good catch. The Event Summary section (non-normative) should be updated to match the rest of the spec.
Comment 5 Adam Bergkvist 2014-04-10 07:16:21 UTC
Updated Event Summary section as discussed. Closing as WONTFIX.

https://github.com/fluffy/webrtc-w3c/commit/ae5f96056433023ede3ee2307c868c895947d950
Comment 6 Harald Alvestrand 2014-06-20 06:57:39 UTC
Conclusion has been challenged (duplicate bug).
Comment 7 Harald Alvestrand 2014-06-20 06:58:06 UTC
*** Bug 25773 has been marked as a duplicate of this bug. ***
Comment 8 Harald Alvestrand 2014-06-25 16:44:43 UTC
Discussed on telechat June 25. The conclusion was to re-close this as "no change needed" - some arguments exist for adding event firing on close(), some arguments exist against it, but the strength of arguments did not warrant a change.

Note - addTrack has the same difference between "script-caused events" and "non-script-caused events", and should be consistent with this one.