5.7 RTCTrackEvent

The track event uses the RTCTrackEvent interface.

  1. WebIDL[Exposed=Window]
  2. interface RTCTrackEvent : Event {
  3. constructor(DOMString type, RTCTrackEventInit eventInitDict);
  4. readonly attribute RTCRtpReceiver receiver;
  5. readonly attribute MediaStreamTrack track;
  6. [SameObject] readonly attribute FrozenArray<MediaStream> streams;
  7. readonly attribute RTCRtpTransceiver transceiver;
  8. };

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 MediaStreams 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.

  1. WebIDLdictionary RTCTrackEventInit : EventInit {
  2. required RTCRtpReceiver receiver;
  3. required MediaStreamTrack track;
  4. sequence<MediaStream> streams = [];
  5. required RTCRtpTransceiver transceiver;
  6. };

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 MediaStreams 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.