Agora Java API Reference for Android

Public Member Functions | List of all members
io.agora.rtc2.IMediaRecorderCallback Interface Reference

## Public Member Functions
void | onRecorderStateChanged (String channelId, int uid, int state, int reason)
void | onRecorderInfoUpdated (String channelId, int uid, RecorderInfo info)

## Detailed Description

The `IMediaRecorderCallback` interface.

Since
  v4.0.0

## Member Function Documentation

## ◆ onRecorderStateChanged()

void io.agora.rtc2.IMediaRecorderCallback.onRecorderStateChanged | ( | String | channelId,
|  | int | uid,
|  | int | state,
|  | int | reason
| ) |  |

Occurs when the recording state changes.

When the local audio and video recording state changes, the SDK triggers this callback to report the current recording state and the reason for the change.

Parameters

  state | The current recording state: int RECORDER_STATE_ERROR(-1): An error occurs during the recording. See `error` message for the reason. RECORDER_STATE_START(2): The audio and video recording is started. RECORDER_STATE_STOP(3): The audio and video recording is stopped.
  reason | The reason for the state change: RECORDER_REASON_NONE(0): No error occurs. RECORDER_REASON_WRITE_FAILED(1): The SDK fails to write the recorded data to a file. RECORDER_REASON_NO_STREAM(2): The SDK does not detect audio and video streams to be recorded, or audio and video streams are interrupted for more than five seconds during recording. RECORDER_REASON_OVER_MAX_DURATION(3): The recording duration exceeds the upper limit. RECORDER_REASON_CONFIG_CHANGED(4): The recording configuration changes.
  channelId | The channel name.
  uid | ID of the user.

## ◆ onRecorderInfoUpdated()

void io.agora.rtc2.IMediaRecorderCallback.onRecorderInfoUpdated | ( | String | channelId,
|  | int | uid,
|  | RecorderInfo | info
| ) |  |

Occurs when the recording information is updated.

After you successfully register this callback and enable the local audio and video recording, the SDK periodically triggers the `onRecorderInfoUpdated` callback based on the set value of `recorderInfoUpdateInterval`. This callback reports the filename, duration, and size of the current recording file.

Parameters

  info | Information about the recording file. See RecorderInfo.\
  channelId | The channel name.
  uid | ID of the user.