Class ModifySettings

Modifies the settings for a given room and updates the state accordingly.

The options for modifying settings.

Function to show alert messages.

The name of the room.

The audio setting to be applied.

The video setting to be applied.

The screenshare setting to be applied.

The chat setting to be applied.

The socket instance for emitting events.

Function to update the audio setting state.

Function to update the video setting state.

Function to update the screenshare setting state.

Function to update the chat setting state.

Function to update the visibility of the settings modal.

A promise that resolves when the settings have been modified.

Will show an alert if any setting is set to "approval" in demo mode (room name starts with "d").

const options: ModifySettingsOptions = {
showAlert: (alert) => console.log(alert),
roomName: 'exampleRoom',
audioSet: 'enabled',
videoSet: 'disabled',
screenshareSet: 'approval',
chatSet: 'enabled',
socket: socketInstance,
updateAudioSetting: (audio) => console.log('Audio setting updated:', audio),
updateVideoSetting: (video) => console.log('Video setting updated:', video),
updateScreenshareSetting: (screenshare) => console.log('Screenshare setting updated:', screenshare),
updateChatSetting: (chat) => console.log('Chat setting updated:', chat),
updateIsSettingsModalVisible: (visible) => console.log('Settings modal visibility:', visible),
};

const modifySettingsService = new ModifySettings();
await modifySettingsService.modifySettings(options);

Constructors

Methods

Constructors

Methods

  • Modifies the settings for a given room and updates the state accordingly.

    Parameters

    Returns Promise<void>

    A promise that resolves when the settings have been modified.

    Will show an alert if any setting is set to "approval" in demo mode (room name starts with "d").