Skip to main content
Version: 0.0.x

Record Meeting - Javascript

VideoSDK enables you to record video and audio during meetings, and you can access the recorded files in the developer dashboard or opt to store them in your own cloud storage.

Additionally, VideoSDK offers flexibility in configuring recording layouts. You can achieve this by selecting various prebuilt layouts in the configuration or by providing your own custom template for recording, tailored to your layout preferences.

This guide provides an overview of implementing the start and stop functionality for meeting recording.

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.

startRecording()

The startRecording() method, accesible from the meeting object, is used to initiate the recording of a meeting. This method accepts the following four 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.

    // URL for webhook
    const webhookUrl = "https://example.com";

    // directory path to store recording
    const awsDirPath = "path/to/file";

    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: "landscape", // "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",
    },
    };

stopRecording()

  • The stopRecording() method, accessible from the meeting object, is used to stop the recording of a meeting.

Example

let meeting;

// Initialize Meeting
meeting = VideoSDK.initMeeting({
// ...
});

const startRecordingBtn = document.getElementById("startRecordingBtn");
startRecordingBtn.addEventListener("click", () => {
// Configuration for recording
let 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
meeting?.startRecording(
"YOUR WEB HOOK URL",
"AWS Directory Path",
config,
transcription
);
});

const stopRecordingBtn = document.getElementById("stopRecordingBtn");
stopRecordingBtn.addEventListener("click", () => {
// Stop Recording
meeting?.stopRecording();
});

Events associated with Recording

  • onRecordingStateChanged - The recording-state-changed event is triggered whenever the state of meeting recording changes.
let meeting;

// Initialize Meeting
meeting = VideoSDK.initMeeting({
// ...
});

const Constants = VideoSDK.Constants;

meeting.on("recording-state-changed", (data) => {
const { status } = data;

if (status === Constants.recordingEvents.RECORDING_STARTING) {
console.log("Meeting recording is starting");
} else if (status === Constants.recordingEvents.RECORDING_STARTED) {
console.log("Meeting recording is started");
} else if (status === Constants.recordingEvents.RECORDING_STOPPING) {
console.log("Meeting recording is stopping");
} else if (status === Constants.recordingEvents.RECORDING_STOPPED) {
console.log("Meeting recording is stopped");
} else {
//
}
});
important

You can access your recordings on our Dashboard. Additionally, you can access your recordings using our Recording API.

You can access your post transcriptions using our Post Transcription API

API Reference

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

Got a Question? Ask us on discord