TrackEvent: TrackEvent() constructor
The TrackEvent() constructor
creates and returns a new TrackEvent object describing an event which
occurred on a list of tracks (AudioTrackList,
VideoTrackList, or TextTrackList).
Syntax
js
new TrackEvent(type)
new TrackEvent(type, options)
Parameters
type-
A string with the name of the event. It is case-sensitive and browsers set it to
addtrackorremovetrack. optionsOptional-
An object that, in addition of the properties defined in
Event(), can have the following properties:trackOptional-
The track to which the event refers; this is
nullby default, but should be set to aVideoTrack,AudioTrack, orTextTrackas appropriate given the type of track.
Return value
A new TrackEvent object, initialized as described by the
inputs to the constructor.
Specifications
| Specification |
|---|
| HTML> # the-trackevent-interface> |
Browser compatibility
Loading…