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.
- : An array of
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 togetParameters()
. This parameter cannot be changed by the caller.
-
: A string containing a unique ID.
This value is used to ensure that
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.
-
: An array of
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.
-
: An
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
, orbalanced
. The default value isbalanced
.
-
: Specifies the preferred way the WebRTC layer should handle optimizing bandwidth against quality in constrained-bandwidth situations.
The possible values are
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
Specification |
---|
WebRTC: Real-Time Communication in Browsers # dom-rtcrtpsender-getparameters |
Browser compatibility
BCD tables only load in the browser