This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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
Sorry for the typo, the section is 4.3.3.2
Not firing the event is intentional since the script is explicitly stopping the MediaStreamTrack and the readyState is immediately updated.
(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
Good catch. The Event Summary section (non-normative) should be updated to match the rest of the spec.
Updated Event Summary section as discussed. Closing as WONTFIX. https://github.com/fluffy/webrtc-w3c/commit/ae5f96056433023ede3ee2307c868c895947d950
Conclusion has been challenged (duplicate bug).
*** Bug 25773 has been marked as a duplicate of this bug. ***
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.