5.7 RTCTrackEvent
The track
event uses the RTCTrackEvent
interface.
- WebIDL[Exposed=Window]
- interface
RTCTrackEvent
: Event {constructor
(DOMString type,RTCTrackEventInit
eventInitDict);- readonly attribute
RTCRtpReceiver
receiver
;- readonly attribute MediaStreamTrack
track
;- [SameObject] readonly attribute FrozenArray<MediaStream>
streams
;- readonly attribute
RTCRtpTransceiver
transceiver
;- };
Constructors
RTCTrackEvent.constructor()
Attributes
receiver
of type RTCRtpReceiver
, readonly
The receiver
attribute represents the RTCRtpReceiver
object associated with the event.
track
of type MediaStreamTrack
, readonly
The track
attribute represents the MediaStreamTrack
object that is associated with the RTCRtpReceiver
identified by receiver
.
streams
of type FrozenArray<MediaStream
>, readonly
The streams
attribute returns an array of MediaStream
objects representing the MediaStream
s that this event’s track
is a part of.
transceiver
of type RTCRtpTransceiver
, readonly
The transceiver
attribute represents the RTCRtpTransceiver
object associated with the event.
- WebIDLdictionary
RTCTrackEventInit
: EventInit {- required
RTCRtpReceiver
receiver
;- required MediaStreamTrack
track
;- sequence<MediaStream>
streams
= [];- required
RTCRtpTransceiver
transceiver
;- };
Dictionary RTCTrackEventInit
Members
receiver
of type RTCRtpReceiver
, required
The receiver
member represents the RTCRtpReceiver
object associated with the event.
track
of type MediaStreamTrack
, required
The track
member represents the MediaStreamTrack
object that is associated with the RTCRtpReceiver
identified by receiver
.
streams
of type sequence<MediaStream
>, defaulting to []
The streams
member is an array of MediaStream
objects representing the MediaStream
s that this event’s track
is a part of.
transceiver
of type RTCRtpTransceiver
, required
The transceiver
attribute represents the RTCRtpTransceiver
object associated with the event.