• 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.

    const options = {
    videoPreference: "user",
    checkoff: false,
    parameters: {
    audioOnlyRoom: false,
    frameRate: 30,
    vidCons: { width: 640, height: 480 },
    showAlert: showNotification,
    mediaDevices: navigator.mediaDevices,
    hasCameraPermission: true,
    updateVideoSwitching: updateVideoSwitchingState,
    updateCurrentFacingMode: updateCurrentFacingMode,
    requestPermissionCamera: requestCameraPermission,
    streamSuccessVideo: streamSuccessVideoFunction,
    sleep: sleepFunction,
    checkMediaPermission: true,
    getUpdatedAllParams: getUpdatedAllParamsFunction,
    },
    };

    switchUserVideoAlt(options)
    .then(() => {
    console.log("Video switched successfully");
    })
    .catch((error) => {
    console.error("Error switching video:", error);
    });