大网数据广告活动
Web 标准与前端开发

RTCRtpReceiver: getParameters() method

· 52CE 我爱测

The **`getParameters()`** method of the RTCRtpReceiver interface returns an object describing the current configuration for how the receiver's RTCRtpReceiver.track is decoded.

WebRTC API

The getParameters() method of the RTCRtpReceiver interface returns an object describing the current configuration for how the receiver's RTCRtpReceiver.track is decoded.

Syntax

getParameters()

Parameters

None.

Return value

An object indicating the current configuration of the receiver.

  • codecs

    • : An 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

        • : A 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.
      • clockRate

        • : A 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.
      • mimeType

        • : A 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.
      • payloadType

      • sdpFmtpLine

        • : A 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.
  • 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 . This parameter cannot be changed once initially set.
  • rtcp

    • : An object providing the configuration parameters used for RTCP on the sender or receiver. This parameter cannot be changed once initially set.

      The object may have the following properties:

      • cname
        • : A string giving the canonical name (CNAME) used by RTCP (e.g., in SDES messages).
      • reducedSize
        • : A boolean that is true if reduced-size RTCP is configured (5506), and false if compound RTCP is specified (3550).

Examples

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;
}

Specifications

Browser compatibility

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。