Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • initializes a base container tag to display incoming media streamsjoins to the room on server
  • negotiates WebRTC connection
Code Block
languagejs
themeRDark
const playStreams = function(state) {
    //create remote display item to show remote streams
    remoteDisplay = initRemoteDisplay({
        div: document.getElementById("remoteVideo"),
        room: state.room,
        peerConnection: state.pc
    });
    state.room.join(state.pc);
}

8. Playback stopping

stopStreams(), remoteDisplay.stop() code

...