From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../api/rtcpeerconnection/onaddstream/index.html | 103 +++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 files/zh-cn/web/api/rtcpeerconnection/onaddstream/index.html (limited to 'files/zh-cn/web/api/rtcpeerconnection/onaddstream') diff --git a/files/zh-cn/web/api/rtcpeerconnection/onaddstream/index.html b/files/zh-cn/web/api/rtcpeerconnection/onaddstream/index.html new file mode 100644 index 0000000000..1c5a04d575 --- /dev/null +++ b/files/zh-cn/web/api/rtcpeerconnection/onaddstream/index.html @@ -0,0 +1,103 @@ +--- +title: RTCPeerConnection.onaddstream +slug: Web/API/RTCPeerConnection/onaddstream +translation_of: Web/API/RTCPeerConnection/onaddstream +--- +

{{APIRef("WebRTC")}}{{SeeCompatTable}}

+ +

当类型为{{domxref("MediaStreamEvent")}}的{{event("addstream")}} 事件发生时,通过{{domxref("RTCPeerConnection")}}触发RTCPeerConnection.onaddstream 事件处理函数。当远程媒体流{{domxref("MediaStream")}} 添加到连接后发送事件。当{{domxref("RTCPeerConnection.setRemoteDescription()")}} 后此事件立即被调用而不需要等待SDP交换完成。

+ +

语法

+ +
peerconnection.onaddstream = function;
+
+ +

+ + + +

例子

+ +
pc.onaddstream = function(ev) { alert("onaddstream event detected!"); };
+
+ +

规范

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{ SpecName('WebRTC 1.0', '#widl-RTCPeerConnection-onaddstream', 'RTCPeerConnection.onaddstream') }}{{ Spec2('WebRTC 1.0') }}Initial specification.
+ +

浏览器兼容性

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{ CompatVersionUnknown() }} [1]{{ CompatVersionUnknown }} [1]{{ CompatNo() }}{{ CompatVersionUnknown() }}{{ CompatUnknown() }}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatNo() }}{{ CompatUnknown() }}{{ CompatUnknown() }}
+
+ +

[1] Though this property is not prefixed, the interface it belongs to is.

+ +

扩展阅读

+ + -- cgit v1.2.3-54-g00ecf