Skip to main content

Recording

The meeting.recording object can be used start and stop recordings in a meeting. You can also get the current status of a recording using this API.

The meeting.recording object has the following properties:

List recordings

Retrieve a list of active recordings along with their current status.

const recordings = meeting.recording.recordings;

it returns list of recording ids and their state

[
{
id: '<recording-id>',
state: '<recording-state>',
},
];

The recording states include IDLE, STARTING, RECORDING, PAUSED, and STOPPING.

Start a recording

Initiate a recording using the start method.

await meeting.recording.start();

To enable multiple parallel recordings, the first recording must be started with the option { allowMultiple: true }.

await meeting.recording.start({ allowMultiple: true });

Subsequent recordings can then be initiated while the first is still running.

Stop a recording

End an active recording with the stop method.

await meeting.recording.stop();

To stop a specific recording, provide the recording ID:

await meeting.recording.stop(recordingId);

Omitting the recording ID will stop all recordings in RECORDING or PAUSED state.

Pause a recording

Temporarily halt a recording using the pause method.

await meeting.recording.pause();

To pause a specific recording, include the recording ID:

await meeting.recording.pause(recordingId);

Without a recording ID, all recordings in the RECORDING state will be paused.

Resume a recording

Restart a paused recording with the resume method.

await meeting.recording.resume();

For resuming a specific recording, pass the recording ID:

await meeting.recording.resume(recordingId);

If no recording ID is specified, all recordings in the PAUSED state will be resumed.

Recording Configuration

You can set the defaults for recording during initialization

const meeting = await DyteClient.init({
authToken,
defaults: {
recording: recordingConfig,
},
});

In recording config you can specify height, width and codec of the recording output. You can also customize the recording file name prefix.

interface RecordingConfig {
videoConfig?: {
height?: number;
width?: number;
codec?: 'H264' | 'VP8';
};
fileNamePrefix?: string;
}

videoConfig

  1. codec - Codec using which the recording will be encoded. H264 will use a mp4 container, VP8 will use a webm container

    Allowed values: H264 | VP8

    Default: H264

  2. width - Width of the recording video in pixels Allowed values: 1 >= width <= 1920

    Default: 1280

  3. height - Height of the recording video in pixels Allowed values: 1 >= height <= 1920

    Default: 720

fileNamePrefix

You can customize the file name generated by Dyte recorder. All recordings for the meeting will start with the prefix provided here. It is equivalent of file_name_prefix in our start recording API

Check active recording state

The meeting.recording.recordingState property describes the current state of the recording. The valid states are IDLE, STARTING, RECORDING, PAUSED and STOPPING.