Adjusts the layout parameters based on the provided options.

This method calculates the layout dimensions and updates the main window size based on the current event type, the number of participants, and whether screen sharing is active. It also manages the state transitions to ensure that the UI reflects the correct configuration based on user interactions.

The options for readjusting the layout.

The number of participants or elements.

The current state of the layout.

The parameters for the layout adjustment.

Function to get updated parameters.

The type of event (e.g., "broadcast", "chat", "conference").

Indicates if screen sharing has started.

Indicates if content is being shared.

The main height and width value.

The previous main height and width value.

The label for the host.

Indicates if it is the first round.

Indicates if the screen is locked.

Function to update the main height and width.

Function to prepopulate user media.

A promise that resolves when the layout adjustment is complete.

Throws an error if there is an issue updating the grid sizes.

const options = {
n: 5,
state: 0,
parameters: {
getUpdatedAllParams: () => updatedParams,
eventType: 'conference',
shareScreenStarted: false,
shared: false,
mainHeightWidth: 100,
prevMainHeightWidth: 100,
hostLabel: 'Host Name',
first_round: false,
lock_screen: false,
updateMainHeightWidth: (value) => { console.log(updated) },
prepopulateUserMedia: async ({ name, parameters }) => { },
},
};

await readjust(options);

Constructors

Methods

Constructors

Methods

  • Adjusts the layout parameters based on the provided options.

    Parameters

    Returns Promise<void>

    A promise that resolves when the layout adjustment is complete.

    Throws an error if there is an issue updating the grid sizes.