Public Member Functions | |
virtual | ~IRtcEngineEventHandler () |
virtual void | onWarning (int warn, const char *msg) |
virtual void | onError (int err, const char *msg) |
virtual void | onJoinChannelSuccess (const char *channel, uid_t uid, int elapsed) |
virtual void | onRejoinChannelSuccess (const char *channel, uid_t uid, int elapsed) |
virtual void | onLeaveChannel (const RtcStats &stats) |
virtual void | onClientRoleChanged (CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole) |
virtual void | onUserJoined (uid_t uid, int elapsed) |
virtual void | onUserOffline (uid_t uid, USER_OFFLINE_REASON_TYPE reason) |
virtual void | onLastmileQuality (int quality) |
virtual void | onLastmileProbeResult (const LastmileProbeResult &result) |
virtual void | onConnectionInterrupted () |
virtual void | onConnectionLost () |
virtual void | onConnectionBanned () |
virtual void | onApiCallExecuted (int err, const char *api, const char *result) |
virtual void | onRequestToken () |
virtual void | onTokenPrivilegeWillExpire (const char *token) |
virtual void | onAudioQuality (uid_t uid, int quality, unsigned short delay, unsigned short lost) |
virtual void | onRtcStats (const RtcStats &stats) |
virtual void | onNetworkQuality (uid_t uid, int txQuality, int rxQuality) |
virtual void | onLocalVideoStats (const LocalVideoStats &stats) |
virtual void | onRemoteVideoStats (const RemoteVideoStats &stats) |
virtual void | onLocalAudioStats (const LocalAudioStats &stats) |
virtual void | onRemoteAudioStats (const RemoteAudioStats &stats) |
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 | onAudioVolumeIndication (const AudioVolumeInfo *speakers, unsigned int speakerNumber, int totalVolume) |
virtual void | onActiveSpeaker (uid_t uid) |
virtual void | onVideoStopped () |
virtual void | onFirstLocalVideoFrame (int width, int height, int elapsed) |
virtual void | onFirstRemoteVideoDecoded (uid_t uid, int width, int height, int elapsed) |
virtual void | onFirstRemoteVideoFrame (uid_t uid, int width, int height, int elapsed) |
virtual void | onUserMuteAudio (uid_t uid, bool muted) |
virtual void | onUserMuteVideo (uid_t uid, bool muted) |
virtual void | onUserEnableVideo (uid_t uid, bool enabled) |
virtual void | onAudioDeviceStateChanged (const char *deviceId, int deviceType, int deviceState) |
virtual void | onAudioDeviceVolumeChanged (MEDIA_DEVICE_TYPE deviceType, int volume, bool muted) |
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 | onAudioMixingFinished () |
virtual void | onAudioMixingStateChanged (fAUDIO_MIXING_STATE_TYPE state, AUDIO_MIXING_ERROR_TYPE errorCode) |
virtual void | onRemoteAudioMixingBegin () |
virtual void | onRemoteAudioMixingEnd () |
virtual void | onAudioEffectFinished (int soundId) |
virtual void | onFirstRemoteAudioDecoded (uid_t uid, int elapsed) |
virtual void | onVideoDeviceStateChanged (const char *deviceId, int deviceType, int deviceState) |
virtual void | onLocalVideoStateChanged (LOCAL_VIDEO_STREAM_STATE localVideoState, LOCAL_VIDEO_STREAM_ERROR error) |
virtual void | onVideoSizeChanged (uid_t uid, int width, int height, int rotation) |
virtual void | onRemoteVideoStateChanged (uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed) |
virtual void | onUserEnableLocalVideo (uid_t uid, bool enabled) |
virtual void | onStreamMessage (uid_t uid, int streamId, const char *data, size_t length) |
virtual void | onStreamMessageError (uid_t uid, int streamId, int code, int missed, int cached) |
virtual void | onMediaEngineLoadSuccess () |
virtual void | onMediaEngineStartCallSuccess () |
virtual void | onChannelMediaRelayStateChanged (CHANNEL_MEDIA_RELAY_STATE state, CHANNEL_MEDIA_RELAY_ERROR code) |
virtual void | onChannelMediaRelayEvent (CHANNEL_MEDIA_RELAY_EVENT code) |
virtual void | onFirstLocalAudioFrame (int elapsed) |
virtual void | onFirstRemoteAudioFrame (uid_t uid, int elapsed) |
virtual void | onRtmpStreamingStateChanged (const char *url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_ERROR errCode) |
virtual void | onStreamPublished (const char *url, int error) |
virtual void | onStreamUnpublished (const char *url) |
virtual void | onTranscodingUpdated () |
virtual void | onStreamInjectedStatus (const char *url, uid_t uid, int status) |
virtual void | onAudioRouteChanged (AUDIO_ROUTE_TYPE routing) |
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 | onMicrophoneEnabled (bool enabled) |
virtual void | onConnectionStateChanged (CONNECTION_STATE_TYPE state, CONNECTION_CHANGED_REASON_TYPE reason) |
virtual void | onNetworkTypeChanged (NETWORK_TYPE type) |
virtual void | onLocalUserRegistered (uid_t uid, const char *userAccount) |
virtual void | onUserInfoUpdated (uid_t uid, const UserInfo &info) |
The SDK uses the IRtcEngineEventHandler interface class to send callbacks to the application. The application inherits the methods of this interface class to retrieve these callbacks.
All methods in this interface class have default (empty) implementations. Therefore, the application can only inherit some required events. In the callbacks, avoid time-consuming tasks or calling blocking APIs, such as the SendMessage method. Otherwise, the SDK may not work properly.
|
inlinevirtual |
|
inlinevirtual |
Reports a warning during SDK runtime.
In most cases, the application can ignore the warning reported by the SDK because the SDK can usually fix the issue and resume running. For example, when losing connection with the server, the SDK may report WARN_LOOKUP_CHANNEL_TIMEOUT and automatically try to reconnect.
warn | Warning code: WARN_CODE_TYPE. |
msg | Pointer to the warning message. |
|
inlinevirtual |
Reports an error during SDK runtime.
In most cases, the SDK cannot fix the issue and resume running. The SDK requires the application to take action or informs the user about the issue.
For example, the SDK reports an ERR_START_CALL error when failing to initialize a call. The application informs the user that the call initialization failed and invokes the leaveChannel method to leave the channel.
err | Error code: ERROR_CODE_TYPE. |
msg | Pointer to the error message. |
|
inlinevirtual |
Occurs when a user joins a channel.
This callback notifies the application that a user joins a specified channel when the application calls the joinChannel method.
The channel name assignment is based on channelName
specified in the joinChannel method.
If the uid
is not specified in the joinChannel method, the server automatically assigns a uid
.
channel | Pointer to the channel name. |
uid | User ID of the user joining the channel. |
elapsed | Time elapsed (ms) from the user calling the joinChannel method until the SDK triggers this callback. |
|
inlinevirtual |
Occurs when a user rejoins the channel after disconnection 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.
channel | Pointer to the channel name. |
uid | User ID of the user rejoining the channel. |
elapsed | Time elapsed (ms) from starting to reconnect until the SDK triggers this callback. |
|
inlinevirtual |
Occurs when a user leaves the channel.
This callback notifies the application that a user leaves the channel when the application calls the leaveChannel method.
The application retrieves information, such as the call duration and statistics.
stats | Pointer to the statistics of the call: RtcStats. |
|
inlinevirtual |
Occurs when the user role switches in a live broadcast. For example, from a host to an audience or vice versa.
This callback notifies the application of a user role switch when the application calls the setClientRole method.
The SDK triggers this callback when the local user switches the user role by calling the setClientRole method after joining the channel.
oldRole | Role that the user switches from: CLIENT_ROLE_TYPE. |
newRole | Role that the user switches to: CLIENT_ROLE_TYPE. |
|
inlinevirtual |
Occurs when a remote user (Communication)/ host (Live Broadcast) joins the channel.
The SDK triggers this callback under one of the following circumstances:
uid | User ID of the user or host joining the channel. |
elapsed | Time delay (ms) from the local user calling the joinChannel method until the SDK triggers this callback. |
|
inlinevirtual |
Occurs when a remote user (Communication)/host (Live Broadcast) leaves the channel.
Reasons why the user is offline:
uid | User ID of the user leaving the channel or going offline. |
reason | Reason why the user is offline: USER_OFFLINE_REASON_TYPE. |
|
inlinevirtual |
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.
quality | The last mile network quality: QUALITY_TYPE. |
|
inlinevirtual |
Reports 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. See LastmileProbeResult. |
|
inlinevirtual |
DEPRECATED Occurs when the connection between the SDK and the server is interrupted.
Deprecated as of v2.3.2. Replaced by the onConnectionStateChanged(CONNECTION_STATE_RECONNECTING, CONNECTION_CHANGED_INTERRUPTED) callback.
The SDK triggers this callback when it loses connection with the server for more than four seconds after the connection is established.
After triggering this callback, the SDK tries reconnecting to the server. You can use this callback to implement pop-up reminders.
This callback is different from onConnectionLost:
If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel.
|
inlinevirtual |
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 the joinChannel method, whether or not it is in the channel.
This callback is different from onConnectionInterrupted:
If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel.
|
inlinevirtual |
DEPRECATED Deprecated as of v2.3.2. Replaced by the onConnectionStateChanged(CONNECTION_STATE_FAILED, CONNECTION_CHANGED_BANNED_BY_SERVER) callback.
Occurs when your connection is banned by the Agora Server.
|
inlinevirtual |
Occurs when a method is executed by the SDK.
err | The error code (ERROR_CODE_TYPE) returned by the SDK when a method call fails. If the SDK returns 0, then the method call is successful. |
api | Pointer to the method executed by the SDK. |
result | Pointer to the result of the method call. |
|
inlinevirtual |
Occurs when the token expires.
After a token is specified by calling the joinChannel method, if the SDK losses connection with the Agora server due to network issues, the token may expire after a certain period of time and a new token may be required to reconnect to the server.
This callback notifies the application to generate a new token. Call the renewToken method to renew the token.
|
inlinevirtual |
Occurs when the token expires in 30 seconds.
The user becomes offline if the token used in the joinChannel method expires. The SDK triggers this callback 30 seconds before the token expires to remind the application to get a new token. Upon receiving this callback, generate a new token on the server and call the renewToken method to pass the new token to the SDK.
token | Pointer to the token that expires in 30 seconds. |
|
inlinevirtual |
DEPRECATED Reports the statistics of the audio stream from each remote user/host.
Deprecated as of v2.3.2. Use the onRemoteAudioStats callback instead.
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 users/hosts sending audio streams, the SDK triggers this callback as many times.
uid | User ID of the speaker. |
quality | Audio quality of the user: QUALITY_TYPE. |
delay | Time delay (ms) of sending the audio packet from the sender to the receiver, including the time delay of audio sampling pre-processing, transmission, and the jitter buffer. |
lost | Packet loss rate (%) of the audio packet sent from the sender to the receiver. |
|
inlinevirtual |
Reports the statistics of the current call.
The SDK triggers this callback once every two seconds after the user joins the channel.
stats | Statistics of the RtcEngine: RtcStats. |
|
inlinevirtual |
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, the SDK triggers this callback as many times.
uid | User ID. The network quality of the user with this uid is reported. If uid is 0, the local network quality is reported. |
txQuality | Uplink transmission quality rating of the user in terms of the transmission bitrate, packet loss rate, average RTT (Round-Trip Time), and jitter of the uplink network. txQuality is a quality rating helping you understand how well the current uplink network conditions can support the selected VideoEncoderConfiguration. 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-broadcast 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 the packet loss rate, average RTT, and jitter of the downlink network. See QUALITY_TYPE. |
|
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.
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/host. If a channel includes multiple remote users, the SDK triggers this callback as many times.
stats | Statistics of the remote video stream. See RemoteVideoStats. |
|
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.
This callback replaces the onAudioQuality callback.
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.
stats | Pointer to the statistics of the received remote audio streams. See RemoteAudioStats. |
|
inlinevirtual |
Occurs when the local audio 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.
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.
This callback indicates the state change 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 |
Reports which users are speaking, the speakers' volume and whether the local user is speaking.
This callback reports the IDs and volumes of the loudest speakers (at most 3 users) 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 the enableAudioVolumeIndication method. Once enabled, this callback is triggered at the set interval, regardless of whether a user speaks or not.
The SDK triggers two independent onAudioVolumeIndication
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.
report_vad
(true) in the enableAudioVolumeIndication
method.speakers
array in the onAudioVolumeIndication callback suggests that no remote user is speaking at the moment.speakers | A pointer to AudioVolumeInfo:
|
speakerNumber | Total number of speakers. The value range is [0, 3].
|
totalVolume | Total volume after audio mixing. The value ranges between 0 (lowest volume) and 255 (highest volume).
|
|
inlinevirtual |
Reports which user is the loudest speaker.
If the user enables the audio volume indication by calling the enableAudioVolumeIndication method, this callback returns the uid
of the active speaker detected by the audio volume detection module of the SDK.
uid | User ID of the active speaker. A uid of 0 represents the local user. |
|
inlinevirtual |
DEPRECATED Occurs when the video stops playing.
The application can use this callback to change the configuration of the view (for example, displaying other pictures in the view) after the video stops playing.
Deprecated as of v2.4.1. Use LOCAL_VIDEO_STREAM_STATE_STOPPED(0) in the onLocalVideoStateChanged callback instead.
|
inlinevirtual |
Occurs when the first local video frame is displayed/rendered on the local video view.
width | Width (px) of the first local video frame. |
height | 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 remote video frame is received and decoded.
This callback is triggered in either of the following scenarios:
The application can configure the user view settings in this callback.
uid | User ID of the remote user sending the video stream. |
width | Width (px) of the video stream. |
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. |
|
inlinevirtual |
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 retrieve the time elapsed from a user joining the channel until the first video frame is displayed.
uid | User ID of the remote user sending the video stream. |
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. |
|
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.
uid | User ID of the remote user. |
muted | Whether the remote user's audio stream is muted/unmuted:
|
|
inlinevirtual |
Occurs when a remote user's video stream playback pauses/resumes.
You can also use the onRemoteVideoStateChanged callback with the following parameters:
The SDK triggers this callback when the remote user stops or resumes sending the video stream by calling the muteLocalVideoStream method.
uid | User ID of the remote user. |
muted | Whether the remote user's video stream playback is paused/resumed:
|
|
inlinevirtual |
Occurs when a specific 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.
uid | User ID of the remote user. |
enabled | Whether the remote user enables/disables the video module:
|
|
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 | Pointer to the device ID. |
deviceType | Device type: MEDIA_DEVICE_TYPE. |
deviceState | Device state: MEDIA_DEVICE_STATE_TYPE. |
|
inlinevirtual |
Occurs when the volume of the playback device, microphone, or application changes.
deviceType | Device type: MEDIA_DEVICE_TYPE. |
volume | Volume of the device. The value ranges between 0 and 255. |
muted |
|
|
inlinevirtual |
DEPRECATED Occurs when the camera turns on and is ready to capture the video.
If the camera fails to turn on, fix the error reported in the onError callback.
Deprecated as of v2.4.1. Use LOCAL_VIDEO_STREAM_STATE_CAPTURING (1) in the onLocalVideoStateChanged callback instead.
|
inlinevirtual |
Occurs when the camera focus area changes.
The SDK triggers this callback when the local user changes the camera focus position by calling the setCameraFocusPositionInPreview method.
x | x coordinate of the changed camera focus area. |
y | y coordinate of the changed camera focus area. |
width | Width of the changed camera focus area. |
height | Height of the changed camera focus area. |
|
inlinevirtual |
Occurs when the camera exposure area changes.
The SDK triggers this callback when the local user changes the camera exposure position by calling the setCameraExposurePosition method.
x | x coordinate of the changed camera exposure area. |
y | y coordinate of the changed camera exposure area. |
width | Width of the changed camera exposure area. |
height | Height of the changed camera exposure area. |
|
inlinevirtual |
Occurs when the audio mixing file playback finishes.
DEPRECATED** use onAudioMixingStateChanged instead.
You can start an audio mixing file playback by calling the startAudioMixing method. The SDK triggers this callback when the audio mixing file playback finishes.
If the startAudioMixing method call fails, an error code returns in the onError callback.
|
inlinevirtual |
Occurs when the state of the local user's audio mixing file changes.
When you call the startAudioMixing method and the state of audio mixing file changes, the SDK triggers this callback.
state
, and 0 in errorCode
.state
and an error in errorCode
.state | The state code. See AUDIO_MIXING_STATE_TYPE. |
errorCode | The error code. See AUDIO_MIXING_ERROR_TYPE. |
|
inlinevirtual |
Occurs when a remote user starts audio mixing.
When a remote user calls startAudioMixing to play the background music, the SDK reports this callback.
|
inlinevirtual |
Occurs when a remote user finishes audio mixing.
|
inlinevirtual |
Occurs when the local audio effect playback finishes.
The SDK triggers this callback when the local audio effect file playback finishes.
soundId | ID of the local audio effect. Each local audio effect has a unique ID. |
|
inlinevirtual |
Occurs when the SDK decodes the first remote audio frame for playback.
This callback is triggered in either of the following scenarios:
uid | User ID of the remote user sending the audio stream. |
elapsed | Time elapsed (ms) from the local user calling the joinChannel method until the SDK triggers this callback. |
|
inlinevirtual |
Occurs when the video device state changes.
deviceId | Pointer to the device ID of the video device that changes state. |
deviceType | Device type: MEDIA_DEVICE_TYPE. |
deviceState | Device state: MEDIA_DEVICE_STATE_TYPE. |
|
inlinevirtual |
Occurs when the local video stream state changes.
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.
localVideoState | State type LOCAL_VIDEO_STREAM_STATE. When the state is LOCAL_VIDEO_STREAM_STATE_FAILED (3), see the error parameter for details. |
error | The detailed error information: LOCAL_VIDEO_STREAM_ERROR. |
|
inlinevirtual |
Occurs when the video size or rotation of a specified user changes.
uid | User ID of the remote user or local user (0) whose video size or rotation changes. |
width | New width (pixels) of the video. |
height | New height (pixels) of the video. |
rotation | New rotation of the video [0 to 360). |
|
inlinevirtual |
Occurs when the remote video state changes.
uid | ID of the remote user whose video state changes. |
state | State of the remote video. See REMOTE_VIDEO_STATE. |
reason | The reason of the remote video state change. See REMOTE_VIDEO_STATE_REASON. |
elapsed | Time elapsed (ms) from the local user calling the joinChannel method until the SDK triggers this callback. |
|
inlinevirtual |
Occurs when a specified remote user enables/disables the local video capturing function.
This callback is only applicable to the scenario when the user only wants to watch the remote video without sending any video stream to the other user.
The SDK triggers this callback when the remote user resumes or stops capturing the video stream by calling the enableLocalVideo method.
uid | User ID of the remote user. |
enabled | Whether the specified remote user enables/disables the local video capturing function:
|
|
inlinevirtual |
Occurs when the local user receives the data stream from the remote user within five seconds.
The SDK triggers this callback when the local user receives the stream message that the remote user sends by calling the sendStreamMessage method.
uid | User ID of the remote user sending the message. |
streamId | Stream ID. |
data | Pointer to the data received by the local user. |
length | Length of the data in bytes. |
|
inlinevirtual |
Occurs when the local user does not receive the data stream from the remote user within five seconds.
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.
uid | User ID of the remote user sending the message. |
streamId | Stream ID. |
code | Error code: ERROR_CODE_TYPE. |
missed | Number of lost messages. |
cached | Number of incoming cached messages when the data stream is interrupted. |
|
inlinevirtual |
Occurs when the media engine loads.
|
inlinevirtual |
Occurs when the media engine call starts.
|
inlinevirtual |
Occurs when the state of the media stream relay changes.
The SDK returns the state of the current media relay with any error message.
state | The state code in CHANNEL_MEDIA_RELAY_STATE. |
code | The error code in CHANNEL_MEDIA_RELAY_ERROR. |
|
inlinevirtual |
Reports events during the media stream relay.
code | The event code in CHANNEL_MEDIA_RELAY_EVENT. |
|
inlinevirtual |
Occurs when the engine sends the first local audio frame.
elapsed | Time elapsed (ms) from the local user calling joinChannel until the SDK triggers this callback. |
|
inlinevirtual |
Occurs when the engine receives the first audio frame from a specific remote user.
uid | User ID of the remote user. |
elapsed | Time elapsed (ms) from the remote user calling joinChannel until the SDK triggers this callback. |
|
inlinevirtual |
Occurs when the state of the RTMP streaming changes.
The SDK triggers this callback to report the result of the local user calling the addPublishStreamUrl or removePublishStreamUrl method.
This callback indicates the state of the RTMP streaming. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the errCode parameter.
url | The RTMP URL address. |
state | The RTMP streaming state. See: RTMP_STREAM_PUBLISH_STATE. |
errCode | The detailed error information for streaming. See: RTMP_STREAM_PUBLISH_ERROR. |
|
inlinevirtual |
Reports the result of calling the addPublishStreamUrl method. (CDN live only.)
url | The RTMP URL address. |
error | Error code: ERROR_CODE_TYPE. Main errors include:
|
|
inlinevirtual |
Reports the result of calling the removePublishStreamUrl method. (CDN live only.)
This callback indicates whether you have successfully removed an RTMP stream from the CDN.
url | The RTMP URL address. |
|
inlinevirtual |
Occurs when the publisher's transcoding is updated.
When the LiveTranscoding
class in the setLiveTranscoding method updates, the SDK triggers the onTranscodingUpdated
callback to report the update information to the local host.
setLiveTranscoding
method to set the LiveTranscoding class for the first time, the SDK does not trigger the onTranscodingUpdated
callback.
|
inlinevirtual |
Occurs when a voice or video stream URL address is added to a live broadcast.
url | Pointer to the URL address of the externally injected stream. |
uid | User ID. |
status | State of the externally injected stream: INJECT_STREAM_STATUS. |
|
inlinevirtual |
Occurs when the local audio route changes.
The SDK triggers this callback when the local audio route switches to an earpiece, speakerphone, headset, or Bluetooth device.
routing | Audio output routing. See: AUDIO_ROUTE_TYPE. |
|
inlinevirtual |
Occurs when the locally published media stream falls back to an audio-only stream due to poor network conditions or switches back to the video after the network conditions improve.
If you call setLocalPublishFallbackOption and set option as STREAM_FALLBACK_OPTION_AUDIO_ONLY, the SDK triggers this callback 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.
isFallbackOrRecover | Whether the locally published stream falls back to audio-only or switches 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 the video stream after the network conditions improve.
If you call setRemoteSubscribeFallbackOption and set option
as STREAM_FALLBACK_OPTION_AUDIO_ONLY, the SDK triggers this callback when the remote media stream falls back to audio-only mode due to poor uplink conditions, or when the remote media stream switches back to the video after the uplink network condition improves.
uid | ID of the remote user sending the stream. |
isFallbackOrRecover | Whether the remotely subscribed media stream falls back to audio-only or switches back to the video:
|
|
inlinevirtual |
Reports the transport-layer statistics of each remote audio stream.
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.
uid | User ID of the remote user sending the audio packet. |
delay | Network time delay (ms) from the remote user sending the audio packet to the local user. |
lost | 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.
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.
uid | User ID of the remote user sending the video packet. |
delay | Network time delay (ms) from the remote user sending the video packet to the local user. |
lost | Packet loss rate (%) of the video packet sent from the remote user. |
rxKBitRate | Received bitrate (Kbps) of the video packet sent from the remote user. |
|
inlinevirtual |
DEPRECATED Occurs when the microphone is enabled/disabled.
The onMicrophoneEnabled callback is deprecated. Use LOCAL_AUDIO_STREAM_STATE_STOPPED (0) or LOCAL_AUDIO_STREAM_STATE_RECORDING (1) in the onLocalAudioStateChanged callback instead.
The SDK triggers this callback when the local user resumes or stops capturing the local audio stream by calling the enbaleLocalAudio method.
enabled | Whether the microphone is enabled/disabled:
|
|
inlinevirtual |
Occurs when the connection state between the SDK and the server changes.
state | See CONNECTION_STATE_TYPE. |
reason | See CONNECTION_CHANGED_REASON_TYPE. |
|
inlinevirtual |
Occurs when the local network type changes.
When the network connection is interrupted, this callback indicates whether the interruption is caused by a network type change or poor network conditions.
type | See NETWORK_TYPE. |
|
inlinevirtual |
Occurs when the local user successfully registers a user account by calling the registerLocalUserAccount method or joins a channel by calling the joinChannelWithUserAccount method.This callback reports the user ID and user account of the local user.
uid | The ID of the local user. |
userAccount | The user account of the local user. |
|
inlinevirtual |
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. |