MediaStreamEvent - Web APIs | MDN

Instance properties

A MediaStreamEvent being an Event, this event also implements these properties.

MediaStreamEvent.stream Read only Deprecated Non-standard

Contains the MediaStream containing the stream associated with the event.

Constructors

MediaStreamEvent() Deprecated Non-standard

Returns a new MediaStreamEvent. It takes two parameters, the first being a string representing the type of the event; the second a dictionary containing the MediaStream it refers to.

Instance methods

A MediaStreamEvent being an Event, this event also implements these properties. There is no specific MediaStreamEvent method.

Examples

js

pc.onaddstream = (ev) => {
  alert(`A stream (id: '${ev.stream.id}') has been added to this connection.`);
};

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.