只读
RTCDataChannel
property
negotiated
indicates whether the
RTCDataChannel
's connection was negotiated by the Web app (
true
) or by the WebRTC layer (
false
).
默认为
false
.
见 Creating a data channel in Using WebRTC data channels for further information about this property.
var negotiated = aDataChannel.negotiated;
true
若
RTCDataChannel
's connection was negotiated by the Web app itself;
false
if the negotiation was handled by the WebRTC layer. The default is
false
.
The code snippet below checks the value of
negotiated
; if it's
true
, a function called
shutdownRemoteChannel()
is called with the channel's
id
; presumably this would be implemented to transmit a shutdown signal to the remote peer prior to terminating the connection.
if (dataChannel.negotiated) {
shutdownRemoteChannel(dataChannel.id);
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCDataChannel.negotiated' in that specification. |
候选推荐 | 最初的规范。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
negotiated
|
Chrome 56 | Edge ≤79 | Firefox 68 | IE No | Opera 43 | Safari No | WebView Android 56 | Chrome Android 56 | Firefox Android 68 | Opera Android 43 | Safari iOS No | Samsung Internet Android 6.0 |
完整支持
不支持
实验。期望将来行为有所改变。
RTCDataChannel
MediaDevices.getUserMedia()
Navigator.mediaDevices
RTCCertificate
RTCDTMFSender
RTCDTMFToneChangeEvent
RTCDataChannelEvent
RTCDtlsTransport
RTCErrorEvent
RTCIceCandidate
RTCIceTransport
RTCPeerConnection
RTCPeerConnectionIceErrorEvent
RTCPeerConnectionIceEvent
RTCRtpReceiver
RTCRtpSender
RTCRtpTransceiver
RTCSctpTransport
RTCSessionDescription
RTCStatsEvent
RTCStatsReport
RTCTrackEvent