W3cubDocs

/Web APIs

RTCRtpTransceiver: currentDirection property

The read-only RTCRtpTransceiver property currentDirection is a string which indicates the current negotiated directionality of the transceiver.

The directionality indicates whether the transceiver will offer to send and/or receive RTP 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 the direction property. Changing the direction triggers a renegotiation, which may eventually result in the currentDirection also changing.

Value

The value is initially null, 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: Does not offer to receive RTP data and will not do so.
"recvonly"

Transceiver offers to receive but not set RTP data:

  • RTCRtpSender: Does not 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: Does not offer to send RTP data, and will not do so.
  • RTCRtpReceiver: Does not 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: Does not offer to send RTP data, and will not do so.
  • RTCRtpReceiver: Does not offer to receive RTP data and will not do so.

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
currentDirection 69 79 59 No 56 12.1 69 69 59 48 12.2 10.0
stopped_value 103 103 118 No 89 No 103 103 118 71 No 20.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/currentDirection