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-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

Specification
WebRTC: Real-Time Communication in Browsers
# dom-rtcrtptransceiver-currentdirection

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
currentDirection
Chrome – Full support
Chrome 69 (Release date: 2018-09-04)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 59 (Release date: 2018-03-13)
footnote Full support
Opera – Full support
Opera 56 (Release date: 2018-09-25)
footnote Full support
Safari – Full support
Safari 12.1 (Release date: 2019-03-25)
footnote Full support
Chrome Android – Full support
Chrome Android 69 (Release date: 2018-09-04)
footnote Full support
Firefox for Android – Full support
Firefox for Android 59 (Release date: 2018-03-13)
footnote Full support
Opera Android – Full support
Opera Android 48 (Release date: 2018-11-08)
footnote Full support
Safari on iOS – Full support
Safari on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
Samsung Internet – Full support
Samsung Internet 10 (Release date: 2019-08-22)
footnote Full support
WebView Android – Full support
WebView Android 69 (Release date: 2018-09-04)
footnote Full support
WebView on iOS – Full support
WebView on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
"stopped" value
Chrome – Full support
Chrome 103 (Release date: 2022-06-21)
footnote Full support
Edge – Full support
Edge 103 (Release date: 2022-06-23)
footnote Full support
Firefox – Full support
Firefox 118 (Release date: 2023-09-26)
footnote Full support
Opera – Full support
Opera 89 (Release date: 2022-07-07)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 103 (Release date: 2022-06-21)
footnote Full support
Firefox for Android – Full support
Firefox for Android 118 (Release date: 2023-09-26)
footnote Full support
Opera Android – Full support
Opera Android 71 (Release date: 2022-09-16)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 20 (Release date: 2023-02-10)
footnote Full support
WebView Android – Full support
WebView Android 103 (Release date: 2022-06-21)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

See also