Start and Stop - Javascript
This guide will provide an overview of how to implement start and stop Meeting Recording.
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.cautionIf you don't have a value for
webhookUrl
orawsDirPath
and wish to utilize theconfig
property, you should passnull
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 themeeting
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();
});
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 utilized in this guide are provided below.
Got a Question? Ask us on discord