Server Gateway SDK v3.7.200.21 for Linux Java
Public Member Functions | List of all members
io.agora.rtc.ILocalUserObserver Interface Reference

Public Member Functions

void onAudioTrackPublishSuccess (AgoraLocalUser agora_local_user, AgoraLocalAudioTrack agora_local_audio_track)
 
void onLocalAudioTrackStateChanged (AgoraLocalUser agora_local_user, AgoraLocalAudioTrack agora_local_audio_track, int state, int error)
 
void onLocalAudioTrackStatistics (AgoraLocalUser agora_local_user, LocalAudioStats stats)
 
void onRemoteAudioTrackStatistics (AgoraLocalUser agora_local_user, AgoraRemoteAudioTrack agora_remote_audio_track, RemoteAudioTrackStats stats)
 
void onUserAudioTrackSubscribed (AgoraLocalUser agora_local_user, String user_id, AgoraRemoteAudioTrack agora_remote_audio_track)
 
void onUserAudioTrackStateChanged (AgoraLocalUser agora_local_user, String user_id, AgoraRemoteAudioTrack agora_remote_audio_track, int state, int reason, int elapsed)
 
void onAudioSubscribeStateChanged (AgoraLocalUser agora_local_user, String channel, String user_id, int old_state, int new_state, int elapse_since_last_state)
 
void onAudioPublishStateChanged (AgoraLocalUser agora_local_user, String channel, int old_state, int new_state, int elapse_since_last_state)
 
void onFirstRemoteAudioFrame (AgoraLocalUser agora_local_user, String user_id, int elapsed)
 
void onFirstRemoteAudioDecoded (AgoraLocalUser agora_local_user, String user_id, int elapsed)
 
void onVideoTrackPublishSuccess (AgoraLocalUser agora_local_user, AgoraLocalVideoTrack agora_local_video_track)
 
void onLocalVideoTrackStateChanged (AgoraLocalUser agora_local_user, AgoraLocalVideoTrack agora_local_video_track, int state, int error)
 
void onLocalVideoTrackStatistics (AgoraLocalUser agora_local_user, AgoraLocalVideoTrack agora_local_video_track, LocalVideoTrackStats stats)
 
void onUserVideoTrackSubscribed (AgoraLocalUser agora_local_user, String user_id, VideoTrackInfo info, AgoraRemoteVideoTrack agora_remote_video_track)
 
void onUserVideoTrackStateChanged (AgoraLocalUser agora_local_user, String user_id, AgoraRemoteVideoTrack agora_remote_video_track, int state, int reason, int elapsed)
 
void onRemoteVideoTrackStatistics (AgoraLocalUser agora_local_user, AgoraRemoteVideoTrack agora_remote_video_track, RemoteVideoTrackStats stats)
 
void onVideoSubscribeStateChanged (AgoraLocalUser agora_local_user, String channel, String user_id, int old_state, int new_state, int elapse_since_last_state)
 
void onVideoPublishStateChanged (AgoraLocalUser agora_local_user, String channel, int old_state, int new_state, int elapse_since_last_state)
 
void onFirstRemoteVideoFrame (AgoraLocalUser agora_local_user, String user_id, int width, int height, int elapsed)
 
void onFirstRemoteVideoDecoded (AgoraLocalUser agora_local_user, String user_id, int width, int height, int elapsed)
 
void onUserInfoUpdated (AgoraLocalUser agora_local_user, String user_id, int msg, int val)
 
void onIntraRequestReceived (AgoraLocalUser agora_local_user)
 
void onRemoteSubscribeFallbackToAudioOnly (AgoraLocalUser agora_local_user, String user_id, int is_fallback_or_recover)
 
void onStreamMessage (AgoraLocalUser agora_local_user, String user_id, int stream_id, String data, long length)
 
void onUserStateChanged (AgoraLocalUser agora_local_user, String user_id, int state)
 

Detailed Description

The ILocalUserObserver interface.

Member Function Documentation

◆ onAudioPublishStateChanged()

