leaveChannel abstract method

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

Sets channel options and leaves the channel.

If you call release immediately after calling this method, the SDK does not trigger the onLeaveChannel callback. If you have called joinChannelEx to join multiple channels, calling this method will leave the channels when calling joinChannel and joinChannelEx at the same time. This method will release all resources related to the session, leave the channel, that is, hang up or exit the call. This method can be called whether or not a call is currently in progress. After joining the channel, you must call this method or to end the call, otherwise, the next call cannot be started. This method call is asynchronous. When this method returns, it does not necessarily mean that the user has left the channel. After actually leaving the channel, the local user triggers the onLeaveChannel callback; after the user in the communication scenario and the host in the live streaming scenario leave the channel, the remote user triggers the onUserOffline callback.

  • 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});