Function to update the visibility of the media settings modal.
Param: options.parameters.showAlert
Optional function to show alert messages.
Param: options.parameters.switchUserVideoAlt
Function to switch the user's video input.
Returns
A promise that resolves when the video input has been switched.
Remarks
This function checks if the user is allowed to switch the video input based on the current state,
and it shows alerts if there are any issues. If the video is already on, it cannot be switched until
it is turned off, and vice versa. The facing mode of the camera is toggled between "user" and "environment".
Example
constoptions: SwitchVideoAltOptions = { parameters: { recordStarted:false, recordResumed:false, recordStopped:false, recordPaused:false, recordingMediaOptions:'video', videoAlreadyOn:true, currentFacingMode:'user', allowed:true, audioOnlyRoom:false, updateCurrentFacingMode: (mode) =>console.log(`Facing mode updated to: ${mode}`), updateIsMediaSettingsModalVisible: (isVisible) =>console.log(`Media settings modal is now ${isVisible?'visible':'hidden'}`), switchUserVideoAlt:async ({ videoPreference }) =>console.log(`Switched video to: ${videoPreference}`), getUpdatedAllParams: () => ({ }), }, };
Switches the video input based on user preference and current state.
Param: options
The options for switching the video input.
Param: options.parameters
The parameters required for switching the video input.
Param: options.parameters.recordStarted
Indicates if recording has started.
Param: options.parameters.recordResumed
Indicates if recording has resumed.
Param: options.parameters.recordStopped
Indicates if recording has stopped.
Param: options.parameters.recordPaused
Indicates if recording is paused.
Param: options.parameters.recordingMediaOptions
The current media options (e.g., "video").
Param: options.parameters.videoAlreadyOn
Indicates if the video is currently on.
Param: options.parameters.currentFacingMode
The current facing mode of the camera (e.g., "environment").
Param: options.parameters.allowed
Indicates if the user is allowed to switch video.
Param: options.parameters.audioOnlyRoom
Indicates if the current room is audio-only.
Param: options.parameters.updateCurrentFacingMode
Function to update the current facing mode.
Param: options.parameters.updateIsMediaSettingsModalVisible
Function to update the visibility of the media settings modal.
Param: options.parameters.showAlert
Optional function to show alert messages.
Param: options.parameters.switchUserVideoAlt
Function to switch the user's video input.
Returns
A promise that resolves when the video input has been switched.
Remarks
This function checks if the user is allowed to switch the video input based on the current state, and it shows alerts if there are any issues. If the video is already on, it cannot be switched until it is turned off, and vice versa. The facing mode of the camera is toggled between "user" and "environment".
Example