Zoom Video SDK for React - v0.0.2
    Preparing search index...

    Function useVideoState

    • Hook to access and manage video state

      This hook provides video state management including:

      • Current video capture status
      • Toggle video on/off functionality
      • Set video state explicitly
      • Automatic state synchronization with Zoom Video SDK

      Returns {
          isVideoOn: boolean;
          setVideo: (
              videoStateArg: boolean,
              videoOptions?: CaptureVideoOption,
          ) => Promise<void>;
          toggleVideo: (videoOptions?: CaptureVideoOption) => Promise<void>;
      }

      Object containing video state and control functions

      const { isVideoOn, toggleVideo, setVideo } = useVideoState();

      return (
      <div>
      <button onClick={() => toggleVideo({ fps: 30 })}>
      {isVideoOn ? 'Turn Off Video' : 'Turn On Video'}
      </button>
      <button onClick={() => setVideo(true, { fps: 15 })}>
      Force Video On
      </button>
      </div>
      );