muteUser abstract method

Future<void> muteUser(
  1. String userID,
  2. bool mute
)

Whether can receive the audio data of the specified user.

Available since: 2.16.0 Description: In the process of real-time audio and video interaction, local users can use this function to control whether to receive audio data from designated remote users when pulling streams as needed. When the developer does not receive the audio receipt, the hardware and network overhead can be reduced. Use cases: When developers need to quickly close and restore remote audio, they can call this function to enhance the interactive experience. Default value: The default is false, which means to receive audio data from all users. When to call: After initializing the range audio createRangeAudio. Caution: This function is valid only when the muteAllPlayStreamAudio function is set to false. Related APIs: You can call the muteAllPlayStreamAudio function to control whether to receive all audio data. 1. When the muteAllPlayStreamAudio(true) function is called, it takes effect globally, that is, local users will be prohibited from receiving audio data from all remote users. At this time, the muteUser function will not take effect regardless of whether the muteUser function is called before or after muteAllPlayStreamAudio. 2. When the muteAllPlayStreamAudio(false) function is called, the local user can receive the audio data of all remote users. At this time, the muteUser function can be used to control whether to receive the audio data of the specified user. Calling the muteUser(userID, true) function allows the local user to receive audio data other than the userID; calling the muteUser(userID, false) function allows the local user to receive the audio data of the userID.

  • userID User ID.
  • mute Whether it can receive the audio data of the specified remote user, "true" means prohibition, "false" means receiving, the default value is "false".

Implementation

Future<void> muteUser(String userID, bool mute);