The TrackEvent() constructor creates and returns a new TrackEvent object describing an event which occurred on a list of tracks (AudioTrackList, VideoTrackList, or TextTrackList).
new TrackEvent(type)
new TrackEvent(type, options)typeA string with the name of the event. It is case-sensitive and browsers set it to addtrack or removetrack.
options OptionalAn object that, in addition of the properties defined in Event(), can have the following properties:
track OptionalThe track to which the event refers; this is null by default, but should be set to a VideoTrack, AudioTrack, or TextTrack as appropriate given the type of track.
A new TrackEvent object, initialized as described by the inputs to the constructor.