React Native 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 { View, Text } from "react-native";
    import { WebView } from "react-native-webview";
    import { useWhiteboard } from "@videosdk.live/react-native-sdk";

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

    if (!whiteboardUrl) {
    return (
    <View style={{ flex: 1, alignItems: "center", justifyContent: "center" }}>
    <Text>No active whiteboard session</Text>
    </View>
    );
    }

    return (
    <View style={{ flex: 1 }}>
    <WebView source={{ uri: whiteboardUrl }} style={{ flex: 1 }} />
    </View>
    );
    }

    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-native-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-native-sdk";

      const { stopWhiteboard } = useWhiteboard();

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

      run();