The options for switching the user's video.
A promise that resolves when the video switching is complete.
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);
});
Switches the user's video stream based on the provided video preference and other parameters.