Skip to main content
Version: 2.x.x

Recording Events - React Native

VideoSDK provides the onRecordingStateChanged() event, which notifies you of the current state of recording for the room.

onRecordingStateChanged()​

  • This event is triggered when the recording state of the room changes.
  • It can be subscribed to using the useRoom hook.

Example​

Here is an example demonstrating the usage of the event mentioned on this page.

import { Constants, useRoom } from "@videosdk.live/react-native-sdk";

function onRecordingStateChanged(data) {
const { state } = data;

if (state === Constants.recordingEvents.RECORDING_STARTING) {
console.log("Room Recording is starting");
} else if (state === Constants.recordingEvents.RECORDING_STARTED) {
console.log("Room Recording is started");
} else if (state === Constants.recordingEvents.RECORDING_STOPPING) {
console.log("Room Recording is stopping");
} else if (state === Constants.recordingEvents.RECORDING_STOPPED) {
console.log("Room Recording is stopped");
} else {
//
}
}

const { roomId } = useRoom({
onRecordingStateChanged,
});

API Reference​

The API references for all the methods and events utilised in this guide are provided below.

Got a Question? Ask us on discord