React Api Reference
    Preparing search index...

    Class useWhiteboard

    useWhiteboard provides APIs to start, stop, and access a collaborative whiteboard session within a meeting.

    Index

    Constructors

    Properties

    whiteboardUrl: string
    • This represents the URL of the current whiteboard session.

    Value:

    • null when no whiteboard session is active.
    • A valid URL string after startWhiteboard() has been called.
    import React from "react";
    import { useWhiteboard } from "@videosdk.live/react-sdk";

    function WhiteboardComponent() {
    const { whiteboardUrl } = useWhiteboard();

    return (
    <div>
    {whiteboardUrl && (
    <iframe src={whiteboardUrl} width="800" height="600"></iframe>
    )}
    </div>
    );
    }

    export default WhiteboardComponent;

    Methods

      • This method can be used to start a whiteboard session for all participants and generates a whiteboardUrl for rendering the whiteboard.

      Returns Promise<void>

      import { useWhiteboard } from "@videosdk.live/react-sdk";

      const { startWhiteboard } = useWhiteboard();

      const run = async () => {
      await startWhiteboard();
      };

      run();
      • This method can be used to stop the active whiteboard session for all participants.

      Returns Promise<void>

      import { useWhiteboard } from "@videosdk.live/react-sdk";

      const { stopWhiteboard } = useWhiteboard();

      const run = async () => {
      await stopWhiteboard();
      };

      run();