peerConnection.addEventListener("track", (e) => {
let videoElement = document.getElementById("video-box");
videoElement.srcObject = e.streams[0];
});RTCTrackEvent / notebook
RTCTrackEvent
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.