RTCRtpTransceiver: currentDirection property
Baseline Widely available *
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
* Some parts of this feature may have varying levels of support.
The read-onlyRTCRtpTransceiver propertycurrentDirection is a string which indicates the current negotiated directionality of the transceiver.
The directionality indicates whether the transceiver will offer to send and/or receiveRTP data, or whether it is inactive or stopped and won't send or receive data.
The transceiver's preferred directionality can be set and read using thedirection property.Changing thedirection triggers a renegotiation, which may eventually result in thecurrentDirection also changing.
In this article
Value
The value is initiallynull, prior to negotiation using an offer/answer.
After negotiation the value is a string with one of the following values:
"sendrecv"Transceiver offers to send and receive RTP data:
RTCRtpSender: Offers to send RTP data, and will do so if the remote peer accepts the connection and at least one of the sender's encodings is active.RTCRtpReceiver: Offers to receive RTP data, and does so if the remote peer accepts.
"sendonly"Transceiver offers to send but not receive RTP data:
RTCRtpSender: Offers to send RTP data, and will do so if the remote peer accepts the connection and at least one of the sender's encodings is active.RTCRtpReceiver: Doesnot offer to receive RTP data and will not do so.
"recvonly"Transceiver offers to receive but not set RTP data:
RTCRtpSender: Doesnot offer to send RTP data, and will not do so.RTCRtpReceiver: Offers to receive RTP data, and will do so if the remote peer offers.
"inactive"Transceiver is inactive:
RTCRtpSender: Doesnot offer to send RTP data, and will not do so.RTCRtpReceiver: Doesnot offer to receive RTP data and will not do so.
"stopped"This is the terminal state of the transceiver.The transceiver is stopped and will not send or receive RTP data or offer to do so.
RTCRtpSender: Doesnot offer to send RTP data, and will not do so.RTCRtpReceiver: Doesnot offer to receive RTP data and will not do so.
Specifications
| Specification |
|---|
| WebRTC: Real-Time Communication in Browsers> # dom-rtcrtptransceiver-currentdirection> |