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.
The getParameters() method of the RTCRtpReceiver interface returns an object describing the current configuration for how the receiver's track is decoded.
getParameters()
None.
An object indicating the current configuration of the receiver.
codecsAn array of objects describing the media 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:
channels OptionalA 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 a list 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 a registry of valid MIME types. Also see Codecs used by WebRTC for details about potential codecs that might be referenced here.
payloadTypeThe RTP payload type used to identify this codec.
sdpFmtpLine OptionalA string giving the format specific parameters field from the a=fmtp line in the SDP which corresponds to the codec SDP from the remote peer, if the field is present. If there is no parameters field, this property is left out. See section 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 in RFC 3550, section 5.3.1. This parameter cannot be changed once initially set.
rtcpAn RTCRtcpParameters object providing the configuration parameters used for RTCP on the sender or receiver. This parameter cannot be changed once initially set.
This example obtains the canonical name (CNAME) being used for RTCP on an RTCRtpReceiver.
function getRtcpCNAME(receiver) {
let parameters = receiver.getParameters();
return parameters.rtcp.cname;
}
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
getParameters |
59 | 79 | 128 | 46 | 11 | 59 | 128 | 43 | 11 | 7.0 | 59 | 11 |
return_object_property_codecs |
69 | 79 | 128 | 56 | 11 | 69 | 128 | 48 | 11 | 10.0 | 69 | 11 |
return_object_property_headerExtensions |
69 | 79 | No | 56 | 11 | 69 | No | 48 | 11 | 10.0 | 69 | 11 |
return_object_property_rtcp |
69 | 79 | No | 56 | 15 | 69 | No | 48 | 15 | 10.0 | 69 | 15 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/getParameters