MDN self-hosted library · e01.org

MediaStreamEvent: stream property

WebRTC

Open notebook · 1 cells web-api-instance-property upstream source

WebRTC

The read-only property MediaStreamEvent.stream returns the MediaStream associated with the event.

Example

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

Browser compatibility

See also

  • addstream, removestream
  • RTCPeerConnection