Skip to main content
Version: 3.x.x

Handle Large Rooms - Android

Managing large rooms requires specific strategies to keep performance and stability. This section provides best practices for optimizing VideoSDK applications to handle high participant volumes effectively. By implementing these recommendations, you can reduce lag and maintain video and audio quality in large rooms.

User Interface Optimization​

When hosting large rooms, an optimized UI helps manage participant visibility.

Recommended Practices:

  • Limit Visible Participants: Display only a limited number of participants on screen at any given time, adapting the view based on screen size. Use pagination to allow users to browse or switch between additional participants. For example, you could display only users whose video stream is enabled, or you could choose to display all active speakers. This approach helps manage screen space efficiently, ensuring that the most relevant participants are visible without overwhelming the interface.
  • Prioritize Active Speakers: Ensure all active speakers are displayed on the screen to highlight who is currently talking, helping participants stay engaged and aware of ongoing discussions. To identify which participant is speaking, you can use the onSpeakerChanged() event.

Optimizing Media Streams​

In large video calls, it’s important to manage media streams effectively to optimize system resources.

Recommended Practices:

  • Receive Only the Media You Show: Pass autoConsume = false to createRoom(). A participant's mic and webcam are then not received until you call consumeMicStreams() or consumeWebcamStreams() on that participant, for example from onParticipantJoined(), and again from onMediaStatusChanged() when they turn their media on. Call stopConsumingWebcamStreams() when a participant's tile leaves the screen. These are suspend functions, so call them from a coroutine. See Selective Subscription for a full example.
  • Pause Streams for Non-Visible Participants: To optimize performance, pause the video and/or audio streams of participants who are not currently visible on the screen. This reduces unnecessary resource consumption.
  • Resume Streams When Visible: Once a participant comes into view, resume their stream to provide an uninterrupted experience as they appear on the screen.

For detailed setup instructions on pausing and resuming streams, check out our in-depth documentation here.

Media Stream Quality Adjustment​

In large rooms, managing media stream quality is essential to balance performance and user experience.

Recommended Practices:

  • High Quality for Active Speakers: For all active speakers, set the video stream quality to a higher level using the setQuality method (e.g., setQuality(VideoQuality.HIGH)). This ensures that participants will receive higher-quality video for active speakers, providing a clearer and more engaging experience.
  • Lower Quality for Non-Speaking Participants: For other participants who are not actively speaking, set their video stream quality to a lower level (e.g., setQuality(VideoQuality.LOW)). This helps conserve bandwidth and system resources while maintaining overall room performance.
  • Lower the Quality You Send When No One Watches: Pass dynaCast = true to createRoom(). The server then lowers the quality of the webcam stream you send while no one is watching its larger layers, and raises it again when someone is. It only works when the webcam sends multiple layers: multiStream on and the VP8 codec.

setQuality() is a suspend function, so call it from a coroutine. It takes a VideoQuality: HIGH, MEDIUM or LOW. It does nothing on the local participant, or when the value already matches the participant's videoQuality.

Check out the documentation for the setQuality() method here

Got a Question? Ask us on discord