void io.agora.rtc.ILocalUserObserver.onAudioPublishStateChanged ( AgoraLocalUser  agora_local_user,
String  channel,
int  old_state,
int  new_state,
int  elapse_since_last_state 
)

Occurs when the audio publish state changed.

Parameters
agora_local_userAn AgoraLocalUser object.
channelThe channel name of user joined.
old_stateThe old state of the audio stream publishing.
  • 0: The initial publishing state after joining the channel.
  • 1: Fails to publish the local stream.
  • 2: Publishing.
  • 3: Publishes successfully.
new_stateThe new state of the audio stream publishing.
  • 0: The initial publishing state after joining the channel.
  • 1: Fails to publish the local stream.
  • 2: Publishing.
  • 3: Publishes successfully.
elapse_since_last_stateThe time elapsed (ms) from the old state to the new state.

◆ onAudioSubscribeStateChanged()

void io.agora.rtc.ILocalUserObserver.onAudioSubscribeStateChanged ( AgoraLocalUser  agora_local_user,
String  channel,
String  user_id,
int  old_state,
int  new_state,
int  elapse_since_last_state 
)

Occurs when the audio subscribe state changed.

Parameters
agora_local_userAn AgoraLocalUser object.
channelThe channel name of user joined.
user_idThe remote string user ID that is subscribed to.
old_stateThe old state of the audio stream subscription.
  • 0: The initial subscribing state after joining the channel.
  • 1: Fails to subscribe to the remote stream.
  • 2: Subscribing.
  • 3: Subscribes to and receives the remote stream successfully.
new_stateThe new state of the audio stream subscription.
  • 0: The initial subscribing state after joining the channel.
  • 1: Fails to subscribe to the remote stream.
  • 2: Subscribing.
  • 3: Subscribes to and receives the remote stream successfully.
elapse_since_last_stateThe time elapsed (ms) from the old state to the new state.

◆ onAudioTrackPublishSuccess()

void io.agora.rtc.ILocalUserObserver.onAudioTrackPublishSuccess ( AgoraLocalUser  agora_local_user,
AgoraLocalAudioTrack  agora_local_audio_track 
)

Occurs when the first packet of the local audio track is sent, indicating that the local audio track is successfully published.

Parameters
agora_local_userAn AgoraLocalUser object.
agora_local_audio_trackAn AgoraLocalAudioTrack object.

◆ onFirstRemoteAudioDecoded()

void io.agora.rtc.ILocalUserObserver.onFirstRemoteAudioDecoded ( AgoraLocalUser  agora_local_user,
String  user_id,
int  elapsed 
)

Occurs when the SDK decodes the first remote audio frame for playback.

Parameters
agora_local_userAn AgoraLocalUser object.
user_idID of the remote user.
elapsedThe time (ms) since the user connects to an Agora channel.

◆ onFirstRemoteAudioFrame()

void io.agora.rtc.ILocalUserObserver.onFirstRemoteAudioFrame ( AgoraLocalUser  agora_local_user,
String  user_id,
int  elapsed 
)

Occurs when the first remote audio frame is received.

Parameters
agora_local_userAn AgoraLocalUser object.
user_idID of the remote user.
elapsedThe time (ms) since the user connects to an Agora channel.

◆ onFirstRemoteVideoDecoded()

void io.agora.rtc.ILocalUserObserver.onFirstRemoteVideoDecoded ( AgoraLocalUser  agora_local_user,
String  user_id,
int  width,
int  height,
int  elapsed 
)

Occurs when the SDK decodes the first remote video frame for playback.

Parameters
agora_local_userAn AgoraLocalUser object.
user_idID of the remote user.
widthWidth (px) of the video stream.
heightHeight (px) of the video stream.
elapsedThe time (ms) since the user connects to an Agora channel.

◆ onFirstRemoteVideoFrame()

void io.agora.rtc.ILocalUserObserver.onFirstRemoteVideoFrame ( AgoraLocalUser  agora_local_user,
String  user_id,
int  width,
int  height,
int  elapsed 
)

