Fix automatic removal of streams when ended
The parameter given to the "ended" event handler emitted by
MediaStreamTracks is not the track itself, but an "Event" object. Due
to this the handler parameter never matched with the known tracks, so
ended tracks were not automatically removed.
In some cases (when emitted from the MediaStreamTrack due to limitations
in the Event API) the "ended" event may not contain the track that it
refers to. Therefore, rather than a single handler for all the tracks
each track needs its own handler explicitly associated with the track.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Loading
Please register or sign in to comment