setSubscribeAudioAllowlist abstract method

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

Sets the audio subscription allowlist.

You can call this method to specify the audio streams you want to subscribe to. This method can be called before or after joining a channel. The audio subscription allowlist is not affected by muteRemoteAudioStream, muteAllRemoteAudioStreams, or autoSubscribeAudio in ChannelMediaOptions. After setting the allowlist, if you leave and rejoin the channel, the allowlist remains effective. If a user appears in both the audio subscription allowlist and blocklist, only the blocklist takes effect.

  • uidList The list of user IDs in the audio subscription allowlist. If you want to subscribe to a specific user's audio stream, add that user's ID to this list. If you want to remove a user from the allowlist, call the setSubscribeAudioAllowlist method again and update the list of user IDs so that it no longer contains the uid of the user you want to remove.
  • uidNumber The number of users in the allowlist.

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. See Error Codes for details and resolution suggestions.

Implementation

Future<void> setSubscribeAudioAllowlist(
    {required List<int> uidList, required int uidNumber});