Agora RTC Objective-C API Reference
Refactor
|
Inherits <NSObject>.
Core Methods | |
id< AgoraRtcEngineDelegate > _Nullable | delegate |
(int) | - joinChannelByToken:channelId:info:uid:joinSuccess: |
(int) | - joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: |
(int) | - leaveChannel: |
(int) | - setChannelProfile: |
(int) | - updateChannelWithMediaOptions: |
(int) | - setClientRole: |
(int) | - setClientRole:options: |
(int) | - renewToken: |
(AgoraConnectionState) | - getConnectionState |
(int) | - startChannelMediaRelay: |
(int) | - updateChannelMediaRelay: |
(int) | - stopChannelMediaRelay |
(int) | - pauseAllChannelMediaRelay |
(int) | - resumeAllChannelMediaRelay |
(int) | - enableWirelessAccelerate: |
(int) | - enableWebSdkInteroperability: |
(instancetype _Nonnull) | + sharedEngineWithAppId:delegate: |
(instancetype _Nonnull) | + sharedEngineWithConfig:delegate: |
(void) | + destroy |
Core Audio | |
(int) | - enableAudio |
(int) | - disableAudio |
(int) | - enableLocalAudio: |
(int) | - setAudioProfile: |
(int) | - enableAudioVolumeIndication:smooth:reportVad: |
(int) | - adjustUserPlaybackSignalVolume:volume: |
(int) | - enableExtensionWithVendor:extension:enabled:sourceType: |
(int) | - enableExtensionWithVendor:extension:extensionInfo:enabled: |
(int) | - setExtensionProviderPropertyWithVendor:key:value: |
(int) | - setExtensionPropertyWithVendor:extension:key:value:sourceType: |
(int) | - setExtensionPropertyWithVendor:extension:extensionInfo:key:value: |
(NSString *_Nullable) | - getExtensionPropertyWithVendor:extension:key: |
(NSString *_Nullable) | - getExtensionPropertyWithVendor:extension:key:sourceType: |
(NSString *_Nullable) | - getExtensionPropertyWithVendor:extension:extensionInfo:key: |
Core Video | |
(int) | - enableVideo |
(int) | - disableVideo |
(int) | - enableLocalVideo: |
(int) | - setupLocalVideo: |
(int) | - setLocalRenderMode:mode: |
(int) | - setLocalRenderMode:mirror: |
(int) | - startPreview |
(int) | - stopPreview |
(int) | - setRemoteRenderMode:mode:mirror: |
(int) | - muteLocalVideoStream: |
(int) | - muteAllRemoteVideoStreams: |
(int) | - setDefaultMuteAllRemoteVideoStreams: |
(int) | - muteRemoteVideoStream:mute: |
(int) | - setVideoDenoiserOptions:options: |
(int) | - setLowlightEnhanceOptions:options: |
(int) | - setColorEnhanceOptions:options: |
(int) | - enableVirtualBackground:backData:segData: |
(int) | - enableRemoteSuperResolution:enable: |
Audio Effect Playback | |
(int) | - setVoiceBeautifierPreset: |
(int) | - setVoiceConversionPreset: |
(int) | - setVoiceBeautifierParameters:param1:param2: |
(int) | - setVoiceConversionParameters:param1:param2: |
(int) | - setHeadphoneEQPreset: |
(int) | - setHeadphoneEQParameters:highGain: |
Sound Position Indication | |
(int) | - enableSoundPositionIndication: |
(int) | - setRemoteVoicePosition:pan:gain: |
(int) | - enableSpatialAudio: |
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) | - setRemoteVideo:SubscriptionOptions: |
(int) | - setRemoteDefaultVideoStreamType: |
(int) | - setSubscribeAudioAllowlist: |
(int) | - setSubscribeVideoAllowlist: |
Built-in Encryption | |
(int) | - enableEncryption:encryptionConfig: |
Data Steam | |
(int) | - createDataStream:config: |
(int) | - createDataStreamEx:reliable:ordered:connection: |
(int) | - createDataStreamEx:config:connection: |
(int) | - sendStreamMessageEx:data:connection: |
Stream Publish | |
(int) | - startRtmpStreamWithoutTranscoding: |
(int) | - startRtmpStreamWithTranscoding:transcoding: |
(int) | - updateRtmpTranscoding: |
(int) | - stopRtmpStream: |
(int) | - stopScreenCapture |
(int) | - startScreenCapture: |
(int) | - updateScreenCapture: |
(int) | - setSubscribeAudioAllowlistEx:connection: |
(int) | - setSubscribeVideoAllowlistEx:connection: |
(int) | - startRtmpStreamWithoutTranscodingEx:connection: |
(int) | - startRtmpStreamWithTranscodingEx:transcoding:connection: |
(int) | - updateRtmpTranscodingEx:connection: |
(int) | - stopRtmpStreamEx:connection: |
(int) | - startChannelMediaRelayEx:connection: |
(int) | - updateChannelMediaRelayEx:connection: |
(int) | - stopChannelMediaRelayEx: |
(int) | - pauseAllChannelMediaRelayEx: |
(int) | - resumeAllChannelMediaRelayEx: |
Camera Control | |
(CGFloat) | - cameraMaxZoomFactor |
(int) | - switchCamera |
(int) | - enableMultiCamera:config: |
(int) | - startSecondaryCameraCapture |
(int) | - stopSecondaryCameraCapture |
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: |
Media Metadata | |
(BOOL) | - setMediaMetadataDataSource:withType: |
(BOOL) | - setMediaMetadataDelegate:withType: |
Miscellaneous Methods | |
(int) | - setLogFile: |
(int) | - setLogFilter: |
(int) | - setLogFileSize: |
(NSString *_Nullable) | - uploadLogFile |
(NSString *_Nullable) | - getCallId |
(int) | - rate:rating:description: |
(int) | - complain:description: |
(int) | - startLastmileProbeTest: |
(int) | - stopLastmileProbeTest |
(NSInteger) | - getNtpTimeInMs |
(NSString *_Nonnull) | + getSdkVersion |
(NSString *_Nonnull) | + getErrorDescription: |
MediaPlayer publish | |
(id< AgoraRtcMediaPlayerProtocol >_Nullable) | - createMediaPlayerWithDelegate: |
(id< AgoraRtcMediaPlayerCacheManagerProtocol > _Nullable) | - createMediaPlayerCacheManager |
(int) | - destroyMediaPlayer: |
(id< AgoraRtcMediaPlayerProtocol > _Nullable) | - getMediaPlayer: |
(int) | - startRhythmPlayer:sound2:config: |
(int) | - stopRhythmPlayer |
(int) | - configRhythmPlayer: |
(int) | - setDirectCdnStreamingAudioConfiguration: |
(int) | - setDirectCdnStreamingVideoConfiguration: |
(int) | - startDirectCdnStreaming:publishUrl:mediaOptions: |
(int) | - stopDirectCdnStreaming |
(int) | - updateDirectCdnStreamingMediaOptions: |
Deprecated Methods | |
(int) | - setAudioProfile:scenario: |
(int) | - setAdvancedAudioOptions: |
(int) | - sendCustomReportMessage:category:event:label:value: |
(int) | - setLogLevel: |
(int) | - setLocalAccessPoint: |
(int) | - setCloudProxy: |
(int) | - setAVSyncSource:uid: |
(int) | - enableVideoImageSource:options: |
(int) | - getNetworkType |
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.
- (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
(AgoraRtmpStreamingErrorCodeOK
): 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) startChannelMediaRelay: | (AgoraChannelMediaRelayConfiguration *_Nonnull) | config |
Starts to relay media streams across channels.
After a successful method call, the SDK triggers the [channelMediaRelayStateDidChange]([AgoraRtcEngineDelegate rtcEngine:channelMediaRelayStateDidChange:error:]) and [didReceiveChannelMediaRelayEvent]([AgoraRtcEngineDelegate rtcEngine:didReceiveChannelMediaRelayEvent:]) callbacks, and these callbacks return the state and events of the media stream relay.
channelMediaRelayStateDidChange
callback returns AgoraChannelMediaRelayStateRunning(2) and AgoraChannelMediaRelayStateIdle(0), and the didReceiveChannelMediaRelayEvent
callback returns AgoraChannelMediaRelayEventSentToDestinationChannel(4), 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) updateChannelMediaRelay: | (AgoraChannelMediaRelayConfiguration *_Nonnull) | config |
Updates the channels for media stream relay.
After the channel media relay starts, if you want to relay the media stream to more channels, or leave the current relay channel, you can call the updateChannelMediaRelay
method.
After a successful method call, the SDK triggers the [didReceiveChannelMediaRelayEvent]([AgoraRtcEngineDelegate rtcEngine:didReceiveChannelMediaRelayEvent:]) callback with the AgoraChannelMediaRelayEventUpdateDestinationChannel(7) state code.
Note**
removeDestinationInfoForChannelName
method in channelMediaRelayConfiguration before calling this method.config | The media stream relay configuration: [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) enableWebSdkInteroperability: | (BOOL) | enabled |
enabled | Whether interoperability with the Agora Web SDK is enabled:
|
+ (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. + (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) enableExtensionWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
enabled: | (BOOL) | enabled | |
- (int) enableExtensionWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
enabled: | (BOOL) | enabled | |
sourceType: | (AgoraMediaSourceType) | sourceType | |
Enable/Disable extension.
provider | name for provider, e.g. agora.builtin. |
extension | name for extension, e.g. agora.beauty. |
enabled | enable or disable.
|
sourceType | Media source types definition see AgoraMediaSourceType, default is AgoraMediaSourceTypeUnknown. |
- (int) enableExtensionWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
extensionInfo: | (AgoraExtensionInfo *__nonnull) | extensionInfo | |
enabled: | (BOOL) | enabled | |
Enable/Disable extension.
provider | name for provider, e.g. agora.io. |
extension | name for extension, e.g. agora.beauty. |
extensionInfo | the information for extension. |
enabled | enable or disable.
|
- (int) setExtensionProviderPropertyWithVendor: | (NSString *__nonnull) | provider | |
key: | (NSString *__nonnull) | key | |
value: | (NSString *__nonnull) | value | |
Set extension provider specific property.
provider | name for provider, e.g. agora.io. |
key | key for the property. |
value | property value. |
- (int) setExtensionPropertyWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
key: | (NSString *__nonnull) | key | |
value: | (NSString *__nonnull) | value | |
- (int) setExtensionPropertyWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
key: | (NSString *__nonnull) | key | |
value: | (NSString *__nonnull) | value | |
sourceType: | (AgoraMediaSourceType) | sourceType | |
Set extension specific property.
provider | name for provider, e.g. agora.builtin. |
extension | name for extension, e.g. agora.beauty. |
key | key for the property. |
value | property value. |
sourceType | Media source types definition see AgoraMediaSourceType, default is AgoraMediaSourceTypeUnknown. |
- (int) setExtensionPropertyWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
extensionInfo: | (AgoraExtensionInfo *__nonnull) | extensionInfo | |
key: | (NSString *__nonnull) | key | |
value: | (NSString *__nonnull) | value | |
Set extension specific property.
provider | name for provider, e.g. agora.io. |
extension | name for extension, e.g. agora.beauty. |
extensionInfo | the information for extension. |
key | key for the property. |
value | property value of json format. |
- (NSString * _Nullable) getExtensionPropertyWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
key: | (NSString *__nonnull) | key | |
Get extension specific property.
provider | name for provider, e.g. agora.builtin. |
extension | name for extension, e.g. agora.beauty. |
key | key for the property. |
- (NSString * _Nullable) getExtensionPropertyWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
key: | (NSString *__nonnull) | key | |
sourceType: | (AgoraMediaSourceType) | sourceType | |
Get extension specific property.
provider | name for provider, e.g. agora.builtin. |
extension | name for extension, e.g. agora.beauty. |
key | key for the property. |
sourceType | Media source types definition see AgoraMediaSourceType, default is AgoraMediaSourceTypeUnknown. |
- (NSString * _Nullable) getExtensionPropertyWithVendor: | (NSString *__nonnull) | provider | |
extension: | (NSString *__nonnull) | extension | |
extensionInfo: | (AgoraExtensionInfo *__nonnull) | extensionInfo | |
key: | (NSString *__nonnull) | key | |
Get extension specific property.
provider | name for provider, e.g. agora.io. |
extension | name for extension, e.g. agora.beauty. |
extensionInfo | the information for extension. |
key | key for the property. |
- (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:
|
- (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: | (NSUInteger) | uid | |
mode: | (AgoraVideoRenderMode) | mode | |
- (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) stopPreview |
Stops the local video preview and the video.
- (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) 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) setDefaultMuteAllRemoteVideoStreams: | (BOOL) | mute |
joinChannelByToken
.Determines whether to receive all remote video streams by default.
mute | Whether to receive remote video streams by default:
|
- (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) 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) 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) 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) 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 |
- (int) enableRemoteSuperResolution: | (NSUInteger) | uid | |
enable: | (BOOL) | enable | |
Enables/Disables the super resolution feature for a remote user's video. (beta feature)
This feature effectively boosts the resolution of a remote user's video seen by the local user. If the original resolution of a remote user's video is a × b, the local user's device can render the remote video at a resolution of 2a × 2b after you enable this feature.
libagora_super_resolution_extension.so
AgoraSuperResolutionExtension.xcframework
uid | The user ID of the remote user. |
enable | Determines whether to enable super resolution for the remote user's video:
|
- (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) 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) 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) setRemoteVideo: | (NSUInteger) | uid | |
SubscriptionOptions: | (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) 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) 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.
- (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. |
- (int) pushExternalEncodedVideoFrame: | (NSData *_Nonnull) | frame | |
info: | (AgoraEncodedVideoFrameInfo *_Nonnull) | info | |
Pushes the encoded external video frame to Agora SDK.
data | The encoded external video data, which must be the direct buffer. |
frameInfo | The encoded external video frame info: AgoraEncodedVideoFrameInfo. |
- (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. - (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) 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) enableEchoCancellationExternal: | (BOOL) | enabled | |
audioSourceDelay: | (NSInteger) | audioSourceDelay | |
- (int) setExternalAudioSource: | (BOOL) | enabled | |
sampleRate: | (NSInteger) | sampleRate | |
channels: | (NSInteger) | channels | |
sourceNumber: | (NSInteger) | sourceNumber | |
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:
|
sourceNumber | The number of the external audio sources, should be greater than 0. |
- (int) enableCustomAudioLocalPlayback: | (NSInteger) | sourceId | |
enabled: | (BOOL) | enabled | |
Sets the external audio source.
sourceId | custom audio source id. |
enabled | Determines whether to local playback the external audio source:
|
- (int) pushCaptureAudioFrame: | (AgoraAudioFrame *_Nonnull) | audioFrame |
- (int) pushReverseAudioFrame: | (AgoraAudioFrame *_Nonnull) | audioFrame |
- (int) setDirectExternalAudioSource: | (BOOL) | enabled |
Sets the direct external audio source.
enabled | Determines whether to enable the direct external audio source:
|
- (int) setDirectExternalAudioSource: | (BOOL) | enabled | |
localPlayback: | (BOOL) | localPlayback | |
Sets the direct external audio source.
enabled | Determines whether to enable the direct external audio source:
|
localPlayback | Determines whether to enable the local playback of the direct external audio source |
- (int) pushDirectAudioFrameNSData: | (NSData *_Nonnull) | data |
Pushes the direct send audio data to the Agora SDK with not buffer.
data | External audio data. (sampleRate / channels by setExternalAudioSource: ) |
- (int) pushDirectAudioFrameRawData: | (void *_Nonnull) | data | |
samples: | (NSInteger) | samples | |
sampleRate: | (NSInteger) | sampleRate | |
channels: | (NSInteger) | channels | |
Pushes the direct send audio data to the Agora SDK with not buffer.
data | External audio data. |
samples | Number of samples for the push, which can be set as "samples = data.length / sizeof(int16_t)" |
sampleRate | The Sample rate (Hz) , which can set be as 8000, 16000, 32000, 44100, or 48000. |
channels | The number of channels, which can be set as 1 or 2:
|
- (int) enableExternalAudioSourceLocalPlayback: | (BOOL) | enable |
Enable or disable the external audio source local playback.
enable | Determines whether to enable the external audio source local playback: |
- (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) | sourceId | |
volume: | (NSInteger) | volume | |
- (int) adjustCustomAudioPlayoutVolume: | (NSInteger) | sourceId | |
volume: | (NSInteger) | volume | |
- (int64_t) getCurrentMonotonicTimeInMs |
- (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) 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) 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) 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. |
- (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) startSecondaryCameraCapture |
Start the secondary camera capture. Applies to iOS 13.0+ only.
- (int) stopSecondaryCameraCapture |
Stop the secondary camera capture. Applies to iOS 13.0+ only.
- (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) 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.
- (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.
- (NSInteger) getNtpTimeInMs |
Return current NTP(Network Time Protocol) 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. |
- (int) stopDirectCdnStreaming |
Stop direct cdn streaming
- (int) updateDirectCdnStreamingMediaOptions: | (AgoraDirectCdnStreamingMediaOptions *_Nonnull) | options |
Change the media source during the pushing
- (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) 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. |
- (BOOL) isSecure |
- (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) 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
- (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) 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) 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) setRemoteVideo: | (NSUInteger) | uid | |
SubscriptionOptionsEx: | (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).
- (int) pushExternalEncodedVideoFrameEx: | (NSData *_Nonnull) | frame | |
info: | (AgoraEncodedVideoFrameInfo *_Nonnull) | info | |
videoTrackId: | (NSUInteger) | videoTrackId | |
Pushes the encoded external video frame to specified connection in Agora SDK.
data | The encoded external video data, which must be the direct buffer. |
frameInfo | The encoded external video frame info: AgoraEncodedVideoFrameInfo. |
connection | AgoraRtcConnection by channelId and uid combine |
Provided by category AgoraRtcEngineKit(Ex).
- (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. 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) 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) 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) 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) startChannelMediaRelayEx: | (AgoraChannelMediaRelayConfiguration *_Nonnull) | config | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Starts to relay media streams across channels.
configuration | The configuration of the media stream relay:AgoraChannelMediaRelayConfiguration. |
connection | AgoraRtcConnection. |
Provided by category AgoraRtcEngineKit(Ex).
- (int) updateChannelMediaRelayEx: | (AgoraChannelMediaRelayConfiguration *_Nonnull) | config | |
connection: | (AgoraRtcConnection *_Nonnull) | connection | |
Updates the channels for media stream relay
configuration | The media stream relay configuration: 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).
|
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.