RTCRtpTransceiver.currentDirection

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

Its value is one of the strings defined by the RTCRtpTransceiverDirection enumeration.

You can examine and set the transceiver's preferred directionality using direction property.

Syntax

var direction = RTCRtpTransceiver.currentDirection

Value

A DOMString whose value is one of the strings which are a member of the RTCRtpTransceiverDirection enumerated type.

The RTCRtpTransceiverDirection type is an enumeration of string values. Each describes how the transceiver's associated RTCRtpSender and RTCRtpReceiver behave as shown in the table below.

Value RTCRtpSender behavior RTCRtpReceiver behavior
"sendrecv" Offers to send RTP data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active. Offers to receive RTP data, and does so if the other peer accepts.
"sendonly" Offers to send RTP data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active. Does not offer to receive RTP data and will not do so.
"recvonly" Does not offer to send RTP data, and will not do so. Offers to receive RTP data, and will do so if the other peer offers.
"inactive" Does not offer to send RTP data, and will not do so. Does not offer to receive RTP data and will not do so.

To determine if a sender has at least one active encoding, the user agent gets its parameters using RTCRtpSender.getParameters(), then looks at the parameters' encodings property; if any of the listed encodings has its active property set to true, the sender has an active encoding.

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
No
59
No
No
12.1
69
69
59
No
12.2
10.0

See also

© 2005–2021 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