prepopulate User Media
Populates the main media grid state based on the media activity of the participant.
This function determines the primary display based on the event type and parameters such as the host, shared screens, or active video streams, updating the main media grid state accordingly.
Key Responsibilities:
Determines which participant should be displayed on the main screen
Updates main screen state (filled, person, admin status)
Handles screen sharing and whiteboard scenarios
Manages main screen height/width based on event type
Logic Flow:
Participant Lookup: Finds the participant by name
Event Type Handling:
Conference: Manages admin/host display
Webinar: Handles host-specific display logic
Broadcast/Chat: Similar to conference with variations
Screen Sharing: Adjusts display for shared screens or whiteboard
State Updates: Updates main screen person, filled status, and dimensions
Component Building: Builds and emits VideoCard/AudioCard/MiniCard to mainGridStream
Example Usage:
val options = PrepopulateUserMediaOptions(
name = "Host",
parameters = mediaParameters
)
prepopulateUserMedia(options)Parameters
The options containing participant name and parameters