closeAndResize

Manages the closing and resizing of streams within a media session, adapting the layout and updating participant and stream information as needed.

Operations by Stream Type:

  • Audio Stream: Removes audio stream, updates active names, triggers reordering

  • Video Stream: Removes video from active and limited streams, updates main window

  • Screenshare: Stops screen sharing, restores deferred video, triggers reordering

Workflow:

  1. Stream Identification: Finds the stream by producerId

  2. Stream Removal: Removes from appropriate stream lists

  3. State Updates: Updates relevant state flags and lists

  4. UI Refresh: Triggers reordering and main window updates

Parameters

options

Options containing producer ID, media kind, and parameters

Example:

val options = CloseAndResizeOptions(
producerId = "producer-123",
kind = "video",
parameters = closeResizeParams
)

closeAndResize(options)