Agora Recording Java API Reference
|
Public Member Functions | |
void | nativeObjectRef (long nativeHandle) |
void | onLeaveChannel (int reason) |
void | onError (int error, int stat_code) |
void | onWarning (int warn) |
void | onJoinChannelSuccess (String channelId, long uid) |
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 | stopCallBack () |
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 io.agora.recording.RecordingEventHandler.nativeObjectRef | ( | long | nativeHandle | ) |
This callback returns the JNI instance. You need to pass this JNI instance when calling each main method, except createChannel.
nativeHandle | The recording engine. |
void io.agora.recording.RecordingEventHandler.onLeaveChannel | ( | int | reason | ) |
This callback is triggered when a user leaves the channel.
reason | The reasons why the recording app leaves the channel. See LEAVE_PATH_CODE. |
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 app and informs the user on the issue.
error | Error codes. |
stat_code | State codes. |
void io.agora.recording.RecordingEventHandler.onWarning | ( | int | warn | ) |
This callback is triggered when a warning occurrs during SDK runtime.
In most cases, the app can ignore the warnings reported by the SDK because the SDK can usually fix the issue and resume running.
warn | Warning codes. |
void io.agora.recording.RecordingEventHandler.onJoinChannelSuccess | ( | String | channelId, |
long | uid | ||
) |
This callback is triggered when the recording app successfully joins the specified channel with an assigned Channel ID and user ID.
channelId | Channel ID assigned based on the channel name specified in createChannel. |
uid | User ID of the user. |
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.
uid | User ID of the user. |
reason | The rerasons why the user leaves the channel or goes offline. See USER_OFFLINE_REASON_TYPE. |
void io.agora.recording.RecordingEventHandler.onUserJoined | ( | long | uid, |
String | recordingDir | ||
) |
This callback is triggered when a user joins the channel and returns the UID of the new user.
If there are users in the channel before the recording app joins the channel, the SDK will also reports on the UIDs of the existing users. This callback is triggered as many times as the number of the users in the channel.
uid | User ID of the user. |
recordingDir | Directory of the recorded files. |
void io.agora.recording.RecordingEventHandler.onActiveSpeaker | ( | long | uid | ) |
This callback returns the user ID of the active speaker.
uid | The user ID of the active speaker. |
void io.agora.recording.RecordingEventHandler.audioFrameReceived | ( | long | uid, |
AudioFrame | frame | ||
) |
This callback is triggered when the raw audio data is received.
uid | User ID of the user. |
frame | Received raw audio data in PCM or AAC format. See AudioFrame. |
void io.agora.recording.RecordingEventHandler.videoFrameReceived | ( | long | uid, |
int | type, | ||
VideoFrame | frame, | ||
int | rotation | ||
) |
This callback is triggered when the raw video data is received.
This callback is triggered for every received raw video frame and can be used to detect sexually explicit content, if necessary.
Agora recommends capturing the i frame only and neglecting the others.
uid | User ID 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 data:
|
frame | Received video data in YUV, H.264, or JPEG format. See VideoFrame. |
rotation | Rotational angle: 0, 90, 180, or 270. |
void io.agora.recording.RecordingEventHandler.stopCallBack | ( | ) |
The SDK triggers this callback when it stop to receive other callbacks and cannot call the JNI function.
void io.agora.recording.RecordingEventHandler.recordingPathCallBack | ( | String | path | ) |
This callback returns the directory of the recorded files.
path | The directory of the recorded files. |
void io.agora.recording.RecordingEventHandler.onAudioVolumeIndication | ( | AudioVolumeInfo [] | infos | ) |
Reports the list of users who are speaking and their volumes. This callback works only when audioIndicationInterval > 0.
speakers | An array containing the user ID and volume information for each speaker. For more information, see AudioVolumeInfo。 |
speakerNum | The total number of users who are speaking. |
void io.agora.recording.RecordingEventHandler.onFirstRemoteVideoDecoded | ( | long | uid, |
int | width, | ||
int | height, | ||
int | elapsed | ||
) |
Occurs when the first remote video frame is decoded. This callback applies only to the composite mode and is triggered after the first frame of the remote video is received and decoded. The app can configure the user view settings with this callback.
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. |
void io.agora.recording.RecordingEventHandler.onFirstRemoteAudioFrame | ( | long | uid, |
int | elapsed | ||
) |
Occurs when the first remote audio frame is received.
uid | The user ID. |
elapsed | Time elapsed (ms) from the local user calling createChannel until this callback is triggered. |
void io.agora.recording.RecordingEventHandler.onReceivingStreamStatusChanged | ( | boolean | receivingAudio, |
boolean | receivingVideo | ||
) |
Occurs when the status of receiving the audio or video stream changes.
receivingAudio | Whether or not the recording application is receiving the audio stream. |
receivingVideo | Whether or not the recording application is receiving the video stream. |
void io.agora.recording.RecordingEventHandler.onConnectionLost | ( | ) |
Occurs 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:
For both callbacks, the SDK tries to reconnect to the server until the app calls leaveChannel.
void io.agora.recording.RecordingEventHandler.onConnectionInterrupted | ( | ) |
Occurs 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:
For both callbacks, the SDK tries to reconnect to the server until the app calls leaveChannel.