reorderStreams

Reorders video streams based on the provided parameters and options.

This function manages the reordering of video streams in a meeting interface, handling additions, removals, and screen changes. It updates the stream lists and triggers necessary UI updates.

Features:

  • Stream reordering and management

  • Screen sharing stream handling

  • Admin stream prioritization

  • Active sounds management

  • UI update triggering

  • Error handling

Matches React/Flutter behavior 100%:

  • Admin name is only set when using oldAdminStream

  • Screen share streams are properly filtered

  • youyou streams are added with duplicate checks

Parameters:

  • options Configuration options for reordering streams

Returns:

Example Usage:

val options = ReorderStreamsOptions(
add = true,
screenChanged = false,
parameters = myParameters,
streams = myStreams
)

val result = reorderStreams(options)
result.onSuccess {
}
result.onFailure { error ->
Logger.e("ReorderStreams", "Error reordering streams: ${error.message}")
}