The WebRTC interface
RTCRtpTransceiver
describes a permanent pairing of an
RTCRtpSender
和
RTCRtpReceiver
, along with some shared state.
每个
SDP
media section describes one bidirectional SRTP ("Secure Real Time Protocol") stream (excepting the media section for
RTCDataChannel
, if present). This pairing of send and receive SRTP streams is significant for some applications, so
RTCRtpTransceiver
is used to represent this pairing, along with other important state from the media section. Each non-disabled SRTP media section is always represented by exactly one transceiver.
A transceiver is uniquely identified using its
mid
property, which is the same as the media ID (
mid
) of its corresponding m-line. An
RTCRtpTransceiver
is
associated
with an m-line if its
mid
is non-null; otherwise it's considered disassociated.
currentDirection
只读
RTCRtpTransceiverDirection
which indicates the transceiver's current directionality, or
null
if the transceiver is stopped or has never participated in an exchange of offers and answers. To change the transceiver's directionality, set the value of the
direction
特性。
direction
RTCRtpTransceiverDirection
which is used to set the transceiver's desired direction.
mid
只读
null
if neither a local or remote description has been applied, or if its associated m-line is rejected by either a remote offer or any answer.
receiver
只读
RTCRtpReceiver
object that handles receiving and decoding incoming media.
sender
只读
RTCRtpSender
object responsible for encoding and sending data to the remote peer.
stopped
RTCRtpSender
and
RTCRtpReceiver
has been permanently disabled, either due to SDP offer/answer, or due to a call to
stop()
.
setCodecPreferences()
RTCRtpCodecParameters
objects which override the default preferences used by the
用户代理
for the transceiver's codecs.
stop()
RTCRtpTransceiver
. The associated sender stops sending data, and the associated receiver likewise stops receiving and decoding incoming data.
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCRtpTransceiver' in that specification. |
候选推荐 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
RTCRtpTransceiver
|
Chrome 69 | Edge ≤18 | Firefox 59 | IE 不支持 No | Opera 不支持 No | Safari Yes | WebView Android 69 | Chrome Android 69 | Firefox Android 59 | Opera Android 不支持 No | Safari iOS Yes | Samsung Internet Android 10.0 |
currentDirection
|
Chrome 69 | Edge 不支持 No | Firefox 59 | IE 不支持 No | Opera 不支持 No | Safari ? | WebView Android 69 | Chrome Android 69 | Firefox Android 59 | Opera Android 不支持 No | Safari iOS ? | Samsung Internet Android 10.0 |
direction
|
Chrome 69 | Edge 不支持 No | Firefox 59 | IE 不支持 No | Opera 不支持 No | Safari Yes | WebView Android 69 | Chrome Android 69 | Firefox Android 59 | Opera Android 不支持 No | Safari iOS Yes | Samsung Internet Android 10.0 |
mid
|
Chrome 69 | Edge 不支持 No | Firefox 59 | IE 不支持 No | Opera 不支持 No | Safari Yes | WebView Android 69 | Chrome Android 69 | Firefox Android 59 | Opera Android 不支持 No | Safari iOS Yes | Samsung Internet Android 10.0 |
receiver
|
Chrome 69 | Edge 不支持 No | Firefox 59 | IE 不支持 No | Opera 不支持 No | Safari Yes | WebView Android 69 | Chrome Android 69 | Firefox Android 59 | Opera Android 不支持 No | Safari iOS Yes | Samsung Internet Android 10.0 |
sender
|
Chrome 69 | Edge 不支持 No | Firefox 59 | IE 不支持 No | Opera 不支持 No | Safari Yes | WebView Android 69 | Chrome Android 69 | Firefox Android 59 | Opera Android 不支持 No | Safari iOS Yes | Samsung Internet Android 10.0 |
setCodecPreferences()
|
Chrome 不支持 No | Edge 不支持 No | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari ? | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS ? | Samsung Internet Android 不支持 No |
stop()
|
Chrome 不支持 No | Edge 不支持 No | Firefox 59 | IE 不支持 No | Opera 不支持 No | Safari Yes | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 59 | Opera Android 不支持 No | Safari iOS Yes | Samsung Internet Android 不支持 No |
stopped
弃用
|
Chrome 69 | Edge 不支持 No | Firefox 59 | IE 不支持 No | Opera 不支持 No | Safari Yes | WebView Android 69 | Chrome Android 69 | Firefox Android 59 | Opera Android 不支持 No | Safari iOS Yes | Samsung Internet Android 10.0 |
完整支持
不支持
兼容性未知
弃用。不要用于新网站。
RTCPeerConnection.addTrack()
and
RTCPeerConnection.addTransceiver()
both create transceivers
RTCRtpReceiver
and
RTCRtpSender
RTCRtpTransceiver
MediaDevices.getUserMedia()
Navigator.mediaDevices
RTCCertificate
RTCDTMFSender
RTCDTMFToneChangeEvent
RTCDataChannel
RTCDataChannelEvent
RTCDtlsTransport
RTCErrorEvent
RTCIceCandidate
RTCIceTransport
RTCPeerConnection
RTCPeerConnectionIceErrorEvent
RTCPeerConnectionIceEvent
RTCRtpReceiver
RTCRtpSender
RTCSctpTransport
RTCSessionDescription
RTCStatsReport
RTCTrackEvent