Occurs when the most active remote speaker is detected.
This callback reports the speaker with the highest accumulative volume during a certain period. If the user enables the audio volume indication by
calling enableAudioVolumeIndication
, this callback returns the uid of the active speaker whose voice is detected by the audio volume detection module of the SDK.
Note
enableAudioVolumeIndication
.Occurs when an API method is executed.
Occurs when the audio effect file playback finishes.
You can start a local audio effect playback by calling playEffect
. This callback is triggered when the local audio effect file playback finishes.
Occurs when the audio mixing file playback finishes.
You can start an audio mixing file playback by calling startAudioMixing
. This callback is triggered when the audio mixing file playback finishes.
If the startAudioMixing
method call fails, an AudioMixingOpenError
warning returns in the Warning
callback.
Occurs when the playback state of the local user's music file changes.
Occurs when the audio publishing state changes.
Reports the statistics of the audio stream from each remote user/host.
Occurs when the local audio playback route changes.
This callback returns that the audio route switched to an earpiece, speakerphone, headset, or Bluetooth device.
The definition of the routing is listed in AudioOutputRouting
.
Occurs when the audio subscribing state changes.
Reports which users are speaking and the speakers' volume, and whether the local user is speaking.
This callback reports the IDs and volumes of the loudest speakers (at most 3) at the moment in the channel, and whether the local user is speaking.
By default, this callback is disabled. You can enable it by calling enableAudioVolumeIndication
. Once enabled, this callback is triggered at the set interval, regardless of whether a user speaks or not.
The SDK triggers two independent AudioVolumeIndication
callbacks at one time, which separately report the volume information of the local user and all the remote speakers. For more information, see the detailed parameter descriptions.
Note
report_vad(true)
in the enableAudioVolumeIndication
method.muteLocalAudioStream
affects the SDK's behavior.muteLocalAudioStream
, the SDK stops triggering the local user's callback.muteLocalAudioStream
, the remote speakers' callback does not include information of this remote user; 20 seconds after all remote users call the the muteLocalAudioStream
method, the SDK stops triggering the remote speakers' callback.The camera exposure area has changed.
The SDK triggers this callback when the local user changes the camera exposure position by calling setCameraExposurePosition
.
Occurs when the camera focus area is changed.
The SDK triggers this callback when the local user changes the camera focus position by
calling setCameraFocusPositionInPreview
.
Occurs when the camera is turned on and ready to capture video.
Reports events during the media stream relay.
Occurs when the state of the media stream relay changes.
The SDK reports the state of the current media relay and possible error messages in this callback.
Occurs when the user role switch fails in the interactive live streaming.
Occurs when the user role switches successfully in the interactive live streaming.
In the LiveBroadcasting
channel profile, when the local user successfully calls setClientRole
to
switch their user role after joining the channel, for example, from a host to an audience member or vice versa, the SDK triggers
this callback to report the user role before and after the switch.
Occurs when your connection is banned by the Agora Server.
Occurs when the connection between the SDK and the server is interrupted.
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 joinChannel
, regardless of whether it is in the channel or not.
If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel.
Occurs when the network connection state changes.
The Agora SDK returns this callback to report on the current network connection state when it changes, and the reason to such change.
Reports an error during SDK runtime.
In most cases, the SDK cannot fix the issue and resume running. The SDK requires the app to take action or informs the user about the issue.
For example, the SDK reports a StartCall
error when failing to initialize a call. The app informs the user that the call initialization failed and invokes the leaveChannel
method to leave the channel. For detailed error codes, see ErrorCode.
Reports the face detection result of the local user.
Once you enable face detection by calling enableFaceDetection
, you can get the following information on the local user in real-time:
Note
Occurs when the first local audio frame is sent.
Occurs when the first audio frame is published.
Occurs when the first local video frame is rendered.
This callback is triggered after the first local video frame is rendered on the local video window.
Occurs when the first video frame is published.
Occurs when the engine receives the first audio frame from a specified remote user.
Occurs when the first remote audio frame is received.
Occurs when the first remote video frame is received and decoded.
Occurs when the first remote video frame is rendered.
This callback is triggered after the first frame of the remote video is rendered on the video window. The application can retrieve the data of the time elapsed from the user joining the channel until the first video frame is displayed.
Occurs when the local user joins a specified channel.
The channel name assignment is based on channelName specified in the joinChannel method.
If the uid is not specified when joinChannel
is called, the server automatically assigns a uid.
Reports the last-mile network probe result.
The SDK triggers this callback within 30 seconds after the app calls startLastmileProbeTest
.
Reports the last mile network quality of the local user once every two seconds before the user joins the channel.
Last mile refers to the connection between the local device and Agora's edge server. After the application calls the enableLastmileTest
method,
this callback reports once every two seconds the uplink and downlink last mile network conditions of the local user before the user joins the channel.
Occurs when a user leaves the channel.
When the app calls the leaveChannel
method, the SDK uses this callback to notify the app when the user leaves the channel.
With this callback, the application retrieves the channel information, such as the call duration and statistics.
Occurs when the local audio stream state changes.
This callback indicates the state change of the local audio stream, including the state of the audio recording and encoding, and allows you to troubleshoot issues when exceptions occur.
Note
When the state is Failed
, see the error
parameter for details.
Reports the statistics of the local audio stream.
Occurs when the published media stream falls back to an audio-only stream due to poor network conditions or switches back to video stream after the network conditions improve.
If you call setLocalPublishFallbackOption
and set option as AudioOnly
,
this callback is triggered when the locally published stream falls back to audio-only mode due to poor uplink conditions,
or when the audio stream switches back to the video after the uplink network condition improves. Once the published stream falls back to audio only,
the remote app receives the RemoteVideoStateChanged
callback.
Occurs when the local user registers a user account.
This callback is triggered when the local user successfully registers a user account by calling registerLocalUserAccount
, or joins a channel by calling joinChannelWithUserAccount
.
This callback reports the user ID and user account of the local user.
Occurs when the local video state changes.
The SDK returns the current video state in this callback.
The SDK triggers the LocalVideoStateChanged(Failed, CaptureFailure)
callback in the following situations:
LocalVideoStateChanged(Capturing, OK)
callback.When the camera outputs the captured video frames, if all the video frames are the same for 15 consecutive frames, the SDK triggers the LocalVideoStateChanged(Capturing, CaptureFailure)
callback. Note that the video frame duplication detection is only available for video frames with a resolution greater than 200 × 200, a frame rate greater than or equal to 10 fps, and a bitrate less than 20 Kbps.
Reports the statistics of the local video streams.
The SDK triggers this callback once every two seconds for each user/host. If there are multiple users/hosts in the channel, the SDK triggers this callback as many times.
Occurs when the media engine is loaded.
Occurs when the media engine starts.
Occurs when the local user receives the metadata.
Occurs when the microphone is enabled/disabled.
Reports the last mile network quality of each user in the channel once every two seconds.
Last mile refers to the connection between the local device and Agora's edge server. This callback reports once every two seconds the last mile network conditions of each user in the channel. If a channel includes multiple users, then this callback will be triggered as many times.
Note
txQuality
is Unknown
when the user is not sending a stream; rxQuality
is Unknown
when the user is not receiving a stream.
Occurs when the network type changes.
The SDK returns the current network type in this callback. When the network connection is interrupted, this callback indicates whether the interruption is caused by a network type change or poor network conditions.
Reports the proxy connection state.
Occurs when a user rejoins the channel after being disconnected due to network problems.
When a user loses connection with the server because of network problems, the SDK automatically tries to reconnect and triggers this callback upon reconnection.
Occurs when the remote audio state changes.
This callback indicates the state change of the remote audio stream.
Note
This callback does not work properly when the number of users (in the [Communication
] profile) or hosts (in the [LiveBroadcasting
] profile) in the channel exceeds 17.
Reports the statistics of the audio stream from each remote user/host.
The SDK triggers this callback once every two seconds for each remote user/host. If a channel includes multiple remote users, the SDK triggers this callback as many times.
Schemes such as FEC (Forward Error Correction) or retransmission counter the frame loss rate. Hence, users may find the overall audio quality acceptable even when the packet loss rate is high.
Reports the transport-layer statistics of each remote audio stream.
Occurs when the remote media stream falls back to audio-only stream due to poor network conditions or switches back to video stream after the network conditions improve.
If you call setRemoteSubscribeFallbackOption
and set
option as AudioOnly
,
this callback is triggered when the remotely subscribed media stream falls back to audio-only mode due
to poor downlink conditions, or when the remotely subscribed media stream switches back to the video after
the downlink network condition improves.
Occurs when the remote video state changes.
Reports the statistics of the video stream from each remote user/host. The SDK triggers this callback once every two seconds for each remote user/host. If a channel includes multiple remote users, the SDK triggers this callback as many times.
Reports the transport-layer statistics of each remote video stream.
Reports the information of an audio file.
Occurs when the token has expired.
After a token is specified when joining the channel, the token expires after a certain period of time,
and a new token is required to reconnect to the server. This callback notifies the app to generate a
new token and call joinChannel
to rejoin the channel with the new token.
Reports the statistics of the RtcEngine
once every two seconds.
Reports events during the RTMP or RTMPS streaming.
Occurs when the state of the RTMP or RTMPS streaming changes.
When the CDN live streaming state changes, the SDK triggers this callback to report the current state and the reason why the state has changed.
This callback indicates the state of the RTMP or RTMPS streaming. When exceptions occur,
you can troubleshoot issues by referring to the detailed error descriptions in the errCode
parameter.
Reports the result of taking a video snapshot.
Occurs when the local user receives a remote data stream.
The SDK triggers this callback when the local user receives the stream message that the remote user sends
by calling the sendStreamMessage
method.
Occurs when the local user fails to receive a remote data stream.
The SDK triggers this callback when the local user fails to receive the stream message that the remote
user sends by calling the sendStreamMessage
method.
Reports the result of calling addPublishStreamUrl
.
Reports the result of calling removePublishStreamUrl
.
Occurs when the token expires in 30 seconds.
The user becomes offline if the token used when joining the channel expires. This callback is triggered 30 seconds before the token expires to remind the app to get a new token. Upon receiving this callback, you need to generate a new token on the server and call renewToken
to pass the new token to the SDK.
Occurs when the publisher's transcoding settings are updated.
When the LiveTranscoding
class in the setLiveTranscoding
method updates, the SDK triggers this callback to report the update information.
Note
setLiveTranscoding
to set the LiveTranscoding
class for the first time, the SDK does not trigger this callback.Occurs when a remote user enables/disables the local video capture function.
The SDK triggers this callback when the remote user resumes or stops capturing the video stream by
calling enableLocalVideo
.
This callback is only applicable to the scenario when the remote user only wants to watch the remote video without sending any video stream to the other user.
Occurs when a remote user enables/disables the video module.
Once the video module is disabled, the remote user can only use a voice call. The remote user cannot send or receive any video from other users.
The SDK triggers this callback when the remote user enables or disables the video module by calling the enableVideo
or disableVideo
method.
Note
This callback is invalid when the number of users or hosts in the channel exceeds 17.
Occurs when the SDK gets the user ID and user account of the remote user.
After a remote user joins the channel, the SDK gets the UID and user account of the remote user, caches them in a mapping table object (UserInfo
), and triggers this callback on the local client.
Occurs when a remote user (Communication
)/host (LiveBroadcasting
) joins the channel.
Communication
profile: This callback notifies the app when another user joins the channel. If other users are already in the channel, the SDK also reports to the app on the existing users.LiveBroadcasting
profile: This callback notifies the app when the host joins the channel. If other hosts are already in the channel, the SDK also reports to the app on the existing hosts. We recommend having at most 17 hosts in a channel.The SDK triggers this callback under one of the following circumstances:
joinChannel
.setClientRole
after joining the channel.Note
In the LiveBroadcasting
profile:
UserJoined
callback when another host joins the channel.UserJoined
callback when a new host joins the channel.UserJoined
callback is triggered as long as the web application publishes streams.Occurs when a remote user stops/resumes sending the audio stream.
The SDK triggers this callback when the remote user stops or resumes sending the audio stream by calling the muteLocalAudioStream
method.
Note
This callback is invalid when the number of users or hosts in the channel exceeds 17.
Occurs when a remote user stops/resumes sending the video stream.
The SDK triggers this callback when the remote user stops or resumes sending the video stream by calling the muteLocalVideoStream
method.
Note
This callback is invalid when the number of users or hosts in the channel exceeds 17.
Occurs when a remote user (Communication
)/host (LiveBroadcasting
) leaves the channel.
There are two reasons for users to become offline:
Communication
profile, and more for the LiveBroadcasting
profile), the SDK assumes that the user/host drops offline. A poor network connection may lead to false detections, so we recommend using the Agora RTM SDK for reliable offline detection.Reports whether the super resolution feature is successfully enabled. (beta feature)
Occurs when the video publishing state changes.
Occurs when the video size or rotation information of a remote user changes.
Occurs when the video stops playing.
Occurs when the video subscribing state changes.
Reports a warning during SDK runtime.
In most cases, the app can ignore the warning reported by the SDK because the SDK can usually fix the issue and resume running.
For instance, the SDK may report a LookupChannelTimeout
warning upon disconnection with the server and tries to reconnect. For detailed warning codes, see WarningCode
.
Reports the voice pitch of the local user.
Occurs when the recording information is updated.
Occurs when the recording state changes.
Reports whether the virtual background is successfully enabled.
since v3.5.0.3
After you call enableVirtualBackground
, the SDK triggers this callback to report whether the virtual background is successfully enabled.
Note
If the background image customized in the virtual background is in PNG or JPG format, the triggering of this callback is delayed until the image is read.
Generated using TypeDoc
Callbacks.
The SDK uses the
RtcEngineEvents
interface class to send callbacks to the application, and the application inherits the methods of this interface class to retrieve these callbacks. All methods in this interface class have their (empty) default implementations, and the application can inherit only some of the required events instead of all of them. In the callbacks, the application should avoid time-consuming tasks or call blocking APIs (such as SendMessage), otherwise, the SDK may not work properly.