async leave()

in src/providers/MeetingProvider/MeetingManager.ts [212:238]


  async leave(): Promise<void> {
    if (this.audioVideo) {
      this.audioVideo.stopContentShare();
      this.audioVideo.stopLocalVideoTile();
      this.audioVideo.unbindAudioElement();

      try {
        await this.meetingSession?.deviceController.chooseAudioOutput(null);
        await this.meetingSession?.deviceController.destroy();
      } catch (error) {
        console.log(
          'MeetingManager failed to clean up media resources on leave'
        );
      }

      if (this.activeSpeakerListener) {
        this.audioVideo.unsubscribeFromActiveSpeakerDetector(
          this.activeSpeakerListener
        );
      }

      this.audioVideo.stop();
    }
    this.initializeMeetingManager();
    this.publishAudioVideo();
    this.publishActiveSpeaker();
  }