RTCRtpReceiver: getParameters() method

The getParameters() method of the RTCRtpReceiver interface returns an object describing the current configuration for the encoding and transmission of media on the receiver's track.

Syntax

js
getParameters()

Parameters

None.

Return value

An object indicating the current configuration of the receiver.

codecs

An array of RTCRtpCodecParameters objects describing the set of codecs from which the sender or receiver will choose. This parameter cannot be changed once initially set.

headerExtensions

An array of zero or more RTP header extensions, each identifying an extension supported by the sender or receiver. Header extensions are described in RFC 3550, section 5.3.1. This parameter cannot be changed once initially set.

rtcp

An RTCRtcpParameters object providing the configuration parameters used for RTCP on the sender or receiver. This parameter cannot be changed once initially set.

Examples

This example obtains the canonical name (CNAME) being used for RTCP on an RTCRtpReceiver.

js
function getRtcpCNAME(receiver) {
  let parameters = receiver.getParameters();

  return parameters.rtcp.cname;
}

Specifications

Specification
WebRTC: Real-Time Communication in Browsers
# dom-rtcrtpreceiver-getparameters

Browser compatibility

BCD tables only load in the browser