Documentation
On-premise Recording
API Reference
Agora Recording Java API Reference
Agora On-Premise Recording SDK Java API Reference
|
void | onLeaveChannel (int reason) |
|
void | onError (int error, int stat_code) |
|
void | onWarning (int warn) |
|
void | onJoinChannelSuccess (String channelId, long uid) |
|
void | onRemoteVideoStreamStateChanged (long uid, REMOTE_STREAM_STATE state, REMOTE_STREAM_STATE_CHANGED_REASON reason) |
|
void | onRemoteAudioStreamStateChanged (long uid, REMOTE_STREAM_STATE state, REMOTE_STREAM_STATE_CHANGED_REASON reason) |
|
void | onUserOffline (long uid, int reason) |
|
void | onUserJoined (long uid, String recordingDir) |
|
void | onActiveSpeaker (long uid) |
|
void | audioFrameReceived (long uid, AudioFrame frame) |
|
void | videoFrameReceived (long uid, int type, VideoFrame frame, int rotation) |
|
void | recordingPathCallBack (String path) |
|
void | onAudioVolumeIndication (AudioVolumeInfo[] infos) |
|
void | onFirstRemoteVideoDecoded (long uid, int width, int height, int elapsed) |
|
void | onFirstRemoteAudioFrame (long uid, int elapsed) |
|
void | onReceivingStreamStatusChanged (boolean receivingAudio, boolean receivingVideo) |
|
void | onConnectionLost () |
|
void | onConnectionInterrupted () |
|
void | onRejoinChannelSuccess (String channelId, long uid) |
|
void | onConnectionStateChanged (CONNECTION_STATE_TYPE state, CONNECTION_CHANGED_REASON_TYPE reason) |
|
void | onRemoteVideoStats (long uid, RemoteVideoStats stats) |
|
void | onRemoteAudioStats (long uid, RemoteAudioStats stats) |
|
void | onRecordingStats (RecordingStats stats) |
|
void | onLocalUserRegistered (long uid, String userAccount) |
|
void | onUserInfoUpdated (long uid, String userAccount) |
|
◆ onLeaveChannel()
void io.agora.recording.RecordingEventHandler.onLeaveChannel |
( |
int |
reason | ) |
|
This callback is triggered when a user leaves the channel.
- Parameters
-
reason | The reasons why the recording server leaves the channel. See LEAVE_PATH_CODE. |
◆ onError()
void io.agora.recording.RecordingEventHandler.onError |
( |
int |
error, |
|
|
int |
stat_code |
|
) |
| |
This callback is triggered when an error occurrs during SDK runtime.
The SDK cannot fix the issue or resume running, which requires intervention from the application and informs the user on the issue.
- Parameters
-
◆ onWarning()
void io.agora.recording.RecordingEventHandler.onWarning |
( |
int |
warn | ) |
|
This callback is triggered when a warning occurrs during SDK runtime.
In most cases, the application can ignore the warnings reported by the SDK because the SDK can usually fix the issue and resume running.
- Parameters
-
◆ onJoinChannelSuccess()
void io.agora.recording.RecordingEventHandler.onJoinChannelSuccess |
( |
String |
channelId, |
|
|
long |
uid |
|
) |
| |
This callback is triggered when the recording server successfully joins the specified channel with an assigned Channel ID and user ID.
- Parameters
-
channelId | The Channel ID assigned based on the channel name specified in createChannel. |
uid | User ID of the user. |
◆ onRemoteVideoStreamStateChanged()
This callback is triggered when the state of a remote user's video stream changes.
- Parameters
-
◆ onRemoteAudioStreamStateChanged()
This callback is triggered when the state of a remote user's audio stream changes.
- Parameters
-
◆ onUserOffline()
void io.agora.recording.RecordingEventHandler.onUserOffline |
( |
long |
uid, |
|
|
int |
reason |
|
) |
| |
This callback is triggered when a user leaves the channel or goes offline.
The SDK reads the timeout data to determine if a user leaves the channel (or goes offline). If no data package is received from the user within 15 seconds, the SDK assumes the user is offline. A poor network connection may lead to false detections, so use signaling for reliable offline detection.
- Parameters
-
uid | The uid of the user. |
reason | The rerasons why the user leaves the channel or goes offline. See USER_OFFLINE_REASON_TYPE. |
◆ onUserJoined()
void io.agora.recording.RecordingEventHandler.onUserJoined |
( |
long |
uid, |
|
|
String |
recordingDir |
|
) |
| |
This callback is triggered when a remote user/host joins the channel and reports the UID of the new user.
-
Communication profile: This callback notifies the recording server that a remote user joins the channel and reports the user's UID and information.
-
Live broadcast profile: This callback notifies the recording server that a host joins the channel and reports the user's UID and information.
If there are users/hosts in the channel before the recording server joins the channel, the SDK also reports on the UIDs and information of the existing users/hosts. This callback is triggered as many times as the number of the users/hosts in the channel.
- Parameters
-
uid | The uid of the new user/host. |
recordingDir | The relative path of the recorded files and recording log. |
◆ onActiveSpeaker()
void io.agora.recording.RecordingEventHandler.onActiveSpeaker |
( |
long |
uid | ) |
|
This callback reports the user who speaks loudest.
If you set the audioIndicationInterval parameter in RecordingConfig to be greater than 0, this callback returns the uid
of the user with the highest voice volume over a certain time period.
- Parameters
-
uid | The uid of the user with the highest voice volume over a certain time period. |
◆ audioFrameReceived()
void io.agora.recording.RecordingEventHandler.audioFrameReceived |
( |
long |
uid, |
|
|
AudioFrame |
frame |
|
) |
| |
Occurs when the raw audio data is received. If you set decodeAudio in RecordingConfig as 1
, 2
, or 3
, you receive audio frames from this callback.
- Parameters
-
uid | The uid of the user. |
frame | Received raw audio data in PCM or AAC format. See AudioFrame. |
◆ videoFrameReceived()
void io.agora.recording.RecordingEventHandler.videoFrameReceived |
( |
long |
uid, |
|
|
int |
type, |
|
|
VideoFrame |
frame, |
|
|
int |
rotation |
|
) |
| |
Occurs when the video frame is received.
If you set decodeVideo in RecordingConfig as 1
, 2
, or 3
, you receive raw video data from this callback.
If you set decodeVideo in RecordingConfig as 4
or 5
, you receive video frames in JPG file format from this callback.
This callback is triggered for every received video frame and can be used to detect sexually explicit content, if necessary.
Agora recommends capturing the I frame only and neglecting the others.
- Parameters
-
uid | The uid of the remote user as specified in the createChannel() method. If no uid is previously assigned, the Agora server automatically assigns a uid. |
type | The format of the received video frame:
-
0: YUV
-
1: H.264
-
2: JPG
-
3: H.265
-
4: JPG file
|
frame | Received video frame. See VideoFrame. |
rotation | Rotational angle: 0, 90, 180, or 270. |
◆ recordingPathCallBack()
void io.agora.recording.RecordingEventHandler.recordingPathCallBack |
( |
String |
path | ) |
|
This callback reports the relative path of the recorded files.
- Parameters
-
path | The relative path of the recorded files. |
◆ onAudioVolumeIndication()
void io.agora.recording.RecordingEventHandler.onAudioVolumeIndication |
( |
AudioVolumeInfo[] |
infos | ) |
|
This callback reports the list of users who are speaking and their volumes.
This callback works only when audioIndicationInterval > 0.
- Parameters
-
infos | An array containing the user ID and volume information for each speaker. For more information, see AudioVolumeInfo. |
◆ onFirstRemoteVideoDecoded()
void io.agora.recording.RecordingEventHandler.onFirstRemoteVideoDecoded |
( |
long |
uid, |
|
|
int |
width, |
|
|
int |
height, |
|
|
int |
elapsed |
|
) |
| |
This callback is triggered when the first remote video frame is received and decoded.
- Parameters
-
uid | The user ID. |
width | The width of the video frame. |
height | The height of the video frame. |
elapsed | Time elapsed (ms) from the local user calling createChannel until this callback is triggered. |
◆ onFirstRemoteAudioFrame()
void io.agora.recording.RecordingEventHandler.onFirstRemoteAudioFrame |
( |
long |
uid, |
|
|
int |
elapsed |
|
) |
| |
This callback is triggered when the first remote audio frame is received.
- Parameters
-
uid | The user ID. |
elapsed | Time elapsed (ms) from the local user calling createChannel until this callback is triggered. |
◆ onReceivingStreamStatusChanged()
void io.agora.recording.RecordingEventHandler.onReceivingStreamStatusChanged |
( |
boolean |
receivingAudio, |
|
|
boolean |
receivingVideo |
|
) |
| |
This callback is triggered when the status of receiving the audio or video stream changes.
- Parameters
-
receivingAudio | Whether or not the recording server is receiving the audio stream. |
receivingVideo | Whether or not the recording server is receiving the video stream. |
◆ onConnectionLost()
void io.agora.recording.RecordingEventHandler.onConnectionLost |
( |
| ) |
|
This callback is triggered when the SDK cannot reconnect to Agora's edge server 10 seconds after its connection to the server is interrupted.
The SDK triggers this callback when it cannot connect to the server 10 seconds after calling createChannel regardless of whether it is in the channel or not.
This callback is different from onConnectionInterrupted:
-
The SDK triggers the onConnectionInterrupted callback when the SDK loses connection with the server for more than 4 seconds after it joins the channel.
-
The SDK triggers the onConnectionLost callback when the SDK loses connection with the server for more than 10 seconds, regardless of whether it joins the channel or not.
For both callbacks, the SDK tries to reconnect to the server until the application calls leaveChannel.
◆ onConnectionInterrupted()
void io.agora.recording.RecordingEventHandler.onConnectionInterrupted |
( |
| ) |
|
This callback is triggered when the connection between the SDK and the server is interrupted.
The SDK triggers this callback when it cannot connect to the server 10 seconds after calling createChannel regardless of whether it is in the channel or not.
This callback is different from onConnectionLost:
-
The SDK triggers the onConnectionInterrupted callback when the SDK loses connection with the server for more than 4 seconds after it joins the channel.
-
The SDK triggers the onConnectionLost callback when the SDK loses connection with the server for more than 10 seconds, regardless of whether it joins the channel or not.
For both callbacks, the SDK tries to reconnect to the server until the application calls leaveChannel.
◆ onRejoinChannelSuccess()
void io.agora.recording.RecordingEventHandler.onRejoinChannelSuccess |
( |
String |
channelId, |
|
|
long |
uid |
|
) |
| |
This callback is triggered when the recording server rejoins the channel after being disconnected due to network problems.
When the recording server loses connection with the server because of network problems, the SDK automatically tries to reconnect and triggers this callback upon reconnection.
- Parameters
-
channelId | The channel name. |
uid | The uid of the recording server. |
◆ onConnectionStateChanged()
This callback is triggered when the network connection state changes.
- Parameters
-
◆ onRemoteVideoStats()
void io.agora.recording.RecordingEventHandler.onRemoteVideoStats |
( |
long |
uid, |
|
|
RemoteVideoStats |
stats |
|
) |
| |
This callback reports the statistics of the video stream from the remote user (communication profile)/host (live broadcast profile).
The SDK triggers this callback once every two seconds for each remote user (communication profile)/host (live broadcast profile). If a channel includes multiple remote users/hosts, the SDK triggers this callback as many times.
- Parameters
-
uid | The uid of the user sending the video stream. |
stats | The statistics of the received remote video stream. See RemoteVideoStats. |
◆ onRemoteAudioStats()
void io.agora.recording.RecordingEventHandler.onRemoteAudioStats |
( |
long |
uid, |
|
|
RemoteAudioStats |
stats |
|
) |
| |
This callback reports the statistics of the audio stream from the remote user (communication profile)/host (live broadcast profile).
The SDK triggers this callback once every two seconds for each remote user (communication profile)/host (live broadcast profile). If a channel includes multiple remote users, the SDK triggers this callback as many times.
- Parameters
-
uid | The uid of the user sending the audio stream. |
stats | The statistics of the received remote audio stream. See RemoteAudioStats. |
◆ onRecordingStats()
void io.agora.recording.RecordingEventHandler.onRecordingStats |
( |
RecordingStats |
stats | ) |
|
This callback reports the statistics of the recording once every two seconds.
- Parameters
-
◆ onLocalUserRegistered()
void io.agora.recording.RecordingEventHandler.onLocalUserRegistered |
( |
long |
uid, |
|
|
String |
userAccount |
|
) |
| |
Occurs when the recording server successfully registers a user account by calling the createChannelWithUserAccount method. This callback reports the user ID and user account of the recording server.
- Parameters
-
uid | The uid of the recording server. |
userAccount | The user account of the recording server. |
◆ onUserInfoUpdated()
void io.agora.recording.RecordingEventHandler.onUserInfoUpdated |
( |
long |
uid, |
|
|
String |
userAccount |
|
) |
| |
Occurs when the SDK gets the user ID and user account of a remote user.
After a remote user joins the channel, the SDK gets the UID and user account of the remote user and triggers this callback on the local client.
- Parameters
-
uid | The uid of the remote user. |
userAccount | The user account of the remote user. |