Updated on 2025-04-18 GMT+08:00

Scenario 5: Leaving a Meeting

Description

To leave a meeting from a third-party web page, call the leaveConf API of the SDK. If you forcibly end the process or close the web page, you may still exist in the participant list of other users for a short period of time.

Service Process

To leave a meeting, call the leaveConf API and then process the leave_conf_result callback event.

  1. Call an API.

    1. Call the leaveConf API to exit the SDK and process the calling result (successful or failed) based on the Promise object returned by the SDK.

  2. Implement the callback function.

    Implement the callback event leave_conf_result.

Sample Code

HWMeeting.leaveConf().then(() => {
    // API called.
      ...
    }).catch((e) => {
    // API calling failed.
      ...
})

1
2
3
4
5
6
7
8
// Event listening. Configure it before joining a meeting.
listener = HWMeeting.createEventListener();

HWMeeting.getEventList().forEach(event => {
  listener.on("leave_conf_result", (eventData) => {
      ...
  });
});