files/en-us/web/api/rtcrtpsender/getparameters/index.md
{{APIRef("WebRTC")}}
The getParameters() method of the {{domxref("RTCRtpSender")}} interface returns an object describing the current configuration for how the sender's {{domxref("RTCRtpSender.track", "track")}} will be encoded and transmitted to a remote {{domxref("RTCRtpReceiver")}}.
getParameters()
None.
An object indicating the current configuration of the sender. <!-- RTCRtpSendParameters, derived from RTCRtpParameters -->
<!-- spec defines following in RTCRtpSendParameters -->encodings
active
true (the default) if the encoding is being sent, false if it is not being sent or used.codec {{optional_inline}}
channels {{optional_inline}}
clockRate
mimeType
"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.sdpFmtpLine {{optional_inline}}
dtx {{Deprecated_Inline}} {{Non-standard_Inline}}
audio, this property indicates whether or not discontinuous transmission is being used (a feature by which a phone is turned off or the microphone muted automatically in the absence of voice activity).
The value is taken either enabled or disabled.maxBitrate
: A positive integer indicating the maximum number of bits per second that the user agent is allowed to grant to tracks encoded with this encoding.
Other parameters may further constrain the bit rate, such as the value of maxFramerate, or the bandwidth available for the transport or physical network.
The value is computed using the standard Transport Independent Application Specific Maximum (TIAS) bandwidth as defined by {{RFC(3890, "", "6.2.2")}}; this is the maximum bandwidth needed without considering protocol overheads from IP, TCP or UDP, and so forth.
Note that the bitrate can be achieved in a number of ways, depending on the media and encoding. For example, for video a low bit rate might be achieved by dropping frames (a bitrate of zero might allow just one frame to be sent), while for audio the track might have to stop playing if the bitrate is too low for it to be sent.
maxFramerate
priority
very-low, low (default), medium, high.rid
scaleResolutionDownBy
video, this is a floating-point value specifying a factor by which to scale down the video during encoding.
The default value, 1.0, means that the video will be encoded at its original size.
A value of 2.0 scales the video frames down by a factor of 2 in each dimension, resulting in a video 1/4 the size of the original.
The value must not be less than 1.0 (attempting to scale the video to a larger size will throw a {{jsxref("RangeError")}}).transactionId
getParameters().
This parameter cannot be changed by the caller.
<!-- spec defines following in RTCRtpParameters -->
codecs
: An array of objects describing the media codecs that the sender has set as enabled, and is prepared to use. This parameter cannot be changed once initially set.
Each codec object in the array may have the following properties: <!-- RTCRtpCodecParameters -->
channels {{optional_inline}}
clockRate
mimeType
"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.payloadType
sdpFmtpLine {{optional_inline}}
headerExtensions
rtcp
: An object providing the configuration parameters used for {{Glossary("RTCP")}} on the sender. This parameter cannot be changed.
The object may have the following properties: <!-- RTCRtcpParameters -->
cname
reducedSize
True if reduced size RTCP is configured ({{rfc("5506")}}), and False if compound RTCP is specified ({{rfc("3550")}}).degradationPreference
balanced
maintain-framerate
maintain-resolution
maintain-framerate-and-resolution
This example gets the sender's current transaction ID; the transaction ID uniquely identifies the current set of parameters, to ensure that calls to {{domxref("RTCRtpSender.setParameters", "setParameters()")}} are always handled in the correct order, avoiding inadvertently overwriting parameters with older parameters.
function getSenderTransactionID(sender) {
let parameters = sender.getParameters();
return parameters.transactionId;
}
In the same way, this code gets the canonical name (CNAME) being used for {{Glossary("RTCP")}} on an {{domxref("RTCRtpSender")}}.
function getRtpCNAME(sender) {
let parameters = sender.getParameters();
return parameters.rtcp.cname;
}
{{Specifications}}
{{Compat}}