consumer Resume
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:
Stream Type Detection: Determines if audio or video
Participant Lookup: Finds the participant associated with the stream
Screen Share Detection: Checks for active screen sharing
Stream Management: Adds stream to appropriate lists
UI Updates: Triggers UI component updates
Stream Reordering: Calls reorderStreams as needed
State Updates: Updates various state flags
Parameters
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.