Class SwitchUserVideo

Switches the user's video input device based on the provided options.

This method checks permissions, enumerates available devices, and updates the video stream based on user preferences. It also manages UI updates and alerts.

The options for switching the user's video.

The preferred video input device ID.

Flag indicating whether to turn off the video.

Additional parameters required for switching the video.

Indicates if the room is audio-only.

The desired frame rate for the video.

Video constraints such as width and height.

The previous video input device ID.

Function to show alerts to the user.

Indicates if the user has camera permission.

Function to update video switching state.

Function to update the default video input device.

Function to request camera permission.

Function to handle successful video stream.

Function to pause execution for a specified duration.

Function to check media permissions.

A promise that resolves when the video input device has been successfully switched.

Throws an error if switching the video input device fails.

await switchUserVideo({
videoPreference: 'user',
checkoff: false,
parameters: {
audioOnlyRoom: false,
frameRate: 30,
vidCons: { width: 1280, height: 720 },
prevVideoInputDevice: 'device-id',
showAlert: myShowAlertFunction,
hasCameraPermission: true,
updateVideoSwitching: myUpdateFunction,
updateUserDefaultVideoInputDevice: myUpdateFunction,
requestPermissionCamera: myRequestPermissionFunction,
streamSuccessVideo: myStreamSuccessFunction,
sleep: mySleepFunction,
checkMediaPermission: true,
},
});

Constructors

Methods

Constructors

Methods

  • Switches the user's video input device based on the provided options.

    Parameters

    • options: {
          videoPreference: string;
          checkoff: boolean;
          parameters: any;
      }

      The options for switching the user's video.

      • videoPreference: string

        The preferred video input device ID.

      • checkoff: boolean

        Flag indicating whether to turn off the video.

      • parameters: any

        Additional parameters required for switching the video.

    Returns Promise<void>

    A promise that resolves when the video input device has been switched.

    Will throw an error if switching the video input device fails.

MMNEPVFCICPMFPCPTTAAATR