modify Settings
Modifies settings for a given room and updates the state accordingly.
options: Options for modifying settings, including:showAlert: Function to show alert messages (optional).roomName: The name of the room.audioSet: The audio setting to be applied.videoSet: The video setting to be applied.screenshareSet: The screenshare setting to be applied.chatSet: The chat setting to be applied.socket: The socket instance for emitting events.updateAudioSetting: Function to update the audio setting state.updateVideoSetting: Function to update the video setting state.updateScreenshareSetting: Function to update the screenshare setting state.updateChatSetting: Function to update the chat setting state.updateIsSettingsModalVisible: Function to update the visibility of the settings modal.
Throws an alert if any setting is set to "approval" in demo mode (room name starts with "d").
Example usage:
modifySettings(
ModifySettingsOptions(
roomName = "d123",
audioSet = "allow",
videoSet = "allow",
screenshareSet = "deny",
chatSet = "allow",
socket = mySocketInstance,
updateAudioSetting = setAudioSetting,
updateVideoSetting = setVideoSetting,
updateScreenshareSetting = setScreenshareSetting,
updateChatSetting = setChatSetting,
updateIsSettingsModalVisible = setIsSettingsModalVisible,
showAlert = { options -> alertUser(options) }
)
)