Agora RTC Objective-C API Reference
Refactor
|
Inherits <NSObject>.
Audio Effect Playback | |
(int) | - setVoiceBeautifierPreset: |
(int) | - setVoiceConversionPreset: |
(int) | - setVoiceBeautifierParameters:param1:param2: |
(int) | - setVoiceConversionParameters:param1:param2: |
(int) | - setHeadphoneEQPreset: |
(int) | - setHeadphoneEQParameters:highGain: |
(int) | - enableVoiceAITuner:type: |
Sound Position Indication | |
(int) | - enableSoundPositionIndication: |
(int) | - setRemoteVoicePosition:pan:gain: |
(int) | - enableSpatialAudio: |
(int) | - setAINSMode:mode: |
Audio Mixing | |
(int) | - selectAudioTrack: |
(int) | - getAudioTrackCount |
Audio Recording | |
(int) | - startAudioRecordingWithConfig: |
Echo Test | |
(int) | - startEchoTestWithConfig: |
Miscellaneous Audio Control | |
(int) | - enableInEarMonitoring: |
(int) | - enableInEarMonitoring:includeAudioFilters: |
(int) | - setInEarMonitoringVolume: |
Dual Video Mode | |
(int) | - enableDualStreamMode: |
(int) | - enableDualStreamMode:streamConfig: |
(int) | - setDualStreamMode: |
(int) | - setDualStreamMode:streamConfig: |
(int) | - setSimulcastConfig: |
(int) | - setRemoteDefaultVideoStreamType: |
(int) | - setRemoteVideoSubscriptionOptions:options: |
(int) | - setSubscribeAudioAllowlist: |
(int) | - setSubscribeVideoAllowlist: |
Stream Fallback | |
(int) | - setHighPriorityUserList:option: |
(int) | - setHighPriorityUserListEx:option:connection: |
Built-in Encryption | |
(int) | - enableEncryption:encryptionConfig: |
(int) | - enableEncryptionEx:encryptionConfig:connection: |
Data Steam | |
(int) | - createDataStream:config: |
(int) | - createDataStreamEx:reliable:ordered:connection: |
(int) | - createDataStreamEx:config:connection: |
(int) | - sendStreamMessageEx:data:connection: |
Camera Control | |
(CGFloat) | - cameraMaxZoomFactor |
(int) | - switchCamera |
(int) | - enableMultiCamera:config: |
(int) | - enableCameraCenterStage: |
(int) | - startCameraCapture:config: |
(int) | - stopCameraCapture: |
Face Detection | |
(int) | - enableFaceDetection: |
Watermark | |
(int) | - addVideoWatermark:options: |
(int) | - registerLocalUserAccount:appId: |
(int) | - joinChannelByToken:channelId:userAccount:joinSuccess: |
(int) | - joinChannelByToken:channelId:userAccount:mediaOptions:joinSuccess: |
(AgoraUserInfo *_Nullable) | - getUserInfoByUserAccount:withError: |
(AgoraUserInfo *_Nullable) | - getUserInfoByUid:withError: |
(BOOL) | - setAudioFrameDelegate: |
(BOOL) | - setVideoFrameDelegate: |
(BOOL) | - setEncodedVideoFrameDelegate: |
(BOOL) | - setFaceInfoDelegate: |
Media Metadata | |
(BOOL) | - setMediaMetadataDataSource:withType: |
(BOOL) | - setMediaMetadataDelegate:withType: |
Miscellaneous Methods | |
(NSString *_Nonnull) | + getSdkVersion |
(NSString *_Nonnull) | + getErrorDescription: |
(int) | - setLogFile: |
(int) | - setLogFilter: |
(int) | - setLogFileSize: |
(NSString *_Nullable) | - uploadLogFile |
(int) | - writeLog:content: |
(NSString *_Nullable) | - getCallId |
(int) | - rate:rating:description: |
(int) | - complain:description: |
(int) | - startLastmileProbeTest: |
(int) | - stopLastmileProbeTest |
(uint64_t) | - getNtpWallTimeInMs |
Agora provides ensured quality of experience (QoE) for worldwide Internet-based voice and video communications through a virtual global network that is especially optimized for real-time web and mobile-to-mobile applications.
The AgoraRtcEngineKit class is the entry point of the Agora SDK that provides simple APIs for applications to easily start voice and video communication. Provides all methods that can be invoked by your application.
Agora provides ensured quality of experience (QoE) for worldwide Internet-based voice and video communications through a virtual global network that is especially optimized for real-time web and mobile-to-mobile applications.
AgoraRtcEngineKit
is the basic interface class of Agora Native SDK. Creating an AgoraRtcEngineKit object and then calling the methods of this object enables the use of Agora Native SDK’s communication functionality.
+ (instancetype _Nonnull) sharedEngineWithAppId: | (NSString *_Nonnull) | appId | |
delegate: | (id< AgoraRtcEngineDelegate > _Nullable) | delegate | |
Initializes the Agora SDK service.
After the initialization, the service is set to enable audio by default.
appId | App ID of your Agora project. |
delegate | AgoraRtcEngineDelegate. |
+ (instancetype _Nonnull) sharedEngineWithConfig: | (AgoraRtcEngineConfig *_Nonnull) | config | |
delegate: | (id< AgoraRtcEngineDelegate > _Nullable) | delegate | |
Creates an AgoraRtcEngineKit instance.
Unless otherwise specified, all the methods provided by the AgoraRtcEngineKit instance are executed asynchronously. Agora recommends calling these methods in the same thread.
sharedEngineWithAppId
and this method is that this method enables you to specify the connection area.config | Configurations for the AgoraRtcEngineKit instance. For details, see AgoraRtcEngineConfig. |
delegate | AgoraRtcEngineDelegate. |
-1
(AgoraErrorCodeFailed
): A general error occurs (no specified reason).-2
(AgoraErrorCodeInvalidArgument
): No AgoraRtcEngineDelegate
object is specified.-7
(AgoraErrorCodeNotInitialized
): The SDK is not initialized.-101
(AgoraErrorCodeInvalidAppId
): The App ID is invalid. - (int) preloadChannelByToken: | (NSString *_Nullable) | token | |
channelId: | (NSString *_Nonnull) | channelId | |
uid: | (NSUInteger) | uid | |
Preload a channel.
This method enables users to preload a channel.
A successful call of this method will reduce the time of joining the same channel.
Note:
token | The token generated on your server for authentication. |
channelId | The channel name. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported character scopes are:
|
uid | The user ID. This parameter is used to identify the user in the channel for real-time audio and video interaction. You need to set and manage user IDs yourself, and ensure that each user ID in the same channel is unique. This parameter is a 32-bit unsigned integer. The value range is 1 to 2<h>32</h>-1. If the user ID is not assigned (or set to 0), the SDK assigns a random user ID and returns it in the onJoinChannelSuccess callback. Your application must record and maintain the returned user ID, because the SDK does not do so. |
- (int) preloadChannelByTokenWithUserAccount: | (NSString *_Nullable) | token | |
channelId: | (NSString *_Nonnull) | channelId | |
userAccount: | (NSString *_Nonnull) | userAccount | |
Preload a channel.
This method enables users to preload a channel.
A successful call of this method will reduce the time of joining the same channel.
Note:
token | The token generated on your server for authentication. |
channelId | The channel name. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported character scopes are:
|
userAccount | The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
|
- (int) updatePreloadChannelToken: | (NSString *_Nonnull) | token |
Update token of the preloaded channels.
An easy way to update all preloaded channels' tokens, if all preloaded channels use the same token.
If preloaded channels use different tokens, we need to call the 'preloadChannel' method with the same 'channelId' and 'uid' or 'userAccount' to update the corresponding token.
token | The token generated on your server for authentication. |
- (int) joinChannelByToken: | (NSString *_Nullable) | token | |
channelId: | (NSString *_Nonnull) | channelId | |
info: | (NSString *_Nullable) | info | |
uid: | (NSUInteger) | uid | |
joinSuccess: | (void(^)(NSString *_Nonnull channel, NSUInteger uid, NSInteger elapsed)) | joinSuccessBlock | |
Joins a channel.
Users in the same channel can talk to each other, and multiple users in the same channel can start a group chat. Users with different App IDs cannot call each other even if they join the same channel.
You must call the leaveChannel: leaveChannel method to exit the current call before entering another channel. This method call is asynchronous; therefore, you can call this method in the main user interface thread.
A successful method call triggers the following callbacks:
When the connection between the client and Agora's server is interrupted due to poor network conditions, the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the AgoraRtcEngineDelegate.rtcEngine:didRejoinChannel:withUid:elapsed: didRejoinChannel callback on the local client.
setCategory(AVAudioSessionCategoryPlayAndRecord)
to set AVAudioSession
to PlayAndRecord
mode. When AVAudioSession
is set to PlayAndRecord
mode, the sound played (for example a ringtone) is interrupted. The app should not set AVAudioSession
to any other mode.token | The token for authentication.
|
channelId | Unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
|
info | (Optional) Additional information about the channel. This parameter can be set to nil or contain channel related information. Other users in the channel do not receive this message. |
uid | User ID. A 32-bit unsigned integer with a value ranging from 1 to (232-1). The uid must be unique. If a uid is not assigned (or set to 0), the SDK assigns and returns a uid in the callback. Your app must record and maintain the returned uid since the SDK does not do so. |
joinSuccessBlock | Same as AgoraRtcEngineDelegate.rtcEngine:didJoinChannel:withUid:elapsed: didJoinChannel. We recommend you set this parameter as nil to use didJoinChannel .
|
- (int) joinChannelByToken: | (NSString *_Nullable) | token | |
channelId: | (NSString *_Nonnull) | channelId | |
uid: | (NSUInteger) | uid | |
mediaOptions: | (AgoraRtcChannelMediaOptions *_Nonnull) | mediaOptions | |
joinSuccess: | (void(^)(NSString *_Nonnull channel, NSUInteger uid, NSInteger elapsed)) | joinSuccessBlock | |
Joins a channel.
Users in the same channel can talk to each other, and multiple users in the same channel can start a group chat. Users with different App IDs cannot call each other even if they join the same channel.
You must call the leaveChannel: leaveChannel method to exit the current call before entering another channel. This method call is asynchronous; therefore, you can call this method in the main user interface thread.
A successful method call triggers the following callbacks:
When the connection between the client and Agora's server is interrupted due to poor network conditions, the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the AgoraRtcEngineDelegate.rtcEngine:didRejoinChannel:withUid:elapsed: didRejoinChannel callback on the local client.
setCategory(AVAudioSessionCategoryPlayAndRecord)
to set AVAudioSession
to PlayAndRecord
mode. When AVAudioSession
is set to PlayAndRecord
mode, the sound played (for example a ringtone) is interrupted. The app should not set AVAudioSession
to any other mode.token | The token for authentication.
|
channelId | Unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
|
uid | User ID. A 32-bit unsigned integer with a value ranging from 1 to (232-1). The uid must be unique. If a uid is not assigned (or set to 0), the SDK assigns and returns a uid in the callback. Your app must record and maintain the returned uid since the SDK does not do so. |
mediaOptions | AgoraRtcChannelMediaOptions Object. |
joinSuccessBlock | Same as AgoraRtcEngineDelegate.rtcEngine:didJoinChannel:withUid:elapsed: didJoinChannel. We recommend you set this parameter as nil to use didJoinChannel .
|
- (int) leaveChannel: | (void(^)(AgoraChannelStats *_Nonnull stat)) | leaveChannelBlock |
Leaves the channel.
This method allows a user to leave the channel, for example, by hanging up or exiting a call.
This method also releases all resources related to the call.
This method is an asynchronous call, which means that the result of this method returns before the user has not actually left the channel. Once the user successfully leaves the channel, the SDK triggers the AgoraRtcEngineDelegate.rtcEngine:didLeaveChannelWithStats: didLeaveChannelWithStats callback.
didLeaveChannelWithStats
callback.leaveChannelBlock | This callback indicates that a user leaves a channel, and provides the statistics of the call in AgoraChannelStats. |
- (int) setChannelProfile: | (AgoraChannelProfile) | profile |
Sets the channel profile.
The SDK differentiates channel profiles and applies different optimization algorithms accordingly.
joinChannelByToken
. You cannot set the channel profile once you have joined the channel.profile | The channel profile: AgoraChannelProfile. |
- (int) updateChannelWithMediaOptions: | (AgoraRtcChannelMediaOptions *_Nonnull) | mediaOptions |
Updates the channel media options after joining the channel.
mediaOptions | The channel media options: ChannelMediaOptions. |
- (int) setClientRole: | (AgoraClientRole) | role |
Sets the role of a user.
This method sets the role of a user as either a broadcaster or an audience.
role | Role of the client: AgoraClientRole. |
- (int) setClientRole: | (AgoraClientRole) | role | |
options: | (AgoraClientRoleOptions *_Nullable) | options | |
Sets the role of a user.
This method is applicable only to the live interactive streaming profile.
Sets the role of a user, such as a host or an audience (default), before joining a channel.
This method can be used to switch the user role after a user joins a channel.
When a user switches user roles after joining a channel, a successful method call triggers the following callback:
role | The role of the user: |
AgoraClientRoleBroadcaster(1)
: Host. A host can both send and receive streams.AgoraClientRoleAudience(2)
: Audience, the default role. An audience can only receive streams.options | The client role of the user, see AgoraClientRoleOptions. |
0
(AgoraRtmpStreamingReasonOK
): Success.0
: Failure.-1
(AgoraErrorCodeFailed
): A general error occurs (no specified reason).-2
(AgoraErrorCodeInvalidArgument
): The parameter is invalid.-7
(AgoraErrorCodeNotInitialized
): The SDK is not initialized. - (int) renewToken: | (NSString *_Nonnull) | token |
Renews the token.
Once a token is enabled and used, it expires after a certain period of time.
Under the following circumstances, generate a new token on your server, and then call this method to renew it. Failure to do so results in the SDK disconnecting from the server.
AgoraErrorCodeTokenExpired
(-109) error is reported. token | The new token. |
- (AgoraConnectionState) getConnectionState |
Gets the connection state of the SDK.
- (int) startOrUpdateChannelMediaRelay: | (AgoraChannelMediaRelayConfiguration *_Nonnull) | config |
Starts or update to relay media streams across channels.
After a successful method call, the SDK triggers the [channelMediaRelayStateDidChange]([AgoraRtcEngineDelegate rtcEngine:channelMediaRelayStateDidChange:error:]) callback, and this callback return the state of the media stream relay.
channelMediaRelayStateDidChange
callback returns AgoraChannelMediaRelayStateRunning(2) and AgoraChannelMediaRelayStateIdle(0), the SDK starts relaying media streams between the original and the destination channel.If the channelMediaRelayStateDidChange
callback returns AgoraChannelMediaRelayStateFailure(3), an exception occurs during the media stream relay.
Note**
config | The configuration of the media stream relay: [AgoraChannelMediaRelayConfiguration](AgoraChannelMediaRelayConfiguration). |
- (int) stopChannelMediaRelay |
Stops the media stream relay.
Once the relay stops, the broadcaster quits all the destination channels.
After a successful method call, the SDK triggers the [channelMediaRelayStateDidChange]([AgoraRtcEngineDelegate rtcEngine:channelMediaRelayStateDidChange:error:]) callback. If the callback returns AgoraChannelMediaRelayStateIdle(0) and AgoraChannelMediaRelayErrorNone(0), the broadcaster successfully stops the relay.
- (int) pauseAllChannelMediaRelay |
pause the channels for media stream relay.
- (int) resumeAllChannelMediaRelay |
resume the channels for media stream relay.
- (int) enableWirelessAccelerate: | (BOOL) | enabled |
Turn WIFI acceleration on or off.
enabled |
|
- (int) startLocalVideoTranscoder: | (AgoraLocalTranscoderConfiguration *_Nonnull) | config |
- (int) updateLocalTranscoderConfiguration: | (AgoraLocalTranscoderConfiguration *_Nonnull) | config |
- (int) stopLocalVideoTranscoder |
- (int) startMediaRenderingTracing |
Start tracing media rendering events.
[AgoraRtcEngineDelegate rtcEngine:videoRenderingTracingResultOfUid:currentEvent:tracingInfo:]
-7(AgoraErrorCodeNotInitialized)
: The SDK is not initialized. - (int) enableInstantMediaRendering |
Enable instant media rendering.
-7(AgoraErrorCodeNotInitialized)
: The SDK is not initialized. + (void) destroy |
This method releases all the resources used by the Agora SDK. This is useful for applications that occasionally make voice or video calls, to free up resources for other operations when not making calls. Once the application has called this method to destroy the created AgoraRtcEngineKit instance, no other methods in the SDK can be used and no callbacks occur. To start communications again, call sharedEngineWithAppId:delegate: sharedEngineWithAppId to establish a new AgoraRtcEngineKit instance.
- (int) enableAudio |
Enables the audio.
The audio is enabled by default.
- (int) disableAudio |
Disables the audio.
- (int) enableLocalAudio: | (BOOL) | enabled |
Enables or disables the local audio capture.
The audio function is enabled by default. This method disables or re-enables the local audio function, that is, to stop or restart local audio capture and processing.
This method does not affect receiving or playing the remote audio streams, and enableLocalAudio
(NO) is applicable to scenarios where the user wants to receive remote audio streams without sending any audio stream to other users in the channel.
enabled | Determines whether to disable or re-enable the local audio function:
|
- (int) setAudioProfile: | (AgoraAudioProfile) | profile |
Sets the audio profile.
joinChannelByToken
.profile
as AgoraAudioProfileMusicHighQuality
(4).profile | The audio profile, such as the sample rate, bitrate, encoding mode, and the number of channels, see AgoraAudioProfile. |
- (int) setAudioScenario: | (AgoraAudioScenario) | scenario |
- (int) enableAudioVolumeIndication: | (NSInteger) | interval | |
smooth: | (NSInteger) | smooth | |
reportVad: | (BOOL) | reportVad | |
Enables the reportAudioVolumeIndicationOfSpeakers
callback to report on which users are speaking and the speakers' volume.
Once the AgoraRtcEngineDelegate.rtcEngine:reportAudioVolumeIndicationOfSpeakers:totalVolume: reportAudioVolumeIndicationOfSpeakers callback is enabled, the SDK returns the volume indication in the at the time interval set in enableAudioVolumeIndication
, regardless of whether any user is speaking in the channel.
interval | Sets the time interval between two consecutive volume indications:
|
smooth | The smoothing factor that sets the sensitivity of the audio volume indicator. The value range is [0, 10]. The greater the value, the more sensitive the indicator. The recommended value is 3. |
- (int) adjustUserPlaybackSignalVolume: | (NSUInteger) | uid | |
volume: | (int) | volume | |
Adjust the playback signal volume of a specified remote user.
You can call this method as many times as necessary to adjust the playback volume of different remote users, or to repeatedly adjust the playback volume of the same remote user.
Note**
uid | The ID of the remote user. |
volume | The playback volume of the specified remote user. The value ranges from 0 to 100: |
- (int) startRecordingDeviceTest: | (int) | indicationInterval |
Starts the microphone test.
This method tests whether the microphone works properly. Once the test starts, the SDK reports the volume information by using the [reportAudioVolumeIndicationOfSpeakers]([AgoraRtcEngineDelegate rtcEngine:reportAudioVolumeIndicationOfSpeakers:totalVolume:]) callback method.
indicationInterval | Interval (ms) at which to report the microphone volume. |
- (int) stopRecordingDeviceTest |
Stops the microphone test.
This method stops testing the microphone. You must call this method to stop the test after calling the [startRecordingDeviceTest](startRecordingDeviceTest:) method.
- (int) startPlaybackDeviceTest: | (NSString *_Nonnull) | audioFileName |
Starts a playback device test.
This method tests whether the playback device works properly with the specified playback audio file.
audioFileName | File path of the audio file for the test, which is in utf8 absolute path: |
- (int) stopPlaybackDeviceTest |
Stops the playback device test.
This method stops testing the playback device. You must call this method to stop the test after calling [startPlaybackDeviceTest](startPlaybackDeviceTest:).
- (int) registerExtensionWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
sourceType: | (AgoraMediaSourceType) | sourceType | |
Registers an extension. Normally, you should call this function immediately after initializing the engine. Once an extension is registered, the SDK will automatically create and add it to the pipeline.
provider | The name of the extension provider, e.g. agora.io. |
extension | The name of the extension, e.g. agora.beauty. |
sourceType | The source type of the extension, e.g. AgoraMediaSourceTypePrimaryCamera. See AgoraMediaSourceType. |
- (int) enableExtensionWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
enabled: | (BOOL) | enabled | |
Enable/Disable an extension. By calling this function, you can dynamically enable/disable the extension without changing the pipeline. For example, enabling/disabling Extension_A means the data will be adapted/bypassed by Extension_A.
NOTE: For compatibility reasons, if you haven't call registerExtensionWithVendor, enableExtension will automatically register the specified extension. We suggest you call registerExtensionWithVendor explicitly.
provider | The name of the extension provider, e.g. agora.io. |
extension | The name of the extension, e.g. agora.beauty. |
enabled | Whether to enable the extension:
|
- (int) enableExtensionWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
enabled: | (BOOL) | enabled | |
sourceType: | (AgoraMediaSourceType) | sourceType | |
Enable/Disable an extension. By calling this function, you can dynamically enable/disable the extension without changing the pipeline. For example, enabling/disabling Extension_A means the data will be adapted/bypassed by Extension_A.
NOTE: For compatibility reasons, if you haven't call registerExtensionWithVendor, enableExtension will automatically register the specified extension. We suggest you call registerExtensionWithVendor explicitly.
provider | The name of the extension provider, e.g. agora.io. |
extension | The name of the extension, e.g. agora.beauty. |
enabled | Whether to enable the extension:
|
sourceType | The source type of the extension, e.g. AgoraMediaSourceTypePrimaryCamera. See AgoraMediaSourceType |
- (int) enableExtensionWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
extensionInfo: | (AgoraExtensionInfo *__nonnull) | extensionInfo | |
enabled: | (BOOL) | enabled | |
Enable/Disable an extension. By calling this function, you can dynamically enable/disable the extension without changing the pipeline. For example, enabling/disabling Extension_A means the data will be adapted/bypassed by Extension_A.
NOTE: For compatibility reasons, if you haven't call registerExtensionWithVendor, enableExtension will automatically register the specified extension. We suggest you call registerExtensionWithVendor explicitly.
provider | The name of the extension provider, e.g. agora.io. |
extension | The name of the extension, e.g. agora.beauty. |
extensionInfo | The information for extension definition see AgoraExtensionInfo |
enabled | Whether to enable the extension:
|
- (int) setExtensionProviderPropertyWithVendor: | (NSString *__nonnull) | provider | |
key: | (NSString *__nonnull) | key | |
value: | (NSString *__nonnull) | value | |
Sets the provider property of an extension.
provider | The name of the extension provider, e.g. agora.io. |
key | The key of the extension. |
value | The JSON formatted value of the extension key. |
- (int) setExtensionPropertyWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
key: | (NSString *__nonnull) | key | |
value: | (NSString *__nonnull) | value | |
Sets the properties of an extension.
provider | The name of the extension provider, e.g. agora.io. |
extension | The name of the extension, e.g. agora.beauty. |
key | The key of the extension. |
value | The JSON formatted value of the extension key. |
- (int) setExtensionPropertyWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
key: | (NSString *__nonnull) | key | |
value: | (NSString *__nonnull) | value | |
sourceType: | (AgoraMediaSourceType) | sourceType | |
Sets the properties of an extension.
provider | The name of the extension provider, e.g. agora.io. |
extension | The name of the extension, e.g. agora.beauty. |
key | The key of the extension. |
value | The JSON formatted value of the extension key. |
sourceType | The source type of the extension, e.g. AgoraMediaSourceTypePrimaryCamera. See AgoraMediaSourceType. |
- (int) setExtensionPropertyWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
extensionInfo: | (AgoraExtensionInfo *__nonnull) | extensionInfo | |
key: | (NSString *__nonnull) | key | |
value: | (NSString *__nonnull) | value | |
Sets the properties of an extension.
provider | The name of the extension provider, e.g. agora.io. |
extension | The name of the extension, e.g. agora.beauty. |
extensionInfo | The information for extension. See AgoraExtensionInfo. |
key | The key of the extension. |
value | The JSON formatted value of the extension key. |
- (NSString * _Nullable) getExtensionPropertyWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
key: | (NSString *__nonnull) | key | |
Gets the properties of an extension.
provider | The name of the extension provider, e.g. agora.io. |
extension | The name of the extension, e.g. agora.beauty. |
key | The key of the extension. |
- (NSString * _Nullable) getExtensionPropertyWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
key: | (NSString *__nonnull) | key | |
sourceType: | (AgoraMediaSourceType) | sourceType | |
Gets the properties of an extension.
provider | The name of the extension provider, e.g. agora.io. |
extension | The name of the extension, e.g. agora.beauty. |
key | The key of the extension. |
sourceType | The source type of the extension, e.g. AgoraMediaSourceTypePrimaryCamera. See AgoraMediaSourceType. |
- (NSString * _Nullable) getExtensionPropertyWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
extensionInfo: | (AgoraExtensionInfo *__nonnull) | extensionInfo | |
key: | (NSString *__nonnull) | key | |
Gets the properties of an extension.
provider | The name of the extension provider, e.g. agora.io. |
extension | The name of the extension, e.g. agora.beauty. |
extensionInfo | The information for extension. See AgoraExtensionInfo. |
key | The key of the extension. |
- (int) enableVideo |
Enables the video.
You can call this method either before joining a channel or during a call. If you call this method before entering a channel, the service starts the video; if you call it during a call, the audio call switches to a video call.
- (int) disableVideo |
Disables the video.
This method stops capturing the local video and receiving all remote video. To enable the local preview function, call enableLocalVideo: enableLocalVideo(YES).
- (int) enableLocalVideo: | (BOOL) | enabled |
Disables or re-enables the local video capture.
Once you enable the video using enableVideo, the local video is enabled by default. This method disables or re-enables the local video capture.
enableLocalVideo(NO)
applies to scenarios when the user wants to watch the remote video without sending any video stream to the other user.
enableVideo
. Otherwise, this method may not work properly.enabled | Determines whether to disable or re-enable the local video, including the capturer, renderer, and sender:
|
- (NSArray <AgoraVideoCodecCapInfo *> *__nullable) queryCodecCapability |
Querys current device codec capacity.
- (int) queryDeviceScore |
Queries the score of the current device.
Most devices score between 60-100, with higher scores indicating better performance.0: If the value is greater than 0, it means that the device score has been retrieved and represents the score value.
< 0: Failure.
- (int) setupLocalVideo: | (AgoraRtcVideoCanvas *_Nullable) | local |
This method initializes the video view of the local stream on the local device.
It affects only the video view that the local user sees, not the published local video stream.
Call this method to bind the local video stream to a video view and to set the rendering and mirror modes of the video view. To unbind the view
, set the view
in AgoraRtcVideoCanvas to nil
.
local | The local video view and settings. See AgoraRtcVideoCanvas. |
- (int) setLocalRenderMode: | (AgoraVideoRenderMode) | mode | |
mirror: | (AgoraVideoMirrorMode) | mirror | |
Updates the display mode of the local video view.
After initialzing the local video view, you can call this method to update its rendering mode. It affects only the video view that the local user sees, not the published local video stream.
mode | Sets the local display mode. See AgoraVideoRenderMode. |
mirror | Sets the mirror mode. See #AgoraVideoMirrorMode |
- (int) startPreview |
Starts the local video preview before joining a channel.
Once you call this method to start the local video preview, if you leave the channel by calling leaveChannel: leaveChannel, the local video preview remains until you call stopPreview to disable it.
- (int) startPreview: | (AgoraVideoSourceType) | sourceType |
Starts the local video preview before joining a channel.
Once you call this method to start the local video preview, if you leave the channel by calling leaveChannel: leaveChannel, the local video preview remains until you call stopPreview to disable it.
sourceType | source type of video. See AgoraVideoSourceType. |
- (int) stopPreview |
Stops the local video preview and the video.
- (int) stopPreview: | (AgoraVideoSourceType) | sourceType |
Stops the local video preview and the video.
sourceType | source type of video. See AgoraVideoSourceType. |
- (int) setRemoteRenderMode: | (NSUInteger) | uid | |
mode: | (AgoraVideoRenderMode) | mode | |
mirror: | (AgoraVideoMirrorMode) | mirror | |
Configures the remote video display mode. The application can call this method multiple times to change the display mode.
uid | User id of the user whose video streams are received. |
mode | AgoraVideoRenderMode |
mirror | AgoraVideoMirrorMode |
- (int) muteLocalVideoStream: | (BOOL) | mute |
Stops or resumes sending the local video stream.
mute | Determines whether to send or stop sending the local video stream:
|
- (int) muteRemoteVideoStream: | (NSUInteger) | uid | |
mute: | (BOOL) | mute | |
Stops or resumes receiving the video stream of a specified user.
You can call this method before or after joining a channel. If a user leaves a channel, the settings in this method become invalid.
uid | ID of the specified remote user. |
mute | Whether to stop receiving the video stream of the specified user:
|
- (int) muteAllRemoteVideoStreams: | (BOOL) | mute |
Stops/Resumes receiving all remote video streams.
This method works for all remote users that join or will join a channel. You can call this method before, during, or after a call.
muteAllRemoteVideoStreams
(YES) before joining a channel, the local user does not receive any video stream after joining the channel.muteAllRemoteVideoStreams
(YES) after joining a channel, the local use stops receiving any video stream from any user in the channel, including any user who joins the channel after you call this method.muteAllRemoteVideoStreams
(YES) after leaving a channel, the local user does not receive any video stream the next time the user joins a channel.After you successfully call muteAllRemoteVideoStreams
(YES), you can take the following actions:
muteAllRemoteVideoStreams
(NO).uid
is the ID of the user whose video stream you want to resume receiving.muteAllRemoteVideoStreams
stop taking effect if either of the following occurs:enableVideo
after muteAllRemoteVideoStreams
(YES).disableVideo
after muteAllRemoteVideoStreams
(NO).mute | Whether to stop receiving remote video streams:
|
- (int) setFaceShapeBeautyOptions: | (BOOL) | enable | |
options: | (AgoraFaceShapeBeautyOptions *_Nullable) | options | |
Enables/Disables face shape and sets the beauty options.
enable | Sets whether or not to enable face shape: |
YES
: Enable face shape.NO
: Disable face shape. options | Sets the face shape beauty option. See AgoraFaceShapeBeautyOptions. |
- (int) setFaceShapeBeautyOptions: | (BOOL) | enable | |
options: | (AgoraFaceShapeBeautyOptions *_Nullable) | options | |
sourceType: | (AgoraMediaSourceType) | sourceType | |
Enables/Disables face shape and sets the beauty options.
enable | Sets whether or not to enable face shape: |
YES
: Enable face shape.NO
: Disable face shape. options | Sets the face shape style option. See AgoraFaceShapeBeautyOptions. |
sourceType | The source type of the extension, e.g. AgoraMediaSourceTypePrimaryCamera. See AgoraMediaSourceType. |
- (AgoraFaceShapeBeautyOptions * _Nullable) getFaceShapeBeautyOptions |
Gets the face shape beauty options.
- (AgoraFaceShapeBeautyOptions * _Nullable) getFaceShapeBeautyOptions: | (AgoraMediaSourceType) | sourceType |
Gets the face shape beauty options.
sourceType | The source type of the extension, e.g. AgoraMediaSourceTypePrimaryCamera. See AgoraMediaSourceType. |
- (int) setFaceShapeAreaOptions: | (AgoraFaceShapeAreaOptions *_Nullable) | options |
Sets the face shape area options.
options | Sets the face shape area option. See AgoraFaceShapeAreaOptions.. |
- (int) setFaceShapeAreaOptions: | (AgoraFaceShapeAreaOptions *_Nullable) | options | |
sourceType: | (AgoraMediaSourceType) | sourceType | |
Sets the face shape area options.
options | Sets the face shape area option. See AgoraFaceShapeAreaOptions. |
sourceType | The source type of the extension, e.g. AgoraMediaSourceTypePrimaryCamera. See AgoraMediaSourceType. |
- (AgoraFaceShapeAreaOptions * _Nullable) getFaceShapeAreaOptions: | (AgoraFaceShapeArea) | area |
Gets the face shape area options.
area | Sets the face shape area. See AgoraFaceShapeArea. |
- (AgoraFaceShapeAreaOptions * _Nullable) getFaceShapeAreaOptions: | (AgoraFaceShapeArea) | area | |
sourceType: | (AgoraMediaSourceType) | sourceType | |
Gets the face shape area options.
area | Sets the face shape area. See AgoraFaceShapeArea. |
sourceType | The source type of the extension, e.g. AgoraMediaSourceTypePrimaryCamera. See AgoraMediaSourceType. |
- (int) setVideoDenoiserOptions: | (BOOL) | enable | |
options: | (AgoraVideoDenoiserOptions *_Nullable) | options | |
Sets video noise reduction.
Underlit environments and low-end video capture devices can cause video images to contain significant noise, which affects video quality. In real-time interactive scenarios, video noise also consumes bitstream resources and reduces encoding efficiency during encoding.
You can call this method to enable the video noise reduction feature and set the options of the video noise reduction effect.
Note:**
AgoraClearVisionExtension.xcframework
dynamic library.enable | Sets whether to enable video noise reduction: |
options | The video noise reduction options. See AgoraVideoDenoiserOptions. |
- (int) setVideoDenoiserOptions: | (BOOL) | enable | |
options: | (AgoraVideoDenoiserOptions *_Nullable) | options | |
sourceType: | (AgoraMediaSourceType) | sourceType | |
Sets video noise reduction.
Underlit environments and low-end video capture devices can cause video images to contain significant noise, which affects video quality. In real-time interactive scenarios, video noise also consumes bitstream resources and reduces encoding efficiency during encoding.
You can call this method to enable the video noise reduction feature and set the options of the video noise reduction effect.
Note:**
AgoraClearVisionExtension.xcframework
dynamic library.enable | Sets whether to enable video noise reduction: |
options | The video noise reduction options. See AgoraVideoDenoiserOptions. |
sourceType | The source type of the extension, e.g. AgoraMediaSourceTypePrimaryCamera. See AgoraMediaSourceType. |
- (int) setLowlightEnhanceOptions: | (BOOL) | enable | |
options: | (AgoraLowlightEnhanceOptions *_Nullable) | options | |
Sets low-light enhancement.
The low-light enhancement feature can adaptively adjust the brightness value of the video captured in situations with low or uneven lighting, such as backlit, cloudy, or dark scenes. It restores or highlights the image details and improves the overall visual effect of the video.
You can call this method to enable the low-light enhancement feature and set the options of the low-light enhancement effect.
Note:**
AgoraClearVisionExtension.xcframework
dynamic library.enable | Sets whether to enable low-light enhancement: |
options | The low-light enhancement options. See AgoraLowlightEnhanceOptions. |
- (int) setLowlightEnhanceOptions: | (BOOL) | enable | |
options: | (AgoraLowlightEnhanceOptions *_Nullable) | options | |
sourceType: | (AgoraMediaSourceType) | sourceType | |
Sets low-light enhancement.
The low-light enhancement feature can adaptively adjust the brightness value of the video captured in situations with low or uneven lighting, such as backlit, cloudy, or dark scenes. It restores or highlights the image details and improves the overall visual effect of the video.
You can call this method to enable the low-light enhancement feature and set the options of the low-light enhancement effect.
Note:**
AgoraClearVisionExtension.xcframework
dynamic library.enable | Sets whether to enable low-light enhancement: |
options | The low-light enhancement options. See AgoraLowlightEnhanceOptions. |
sourceType | The source type of the extension, e.g. AgoraMediaSourceTypePrimaryCamera. See AgoraMediaSourceType. |
- (int) setColorEnhanceOptions: | (BOOL) | enable | |
options: | (AgoraColorEnhanceOptions *_Nullable) | options | |
Sets color enhancement.
The video images captured by the camera can have color distortion. The color enhancement feature intelligently adjusts video characteristics such as saturation and contrast to enhance the video color richness and color reproduction, making the video more vivid.
You can call this method to enable the color enhancement feature and set the options of the color enhancement effect.
Note:**
AgoraClearVisionExtension.xcframework
dynamic library.enable | Sets whether to enable color enhancement: |
options | The color enhancement options. See AgoraColorEnhanceOptions. |
- (int) setColorEnhanceOptions: | (BOOL) | enable | |
options: | (AgoraColorEnhanceOptions *_Nullable) | options | |
sourceType: | (AgoraMediaSourceType) | sourceType | |
Sets color enhancement.
The video images captured by the camera can have color distortion. The color enhancement feature intelligently adjusts video characteristics such as saturation and contrast to enhance the video color richness and color reproduction, making the video more vivid.
You can call this method to enable the color enhancement feature and set the options of the color enhancement effect.
Note:**
AgoraClearVisionExtension.xcframework
dynamic library.enable | Sets whether to enable color enhancement: |
options | The color enhancement options. See AgoraColorEnhanceOptions. |
sourceType | The source type of the extension, e.g. AgoraMediaSourceTypePrimaryCamera. See AgoraMediaSourceType. |
- (int) enableVirtualBackground: | (BOOL) | enable | |
backData: | (AgoraVirtualBackgroundSource *_Nullable) | backData | |
segData: | (AgoraSegmentationProperty *_Nullable) | segData | |
Enables/Disables the virtual background. (beta function)
After enabling the virtual background function, you can replace the original background image of the local user with a custom background image. After the replacement, all users in the channel can see the custom background image. You can find out from the [virtualBackgroundSourceEnabled]([AgoraRtcEngineDelegate rtcEngine:virtualBackgroundSourceEnabled:reason:]) callback whether the virtual background is successfully enabled or the cause of any errors.
Note**:
AgoraVideoSegmentationExtension.framework
dynamic library into the project folder.enable | Sets whether to enable the virtual background: |
YES
: Enable.NO
: Disable. backData | The custom background image. See AgoraVirtualBackgroundSource. |
segData | See AgoraSegmentationProperty. |
- (int) enableVirtualBackground: | (BOOL) | enable | |
backData: | (AgoraVirtualBackgroundSource *_Nullable) | backData | |
segData: | (AgoraSegmentationProperty *_Nullable) | segData | |
sourceType: | (AgoraMediaSourceType) | sourceType | |
Enables/Disables the virtual background. (beta function)
After enabling the virtual background function, you can replace the original background image of the local user with a custom background image. After the replacement, all users in the channel can see the custom background image. You can find out from the [virtualBackgroundSourceEnabled]([AgoraRtcEngineDelegate rtcEngine:virtualBackgroundSourceEnabled:reason:]) callback whether the virtual background is successfully enabled or the cause of any errors.
Note**:
AgoraVideoSegmentationExtension.framework
dynamic library into the project folder.enable | Sets whether to enable the virtual background: |
YES
: Enable.NO
: Disable. backData | The custom background image. See AgoraVirtualBackgroundSource. |
segData | See AgoraSegmentationProperty. |
sourceType | The source type of the extension, e.g. AgoraMediaSourceTypePrimaryCamera. See AgoraMediaSourceType. |
- (int) setVideoScenario: | (AgoraApplicationScenarioType) | scenarioType |
You can call this method to set the expected video scenario. The SDK witll optimize the video experience for each scenario you set.
scenarioType | The video application scenario(AgoraApplicationScenarioType). |
- (int) setVideoQoEPreference: | (AgoraQoEPreferenceType) | preferenceType |
Sets the video qoe preference. You can call this method to set the expected QoE Preference. The SDK will optimize the video experience for each preference you set.
preferenceType | The qoe preference type. See #VIDEO_QOE_PREFERENCE_TYPE. |
- (BOOL) isFeatureAvailableOnDevice: | (AgoraFeatureType) | type |
Whether the target feature is available for the device.
type | The feature type. See AgoraFeatureType. |
- (int) setVoiceBeautifierPreset: | (AgoraVoiceBeautifierPreset) | preset |
Sets an SDK preset voice beautifier effect.
Call this method to set an SDK preset voice beautifier effect for the local user who sends an audio stream. After setting a voice beautifier effect, all users in the channel can hear the effect.
You can set different voice beautifier effects for different scenarios. See Set the Voice Beautifier and Audio Effects.
To achieve better audio effect quality, Agora recommends calling setAudioProfile and setting the scenario
parameter to AUDIO_SCENARIO_GAME_STREAMING(3)
and the profile
parameter to AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)
or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)
before calling this method.
profile
parameter of setAudioProfile to AUDIO_PROFILE_SPEECH_STANDARD(1)
or AUDIO_PROFILE_IOT(6)
; otherwise, this method call fails.preset | The options for SDK preset voice beautifier effects: #VOICE_BEAUTIFIER_PRESET. |
- (int) setVoiceConversionPreset: | (AgoraVoiceConversionPreset) | preset |
Sets an SDK preset voice conversion.
Call this method to set an SDK preset audio effect for the local user who sends an audio stream. This audio effect does not change the gender characteristics of the original voice. After setting an audio effect, all users in the channel can hear the effect.
You can set different audio effects for different scenarios. See Set the Voice Beautifier and Audio Effects.
To achieve better audio effect quality, Agora recommends calling setAudioProfile and setting the scenario
parameter to AUDIO_SCENARIO_GAME_STREAMING(3)
before calling this method.
parameter
of setAudioProfile
to AUDIO_PROFILE_SPEECH_STANDARD(1)
or AUDIO_PROFILE_IOT(6)
; otherwise, this method call fails.preset
parameter to enumerators except ROOM_ACOUSTICS_3D_VOICE
or PITCH_CORRECTION
, do not call setAudioEffectParameters; otherwise, setAudioEffectParameters
overrides this method.setAudioEffectPreset
:preset | The options for SDK preset audio effects. See #VOICE_CONVERSION_PRESET. |
- (int) setVoiceBeautifierParameters: | (AgoraVoiceBeautifierPreset) | preset | |
param1: | (int) | param1 | |
param2: | (int) | param2 | |
Sets parameters for SDK preset voice beautifier effects.
Call this method to set a gender characteristic and a reverberation effect for the singing beautifier effect. This method sets parameters for the local user who sends an audio stream.
After you call this method successfully, all users in the channel can hear the relevant effect.
To achieve better audio effect quality, before you call this method, Agora recommends calling setAudioProfile, and setting the scenario
parameter as AUDIO_SCENARIO_GAME_STREAMING(3)
and the profile
parameter as AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)
or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)
.
profile
parameter of setAudioProfile as AUDIO_PROFILE_SPEECH_STANDARD(1)
or AUDIO_PROFILE_IOT(6)
; otherwise, this method call does not take effect.setVoiceBeautifierParameters
:preset | The options for SDK preset voice beautifier effects:
|
param1 | The gender characteristics options for the singing voice:
|
param2 | The reverberation effects options:
|
- (int) setVoiceConversionParameters: | (AgoraVoiceConversionPreset) | preset | |
param1: | (int) | param1 | |
param2: | (int) | param2 | |
Set parameters for SDK preset voice conversion.
preset | The options for SDK preset audio effects. See #VOICE_CONVERSION_PRESET. |
param1 | reserved. |
param2 | reserved. |
- (int) setHeadphoneEQPreset: | (AgoraHeadphoneEQPreset) | preset |
Sets preset audio playback effect for remote headphones after remote audio is mixed.
preset | The preset key: #HEADPHONE_EQUALIZER_PRESET.
|
- (int) setHeadphoneEQParameters: | (int) | lowGain | |
highGain: | (int) | highGain | |
Sets the parameters of audio playback effect for remote headphones after remote audio is mixed.
lowGain | The higher the parameter value, the deeper the sound. The value range is [-10,10]. |
highGain | The higher the parameter value, the sharper the sound. The value range is [-10,10]. |
- (int) enableVoiceAITuner: | (bool) | enabled | |
type: | (AgoraVoiceAITunerType) | type | |
Enables or disables the voice AI tuner.
enabled | Determines whether to enable the voice AI tuner:
|
type. | The options for SDK voice AI tuner types. See #VOICE_AI_TUNER_TYPE. |
- (int) enableSoundPositionIndication: | (BOOL) | enabled |
Enables/Disables stereo panning for remote users.
If you need to use the [setRemoteVoicePosition]([AgoraRtcEngineKit setRemoteVoicePosition:pan:gain:]) method, ensure that you call this method before joining a channel to enable stereo panning for remote users.
enabled | Sets whether or not to enable stereo panning for remote users: |
YES
: enables stereo panning.NO
: disables stereo panning.-157
(AgoraErrorCodeModuleNotFound
): The library for enabling deep-learning noise reduction is not integrated. - (int) setRemoteVoicePosition: | (NSUInteger) | uid | |
pan: | (double) | pan | |
gain: | (double) | gain | |
Sets the sound position and gain of a remote user.
When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, such as Battle Royale games.
Note:**
uid | The ID of the remote user. |
pan | The sound position of the remote user. The value ranges from -1.0 to 1.0: |
gain | Gain of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original gain of the remote user). The smaller the value, the less the gain. |
- (int) enableSpatialAudio: | (BOOL) | enabled |
Enables/Disables spatial audio for remote users.
enabled | Sets whether or not to enable spatial audio for remote users: |
YES
: enables spatial audio.NO
: disables spatial audio.- (int) setAINSMode: | (BOOL) | enabled | |
mode: | (AUDIO_AINS_MODE) | mode | |
enabled | Determines whether to enable AINS.
|
mode | The type of the ains |
- (int) selectAudioTrack: | (NSInteger) | index |
Select audio track for the music file.
Call this method when you are in a channel.
- (int) getAudioTrackCount |
Get audio track count of the music file.
Call this method when you are in a channel.
- (int) startAudioRecordingWithConfig: | (AgoraAudioRecordingConfiguration *_Nonnull) | config |
Starts an audio recording on the client.
The SDK allows recording audio during a call. After successfully calling this method, you can record the audio of users in the channel and get an audio recording file. Supported file formats are as follows:
AgoraAudioRecordingQualityMedium
, the file size for a 10-minute recording is approximately 2 MB.Once the user leaves the channel, the recording automatically stops.
config | Recording configuration. See AgoraAudioRecordingConfiguration. |
< 0: Failure.
-160(AgoraErrorCodeAlreadyInRecording
): The client is already recording audio. To start a new recording, call [stopAudioRecording]([AgoraRtcEngineKit stopAudioRecording]) to stop the current recording first, and then call startAudioRecordingWithConfig
.
- (int) setAudioEncodedFrameDelegate: | (id< AgoraAudioEncodedFrameDelegate > _Nullable) | delegate | |
config: | (AgoraAudioEncodedFrameDelegateConfig *_Nonnull) | config | |
- (int) startEchoTestWithConfig: | (AgoraEchoTestConfiguration *_Nonnull) | config |
Starts an audio/video call loop test.
config | The configuration for audio/video echo test. |
- (int) enableInEarMonitoring: | (BOOL) | enabled |
Enables in-ear monitoring.
enabled | Determines whether to enable in-ear monitoring.
|
- (int) enableInEarMonitoring: | (BOOL) | enabled | |
includeAudioFilters: | (AgoraEarMonitoringFilterType) | includeAudioFilters | |
Enables in-ear monitoring.
enabled | Determines whether to enable in-ear monitoring.
|
includeAudioFilters | The type of the ear monitoring: AgoraEarMonitoringFilterType. |
- (int) setInEarMonitoringVolume: | (NSInteger) | volume |
Sets the volume of the in-ear monitoring.
volume | The volume of the in-ear monitor, ranging from 0 to 100, can be amplified to 400, but not suggested. The default value is 100. |
- (int) enableDualStreamMode: | (BOOL) | enabled |
Enables or disables the dual video stream mode.
enabled |
|
- (int) enableDualStreamMode: | (BOOL) | enabled | |
streamConfig: | (AgoraSimulcastStreamConfig *_Nonnull) | streamConfig | |
Enables or disables the dual video stream mode.
If dual-stream mode is enabled, the subscriber can choose to receive the high-stream (high-resolution high-bitrate video stream) or low-stream (low-resolution low-bitrate video stream) video using setRemoteVideoStreamType.
enabled |
|
streamConfig |
|
- (int) setDualStreamMode: | (AgoraSimulcastStreamMode) | mode |
Enables, disables or auto enable the dual video stream mode.
mode |
|
- (int) setDualStreamMode: | (AgoraSimulcastStreamMode) | mode | |
streamConfig: | (AgoraSimulcastStreamConfig *_Nonnull) | streamConfig | |
Enables, disables or auto enable the dual video stream mode.
If dual-stream mode is enabled, the subscriber can choose to receive the high-stream (high-resolution high-bitrate video stream) or low-stream (low-resolution low-bitrate video stream) If dual-stream mode is auto, if user subscriber low-stream, then we will send low-stream video using setRemoteVideoStreamType.
mode |
|
streamConfig |
|
- (int) setSimulcastConfig: | (AgoraSimulcastConfig *_Nonnull) | simulcastConfig |
Sets the multi-layer video stream configuration.
If multi-layer is configured, the subscriber can choose to receive the coresponding layer of video stream using setRemoteVideoStreamType.
simulcastConfig |
|
- (int) setRemoteDefaultVideoStreamType: | (AgoraVideoStreamType) | streamType |
Sets the default stream type of the remote video if the remote user has enabled the dual-stream mode.
streamType | The default video stream type: AgoraVideoStreamType. |
- (int) setRemoteVideoSubscriptionOptions: | (NSUInteger) | uid | |
options: | (AgoraVideoSubscriptionOptions *_Nonnull) | options | |
Sets the remote video subscription options
uid | ID of the remote user sending the video stream. |
options | Sets the video subscription options. |
- (int) setSubscribeAudioAllowlist: | (NSArray< NSNumber * > *_Nonnull) | allowlist |
Sets the allowlist of subscribe remote stream audio.
allowlist | The uid list of users who do subscribe to audio. |
If a user is in the blocklist and allowlist at the same time, the user will not subscribe to audio.
- (int) setSubscribeVideoAllowlist: | (NSArray< NSNumber * > *_Nonnull) | allowlist |
Sets the allowlist of subscribe remote stream video.
allowlist | The uid list of users who do subscribe to video. |
If a user is in the blocklist and allowlist at the same time, the user will not subscribe to video.
- (int) setHighPriorityUserList: | (NSArray< NSNumber * > *_Nullable) | uidList | |
option: | (AgoraStreamFallbackOptions) | option | |
Sets high priority user list and related remote subscribe stream fallback option.
This method sets the high priority user list and disables/enables the vips' remote subscribe stream fallback option according to the network conditions in NASA2.
If you use the option as AgoraStreamFallbackOptionAudioOnly = 2, the AutVos will automatically switch the video from a high-stream to a low-stream, or disable the video when the downlink network conditions cannot support both audio and video to guarantee the quality of the audio. The AutVos monitors the network quality and re-enables the video stream when the network conditions improve. Once the subscribed stream falls back to audio only, or the audio stream switches back to the video stream, the [didRemoteSubscribeFallbackToAudioOnly]([AgoraRtcEngineDelegate rtcEngine:didRemoteSubscribeFallbackToAudioOnly:byUid:]) callback will be triggered.
option | AgoraStreamFallbackOptions |
- (void) setExternalVideoSource: | (BOOL) | enable | |
useTexture: | (BOOL) | useTexture | |
sourceType: | (AgoraExternalVideoSourceType) | sourceType | |
Sets the external video source.
Call this API before enableVideo
or startPreview
.
enable | Determines whether to enable the external video source.
|
The Agora SDK does not support switching video sources dynamically in the channel. If an external video source is enabled and you are in a channel, if you want to switch to an internal video source, you must exit the channel. Then call this method to set enable as NO, and join the channel again.
useTexture | Determines whether to use textured video data.
|
sourceType | Determines the type of the external video source.
|
- (void) setExternalVideoSource: | (BOOL) | enable | |
useTexture: | (BOOL) | useTexture | |
sourceType: | (AgoraExternalVideoSourceType) | sourceType | |
encodedVideoTrackOption: | (AgoraEncodedVideoTrackOptions *_Nonnull) | encodedVideoTrackOption | |
Sets the external video source.
Call this API before enableVideo
or startPreview
.
enable | Determines whether to enable the external video source.
|
The Agora SDK does not support switching video sources dynamically in the channel. If an external video source is enabled and you are in a channel, if you want to switch to an internal video source, you must exit the channel. Then call this method to set enable as NO, and join the channel again.
useTexture | Determines whether to use textured video data.
|
sourceType | Determines the type of the external video source. |
encodedVideoTrackOption | Determines encoded video track options. |
- (BOOL) pushExternalVideoFrame: | (AgoraVideoFrame *_Nonnull) | frame |
Pushes the external video frame.
This method pushes the video frame using the AgoraVideoFrame class and passes it to the Agora SDK with the format
parameter in AgoraVideoFormat.
Call setExternalVideoSource:useTexture:pushMode: setExternalVideoSource and set the pushMode
parameter as YES
before calling this method.
frame | Video frame containing the SDK's encoded video data to be pushed: AgoraVideoFrame. |
YES
: Success.NO
: Failure. - (BOOL) pushExternalVideoFrame: | (AgoraVideoFrame *_Nonnull) | frame | |
videoTrackId: | (NSUInteger) | videoTrackId | |
Pushes the external video frame.
This method pushes the video frame using the AgoraVideoFrame class and passes it to the Agora SDK with the format
parameter in AgoraVideoFormat.
Call setExternalVideoSource:useTexture:pushMode: setExternalVideoSource and set the pushMode
parameter as YES
before calling this method.
frame | Video frame containing the SDK's encoded video data to be pushed: AgoraVideoFrame. |
videoTrackId | The id of the video track. |
YES
: Success.NO
: Failure. - (int) pushExternalEncodedVideoFrame: | (NSData *_Nonnull) | frame | |
info: | (AgoraEncodedVideoFrameInfo *_Nonnull) | info | |
Pushes the encoded external video frame to Agora SDK.
frame | The encoded external video data, which must be the direct buffer. |
info | The encoded external video frame info: AgoraEncodedVideoFrameInfo. |
- (int) pushExternalEncodedVideoFrame: | (NSData *_Nonnull) | frame | |
info: | (AgoraEncodedVideoFrameInfo *_Nonnull) | info | |
videoTrackId: | (NSUInteger) | videoTrackId | |
Pushes the encoded external video frame to specified connection in Agora SDK.
frame | The encoded external video data, which must be the direct buffer. |
info | The encoded external video frame info: AgoraEncodedVideoFrameInfo. |
videoTrackId | The id of the video track. |
- (unsigned int) createCustomVideoTrack |
Get an custom video track id created by internal,which could used to publish or preview
- (unsigned int) createCustomEncodedVideoTrack: | (AgoraEncodedVideoTrackOptions *_Nonnull) | encodedVideoTrackOption |
Get an custom encoded video track id created by internal,which could used to publish or preview
- (int) destroyCustomVideoTrack: | (NSUInteger) | videoTrackId |
destroy a created custom video track id
videoTrackId | The video track id which was created by createCustomVideoTrack |
- (int) destroyCustomEncodedVideoTrack: | (NSUInteger) | videoTrackId |
destroy a created custom encoded video track id
videoTrackId | The video track id which was created by createCustomEncodedVideoTrack |
- (void) enableExternalAudioSink: | (BOOL) | enabled | |
sampleRate: | (NSUInteger) | sampleRate | |
channels: | (NSUInteger) | channels | |
Enables the external audio sink.
This method applies to scenarios where you want to use external audio data for playback. After enabling the external audio sink, you can call the [pullPlaybackAudioFrameRawData]([AgoraRtcEngineKit pullPlaybackAudioFrameRawData:lengthInByte:]) / [pullPlaybackAudioFrameSampleBufferByLengthInByte]([AgoraRtcEngineKit pullPlaybackAudioFrameSampleBufferByLengthInByte:]) method to pull the remote audio data, process it, and play it with the audio effects that you want.
enabled | Determines whether to enable the external audio sick:
|
sampleRate | Sets the sample rate (Hz) of the external audio sink. You can set this parameter as 16000, 32000, 44100 or 48000. |
channels | Sets the number of audio channels of the external audio sink: |
- (BOOL) pullPlaybackAudioFrameRawData: | (void *_Nonnull) | data | |
lengthInByte: | (NSUInteger) | lengthInByte | |
Pulls the remote audio data in the RawData format.
Before calling this method, call the [enableExternalAudioSink]([AgoraRtcEngineKit enableExternalAudioSink:channels:]) method to enable and set the external audio sink.
After a successful method call, the app pulls the decoded and mixed audio data for playback.
Note**
data | The audio data that you want to pull. The data format is in byte[]. |
lengthInByte | The data length (byte) of the external audio data. |
The value of this parameter is related to the value of the sampleRate
parameter that you set in the [enableExternalAudioSink]([AgoraRtcEngineKit enableExternalAudioSink:channels:]) method: lengthInByte = sampleRate / 100 * 2 * number of channels * time (ms).
- (CMSampleBufferRef _Nullable) pullPlaybackAudioFrameSampleBufferByLengthInByte: | (NSUInteger) | lengthInByte |
Pulls the remote audio data in the SampleBuffer format.
Before calling this method, call the [enableExternalAudioSink]([AgoraRtcEngineKit enableExternalAudioSink:channels:]) method to enable and set the external audio sink.
After a successful method call, the app pulls the decoded and mixed audio data for playback.
Note**
lengthInByte | The data length (byte) of the external audio data. |
The value of this parameter is related to the value of the sampleRate parameter that you set in the [enableExternalAudioSink]([AgoraRtcEngineKit enableExternalAudioSink:channels:]) method:
lengthInByte
= sampleRate
/ 100 * 2 * number of channels * time (ms).- (int) createCustomAudioTrack: | (AgoraAudioTrackType) | trackType | |
config: | (AgoraAudioTrackConfig *_Nonnull) | config | |
Create a custom audio track and get the audio track id.
joinChannel
.trackType | The type of custom audio track See AgoraAudioTrackType. |
config | The config of custom audio track See AgoraAudioTrackConfig. |
- (int) destroyCustomAudioTrack: | (NSInteger) | trackId |
Destroy custom audio track by trackId
trackId | The custom audio track id |
- (int) enableCustomAudioLocalPlayback: | (NSInteger) | trackId | |
enabled: | (BOOL) | enabled | |
Sets the external audio source.
trackId | custom audio track id. |
enabled | Enable/Disables the local playback of external audio track:
|
- (int) setRecordingAudioFrameParametersWithSampleRate: | (NSInteger) | sampleRate | |
channel: | (NSInteger) | channel | |
mode: | (AgoraAudioRawFrameOperationMode) | mode | |
samplesPerCall: | (NSInteger) | samplesPerCall | |
Sets the audio recording format for the onRecordAudioFrame
callback.
The SDK calculates the sample interval according to the value of the sampleRate
, channel
, and samplesPerCall
parameters you set in this method. Sample interval (sec) = samplePerCall
/(sampleRate
× channel
). Ensure that the value of sample interval is no less than 0.01. The SDK triggers the onRecordAudioFrame
callback according to the sample interval.
sampleRate | The audio sample rate (samplesPerSec ) returned in the onRecordAudioFrame callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
channel | The number of audio channels (channels ) returned in the onRecordAudioFrame callback, which can be set as 1 or 2:
|
mode | Deprecated. The use mode of the onRecordAudioFrame callback.See AgoraAudioRawFrameOperationMode. |
samplesPerCall | The number of samples the onRecordAudioFrame callback returns. Set it as 1024 for RTMP streaming. |
- (int) setPlaybackAudioFrameParametersWithSampleRate: | (NSInteger) | sampleRate | |
channel: | (NSInteger) | channel | |
mode: | (AgoraAudioRawFrameOperationMode) | mode | |
samplesPerCall: | (NSInteger) | samplesPerCall | |
Sets the audio playback format for the onPlaybackAudioFrame
callback.
The SDK calculates the sample interval according to the value of the sampleRate
, channel
, and samplesPerCall
parameters you set in this method. Sample interval (sec) = samplePerCall
/(sampleRate
× channel
). Ensure that the value of sample interval is no less than 0.01. The SDK triggers the onPlaybackAudioFrame
callback according to the sample interval.
sampleRate | The sample rate (samplesPerSec ) returned in the onPlaybackAudioFrame callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
channel | The number of audio channels (channels ) returned in the onPlaybackAudioFrame callback, which can be set as 1 or 2:
|
mode | Deprecated. The use mode of the onPlaybackAudioFrame callback. See AgoraAudioRawFrameOperationMode. |
samplesPerCall | The number of samples the onPlaybackAudioFrame callback returns. Set it as 1024 for RTMP streaming. |
- (int) setMixedAudioFrameParametersWithSampleRate: | (NSInteger) | sampleRate | |
channel: | (NSInteger) | channel | |
samplesPerCall: | (NSInteger) | samplesPerCall | |
Sets the mixed audio format for the onMixedAudioFrame
callback.
sampleRate | The sample rate (Hz) of the audio data returned in the onMixedAudioFrame callback, which can set be as 8000, 16000, 32000, 44100, or 48000. |
channel | The number of channels of the audio data in onMixedAudioFrame callback, which can be set as 1 or 2:
|
samplesPerCall | Not supported. Sampling points in the called data returned in onMixedAudioFrame . For example, it is usually set as 1024 for stream pushing. |
- (int) setEarMonitoringAudioFrameParametersWithSampleRate: | (NSInteger) | sampleRate | |
channel: | (NSInteger) | channel | |
mode: | (AgoraAudioRawFrameOperationMode) | mode | |
samplesPerCall: | (NSInteger) | samplesPerCall | |
Sets the audio ear monitoring format for the onEarMonitoringAudioFrame
callback.
The SDK calculates the sample interval according to the value of the sampleRate
, channel
, and samplesPerCall
parameters you set in this method. Sample interval (sec) = samplePerCall
/(sampleRate
× channel
). Ensure that the value of sample interval is no less than 0.01. The SDK triggers the onEarMonitoringAudioFrame
callback according to the sample interval.
sampleRate | The sample rate (samplesPerSec ) returned in the onEarMonitoringAudioFrame callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
channel | The number of audio channels (channels ) returned in the onEarMonitoringAudioFrame callback, which can be set as 1 or 2:
|
mode | Deprecated. The use mode of the onEarMonitoringAudioFrame callback. See AgoraAudioRawFrameOperationMode. |
samplesPerCall | The number of samples the onEarMonitoringAudioFrame callback returns. Set it as 1024 for RTMP streaming. |
- (int) setPlaybackAudioFrameBeforeMixingParametersWithSampleRate: | (NSInteger) | sampleRate | |
channel: | (NSInteger) | channel | |
Sets the audio frame parameters for the onPlaybackAudioFrameBeforeMixing callback.
sampleRate | The sample rate(Hz) contained in the onPlaybackAudioFrameBeforeMixing callback. You can set it as 8000, 16000, 32000, 44100, or 48000. |
channel | The number of channels contained in the onPlaybackAudioFrameBeforeMixing callback.
|
- (int) adjustCustomAudioPublishVolume: | (NSInteger) | trackId | |
volume: | (NSInteger) | volume | |
- (int) adjustCustomAudioPlayoutVolume: | (NSInteger) | trackId | |
volume: | (NSInteger) | volume | |
- (int64_t) getCurrentMonotonicTimeInMs |
- (int) registerAudioSpectrumDelegate: | (id< AgoraAudioSpectrumDelegate > _Nullable) | delegate |
Registers an audio spectrum delegate.
You need to register the following callbacks according to your scenario:
delegate | AgoraAudioSpectrumDelegate |
- (int) unregisterAudioSpectrumDelegate: | (id< AgoraAudioSpectrumDelegate > _Nullable) | delegate |
Releases the audio spectrum delegate.
delegate | AgoraAudioSpectrumDelegate |
- (int) enableAudioSpectrumMonitor: | (int) | intervalInMS |
Enable the audio spectrum monitor.
intervalInMS | Sets the time interval(ms) between two consecutive audio spectrum callback. The default value is 100. This param should be larger than 10. |
- (int) disableAudioSpectrumMonitor |
Disalbe the audio spectrum monitor.
- (int) enableEncryption: | (bool) | enabled | |
encryptionConfig: | (AgoraEncryptionConfig *_Nonnull) | config | |
Enables/Disables the built-in encryption.
In scenarios requiring high security, Agora recommends calling enableEncryption to enable the built-in encryption before joining a channel.
All users in the same channel must use the same encryption mode and encryption key. Once all users leave the channel, the encryption key of this channel is automatically cleared.
Note**
enabled | Whether to enable the built-in encryption: |
config | Configurations of built-in encryption schemas. See AgoraEncryptionConfig. |
AgoraErrorCodeInvalidArgument
): An invalid parameter is used. Set the parameter with a valid value.AgoraErrorCodeNotInitialized
): The SDK is not initialized. Initialize the AgoraRtcEngineKit
instance before calling this method.AgoraErrorCodeNotSupported
): The encryption mode is incorrect or the SDK fails to load the external encryption library. Check the enumeration or reload the external encryption library. - (int) createDataStream: | (NSInteger *_Nonnull) | streamId | |
config: | (AgoraDataStreamConfig *_Nonnull) | config | |
Creates a data stream.
Each user can create up to five data streams during the lifecycle of the [AgoraRtcChannel](AgoraRtcChannel).
streamId | ID of the created data stream. |
config | the config of data stream. |
- (int) startRtmpStreamWithoutTranscoding: | (NSString *_Nonnull) | url |
New publish stream interface, just publish raw stream
url | The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. The RTMP URL address must not contain special characters, such as Chinese language characters. |
- (int) startRtmpStreamWithTranscoding: | (NSString *_Nonnull) | url | |
transcoding: | (AgoraLiveTranscoding *_Nullable) | transcoding | |
New publish stream interface, just publish mix stream
url | The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. The RTMP URL address must not contain special characters, such as Chinese language characters. |
transcoding | Sets the CDN live audio/video transcoding settings. See AgoraLiveTranscoding. |
- (int) updateRtmpTranscoding: | (AgoraLiveTranscoding *_Nullable) | transcoding |
Sets the video layout and audio settings for CDN live. (CDN live only.)
The SDK triggers the [rtcEngineTranscodingUpdated]([AgoraRtcEngineDelegate rtcEngineTranscodingUpdated:]) callback when you call the setLiveTranscoding
method to update the transcoding setting.
Note**
setLiveTranscoding
method to update the transcoding setting for the first time, the SDK does not trigger the rtcEngineTranscodingUpdated
callback.transcoding | Sets the CDN live audio/video transcoding settings. See AgoraLiveTranscoding. |
- (int) stopRtmpStream: | (NSString *_Nonnull) | url |
Removes an RTMP stream from the CDN.
This method removes the RTMP URL address added by the [addPublishStreamUrl](addPublishStreamUrl:transcodingEnabled:) method from a CDN live stream.
This method call triggers the [rtmpStreamingChangedToState]([AgoraRtcEngineDelegate rtcEngine:rtmpStreamingChangedToState:state:errorCode:]) callback on the local client to report the state of removing an RTMP stream from the CDN.
Note:**
This method applies to live-broadcast profile only. This method removes only one URL each time it is called. The URL must not contain special characters, such as Chinese language characters.
url | The RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes. |
- (int) setScreenCaptureScenario: | (AgoraScreenScenarioType) | scenarioType |
Setting the screen sharing capture scenario.
scenarioType | The screen sharing scenario parameters, see [AgoraScreenScenarioType](AgoraScreenScenarioType). |
ERR_NOT_READY
: no screen or windows is being shared. - (int) stopScreenCapture |
Stops a screen capture.
- (int) startScreenCapture: | (AgoraScreenCaptureParameters2 *_Nullable) | parameters |
Starts screen sharing.
Before calling this method, ensure that you have integrated AgoraRelayKitExtension.framework. When you call this method, AgoraRtcEngine will establish a socket connection to the ReplayKit extension. In the ReplayKit extension, inherit the AgoraReplayKitHandler, and then AgoraRtcEngine will get the screen share data.
A successful call of this method triggers the [AgoraRtcEngineDelegate]([AgoraRtcEngineDelegate rtcEngine:localVideoStateChangedOfState:state:error:sourceType]) callback:
parameters | The configuration of the screen sharing. |
- (int) updateScreenCapture: | (AgoraScreenCaptureParameters2 *_Nullable) | parameters |
Updates the screen sharing configuration.
parameters | The configuration of the screen sharing. |
- (AgoraScreenCaptureFrameRateCapability) queryScreenCaptureCapability |
Queries the ability of screen sharing to support the maximum frame rate.
- (NSArray<AgoraFocalLengthInfo *>* __nullable) queryCameraFocalLengthCapability |
- (CGFloat) cameraMaxZoomFactor |
get the max camera zoom ratio.
- (int) switchCamera |
Switches between the front and rear cameras.
- (int) enableMultiCamera: | (BOOL) | enabled | |
config: | (AgoraCameraCapturerConfiguration *_Nullable) | config | |
Enables the SDK use AVCaptureMultiCamSession or AVCaptureSession. Applies to iOS 13.0+ only.
enabled | Whether to enable multi-camera when capturing video:
|
config | The config for secondary camera capture session. See AgoraCameraCapturerConfiguration. |
- (int) enableCameraCenterStage: | (BOOL) | enabled |
Enables the Portrait Center Stage.
enabled | enable Center Stage:
|
- (int) startCameraCapture: | (AgoraVideoSourceType) | sourceType | |
config: | (AgoraCameraCapturerConfiguration *_Nullable) | config | |
Start the camera capture
sourceType | source type of camera. See AgoraVideoSourceType. |
- (int) stopCameraCapture: | (AgoraVideoSourceType) | sourceType |
Stop the camera capture
sourceType | source type of camera. See AgoraVideoSourceType. |
- (int) enableFaceDetection: | (bool) | enable |
Enables/Disables face detection for the local user. (iOS only)
Once face detection is enabled, the SDK triggers the [facePositionDidChangeWidth]([AgoraRtcEngineDelegate rtcEngine:facePositionDidChangeWidth:previewHeight:faces:]) callback to report the face information of the local user, which includes the following aspects:
You can call this method either before or after joining a channel.
enable | Determines whether to enable the face detection function for the local user: |
- (int) addVideoWatermark: | (NSURL *_Nonnull) | url | |
options: | (WatermarkOptions *_Nonnull) | options | |
Adds a watermark image to the local video.
This method adds a PNG watermark image to the local video in the interactive live streaming. Once the watermark image is added, all the audience in the channel (CDN audience included), and the capturing device can see and capture it. Agora supports adding only one watermark image onto the local video, and the newly watermark image replaces the previous one.
The watermark position depends on the settings in the [setVideoEncoderConfiguration]([AgoraRtcEngineKit setVideoEncoderConfiguration:]) method:
When setting the watermark position, the region must be less than the dimensions set in the [setVideoEncoderConfiguration]([AgoraRtcEngineKit setVideoEncoderConfiguration:]) method. Otherwise, the watermark image will be cropped.
Note**
visibleInPreview
member in the WatermarkOptions class to set whether or not the watermark is visible in preview.url | The local file path of the watermark image to be added. This method supports adding a watermark image from the local file path. If the watermark image to be added is in the project file, you need to change the image's Type from PNG image to Data in the Xcode property, otherwise, the Agora Native SDK cannot recognize the image. |
options | The options of the watermark image to be added. See WatermarkOptions. |
- (int) registerLocalUserAccount: | (NSString *_Nonnull) | userAccount | |
appId: | (NSString *_Nonnull) | appId | |
Registers a user account.
Once registered, the user account can be used to identify the local user when the user joins the channel. After the user successfully registers a user account, the SDK triggers the onLocalUserRegistered callback on the local client, reporting the user ID and user account of the local user.
To join a channel with a user account, you can choose either of the following:
Call the [registerLocalUserAccount]([AgoraRtcEngineKit registerLocalUserAccount:appId:]) method to create a user account, and then the [joinChannelByUserAccount]([AgoraRtcEngineKit joinChannelByUserAccount:token:channelId:joinSuccess:]) method to join the channel. Call the [joinChannelByUserAccount]([AgoraRtcEngineKit joinChannelByUserAccount:token:channelId:joinSuccess:]) method to join the channel.
The difference between the two is that for the former, the time elapsed between calling the joinChannelWithUserAccount method and joining the channel is shorter than the latter.
userAccount
parameter. Otherwise, this method does not take effect.userAccount
parameter is unique in the channel.userAccount | The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
|
appId | The App ID of your project. |
- (int) joinChannelByToken: | (NSString *_Nullable) | token | |
channelId: | (NSString *_Nonnull) | channelId | |
userAccount: | (NSString *_Nonnull) | userAccount | |
joinSuccess: | (void(^)(NSString *_Nonnull channel, NSUInteger uid, NSInteger elapsed)) | joinSuccessBlock | |
Joins the channel with a user account.
After the user successfully joins the channel, the SDK triggers the following callbacks:
COMMUNICATION
profile, or is a host in the LIVE_BROADCASTING
profile.token | The token generated at your server:
|
channelId | The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
|
userAccount | The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
|
joinSuccessBlock | callback block |
- (int) joinChannelByToken: | (NSString *_Nullable) | token | |
channelId: | (NSString *_Nonnull) | channelId | |
userAccount: | (NSString *_Nonnull) | userAccount | |
mediaOptions: | (AgoraRtcChannelMediaOptions *_Nonnull) | mediaOptions | |
joinSuccess: | (void(^)(NSString *_Nonnull channel, NSUInteger uid, NSInteger elapsed)) | joinSuccessBlock | |
Joins the channel with a user account.
After the user successfully joins the channel, the SDK triggers the following callbacks:
COMMUNICATION
profile, or is a host in the LIVE_BROADCASTING
profile.token | The token generated at your server:
|
channelId | The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
|
userAccount | The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
|
mediaOptions | The channel media options: ChannelMediaOptions |
joinSuccessBlock | callback block |
- (AgoraUserInfo* _Nullable) getUserInfoByUserAccount: | (NSString *_Nonnull) | userAccount | |
withError: | (AgoraErrorCode *_Nullable) | error | |
Gets the user information by passing in the user account.
After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object (AgoraUserInfo
), and triggers the [didUpdatedUserInfo]([AgoraRtcEngineDelegate rtcEngine:didUpdatedUserInfo:withUid:]) callback on the local client.
After receiving the [didUpdatedUserInfo]([AgoraRtcEngineDelegate rtcEngine:didUpdatedUserInfo:withUid:]) callback, you can call this method to get the user ID of the remote user from the userInfo
object by passing in the user account.
userAccount | The user account of the user. Ensure that you set this parameter. |
error | The pointer to [AgoraErrorCode](AgoraErrorCode). It can be set as nil. |
- (AgoraUserInfo* _Nullable) getUserInfoByUid: | (NSUInteger) | uid | |
withError: | (AgoraErrorCode *_Nullable) | error | |
Gets the user information by passing in the user ID.
After a user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object (AgoraUserInfo
), and triggers the [didUpdatedUserInfo]([AgoraRtcEngineDelegate rtcEngine:didUpdatedUserInfo:withUid:]) callback on the local client.
After receiving the [didUpdatedUserInfo]([AgoraRtcEngineDelegate rtcEngine:didUpdatedUserInfo:withUid:]) callback, you can call this method to get the user account of the user from the userInfo
object by passing in the user ID.
uid | The user ID of the user. Ensure that you set this parameter. |
error | The pointer to [AgoraErrorCode](AgoraErrorCode). It can be set as nil. |
- (BOOL) setAudioFrameDelegate: | (id< AgoraAudioFrameDelegate > _Nullable) | delegate |
register & unregister the player audio observer
delegate | observer object, pass nil to unregister |
- (BOOL) setVideoFrameDelegate: | (id< AgoraVideoFrameDelegate > _Nullable) | delegate |
Registers & unregister video frame observer object.
delegate | An object to the video frame observer: id<AgoraVideoFrameDelegate>. |
- (BOOL) setEncodedVideoFrameDelegate: | (id< AgoraEncodedVideoFrameDelegate > _Nullable) | delegate |
Obtain H264 video data before decoding.
delegate | An object to the video frame observer: id<AgoraEncodedVideoFrameDelegate>. |
- (BOOL) setFaceInfoDelegate: | (id< AgoraFaceInfoDelegate > _Nullable) | delegate |
register & unregister the face info observer
delegate | observer object, pass nil to unregister |
- (BOOL) setMediaMetadataDataSource: | (id< AgoraMediaMetadataDataSource > _Nullable) | metadataDataSource | |
withType: | (AgoraMetadataType) | type | |
Sets the data source of the metadata.
You need to implement the AgoraMediaMetadataDataSource protocol and specify the type of metadata in this method.
Use this method with the AgoraRtcEngineKit.setMediaMetadataDelegate:withType: setMediaMetadataDelegate method to add synchronized metadata in the video stream. You can create more diversified live interactive streaming interactions, such as sending shopping links, digital coupons, and online quizzes.
Note**
joinChannelByToken
method.metadataDataSource | The AgoraMediaMetadataDataSource protocol. |
type | The metadata type. See AgoraMetadataType. Currently, the SDK supports video metadata only. |
- (BOOL) setMediaMetadataDelegate: | (id< AgoraMediaMetadataDelegate > _Nullable) | metadataDelegate | |
withType: | (AgoraMetadataType) | type | |
Sets the delegate of the metadata.
You need to implement the AgoraMediaMetadataDelegate protocol and specify the type of metadata in this method.
Note**
joinChannelByToken
method.metadataDelegate | The AgoraMediaMetadataDelegate protocol. |
type | The metadata type. See AgoraMetadataType. Currently, the SDK supports video metadata only. |
+ (NSString * _Nonnull) getSdkVersion |
Gets the Agora SDK version.
+ (NSString* _Nonnull) getErrorDescription: | (NSInteger) | error |
Gets the warning or error description.
error | The warning or error code. |
- (int) setLogFile: | (NSString *_Nonnull) | filePath |
Specifies an SDK output log file.
The log file records all log data for the SDK’s operation. Ensure that the directory for the log file exists and is writable.
App Sandbox/Library/caches/agorasdk.log
App Sandbox/Library/Logs/agorasdk.log
, for example /Users/<username>/Library/Containers/<App Bundle Identifier>/Data/Library/Logs/agorasdk.log
.~/Library/Logs/agorasdk.log
.filePath | Absolute path of the log file. The string of the log file is in UTF-8 code. |
- (int) setLogFilter: | (NSUInteger) | filter |
Sets the output log filter level of the SDK.
You can use one or a combination of the filters. The log level follows the sequence of Off
, Critical
, Error
, Warning
, Info
and Debug
. Choose a level to see the logs preceding that level.
For example, if you set the log filter level to Warning
, you see the logs within levels Critical
, Error
, and Warning
.
filter | Log filter level: AgoraLogFilter. |
- (int) setLogFileSize: | (NSUInteger) | fileSizeInKBytes |
Sets the log file size (KB).
The SDK has two log files, each with a default size of 512 KB. If you set fileSizeInBytes
as 1024 KB, the SDK outputs log files with a total maximum size of 2 MB. If the total size of the log files exceed the set value, the new output log files overwrite the old output log files.
fileSizeInKBytes | The SDK log file size (KB). |
- (NSString * _Nullable) uploadLogFile |
Upload current log file immediately to server. only use this when an error occurs block before log file upload success or timeout.
- (int) writeLog: | (AgoraLogLevel) | level | |
content: | (NSString *_Nonnull) | content | |
You can Write the log to SDK log files of the specified level
level | Log level: AgoraLogLevel. |
- (NSString * _Nullable) getCallId |
Gets the current call ID.
When a user joins a channel, a call ID is generated to identify the call.
After a call ends, you can call rate
or complain
to gather feedback from your customer.
- (int) rate: | (NSString *_Nonnull) | callId | |
rating: | (NSInteger) | rating | |
description: | (NSString *_Nullable) | description | |
Allows a user to rate the call.
It is usually called after the call ends.
callId | The call ID retrieved from the getCallId method. |
rating | The rating of the call between 1 (the lowest score) to 5 (the highest score). If you set a value out of this range, the AgoraErrorCodeInvalidArgument(-2) error occurs. |
description | (Optional) The description of the rating. The string length must be less than 800 bytes. |
callId
is invalid.- (int) complain: | (NSString *_Nonnull) | callId | |
description: | (NSString *_Nullable) | description | |
Allows a user to complain about the call quality.
This method is usually called after the call ends.
callId | The call ID retrieved from the getCallId method. |
description | (Optional) The description of the complaint. The string length must be less than 800 bytes. |
callId
is invalid.- (int) startLastmileProbeTest: | (AgoraLastmileProbeConfig *_Nullable) | config |
Starts the last-mile network probe test.
Starts the last-mile network probe test before joining a channel to get the uplink and downlink last-mile network statistics, including the bandwidth, packet loss, jitter, and round-trip time (RTT).
Call this method to check the uplink network quality before users join a channel or before an audience switches to a host.
Once this method is enabled, the SDK triggers the AgoraRtcEngineDelegate.rtcEngine:lastmileProbeTestResult: lastmileProbeTestResult callback within 30 seconds depending on the network conditions. This callback reports the real-time statistics of the network conditions.
lastmileProbeTestResult
callback. Otherwise, the callback may be interrupted.config | The configurations for the last-mile network probe test. See AgoraLastmileProbeConfig. |
- (int) stopLastmileProbeTest |
Stops the last-mile network probe test.
- (uint64_t) getNtpWallTimeInMs |
Return current NTP(unix timestamp) time in milliseconds.
- (id<AgoraRtcMediaPlayerProtocol>_Nullable) createMediaPlayerWithDelegate: | (id< AgoraRtcMediaPlayerDelegate >_Nullable) | delegate |
create MediaPlayer
delegate | An object to the mediaPlayer observer: id<AgoraRtcMediaPlayerDelegate>. |
- (id<AgoraRtcMediaPlayerCacheManagerProtocol> _Nullable) createMediaPlayerCacheManager |
create MediaPlayer cache manager
- (int) destroyMediaPlayer: | (id< AgoraRtcMediaPlayerProtocol >_Nullable) | mediaPlayer |
Destroy a media player source instance. If a media player source instance is destroyed, the video and audio of it cannot be published.
mediaPlayer | id<AgoraMediaPlayerProtocol> |
- (id<AgoraRtcMediaPlayerProtocol> _Nullable) getMediaPlayer: | (int) | mediaPlayerId |
getMediaPlayer
mediaPlayerId | of the mediaPlayer. |
- (int) startRhythmPlayer: | (NSString *_Nonnull) | sound1 | |
sound2: | (NSString *_Nonnull) | sound2 | |
config: | (AgoraRhythmPlayerConfig *_Nullable) | config | |
Enables the rhythm player.
sound1 | The absolute path or URL address (including the filename extensions) of the file for the downbeat. |
sound2 | The absolute path or URL address (including the filename extensions) of the file for the upbeats. |
config | The configuration of rhythm player. |
- (int) stopRhythmPlayer |
Disables the rhythm player.
- (int) configRhythmPlayer: | (AgoraRhythmPlayerConfig *_Nullable) | config |
Configures the rhythm player.
config | The configuration of rhythm player. |
- (int) setDirectCdnStreamingAudioConfiguration: | (AgoraAudioProfile) | profile |
Set audio parameters for direct streaming to CDN
profile | Sets the sample rate, bitrate, encoding mode, and the number of channels: #AUDIO_PROFILE_TYPE. |
- (int) setDirectCdnStreamingVideoConfiguration: | (AgoraVideoEncoderConfiguration *_Nonnull) | config |
Set video parameters for direct streaming to CDN
Each configuration profile corresponds to a set of video parameters, including the resolution, frame rate, and bitrate.
config | The local video encoder configuration: VideoEncoderConfiguration. |
- (int) startDirectCdnStreaming: | (id< AgoraDirectCdnStreamingEventDelegate > _Nonnull) | delegate | |
publishUrl: | (NSString *_Nonnull) | publishUrl | |
mediaOptions: | (AgoraDirectCdnStreamingMediaOptions *_Nonnull) | options | |
Start direct cdn streaming
delegate | A pointer to the direct cdn streaming event handler: IDirectCdnStreamingEventHandler. |
publishUrl | The url of the cdn used to publish the stream. |
options | The direct cdn streaming media options: AgoraDirectCdnStreamingMediaOptions. This API must pass an audio-related option, and temporarily cannot pass more than one. Video-related options may not be passed, or one, but not multiple. |
- (int) stopDirectCdnStreaming |
Stop direct cdn streaming
- (int) updateDirectCdnStreamingMediaOptions: | (AgoraDirectCdnStreamingMediaOptions *_Nonnull) | options |
Change the media source during the pushing
- (int) setAdvancedAudioOptions: | (AgoraAdvancedAudioOptions *_Nonnull) | options |
set advanced audio options. use this method before join channel / enableAudio / enableLocalAudio.
options | The AgoraAdvancedAudioOptions class, See the definition of AgoraAdvancedAudioOptions for details. |
- (int) sendCustomReportMessage: | (NSString *_Nullable) | messageId | |
category: | (NSString *_Nullable) | category | |
event: | (NSString *_Nullable) | event | |
label: | (NSString *_Nullable) | label | |
value: | (NSInteger) | value | |
Agora supports reporting and analyzing customized messages.
This function is in the beta stage with a free trial. The ability provided in its beta test version is reporting a maximum of 10 message pieces within 6 seconds, with each message piece not exceeding 256 bytes.
To try out this function, contact support@agora.io and discuss the format of customized messages with us.
- (int) setLogLevel: | (AgoraLogLevel) | level |
Sets the output log level of the SDK.
You can set the SDK to ouput the log files of the specified level.
level | The log level:
|
- (int) setLocalAccessPoint: | (AgoraLocalAccessPointConfiguration *_Nonnull) | config |
Set local access point configuration for local proxy service. Use this method before join channel.
config | The configuration for local access point. |
- (int) setCloudProxy: | (AgoraCloudProxyType) | proxyType |
Sets the Agora cloud proxy service.
When the user's firewall restricts the IP address and port, refer to Use Cloud Proxy* to add the specific IP addresses and ports to the firewall allowlist; then, call this method to enable the cloud proxy and set the cloud proxy type with the proxyType
parameter as AgoraUdpProxy(1)
, which is the cloud proxy for the UDP protocol.
After a successfully cloud proxy connection, the SDK triggers the [connectionChangedToState(AgoraConnectionStateConnecting, AgoraConnectionChangedSettingProxyServer)]([AgoraRtcEngineDelegate rtcEngine:connectionChangedToState:reason:]) callback.
To disable the cloud proxy that has been set, call setCloudProxy(AgoraNoneProxy)
. To change the cloud proxy type that has been set, call setCloudProxy(AgoraNoneProxy)
first, and then call setCloudProxy
, and pass the value that you expect in proxyType
.
Note**
proxyType | The cloud proxy type, see AgoraCloudProxyType. This parameter is required, and the SDK reports an error if you do not pass in a value. |
-2(AgoraErrorCodeInvalidArgument)
: The parameter is invalid.-7(AgoraErrorCodeNotInitialized)
: The SDK is not initialized. - (NSInteger) takeSnapshot: | (NSInteger) | uid | |
filePath: | (NSString *_Nonnull) | filePath | |
- (int) enableContentInspect: | (BOOL) | enabled | |
config: | (AgoraContentInspectConfig *_Nonnull) | config | |
- (int) setAVSyncSource: | (NSString *_Nonnull) | channelId | |
uid: | (NSUInteger) | uid | |
Bind local user and a remote user as an audio&video sync group. The remote user is defined by cid and uid. There’s a usage limit that local user must be a video stream sender. On the receiver side, media streams from same sync group will be time-synced
channelId | The channel id |
uid | The user ID of the remote user to be bound with (local user) |
- (int) sendAudioMetadata: | (NSData *_Nonnull) | metadata |
send audio metadata
metadata | The NSData of metadata |
- (int) enableVideoImageSource: | (BOOL) | enable | |
options: | (AgoraImageTrackOptions *_Nullable) | options | |
Enable or disable video image source to replace the current video source published or resume it
enable | true for enable, false for disable |
options | options for image track |
- (int) getNetworkType |
get network Type
- (AgoraMediaRecorder * _Nullable) createMediaRecorder: | (AgoraRecorderStreamInfo *_Nonnull) | info |
Creates a media recorder object and return its pointer.
info | The AgoraRecorderStreamInfo object. It contains the user ID and the channel name. |
- (int) destroyMediaRecorder: | (AgoraMediaRecorder *_Nullable) | mediaRecorder |
Destroy a media recorder source instance.
mediaRecorder | AgoraMediaRecorder pointer |
- (id<AgoraH265TranscoderProtocol>_Nullable) getH265Transcoder |
Get the H265Transcoder instance
- (int) enableWebSdkInteroperability: | (BOOL) | enabled |
enabled | Whether interoperability with the Agora Web SDK is enabled:
|
- (int) setAudioProfile: | (AgoraAudioProfile) | profile | |
scenario: | (AgoraAudioScenario) | scenario | |
Sets the audio parameters and application scenarios.
joinChannelByToken
.profile
as AgoraAudioProfileMusicHighQuality
(4) and scenario
as AgoraAudioScenarioGameStreaming
(3). profile | Sets the sample rate, bitrate, encoding mode, and the number of channels. See AgoraAudioProfile. |
scenario | Sets the audio application scenarios. See AgoraAudioScenario. |
- (int) setExternalAudioSource: | (BOOL) | enabled | |
sampleRate: | (NSInteger) | sampleRate | |
channels: | (NSInteger) | channels | |
Sets the external audio source.
enabled | Determines whether to enable the external audio source:
|
sampleRate | The Sample rate (Hz) of the external audio source, which can set be as 8000, 16000, 32000, 44100, or 48000. |
channels | The number of channels of the external audio source, which can be set as 1 or 2:
|
- (int) setExternalAudioSource: | (BOOL) | enabled | |
sampleRate: | (NSInteger) | sampleRate | |
channels: | (NSInteger) | channels | |
localPlayback: | (BOOL) | localPlayback | |
publish: | (BOOL) | publish | |
Sets the external audio source.
enabled | Determines whether to enable the external audio source:
|
sampleRate | The Sample rate (Hz) of the external audio source, which can set be as 8000, 16000, 32000, 44100, or 48000. |
channels | The number of channels of the external audio source, which can be set as 1 or 2:
|
localPlayback | Enable/Disables the local playback of external audio track:
|
publish | Determines whether to publish the external audio track:
|
- (int) setLocalRenderMode: | (NSUInteger) | uid | |
mode: | (AgoraVideoRenderMode) | mode | |
- (int) enableExternalAudioSourceLocalPlayback: | (BOOL) | enable |
Enable or disable the external audio source local playback.
enable | Determines whether to enable the external audio source local playback: |
- (void) addDelegate: | (id< AgoraRtcEngineDelegate > _Nonnull) | delegate |
Adds multiple SDK delegate.
delegate | The AgoraRtcEngineDelegate object. |
- (void) removeDelegate: | (id< AgoraRtcEngineDelegate > _Nonnull) | delegate |
Removes multiple SDK delegate.
delegate | The AgoraRtcEngineDelegate object. |
- (int) joinChannelExByToken: | (NSString *_Nullable) | token | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
delegate: | (id< AgoraRtcEngineDelegate > _Nullable) | delegate | |
mediaOptions: | (AgoraRtcChannelMediaOptions *_Nonnull) | mediaOptions | |
joinSuccess: | (void(^)(NSString *_Nonnull channel, NSUInteger uid, NSInteger elapsed)) | joinSuccessBlock | |
Joins a channel.
You can call this method multiple times to join multiple channels.
token | The token for authentication.
|
connection | AgoraRtcConnection by channelId and uid combine |
delegate | AgoraRtcEngineDelegate protocol.(Need a new object when called) |
mediaOptions | AgoraRtcChannelMediaOptions Object. |
joinSuccessBlock | Same as AgoraRtcEngineDelegate.rtcEngine:didJoinChannel:withUid:elapsed: didJoinChannel. We recommend you set this parameter as nil to use didJoinChannel .
|
Provided by category AgoraRtcEngineKit(Ex).
- (int) joinChannelExByToken: | (NSString *_Nullable) | token | |
channelId: | (NSString *_Nonnull) | channelId | |
userAccount: | (NSString *_Nonnull) | userAccount | |
delegate: | (id< AgoraRtcEngineDelegate > _Nullable) | delegate | |
mediaOptions: | (AgoraRtcChannelMediaOptions *_Nonnull) | mediaOptions | |
joinSuccess: | (void(^)(NSString *_Nonnull channel, NSUInteger uid, NSInteger elapsed)) | joinSuccessBlock | |
Joins the channel with a user account.
After the user successfully joins the channel, the SDK triggers the following callbacks:
COMMUNICATION
profile, or is a host in the LIVE_BROADCASTING
profile.token | The token generated at your server:
|
channelId | The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
|
userAccount | The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
|
delegate | AgoraRtcEngineDelegate protocol. |
mediaOptions | The channel media options: ChannelMediaOptions |
Provided by category AgoraRtcEngineKit(Ex).
- (int) updateChannelExWithMediaOptions: | (AgoraRtcChannelMediaOptions *_Nonnull) | mediaOptions | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Updates the channel media options after joining the channel.
mediaOptions | The channel media options: ChannelMediaOptions. |
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) setDelegateEx: | (id< AgoraRtcEngineDelegate > _Nullable) | delegate | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Resets the SDK delegate.
The SDK uses the delegate to inform the app on engine runtime events. All methods defined in the delegate are optional implementation methods.
delegate | The AgoraRtcEngineDelegate protocol. |
connection | The AgoraRtcConnection object. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) muteLocalAudioStreamEx: | (BOOL) | mute | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Stops or resumes sending the local audio stream with connection.
mute | Determines whether to send or stop sending the local audio stream:
|
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) muteLocalVideoStreamEx: | (BOOL) | mute | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Stops or resumes sending the local video stream with connection.
mute | Determines whether to send or stop sending the local video stream:
|
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) muteRemoteAudioStreamEx: | (NSUInteger) | uid | |
mute: | (BOOL) | mute | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Mutes a specified remote user's audio stream.
uid | User ID whose audio streams the user intends to mute. |
mute | * YES: Stops playing a specified user’s audio streams. NO: Resumes playing a specified user’s audio streams. |
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) muteAllRemoteAudioStreamsEx: | (BOOL) | mute | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Stops or resumes receiving all remote audio stream with connection.
mute | Whether to stop receiving remote audio streams:
|
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) setVideoEncoderConfigurationEx: | (AgoraVideoEncoderConfiguration *_Nonnull) | config | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Sets the video encoder configuration.
Each configuration profile corresponds to a set of video parameters, including the resolution, frame rate, and bitrate.
The parameters specified in this method are the maximum values under ideal network conditions. If the video engine cannot render the video using the specified parameters due to poor network conditions, the parameters further down the list are considered until a successful configuration is found.
config | The local video encoder configuration, see #AgoraVideoEncoderConfiguration. |
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) setupRemoteVideoEx: | (AgoraRtcVideoCanvas *_Nonnull) | remote | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Binds the remote user to the video display window, that is, sets the view for the user of the specified uid.
Usually, the application should specify the uid of the remote video in the method call before the user enters a channel. If the remote uid is unknown to the application, you can set the uid after receiving the AgoraRtcEngineDelegate.rtcEngine:didJoinedOfUid:elapsed: didJoinedOfUid event.
remote | AgoraRtcVideoCanvas |
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) setRemoteRenderModeEx: | (NSUInteger) | uid | |
mode: | (AgoraVideoRenderMode) | mode | |
mirror: | (AgoraVideoMirrorMode) | mirror | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Configures the remote video display mode. The application can call this method multiple times to change the display mode.
uid | User id of the user whose video streams are received. |
mode | AgoraVideoRenderMode |
mirror | AgoraVideoMirrorMode |
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) muteRemoteVideoStreamEx: | (NSUInteger) | uid | |
mute: | (BOOL) | mute | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Stops or resumes receiving the video stream of a specified user.
uid | ID of the specified remote user. |
mute | Determines whether to receive or stop receiving a specified video stream:
|
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) muteAllRemoteVideoStreamsEx: | (BOOL) | mute | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Stops or resumes receiving all remote video stream with connection.
mute | Whether to stop receiving remote video streams:
|
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) enableDualStreamModeEx: | (BOOL) | enabled | |
streamConfig: | (AgoraSimulcastStreamConfig *) | streamConfig | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Enables or disables the dual video stream mode.
If dual-stream mode is enabled, the subscriber can choose to receive the high-stream (high-resolution high-bitrate video stream) or low-stream (low-resolution low-bitrate video stream) video using setRemoteVideoStreamType setRemoteVideoStreamType.
enabled |
|
streamConfig | The minor stream config |
connection | An output parameter which is used to control different connection instances. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) setDualStreamModeEx: | (AgoraSimulcastStreamMode) | mode | |
streamConfig: | (AgoraSimulcastStreamConfig *) | streamConfig | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Enables or disables the dual video stream mode.
If dual-stream mode is enabled, the subscriber can choose to receive the high-stream (high-resolution high-bitrate video stream) or low-stream (low-resolution low-bitrate video stream) video using setRemoteVideoStreamType setRemoteVideoStreamType.
mode | The dual-stream mode. |
streamConfig | The minor stream config |
connection | An output parameter which is used to control different connection instances. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) setSimulcastConfigEx: | (AgoraSimulcastConfig *) | simulcastConfig | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Set the multi-layer video stream configuration.
If multi-layer is configed, the subscriber can choose to receive the coresponding layer of video stream using setRemoteVideoStreamType.
simulcastConfig |
|
connection | The RtcConnection object. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) setRemoteVideoStreamEx: | (NSUInteger) | uid | |
type: | (AgoraVideoStreamType) | streamType | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Sets the remote video stream type.
If the remote user has enabled the dual-stream mode, by default the SDK receives the high-stream video. Call this method to switch to the low-stream video.
uid | ID of the remote user sending the video stream. |
streamType | The video stream type: AgoraVideoStreamType. |
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) setRemoteVideoSubscriptionOptionsEx: | (NSUInteger) | uid | |
options: | (AgoraVideoSubscriptionOptions *_Nonnull) | options | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Sets the remote video subscription options
uid | ID of the remote user sending the video stream. |
options | Sets the video subscription options. |
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (AgoraUserInfo* _Nullable) getUserInfoByUserAccountEx: | (NSString *_Nonnull) | userAccount | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
withError: | (AgoraErrorCode *_Nullable) | error | |
Gets the user information by passing in the user account.
After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object (AgoraUserInfo
), and triggers the [didUpdatedUserInfo]([AgoraRtcEngineDelegate rtcEngine:didUpdatedUserInfo:withUid:]) callback on the local client.
After receiving the [didUpdatedUserInfo]([AgoraRtcEngineDelegate rtcEngine:didUpdatedUserInfo:withUid:]) callback, you can call this method to get the user ID of the remote user from the userInfo
object by passing in the user account.
userAccount | The user account of the user. Ensure that you set this parameter. |
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (AgoraUserInfo* _Nullable) getUserInfoByUidEx: | (NSUInteger) | uid | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
withError: | (AgoraErrorCode *_Nullable) | error | |
Gets the user information by passing in the user ID.
After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object (userInfo
), and triggers the onUserInfoUpdated callback on the local client.
After receiving the onUserInfoUpdated callback, you can call this method to get the user account of the remote user from the userInfo
object by passing in the user ID.
uid | The user ID of the remote user. Ensure that you set this parameter. |
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (AgoraConnectionState) getConnectionStateEx: | (AgoraRtcConnection *_Nonnull) | connection |
Gets the connection state of the SDK.
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) adjustRecordingSignalVolumeEx: | (NSInteger) | volume | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Adjusts the recording volume.
volume | The recording volume, which ranges from 0 to 400:
|
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) muteRecordingSignalEx: | (BOOL) | mute | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Mutes or resume recording signal volume.
mute | Determines whether to mute or resume the recording signal volume.
|
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) adjustUserPlaybackSignalVolumeEx: | (NSUInteger) | uid | |
volume: | (NSInteger) | volume | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Adjust the playback signal volume of a specified remote user.
You can call this method as many times as necessary to adjust the playback volume of different remote users, or to repeatedly adjust the playback volume of the same remote user.
Note**
uid | The ID of the remote user. |
volume | The playback volume of the specified remote user. The value ranges between 0 and 400, including the following: |
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) sendCustomReportMessageEx: | (NSString *_Nullable) | messageId | |
category: | (NSString *_Nullable) | category | |
event: | (NSString *_Nullable) | event | |
label: | (NSString *_Nullable) | label | |
value: | (NSInteger) | value | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Provided by category AgoraRtcEngineKit(Ex).
- (int) enableAudioVolumeIndicationEx: | (NSInteger) | interval | |
smooth: | (NSInteger) | smooth | |
reportVad: | (BOOL) | reportVad | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Provided by category AgoraRtcEngineKit(Ex).
- (int) setRemoteVoicePositionEx: | (NSUInteger) | uid | |
pan: | (double) | pan | |
gain: | (double) | gain | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Sets the sound position and gain of a remote user.
When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, such as Battle Royale games.
Note:**
uid | The ID of the remote user. |
pan | The sound position of the remote user. The value ranges from -1.0 to 1.0: |
gain | Gain of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original gain of the remote user). The smaller the value, the less the gain. |
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) addVideoWatermarkEx: | (NSURL *_Nonnull) | url | |
options: | (WatermarkOptions *_Nonnull) | options | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Adds a watermark image to the local video.
This method adds a PNG watermark image to the local video in the interactive live streaming. Once the watermark image is added, all the audience in the channel (CDN audience included), and the capturing device can see and capture it. Agora supports adding only one watermark image onto the local video, and the newly watermark image replaces the previous one.
The watermark position depends on the settings in the [setVideoEncoderConfiguration]([AgoraRtcEngineKit setVideoEncoderConfiguration:]) method:
When setting the watermark position, the region must be less than the dimensions set in the [setVideoEncoderConfiguration]([AgoraRtcEngineKit setVideoEncoderConfiguration:]) method. Otherwise, the watermark image will be cropped.
Note**
visibleInPreview
member in the WatermarkOptions class to set whether or not the watermark is visible in preview.url | The local file path of the watermark image to be added. This method supports adding a watermark image from the local file path. If the watermark image to be added is in the project file, you need to change the image's Type from PNG image to Data in the Xcode property, otherwise, the Agora Native SDK cannot recognize the image. |
options | The options of the watermark image to be added. See WatermarkOptions. |
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) clearVideoWatermarkEx: | (AgoraRtcConnection *_Nonnull) | connection |
Clears the watermark image on the video stream.
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (int) createDataStreamEx: | (NSInteger *_Nonnull) | streamId | |
reliable: | (BOOL) | reliable | |
ordered: | (BOOL) | ordered | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Creates a data stream.
Each user can create up to five data streams during the lifecycle of the AgoraRtcEngineKit
.
reliable
and ordered
parameters to YES
or NO
. Do not set one as YES
and the other as NO
.streamId | ID of the created data stream. |
reliable | Sets whether or not the recipients are guaranteed to receive the data stream from the sender within five seconds:
|
ordered | Sets whether or not the recipients receive the data stream in the sent order:
|
connection | AgoraRtcConnection by channelId and uid combine. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) createDataStreamEx: | (NSInteger *_Nonnull) | streamId | |
config: | (AgoraDataStreamConfig *_Nonnull) | config | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Creates a data stream.
Each user can create up to five data streams during the lifecycle of the [AgoraRtcChannel](AgoraRtcChannel).
streamId | ID of the created data stream. |
config | the config of data stream. |
connection | AgoraRtcConnection by channelId and uid combine. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) sendStreamMessageEx: | (NSInteger) | streamId | |
data: | (NSData *_Nonnull) | data | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Sends data stream messages to all users in a channel.
The SDK has the following restrictions on this method:
If the remote user receives the data stream within five seconds, the SDK triggers the AgoraRtcEngineDelegate.rtcEngine:receiveStreamMessageFromUid:streamId:data: receiveStreamMessageFromUid callback on the remote client, from which the remote user gets the stream message.
If the remote user does not receive the data stream within five seconds, the SDK triggers the AgoraRtcEngineDelegate.rtcEngine:didOccurStreamMessageErrorFromUid:streamId:error:missed:cached: didOccurStreamMessageErrorFromUid callback on the remote client.
streamId | ID of the sent data stream returned in the createDataStream method. |
data | Sent data. |
connection | AgoraRtcConnection by channelId and uid combine. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) setHighPriorityUserListEx: | (NSArray< NSNumber * > *_Nullable) | uidList | |
option: | (AgoraStreamFallbackOptions) | option | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Sets the high priority user list and related remote subscribe fallback option.
uidList | The uid list of high priority users. |
option | The remote subscribe fallback option of high priority users. |
connection | AgoraRtcConnection by channelId and uid combine. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) setSubscribeAudioAllowlistEx: | (NSArray< NSNumber * > *_Nonnull) | allowlist | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Sets the allowlist of subscribe remote stream audio.
allowlist | The uid list of users who do subscribe to audio. |
connection | AgoraRtcConnection by channelId and uid combine. |
If a user is in the blocklist and allowlist at the same time, the user will not subscribe to audio.
Provided by category AgoraRtcEngineKit(Ex).
- (int) setSubscribeVideoAllowlistEx: | (NSArray< NSNumber * > *_Nonnull) | allowlist | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Sets the allowlist of subscribe remote stream video.
allowlist | The uid list of users who do subscribe to video. |
connection | AgoraRtcConnection by channelId and uid combine. |
If a user is in the blocklist and allowlist at the same time, the user will not subscribe to video.
Provided by category AgoraRtcEngineKit(Ex).
- (NSInteger) takeSnapshotEx: | (AgoraRtcConnection *_Nonnull) | connection | |
uid: | (NSInteger) | uid | |
filePath: | (NSString *_Nonnull) | filePath | |
Provided by category AgoraRtcEngineKit(Ex).
- (int) sendAudioMetadataEx: | (AgoraRtcConnection *_Nonnull) | connection | |
metadata: | (NSData *_Nonnull) | metadata | |
send audio metadata
metadata | The NSData of metadata |
connection | AgoraRtcConnection. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) enableContentInspectEx: | (BOOL) | enabled | |
config: | (AgoraContentInspectConfig *_Nonnull) | config | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Enables video screenshot and upload with the connection ID.
enabled | Whether to video screenshot and upload:
|
config | The configuration for video screenshot and upload. |
connection | The connection information. See AgoraRtcConnection. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) startRtmpStreamWithoutTranscodingEx: | (NSString *_Nonnull) | url | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Publishes the local stream without transcoding to a specified CDN live RTMP address. (CDN live only.)
url | The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. |
connection | AgoraRtcConnection. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) startRtmpStreamWithTranscodingEx: | (NSString *_Nonnull) | url | |
transcoding: | (AgoraLiveTranscoding *_Nullable) | transcoding | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Publishes the local stream with transcoding to a specified CDN live RTMP address. (CDN live only.)
url | The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. |
transcoding | Sets the CDN live audio/video transcoding settings. See LiveTranscoding. |
connection | AgoraRtcConnection. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) updateRtmpTranscodingEx: | (AgoraLiveTranscoding *_Nullable) | transcoding | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Update the video layout and audio settings for CDN live. (CDN live only.)
transcoding | Sets the CDN live audio/video transcoding settings. See LiveTranscoding. |
connection | AgoraRtcConnection. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) stopRtmpStreamEx: | (NSString *_Nonnull) | url | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Stop an RTMP stream with transcoding or without transcoding from the CDN. (CDN live only.)
url | The RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes. |
connection | AgoraRtcConnection. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) startOrUpdateChannelMediaRelayEx: | (AgoraChannelMediaRelayConfiguration *_Nonnull) | config | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Starts or update to relay media streams across channels.
config | The configuration of the media stream relay:AgoraChannelMediaRelayConfiguration. |
connection | AgoraRtcConnection. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) stopChannelMediaRelayEx: | (AgoraRtcConnection *_Nonnull) | connection |
Stops the media stream relay.
Once the relay stops, the host quits all the destination channels.
connection | AgoraRtcConnection. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) pauseAllChannelMediaRelayEx: | (AgoraRtcConnection *_Nonnull) | connection |
pause the channels for media stream relay.
connection | AgoraRtcConnection. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) resumeAllChannelMediaRelayEx: | (AgoraRtcConnection *_Nonnull) | connection |
resume the channels for media stream relay.
connection | AgoraRtcConnection. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) startMediaRenderingTracingEx: | (AgoraRtcConnection *_Nonnull) | connection |
Start tracing media rendering events.
[AgoraRtcEngineDelegate rtcEngine:videoRenderingTracingResultOfUid:currentEvent:tracingInfo:]
connection | AgoraRtcConnection. |
-2(AgoraErrorCodeInvalidArgument)
: The parameter is invalid. Check the channel ID and local uid set by parameter connection
.-7(AgoraErrorCodeNotInitialized)
: The SDK is not initialized. Provided by category AgoraRtcEngineKit(Ex).
- (int) setParametersEx: | (NSString *_Nonnull) | options | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Provides the technical preview functionalities or special customizations by configuring the SDK with JSON options.
options | SDK options in JSON format. |
connection | AgoraRtcConnection. |
Provided by category AgoraRtcEngineKit(Ex).
- (NSString * _Nullable) getCallIdEx: | (AgoraRtcConnection *_Nonnull) | connection |
Gets the current call ID.
When a user joins a channel, a call ID is generated to identify the call.
After a call ends, you can call rate
or complain
to gather feedback from your customer.
connection | The AgoraRtcConnection object. |
Provided by category AgoraRtcEngineKit(Ex).
- (void) addDelegateEx: | (id< AgoraRtcEngineDelegate > _Nonnull) | delegate | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Adds multiple SDK delegate.
delegate | The AgoraRtcEngineDelegate object. |
connection | The AgoraRtcConnection object. |
Provided by category AgoraRtcEngineKit(Ex).
- (void) removeDelegateEx: | (id< AgoraRtcEngineDelegate > _Nonnull) | delegate | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Removes multiple SDK delegate.
delegate | The AgoraRtcEngineDelegate object. |
connection | The AgoraRtcConnection object. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) enableEncryptionEx: | (bool) | enabled | |
encryptionConfig: | (AgoraEncryptionConfig *_Nonnull) | config | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Enables/Disables the built-in encryption.
In scenarios requiring high security, Agora recommends calling enableEncryption to enable the built-in encryption before joining a channel.
All users in the same channel must use the same encryption mode and encryption key. Once all users leave the channel, the encryption key of this channel is automatically cleared.
Note**
enabled | Whether to enable the built-in encryption: |
config | Configurations of built-in encryption schemas. See AgoraEncryptionConfig. |
connection | AgoraRtcConnection by channelId and uid combine |
AgoraErrorCodeInvalidArgument
): An invalid parameter is used. Set the parameter with a valid value.AgoraErrorCodeNotInitialized
): The SDK is not initialized. Initialize the AgoraRtcEngineKit
instance before calling this method.AgoraErrorCodeNotSupported
): The encryption mode is incorrect or the SDK fails to load the external encryption library. Check the enumeration or reload the external encryption library. Provided by category AgoraRtcEngineKit(Ex).
|
readwritenonatomicweak |
Sets and retrieves the SDK delegate.
The SDK uses the delegate to inform the app on engine runtime events. All methods defined in the delegate are optional implementation methods.