过时
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.

MediaStreamEvent() 构造函数创建新 MediaStreamEvent .

句法

 var event = new MediaStreamEvent(type, mediaStreamEventInit);
					

type
DOMString containing the name of the event, like addstream or removestream .
mediaStreamEventInit
MediaStreamEventInit 字典,拥有以下字段:
  • "stream" 类型 MediaStream representing the stream being concerned by the event.
  • "bubbles" , optional and defaulting to false , inherited from EventInit , and indicating if the event must bubble or not.
  • "cancelable" , optional and defaulting to false , inherited from EventInit , and indicating if the event can be canceled or not.

范例

// s is a MediaStream
var event = new MediaStreamEvent("addstream", {"stream": s});
					

浏览器兼容性

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
MediaStreamEvent() 构造函数 弃用 Chrome Yes Edge ≤18 Firefox Yes IE No Opera Yes Safari ? WebView Android Yes Chrome Android Yes Firefox Android ? Opera Android Yes Safari iOS ? Samsung Internet Android Yes

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

弃用。不要用于新网站。

弃用。不要用于新网站。

另请参阅

元数据

  • 最后修改: