logo
On this page

In a live streaming scenario, how to listen to the event of remote audience role users logging in/exiting the room?

2023-05-24
Products / Plugins:Video Call / Audio Call / Live streaming
Platform / Framework:iOS / Android / macOS / Windows

Overview

During live streaming, developers often need to listen to information about remote audience logging in/exiting the room to perform corresponding business operations, such as displaying UI, displaying VIP audience entry, etc.

In scenarios with different scales of users, different solutions need to be adopted for implementation.

  • When the number of users simultaneously online in the room is less than 500: use onRoomUserUpdate to listen to user login/exit.

  • When the number of users simultaneously online in the room is greater than 500: it is recommended that developers maintain the user list information themselves or consult ZEGOCLOUD Technical Support for further understanding.

The following introduces the solution implemented using onRoomUserUpdate.

Solution

When a user logs in to the room, set isUserStatusNotify in the ZegoRoomConfig settings in the login interface to "true" (the default value is "false"). After setting, all users in the room will receive messages about the user logging in/exiting the room.

Note

Each user needs to set isUserStatusNotify to "true" when logging in.

When using this solution, there are certain usage restrictions. The specific restrictions are as follows:

  • By default, the total QPS of all users logging in to each room is 200, which means a maximum of 200 users can log in to the same room per second.

  • When the number of people in the room exceeds 500, some users' notifications of joining/exiting the room (onRoomUserUpdate) cannot be received normally. It is recommended that developers maintain a list of room users on their own business server:

    • The first 500 people will not be able to receive notifications of users beyond 500 joining/exiting the room;
    • Users beyond 500 cannot receive notifications of any users joining/exiting the room (the first 500 can receive notifications from each other normally).
Note

If you need to increase the limit, please contact ZEGOCLOUD Technical Support to apply for evaluation.

Previous

Why do some files fail to transcode?

Next

After OBS publishes a stream, the iOS mini program has no audio when pulling the stream. What should I do?

On this page

Back to top