Skip to main content
Version: 3.x.x

Recording Events - Android

The onRecordingStateChanged event tells you the current state of recording for the room.

onRecordingStateChanged​

  • This event will be triggered when the room's recording status changes.
  • Override it in a RoomEventListener and register the listener with room.addEventListener().
  • startRecording() returns before the recording has started. Wait for RECORDING_STARTED in this event.
  • state is a RecordingState: RECORDING_STARTING, RECORDING_STARTED, RECORDING_STOPPING or RECORDING_STOPPED. Compare it with these values, not with strings. A state outside them is not delivered.
  • room.recordingState holds the latest one. It is RECORDING_STOPPED until the first event, and is reset when the room is left.

Example​

Here is the usage of the event mentioned in this page.

private val roomEventListener: RoomEventListener = object : RoomEventListener() {
override fun onRecordingStateChanged(state: RecordingState) {
when (state) {
RecordingState.RECORDING_STARTING -> {
Log.d("onRecordingStateChanged", "Room recording is starting")
}
RecordingState.RECORDING_STARTED -> {
Log.d("onRecordingStateChanged", "Room recording is started")
}
RecordingState.RECORDING_STOPPING -> {
Log.d("onRecordingStateChanged", "Room recording is stopping")
}
RecordingState.RECORDING_STOPPED -> {
Log.d("onRecordingStateChanged", "Room recording is stopped")
}
}
}
}

override fun onCreate(savedInstanceState: Bundle?) {
//...

// add listener to room
room!!.addEventListener(roomEventListener)
}

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