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
RoomEventListenerand register the listener withroom.addEventListener(). startRecording()returns before the recording has started. Wait forRECORDING_STARTEDin this event.stateis aRecordingState:RECORDING_STARTING,RECORDING_STARTED,RECORDING_STOPPINGorRECORDING_STOPPED. Compare it with these values, not with strings. A state outside them is not delivered.room.recordingStateholds the latest one. It isRECORDING_STOPPEDuntil 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