Occurs when the first remote video frame is rendered. The SDK triggers this callback when the first frame of the remote video is displayed in the user's video window. The application can get the time elapsed from a user joining the channel until the first video frame is displayed.

Parameters
agora_local_userAn AgoraLocalUser object.
user_idID of the remote user.
widthWidth (px) of the video frame.
heightHeight (px) of the video stream.
elapsedTime elapsed (ms) from the time when the user connects to the channel to the time when the SDK triggers this callback.

◆ onIntraRequestReceived()

void io.agora.rtc.ILocalUserObserver.onIntraRequestReceived ( AgoraLocalUser  agora_local_user)

Occurs when the intra request is received from a remote user. The method notifies the local user to encode a key frame.

Parameters
agora_local_userAn AgoraLocalUser object.

◆ onLocalAudioTrackStateChanged()

void io.agora.rtc.ILocalUserObserver.onLocalAudioTrackStateChanged ( AgoraLocalUser  agora_local_user,
AgoraLocalAudioTrack  agora_local_audio_track,
int  state,
int  error 
)

Occurs when the state of a local audio track changes.

Parameters
agora_local_userAn AgoraLocalUser object.
agora_local_audio_trackThe pointer to ILocalAudioTrack.
stateThe state of the local audio track.
  • 0: The local audio is in the initial state.
  • 1: The audio recording device starts successfully.
  • 2: The first audio frame is encoded successfully.
  • 3: The local audio fails to start.
errorThe error information for a state failure.
  • 0: The local audio is normal.
  • 1: No specified reason for the local audio failure.
  • 2: No permission to use the local audio device.
  • 3: The microphone is in use.
  • 4: The local audio recording fails. Check whether the recording device is working properly.
  • 5: The local audio encoding fails.

◆ onLocalAudioTrackStatistics()

void io.agora.rtc.ILocalUserObserver.onLocalAudioTrackStatistics ( AgoraLocalUser  agora_local_user,
LocalAudioStats  stats 
)

Reports the statistics of a local audio track.

Parameters
agora_local_userAn AgoraLocalUser object.
statsThe statistics of the local audio track.

◆ onLocalVideoTrackStateChanged()

void io.agora.rtc.ILocalUserObserver.onLocalVideoTrackStateChanged ( AgoraLocalUser  agora_local_user,
AgoraLocalVideoTrack  agora_local_video_track,
int  state,
int  error 
)

◆ onLocalVideoTrackStatistics()

void io.agora.rtc.ILocalUserObserver.onLocalVideoTrackStatistics ( AgoraLocalUser  agora_local_user,
AgoraLocalVideoTrack  agora_local_video_track,
LocalVideoTrackStats  stats 
)

Reports the statistics of a local video track.

Parameters
agora_local_userAn AgoraLocalUser object.
agora_local_video_trackAn AgoraLocalVideoTrack object.
statsThe statistics of the local video track.

◆ onRemoteAudioTrackStatistics()

void io.agora.rtc.ILocalUserObserver.onRemoteAudioTrackStatistics ( AgoraLocalUser  agora_local_user,
AgoraRemoteAudioTrack  agora_remote_audio_track,
RemoteAudioTrackStats  stats 
)

Reports the statistics of a remote audio track.

Parameters
agora_local_userAn AgoraLocalUser object.
agora_remote_audio_trackAn IRemoteAudioTrack object.
statsThe statistics of the remote audio track.

◆ onRemoteSubscribeFallbackToAudioOnly()

void io.agora.rtc.ILocalUserObserver.onRemoteSubscribeFallbackToAudioOnly ( AgoraLocalUser  agora_local_user,
String  user_id,
int  is_fallback_or_recover 
)

◆ onRemoteVideoTrackStatistics()

void io.agora.rtc.ILocalUserObserver.onRemoteVideoTrackStatistics ( AgoraLocalUser  agora_local_user,
AgoraRemoteVideoTrack  agora_remote_video_track,
RemoteVideoTrackStats  stats 
)

