setSubscribeAudioAllowlist abstract method

Future<void> setSubscribeAudioAllowlist({
  1. required List<int> uidList,
  2. required int uidNumber,
})

Sets the allowlist of subscriptions for audio streams.

You can call this method to specify the audio streams of a user that you want to subscribe to. If a user is added in the allowlist and blocklist at the same time, only the blocklist takes effect. You can call this method either before or after joining a channel. The allowlist is not affected by the setting in muteRemoteAudioStream, muteAllRemoteAudioStreams and autoSubscribeAudio in ChannelMediaOptions. Once the allowlist of subscriptions is set, it is effective even if you leave the current channel and rejoin the channel.

  • uidList The user ID list of users that you want to subscribe to. If you want to specify the audio streams of a user for subscription, add the user ID in this list. If you want to remove a user from the allowlist, you need to call the setSubscribeAudioAllowlist method to update the user ID list; this means you only add the uid of users that you want to subscribe to in the new user ID list.
  • uidNumber The number of users in the user ID list.

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> setSubscribeAudioAllowlist(
    {required List<int> uidList, required int uidNumber});