Web/API/MediaStreamEvent/MediaStreamEvent

From Get docs

ObsoleteThis 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.


The MediaStreamEvent() constructor creates a new MediaStreamEvent.

Syntax

 var event = new MediaStreamEvent(type, mediaStreamEventInit);

Values

type
Is a DOMString containing the name of the event, like addstream or removestream.
mediaStreamEventInit
Is a MediaStreamEventInit dictionary, having the following fields:
  • "stream" of type 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.

Example

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

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet

MediaStreamEvent() constructor

Deprecated'

Chrome

Full support Yes

Edge

Full support ≤18

Firefox

Full support Yes

IE

No support No

Opera

Full support Yes

Safari

?

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

?

Opera Android

Full support Yes

Safari iOS

?

Samsung Internet Android

Full support Yes

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Deprecated. Not for use in new websites.'
Deprecated. Not for use in new websites.


See also