-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
End removed tracks remotely again; Make receiver.track nullable instead #1181
Comments
I was just talking about this idea with @pthatcherg today. I think it would work, though the receiver should also be recreated when a local description with the "recv" bit is set, so that media can be received before the answer. |
I think it would be good to work through the events (in terms of But overall this looks like something that could work. If the intent is to have the received track being constantly connected to a video element or a recorder the sender can play with |
@jan-ivar @stefhak @taylor-b Section 5.1 says: "When the other peer stops sending a track in this manner, an ended event is fired at the MediaStreamTrack object." So one could argue that the existing draft already supports this. Section 5.3 says "When one of the SSRCs for RTP source media streams received by receiver is removed (either due to reception of a BYE or via timeout), the mute event is fired at track. If and when packets are received again, the unmute event is fired at track." So according to this one could argue that when the sender stops sending, a mute event is received on the remote received track. So there may actually be two events! |
@aboba That's where this started, in #1168. Sadly, the more contradictory language in a spec, the more doubt it casts on the consensus reached. On the |
At the June virtual interim we came up with #1377 to give sites a way to detect remote track removal both in the spec and Chrome today, bridging an important transition period. Basically, of the two approaches: track.onended = () => log(`Track ${track.id} ended.`);
stream.onremovetrack = e => log(`Track ${e.track.id} removed.`); only the first one would break. Unfortunately, Firefox does not do the second one yet (though we'd add it asap). It's still unclear however how web compatible this is. Anecdotally, it seems like few sites would be affected, just from the difficulty of dealing with browser differences when it comes to adding/removing tracks, but we don't know. @foolip can we find out how many sites are using |
@foolip can we find out how many sites are using These numbers are percentage of page views in Chrome, not a proportion of sites, but There's no use counter for the "ended" event, though. Would it be useful? @guidou |
Consensus at the September interim was to close this issue. |
Instead of #1161, let's fire
ended
on remote tracks again like browsers do today, to avoid breakage.Basically, when a
transceiver
's direction loses the "send" bit as a result of setting a remote description, fire anended
event ontransceiver.receiver.track
and settransceiver.receiver.track
tonull
.This necessitates making
receiver.track
nullable.Later, should a transceiver's direction regain its "send" bit as a result of setting a remote description, set
transceiver.receiver.track
to a new track of the same kind, and call process the remote track (which fires a newtrack
event).This would be backwards compatible.
The text was updated successfully, but these errors were encountered: