The MediaStreamTrackEvent() constructor returns a new MediaStreamTrackEvent object, which represents an event signaling that a MediaStreamTrack has been added to or removed from a MediaStream.
new MediaStreamTrackEvent(type, options)typeA string with the name of the event. It is case-sensitive and browsers set it to addtrack or removetrack.
optionsAn object that, in addition of the properties defined in Event(), can have the following properties:
trackA MediaStreamTrack object representing the track which was added to or removed from the stream.
A new MediaStreamTrackEvent object, initialized based on the provided options.