MediaStreamTrackEvent: MediaStreamTrackEvent() constructor
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2017.
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.
Syntax
new MediaStreamTrackEvent(type, options)
Parameters
type-
A string with the name of the event. It is case-sensitive and browsers set it to
addtrackorremovetrack. options-
An object that, in addition of the properties defined in
Event(), can have the following properties:track-
A
MediaStreamTrackobject representing the track which was added to or removed from the stream.
Return value
A new MediaStreamTrackEvent object, initialized based on the provided options.
Specifications
| Specification |
|---|
| Media Capture and Streams> # dom-mediastreamtrackevent-constructor> |
Browser compatibility
Loading…