Video SDK for Web - Meeting End via Host

Description
We are working on Integrating the Video SDK to our angular app and have used the Sample Web Video SDK App provided by Zoom for our reference.

We have added a button on UI for Host and Participant to end/leave meeting. On click of button we are calling zoomClient.leave(true) if host or zoomClient.leave() if participant.

If the host clicks on the end button the Session ends for everyone however we are unable to identify this event in all other participant browser so that we can exit meeting for each participant.

Is there a event that need to be handled in order to know that host has ended the session from his/her end and the participants are taken out of meeting and could be redirected to other page.

Note: We have handled zoomClient.on(‘user-removed’) event, but this gets called anytime the host or attendee leaves the meeting. It does not provide information if the session has ended or not.

Browser Console Error
No Error in console.

Which Web Video SDK version?
@zoom1234/videosdk”: “^1.6.0”,

Video SDK Code Snippets

Function that is called on click on End Meeting Button

public async onLeaveSessionClick() {
    try {
      this.loaderService.showLoader();
      await Promise.all([this.toggleSelfVideo(false), this.stopAllParticipantVideo()]);

      this.mediaStream.stopAudio();

      let currentUser = this.participants.find((user) => user.userId === this.selfId);

      //Pass true if host and end session and false if participant and leave session
      if(currentUser?.isHost) {
        await this.zoomClient.leave(true);
      }
      else {
        await this.zoomClient.leave();
      }

      this.loaderService.hideLoader();

      //show ending screen
      this.routingService.routeToPath(`/zoom/${this.taskId}/end`, { queryParamsHandling: 'merge', replaceUrl: true });
    } catch (e) {
      this.loaderService.hideLoader();
      console.error('Error leaving session', e);
    }
  }

Hey @rs.subk-dev

Thanks for your feedback.

In Video SDK Web, when the session is ended(user left or host ended), the connection-change with payload.state === ConnectionState.Closed will be fired.

Thanks
Vic

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.