leaveChannel abstract method

Future<void> leaveChannel({
  1. LeaveChannelOptions? options,
})

Sets channel options and leaves the channel.

After calling this method, the SDK terminates the audio and video interaction, leaves the current channel, and releases all resources related to the session. After joining the channel, you must call this method to end the call; otherwise, the next call cannot be started. If you have called joinChannelEx to join multiple channels, calling this method will leave all the channels you joined. This method call is asynchronous. When this method returns, it does not necessarily mean that the user has left the channel.

  • options The options for leaving the channel. See LeaveChannelOptions.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly.

Implementation

Future<void> leaveChannel({LeaveChannelOptions? options});