changeVids

suspend fun changeVids(options: ChangeVidsOptions)

Changes the video streams on the screen based on the provided options and parameters.

This function adjusts video streams based on conditions like event type, active participants, and screen sharing status. It updates the necessary lists and variables to display the appropriate video streams.

Key Features:

  • Screen Sharing Handling: Adjusts streams when screen sharing is active

  • Participant Filtering: Removes streams without corresponding participants

  • Audio Loudness Sorting: Sorts streams based on audio levels if enabled

  • Event Type Logic: Different behavior for conference, broadcast, chat events

  • Pagination: Creates paginated views of streams

  • Breakout Room Support: Handles streams in breakout rooms

  • Host Prioritization: Ensures host streams are displayed appropriately

  • Mixed Streams: Combines video and audio-only streams

Workflow:

  1. Initialize: Clone all parameter lists to avoid mutation

  2. Screen Share Check: Adjust streams if screen sharing is active

  3. Participant Filtering: Remove streams without participants

  4. Audio Sorting: Sort by loudness if enabled

  5. Stream Classification: Separate into video, audio-only, muted

  6. Host Handling: Special logic for conference host

  7. Stream Compilation: Combine streams based on display type

  8. Pagination: Create paginated views

  9. Breakout Rooms: Handle breakout room streams

  10. Display: Call dispStreams to show the streams

Parameters

options

Options containing screen change flag and parameters

Example:

val options = ChangeVidsOptions(
screenChanged = false,
parameters = changeVidsParams
)

changeVids(options)

Note:

This implementation matches the Flutter SDK logic 100%. It handles all the complex scenarios including screen sharing, breakout rooms, audio loudness sorting, and pagination.