Agora RTC Objective-C API Reference
Refactor
|
Inherits <NSObject>.
Core Delegate Methods | |
(void) | - rtcEngineRequestToken: |
(void) | - rtcEngine:tokenPrivilegeWillExpire: |
(void) | - rtcEngine:licenseValidationFailure: |
(void) | - rtcEngineConnectionDidLost: |
(void) | - rtcEngine:networkTypeChanged: |
(void) | - rtcEngine:permissionError: |
(void) | - rtcEngine:connectionChangedToState:reason: |
(void) | - rtcEngine:wlAccMessage:action:wlAccMsg: |
(void) | - rtcEngine:wlAccStats:averageStats: |
(void) | - rtcEngine:reportRtcStats: |
(void) | - rtcEngine:lastmileProbeTestResult: |
(void) | - rtcEngine:didApiCallExecute:api:result: |
(void) | - rtcEngine:uploadLogResultRequestId:success:reason: |
Local User Core Delegate Methods | |
(void) | - rtcEngine:didJoinChannel:withUid:elapsed: |
(void) | - rtcEngine:didRejoinChannel:withUid:elapsed: |
(void) | - rtcEngine:didClientRoleChanged:newRole:newRoleOptions: |
(void) | - rtcEngine:didClientRoleChangeFailed:currentRole: |
(void) | - rtcEngine:didLeaveChannelWithStats: |
Local User Audio Delegate Methods | |
(void) | - rtcEngine:firstLocalAudioFramePublished: |
(void) | - rtcEngine:localAudioStats: |
(void) | - rtcEngine:localAudioStateChanged:error: |
Local User Video Delegate Methods | |
(void) | - rtcEngine:cameraExposureDidChangedToRect: |
(void) | - rtcEngine:firstLocalVideoFramePublishedWithElapsed:sourceType: |
(void) | - rtcEngine:firstLocalVideoFrameWithSize:elapsed:sourceType: |
(void) | - rtcEngine:localVideoStats:sourceType: |
(void) | - rtcEngine:videoRenderingTracingResultOfUid:currentEvent:tracingInfo: |
Remote User Core Delegate Methods | |
(void) | - rtcEngine:didJoinedOfUid:elapsed: |
(void) | - rtcEngine:didOfflineOfUid:reason: |
Remote User Audio Delegate Methods | |
(void) | - rtcEngine:firstRemoteAudioFrameDecodedOfUid:elapsed: |
(void) | - rtcEngine:remoteAudioStats: |
(void) | - rtcEngine:reportAudioVolumeIndicationOfSpeakers:totalVolume: |
(void) | - rtcEngineIntraRequestReceived: |
(void) | - rtcEngine:uplinkNetworkInfoUpdate: |
(void) | - rtcEngine:downlinkNetworkInfoUpdate: |
(void) | - rtcEngine:didAudioSubscribeStateChange:uid:oldState:newState:elapseSinceLastState: |
(void) | - rtcEngine:didAudioPublishStateChange:oldState:newState:elapseSinceLastState: |
(void) | - rtcEngine:didLocalUserRegisteredWithUserId:userAccount: |
(void) | - rtcEngine:didUserInfoUpdatedWithUserId:userInfo: |
CDN Live Streaming Delegate Methods | |
(void) | - rtcEngine:rtmpStreamingChangedToState:state:errCode: |
(void) | - rtcEngine:rtmpStreamingEventWithUrl:eventCode: |
(void) | - rtcEngine:audioMixingStateChanged:reasonCode: |
(void) | - rtcEngine:audioMixingPositionChanged: |
Face Detection Delegate Methods | |
(void) | - rtcEngine:facePositionDidChangeWidth:previewHeight:faces: |
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.
- (void) rtcEngineRequestToken: | (AgoraRtcEngineKit *_Nonnull) | engine |
Occurs when the token has expired.
If a token is specified when calling joinChannelByToken
, the token expires after a certain period of time and you need a new token to reconnect to the server.
Upon receiving this callback, generate a new token at your app server and call renewToken: (AgoraRtcEngineKit) renewToken to pass the new token to the SDK.
engine | The AgoraRtcEngineKit object. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
tokenPrivilegeWillExpire: | (NSString *_Nonnull) | token | |
Occurs when the token will expire in 30 seconds.
If the token you specified when calling joinChannelByToken
expires, the user drops offline. This callback is triggered 30 seconds before the token expires, to remind you to renew the token. Upon receiving this callback, generate a new token at your app server and call renewToken: (AgoraRtcEngineKit) renewToken to pass the new token to the SDK.
engine | The AgoraRtcEngineKit object. |
token | The token that will expire in 30 seconds. |
- (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 joinChannelByToken
, regardless of whether it is in the channel or not.
engine | The AgoraRtcEngineKit object. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
networkTypeChanged: | (AgoraNetworkType) | type | |
Occurs when the connection state of the SDK to the server is changed.
engine | The AgoraRtcEngineKit object. |
type | See AgoraNetworkType. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
permissionError: | (AgoraPermissionType) | type | |
Occurs when permission error
engine | The AgoraRtcEngineKit object. |
type | See AgoraPermissionType. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
connectionChangedToState: | (AgoraConnectionState) | state | |
reason: | (AgoraConnectionChangedReason) | reason | |
Occurs when the connection state of the SDK to the server is changed.
engine | The AgoraRtcEngineKit object. |
state | See AgoraConnectionState. |
reason | See AgoraConnectionChangedReason. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
wlAccMessage: | (AgoraWlAccReason) | reason | |
action: | (AgoraWlAccAction) | action | |
wlAccMsg: | (NSString *_Nonnull) | wlAccMsg | |
Reports WIFI user message. When the user needs to be prompted to approach the AP or switch the frequency band connected to the AP, the SDK will trigger this callback to notify the APP.
engine | AgoraRtcEngineKit object. |
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. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
wlAccStats: | (AgoraWlAccStats *_Nonnull) | currentStats | |
averageStats: | (AgoraWlAccStats *_Nonnull) | averageStats | |
Reports WIFI accelerate status. When the optimized end-to-end delay, frozen ratio and packet loss rate need to be displayed to the user, the SDK will trigger this callback to notify the APP.
engine | AgoraRtcEngineKit object. |
currentStats | Instantaneous value of optimization effect. |
averageStats | Average value of cumulative optimization effect. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
reportRtcStats: | (AgoraChannelStats *_Nonnull) | stats | |
Reports the statistics of the current call.
This callback is triggered once every two seconds after the user joins the channel.
engine | The AgoraRtcEngineKit object. |
stats | The statistics on the current call: 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 the startLastmileProbeTest: (AgoraRtcEngineKit) startLastmileProbeTest method.
engine | The AgoraRtcEngineKit object. |
result | The uplink and downlink last-mile network probe test result, see AgoraLastmileProbeResult. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
didApiCallExecute: | (NSInteger) | error | |
api: | (NSString *_Nonnull) | api | |
result: | (NSString *_Nonnull) | result | |
The API call was executed successfully.
engine | The AgoraRtcEngineKit object. |
error | AgoraErrorCode |
api | The method executed by the SDK. |
result | The result of the method call. |
- (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 the local user successfully joins a specified channel.
engine | AgoraRtcEngineKit object |
channel | The channel name. |
uid | The user ID. |
elapsed | The time elapsed (ms) from the local user calling joinChannelByToken until this event occurs. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
didRejoinChannel: | (NSString *_Nonnull) | channel | |
withUid: | (NSUInteger) | uid | |
elapsed: | (NSInteger) | elapsed | |
Occurs when the local user rejoins a channel.
If the client loses connection with the server because of network problems, the SDK automatically attempts to reconnect and then triggers this callback upon reconnection, indicating that the user rejoins the channel with the assigned channel ID and user ID.
engine | The AgoraRtcEngineKit object. |
channel | The channel name. |
uid | The user ID. |
elapsed | Time elapsed (ms) from the local user calling joinChannelByToken until this event occurs. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
didClientRoleChanged: | (AgoraClientRole) | oldRole | |
newRole: | (AgoraClientRole) | newRole | |
newRoleOptions: | (AgoraClientRoleOptions *_Nullable) | newRoleOptions | |
Occurs when the local user role switches in a live broadcast.
engine | The AgoraRtcEngineKit object. |
oldRole | The role that the user switches from: AgoraClientRole. |
newRole | The role that the user switches to: AgoraClientRole. |
newRoleOptions | The client role option of the new role: AgoraClientRoleOptions. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
didClientRoleChangeFailed: | (AgoraClientRoleChangeFailedReason) | reason | |
currentRole: | (AgoraClientRole) | currentRole | |
Occurs when the local user role switches in a live broadcast.
engine | The AgoraRtcEngineKit object. |
reason | The reason of the failure of the local user role switches: AgoraClientRoleChangeFailedReason. |
currentRole | The current role of the user: AgoraClientRole. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
didLeaveChannelWithStats: | (AgoraChannelStats *_Nonnull) | stats | |
Occurs when the local user leaves a channel.
When the user successfully leaves the channel after calling leaveChannel: (AgoraRtcEngineKit) leaveChannel method, this callback notifies the app that a user leaves a channel.
This callback also reports information such as the call duration and the statistics of data received or transmitted by the SDK.
engine | The AgoraRtcEngineKit object. |
stats | The statistics of the call. See AgoraChannelStats. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
firstLocalAudioFramePublished: | (NSInteger) | elapsed | |
Occurs when the first local audio frame is published.
engine | The AgoraRtcEngineKit object. |
elapsed | The time elapsed (ms) from calling joinChannelByToken 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 | The AgoraRtcEngineKit object. |
stats | The statistics of the local audio stream. See AgoraRtcLocalAudioStats. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
localAudioStateChanged: | (AgoraAudioLocalState) | state | |
error: | (AgoraAudioLocalError) | error | |
Occurs when the local audio stream state changes.
This callback indicates the state change of the local audio stream, including the state of the audio recording and encoding, and allows you to troubleshoot issues when exceptions occur.
AgoraAudioLocalStateFailed
(3), see the error
parameter for details. engine | AgoraRtcEngineKit object |
state | The state of the local audio. See AgoraAudioLocalState. |
error | The error information of the local audio. See AgoraAudioLocalError. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
cameraExposureDidChangedToRect: | (CGRect) | rect | |
A camera exposure position changed.
engine | AgoraRtcEngineKit object |
rect | Exposure rectangle in the local preview |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
firstLocalVideoFramePublishedWithElapsed: | (NSInteger) | elapsed | |
sourceType: | (AgoraVideoSourceType) | sourceType | |
Event of the first local video frame is published.
engine | The engine kit |
elapsed | The elapsed time(ms) from the beginning of the session. |
sourceType | source type of the orignated video source. See AgoraVideoSourceType. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
firstLocalVideoFrameWithSize: | (CGSize) | size | |
elapsed: | (NSInteger) | elapsed | |
sourceType: | (AgoraVideoSourceType) | sourceType | |
The first local frame displayed on the video window.
Same as [firstLocalVideoFrameBlock]([AgoraRtcEngineKit firstLocalVideoFrameBlock:]).
engine | The AgoraRtcEngineKit object. |
size | Size of the video (width and height). |
elapsed | Time elapsed (ms) from calling joinChannelByToken until this callback is triggered. |
sourceType | source type of the orignated video source. See AgoraVideoSourceType. |
- (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 for each user/host. If there are multiple users/hosts in the channel, the SDK triggers this callback as many times.
engine | The AgoraRtcEngineKitobject. |
stats | Statistics of the local video stream. See AgoraRtcLocalVideoStats. |
sourceType | source type of the orignated video source. See AgoraVideoSourceType. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
videoRenderingTracingResultOfUid: | (NSUInteger) | uid | |
currentEvent: | (AgoraMediaTraceEvent) | currentEvent | |
tracingInfo: | (AgoraVideoRenderingTracingInfo *_Nonnull) | tracingInfo | |
Reports the tracing result of video rendering event of the user.
uid | The user ID. |
currentEvent | The current event of the tracing result: AgoraMediaTraceEvent. |
tracingInfo | The tracing result: AgoraVideoRenderingTracingInfo. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
didJoinedOfUid: | (NSUInteger) | uid | |
elapsed: | (NSInteger) | elapsed | |
Occurs when a remote user or user joins the channel.
If other users or hosts are already in the channel, the SDK also reports to the app on the existing users/hosts.
The SDK triggers this callback under one of the following circumstances:
joinChannelByToken
.engine | The AgoraRtcEngineKit object. |
uid | The user ID. |
elapsed | Time elapsed (ms) from calling joinChannelByToken until this callback is triggered. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
didOfflineOfUid: | (NSUInteger) | uid | |
reason: | (AgoraUserOfflineReason) | reason | |
Occurs when a remote user or host goes offline.
There are two reasons for a user to go offline:
engine | The AgoraRtcEngineKit object. |
uid | The ID of the user who goes offline. |
reason | The reason why the user goes offline: AgoraUserOfflineReason. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
firstRemoteAudioFrameDecodedOfUid: | (NSUInteger) | uid | |
elapsed: | (NSInteger) | elapsed | |
Occurs when the SDK decodes the first remote audio frame for playback.
Deprecated** from v3.0.0. Use AgoraAudioRemoteStateDecoding(2)
in the [remoteAudioStateChangedOfUid]([AgoraRtcEngineDelegate rtcEngine:remoteAudioStateChangedOfUid:state:reason:elapsed:]) callback instead.
This callback is triggered in either of the following scenarios:
engine | AgoraRtcEngineKit object. |
uid | User ID of the remote user sending the audio stream. |
elapsed | The time elapsed (ms) from the local user calling the joinChannel method until the SDK triggers this callback. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
remoteAudioStats: | (AgoraRtcRemoteAudioStats *_Nonnull) | stats | |
Reports the statistics of the remote audio stream.
The SDK triggers this callback once every two seconds for each remote user or broadcaster. If a channel has multiple remote users, the SDK triggers this callback as many times.
engine | The AgoraRtcEngineKit object. |
stats | The statistics of the received audio. See AgoraRtcRemoteAudioStats. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
reportAudioVolumeIndicationOfSpeakers: | (NSArray< AgoraRtcAudioVolumeInfo * > *_Nonnull) | speakers | |
totalVolume: | (NSInteger) | totalVolume | |
This callback reports the IDs and volumes of the loudest speakers at the moment in the channel, and whether the local user is speaking.
Once enabled, this callback is triggered at the set interval, regardless of whether a user speaks or not.
The SDK triggers two independent reportAudioVolumeIndicationOfSpeakers
callbacks at one time, which separately report the volume information of the local user and all the remote speakers.
engine | The AgoraRtcEngineKit object. |
speakers | An array containing the user ID and volume information for each speaker: AgoraRtcAudioVolumeInfo.
|
totalVolume | The total volume after audio mixing. The value ranges between 0 (the lowest volume) and 255 (the highest volume).
|
- (void) rtcEngineIntraRequestReceived: | (AgoraRtcEngineKit *_Nonnull) | engine |
Intra request received.
engine | The AgoraRtcEngineKit object. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
uplinkNetworkInfoUpdate: | (AgoraUplinkNetworkInfo *_Nonnull) | networkInfo | |
Target bitrate updated.
engine | The AgoraRtcEngineKit object. |
networkInfo | The uplink network info, including target bitrate bps. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
downlinkNetworkInfoUpdate: | (AgoraDownlinkNetworkInfo *_Nonnull) | networkInfo | |
Downlink network info updated.
engine | The AgoraRtcEngineKit object. |
networkInfo | The network info. |
- (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 subscribe state changed.
engine | The AgoraRtcEngineKit object. |
channelId | The channel name of user joined. |
uid | The remote user ID that is subscribed to. |
oldState | The old state of the audio stream subscribe : AgoraStreamSubscribeState. |
newState | The new state of the audio stream subscribe : AgoraStreamSubscribeState. |
elapseSinceLastState | The time elapsed (ms) from the old state to the new state. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
didAudioPublishStateChange: | (NSString *_Nonnull) | channelId | |
oldState: | (AgoraStreamPublishState) | oldState | |
newState: | (AgoraStreamPublishState) | newState | |
elapseSinceLastState: | (int) | elapseSinceLastState | |
Occurs when the audio publish state changed.
channelId | The channel name of user joined. |
oldState | The old state of the audio stream publish : AgoraStreamPublishState. |
newState | The new state of the audio stream publish : AgoraStreamPublishState. |
elapseSinceLastState | The time elapsed (ms) from the old state to the new state. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
didLocalUserRegisteredWithUserId: | (NSUInteger) | uid | |
userAccount: | (NSString *_Nonnull) | userAccount | |
Occurs when the local user successfully registers a user account by calling the This callback reports the user ID and user account of the local user.
engine | The 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 (userInfo
), and triggers this callback on the local client.
engine | The AgoraRtcEngineKit object. |
uid | The ID of the remote user. |
userInfo | The AgoraUserInfo object that contains the user ID and user account of the remote user. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
didRhythmPlayerStateChanged: | (AgoraRhythmPlayerState) | state | |
errorCode: | (AgoraRhythmPlayerError) | errorCode | |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
videoSizeChangedOfSourceType: | (AgoraVideoSourceType) | sourceType | |
uid: | (NSUInteger) | uid | |
size: | (CGSize) | size | |
rotation: | (NSInteger) | rotation | |
Occurs when the local or remote video size or rotation has changed.
engine | AgoraRtcEngineKit object. |
sourceType | The video source type. |
uid | The user ID. 0 indicates the local user. |
size | Size of the video (width and height) in pixels. |
rotation | The rotation information of the video. |
- (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 | |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
localVideoStateChangedOfState: | (AgoraVideoLocalState) | state | |
error: | (AgoraLocalVideoStreamError) | error | |
sourceType: | (AgoraVideoSourceType) | sourceType | |
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.
engine | AgoraRtcEngineKit object |
state | State type AgoraVideoLocalState. When the state is AgoraVideoLocalStateFailed (3), see the error parameter for details. |
error | The detailed error information: AgoraLocalVideoStreamError. |
sourceType | source type of the orignated video source. See AgoraVideoSourceType. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
remoteVideoStateChangedOfUid: | (NSUInteger) | uid | |
state: | (AgoraVideoRemoteState) | state | |
reason: | (AgoraVideoRemoteReason) | reason | |
elapsed: | (NSInteger) | elapsed | |
Occurs when the remote video state has changed.
AgoraChannelProfileCommunication
profile) or hosts (in the AgoraChannelProfileLiveBroadcasting
profile) in the channel exceeds 17.engine | AgoraRtcEngineKit object. |
uid | ID of the user whose video state has changed. |
state | The remote video state: #AgoraVideoRemoteState. |
reason | The reason of the remote video state change: AgoraVideoRemoteReason. |
elapsed | The time elapsed (ms) from the local user calling joinChannel until this callback is triggered. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
remoteAudioStateChangedOfUid: | (NSUInteger) | uid | |
state: | (AgoraAudioRemoteState) | state | |
reason: | (AgoraAudioRemoteReason) | reason | |
elapsed: | (NSInteger) | elapsed | |
Occurs when the state of a remote audio stream changes.
engine | The AgoraRtcEngineKit object. |
uid | The ID of the user whose audio state has changed. |
state | The state of the remote audio. See AgoraAudioRemoteState. |
reason | The reason of the remote audio state change. See AgoraAudioRemoteReason. |
elapsed | The time elapsed (ms) from calling joinChannelByToken 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 reports the state of the current media relay and possible error messages in this callback.
engine | AgoraRtcEngineKit object. |
state | The state code in [AgoraChannelMediaRelayState](AgoraChannelMediaRelayState). |
error | The error code in [AgoraChannelMediaRelayError](AgoraChannelMediaRelayError). |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
didReceiveChannelMediaRelayEvent: | (AgoraChannelMediaRelayEvent) | event | |
Reports events during the media stream relay.
engine | AgoraRtcEngineKit object. |
event | The event code in [AgoraChannelMediaRelayEvent](AgoraChannelMediaRelayEvent). |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
didProxyConnected: | (NSString *_Nonnull) | channel | |
withUid: | (NSUInteger) | uid | |
proxyType: | (AgoraProxyType) | proxyType | |
localProxyIp: | (NSString *_Nonnull) | localProxyIp | |
elapsed: | (NSInteger) | elapsed | |
Occurs when join success after calling [setLocalAccessPoint]([AgoraRtcEngineKit setLocalAccessPoint:channelId:info:uid:joinSuccess:]) or [setCloudProxy]([AgoraRtcEngineKit setCloudProxy:proxyType])
engine | AgoraRtcEngineKit object. |
channel | Channel name. |
uid | User ID. If the uid is specified in the [joinChannelByToken]([AgoraRtcEngineKit joinChannelByToken:channelId:info:uid:joinSuccess:]) method, the specified user ID is returned. If the user ID is not specified when the joinChannel method is called, the server automatically assigns a uid . |
proxyType | type of proxy agora sdk connected, proxyType will be AgoraNoneProxyType if not connected to proxy(fallback). |
localProxyIp | local proxy ip list, if not join local proxy, it will be "" |
elapsed | Time elapsed (ms) from the user calling the [joinChannelByToken]([AgoraRtcEngineKit joinChannelByToken:channelId:info:uid:joinSuccess:]) method until the SDK triggers this callback. |
- (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 from each remote user/host.
The SDK triggers this callback once every two seconds for each remote user or host. If a channel includes multiple remote users, the SDK triggers this callback as many times.
engine | The AgoraRtcEngineKit object. |
stats | The statistics of the received remote video streams. 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 subscribe state changed.
engine | The AgoraRtcEngineKit object. |
channelId | The channel name of user joined. |
uid | The remote user ID that is subscribed to. |
oldState | The old state of the video stream subscribe : AgoraStreamSubscribeState. |
newState | The new state of the video stream subscribe : AgoraStreamSubscribeState. |
elapseSinceLastState | The time elapsed (ms) from the old state to the new 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 publish state changed.
engine | The AgoraRtcEngineKit object. |
channelId | The channel name of user joined. |
sourceType | source type of the orignated video source. See AgoraVideoSourceType. |
oldState | The old state of the video stream publish : AgoraStreamPublishState. |
newState | The new state of the video stream publish : AgoraStreamPublishState. |
elapseSinceLastState | The time elapsed (ms) from the old state to the new state. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
rtmpStreamingChangedToState: | (NSString *_Nonnull) | url | |
state: | (AgoraRtmpStreamingState) | state | |
errCode: | (AgoraRtmpStreamingErrorCode) | errCode | |
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. |
errCode | The detailed error information for streaming: AgoraRtmpStreamingErrorCode. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
rtmpStreamingEventWithUrl: | (NSString *_Nonnull) | url | |
eventCode: | (AgoraRtmpStreamingEvent) | eventCode | |
Reports events during the RTMP or RTMPS streaming.
engine | AgoraRtcEngineKit object. |
url | The RTMP or RTMPS streaming URL. |
eventCode | The event code. See AgoraRtmpStreamingEvent. |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
audioMixingStateChanged: | (AgoraAudioMixingStateType) | state | |
reasonCode: | (AgoraAudioMixingReasonCode) | reasonCode | |
Audio mixing state changed.
engine | The AgoraRtcEngineKit object. |
state | AgoraAudioMixingStateType |
reasonCode | AgoraAudioMixingReasonCode |
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
audioMixingPositionChanged: | (NSInteger) | position | |
Reports current AudioMixing progress.
The callback occurs once every one second during the playback and reports the current playback progress.
position | Current AudioMixing progress (millisecond). |
- (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. (iOS only)
Since:** v3.0.1.
Once you enable face detection by calling [enableFaceDetection]([AgoraRtcEngineKit enableFaceDetection:]), you can get the following information on the local user in real-time:
The distance between the human face and the device screen. This value is based on the fitting calculation of the local video size and the position of the human face.
Note**
engine | AgoraRtcEngineKit object. |
width | The width (px) of the local video. |
height | The height (px) of the local video. |
faces | An AgoraFacePositionInfo array, which contains the information of the detected human face. |
The number of the AgoraFacePositionInfo array depends on the number of human faces detected. If the array length is 0, it means that no human face is detected.
- (void) rtcEngine: | (AgoraRtcEngineKit *_Nonnull) | engine | |
localVideoStateChangedOfState: | (AgoraVideoLocalState) | state | |
error: | (AgoraLocalVideoStreamError) | error | |
- (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 | |