Record Conference
Recording a conference in Twyng is facilitated through a cloud-based web page recording system. When you initiate recording, a recording task starts in the background. This task may take around 10 to 20 seconds to spin up. You can begin recording after the task has spun up.
Initiate a Recording:
To start recording, you need to pass two additional values in the join method of Twyng.
-
record: A boolean value indicating whether recording is needed for the current conference or session. If true, it initiates the spin-up of the recording task in the background. Subsequent calls to join with
record: truewill be ignored if the task is already spinning up. -
recordUrl: A URL pointing to a web application for the same conference, developed using the Twyng SDK. This URL is usually similar to the actual application URL but may include some modifications specific to recording.
const conferenceJoinInfo = {
roomId: "global-education",
userId: "student-01",
name: "Jhon Thomas",
attributes: {
rollNo: 21,
division: "12 B",
subject: "Computer science",
},
record: true,
recordUrl: `https://twyng.com/record/global-education`,
};
const response = await twyng.join(conferenceJoinInfo);
Manage Recording
Once the recording task has spun up, you can manage the recording process using the recorder instance provided by the SDK. The recorder instance includes methods for starting and stopping the recording.
Starting a Recording:
To start recording, use the start method on the recorder instance. If the task has not started yet, the call will wait until the task is ready to begin recording.
let response = await twyng.recorder.start();
console.log(response);
Stoping a Recording:
To stop the recording, use the stop method on the recorder instance. This will terminate the ongoing recording session.
let response = await twyng.recorder.stop();
console.log(response);
Events
- ON_RECORDING_WORKER_READY:Indicates that the recording task is ready to start.
- ON_RECORDING_INTERRUPTED: Triggered when the recording process is interrupted.
- ON_RECORDING_STARTED: Fired when the recording has successfully started.
- ON_RECORDING_STOPPED: Signals when the recording has been stopped.
ON_RECORDING_WORKER_READY
twyng.on(Twyng.ON_RECORDING_WORKER_READY, (info) => {
console.log('ON_RECORDING_WORKER_READY:', info);
});
ON_RECORDING_INTERRUPTED
twyng.on(Twyng.ON_RECORDING_INTERRUPTED, (info) => {
console.log('ON_RECORDING_INTERRUPTED:', info);
});
ON_RECORDING_STARTED
twyng.on(Twyng.ON_RECORDING_STARTED, (info) => {
console.log('ON_RECORDING_STARTED:', info);
});
ON_RECORDING_STOPPED
twyng.on(Twyng.ON_RECORDING_STOPPED, (info) => {
console.log('ON_RECORDING_STOPPED:', info);
});