W3cubDocs

/Web APIs

RTCRtpTransceiver

The WebRTC interface RTCRtpTransceiver describes a permanent pairing of an RTCRtpSender and an RTCRtpReceiver, along with some shared state.

Each SDP media section describes one bidirectional SRTP ("Secure Real Time Protocol") stream (excepting the media section for RTCDataChannel, if present). This pairing of send and receive SRTP streams is significant for some applications, so RTCRtpTransceiver is used to represent this pairing, along with other important state from the media section. Each non-disabled SRTP media section is always represented by exactly one transceiver.

A transceiver is uniquely identified using its mid property, which is the same as the media ID (mid) of its corresponding m-line. An RTCRtpTransceiver is associated with an m-line if its mid is non-null; otherwise it's considered disassociated.

Instance properties

currentDirection Read only

A read-only string which indicates the transceiver's current negotiated directionality, or null if the transceiver has never participated in an exchange of offers and answers. To change the transceiver's directionality, set the value of the direction property.

direction

A string which is used to set the transceiver's desired direction.

mid Read only

The media ID of the m-line associated with this transceiver. This association is established, when possible, whenever either a local or remote description is applied. This field is null if neither a local or remote description has been applied, or if its associated m-line is rejected by either a remote offer or any answer.

receiver Read only

The RTCRtpReceiver object that handles receiving and decoding incoming media.

sender Read only

The RTCRtpSender object responsible for encoding and sending data to the remote peer.

stopped Deprecated

Indicates whether or not sending and receiving using the paired RTCRtpSender and RTCRtpReceiver has been permanently disabled, either due to SDP offer/answer, or due to a call to stop().

Instance methods

setCodecPreferences()

A list of RTCRtpCodecParameters objects which override the default preferences used by the user agent for the transceiver's codecs.

stop()

Permanently stops the RTCRtpTransceiver. The associated sender stops sending data, and the associated receiver likewise stops receiving and decoding incoming data.

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
RTCRtpTransceiver 69 ≤18 59 No 56 11 69 69 59 48 11 10.0
currentDirection 69 79 59 No 56 12.1 69 69 59 48 12.2 10.0
direction 69 79 59 No 56 11 69 69 59 48 11 10.0
mid 69 79 59 No 56 11 69 69 59 48 11 10.0
receiver 69 79 59 No 56 11 69 69 59 48 11 10.0
sender 69 79 59 No 56 11 69 69 59 48 11 10.0
setCodecPreferences 76 79 No No 63 13.1 76 76 No 54 13.4 12.0
stop 88 88 59 No 74 11 88 88 59 63 11 15.0
stopped 69 79 59 No 56 11 69 69 59 48 11 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/RTCRtpTransceiver