New issue
Advanced search Search tips

Issue 777312 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

MediaStreamTrack onEnded event is not fired when a track's stop method is called

Reported by mmckenzi...@gmail.com, Oct 23 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36

Steps to reproduce the problem:
Use the attached file (test.html) to reproduce the issue

1. Click the button to start the video.
2. You will be prompted to allow camera access. Accept it.
3. The video should stop after a couple of seconds.
4. An alert box should appear but it does not because the onEnded event is never fired

What is the expected behavior?
When a MediaStreamTrack is stopped using the track's stop method, the onEnded event should fire. It appears that this is no longer the case as of the current stable release of Chrome 62.

What went wrong?
When a track is stopped the onEnded event is never fired and no event handlers are executed.

Did this work before? Yes 61.0.3163.0

Does this work in other browsers? N/A

Chrome version: 62.0.3202.62  Channel: stable
OS Version: OS X 10.12.6
Flash Version:
 
test.html
1.6 KB View Download
According to the WebRTC spec, it appears that _not_ firing the onEnded event is actually the correct behaviour.



https://www.w3.org/TR/mediacapture-streams/#life-cycle-and-media-flow

When a MediaStreamTrack track ends for any reason other than the stop() method being invoked, the User Agent must queue a task that runs the following steps:

1. If the track's readyState attribute has the value ended already, then abort these steps.

2. Set track's readyState attribute to ended.

3. Notify track's source that track is ended so that the source may be stopped, unless other MediaStreamTrack objects depend on it.

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

If the end of the track was reached due to a user request, the event source for this event is the user interaction event source.

Comment 2 by meh...@chromium.org, Oct 23 2017

Components: Blink>Media
Feel free to close this. It's not a bug, in that the behavior now obeys the spec, but it was a breaking change.
Status: WontFix (was: Unconfirmed)
mmckenzie.dev@, thank you for the update.

Sign in to add a comment