Table of Contents

Class RTCTrackEvent

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The WebRTC API interface RTCTrackEvent represents the RTCPeerConnection.Track event, which is sent when a new MediaStreamTrack is added to an RTCRtpReceiver which is part of the RTCPeerConnection.

[Value("RTCTrackEvent")]
public class RTCTrackEvent : Event
Inheritance
RTCTrackEvent
Inherited Members

Remarks

The target is the RTCPeerConnection object to which the track is being added.

This event is sent by the WebRTC layer to the website or application, so you will not typically need to instantiate an RTCTrackEvent yourself.

See also on MDN

Constructors

RTCTrackEvent()

public RTCTrackEvent()

RTCTrackEvent(string, RTCTrackEventInit)

The RTCTrackEvent() constructor creates and returns a new RTCTrackEvent object,
configured to describe the track which has been added to the RTCPeerConnection.

public RTCTrackEvent(string type, RTCTrackEventInit eventInitDict)

Parameters

type string
eventInitDict RTCTrackEventInit

Remarks

In general, you won't need to use this constructor, as RTCTrackEvent
objects are created by WebRTC and delivered to your RTCPeerConnection's
RTCPeerConnection.Track event handler as appropriate.

See also on MDN

Properties

Receiver

The read-only receiver property
of the RTCTrackEvent interface indicates the
RTCRtpReceiver which is used to receive data containing media for the
Track to which the event refers.

[Value("receiver")]
public RTCRtpReceiver Receiver { get; }

Property Value

RTCRtpReceiver

The RTCRtpReceiver which pairs the receiver with a
sender and other properties which establish a single bidirectional RTP
stream for use by the Track associated with the
RTCTrackEvent.

NOTE
The Transceiver
includes its own Receiver property, which
will always be the same RTCRtpReceiver as this one.

Remarks

Streams

The WebRTC API
interface RTCTrackEvent's read-only
streams property specifies an array of
MediaStream objects, one for each of the streams that comprise the
track being added to the RTCPeerConnection.

[Value("streams")]
public MediaStream[] Streams { get; }

Property Value

MediaStream[]

An {{jsxref("Array")}} of MediaStream objects, one for each stream that
make up the new track.

Remarks

Track

The WebRTC API
interface RTCTrackEvent's read-only track
property specifies the MediaStreamTrack that has been added to the
RTCPeerConnection.

[Value("track")]
public MediaStreamTrack Track { get; }

Property Value

MediaStreamTrack

A MediaStreamTrack indicating the track which has been added to the
RTCPeerConnection.

Remarks

Transceiver

The WebRTC API interface RTCTrackEvent's
read-only transceiver property indicates the
RTCRtpTransceiver affiliated with the event's
Track.

[Value("transceiver")]
public RTCRtpTransceiver Transceiver { get; }

Property Value

RTCRtpTransceiver

The RTCRtpTransceiver which pairs the receiver with a
sender and other properties which establish a single bidirectional RTP
stream for use by the Track associated with the
RTCTrackEvent.

NOTE
The RTCRtpReceiver referred to by this
RTCRtpReceiver's Receiver
property will always be the same as the RTCTrackEvent's
Receiver property.

Remarks

The transceiver pairs the track's
Receiver with an RTCRtpSender.

See also on MDN