RTCRtpTransceiverDirection
type is an enumerated set of strings which are used to describe the directionality of a
RTCRtpTransceiver
实例。
Both the preferred
direction
和
currentDirection
properties are of this type.
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.
| 值 |
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 1 . | 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 1 . | 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
用户代理
gets its parameters using
RTCRtpSender.getParameters()
, then looks at the parameters'
encodings
property; if any of the listed encodings has its
active
特性被设为
true
, the sender has an active encoding.
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCRtpTransceiverDirection' in that specification. |
候选推荐 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
RTCRtpTransceiverDirection
|
Chrome 69 | Edge ≤18 | Firefox 59 | IE 不支持 No | Opera ? | Safari ? | WebView Android 69 | Chrome Android 69 | Firefox Android 59 | Opera Android ? | Safari iOS ? | Samsung Internet Android 10.0 |
完整支持
不支持
兼容性未知
RTCRtpTransceiver.direction
and
RTCRtpTransceiver.currentDirection
RTCRtpReceiver
and
RTCRtpSender
RTCRtpTransceiverDirection
MediaDevices.getUserMedia()
Navigator.mediaDevices
RTCCertificate
RTCDTMFSender
RTCDTMFToneChangeEvent
RTCDataChannel
RTCDataChannelEvent
RTCDtlsTransport
RTCErrorEvent
RTCIceCandidate
RTCIceTransport
RTCPeerConnection
RTCPeerConnectionIceErrorEvent
RTCPeerConnectionIceEvent
RTCRtpReceiver
RTCRtpSender
RTCRtpTransceiver
RTCSctpTransport
RTCSessionDescription
RTCStatsEvent
RTCStatsReport
RTCTrackEvent