Class SwitchUserVideoAlt

Switches the user's video stream based on the provided video preference and other parameters.

This method manages the process of switching the user's video input device, checking permissions, and updating the relevant application state. If the specified device is not accessible, it attempts to find an alternative.

The options for switching the user's video.

The preferred video input device ID.

A flag indicating whether to turn off the video before switching.

The parameters required for switching the video.

Function to show alert messages to the user.

Flag indicating if the user has granted camera permission.

Function to update the video switching state.

Function to request camera permission from the user.

Function to check if media permissions are granted.

A promise that resolves when the video switching is complete.

Will throw an error if the audio input device cannot be accessed or if there is an unexpected error.

await switchUserVideoAlt({
videoPreference: 'user',
checkoff: false,
parameters: {
hasCameraPermission: true,
updateVideoSwitching: (state) => { /* update state */ },
// other parameters...
},
});

Constructors

Methods

Constructors

Methods

  • Switches the user's video stream based on the provided video preference and other parameters.

    Parameters

    Returns Promise<void>

    A promise that resolves when the video switching is complete.

    Will throw an error if there is an issue with switching the video.