Agora Java API Reference for Android
|
#include <NGIAgoraLocalUser.h>
Public Types | |
enum | USER_MEDIA_INFO { USER_MEDIA_INFO_MUTE_AUDIO = 0, USER_MEDIA_INFO_MUTE_VIDEO = 1, USER_MEDIA_INFO_ENABLE_VIDEO = 4, USER_MEDIA_INFO_ENABLE_LOCAL_VIDEO = 8 } |
Public Member Functions | |
virtual void | onAudioTrackPublishSuccess (agora_refptr< ILocalAudioTrack > audioTrack)=0 |
virtual void | onAudioTrackPublicationFailure (agora_refptr< ILocalAudioTrack > audioTrack, ERROR_CODE_TYPE error)=0 |
virtual void | onLocalAudioTrackStateChanged (agora_refptr< rtc::ILocalAudioTrack > audioTrack, LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_ERROR errorCode)=0 |
virtual void | onLocalAudioTrackStatistics (const LocalAudioStats &stats)=0 |
virtual void | onRemoteAudioTrackStatistics (agora_refptr< rtc::IRemoteAudioTrack > audioTrack, const RemoteAudioTrackStats &stats)=0 |
virtual void | onUserAudioTrackSubscribed (user_id_t userId, agora_refptr< rtc::IRemoteAudioTrack > audioTrack)=0 |
virtual void | onUserAudioTrackStateChanged (user_id_t userId, agora_refptr< rtc::IRemoteAudioTrack > audioTrack, REMOTE_AUDIO_STATE state, REMOTE_AUDIO_STATE_REASON reason, int elapsed)=0 |
virtual void | onVideoTrackPublishSuccess (agora_refptr< ILocalVideoTrack > videoTrack)=0 |
virtual void | onVideoTrackPublicationFailure (agora_refptr< ILocalVideoTrack > videoTrack, ERROR_CODE_TYPE error)=0 |
virtual void | onLocalVideoTrackStateChanged (agora_refptr< rtc::ILocalVideoTrack > videoTrack, LOCAL_VIDEO_STREAM_STATE state, LOCAL_VIDEO_STREAM_ERROR errorCode)=0 |
virtual void | onLocalVideoTrackStatistics (agora_refptr< rtc::ILocalVideoTrack > videoTrack, const LocalVideoTrackStats &stats)=0 |
virtual void | onUserVideoTrackSubscribed (user_id_t userId, VideoTrackInfo trackInfo, agora_refptr< rtc::IRemoteVideoTrack > videoTrack)=0 |
virtual void | onUserVideoTrackStateChanged (user_id_t userId, agora_refptr< rtc::IRemoteVideoTrack > videoTrack, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed)=0 |
virtual void | onFirstRemoteVideoFrameRendered (user_id_t userId, int width, int height, int elapsed)=0 |
virtual void | onRemoteVideoTrackStatistics (agora_refptr< rtc::IRemoteVideoTrack > videoTrack, const RemoteVideoTrackStats &stats)=0 |
virtual void | onAudioVolumeIndication (const AudioVolumeInformation *speakers, unsigned int speakerNumber, int totalVolume)=0 |
virtual void | onActiveSpeaker (user_id_t userId)=0 |
virtual void | onAudioSubscribeStateChanged (const char *channel, user_id_t userId, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState)=0 |
virtual void | onVideoSubscribeStateChanged (const char *channel, user_id_t userId, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState)=0 |
virtual void | onAudioPublishStateChanged (const char *channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState)=0 |
virtual void | onVideoPublishStateChanged (const char *channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState)=0 |
virtual void | onRemoteSubscribeFallbackToAudioOnly (user_id_t userId, bool isFallbackOrRecover) |
virtual void | onFirstRemoteAudioFrame (user_id_t userId, int elapsed)=0 |
virtual void | onFirstRemoteAudioDecoded (user_id_t userId, int elapsed)=0 |
virtual void | onFirstRemoteVideoFrame (user_id_t userId, int width, int height, int elapsed)=0 |
virtual void | onFirstRemoteVideoDecoded (user_id_t userId, int width, int height, int elapsed)=0 |
virtual void | onVideoSizeChanged (user_id_t userId, int width, int height, int rotation)=0 |
virtual void | onUserInfoUpdated (user_id_t userId, USER_MEDIA_INFO msg, bool val) |
virtual void | onIntraRequestReceived () |
virtual void | onStreamMessage (user_id_t userId, int streamId, const char *data, size_t length) |
virtual void | onUserStateChanged (user_id_t userId, uint32_t state) |
The ILocalUserObserver
class.
The media information of a specified user.
|
pure virtual |
Occurs when the first packet of the local audio track is sent, indicating that the local audio track is successfully published.
audioTrack | The pointer to ILocalAudioTrack. |
|
pure virtual |
Occurs when a local audio track fails to be published.
audioTrack | The pointer to ILocalAudioTrack . |
error | The error information: #ERROR_CODE_TYPE. |
|
pure virtual |
Occurs when the state of a local audio track changes.
audioTrack | The pointer to ILocalAudioTrack . |
state | The state of the local audio track. |
errorCode | The error information for a state failure: LOCAL_AUDIO_STREAM_ERROR. |
|
pure virtual |
Reports the statistics of a local audio track.
stats | The reference to the statistics of the local audio track. |
|
pure virtual |
Reports the statistics of a remote audio track.
audioTrack | The pointer to IRemoteAudioTrack . |
stats | The statistics of the remote audio track. |
|
pure virtual |
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.
userId | The ID of the remote user whose audio frame is received. |
audioTrack | The pointer to IRemoteAudioTrack . |
|
pure virtual |
Occurs when the state of a remote audio track changes.
userId | The ID of the remote user whose audio track state has changed. |
audioTrack | The pointer to IRemoteAudioTrack . |
state | The current state of the audio track. |
reason | The reason for the state change. |
elapsed | The time (ms) since the user connects to an Agora channel. |
|
pure virtual |
Occurs when the first packet of a local video track is sent, indicating that the local video track is successfully published.
videoTrack | The pointer to ILocalVideoTrack . |
|
pure virtual |
Occurs when a local video track fails to be published.
videoTrack | The pointer to ILocalVideoTrack . |
error | The error information: #ERROR_CODE_TYPE. |
|
pure virtual |
Occurs when the state of a local video track changes.
videoTrack | The pointer to ILocalVideoTrack . |
state | The state of the local video track. |
errorCode | The error information. |
|
pure virtual |
Reports the statistics of a local video track.
videoTrack | The pointer to ILocalVideoTrack . |
stats | The statistics of the local video track. |
|
pure virtual |
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.
userId | The ID of the remote user whose video frame is received. |
trackInfo | The information of the remote video track. |
videoTrack | The pointer to IRemoteVideoTrack . |
|
pure virtual |
Occurs when the state of a remote video track changes.
userId | the ID of the remote user whose video track state has changed. |
videoTrack | The pointer to IRemoteVideoTrack . |
state | The current state of the video track. |
reason | The reason for the state change. |
elapsed | The time (ms) since the user connects to an Agora channel. |
|
pure virtual |
Occurs when the first remote video frame is rendered.
userId | the ID of the remote user. |
width | Width (px) of the video frame. |
height | Height (px) of the video stream. |
elapsed | The time (ms) since the user connects to an Agora channel. |
|
pure virtual |
Reports the statistics of a remote video track.
videoTrack | The pointer to IRemoteVideoTrack . |
stats | The statistics of the remote video track. |
|
pure virtual |
Reports which users are speaking, the speakers' volumes, and whether the local user is speaking.
This callback reports the IDs and volumes of the loudest speakers at the moment in the channel, and whether the local user is speaking.
You can set the time interval of this callback using setAudioVolumeIndicationParameters.
The SDK triggers two onAudioVolumeIndication
callbacks at one time, one reporting the volume information of the local user and the other reporting the volume information of all remote users.
report_vad
in enableAudioVolumeIndication
to true
.speakers | The pointer to AudioVolumeInformation, which is an array containing the user ID and volume information for each speaker.
|
speakerNumber | The total number of the speakers. |
totalVolume | The total volume after audio mixing. The value ranges between 0 (lowest volume) and 255 (highest volume).
|
|
pure virtual |
Occurs when an active speaker is detected.
You can add relative functions on your app, for example, the active speaker, once detected, will have the portrait zoomed in.
userId | The ID of the active speaker. A userId of 0 means the local user. |
|
pure virtual |
Occurs when the audio subscribe state changed.
channel | The channel name of user joined. |
userId | The remote string user ID that is subscribed to. |
oldState | The old state of the audio stream subscribe : #STREAM_SUBSCRIBE_STATE. |
newState | The new state of the audio stream subscribe : #STREAM_SUBSCRIBE_STATE. |
elapseSinceLastState | The time elapsed (ms) from the old state to the new state. |
|
pure virtual |
Occurs when the video subscribe state changed.
channel | The channel name of user joined. |
userId | The remote string user ID that is subscribed to. |
oldState | The old state of the video stream subscribe : #STREAM_SUBSCRIBE_STATE. |
newState | The new state of the video stream subscribe : #STREAM_SUBSCRIBE_STATE. |
elapseSinceLastState | The time elapsed (ms) from the old state to the new state. |
|
pure virtual |
Occurs when the audio publish state changed.
channel | The channel name of user joined. |
oldState | The old state of the audio stream publish : #STREAM_PUBLISH_STATE. |
newState | The new state of the audio stream publish : #STREAM_PUBLISH_STATE. |
elapseSinceLastState | The time elapsed (ms) from the old state to the new state. |
|
pure virtual |
Occurs when the video publish state changed.
channel | The channel name of user joined. |
oldState | The old state of the video stream publish : #STREAM_PUBLISH_STATE. |
newState | The new state of the video stream publish : #STREAM_PUBLISH_STATE. |
elapseSinceLastState | The time elapsed (ms) from the old state to the new state. |
|
virtual |
Occurs when the first remote audio frame is received.
userId | ID of the remote user. |
isFallbackOrRecover | Whether the remotely subscribed media stream falls back to audio-only or switches back to the video:
|
|
pure virtual |
Occurs when the first remote audio frame is received.
userId | ID of the remote user. |
elapsed | The time (ms) since the user connects to an Agora channel. |
|
pure virtual |
Occurs when the SDK decodes the first remote audio frame for playback.
uid | User ID of the remote user sending the audio stream. |
elapsed | The time (ms) since the user connects to an Agora channel. |
|
pure virtual |
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.
userId | ID of the remote user. |
width | Width (px) of the video frame. |
height | Height (px) of the video stream. |
elapsed | Time elapsed (ms) from the local user calling the joinChannel method until the SDK triggers this callback. |
|
pure virtual |
Occurs when the SDK decodes the first remote video frame for playback.
userId | ID of the remote user. |
width | Width (px) of the video stream. |
height | Height (px) of the video stream. |
elapsed | The time (ms) since the user connects to an Agora channel. |
|
pure virtual |
The local or remote video size or rotation changed.
uid | User ID of the user whose video size or rotation has changed. |
width | Width (pixels) of the video stream. |
height | Height (pixels) of the video stream. |
rotation | Rotation [0 to 360). |
|
virtual |
Occurs when the user media information is updated.
userId | The ID of the user. |
msg | The media information of the user. See USER_MEDIA_INFO. |
val | Whether the user is muted. |
|
virtual |
Occurs when the intra request is received from a remote user.
The method notifies the local user to encode a key frame.
|
virtual |
datastream from this connection.
|
virtual |
Occurs when the remote user state is updated.
uid | The uid of the remote user. |
state | The remote user state.Just & #REMOTE_USER_STATE |