Reports the statistics of a remote video track.

Parameters
agora_local_userAn AgoraLocalUser object.
agora_remote_video_trackAn AgoraRemoteVideoTrack object.
statsThe statistics of the remote video track.

◆ onStreamMessage()

void io.agora.rtc.ILocalUserObserver.onStreamMessage ( AgoraLocalUser  agora_local_user,
String  user_id,
int  stream_id,
String  data,
long  length 
)

Occurs when the local user receives data stream.

Parameters
agora_local_userAn AgoraLocalUser object.
user_idID of the user who sends the data stream.
stream_idID of the stream.
dataThe data in the data stream.
lengthThe length of the data.

◆ onUserAudioTrackStateChanged()

void io.agora.rtc.ILocalUserObserver.onUserAudioTrackStateChanged ( AgoraLocalUser  agora_local_user,
String  user_id,
AgoraRemoteAudioTrack  agora_remote_audio_track,
int  state,
int  reason,
int  elapsed 
)

Occurs when the state of a remote audio track changes.

Parameters
agora_local_userAn AgoraLocalUser object.
user_idThe ID of the remote user whose audio track state has changed.
agora_remote_audio_trackAn IRemoteAudioTrack object.
stateThe current state of the audio track.
  • 0: The remote audio is in the default state.
  • 1: The first remote audio packet is received.
  • 2: The remote audio stream is decoded and plays normally.
  • 3: The remote audio is frozen.
  • 4: The remote audio fails to start.
reasonThe reason for the state change.
  • 0: Internal reasons.
  • 1: Network congestion.
  • 2: Network recovery.
  • 3: The local user stops receiving the remote audio stream or disables the audio module.
  • 4: The local user resumes receiving the remote audio stream or enables the audio module.
  • 5: The remote user stops sending the audio stream or disables the audio module.
  • 6: The remote user resumes sending the audio stream or enables the audio module.
  • 7: The remote user leaves the channel.
elapsedThe time (ms) since the user connects to an Agora channel.

◆ onUserAudioTrackSubscribed()

void io.agora.rtc.ILocalUserObserver.onUserAudioTrackSubscribed ( AgoraLocalUser  agora_local_user,
String  user_id,
AgoraRemoteAudioTrack  agora_remote_audio_track 
)

Occurs when the first remote audio frame is received.

This callback indicates that the local user has subscribed to a specified remote audio track, and the first frame of this audio track has been received.

Parameters
agora_local_userAn AgoraLocalUser object.
user_idThe ID of the remote user whose audio frame is received.
agora_remote_audio_trackAn IRemoteAudioTrack object.

◆ onUserInfoUpdated()

void io.agora.rtc.ILocalUserObserver.onUserInfoUpdated ( AgoraLocalUser  agora_local_user,
String  user_id,
int  msg,
int  val 
)

Occurs when the user media information is updated.

Parameters
agora_local_userAn AgoraLocalUser object.
user_idThe ID of the user.
msgThe media information of the user.
valWhether the user is muted.

◆ onUserStateChanged()

void io.agora.rtc.ILocalUserObserver.onUserStateChanged ( AgoraLocalUser  agora_local_user,
String  user_id,
int  state 
)

Occurs when the remote user state is updated.

Parameters
agora_local_userAn AgoraLocalUser object.
user_idThe uid of the remote user.
stateThe remote user state.

◆ onUserVideoTrackStateChanged()

void io.agora.rtc.ILocalUserObserver.onUserVideoTrackStateChanged ( AgoraLocalUser  agora_local_user,
String  user_id,
AgoraRemoteVideoTrack  agora_remote_video_track,
int  state,
int  reason,
int  elapsed 
)

Occurs when the state of a remote video track changes.

