Handles the click event for toggling audio in a media session.
The parameters required for handling the audio click event.
A promise that resolves when the audio click event has been handled.
The function performs the following actions:
The function makes use of several helper functions and state update functions passed in through the parameters.
Handles the click event for toggling audio in a media session.
Param: options
The parameters required for handling the audio click event.
Param: options.parameters
The parameters for toggling audio.
Param: options.parameters.checkMediaPermission
Flag indicating whether to check media permission.
Param: options.parameters.hasAudioPermission
Flag indicating if the user has audio permission.
Param: options.parameters.audioPaused
Flag indicating if audio is paused.
Param: options.parameters.audioAlreadyOn
Flag indicating if audio is already turned on.
Param: options.parameters.audioOnlyRoom
Flag indicating if the room is audio-only.
Param: options.parameters.recordStarted
Flag indicating if recording has started.
Param: options.parameters.recordResumed
Flag indicating if recording has resumed.
Param: options.parameters.recordPaused
Flag indicating if recording is paused.
Param: options.parameters.recordStopped
Flag indicating if recording is stopped.
Param: options.parameters.recordingMediaOptions
Media options for recording (e.g., "video", "audio").
Param: options.parameters.islevel
User's level in the application.
Param: options.parameters.youAreCoHost
Flag indicating if the user is a co-host.
Param: options.parameters.adminRestrictSetting
Flag indicating if admin restrictions are set.
Param: options.parameters.audioRequestState
Current state of the audio request.
Param: options.parameters.audioRequestTime
Timestamp of the audio request.
Param: options.parameters.member
Current member's name.
Param: options.parameters.socket
The socket instance for communication.
Param: options.parameters.localSocket
The local socket instance for communication.
Param: options.parameters.roomName
The name of the room.
Param: options.parameters.userDefaultAudioInputDevice
The default audio input device for the user.
Param: options.parameters.micAction
Flag indicating if the microphone action is in progress.
Param: options.parameters.localStream
The user's local media stream.
Param: options.parameters.audioSetting
Current audio setting.
Param: options.parameters.videoSetting
Current video setting.
Param: options.parameters.screenshareSetting
Current screenshare setting.
Param: options.parameters.chatSetting
Current chat setting.
Param: options.parameters.updateRequestIntervalSeconds
Interval for updating request states.
Param: options.parameters.participants
List of participants in the room.
Param: options.parameters.transportCreated
Flag indicating if the transport has been created.
Param: options.parameters.transportCreatedAudio
Flag indicating if audio transport has been created.
Returns
A promise that resolves when the audio click event has been handled.
Remarks
This function performs the following actions:
Example