Agora RTC Objective-C API Reference
Refactor
|
Inherited by IRtcEngineEventHandlerEx.
Public Member Functions | |
virtual void | onJoinChannelSuccess (const char *channel, uid_t uid, int elapsed) |
virtual void | onRejoinChannelSuccess (const char *channel, uid_t uid, int elapsed) |
virtual void | onProxyConnected (const char *channel, uid_t uid, PROXY_TYPE proxyType, const char *localProxyIp, int elapsed) |
virtual void | onError (int err, const char *msg) |
virtual void | onAudioQuality (uid_t uid, int quality, unsigned short delay, unsigned short lost) |
virtual void | onLastmileProbeResult (const LastmileProbeResult &result) |
virtual void | onAudioVolumeIndication (const AudioVolumeInfo *speakers, unsigned int speakerNumber, int totalVolume) |
virtual void | onLeaveChannel (const RtcStats &stats) |
virtual void | onRtcStats (const RtcStats &stats) |
virtual void | onAudioDeviceStateChanged (const char *deviceId, int deviceType, int deviceState) |
virtual void | onVideoDeviceStateChanged (const char *deviceId, int deviceType, int deviceState) |
virtual void | onNetworkQuality (uid_t uid, int txQuality, int rxQuality) |
virtual void | onIntraRequestReceived () |
virtual void | onUplinkNetworkInfoUpdated (const UplinkNetworkInfo &info) |
virtual void | onDownlinkNetworkInfoUpdated (const DownlinkNetworkInfo &info) |
virtual void | onLastmileQuality (int quality) |
virtual void | onFirstLocalVideoFrame (VIDEO_SOURCE_TYPE source, int width, int height, int elapsed) |
virtual void | onFirstLocalVideoFramePublished (VIDEO_SOURCE_TYPE source, int elapsed) |
virtual void | onFirstRemoteVideoDecoded (uid_t uid, int width, int height, int elapsed) 1 |
virtual void | onVideoSizeChanged (VIDEO_SOURCE_TYPE sourceType, uid_t uid, int width, int height, int rotation) |
virtual void | onLocalVideoStateChanged (VIDEO_SOURCE_TYPE source, LOCAL_VIDEO_STREAM_STATE state, LOCAL_VIDEO_STREAM_ERROR error) |
virtual void | onRemoteVideoStateChanged (uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed) |
virtual void | onFirstRemoteVideoFrame (uid_t userId, int width, int height, int elapsed) |
virtual void | onUserJoined (uid_t uid, int elapsed) |
virtual void | onUserOffline (uid_t uid, USER_OFFLINE_REASON_TYPE reason) |
virtual void | onUserMuteAudio (uid_t uid, bool muted) |
virtual void | onUserMuteVideo (uid_t userId, bool muted) |
virtual void | onUserEnableVideo (uid_t uid, bool enabled) 1 |
virtual void | onUserStateChanged (uid_t uid, uint32_t state) |
virtual void | onUserEnableLocalVideo (uid_t uid, bool enabled) 1 |
virtual void | onApiCallExecuted (int err, const char *api, const char *result) 1 |
virtual void | onLocalAudioStats (const LocalAudioStats &stats) |
virtual void | onRemoteAudioStats (const RemoteAudioStats &stats) |
virtual void | onLocalVideoStats (VIDEO_SOURCE_TYPE source, const LocalVideoStats &stats) |
virtual void | onRemoteVideoStats (const RemoteVideoStats &stats) |
virtual void | onCameraReady () |
virtual void | onCameraFocusAreaChanged (int x, int y, int width, int height) |
virtual void | onCameraExposureAreaChanged (int x, int y, int width, int height) |
virtual void | onVideoStopped () |
virtual void | onRhythmPlayerStateChanged (RHYTHM_PLAYER_STATE_TYPE state, RHYTHM_PLAYER_ERROR_TYPE errorCode) |
virtual void | onConnectionLost () |
virtual void | onConnectionInterrupted () |
virtual void | onConnectionBanned () |
virtual void | onStreamMessage (uid_t userId, int streamId, const char *data, size_t length, uint64_t sentTs) |
virtual void | onStreamMessageError (uid_t userId, int streamId, int code, int missed, int cached) |
virtual void | onRequestToken () |
virtual void | onTokenPrivilegeWillExpire (const char *token) |
virtual void | onLicenseValidationFailure (LICENSE_ERROR_TYPE error) |
virtual void | onFirstLocalAudioFramePublished (int elapsed) |
virtual void | onFirstRemoteAudioFrame (uid_t uid, int elapsed) |
virtual void | onFirstRemoteAudioDecoded (uid_t uid, int elapsed) |
virtual void | onLocalAudioStateChanged (LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_ERROR error) |
virtual void | onRemoteAudioStateChanged (uid_t uid, REMOTE_AUDIO_STATE state, REMOTE_AUDIO_STATE_REASON reason, int elapsed) |
virtual void | onActiveSpeaker (uid_t userId) |
virtual void | onContentInspectResult (media::CONTENT_INSPECT_RESULT result) |
virtual void | onSnapshotTaken (uid_t uid, const char *filePath, int width, int height, int errCode) |
virtual void | onClientRoleChanged (CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole, const ClientRoleOptions &newRoleOptions) |
virtual void | onClientRoleChangeFailed (CLIENT_ROLE_CHANGE_FAILED_REASON reason, CLIENT_ROLE_TYPE currentRole) |
virtual void | onAudioDeviceVolumeChanged (MEDIA_DEVICE_TYPE deviceType, int volume, bool muted) |
virtual void | onRtmpStreamingStateChanged (const char *url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_ERROR_TYPE errCode) |
virtual void | onRtmpStreamingEvent (const char *url, RTMP_STREAMING_EVENT eventCode) |
virtual void | onTranscodingUpdated () |
virtual void | onAudioRoutingChanged (int routing) |
virtual void | onChannelMediaRelayStateChanged (int state, int code) |
virtual void | onChannelMediaRelayEvent (int code) |
virtual void | onLocalPublishFallbackToAudioOnly (bool isFallbackOrRecover) |
virtual void | onRemoteSubscribeFallbackToAudioOnly (uid_t uid, bool isFallbackOrRecover) |
virtual void | onRemoteAudioTransportStats (uid_t uid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate) |
virtual void | onRemoteVideoTransportStats (uid_t uid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate) |
virtual void | onConnectionStateChanged (CONNECTION_STATE_TYPE state, CONNECTION_CHANGED_REASON_TYPE reason) |
virtual void | onWlAccMessage (WLACC_MESSAGE_REASON reason, WLACC_SUGGEST_ACTION action, const char *wlAccMsg) |
virtual void | onWlAccStats (WlAccStats currentStats, WlAccStats averageStats) |
virtual void | onNetworkTypeChanged (NETWORK_TYPE type) |
virtual void | onEncryptionError (ENCRYPTION_ERROR_TYPE errorType) |
virtual void | onPermissionError (PERMISSION_TYPE permissionType) |
virtual void | onLocalUserRegistered (uid_t uid, const char *userAccount) |
virtual void | onUserInfoUpdated (uid_t uid, const UserInfo &info) |
virtual void | onUploadLogResult (const char *requestId, bool success, UPLOAD_ERROR_REASON reason) |
virtual void | onAudioSubscribeStateChanged (const char *channel, uid_t uid, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState) |
virtual void | onVideoSubscribeStateChanged (const char *channel, uid_t uid, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState) |
virtual void | onAudioPublishStateChanged (const char *channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState) |
virtual void | onVideoPublishStateChanged (VIDEO_SOURCE_TYPE source, const char *channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState) |
virtual void | onExtensionEvent (const char *provider, const char *extension, const char *key, const char *value) |
virtual void | onExtensionStarted (const char *provider, const char *extension) |
virtual void | onExtensionStopped (const char *provider, const char *extension) |
virtual void | onExtensionError (const char *provider, const char *extension, int error, const char *message) |
virtual void | onUserAccountUpdated (uid_t uid, const char *userAccount) |
The IRtcEngineEventHandler class.
The SDK uses this class to send callback event notifications to the app, and the app inherits the methods in this class to retrieve these event notifications.
All methods in this class have their default (empty) implementations, and the app can inherit only some of the required events instead of all. In the callback methods, the app should avoid time-consuming tasks or calling blocking APIs, otherwise the SDK may not work properly.
|
inlinevirtual |
|
inlinevirtual |
Reimplemented in IRtcEngineEventHandlerEx.
|
inlinevirtual |
Occurs when a user joins a channel.
This callback notifies the application that a user joins a specified channel.
channel | The channel name. |
uid | The ID of the user who joins the channel. |
elapsed | The time elapsed (ms) from the local user calling joinChannel until the SDK triggers this callback. |
|
inlinevirtual |
Occurs when a user rejoins the channel.
When a user loses connection with the server because of network problems, the SDK automatically tries to reconnect and triggers this callback upon reconnection.
channel | The channel name. |
uid | The ID of the user who rejoins the channel. |
elapsed | Time elapsed (ms) from the local user calling the joinChannel method until this callback is triggered. |
|
inlinevirtual |
Occurs when join success after calling setLocalAccessPoint or setCloudProxy
channel | Channel name. |
uid | User ID of the user joining the channel. |
proxyType | type of proxy agora sdk connected, proxyType will be NONE_PROXY_TYPE if not connected to proxy(fallback). |
localProxyIp | local proxy ip. if not join local proxy, it will be "". |
elapsed | Time elapsed (ms) from the user calling the joinChannel method until the SDK triggers this callback. |
|
inlinevirtual |
An error occurs during the SDK runtime.
err | The error code: ERROR_CODE_TYPE. |
msg | The detailed error message. |
|
inlinevirtual |
Reports the statistics of the audio stream from each remote user/broadcaster.
The SDK triggers this callback once every two seconds to report the audio quality of each remote user/host sending an audio stream. If a channel has multiple remote users/hosts sending audio streams, the SDK triggers this callback as many times.
uid | The user ID of the remote user sending the audio stream. |
quality | The audio quality of the user: QUALITY_TYPE |
delay | The network delay (ms) from the sender to the receiver, including the delay caused by audio sampling pre-processing, network transmission, and network jitter buffering. |
lost | The audio packet loss rate (%) from the sender to the receiver. |
|
inlinevirtual |
Reports the result of the last-mile network probe result.
The SDK triggers this callback within 30 seconds after the app calls the startLastmileProbeTest
method.
result | The uplink and downlink last-mile network probe test result: LastmileProbeResult. |
|
inlinevirtual |
Reports the volume information of users.
By default, this callback is disabled. You can enable it by calling enableAudioVolumeIndication
. Once this callback is enabled and users send streams in the channel, the SDK triggers the onAudioVolumeIndication
callback at the time interval set in enableAudioVolumeIndication
. The SDK triggers two independent onAudioVolumeIndication
callbacks simultaneously, which separately report the volume information of the local user who sends a stream and the remote users (up to three) whose instantaneous volume is the highest.
speakers | The volume information of the users, see AudioVolumeInfo. An empty speakers array in the callback indicates that no remote user is in the channel or sending a stream at the moment. |
speakerNumber | The total number of speakers.
|
totalVolume | The volume of the speaker. The value ranges between 0 (lowest volume) and 255 (highest volume).
|
|
inlinevirtual |
Occurs when a user leaves a channel.
This callback notifies the app that the user leaves the channel by calling leaveChannel
. From this callback, the app can get information such as the call duration and quality statistics.
stats | The statistics on the call: RtcStats. |
|
inlinevirtual |
Reports the statistics of the current call.
The SDK triggers this callback once every two seconds after the user joins the channel.
stats | The statistics of the current call: RtcStats. |
|
inlinevirtual |
Occurs when the audio device state changes.
This callback notifies the application that the system's audio device state is changed. For example, a headset is unplugged from the device.
deviceId | The device ID. |
deviceType | The device type: MEDIA_DEVICE_TYPE. |
deviceState | The device state:
|
|
inlinevirtual |
Occurs when the video device state changes.
This callback notifies the application that the system's video device state is changed.
deviceId | Pointer to the device ID. |
deviceType | Device type: MEDIA_DEVICE_TYPE. |
deviceState | Device state: MEDIA_DEVICE_STATE_TYPE. |
|
inlinevirtual |
Reports the last mile network quality of each user in the channel.
This callback reports the last mile network conditions of each user in the channel. Last mile refers to the connection between the local device and Agora's edge server.
The SDK triggers this callback once every two seconds. If a channel includes multiple users, the SDK triggers this callback as many times.
txQuality
is UNKNOWN when the user is not sending a stream; rxQuality
is UNKNOWN when the user is not receiving a stream.uid | The user ID. The network quality of the user with this user ID is reported. |
txQuality | Uplink network quality rating of the user in terms of the transmission bit rate, packet loss rate, average RTT (Round-Trip Time) and jitter of the uplink network. This parameter is a quality rating helping you understand how well the current uplink network conditions can support the selected video encoder configuration. For example, a 1000 Kbps uplink network may be adequate for video frames with a resolution of 640 × 480 and a frame rate of 15 fps in the LIVE_BROADCASTING profile, but may be inadequate for resolutions higher than 1280 × 720. See QUALITY_TYPE. |
rxQuality | Downlink network quality rating of the user in terms of packet loss rate, average RTT, and jitter of the downlink network. See QUALITY_TYPE. |
|
inlinevirtual |
Occurs when intra request from remote user is received.
This callback is triggered once remote user needs one Key frame.
Reimplemented in IRtcEngineEventHandlerEx.
|
inlinevirtual |
Occurs when uplink network info is updated.
The SDK triggers this callback when the uplink network information changes.
info | The uplink network information. See UplinkNetworkInfo. |
|
inlinevirtual |
Occurs when downlink network info is updated.
This callback is used for notifying user to switch major/minor stream if needed.
info | The downlink network info collections. |
|
inlinevirtual |
Reports the last-mile network quality of the local user.
This callback reports the last-mile network conditions of the local user before the user joins the channel. Last mile refers to the connection between the local device and Agora's edge server.
When the user is not in a channel and the last-mile network test is enabled (by calling startLastmileProbeTest
), this callback function is triggered to update the app on the network connection quality of the local user.
quality | The last mile network quality. See QUALITY_TYPE. |
|
inlinevirtual |
Occurs when the first local video frame is rendered on the local video view.
source | The video source: VIDEO_SOURCE_TYPE. |
width | The width (px) of the first local video frame. |
height | The height (px) of the first local video frame. |
elapsed | Time elapsed (ms) from the local user calling the joinChannel method until the SDK triggers this callback. If you call the startPreview method before calling the joinChannel method, then elapsed is the time elapsed from calling the startPreview method until the SDK triggers this callback. |
|
inlinevirtual |
Occurs when the first local video frame is published. The SDK triggers this callback under one of the following circumstances:
joinChannel
successfully.muteLocalVideoStream(true)
and muteLocalVideoStream(false) in sequence.disableVideo
and enableVideo
in sequence.pushVideoFrame
to successfully push the video frame to the SDK. source | The video source type. |
elapsed | The time elapsed (ms) from the local user calling joinChannel` to the SDK triggers this callback. |
|
inlinevirtual |
Occurs when the first remote video frame is received and decoded.
The SDK triggers this callback under one of the following circumstances:
muteLocalVideoStream
to stop sending the video stream.disableVideo
to disable video.uid | The user ID of the remote user sending the video stream. |
width | The width (pixels) of the video stream. |
height | The height (pixels) of the video stream. |
elapsed | The time elapsed (ms) from the local user calling joinChannel until the SDK triggers this callback. |
|
inlinevirtual |
Occurs when the local or remote video size or rotation has changed.
sourceType | The video source type: VIDEO_SOURCE_TYPE. |
uid | The user ID. 0 indicates the local user. |
width | The new width (pixels) of the video. |
height | The new height (pixels) of the video. |
rotation | The rotation information of the video. |
|
inlinevirtual |
Occurs when the local video stream state changes.
When the state of the local video stream changes (including the state of the video capture and encoding), the SDK triggers this callback to report the current state. This callback indicates the state of the local video stream, including camera capturing and video encoding, and allows you to troubleshoot issues when exceptions occur.
The SDK triggers the onLocalVideoStateChanged callback with the state code of LOCAL_VIDEO_STREAM_STATE_FAILED
and error code of LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE
in the following situations:
When the camera outputs the captured video frames, if the video frames are the same for 15 consecutive frames, the SDK triggers the onLocalVideoStateChanged
callback with the state code of LOCAL_VIDEO_STREAM_STATE_CAPTURING
and error code of LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE
. 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.
source | The video source type: VIDEO_SOURCE_TYPE. |
state | The state of the local video. See LOCAL_VIDEO_STREAM_STATE. |
error | The detailed error information. See LOCAL_VIDEO_STREAM_ERROR. |
|
inlinevirtual |
Occurs when the remote video state changes.
uid | The ID of the user whose video state has changed. |
state | The remote video state: REMOTE_VIDEO_STATE. |
reason | The reason of the remote video state change: REMOTE_VIDEO_STATE_REASON. |
elapsed | The time elapsed (ms) from the local client calling joinChannel until this callback is triggered. |
|
inlinevirtual |
Occurs when the renderer receives the first frame of the remote video.
userId | The user ID of the remote user sending the video stream. |
width | The width (px) of the video frame. |
height | The height (px) of the video stream. |
elapsed | The time elapsed (ms) from the local user calling joinChannel until the SDK triggers this callback. |
|
inlinevirtual |
Occurs when a remote user or broadcaster joins the channel.
The SDK triggers this callback under one of the following circumstances:
joinChannel
method.uid | The ID of the remote user or broadcaster joining the channel. |
elapsed | The time elapsed (ms) from the local user calling joinChannel or setClientRole until this callback is triggered. |
|
inlinevirtual |
Occurs when a remote user or broadcaster goes offline.
There are two reasons for a user to go offline:
uid | The ID of the remote user or broadcaster who leaves the channel or drops offline. |
reason | The reason why the remote user goes offline: USER_OFFLINE_REASON_TYPE. |
|
inlinevirtual |
Occurs when a remote user's audio stream playback pauses/resumes.
The SDK triggers this callback when the remote user stops or resumes sending the audio stream by calling the muteLocalAudioStream
method.
COMMUNICATION
profile) or hosts (in the LIVE_BROADCASTING
profile) in the channel exceeds 17.uid | The user ID. |
muted | Whether the remote user's audio stream is muted/unmuted:
|
|
inlinevirtual |
Occurs when a remote user pauses or resumes sending the video stream.
When a remote user calls muteLocalVideoStream
to stop or resume publishing the video stream, the SDK triggers this callback to report the state of the remote user's publishing stream to the local user.
userId | ID of the remote user. |
muted | Whether the remote user stops publishing the video stream:
|
|
inlinevirtual |
Occurs when a remote user enables or disables the video module.
Once the video function is disabled, the users cannot see any video.
The SDK triggers this callback when a remote user enables or disables the video module by calling the enableVideo
or disableVideo
method.
uid | The ID of the remote user. |
enabled | Whether the video of the remote user is enabled:
|
|
inlinevirtual |
Occurs when the remote user state is updated.
uid | The uid of the remote user. |
state | The remote user state: REMOTE_USER_STATE. |
|
inlinevirtual |
Occurs when a remote user enables or disables local video capturing.
The SDK triggers this callback when the remote user resumes or stops capturing the video stream by calling the enableLocalVideo
method.
uid | The ID of the remote user. |
enabled | Whether the specified remote user enables/disables local video:
|
|
inlinevirtual |
Occurs when a method is executed by the SDK.
api | The method executed by the SDK. |
err | The error code returned by the SDK when the method call fails. If the SDK returns 0, then the method call is successful. |
result | The result of the method call. |
|
inlinevirtual |
Reports the statistics of the local audio stream.
The SDK triggers this callback once every two seconds.
stats | The statistics of the local audio stream. See LocalAudioStats. |
|
inlinevirtual |
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 who is sending audio streams. If a channel includes multiple remote users, the SDK triggers this callback as many times.
stats | Statistics of the received remote audio streams. See RemoteAudioStats. |
|
inlinevirtual |
Reports the statistics of the local video stream.
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.
enableDualStreamMode
method, this callback reports the statistics of the high-video stream (high bitrate, and high-resolution video stream).source | The video source type. See VIDEO_SOURCE_TYPE. |
stats | Statistics of the local video stream. See LocalVideoStats. |
|
inlinevirtual |
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. If a channel has multiple users/hosts sending video streams, the SDK triggers this callback as many times.
stats | Statistics of the remote video stream. See RemoteVideoStats. |
|
inlinevirtual |
Occurs when the camera turns on and is ready to capture the video.
LOCAL_VIDEO_STREAM_STATE_CAPTURING(1)
in onLocalVideoStateChanged instead. This callback indicates that the camera has been successfully turned on and you can start to capture video.
|
inlinevirtual |
Occurs when the camera focus area changes.
x | The x coordinate of the changed camera focus area. |
y | The y coordinate of the changed camera focus area. |
width | The width of the changed camera focus area. |
height | The height of the changed camera focus area. |
|
inlinevirtual |
Occurs when the camera exposure area changes.
x | The x coordinate of the changed camera exposure area. |
y | The y coordinate of the changed camera exposure area. |
width | The width of the changed camera exposure area. |
height | The height of the changed exposure area. |
|
inlinevirtual |
Occurs when the video stops playing.
LOCAL_VIDEO_STREAM_STATE_STOPPED(0)
in the onLocalVideoStateChanged callback instead.The app can use this callback to change the configuration of the view (for example, displaying other pictures in the view) after the video stops playing.
|
inlinevirtual |
Occurs when the state of the rhythm player changes. When you call the startRhythmPlayer method and the state of rhythm player changes, the SDK triggers this callback.
state | The state code. See #RHYTHM_PLAYER_STATE_TYPE. |
errorCode | The error code. See #RHYTHM_PLAYER_ERROR_TYPE. |
|
inlinevirtual |
Occurs when the SDK cannot reconnect to the 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.
Reimplemented in IRtcEngineEventHandlerEx.
|
inlinevirtual |
Occurs when the connection between the SDK and the server is interrupted.
onConnectionStateChanged
instead.The SDK triggers this callback when it loses connection with the serer for more than 4 seconds after the connection is established. After triggering this callback, the SDK tries to reconnect to the server. If the reconnection fails within a certain period (10 seconds by default), the onConnectionLost() callback is triggered. If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel.
Reimplemented in IRtcEngineEventHandlerEx.
|
inlinevirtual |
Occurs when your connection is banned by the Agora Server.
onConnectionStateChanged
instead. Reimplemented in IRtcEngineEventHandlerEx.
|
inlinevirtual |
Occurs when the local user receives the data stream from the remote user.
The SDK triggers this callback when the user receives the data stream that another user sends by calling the sendStreamMessage method.
userId | ID of the user who sends the data stream. |
streamId | The ID of the stream data. |
data | The data stream. |
length | The length (byte) of the data stream. |
sentTs | The time when the data stream sent. |
|
inlinevirtual |
Occurs when the local user does not receive the data stream from the remote user.
The SDK triggers this callback when the user fails to receive the data stream that another user sends by calling the sendStreamMessage method.
userId | ID of the user who sends the data stream. |
streamId | The ID of the stream data. |
code | The error code. |
missed | The number of lost messages. |
cached | The number of incoming cached messages when the data stream is interrupted. |
|
inlinevirtual |
Occurs when the token expires.
When the token expires during a call, the SDK triggers this callback to remind the app to renew the token.
Upon receiving this callback, generate a new token at your app server and call joinChannel
to pass the new token to the SDK.
Reimplemented in IRtcEngineEventHandlerEx.
|
inlinevirtual |
Occurs when the token will expire in 30 seconds.
When the token is about to expire in 30 seconds, the SDK triggers this callback to remind the app to renew the token.
Upon receiving this callback, generate a new token at your app server and call renewToken to pass the new Token to the SDK.
token | The token that will expire in 30 seconds. |
|
inlinevirtual |
Occurs when connection license verification fails.
You can know the reason accordding to error code
|
inlinevirtual |
Occurs when the first local audio frame is published.
The SDK triggers this callback under one of the following circumstances:
joinChannel
successfully.muteLocalAudioStream(true)
and muteLocalAudioStream(false)
in sequence.disableAudio
and enableAudio
in sequence.pushAudioFrame
to successfully push the audio frame to the SDK.elapsed | The time elapsed (ms) from the local user calling joinChannel to the SDK triggers this callback. |
|
inlinevirtual |
Occurs when the SDK receives the first audio frame from a specific remote user.
onRemoteAudioStateChanged
instead.uid | ID of the remote user. |
elapsed | The time elapsed (ms) from the loca user calling joinChannel until this callback is triggered. |
|
inlinevirtual |
Occurs when the SDK decodes the first remote audio frame for playback.
onRemoteAudioStateChanged
instead. The SDK triggers this callback under one of the following circumstances:uid | User ID of the remote user sending the audio stream. |
elapsed | The time elapsed (ms) from the loca user calling joinChannel until this callback is triggered. |
|
inlinevirtual |
Occurs when the local audio state changes.
When the state of the local audio stream changes (including the state of the audio capture and encoding), the SDK triggers this callback to report the current state. This callback indicates the state of the local audio stream, and allows you to troubleshoot issues when audio exceptions occur.
LOCAL_AUDIO_STREAM_STATE_FAILED(3)
, see the error
parameter for details.state | State of the local audio. See LOCAL_AUDIO_STREAM_STATE. |
error | The error information of the local audio. See LOCAL_AUDIO_STREAM_ERROR. |
|
inlinevirtual |
Occurs when the remote audio state changes.
When the audio state of a remote user (in the voice/video call channel) or host (in the live streaming channel) changes, the SDK triggers this callback to report the current state of the remote audio stream.
uid | ID of the remote user whose audio state changes. |
state | State of the remote audio. See REMOTE_AUDIO_STATE. |
reason | The reason of the remote audio state change. See REMOTE_AUDIO_STATE_REASON. |
elapsed | Time elapsed (ms) from the local user calling the joinChannel method until the SDK triggers this callback. |
|
inlinevirtual |
Occurs when an active speaker is detected.
After a successful call of enableAudioVolumeIndication
, the SDK continuously detects which remote user has the loudest volume. During the current period, the remote user, who is detected as the loudest for the most times, is the most active user.
When the number of users is no less than two and an active remote speaker exists, the SDK triggers this callback and reports the uid of the most active remote speaker.
onActiveSpeaker
callback only once.userId | The ID of the active speaker. A uid of 0 means the local user. |
|
inlinevirtual |
Reports result of content inspection.
result | The result of content inspection: #CONTENT_INSPECT_RESULT. |
|
inlinevirtual |
Reports the result of taking a video snapshot.
After a successful takeSnapshot
method call, the SDK triggers this callback to report whether the snapshot is successfully taken, as well as the details for that snapshot.
uid | The user ID. A uid of 0 indicates the local user. |
filePath | The local path of the snapshot. |
width | The width (px) of the snapshot. |
height | The height (px) of the snapshot. |
errCode | The message that confirms success or gives the reason why the snapshot is not successfully taken:
|
|
inlinevirtual |
Occurs when the user role switches in the interactive live streaming.
oldRole | The old role of the user: CLIENT_ROLE_TYPE. |
newRole | The new role of the user: CLIENT_ROLE_TYPE. |
newRoleOptions | The client role options of the new role: #ClientRoleOptions. |
|
inlinevirtual |
Occurs when the user role in a Live-Broadcast channel fails to switch, for example, from a broadcaster to an audience or vice versa.
reason | The reason for failing to change the client role: CLIENT_ROLE_CHANGE_FAILED_REASON. |
currentRole | The current role of the user: CLIENT_ROLE_TYPE. |
|
inlinevirtual |
Occurs when the audio device volume changes.
deviceType | The device type, see MEDIA_DEVICE_TYPE |
volume | The volume of the audio device. |
muted | Whether the audio device is muted:
|
|
inlinevirtual |
Occurs when the state of the RTMP streaming changes.
When the media push state changes, the SDK triggers this callback and reports the URL address and the current state of the media push. This callback indicates the state of the media push. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the error code.
url | The URL address where the state of the media push changes. |
state | The current state of the media push: RTMP_STREAM_PUBLISH_STATE. |
errCode | The detailed error information for the media push: RTMP_STREAM_PUBLISH_ERROR_TYPE. |
|
inlinevirtual |
Reports events during the media push.
url | The URL for media push. |
eventCode | The event code of media push. See RTMP_STREAMING_EVENT for details. |
|
inlinevirtual |
Occurs when the publisher's transcoding settings are updated.
When the LiveTranscoding
class in setLiveTranscoding updates, the SDK triggers this callback to report the update information.
setLiveTranscoding
method to set the LiveTranscoding
class for the first time, the SDK does not trigger this callback.
|
inlinevirtual |
Occurs when the local audio route changes (for Android, iOS, and macOS only).
The SDK triggers this callback when the local audio route switches to an earpiece, speakerphone, headset, or Bluetooth device.
routing | The current audio output routing:
|
|
inlinevirtual |
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.
state | The state code:
|
code | The error code:
|
|
inlinevirtual |
Reports events during the media stream relay.
code | The event code for media stream relay:
|
|
inlinevirtual |
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 STREAM_FALLBACK_OPTION_AUDIO_ONLY(2)
, 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 onRemoteVideoStateChanged
callback.
isFallbackOrRecover | Whether the published stream fell back to audio-only or switched back to the video:
|
|
inlinevirtual |
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 STREAM_FALLBACK_OPTION_AUDIO_ONLY(2)
, 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.
onRemoteVideoStats
callback.uid | ID of the remote user sending the stream. |
isFallbackOrRecover | Whether the remote media stream fell back to audio-only or switched back to the video:
|
|
inlinevirtual |
Reports the transport-layer statistics of each remote audio stream.
onRemoteAudioStats
instead.This callback reports the transport-layer statistics, such as the packet loss rate and network time delay, once every two seconds after the local user receives an audio packet from a remote user. During a call, when the user receives the audio packet sent by the remote user/host, the callback is triggered every 2 seconds.
uid | ID of the remote user whose audio data packet is received. |
delay | The network time delay (ms) from the sender to the receiver. |
lost | The Packet loss rate (%) of the audio packet sent from the remote user. |
rxKBitRate | Received bitrate (Kbps) of the audio packet sent from the remote user. |
|
inlinevirtual |
Reports the transport-layer statistics of each remote video stream.
onRemoteVideoStats
instead.This callback reports the transport-layer statistics, such as the packet loss rate and network time delay, once every two seconds after the local user receives a video packet from a remote user.
During a call, when the user receives the video packet sent by the remote user/host, the callback is triggered every 2 seconds.
uid | ID of the remote user whose video packet is received. |
delay | The network time delay (ms) from the remote user sending the video packet to the local user. |
lost | The packet loss rate (%) of the video packet sent from the remote user. |
rxKBitRate | The bitrate (Kbps) of the video packet sent from the remote user. |
|
inlinevirtual |
Occurs when the network connection state changes.
When the network connection state changes, the SDK triggers this callback and reports the current connection state and the reason for the change.
state | The current connection state. See #CONNECTION_STATE_TYPE. |
reason | The reason for a connection state change. See CONNECTION_CHANGED_REASON_TYPE. |
|
inlinevirtual |
Occurs when the WIFI message need be sent to the user.
reason | The reason of notifying the user of a message. |
action | Suggest an action for the user. |
wlAccMsg | The message content of notifying the user. |
|
inlinevirtual |
Occurs when SDK statistics wifi acceleration optimization effect.
currentStats | Instantaneous value of optimization effect. |
averageStats | Average value of cumulative optimization effect. |
|
inlinevirtual |
Occurs when the local network type changes.
This callback occurs when the connection state of the local user changes. You can get the connection state and reason for the state change 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.
type | The type of the local network connection. See NETWORK_TYPE. |
|
inlinevirtual |
Reports the built-in encryption errors.
When encryption is enabled by calling enableEncryption
, the SDK triggers this callback if an error occurs in encryption or decryption on the sender or the receiver side.
errorType | The error type. See ENCRYPTION_ERROR_TYPE. |
|
inlinevirtual |
Occurs when the SDK cannot get the device permission.
When the SDK fails to get the device permission, the SDK triggers this callback to report which device permission cannot be got.
permissionType | The type of the device permission. See PERMISSION_TYPE. |
|
inlinevirtual |
Occurs when the local user registers a user account.
After the local user successfully calls registerLocalUserAccount
to register the user account or calls joinChannelWithUserAccount
to join a channel, the SDK triggers the callback and informs the local user's UID and User Account.
uid | The ID of the local user. |
userAccount | The user account of the local user. |
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.
uid | The ID of the remote user. |
info | The UserInfo object that contains the user ID and user account of the remote user. |
|
inlinevirtual |
Reports the user log upload result
requestId | RequestId of the upload |
success | Is upload success |
reason | Reason of the upload, 0: OK, 1 Network Error, 2 Server Error. |
|
inlinevirtual |
Occurs when the audio subscribing state changes.
channel | The name of the channel. |
uid | The ID of the remote user. |
oldState | The previous subscribing status: STREAM_SUBSCRIBE_STATE. |
newState | The current subscribing status: STREAM_SUBSCRIBE_STATE. |
elapseSinceLastState | The time elapsed (ms) from the previous state to the current state. |
|
inlinevirtual |
Occurs when the video subscribing state changes.
channel | The name of the channel. |
uid | The ID of the remote user. |
oldState | The previous subscribing status: STREAM_SUBSCRIBE_STATE. |
newState | The current subscribing status: STREAM_SUBSCRIBE_STATE. |
elapseSinceLastState | The time elapsed (ms) from the previous state to the current state. |
|
inlinevirtual |
Occurs when the audio publishing state changes.
channel | The name of the channel. |
oldState | The previous publishing state: STREAM_PUBLISH_STATE. |
newState | The current publishing state: STREAM_PUBLISH_STATE. |
elapseSinceLastState | The time elapsed (ms) from the previous state to the current state. |
|
inlinevirtual |
Occurs when the video publishing state changes.
source | The video source type. |
channel | The name of the channel. |
oldState | The previous publishing state: STREAM_PUBLISH_STATE. |
newState | The current publishing state: STREAM_PUBLISH_STATE. |
elapseSinceLastState | The time elapsed (ms) from the previous state to the current state. |
|
inlinevirtual |
The event callback of the extension.
To listen for events while the extension is running, you need to register this callback.
provider | The name of the extension provider. |
extension | The name of the extension. |
key | The key of the extension. |
value | The value of the extension key. |
|
inlinevirtual |
Occurs when the extension is enabled.
After a successful call of enableExtension(true)
, the extension triggers this callback.
provider | The name of the extension provider. |
extension | The name of the extension. |
|
inlinevirtual |
Occurs when the extension is disabled.
After a successful call of enableExtension(false)
, the extension triggers this callback.
provider | The name of the extension provider. |
extension | The name of the extension. |
|
inlinevirtual |
Occurs when the extension runs incorrectly.
When calling enableExtension(true)
fails or the extension runs in error, the extension triggers this callback and reports the error code and reason.
provider | The name of the extension provider. |
extension | The name of the extension. |
error | The error code. For details, see the extension documentation provided by the extension provider. |
message | The error message. For details, see the extension documentation provided by the extension provider. |
|
inlinevirtual |
Occurs when the user account is updated.
uid | The user ID. |
userAccount | The user account. |