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.
Properties
currentDirectionRead only- A string from the enum
RTCRtpTransceiverDirectionwhich indicates the transceiver's current directionality, ornullif the transceiver is stopped or has never participated in an exchange of offers and answers. direction- A string from the enum
RTCRtpTransceiverDirectionwhich is used to set the transceiver's desired direction. midRead 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
nullif 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. receiverRead only- The
RTCRtpReceiverobject that handles receiving and decoding incoming media. senderRead only- The
RTCRtpSenderobject responsible for encoding and sending data to the remote peer. stopped- Indicates whether or not sending and receiving using the paired
RTCRtpSenderandRTCRtpReceiverhas been permanently disabled, either due to SDP offer/answer, or due to a call tostop().
Methods
setCodecPreferences()- A list of
RTCRtpCodecParametersobjects 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
| Specification | Status | Comment |
|---|---|---|
| WebRTC 1.0: Real-time Communication Between Browsers The definition of 'RTCRtpTransceiver' in that specification. |
Candidate Recommendation |
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
RTCRtpTransceiver | Chrome Full support 69 | Edge Full support ≤18 | Firefox Full support 59 | IE No support No | Opera No support No | Safari Full support Yes | WebView Android Full support 69 | Chrome Android Full support 69 | Firefox Android Full support 59 | Opera Android No support No | Safari iOS Full support Yes | Samsung Internet Android Full support 10.0 |
currentDirection | Chrome Full support 69 | Edge No support No | Firefox Full support 59 | IE No support No | Opera No support No | Safari ? | WebView Android Full support 69 | Chrome Android Full support 69 | Firefox Android Full support 59 | Opera Android No support No | Safari iOS ? | Samsung Internet Android Full support 10.0 |
direction | Chrome Full support 69 | Edge No support No | Firefox Full support 59 | IE No support No | Opera No support No | Safari Full support Yes | WebView Android Full support 69 | Chrome Android Full support 69 | Firefox Android Full support 59 | Opera Android No support No | Safari iOS Full support Yes | Samsung Internet Android Full support 10.0 |
mid | Chrome Full support 69 | Edge No support No | Firefox Full support 59 | IE No support No | Opera No support No | Safari Full support Yes | WebView Android Full support 69 | Chrome Android Full support 69 | Firefox Android Full support 59 | Opera Android No support No | Safari iOS Full support Yes | Samsung Internet Android Full support 10.0 |
receiver | Chrome Full support 69 | Edge No support No | Firefox Full support 59 | IE No support No | Opera No support No | Safari Full support Yes | WebView Android Full support 69 | Chrome Android Full support 69 | Firefox Android Full support 59 | Opera Android No support No | Safari iOS Full support Yes | Samsung Internet Android Full support 10.0 |
sender | Chrome Full support 69 | Edge No support No | Firefox Full support 59 | IE No support No | Opera No support No | Safari Full support Yes | WebView Android Full support 69 | Chrome Android Full support 69 | Firefox Android Full support 59 | Opera Android No support No | Safari iOS Full support Yes | Samsung Internet Android Full support 10.0 |
setCodecPreferences() | Chrome No support No | Edge No support No | Firefox No support No | IE No support No | Opera No support No | Safari ? | WebView Android No support No | Chrome Android No support No | Firefox Android No support No | Opera Android No support No | Safari iOS ? | Samsung Internet Android No support No |
stop() | Chrome No support No | Edge No support No | Firefox Full support 59 | IE No support No | Opera No support No | Safari Full support Yes | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 59 | Opera Android No support No | Safari iOS Full support Yes | Samsung Internet Android No support No |
stopped | Chrome Full support 69 | Edge No support No | Firefox Full support 59 | IE No support No | Opera No support No | Safari Full support Yes | WebView Android Full support 69 | Chrome Android Full support 69 | Firefox Android Full support 59 | Opera Android No support No | Safari iOS Full support Yes | Samsung Internet Android Full support 10.0 |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- Deprecated. Not for use in new websites.
- Deprecated. Not for use in new websites.
See also
- WebRTC API
- Introduction to the Real-time Transport Protocol (RTP)
RTCPeerConnection.addTrack()andRTCPeerConnection.addTransceiver()both create transceiversRTCRtpReceiverandRTCRtpSender
