consumerResume

Handles the resumption of a media stream (either audio or video) by managing the socket connections, updating the UI, and reordering streams as necessary.

This function performs comprehensive handling of media streams by leveraging socket connections, organizing UI components, and performing real-time updates to the video and audio grids.

Audio Resumption:

  • Adds the resumed audio to the list of active audio streams

  • Updates the UI with an audio-only component (MiniAudioPlayer equivalent)

  • Triggers a reordering of streams if required

  • Manages screen sharing state detection

  • Handles host label filtering

Video Resumption:

  • Adds the resumed video to the list of active video streams

  • Manages screen sharing updates (if applicable)

  • Reorders streams based on the screen sharing state or participant role

  • Handles admin video stream filtering

  • Manages lock screen and defer receive states

Workflow:

  1. Stream Type Detection: Determines if audio or video

  2. Participant Lookup: Finds the participant associated with the stream

  3. Screen Share Detection: Checks for active screen sharing

  4. Stream Management: Adds stream to appropriate lists

  5. UI Updates: Triggers UI component updates

  6. Stream Reordering: Calls reorderStreams as needed

  7. State Updates: Updates various state flags

Parameters

options

Options containing the stream details and parameters

Example:

val options = ConsumerResumeOptions(
stream = myMediaStream,
consumer = myConsumer,
kind = "audio",
remoteProducerId = "producerId123",
parameters = consumerResumeParams,
nsock = socket
)

consumerResume(options)

Note:

This implementation matches the Flutter SDK logic 100%. Platform-specific parts (like MiniAudioPlayer widget) are represented as placeholders that can be implemented per platform.