onUserAudioAvailable property

(void Function(String userId, bool available)?) onUserAudioAvailable
final

A Remote User Published/Unpublished Audio

If you receive the onUserAudioAvailable (userId, true) callback, it indicates that the user published audio.

  • In auto-subscription mode, the SDK will play the user’s audio automatically.

  • In manual subscription mode, you can call muteRemoteAudio (userid, false) to play the user’s audio.

  • Parameters:

    • available(bool):
      • Whether the user published (or unpublished) audio.
        • true: published;
        • false: unpublished.
    • userId(String):
      • User ID of the remote user.

Note

The auto-subscription mode is used by default. You can switch to the manual subscription mode by calling setDefaultStreamRecvMode, but it must be called before room entry for the switch to take effect.

Implementation

final void Function(String userId, bool available)? onUserAudioAvailable;