Skip to main content
Version: 0.1.x

Start and Stop - React Native

This guide will provide an overview of how to implement start and stop Meeting Recording.

startRecording()

The startRecording() method, accesible from the useMeeting hook, can be used to initiate the recording of a meeting. This method accepts the following three parameters:

  • 1. webhookUrl (optional): This is the webhook URL where you can listen to events related to the recording, such as the start and stop of recording. It triggers when the recording is completed and stored on the server. You can learn more about webhooks here

  • 2. awsDirPath (optional): This parameter specifies the path to your S3 bucket where you intend to store the recordings. To enable the storage of recordings in your S3 bucket with VideoSDK, follow this guide (VideoSDK Cloud (AWS S3, Azure Blob or GCP ) Integration)

  • 3. config (optional): This parameter defines how the recording should be conducted

  • 4. transcription (optional): This parameter lets you start post transcription for the recording.

    caution

    If you don't have a value for webhookUrl or awsDirPath and wish to utilize the config property, you should pass null in place of the missing values. Failing to do so may result in the configuration not being applied to the recording.

    const config = {
    // Layout Configuration
    layout: {
    type: "GRID", // "SPOTLIGHT" | "SIDEBAR", Default : "GRID"
    priority: "SPEAKER", // "PIN", Default : "SPEAKER"
    gridSize: 4, // MAX : 4
    },

    // Theme of recording
    theme: "DARK", // "LIGHT" | "DEFAULT"

    // `mode` is used to either record video & audio both or only audio.
    mode: "video-and-audio", // "audio", Default : "video-and-audio"

    // Quality of recording and is only applicable to `video-and-audio` type mode.
    quality: "high", // "low" | "med", Default : "med"

    // This mode refers to orientation of recording.
    // landscape : Record the meeting in horizontally
    // portrait : Record the meeting in vertically (Best for mobile view)
    orientation: "portrait", // "portrait", Default : "landscape"
    };

    // Post Transcription Configuration
    const transcription = {
    enabled: true, // Enables post transcription
    summary: {
    enabled: true, // Enables summary generation

    // Guides summary generation
    prompt:
    "Write summary in sections like Title, Agenda, Speakers, Action Items, Outlines, Notes and Summary",
    },
    };

    startRecording(null, null, config, transcription);

stopRecording()

The stopRecording() method, accesible from the useMeeting hook, is used to stop the recording of a meeting.

Example

import { useMeeting } from "@videosdk.live/react-native-sdk";
import { TouchableOpacity, Text } from "react-native";

const MeetingView = () => {
const { startRecording, stopRecording } = useMeeting();

const handleStartRecording = () => {
// Configuration for recording
const config = {
layout: {
type: "GRID",
priority: "SPEAKER",
gridSize: 4,
},
theme: "DARK",
mode: "video-and-audio",
quality: "high",
orientation: "landscape",
};

// Configuration for post transcription
let transcription = {
enabled: true,
summary: {
enabled: true,
prompt:
"Write summary in sections like Title, Agenda, Speakers, Action Items, Outlines, Notes and Summary",
},
};

// Start Recording
// If you don't have a `webhookUrl` or `awsDirPath`, you should pass null.
startRecording(
"YOUR WEB HOOK URL",
"AWS Directory Path",
config,
transcription
);
};

const handleStopRecording = () => {
// Stop Recording
stopRecording();
};

return (
<>
<TouchableOpacity
onPress={() => {
handleStartRecording();
}}
>
<Text>Start Recording</Text>
</TouchableOpacity>

<TouchableOpacity
onPress={() => {
handleStopRecording();
}}
>
<Text>Stop Recording</Text>
</TouchableOpacity>
</>
);
};
important

To initiate automatic recording at the beginning of a session, simply provide the autoStartConfig feature recording during room creation. For more information on configuring the autoStartConfig, please refer to the provided documentation here.

API Reference

The API references for all the methods utilised in this guide are provided below.

Got a Question? Ask us on discord