RTCRtpTransceiver.currentDirection - Web APIs 编辑

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.

ValueRTCRtpSender behaviorRTCRtpReceiver 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 active1.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 active1.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.

[1] 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

SpecificationStatusComment
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCRtpTransceiver.currentDirection' in that specification.
Candidate Recommendation 

Browser compatibility

BCD tables only load in the browser

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:115 次

字数:5169

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文