Callbacks
Event types, callback threading model, idempotency and retry guidance.
Callbacks
Legacy face
IRecordingEngineEventHandler (24 members) is implemented by the host; the defaults are empty bodies, so ignoring a callback is legal. The pipeline raises real events:
| Moment | Callback |
|---|---|
| Session reaches recording | onConnectionStateChanged(CONNECTION_STATE_CONNECTED, CONNECTION_CHANGED_JOIN_SUCCESS) → onJoinChannelSuccess |
| Participant added/removed | onUserJoined / onUserInfoUpdated / onUserOffline |
| While recording | onRecordingStats (real session duration) |
| Normal end | onLeaveChannel(LEAVE_PATH_CODE) |
| Failure | onError(ERROR_CODE_TYPE, STAT_CODE_TYPE) |
4.x face
IAgoraMediaRtcRecorderEventHandler (21 members), registered with registerRecorderEventHandle:
| Moment | Callback |
|---|---|
joinChannel success | onConnected |
| Recording starts | onRecorderStateChanged(RECORDER_STATE_START=2, RECORDER_REASON_NONE=0) |
| Recording ends | onRecorderStateChanged(RECORDER_STATE_STOP=3) + onRecorderInfoUpdated |
| Failure | onRecorderStateChanged(RECORDER_STATE_ERROR=-1, RECORDER_REASON_WRITE_FAILED=1) + onError |
leaveChannel | onDisconnected(..., CONNECTION_CHANGED_LEAVE_CHANNEL=5) |
Callbacks are invoked synchronously on the calling thread, before joinChannel/leaveChannel/startRecording return.