prepopulateUserMedia

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:

  1. Participant Lookup: Finds the participant by name

  2. Event Type Handling:

    • Conference: Manages admin/host display

    • Webinar: Handles host-specific display logic

    • Broadcast/Chat: Similar to conference with variations

  3. Screen Sharing: Adjusts display for shared screens or whiteboard

  4. State Updates: Updates main screen person, filled status, and dimensions

  5. Component Building: Builds and emits VideoCard/AudioCard/MiniCard to mainGridStream

Example Usage:

val options = PrepopulateUserMediaOptions(
name = "Host",
parameters = mediaParameters
)

prepopulateUserMedia(options)

Parameters

options

The options containing participant name and parameters