Recording Events - React
VideoSDK provides the onRecordingStateChanged()
event, which notifies you of the current state of recording for the meeting.
onRecordingStateChanged()
- This event is triggered when the recording status of the meeting changes.
- It can be subscribed to using the
useMeeting
hook.
Example
Here is an example demonstrating the usage of the event mentioned on this page.
import { Constants, useMeeting } from "@videosdk.live/react-sdk";
function onRecordingStateChanged(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 {
//
}
}
const {
meetingId
...
} = useMeeting({
onRecordingStateChanged,
...
});
API Reference
The API references for all the methods and events utilized in this guide are provided below.
Got a Question? Ask us on discord