Parameters
agora_local_userAn AgoraLocalUser object.
user_idThe ID of the remote user whose video track state has changed.
agora_remote_video_trackAn AgoraRemoteVideoTrack object.
stateThe current state of the video track.
  • 0: The remote video is in the default state.
  • 2: The remote video stream is decoded and plays normally.
  • 3: The remote video is frozen.
  • 4: The remote video fails to start.
reasonThe reason for the state change.
  • 0: Internal reasons.
  • 1: Network congestion.
  • 2: Network recovery.
  • 3: The local user stops receiving the remote video stream or disables the video module.
  • 4: The local user resumes receiving the remote video stream or enables the video module.
  • 5: The remote user stops sending the video stream or disables the video module.
  • 6: The remote user resumes sending the video stream or enables the video module.
  • 7: The remote user leaves the channel.
  • 8: The remote audio-and-video stream falls back to the audio-only stream due to poor network conditions.
  • 9: The remote audio-only stream switches back to the audio-and-video stream after the network conditions improve.
elapsedThe time (ms) since the user connects to an Agora channel.

◆ onUserVideoTrackSubscribed()

void io.agora.rtc.ILocalUserObserver.onUserVideoTrackSubscribed ( AgoraLocalUser  agora_local_user,
String  user_id,
VideoTrackInfo  info,
AgoraRemoteVideoTrack  agora_remote_video_track 
)

Occurs when the first remote video frame is received.

This callback indicates that the local user has subscribed to a specified remote video track, and the first frame of this video track has been received.

Parameters
agora_local_userAn AgoraLocalUser object.
user_idThe ID of the remote user whose video frame is received.
infoThe information of the remote video track.
agora_remote_video_trackAn AgoraRemoteVideoTrack object.

◆ onVideoPublishStateChanged()

void io.agora.rtc.ILocalUserObserver.onVideoPublishStateChanged ( AgoraLocalUser  agora_local_user,
String  channel,
int  old_state,
int  new_state,
int  elapse_since_last_state 
)

Occurs when the video publish state changed.

Parameters
agora_local_userAn AgoraLocalUser object.
channelThe channel name of user joined.
old_stateThe old state of the video stream publishing.
  • 0: The initial publishing state after joining the channel.
  • 1: Fails to publish the local stream.
  • 2: Publishing.
  • 3: Publishes successfully.
new_stateThe new state of the video stream publishing.
  • 0: The initial publishing state after joining the channel.
  • 1: Fails to publish the local stream.
  • 2: Publishing.
  • 3: Publishes successfully.
elapse_since_last_stateThe time elapsed (ms) from the old state to the new state.

◆ onVideoSubscribeStateChanged()

void io.agora.rtc.ILocalUserObserver.onVideoSubscribeStateChanged ( AgoraLocalUser  agora_local_user,
String  channel,
String  user_id,
int  old_state,
int  new_state,
int  elapse_since_last_state 
)

Occurs when the video subscribe state changed.

Parameters
agora_local_userAn AgoraLocalUser object.
channelThe channel name of user joined.
user_idThe remote string user ID that is subscribed to.
old_stateThe old state of the video stream subscription.
  • 0: The initial subscribing state after joining the channel.
  • 1: Fails to subscribe to the remote stream.
  • 2: Subscribing.
  • 3: Subscribes to and receives the remote stream successfully.
new_stateThe new state of the video stream subscription.
  • 0: The initial subscribing state after joining the channel.
  • 1: Fails to subscribe to the remote stream.
  • 2: Subscribing.
  • 3: Subscribes to and receives the remote stream successfully.
elapse_since_last_stateThe time elapsed (ms) from the old state to the new state.

◆ onVideoTrackPublishSuccess()

void io.agora.rtc.ILocalUserObserver.onVideoTrackPublishSuccess ( AgoraLocalUser  agora_local_user,
AgoraLocalVideoTrack  agora_local_video_track 
)

Occurs when the first packet of a local video track is sent, indicating that the local video track is successfully published.

Parameters
agora_local_userAn AgoraLocalUser object.
agora_local_video_trackAn AgoraLocalVideoTrack object.

The documentation for this interface was generated from the following file: