MediaStreamEvent
Experimental
这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。
MediaStreamEvent
接口表示发生在 MediaStream
中的事件.这种类型返回两个事件: addstream
和 removestream
.
Properties
一个 MediaStreamEvent
作为一个 Event
, 该事件也实现了这些属性.
MediaStreamEvent.stream
(en-US) 只读- 包含了
MediaStream
以及相关的事件流.
Constructors
MediaStreamEvent()
(en-US)- 返回一个新的
MediaStreamEvent
. 它需要两个参数, 第一个为DOMString
代表事件的类型; 第二个是一个MediaStream
集合 .
Methods
一个 MediaStreamEvent
作为一个 Event
, 这个事件也实现了这些属性. 没有特定的 MediaStreamEvent
方法.
Examples
pc.onaddstream = function( ev ) {
alert("A stream (id: '" + ev.stream.id + "') has been added to this connection.");
};
Specifications
Specification | Status | Comment |
---|---|---|
WebRTC 1.0: Real-time Communication Between Browsers MediaStreamEvent |
Candidate Recommendation | Initial definition. |
Browser compatibility
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help! (en-US)
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | (Yes) | 未实现 | (Yes) | ? |
Feature | Android | Chrome for Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Basic support | ? | ? | (Yes) | ? | 未实现 | ? | ? |
See also
- WebRTC
- Its usual target:
RTCPeerConnection
.