|
Agora RTC Objective-C API Reference
Refactor
|
Inherits <NSObject>.
CDN Live Streaming Delegate Methods | |
| (void) | - rtcEngine:rtmpStreamingChangedToState:state:reason: |
| (void) | - rtcEngine:rtmpStreamingEventWithUrl:eventCode: |
| (void) | - rtcEngine:audioMixingStateChanged:reasonCode: |
| (void) | - rtcEngine:audioMixingPositionChanged: |
| (void) | - rtcEngine:facePositionDidChangeWidth:previewHeight:faces: |
| (void) | - rtcEngine:didTranscodedStreamLayoutInfoUpdatedWithUserId:videoLayoutInfo: |
| (void) | - rtcEngine:multiPathStats: |
The AgoraRtcEngineDelegate protocol enables callback event notifications to your application.
The SDK uses delegate callbacks in the AgoraRtcEngineDelegate protocol to report runtime events to the application. From v1.1, some block callbacks in the SDK are replaced with delegate callbacks. The old block callbacks are therefore deprecated, but can still be used in the current version. However, Agora recommends replacing block callbacks with delegate callbacks. The SDK calls the block callback if a callback is defined in both the block and delegate callbacks.
| - (typedef NSUInteger) AgoraLocalVideoStreamError |
| - (typedef NSUInteger) AgoraAudioLocalError |
| - (typedef NSUInteger) AgoraRhythmPlayerError |
| - (typedef NSUInteger) AgoraRtmpStreamingErrorCode |
| - (void) rtcEngineRequestToken: | (AgoraRtcEngineKit *_Nonnull) | engine |
Occurs when the token expires.
The SDK triggers this callback if the token expires. When receiving this callback, you need to generate a new token on your token server and you can renew your token through one of the following ways:
renewToken: to pass in the new token.leaveChannel:leaveChannelBlock: to leave the current channel and then pass in the new token when you call joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: to join a channel.updateChannelExWithMediaOptions:connection: to pass in the new token.| engine | AgoraRtcEngineKit object. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| tokenPrivilegeWillExpire: | (NSString *_Nonnull) | token | |
Occurs when the token expires in 30 seconds.
When receiving this callback, you need to generate a new token on your token server and you can renew your token through one of the following ways:
renewToken: to pass in the new token.leaveChannel:leaveChannelBlock: to leave the current channel and then pass in the new token when you call joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: to join a channel.updateChannelExWithMediaOptions:connection: to pass in the new token. Call timing: The SDK triggers this callback 30 seconds before the token expires, reminding the app to update the token.| engine | AgoraRtcEngineKit object. |
| token | The token that is about to expire. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| renewTokenResult: | (NSString *_Nonnull) | token | |
| code: | (AgoraRenewTokenErrorCode) | code | |
Callback for renewToken: call result.
This callback is triggered after the user calls the renewToken: method to update the token, and is used to notify the app of the result.
| token | Token. |
| code | Error code. See AgoraRenewTokenErrorCode. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| licenseValidationFailure: | (AgoraLicenseVerifyCode) | error | |
Occurs when connection license verification fails
You can know the reason accordding to error code
| - (void) rtcEngineConnectionDidLost: | (AgoraRtcEngineKit *_Nonnull) | engine |
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 joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: method, regardless of whether it is in the channel. If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel.
| engine | AgoraRtcEngineKit object. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| networkTypeChanged: | (AgoraNetworkType) | type | |
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.
| engine | AgoraRtcEngineKit object. |
| type | The type of the local network connection. See AgoraNetworkType. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| permissionError: | (AgoraPermissionType) | type | |
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.
| engine | AgoraRtcEngineKit object. |
| type | The type of the device permission. See AgoraPermissionType. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| connectionChangedToState: | (AgoraConnectionState) | state | |
| reason: | (AgoraConnectionChangedReason) | reason | |
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.
| engine | AgoraRtcEngineKit object. |
| state | The current connection state. See AgoraConnectionState. |
| reason | The reason for a connection state change. See AgoraConnectionChangedReason. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| reportRtcStats: | (AgoraChannelStats *_Nonnull) | stats | |
Reports the statistics about the current call.
Call timing: The SDK triggers this callback once every two seconds after the user joins the channel.
| engine | AgoraRtcEngineKit object. |
| stats | Statistics of the RTC engine. See AgoraChannelStats. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| lastmileProbeTestResult: | (AgoraLastmileProbeResult *_Nonnull) | result | |
Reports the last mile network probe result.
The SDK triggers this callback within 30 seconds after the app calls startLastmileProbeTest:.
| engine | AgoraRtcEngineKit object. |
| result | The uplink and downlink last-mile network probe test result. See AgoraLastmileProbeResult. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| uploadLogResultRequestId: | (NSString *_Nonnull) | requestId | |
| success: | (BOOL) | success | |
| reason: | (AgoraUploadErrorReason) | reason | |
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. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didJoinChannel: | (NSString *_Nonnull) | channel | |
| withUid: | (NSUInteger) | uid | |
| elapsed: | (NSInteger) | elapsed | |
Occurs when a user joins the channel.
This callback notifies the application that a user joins a specified channel. Call timing: The SDK triggers this callback when you call joinChannelByToken:channelId:info:uid:joinSuccess:, joinChannelByToken:channelId:uid:mediaOptions:joinSuccess:, joinChannelByToken:channelId:userAccount:joinSuccess:, joinChannelByToken:channelId:userAccount:mediaOptions:joinSuccess:, joinChannelExByToken:connection:delegate:mediaOptions:joinSuccess: or joinChannelExByToken:channelId:userAccount:delegate:mediaOptions:joinSuccess: to join a channel.
| engine | AgoraRtcEngineKit object. |
| channel | The channel name. |
| uid | The ID of the user who rejoins the channel. |
| elapsed | Time elapsed (ms) from the local user calling joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: until the SDK triggers this callback. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didRejoinChannel: | (NSString *_Nonnull) | channel | |
| withUid: | (NSUInteger) | uid | |
| elapsed: | (NSInteger) | elapsed | |
Occurs when a user rejoins the channel.
Call timing: When a user loses connection with the server because of network problems, the SDK automatically tries to reconnect and triggers this callback upon reconnection.
| engine | AgoraRtcEngineKit object. |
| channel | The channel name. |
| uid | The ID of the user who rejoins the channel. |
| elapsed | Time elapsed (ms) from the local user calling joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: until the SDK triggers this callback. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didClientRoleChanged: | (AgoraClientRole) | oldRole | |
| newRole: | (AgoraClientRole) | newRole | |
| newRoleOptions: | (AgoraClientRoleOptions *_Nullable) | newRoleOptions | |
Occurs when the user role or the audience latency level changes.
Call timing: This callback will be triggered in any of the following situations:
setClientRole: or setClientRole:options: to set the user role or audience latency level after joining a channelsetClientRole: or setClientRole:options: and set the user role to AUDIENCE before joining a channel.setClientRole: or setClientRole:options: and set the user role to BROADCASTER before joining a channel.| engine | AgoraRtcEngineKit object. |
| oldRole | Role that the user switches from: AgoraClientRole. |
| newRole | Role that the user switches to: AgoraClientRole. |
| newRoleOptions | Since v4.1.0 Properties of the role that the user switches to. See AgoraClientRoleOptions. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didClientRoleChangeFailed: | (AgoraClientRoleChangeFailedReason) | reason | |
| currentRole: | (AgoraClientRole) | currentRole | |
Occurs when switching a user role fails.
This callback informs you about the reason for failing to switching and your current user role. Call timing: The SDK triggers this callback when the local user calls setClientRole: or setClientRole:options: after joining a channel to switch the user role but the switching fails.
| reason | The reason for a user role switch failure. See AgoraClientRoleChangeFailedReason. |
| currentRole | Current user role. See AgoraClientRole. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didLeaveChannelWithStats: | (AgoraChannelStats *_Nonnull) | stats | |
Occurs when a user leaves a channel.
You can obtain information such as the total duration of a call, and the data traffic that the SDK transmits and receives. Call timing: The SDK triggers this callback after you call leaveChannel:, leaveChannel:leaveChannelBlock:, leaveChannelEx:leaveChannelBlock:, or leaveChannelEx:options:leaveChannelBlock: to leave a channel.
| engine | AgoraRtcEngineKit object. |
| stats | Call statistics. See AgoraChannelStats. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| firstLocalAudioFramePublished: | (NSInteger) | elapsed | |
Occurs when the first audio frame is published.
The SDK triggers this callback under one of the following circumstances:
joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: successfully.muteLocalAudioStream: (YES) and muteLocalAudioStream: (NO) in sequence.disableAudio and enableAudio in sequence.pushExternalAudioFrameRawData:samples:sampleRate:channels:trackId:timestamp: to successfully push the audio frame to the SDK.| engine | AgoraRtcEngineKit object. |
| elapsed | Time elapsed (ms) from the local user calling joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: until the SDK triggers this callback. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| localAudioStats: | (AgoraRtcLocalAudioStats *_Nonnull) | stats | |
Reports the statistics of the local audio stream.
The SDK triggers this callback once every two seconds.
| engine | AgoraRtcEngineKit object. |
| stats | Local audio statistics. See AgoraRtcLocalAudioStats. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| localAudioStateChanged: | (AgoraAudioLocalState) | state | |
| reason: | (AgoraAudioLocalReason) | reason | |
Occurs when the local audio stream 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.
AgoraAudioLocalStateFailed (3), you can view the error information in the error parameter.| engine | AgoraRtcEngineKit object. |
| state | The state of the local audio. See AgoraAudioLocalState. |
| reason | Reasons for local audio state changes. See AgoraAudioLocalReason. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| cameraExposureDidChangedToRect: | (CGRect) | rect | |
Occurs when the camera exposure area changes.
The SDK triggers this callback when the local user changes the camera exposure position by calling setCameraExposurePosition:.
| engine | AgoraRtcEngineKit object. |
| rect | The focus rectangle in the local preview. See CGRect. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| firstLocalVideoFramePublishedWithElapsed: | (NSInteger) | elapsed | |
| sourceType: | (AgoraVideoSourceType) | sourceType | |
Occurs when the first video frame is published.
The SDK triggers this callback under one of the following circumstances:
joinChannelByToken:channelId:info:uid:joinSuccess: or joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: to join the channel successfully.muteLocalVideoStream: (YES) and muteLocalVideoStream: (NO) in sequence.disableVideo and enableVideo in sequence.pushExternalVideoFrame:videoTrackId: to successfully push the video frame to the SDK.| engine | AgoraRtcEngineKit object. |
| sourceType | The type of the video source. See AgoraVideoSourceType. |
| elapsed | Time elapsed (ms) from the local user calling joinChannelByToken:channelId:info:uid:joinSuccess: or joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: until this callback is triggered. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| firstLocalVideoFrameWithSize: | (CGSize) | size | |
| elapsed: | (NSInteger) | elapsed | |
| sourceType: | (AgoraVideoSourceType) | sourceType | |
Occurs when the first local video frame is displayed on the local video view.
The SDK triggers this callback when the first local video frame is displayed on the local video view.
| engine | AgoraRtcEngineKit object. |
| sourceType | The type of the video source. See AgoraVideoSourceType. |
| size | The size of the first local video frame. |
| elapsed | The time elapsed (ms) from the local user calling joinChannelByToken:channelId:info:uid:joinSuccess: or joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: to join the channel to when the SDK triggers this callback. If startPreview / startPreview: is called before joining the channel, this parameter indicates the time elapsed from calling startPreview or startPreview: to when this event occurred. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| localVideoStats: | (AgoraRtcLocalVideoStats *_Nonnull) | stats | |
| sourceType: | (AgoraVideoSourceType) | sourceType | |
Reports the statistics of the local video stream.
The SDK triggers this callback once every two seconds to report the statistics of the local video stream.
| engine | AgoraRtcEngineKit object. |
| sourceType | The type of the video source. See AgoraVideoSourceType. |
| stats | The statistics of the local video stream. See AgoraRtcLocalVideoStats. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| videoRenderingTracingResultOfUid: | (NSUInteger) | uid | |
| currentEvent: | (AgoraMediaTraceEvent) | currentEvent | |
| tracingInfo: | (AgoraVideoRenderingTracingInfo *_Nonnull) | tracingInfo | |
Video frame rendering event callback.
After calling the startMediaRenderingTracing method or joining a channel, the SDK triggers this callback to report the events of video frame rendering and the indicators during the rendering process. Developers can optimize the indicators to improve the efficiency of the first video frame rendering.
| uid | The user ID. |
| currentEvent | The current video frame rendering event. See AgoraMediaTraceEvent. |
| tracingInfo | The indicators during the video frame rendering process. Developers need to reduce the value of indicators as much as possible in order to improve the efficiency of the first video frame rendering. See AgoraVideoRenderingTracingInfo. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didJoinedOfUid: | (NSUInteger) | uid | |
| elapsed: | (NSInteger) | elapsed | |
Occurs when a remote user (in the communication profile)/ host (in the live streaming profile) joins the channel.
| engine | AgoraRtcEngineKit object. |
| uid | The ID of the user or host who joins the channel. |
| elapsed | Time delay (ms) from the local user calling joinChannelByToken:channelId:info:uid:joinSuccess: or joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: until this callback is triggered. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didOfflineOfUid: | (NSUInteger) | uid | |
| reason: | (AgoraUserOfflineReason) | reason | |
Occurs when a remote user (in the communication profile)/ host (in the live streaming profile) leaves the channel.
There are generally two reasons for users to become offline:
| engine | AgoraRtcEngineKit object. |
| uid | The ID of the user who leaves the channel or goes offline. |
| reason | Reasons why a remote user (in the communication profile) or host (in the live streaming profile) goes offline. See AgoraUserOfflineReason. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| receiveRdtMessageFromUid: | (NSUInteger) | uid | |
| type: | (AgoraRdtStreamType) | type | |
| data: | (NSData *_Nonnull) | data | |
Occurs when the local user receives data via Reliable Data Transmission (RDT) from a remote user.
@technical preview
| engine | The engine kit |
| uid | The remote user id |
| type | The stream type. See AgoraRdtStreamType. |
| data | The data received. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| receiveMediaControlMessageFromUid: | (NSUInteger) | uid | |
| data: | (NSData *_Nonnull) | data | |
Occurs when the local user receives media control message sent by a remote user.
@technical preview
| engine | The engine kit |
| uid | The remote user id |
| data | The data received. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| firstRemoteAudioFrameDecodedOfUid: | (NSUInteger) | uid | |
| elapsed: | (NSInteger) | elapsed | |
Occurs when the SDK receives the first audio frame from a specific remote user.
Deprecated from v3.0.0. Use AgoraAudioRemoteStateDecoding(2) in the [remoteAudioStateChangedOfUid]([AgoraRtcEngineDelegate rtcEngine:remoteAudioStateChangedOfUid:state:reason:elapsed:]) callback instead.
| engine | AgoraRtcEngineKit object. |
| uid | The user ID of the remote user. |
| elapsed | The time elapsed (ms) from the local user calling joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: until the SDK triggers this callback. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| remoteAudioStats: | (AgoraRtcRemoteAudioStats *_Nonnull) | stats | |
Reports the transport-layer statistics of each remote audio stream.
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.
| engine | AgoraRtcEngineKit object. |
| stats | The statistics of the received remote audio streams. See AgoraRtcRemoteAudioStats. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| reportAudioVolumeIndicationOfSpeakers: | (NSArray< AgoraRtcAudioVolumeInfo * > *_Nonnull) | speakers | |
| totalVolume: | (NSInteger) | totalVolume | |
Reports the volume information of users.
By default, this callback is disabled. You can enable it by calling enableAudioVolumeIndication:smooth:reportVad:. Once this callback is enabled and users send streams in the channel, the SDK triggers the rtcEngine:reportAudioVolumeIndicationOfSpeakers:totalVolume: callback according to the time interval set in enableAudioVolumeIndication:smooth:reportVad:. The SDK triggers two independent rtcEngine:reportAudioVolumeIndicationOfSpeakers:totalVolume: 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.
muteLocalAudioStream: method to mute, the SDK continues to report the volume indication of the local user. If a remote user whose volume is one of the three highest in the channel stops publishing the audio stream for 20 seconds, the callback excludes this user's information; if all remote users stop publishing audio streams for 20 seconds, the SDK stops triggering the callback for remote users.| engine | AgoraRtcEngineKit object. |
| speakers | The volume information of the users. See AgoraRtcAudioVolumeInfo. An empty speakers array in the callback indicates that no remote user is in the channel or is sending a stream. |
| totalVolume | The volume of the speaker. The value range is [0,255].
|
| - (void) rtcEngineIntraRequestReceived: | (AgoraRtcEngineKit *_Nonnull) | engine |
Intra request received.
| engine | The AgoraRtcEngineKit object. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| uplinkNetworkInfoUpdate: | (AgoraUplinkNetworkInfo *_Nonnull) | networkInfo | |
Occurs when the uplink network information changes.
The SDK triggers this callback when the uplink network information changes.
| engine | AgoraRtcEngineKit object. |
| networkInfo | The uplink network information. See AgoraUplinkNetworkInfo. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didAudioSubscribeStateChange: | (NSString *_Nonnull) | channelId | |
| uid: | (unsigned int) | uid | |
| oldState: | (AgoraStreamSubscribeState) | oldState | |
| newState: | (AgoraStreamSubscribeState) | newState | |
| elapseSinceLastState: | (int) | elapseSinceLastState | |
Occurs when the audio subscribing state changes.
| engine | AgoraRtcEngineKit object. |
| channelId | The channel name. |
| uid | The user ID of the remote user. |
| oldState | The previous subscribing status. See AgoraStreamSubscribeState. |
| newState | The current subscribing status. See AgoraStreamSubscribeState. |
| elapseSinceLastState | The time elapsed (ms) from the previous state to the current state. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didAudioPublishStateChange: | (NSString *_Nonnull) | channelId | |
| oldState: | (AgoraStreamPublishState) | oldState | |
| newState: | (AgoraStreamPublishState) | newState | |
| elapseSinceLastState: | (int) | elapseSinceLastState | |
Occurs when the audio publishing state changes.
| engine | AgoraRtcEngineKit object. |
| channelId | The channel name. |
| oldState | The previous publishing state. See AgoraStreamPublishState. |
| newState | The current publishing stat. See AgoraStreamPublishState. |
| elapseSinceLastState | The time elapsed (ms) from the previous state to the current state. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didLocalUserRegisteredWithUserId: | (NSUInteger) | uid | |
| userAccount: | (NSString *_Nonnull) | userAccount | |
Occurs when the local user registers a user account.
After the local user successfully calls registerLocalUserAccountWithAppID:userAccount: to register the user account or calls joinChannelByToken:channelId:userAccount:mediaOptions:joinSuccess: to join a channel, the SDK triggers the callback and informs the local user's UID and User Account.
| engine | AgoraRtcEngineKit object. |
| uid | The ID of the local user. |
| userAccount | The user account of the local user. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didUserInfoUpdatedWithUserId: | (NSUInteger) | uid | |
| userInfo: | (AgoraUserInfo *_Nonnull) | userInfo | |
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, and triggers this callback on the local client.
| engine | AgoraRtcEngineKit object. |
| uid | The user ID of the remote user. |
| userInfo | The UserInfo object that contains the user ID and user account of the remote user. See AgoraUserInfo for details. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didRhythmPlayerStateChanged: | (AgoraRhythmPlayerState) | state | |
| reason: | (AgoraRhythmPlayerReason) | reason | |
Occurs when the state of virtual metronome changes.
When the state of the virtual metronome changes, the SDK triggers this callback to report the current state of the virtual metronome. This callback indicates the state of the local audio stream and enables you to troubleshoot issues when audio exceptions occur.
| state | For the current virtual metronome status, see AgoraRhythmPlayerState. |
| reason | For the error codes and error messages related to virtual metronome errors, see AgoraRhythmPlayerReason. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didLocalVideoTranscoderErrorWithStream: | (AgoraTranscodingVideoStream *_Nonnull) | stream | |
| errorCode: | (AgoraVideoTranscoderError) | errorCode | |
Occurs when there's an error during the local video mixing.
When you fail to call startLocalVideoTranscoder: or updateLocalTranscoderConfiguration:, the SDK triggers this callback to report the reason.
| stream | The video streams that cannot be mixed during video mixing. See AgoraTranscodingVideoStream. |
| errorCode | The reason for local video mixing error. See AgoraVideoTranscoderError. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| videoSizeChangedOfSourceType: | (AgoraVideoSourceType) | sourceType | |
| uid: | (NSUInteger) | uid | |
| size: | (CGSize) | size | |
| rotation: | (NSInteger) | rotation | |
Occurs when the video size or rotation of a specified user changes.
| engine | AgoraRtcEngineKit object. |
| sourceType | The type of the video source. See AgoraVideoSourceType. |
| uid | The ID of the user whose video size or rotation changes. (The uidfor the local user is 0. The video is the local user's video preview). |
| size | Video dimensions. |
| rotation | The rotation information. The value range is [0,360). Attention: On iOS, The parameter value is always 0. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| contentInspectResult: | (AgoraContentInspectResult) | result | |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| snapshotTaken: | (NSUInteger) | uid | |
| filePath: | (NSString *_Nonnull) | filePath | |
| width: | (NSInteger) | width | |
| height: | (NSInteger) | height | |
| errCode: | (NSInteger) | errCode | |
Reports the result of taking a video snapshot.
After a successful takeSnapshot:filePath: method call, the SDK triggers this callback to report whether the snapshot is successfully taken as well as the details for the snapshot taken.
| engine | AgoraRtcEngineKit object. |
| uid | The user ID. One 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:
|
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| audioMetadataReceived: | (NSUInteger) | uid | |
| metadata: | (NSData *_Nonnull) | metadata | |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| localVideoStateChangedOfState: | (AgoraVideoLocalState) | state | |
| reason: | (AgoraLocalVideoStreamReason) | reason | |
| sourceType: | (AgoraVideoSourceType) | sourceType | |
Occurs when the local video stream state changes.
When the status of the local video changes, the SDK triggers this callback to report the current local video state and the reason for the state change. Applicable scenarios: You can use this callback to stay updated on the state changes of the local video stream, and take corresponding measures based on the reasons for the state changes, to better manage and debug issues related to the video stream. Call timing: - The SDK triggeres this callback under the following circumstances, with the state as AgoraVideoLocalStateFailed, and the reason as AgoraLocalVideoStreamReasonCaptureFailure:
When the camera outputs captured video frames, if the SDK detects 15 consecutive duplicate video frames, it triggers this callback, with the state as AgoraVideoLocalStateCapturing and the reason as AgoraLocalVideoStreamReasonCaptureFailure.Note:
reason parameter in this callback. However, on some devices, when there is an issue with capturing (such as freezing), the Android system will not throw any error callbacks, so the SDK cannot report the reason for the change in local video status. In this case, you can determine if there is no video frame being captured by checking the following: this callback reports the state as AgoraVideoLocalStateCapturing or AgoraVideoLocalStateEncoding, and the captureFrameRate in the rtcEngine:localVideoStats:sourceType: callback is 0.reason parameter in this callback. However, on some devices, when there is an issue with capturing (such as freezing), the Android system will not throw any error callbacks, so the SDK cannot report the reason for the change in local video status. In this case, you can determine if there is no video frame being captured by checking the following: this callback reports the state as AgoraVideoLocalStateCapturing or AgoraVideoLocalStateEncoding, and the captureFrameRate in the rtcEngine:localVideoStats:sourceType: callback is 0.| engine | AgoraRtcEngineKit object. |
| sourceType | The type of the video source. See AgoraVideoSourceType. |
| state | The state of the local video, see AgoraVideoLocalState. |
| reason | The reasons for changes in local video state. See AgoraLocalVideoStreamReason. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| remoteVideoStateChangedOfUid: | (NSUInteger) | uid | |
| state: | (AgoraVideoRemoteState) | state | |
| reason: | (AgoraVideoRemoteReason) | reason | |
| elapsed: | (NSInteger) | elapsed | |
Occurs when the remote video stream state changes.
| engine | AgoraRtcEngineKit object. |
| uid | The ID of the remote user whose video state changes. |
| state | The state of the remote video. See AgoraVideoRemoteState. |
| reason | The reason for the remote video state change. See AgoraVideoRemoteReason. |
| elapsed | Time elapsed (ms) from the local user calling the joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: method until the SDK triggers this callback. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| remoteAudioStateChangedOfUid: | (NSUInteger) | uid | |
| state: | (AgoraAudioRemoteState) | state | |
| reason: | (AgoraAudioRemoteReason) | reason | |
| elapsed: | (NSInteger) | elapsed | |
Occurs when the remote audio state changes.
When the audio state of a remote user (in a voice/video call channel) or host (in a live streaming channel) changes, the SDK triggers this callback to report the current state of the remote audio stream.
| engine | AgoraRtcEngineKit object. |
| uid | The ID of the remote user whose audio state changes. |
| state | The state of the remote audio. See AgoraAudioRemoteState. |
| reason | The reason of the remote audio state change. See AgoraAudioRemoteReason. |
| elapsed | Time elapsed (ms) from the local user calling the joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: method until the SDK triggers this callback. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| channelMediaRelayStateDidChange: | (AgoraChannelMediaRelayState) | state | |
| error: | (AgoraChannelMediaRelayError) | error | |
Occurs when the state of the media stream relay changes.
The SDK returns the state of the current media relay with any error message.
| engine | AgoraRtcEngineKit object. |
| state | The state code. See AgoraChannelMediaRelayState. |
| code | The error code of the channel media relay. See AgoraChannelMediaRelayError. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didProxyConnected: | (NSString *_Nonnull) | channel | |
| withUid: | (NSUInteger) | uid | |
| proxyType: | (AgoraProxyType) | proxyType | |
| localProxyIp: | (NSString *_Nonnull) | localProxyIp | |
| elapsed: | (NSInteger) | elapsed | |
Reports the proxy connection state.
You can use this callback to listen for the state of the SDK connecting to a proxy. For example, when a user calls setCloudProxy: and joins a channel successfully, the SDK triggers this callback to report the user ID, the proxy type connected, and the time elapsed fromthe user calling joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: until this callback is triggered.
| engine | AgoraRtcEngineKit object. |
| channel | The channel name. |
| uid | The user ID. |
| proxyType | The proxy type connected. See AgoraProxyType. |
| localProxyIp | Reserved for future use. |
| elapsed | The time elapsed (ms) from the user calling joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: until this callback is triggered. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| remoteUserStateChangedOfUid: | (NSUInteger) | uid | |
| state: | (NSUInteger) | state | |
Occurs when the remote user state is updated.
| engine | The AgoraRtcEngineKit object. |
| uid | Remote user ID. |
| state | The remote user state. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| remoteVideoStats: | (AgoraRtcRemoteVideoStats *_Nonnull) | stats | |
Reports the statistics of the video stream sent by each remote users.
Reports the statistics of the video stream from the remote users. 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.
| engine | AgoraRtcEngineKit object. |
| stats | Statistics of the remote video stream. See AgoraRtcRemoteVideoStats. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didVideoSubscribeStateChange: | (NSString *_Nonnull) | channelId | |
| uid: | (unsigned int) | uid | |
| oldState: | (AgoraStreamSubscribeState) | oldState | |
| newState: | (AgoraStreamSubscribeState) | newState | |
| elapseSinceLastState: | (int) | elapseSinceLastState | |
Occurs when the video subscribing state changes.
| engine | AgoraRtcEngineKit object. |
| channel | The channel name. |
| uid | The user ID of the remote user. |
| oldState | The previous subscribing status. See AgoraStreamSubscribeState. |
| newState | The current subscribing status. See AgoraStreamSubscribeState. |
| elapseSinceLastState | The time elapsed (ms) from the previous state to the current state. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didVideoPublishStateChange: | (NSString *_Nonnull) | channelId | |
| sourceType: | (AgoraVideoSourceType) | sourceType | |
| oldState: | (AgoraStreamPublishState) | oldState | |
| newState: | (AgoraStreamPublishState) | newState | |
| elapseSinceLastState: | (int) | elapseSinceLastState | |
Occurs when the video publishing state changes.
| engine | AgoraRtcEngineKit object. |
| channelId | The channel name. |
| sourceType | The type of the video source. See AgoraVideoSourceType. |
| oldState | The previous publishing state. See AgoraStreamPublishState. |
| newState | The current publishing stat. See AgoraStreamPublishState. |
| elapseSinceLastState | The time elapsed (ms) from the previous state to the current state. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| rtmpStreamingChangedToState: | (NSString *_Nonnull) | url | |
| state: | (AgoraRtmpStreamingState) | state | |
| reason: | (AgoraRtmpStreamingReason) | reason | |
Occurs when the state of the RTMP or RTMPS streaming changes.
The SDK triggers this callback to report the result of the local user calling the [addPublishStreamUrl](addPublishStreamUrl:transcodingEnabled:) or [removePublishStreamUrl](removePublishStreamUrl:) method.
This callback returns the URL and its current streaming state.
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 errorCode parameter.
| engine | AgoraRtcEngineKit object. |
| url | The CDN streaming URL. |
| state | The RTMP or RTMPS streaming state: AgoraRtmpStreamingState. |
| reason | The detailed error information for streaming: AgoraRtmpStreamingReason. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| rtmpStreamingEventWithUrl: | (NSString *_Nonnull) | url | |
| eventCode: | (AgoraRtmpStreamingEvent) | eventCode | |
Reports events during the Media Push.
| engine | AgoraRtcEngineKit object. |
| url | The URL for Media Push. |
| eventCode | The event code of Media Push. See AgoraRtmpStreamingEvent. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| audioMixingStateChanged: | (AgoraAudioMixingStateType) | state | |
| reasonCode: | (AgoraAudioMixingReasonCode) | reasonCode | |
Occurs when the playback state of the music file changes.
This callback occurs when the playback state of the music file changes, and reports the current state and error code.
| engine | AgoraRtcEngineKit object. |
| state | The playback state of the music file. See AgoraAudioMixingStateType. |
| reasonCode | Error code. See AgoraAudioMixingReasonCode. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| audioMixingPositionChanged: | (NSInteger) | position | |
Reports the playback progress of a music file.
After you called the startAudioMixing:loopback:cycle:startPos: method to play a music file, the SDK triggers this callback every two seconds to report the playback progress.
| position | The playback progress (ms). |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| facePositionDidChangeWidth: | (int) | width | |
| previewHeight: | (int) | height | |
| faces: | (NSArray< AgoraFacePositionInfo * > *_Nullable) | faces | |
Reports the face detection result of the local user.
Since: v3.0.1. Once you enable face detection by calling enableFaceDetection: (YES), you can get the following information on the local user in real-time:
| engine | AgoraRtcEngineKit object. |
| width | The width (px) of the video image captured by the local camera. |
| height | The height (px) of the video image captured by the local camera. |
| faces | Information of the detected face. See AgoraFacePositionInfo. The number of AgoraFacePositionInfo array reported in this callback is based on the faces detected. The length of the array can be 0, which means that no human face is detected in front of the camera. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didTranscodedStreamLayoutInfoUpdatedWithUserId: | (NSUInteger) | uid | |
| videoLayoutInfo: | (AgoraVideoLayoutInfo *_Nonnull) | videoLayoutInfo | |
Occurs when the local user receives a mixed video stream carrying layout information.
When the local user receives a mixed video stream sent by the video mixing server for the first time, or when there is a change in the layout information of the mixed stream, the SDK triggers this callback, reporting the layout information of each sub-video stream within the mixed video stream.
| engine | AgoraRtcEngineKit object. |
| uid | User ID who published this mixed video stream. |
| videoLayoutInfo | Layout information of a specific sub-video stream within the mixed stream. See . AgoraVideoLayoutInfo |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| multiPathStats: | (AgoraMultipathStats *_Nonnull) | stats | |
Report the multipath transmission statistics.
enableMultipath to true to enable multipath transmission.| stats | The multipath statistics. See the MultipathStats structure for details. |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| rtmpStreamingChangedToState: | (NSString *_Nonnull) | url | |
| state: | (AgoraRtmpStreamingState) | state | |
| errCode: | (AgoraRtmpStreamingErrorCode) | errCode | |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didRhythmPlayerStateChanged: | (AgoraRhythmPlayerState) | state | |
| errorCode: | (AgoraRhythmPlayerError) | errorCode | |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| localAudioStateChanged: | (AgoraAudioLocalState) | state | |
| error: | (AgoraAudioLocalError) | error | |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| localVideoStateChangedOfState: | (AgoraVideoLocalState) | state | |
| error: | (AgoraLocalVideoStreamError) | error | |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| localVideoStateChangedOfState: | (AgoraVideoLocalState) | state | |
| error: | (AgoraLocalVideoStreamError) | error | |
| sourceType: | (AgoraVideoSourceType) | sourceType | |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| didVideoPublishStateChange: | (NSString *_Nonnull) | channelId | |
| oldState: | (AgoraStreamPublishState) | oldState | |
| newState: | (AgoraStreamPublishState) | newState | |
| elapseSinceLastState: | (int) | elapseSinceLastState | |
| - (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
| firstLocalVideoFramePublishedWithElapsed: | (NSInteger) | elapsed | |