Firefox Tomorrow

web api interface

MediaStreamEvent

View on MDN ↗

The MediaStreamEvent interface represents events that occurs in relation to a MediaStream. Two events of this type can be thrown: addstream and removestream.

Instance properties

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

  • stream Read only Deprecated
    • : Contains the MediaStream containing the stream associated with the event.

Constructors

  • MediaStreamEvent() Deprecated
    • : 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

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

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also