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); Copy
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);
Modifies the settings for a given room and updates the state accordingly.
Param: options
The options for modifying settings.
Param: options.showAlert
Function to show alert messages.
Param: options.roomName
The name of the room.
Param: options.audioSet
The audio setting to be applied.
Param: options.videoSet
The video setting to be applied.
Param: options.screenshareSet
The screenshare setting to be applied.
Param: options.chatSet
The chat setting to be applied.
Param: options.socket
The socket instance for emitting events.
Param: options.updateAudioSetting
Function to update the audio setting state.
Param: options.updateVideoSetting
Function to update the video setting state.
Param: options.updateScreenshareSetting
Function to update the screenshare setting state.
Param: options.updateChatSetting
Function to update the chat setting state.
Param: options.updateIsSettingsModalVisible
Function to update the visibility of the settings modal.
Returns
A promise that resolves when the settings have been modified.
Throws
Will show an alert if any setting is set to "approval" in demo mode (room name starts with "d").
Example