W3cubDocs

/Web APIs

RTCRtpSender: getParameters() method

The getParameters() method of the RTCRtpSender interface returns an object describing the current configuration for how the sender's track will be encoded and transmitted to a remote RTCRtpReceiver.

Syntax

js

getParameters()

Parameters

None.

Return value

An object indicating the current configuration of the sender.

  • encodings
    • : An array of RTCRtpEncodingParameters objects, each specifying the parameters and settings for a single codec that could be used to encode the track's media.
  • transactionId
    • : A string containing a unique ID. This value is used to ensure that setParameters() can only be called to modify the parameters returned by a specific previous call to getParameters(). This parameter cannot be changed by the caller.
  • 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.
  • degradationPreference Deprecated Optional
    • : Specifies the preferred way the WebRTC layer should handle optimizing bandwidth against quality in constrained-bandwidth situations. The possible values are maintain-framerate, maintain-resolution, or balanced. The default value is balanced.

Examples

This example gets the sender's current transaction ID; the transaction ID uniquely identifies the current set of parameters, to ensure that calls to setParameters() are always handled in the correct order, avoiding inadvertently overwriting parameters with older parameters.

js

function getSenderTransactionID(sender) {
  let parameters = sender.getParameters();

  return parameters.transactionId;
}

In the same, way, this code gets the canonical name (CNAME) being used for RTCP on an RTCRtpSender.

js

function getRtpCNAME(sender) {
  let parameters = sender.getParameters();

  return parameters.rtcp.cname;
}

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
getParameters 68 ≤79 46 No 55 11 68 68 46 48 11 10.0
return_object_property_codecs 69 ≤79
46The property is defined but not implemented/used.
No 56 11 69 69
46The property is defined but not implemented/used.
48 11 10.0
return_object_property_degradationPreference No No No No No 12.1 No No No No 12.2 No
return_object_property_encodings 69 ≤79 46 No 56 12.1 69 69 46 48 12.2 10.0
return_object_property_headerExtensions 69 ≤79
46The property is defined but not implemented/used.
No 56 11 69 69
46The property is defined but not implemented/used.
48 11 10.0
return_object_property_rtcp 69 ≤79
46The property is defined but not implemented/used.
No 56 15 69 69
46The property is defined but not implemented/used.
48 15 10.0
return_object_property_transactionId 69 ≤79 No No 56 12.1 69 69 No 48 12.2 10.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/getParameters