过时
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
The deprecated (and never part of the official specification) read-only
RTCDataChannel
property
stream
returns an ID number (between 0 and 65,535) which uniquely identifies the
RTCDataChannel
.
This ID is set at the time the data channel is created, either by the user agent (if
RTCDataChannel.negotiated
is
false
) or by the site or app script (if
negotiated
is
true
).
This property has been replaced with the
RTCDataChannel.id
property. If you have code that uses
stream
, you will need to update, since browsers have begun to remove support for
stream
.
var stream = aDataChannel.stream;
An
unsigned short
value (that is, an integer between 0 and 65,535) which uniquely identifies the data channel.
var dataChannel = pc.createDataChannel("SampleChannel");
console.log("Data channel stream ID: " + dataChannel.stream);
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
stream
弃用
非标
|
Chrome 56 | Edge ≤79 | Firefox No | IE No | Opera 43 | Safari No | WebView Android 56 | Chrome Android 56 | Firefox Android No | 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