The MediaStreamTrackEvent()
constructor returns a newly created MediaStreamTrackEvent
object, which represents an event announcing that a MediaStreamTrack
has been added to or removed from a MediaStream
.
var trackEvent = new MediaStreamTrackEvent(type, {track: aMediaStreamTrack});
The MediaStreamTrackEvent()
constructor also inherits arguments from Event()
.
type
DOMString
representing the name of the type of the MediaStreamTrackEvent
. It is case-sensitive and can be "addtrack
"
or "removetrack
"
.track
MediaStreamTrack
object representing the track which was added to or removed from the stream.A new MediaStreamTrackEvent
, initialized based on the provided options.
Specification | Status | Comment |
---|---|---|
Media Capture and Streams The definition of 'MediaStreamTrackEvent()' in that specification. | Editor's Draft |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 55.0 | 50 (50) | No support | 42 | ? |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | ? | (Yes) | 50.0 (50) | No support | 42 | ? | 55.0 |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrackEvent/MediaStreamTrackEvent