Obsolete
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.
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, likeaddstream
orremovestream
. - mediaStreamEventInit
- Is a
MediaStreamEventInit
dictionary, having the following fields:"stream"
of typeMediaStream
representing the stream being concerned by the event."bubbles"
, optional and defaulting tofalse
, inherited fromEventInit
, and indicating if the event must bubble or not."cancelable"
, optional and defaulting tofalse
, inherited fromEventInit
, and indicating if the event can be canceled or not.
Example
// s is a MediaStream var event = new MediaStreamEvent("addstream", {"stream": s});
Browser compatibility
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.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
MediaStreamEvent() constructor | 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.