New issue
Advanced search Search tips

Issue 818056 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug-Regression



Sign in to add a comment

MediaStreamTrack onended event handler not triggered

Reported by marcusda...@gmail.com, Mar 2 2018

Issue description

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

Steps to reproduce the problem:
1. start a video chat with audio
2. create a track.onended event handler
3. call track.stop followed by track.enabled = false

What is the expected behavior?
The onended event handler should trigger.

What went wrong?
The event doesn't trigger.
This is on an Android 7.0 using a Moto G5 Plus

Here's the part of the code that registers the event handler and stops the MediaStreamTracks:

localStream.getVideoTracks().forEach(function(track){
  track.onended = function(event) {
    console.log("track ended");
  }
  track.stop();
  track.enabled = false;
});

The problem is that console.log("track ended"); doesn't get called even though it should be called. If I console.log(track); I'm able to see the tracks without a problem. I think this might be a bug because it was working without a problem, and after an auto-update to my Android it stopped working.

Did this work before? Yes 

Chrome version: 64.0.3282.186  Channel: stable
OS Version: OS X 10.12.6
Flash Version:
 

Comment 1 by ajha@chromium.org, Mar 2 2018

Labels: Needs-Bisect Needs-Triage-M64
Cc: susan.boorgula@chromium.org
Labels: Triaged-ET Needs-Feedback
marcusdavid127@ Thanks for the issue.

Can you please confirm if this issue is related to Android?
If this is a Mac related issue, request you to provide a test file where this issue can be reproduced, which will help in further triaging of the issue.

Thanks..
Thanks for getting back to me Susan. This is on Android 7.0 using Chrome v64.0.3282.137. This is the code you can try to reproduce the bug with:

localStream.getVideoTracks().forEach(function(track){
  track.onended = function(event) {
    console.log("track ended");
  }
  track.stop();
  track.enabled = false;
});

I can't share the whole file because there is so much code, and a lot of it is irrelevant to this problem in my opinion. The problem is that the onended event doesn't trigger. I haven't changed the code since uploading it to the Google Play store, so there's no reason it should have just stopped working. The update must have broken it. If I remove the event handler and move everything in it outside the handler, it works fine. But obviously this is undesired because I need that code to run once the track is ended safely. Also I don't want to change my code if I don't need to.
Project Member

Comment 4 by sheriffbot@chromium.org, Mar 3 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Components: -Blink Blink>Media
Labels: -OS-Mac OS-Android
marcusdavid127@ Thanks for the feedback.

As per comment #3, this is a Android related issue.
Hence marking the OS as Android and requesting Android team to please look into this issue and help in further triaging.

Thanks..
Labels: Needs-triage-Mobile
Cc: pnangunoori@chromium.org
Labels: Triaged-Mobile Needs-Feedback
marcusdavid127@ -- Thanks for reporting this issue. Could you please share a sample application and screen cast reproducing the issue. This would help us to reproduce at our end and triage the issue further.

Thanks in advance!
Components: -Blink>Media Blink>MediaStream
Cc: guidou@chromium.org
guidou@: would you happen to know who would be the right person to look at this?
Cc: chfremer@chromium.org
Status: WontFix (was: Unconfirmed)
As there is no action on this issue for long time closing this issue. Request you to update your Chrome to latest #66.0.3359.158 and verify. Feel free to file a new issue if the issue is still reproduced at your end.

Thanks!
Sorry I missed this. According to spec, stopping a track with stop() should not fire the ended event, so this is working as intended.
If you need to do some processing due to stop(), do it right after calling stop().

Sign in to add a comment