过时
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);
					

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
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

图例

完整支持

完整支持

不支持

不支持

非标。预期跨浏览器支持较差。

非标。预期跨浏览器支持较差。

弃用。不要用于新网站。

弃用。不要用于新网站。

另请参阅

元数据

  • 最后修改: