Media Capture and Streams
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.
- : A string with the name of the event.
It is case-sensitive and browsers set it to
options- : An object that, in addition of the properties defined in Event/Event, can have the following properties:
track- : A MediaStreamTrack object representing the track which was added to or removed from the stream.
- : An object that, in addition of the properties defined in Event/Event, can have the following properties:
Return value
A new MediaStreamTrackEvent object, initialized based on the provided options.
Specifications
Browser compatibility
See also
- MediaStream/addtrack_event and MediaStream/removetrack_event events
- MediaStreamTrack
- MediaStream
- Media Capture and Streams API
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
