web api interface
MediaStreamEvent
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.
streamRead only Deprecated- : Contains the
MediaStreamcontaining the stream associated with the event.
- : Contains the
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 theMediaStreamit refers to.
- : Returns a new
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
- WebRTC
- Its usual target:
RTCPeerConnection.