RTCRtpTransceiver
BaselineWidely available *
This feature is well established and works across many devices and browser versions. It’s been available across browsers since October 2018.
* Some parts of this feature may have varying levels of support.
The WebRTC interfaceRTCRtpTransceiver
describes a permanent pairing of anRTCRtpSender
and anRTCRtpReceiver
, along with some shared state.
EachSDP media section describes one bidirectional SRTP ("Secure Real Time Protocol") stream (excepting the media section forRTCDataChannel
, if present).This pairing of send and receive SRTP streams is significant for some applications, soRTCRtpTransceiver
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 itsmid
property, which is the same as the media ID (mid
) of its corresponding m-line. AnRTCRtpTransceiver
isassociated with an m-line if itsmid
is non-null; otherwise it's considered disassociated.
Instance properties
currentDirection
Read onlyA 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 thedirection
property.direction
A string which is used to set the transceiver's desired direction.
mid
Read onlyThe 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 onlyThe
RTCRtpReceiver
object that handles receiving and decoding incoming media.sender
Read onlyThe
RTCRtpSender
object responsible for encoding and sending data to the remote peer.stopped
DeprecatedIndicates whether or not sending and receiving using the paired
RTCRtpSender
andRTCRtpReceiver
has been permanently disabled, either due to SDP offer/answer, or due to a call tostop()
.
Instance methods
setCodecPreferences()
Configures the transceiver's preferred list of codecs, overridinguser agent settings.
stop()
Permanently stops the
RTCRtpTransceiver
.The associated sender stops sending data, and the associated receiver likewise stops receiving and decoding incoming data.
Specifications
Specification |
---|
WebRTC: Real-Time Communication in Browsers # rtcrtptransceiver-interface |