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
.
On this page
MediaStreamTrackEvent: MediaStreamTrackEvent() constructor
Syntax
js
new MediaStreamTrackEvent(type, options)
Parameters
-
type
-
A string with the name of the event. It is case-sensitive and browsers set it to
addtrack
orremovetrack
. -
options
-
An object that, in addition of the properties defined in
Event()
, can have the following properties:-
track
-
A
MediaStreamTrack
object 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
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
MediaStreamTrackEvent |
55 | 12 | 50 | No | 42 | 11 | 55 | 55 | 50 | 42 | 11 | 6.0 |
See also
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrackEvent/MediaStreamTrackEvent