Table of Contents

Class RTCRtpReceiver

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The RTCRtpReceiver interface of the WebRTC API manages the reception and decoding of data for a MediaStreamTrack on an RTCPeerConnection.

[Value("RTCRtpReceiver")]
public class RTCRtpReceiver
Inheritance
RTCRtpReceiver
Inherited Members

Remarks

Constructors

RTCRtpReceiver()

public RTCRtpReceiver()

Properties

JitterBufferTarget

The jitterBufferTarget property of the RTCRtpReceiver interface is a Number that indicates the application's preferred duration, in milliseconds, for which the {{glossary("jitter","jitter buffer")}} should hold media before playing it out.

[Value("jitterBufferTarget")]
public Number? JitterBufferTarget { get; set; }

Property Value

Number

A Number that indicates the current jitter buffer target hold time, in milliseconds.The value can be set to a positive value of no greater than 4000 milliseconds.

Remarks

The application can use it to influence the tradeoff between playout delay and the risk of running out of audio or video frames due to network jitter.

See also on MDN

Track

The track read-only property of the
RTCRtpReceiver interface returns the MediaStreamTrack
associated with the current RTCRtpReceiver instance.

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

Property Value

MediaStreamTrack

A MediaStreamTrack instance.

Remarks

Transform

The transform property of the RTCRtpReceiver object is used to insert a transform stream (TransformStream) running in a worker thread into the receiver pipeline.
This allows stream transforms to be applied to encoded video and audio frames as they arrive from the packetizer (before they are played/rendered).

[Value("transform")]
public Union228? Transform { get; set; }

Property Value

Union228?

A RTCRtpScriptTransform<!-- or {{domxref("SFrameTransform")}} -->, or null if the receiver has no associated transform stream.

Remarks

The transform that is to be added is defined using an RTCRtpScriptTransform and its associated Worker.
If the transform is set in the peer connection track event handler, the transform stream will receive the first full incoming frame for the track.

-Using WebRTC Encoded Transforms
-Transform

See also on MDN

Transport

The read-only transport property of an
RTCRtpReceiver object provides the RTCDtlsTransport object
used to interact with the underlying transport over which the receiver is exchanging
Real-time Transport Control Protocol (RTCP) packets.

[Value("transport")]
public RTCDtlsTransport? Transport { get; }

Property Value

RTCDtlsTransport

An RTCDtlsTransport object representing the underlying transport being
used by the receiver to exchange packets with the remote peer, or null if
the receiver isn't yet connected to a transport.

Remarks

This transport is responsible for receiving the data for the media on the receiver's
Track.

See also on MDN

Methods

GetCapabilities(string)

The static method RTCRtpReceiver.getCapabilities() returns an object describing the codec and header extension capabilities supported by RTCRtpReceiver objects on the current device.

[Value("getCapabilities")]
public static RTCRtpCapabilities? GetCapabilities(string kind)

Parameters

kind string

Returns

RTCRtpCapabilities

A new object that indicates what capabilities the browser has for receiving the specified media kind over an RTCPeerConnection.
If the browser doesn't have any support for the given media kind, the returned value is null.The returned object has the following properties:

Remarks

You can, similarly, obtain the capabilities of RTCRtpSender objects by calling the static function GetCapabilities(string).

See also on MDN

GetContributingSources()

The getContributingSources() method of the RTCRtpReceiver interface returns an array of objects, each corresponding to one CSRC (contributing source) identifier received by the current RTCRtpReceiver in the last ten seconds.

[Value("getContributingSources")]
public List<RTCRtpContributingSource> GetContributingSources()

Returns

List<RTCRtpContributingSource>

An array of objects, each describing one of the contributing sources that provided data to the incoming stream in the past ten seconds.
These objects contain the following properties:

Remarks

GetParameters()

The getParameters() method of the RTCRtpReceiver interface returns an object describing the current configuration for how the receiver's Track is decoded.

[Value("getParameters")]
public RTCRtpReceiveParameters GetParameters()

Returns

RTCRtpReceiveParameters

An object indicating the current configuration of the receiver.

Remarks

GetStats()

The RTCRtpReceiver method getStats() asynchronously requests an RTCStatsReport object which provides statistics about incoming traffic on the owning RTCPeerConnection, returning a {{jsxref("Promise")}} whose fulfillment handler will be called once the results are available.

[Value("getStats")]
public Task<RTCStatsReport> GetStats()

Returns

Task<RTCStatsReport>

A JavaScript Promise which is fulfilled once the statistics are available.
The promise's fulfillment handler receives as a parameter a RTCStatsReport object containing the collected statistics.The returned statistics include those from all streams which are coming in through the RTCRtpReceiver, as well as any of their dependencies.These might include, for example, statistics with types: inbound-rtp, candidate-pair, local-candidate, remote-candidate.

Remarks

GetSynchronizationSources()

The getSynchronizationSources() method of the RTCRtpReceiver interface returns an array of objects, each corresponding to one SSRC (synchronization source) identifier received by the current RTCRtpReceiver in the last ten seconds.

[Value("getSynchronizationSources")]
public List<RTCRtpSynchronizationSource> GetSynchronizationSources()

Returns

List<RTCRtpSynchronizationSource>

An array of objects, each describing one of the synchronization sources that provided data to the incoming stream in the past ten seconds.
These objects contain the following properties:

Remarks