RTCRtpReceiver: getParameters() method
Baseline 2024 *Newly available
Since July 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
* Some parts of this feature may have varying levels of support.
ThegetParameters() method of theRTCRtpReceiver interface returns an object describing the current configuration for how the receiver'strack is decoded.
In this article
Syntax
getParameters()Parameters
None.
Return value
An object indicating the current configuration of the receiver.
codecsAn array of objects describing themedia codecs that the receiver is ready to use.This is the subset of codecs that the receiver has indicated it prefers and that the remote endpoint has indicated it is prepared to send.This parameter cannot be changed once initially set.
Each codec object in the array may have the following properties:
channelsOptionalA positive integer indicating the number of channels supported by the codec.For example, for audio codecs a value of 1 specifies monaural sound, while 2 indicates stereo.
clockRateA positive integer specifying the codec's clock rate in Hertz (Hz).The clock rate is the rate at which the codec's RTP timestamp advances.Most codecs have specific values or ranges of values they permit.The IANA maintains alist of codecs and their parameters, including their clock rates.
mimeTypeA string indicating the codec's MIME media type and subtype, specified as a string of the form
"type/subtype".The MIME type strings used by RTP differ from those used elsewhere.IANA maintains aregistry of valid MIME types.Also seeCodecs used by WebRTC for details about potential codecs that might be referenced here.payloadTypeTheRTP payload type used to identify this codec.
sdpFmtpLineOptionalA string giving the format specific parameters field from the
a=fmtpline in theSDP which corresponds to the codecSDP from the remote peer, if the field is present.If there is no parameters field, this property is left out.Seesection 5.8 of the IETF specification for JSEP for more information.
headerExtensionsAn array of zero or more RTP header extensions, each identifying an extension supported by the sender or receiver.Header extensions are described inRFC 3550, section 5.3.1. This parameter cannot be changed once initially set.
rtcpAn
RTCRtcpParametersobject providing the configuration parameters used forRTCP on the sender or receiver.This parameter cannot be changed once initially set.
Examples
This example obtains the canonical name (CNAME) being used forRTCP on anRTCRtpReceiver.
function getRtcpCNAME(receiver) { let parameters = receiver.getParameters(); return parameters.rtcp.cname;}Specifications
| Specification |
|---|
| WebRTC: Real-Time Communication in Browsers> # dom-rtcrtpreceiver-getparameters> |