RTCRtpTransceiverInit - 用于提供收发器的配置选项
RTCRtpTransceiverInit 是 WebRTC 的字典,用于提供收发器的配置选项,调用 RTCPeerConnection.addTransceiver() 函数时,将使用该字典。
属性
direction 可选
新收发器的首选方向性。此值用于初始化新的 RTCRtpTransceiver 对象的 RTCRtpTransceiver.direction 属性。
sendEncodings 可选
从 RTCRtpSender 发送 RTP 媒体时允许使用的编码列表。每个条目是一个 RTCRtpEncodingParameters 对象。
streams 可选
要添加到收发器的 RTCRtpReceiver 的 MediaStream 对象的列表;当远程对等方的 RTCPeerConnection 的 track 事件发生时,这些是将由该事件指定的流。
规范
| 规范 | 状态 | 备注 |
|---|---|---|
| WebRTC 1.0: Real-time Communication Between Browsers RTCRtpTransceiverInit 的定义 |
候选推荐 | - |
桌面浏览器兼容性
| 特性 | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|---|
| 基础支持 | 69 | ≤18 | 59 | 不支持 | 未知 | 未知 |
direction | 69 | ≤18 | 59 | 不支持 | 未知 | 未知 |
sendEncodings | 69 | ≤18 | 不支持1 | 不支持 | 未知 | 未知 |
streams | 69 | ≤18 | 59 | 不支持 | 未知 | 未知 |
移动浏览器兼容性
| 特性 | Android | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
|---|---|---|---|---|---|---|---|
| 基础支持 | 69 | 69 | 未知 | 59 | 未知 | 未知 | 未知 |
direction | 69 | 69 | 未知 | 59 | 未知 | 未知 | 未知 |
sendEncodings | 69 | 69 | 未知 | 不支持1 | 未知 | 未知 | 未知 |
streams | 69 | 69 | 未知 | 59 | 未知 | 未知 | 未知 |
1. Firefox 中尚未实现 sendEncodings。参见 bug 1396918。