Introduction

When using the Agora RTC SDK to implement a real-time call or interactive streaming, to listen for the status of a user's microphone and camera in a channel, you can use the Agora RTM SDK.

Implementation

You can use the following functions of the Agora RTM SDK to listen for the status of a user's microphone and camera in a channel:

  • User attributes: Listen for the status of a specified user's microphone and camera by adding user attributes.
  • Channel attributes: Listen for the status of all users' microphones and cameras in a specified channel by adding channel attributes.

Listen for user attributes

  1. After joining a channel, call addOrUpdateLocalUserAttributes to add or update the attributes of the local user's microphone and camera.
  2. Call getUserAttributesByKeys to get the attributes of a specified user's microphone and camera, which can be used to show the microphone and camera status.

Listen for channel attributes

  1. (This step is for Linux/Windows C++ only, skip to step 2 when using other platforms.) After joining a channel, call createChannelAttribute to create and return an IRtmChannelAttribute instance.
After getting the microphone and camera status, call release to release the IRtmChannelAttribute instance.
  1. Call addOrUpdateChannelAttributes to add or update the attributes of all users' microphones and cameras in a specified channel.

  2. Call getChannelAttributesByKeys to get the attributes of all users' microphones and cameras in a specified channel, which can be used to show the microphone and camera status.

Reference

Refer to the following documents for detailed integration guide and API reference: