Versions Compared

Key

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

...

13. Выход участника из комнаты

Room.leave() code

Code Block
languagejs
themeRDark
  onJoinClick = () => {
    let app = this;
    ...
    let room = this.state.room;
    let participants = this.state.participants;

    if (!room) {
      ...
    } else {
      this.setState({joinButtonDisabled: true}, () => {
        participants.forEach((participant) => {
          // Stop all the playing participants streams
          app.stopParticipantStream(participant.stream);
        });
        room.leave().then(() => {app.onLeft();}, () => {app.onLeft();});
      });
    }
  };