This topic describes the AliRtcEngine interface of the iOS SDK and Mac SDK.

Contents

Basic methods

API Description Supported earliest version
setH5CompatibleMode Set the H5 compatibility mode. 1.1
getH5CompatibleMode Check whether the H5 compatibility mode is set. 1.1
sharedInstance Create an AliRtcEngine instance. 1.17
destroy Release the SDK instance. 1.1
uploadLog Upload logs. 1.1
setLogDirPath Sets the path for storing the log files of AliLive SDK. 1.17
setLogLevel Configures the log level. 1.17

Channel-related interfaces

API Description Supported earliest version
joinChannel Join the channel. 1.1
leaveChannel Off the channel. 1.1
switchChannel Switch channels. 2.1
isInCall Check whether you are currently in the channel. 1.1
setChannelProfile Set the channel mode. 1.15
createChannelWithDelegate Create an AliRtcEngine subchannel instance. 2.1
destroyChannel Destroys the subchannel created by the createChannelWithDelegate. 2.1

Publish related interfaces

API Description Supported earliest version
publishLocalVideoStream Specify whether to allow video streams to be published. 2.1
isLocalVideoStreamPublished Queries whether the current video stream is allowed to be published. 1.1
isScreenSharePublished Queries whether the current screen stream is allowed to be published. 1.1
publishLocalAudioStream Specify whether to allow the audio stream to be published. 2.1
isLocalAudioStreamPublished Queries whether audio streams are currently allowed. 1.1
publishLocalDualStream Specify whether to allow secondary video streams to be published. 2.1
isDualStreamPublished Queries whether secondary video streams are currently allowed to be published. 2.1

Subscription-related interfaces

API Description Supported earliest version
setRemoteVideoStreamType Specify the format of the subscribed camera stream, large stream or small stream. 2.1
setRemoteDefaultVideoStreamType Specifies the format of the camera stream for the default subscription, large stream or small stream. 2.1
setDefaultSubscribeAllRemoteAudioStreams Specifies whether to receive audio streams by default. 2.1
subscribeAllRemoteAudioStreams Stop or resume receiving all remote audio streams. 2.1
subscribeRemoteAudioStream Stops or resumes audio stream pulling for a specific remote user. 2.1
setDefaultSubscribeAllRemoteVideoStreams Specifies whether to receive video streams by default. 2.1
subscribeAllRemoteVideoStreams Stop or resume receiving all remote video streams. 2.1
subscribeRemoteVideoStream Stops or resumes video stream pulling for a specific remote user. 2.1

Video-related methods

API Description Supported earliest version
setScreenShareEncoderConfiguration Set the screen share encoding properties. 2.1
setLocalViewConfig Set the rendering window and drawing parameters for local preview. 1.1
setCameraCapturerConfiguration Set camera collection preferences. 2.1
enableLocalVideo Disable or re-enable local video collection. 2.1
muteLocalCamera Stop or resume local video data sending. 1.1
muteAllRemoteVideoRendering Stop or resume all remote video rendering (iOS only). 2.1
setRemoteViewConfig Set the rendering window and drawing parameters for the remote video. 1.1
isCameraOn Check whether the camera is turned on. 1.1
stopRecord Stop recording. 1.17
startRecord Start recording (non-layout recording). 1.17
setBeautyEffect Specify whether to enable basic beautification. 1.17.9
setVideoEncoderConfiguration Set video encoding properties. 2.1
addVideoWatermark Add a watermark. 2.1
clearVideoWatermark Clears the watermark information of the corresponding data stream. 2.1
snapshotVideo Screenshot. 2.1
switchCamera Switch the front and rear cameras (iOS only). 1.1
getCurrentCameraDirection Gets the current camera orientation. The default front camera (iOS only). 1.1
setCameraZoom Set the camera zoom ratio (iOS only). 1.1
setCameraFlash Set whether the camera flash is on (iOS only). 1.14
isCameraFocusPointSupported Whether the camera supports manual focus (iOS only). 1.14
isCameraExposurePointSupported Specifies whether the camera supports setting the exposure area (iOS only). 1.14
setCameraFocusPoint Set the camera to focus manually (iOS only). 1.14
setCameraExposurePoint Set the camera exposure point (iOS only). 1.14
isCameraAutoFocusFaceModeSupported Whether the camera supports face focus (iOS only). 2.1
setCameraAutoFocusFaceModeEnabled Set the camera face focus (iOS only). 2.1
getVideoCaptureData Proactively obtain collected data. 2.4
getVideoPreEncoderData Proactively obtain pre-encoding data. 2.4
getVideoRenderData Proactively obtain pull stream data. 2.4

Shared video interface

API Description Supported earliest version
startScreenShare Start screen sharing (iOS only). 2.1
startScreenShareWithDesktopId Screen sharing based on desktop ID (Mac only). 2.1
startScreenShareWithWindowId Screen sharing based on the window ID (Mac only). 2.1
getScreenShareSourceInfoWithType Get screen sharing source information (Mac only). 2.1
updateScreenShareConfig Update the screen sharing configuration (Mac only). 2.1
stopScreenShare Stop screen sharing. 2.1

Audio-related methods

API Description Supported earliest version
setAudioOnlyMode Set whether to audio-only mode or audio-video mode. 1.1
isAudioOnly Query whether the current audio-only mode is displayed. 1.1
muteLocalMic Stop or resume local audio data transmission. 1.1
muteRemoteAudioPlaying Stop or resume audio playback at the far end. 1.1
muteAllRemoteAudioPlaying Stop or resume all audio playback at the far end. 1.16.2
startAudioCapture Enable audio collection. 1.11
stopAudioCapture Disable audio collection. 1.11
startAudioPlayer Turn on the audio playback device. 1.11
stopAudioPlayer Disables audio playback. 1.11
setRemoteAudioVolume Sets the volume of a specified remote user for local playback. 2.1
enableSpeakerphone Set the audio output to the handset or speaker (iOS only). 2.1
isEnableSpeakerphone Gets the current audio output as an earpiece or speaker (iOS only). 2.1
setRecordingVolume Sets the recording volume. 1.16.2
setPlayoutVolume Sets the playback volume. 1.16.2
setRecordingDeviceVolume Set the audio capture device volume (Mac only). 2.1
getRecordingDeviceVolume Gets the audio capture device volume (Mac only). 2.1
setPlayoutDeviceVolume Set the audio playback device volume (Mac only). 2.1
getPlayoutDeviceVolume Gets the audio playback device volume (Mac only). 2.1
setExternalAudioRenderVolume Sets the playback volume for externally entered audio (Mac only). 2.1
getExternalAudioRenderVolume Gets the playback volume of the externally input audio (Mac only). 2.1
enableAudioVolumeIndication Set the volume callback frequency and smoothing factor. 1.17.9
setAudioProfile Set Audio Profile. 2.1
setAudioSessionOperationRestriction Set the control permissions of the SDK on AVAudioSession (iOS only). 2.1
setDeviceVolumeType Set the SDK device volume type (iOS only). 2.1
enableAudioDTX Enable local audio traffic control (voice). 2.1
enableAudioAMD Enable local audio traffic control (microphone). 2.1
setAudioEffectVoiceChangerMode Set the sound effect mode. 2.1
setAudioEffectPitchValue Set the tone sandhi parameters. 2.1
setAudioEffectReverbMode Set the reverb sound mode. 2.1
setAudioEffectReverbParamType Set the reverb sound effect type and specific parameters. 2.1
enableEarBack Enable ear return (iOS only). 1.15
setEarBackVolume Set the ear return volume (iOS only). 1.15
setRecordingDeviceMute Mute audio capture device (Mac only). 2.4
getRecordingDeviceMute Gets the audio capture device mute status (Mac only). 2.4
setPlaybackDeviceMute Mute audio playback device (Mac only). 2.4
getPlaybackDeviceMute Gets the mute status of the audio playback device (Mac only). 2.4

Accompaniment and sound interface

API Description Supported earliest version
startAudioAccompanyWithFile Start mixing. 1.15
stopAudioAccompany Stop mixing. 1.15
setAudioAccompanyVolume Set the mixing volume. 1.15
setAudioAccompanyPublishVolume Set the volume of the stream after mixing. 1.15
getAudioAccompanyPublishVolume Gets the remix volume of the stream. 1.15
setAudioAccompanyPlayoutVolume Sets the volume of local playback after mixing. 1.15
getAudioAccompanyPlayoutVolume Gets the volume of the local playback of the mix. 1.15
pauseAudioAccompany Suspend mixing. 1.15
resumeAudioAccompany Start the remix again. 1.15
getAudioAccompanyDuration Gets the duration of the accompaniment file. 1.17.30
getAudioAccompanyCurrentPosition Gets the music file playback progress. 1.17.30
setAudioAccompanyPosition Sets the playback position of background music. 1.17.30
preloadAudioEffectWithSoundId Preload the sound effect file. 1.15
unloadAudioEffectWithSoundId Deletes a preloaded sound file. 1.15
playAudioEffectWithSoundId Start playing sound effects. 1.15
stopAudioEffectWithSoundId Stop playing sound effects. 1.15
stopAllAudioEffects Stop playing all sound effects. 1.15
setAudioEffectPublishVolumeWithSoundId Set the audio ingest volume. 1.15
getAudioEffectPublishVolumeWithSoundId Gets the volume of the ingest sound effect. 1.15
setAudioEffectPlayoutVolumeWithSoundId Sets the local playback volume of sound effects. 1.15
getAudioEffectPlayoutVolumeWithSoundId Gets the local playback volume of the sound effect. 1.15
setAllAudioEffectsPublishVolume Set the local playback volume for all sound effects. 1.15
setAllAudioEffectsPlayoutVolume Set the streaming volume of all sound effects. 1.15
pauseAudioEffectWithSoundId Pause sound effects. 1.15
pauseAllAudioEffects Pause all sound effects. 1.15
resumeAudioEffectWithSoundId Start playing sound effects again. 1.15
resumeAllAudioEffects Start playing all sound effects again. 1.15

Media Engine Interfaces

API Description Supported earliest version
registerVideoSampleObserver Subscribe to video data output. 1.17
unRegisterVideoSampleObserver Unsubscribe video data output. 1.17
registerLocalVideoTexture Subscribe to local video texture data (iOS only). 1.15
unregisterLocalVideoTexture Cancel local video texture data output (iOS only). 1.15
subscribeAudioData Subscribe to audio data output. 1.17
unSubscribeAudioData Cancel audio data output. 1.17
setSubscribeAudioNumChannel Set the number of output audio channels (this parameter is not supported for data before mixing). 2.1
setSubscribeAudioSampleRate Set the output audio sample rate (this parameter is not supported for data before mixing). 2.1
setExternalVideoSource Enable an external video input source. 2.1
pushExternalVideoFrame Input video data. 2.1
setExternalAudioSource Specifies whether to enable an external audio input source. 1.17.9
pushExternalAudioFrameRawData Input audio data. 1.17.9
setExternalAudioVolume Set the mixing volume. 1.17.9
getExternalAudioVolume Gets the remix volume. 1.17.9
setMixedWithMic Specifies whether to mix with microphone-captured audio. 1.17.9
setExteranlAudioRender Specifies whether to enable external input audio playback. 1.17.9
pushExternalAudioRenderRawData Enter external audio playback data. 1.17.9

Live Bypass Interface

API Description Supported earliest version
startPublishLiveStreamWithURL Enable bypass live streaming. 2.4
updatePublishLiveStreamWithURL Updated parameters related to bypass live streaming. 2.4
stopPublishLiveStreamWithURL Stop bypass live streaming. 2.1
GetPublishLiveStreamStateWithURL Obtains the status of bypass live streaming. 2.4

Cross-channel connection interface

API Description Supported earliest version
startChannelRelay Turn on cross-channel connection. 2.1
updateChannelRelay Update cross-channel Lian Mai. 2.1
stopChannelRelay Stop cross-channel connection. 2.1
enableBackgroundExchange Turn virtual background replacement on or off (Mac only). 2.4
enableBackgroundBlur Turn on or off the virtual background blurring feature (Mac only). 2.4

Preview Port

API Description Supported earliest version
startPreview Start local preview. 1.1
stopPreview Stop local preview. 1.1

Remote user query interface

API Description Supported earliest version
getOnlineRemoteUsers Obtains the list of remote online users. 1.1
getUserInfo Queries remote user information. 1.1
isUserOnline Queries whether a user is online. 1.1

Device management port (Mac only)

API Description Supported earliest version
getAudioCaptures Obtains the list of recording devices in the system. 1.1
getCurrentAudioCapture Gets the recording device name used. 1.1
getCurrentAudioCaptureID Gets the ID of the recording device used. 1.16.2
setCurrentAudioCapture Set the recording device by name. 1.1
setCurrentAudioCaptureWithID Set the recording device by ID. 1.16.2
getAudioRenderers Gets the list of speakers in the system. 1.1
getCurrentAudioRenderer Gets the name of the speaker currently in use. 1.1
getCurrentAudioRendererID Gets the ID of the speaker currently in use. 1.16.2
setCurrentAudioRenderer Set the speaker by name. 1.1
setCurrentAudioRendererWithID Set the speaker by ID. 1.16.2
getCameraList Gets the list of cameras. 1.1
getCurrentCamera Gets the name of the camera currently in use. 1.1
getCurrentCameraID Gets the ID of the currently used camera. 1.16.2
setCurrentCamera Set the camera by name. 1.1
setCurrentCameraWithID Set the camera by ID. 1.16.2
startTestAudioRecordWithName Start testing the audio capture device. 1.16.2
stopTestAudioRecord Stop testing the audio capture device. 1.16.2
startTestAudioPlayoutWithName Start testing the audio playback device. 1.16.2
stopTestAudioPlayout Stop testing the audio playback device. 1.16.2

Video layout recording port (Mac only)

API Description Supported earliest version
startRecord Start recording. 2.1
pauseRecord Pause recording. 2.1
resumeRecord Enable recording again. 2.1
UpdateRecordLayout Update recording information. 2.1
addRecordTemplate Add a recording template. 2.1

Other operations

API Description Supported earliest version
getSDKVersion Obtain the SDK version number. 1.1
getErrorDescription Gets the description of the error code. 2.1
setClientRole Specify a user role. 1.16
getCurrentClientRole Gets the user role (iOS only). 1.17.19
getClientRole Gets the user role (Mac only). 1.17.19
startLastmileDetect Start network quality detection. 1.16.2
stopLastmileDetect Stop network quality detection. 1.16.2
postFeedbackWithUid SDK problem feedback. 1.17.12
sendMediaExtensionMsg Send media extension information. 1.17.1
startIntelligentDenoise Enable intelligent noise reduction. 2.1
stopIntelligentDenoise Turn off intelligent noise reduction. 2.1
refreshAuthInfo Refresh the authentication information. 1.17.41
getCurrentConnectionStatus Gets the current network link status. 2.1
enableDelegateMainQueue Specifies whether to distribute the callback to the main thread (iOS only). 2.1
setDelegateQueue Specifies the callback thread queue (iOS only). 2.1
showDebugView Displays the dashboard. 2.4

Details

  • setH5CompatibleMode: specifies whether to enable H5 compatibility.
    + (void)setH5CompatibleMode:(BOOL)comp;
    Parameter description
    Parameter Type Description
    comp BOOL YES indicates that it is compatible with H5, and NO indicates that it is not compatible with H5. Incompatible with H5 by default.
    Notice The current version does not support changing the H5 compatibility mode after the AliRtcEngine instance is created. You must call this method before the instance is created.
  • getH5CompatibleMode: checks whether the H5 compatible mode is set.
    + (BOOL)getH5CompatibleMode;
    Return result

    YES indicates that it is compatible with H5, and NO indicates that it is not compatible with H5.

  • sharedInstance: creates an AliRtcEngine instance.
    + (instancetype _Nonnull )sharedInstance:(id<AliRtcEngineDelegate>_Nullable)delegate extras:(NSString *_Nullable)extras;
    Parameter description
    Parameter Type Description
    delegate id<AliRtcEngineDelegate>_Nullable The agent that listens for the callback.
    extras NSString *_Nullable For more information about the special features of the SDK, see Extras. No special function is required. You can fill in the blank character:@"".
    Notice Only one primary instance will exist at the same time.
  • destroy: releases the SDK instance.
    + (void)destroy;
    Notice Called after all operations have ended.
  • uploadLog: uploads logs. By default, the file is automatically uploaded.
    + (void)uploadLog;
  • setLogDirPath: specifies the path where the SDK log files are saved.
    + (int)setLogDirPath:(NSString *_Nullable)logDirPath;
    Parameter description
    Parameter Type Description
    logDirPath NSString *_Nullable The absolute path where the log file is saved. The default storage path of iOS logs is Library/Caches/Ali_RTC_Log. The default storage path for Mac logs is /Users/xxx/Documents (document)/Ali_RTC_Log.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Notice Call this operation before calling all SDK operations to avoid log loss. In addition, the App must ensure that the specified directory already exists and can be written to.
  • setLogLevel: specifies the log level.
    - (void)setLogLevel:(AliRtcLogLevel)logLevel;
    Parameter description
    Parameter Type Description
    logLevel AliRtcLogLevel The log level. Default value: AliRtcLogLevelInfo.
  • joinChannel: joins a channel.
    - (int)joinChannel:(AliRtcAuthInfo *_Nonnull)authInfo name:(NSString *_Nullable)userName onResult:(void(^_Nullable)(NSInteger errCode,NSString * _Nonnull channel,NSInteger elapsed))onResult;
    Parameter description
    Parameter Type Description
    authInfo AliRtcAuthInfo The authentication information.
    userName String The display name of the user (not the user ID).
    onResult void(^_Nullable)(NSInteger errCode,NSString * _Nonnull channel,NSInteger elapsed) This callback is called when the execution of this interface is completed.
    Note After you join a channel, if you need to join another channel, you must first call the leaveChannel to leave the current channel. If you fail to join a channel, you do not need to call the leaveChannel again.
  • leaveChannel: leaves the channel.
    - (int)leaveChannel;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note
    • 1.15 and later: Destroy the engine only by destroy methods.
    • 1.15 the following version: When you leave a channel, the AliRtcEngine instance is destroyed. To continue operations such as adding a channel, you need to call getInstance again to initialize the AliRtcEngine instance.
    • If you are not in the channel, the call leaveChannel does not affect the instance. However, a message is generated to notify other users in the channel.
  • switchChannel: switches channels.
    - (int)switchChannel:(AliRtcAuthInfo *_Nonnull)authInfo;
    Parameter description
    Parameter Type Description
    authInfo AliRtcAuthInfo The authentication information.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    • Return to the ERR_SDK_INVALID_STATE. Confirm whether the channel patterns or roles do not match or are not currently added to any channels.
    • The ERR_INVALID_ARGUMENTS is returned. Confirm whether the authentication information is valid or whether it is added to the same channel.
    • The error message returned because ERR_INNER is an SDK internal status error.
    Note
    • This method is only allowed to be used by the watch character AliRtcClientRoleLive in live mode AliRtcInteractiveLive.
    • This interface is an asynchronous interface. After calling this method to successfully switch channels, the SDK first triggers the onLeaveChannelResult callback for leaving the original channel, and then returns the onJoinChannelResult callback for adding the new channel.
  • isInCall: checks whether it is currently in the channel.
    - (BOOL)isInCall;
    Return result

    YES means in the channel, and NO means not in the channel.

  • setChannelProfile: Set the channel mode.
    - (int)setChannelProfile:(AliRtcChannelProfile)profile;
    Parameter description
    Parameter Type Description
    profile AliRtcChannelProfile The channel type. Default value: AliRtcCommunication.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note This interface can only be called before joining the channel. It cannot be reset during meetings. It can be reset after leaving the channel.
  • createChannelWithDelegate: creates an AliRtcEngine subchannel instance.
    - (AliRtcEngine *_Nullable)createChannelWithDelegate:(id<AliRtcEngineDelegate>_Nonnull)delegate extras:(NSString *_Nullable)extras;
    Parameter description
    Parameter Type Description
    delegate id<AliRtcEngineDelegate>_Nonnull The proxy for the returned SDK instance object.
    extras NSString *_Nullable For more information about the special features of the SDK, see Extras. No special function is required. You can fill in the blank character:@"".
    Return result

    A subchannel instance is returned if it succeeds. nil is returned if it fails.

  • destroyChannel: destroys the subchannel created by the createChannelWithDelegate.
    - (void)destroyChannel;
  • publishLocalVideoStream: specifies whether to allow the camera stream to be published.
    - (int)publishLocalVideoStream:(BOOL)enable;
    Parameter description
    Parameter Type Description
    enable boolean YES indicates that the video is sent, and NO indicates that the sending is stopped. The default value is YES.
  • isLocalVideoStreamPublished: queries whether the video stream is allowed to be published.
    - (BOOL)isLocalVideoStreamPublished;
    Return result

    YES indicates to publish the camera stream. NO indicates to publish the camera stream.

  • isScreenSharePublished: queries whether the screen stream is currently allowed to be published.
    - (BOOL)isScreenSharePublished;
    Return result

    YES indicates that the screen stream is published, and NO indicates that the screen stream is not published.

  • publishLocalAudioStream: specifies whether to allow audio streams to be published.
    - (int)publishLocalAudioStream:(BOOL)enable;
    Parameter description
    Parameter Type Description
    enable boolean YES indicates that the local audio stream is sent, and NO indicates that the stream is stopped. By default, YES is used.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • isLocalAudioStreamPublished: queries whether audio streams are allowed.
    - (BOOL)isLocalAudioStreamPublished;
    Return result

    YES indicates that push is allowed, and NO indicates that push is not allowed.

  • publishLocalDualStream: specifies whether to allow secondary video streams to be published.
    - (int)publishLocalDualStream:(BOOL)enable;
    Parameter description
    Parameter Type Description
    enable BOOL YES indicates that the secondary stream needs to be pushed. NO indicates that the secondary stream is not pushed. The default value is NO.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • isDualStreamPublished: queries whether secondary video streams are allowed to be published.
    - (BOOL)isDualStreamPublished;
    Return result

    YES indicates that push is allowed, and NO indicates that push is not allowed.

  • setRemoteVideoStreamType: Specify the format of the subscribed camera stream, large stream or small stream.
    - (int)setRemoteVideoStreamType:(NSString *_Nonnull)uid type:(AliRtcVideoStreamType)streamType;
    Parameter description
    Parameter Type Description
    uid NSString *_Nonnull The ID of the remote user.
    streamType AliRtcVideoStreamType The format of the camera stream. Default value: AliRtcVideoStreamTypeHigh (Big Stream).
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setRemoteDefaultVideoStreamType: Set the format of the camera stream for the default subscription, large stream or small stream.
    - (int)setRemoteDefaultVideoStreamType:(AliRtcVideoStreamType)streamType;
    Parameter description
    Parameter Type Description
    streamType AliRtcVideoStreamType The format of the camera stream. Default value: AliRtcVideoStreamTypeHigh (Big Stream).
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setDefaultSubscribeAllRemoteAudioStreams: specifies whether to receive audio streams by default.
    - (int)setDefaultSubscribeAllRemoteAudioStreams:(BOOL)sub;
    Parameter description
    Parameter Type Description
    sub BOOL YES indicates to receive audio streams of users. NO indicates to stop receiving audio streams of users. Default value: YES.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Notice
    • You can call this operation before or after joining the club. If setDefaultSubscribeAllRemoteAudioStreams:NO is called after joining the channel, the audio stream of users who join the channel after setting will not be received.
    • After you stop receiving audio streams, if you want to resume receiving audio streams, call subscribeRemoteAudioStream :uid sub:YES and specify the UID of the remote user you want to receive.
    • If you want to resume receiving audio streams from multiple users, you need to call the subscribeRemoteAudioStream multiple times. setDefaultSubscribeAllRemoteAudioStreams:YES can only resume the audio streams of users who are later added to the channel.
  • subscribeAllRemoteAudioStreams: Stop or resume receiving all remote audio streams.
    - (int)subscribeAllRemoteAudioStreams:(BOOL)sub;
    Parameter description
    Parameter Type Description
    sub BOOL YES indicates that audio streams of all users are received. NO indicates that audio streams of all users are stopped. The default value is YES.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note This interface serves as the master switch for subscribing to remote audio streams. If this parameter is set to NO, not only all remote audio streams in the current conference will stop subscribing, but also new users who join the conference will no longer subscribe (even if setDefaultSubscribeAllRemoteAudioStreams :YES is set).
  • subscribeRemoteAudioStream: Stops or resumes audio stream pulling for a specific remote user.
    - (int)subscribeRemoteAudioStream:(NSString *_Nonnull)uid sub:(BOOL)sub;
    Parameter description
    Parameter Type Description
    uid NSString *_Nonnull The ID of the remote user.
    sub BOOL YES indicates that the audio stream of the specified user is received. NO indicates that the audio stream of the specified user is stopped. The default value is YES.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note If you have previously called subscribeAllRemoteAudioStreams :NO to mute all remote audio, make sure that you have called subscribeAllRemoteAudioStreams :YES before calling this API. subscribeAllRemoteAudioStreams is global control, subscribeRemoteAudioStream fine control.
  • setDefaultSubscribeAllRemoteVideoStreams: specifies whether to receive video streams by default.
    - (int)setDefaultSubscribeAllRemoteVideoStreams:(BOOL)sub;
    Parameter description
    Parameter Type Description
    sub boolean YES indicates that the user's video stream is received. NO indicates that the user's video stream is not received. The default value is YES.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note
    • You can call this operation before or after joining the club. If you call setDefaultSubscribeAllRemoteVideoStreams:NO after joining a channel, you cannot receive the video streams of users who join the channel after setting it.
    • After you stop receiving a video stream, call subscribeRemoteVideoStream :uid track:track sub:YES and specify the UID of the remote user that you want to receive.
    • If you want to resume receiving video streams from multiple users, you need to call the subscribeRemoteVideoStream multiple times. setDefaultSubscribeAllRemoteVideoStreams:YES can only resume receiving video streams from users who add channels later.
  • subscribeAllRemoteVideoStreams: Stop or resume receiving all remote video streams.
    - (int)subscribeAllRemoteVideoStreams:(BOOL)sub;
    Parameter description
    Parameter Type Description
    sub BOOL YES indicates to receive video streams of all users. NO indicates to stop allowing to receive video streams of all users. The default value is YES.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note This interface serves as the master switch for subscribing to remote video streams. If this parameter is set to NO, not only all remote video streams in the current conference will stop subscribing, but also new users who join the conference will no longer subscribe (even if setDefaultSubscribeAllRemoteVideoStreams :YES is set).
  • subscribeRemoteVideoStream: Stops or resumes video stream pulling for a specific remote user.
    - (int)subscribeRemoteVideoStream:(NSString *_Nonnull)uid track:(AliRtcVideoTrack)track sub:(BOOL)sub;
    Parameter description
    Parameter Type Description
    uid NSString *_Nonnull The ID of the remote user.
    track AliRtcVideoTrack The type of the video stream.
    sub BOOL YES indicates that the video stream of the specified user is received. NO indicates that the video stream of the specified user is stopped. The default value is YES.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note
  • setScreenShareEncoderConfiguration: Set the Screen Sharing Encoding property.
    - (void)setScreenShareEncoderConfiguration:(AliRtcScreenShareEncoderConfiguration* _Nonnull)config;
    Parameter description
    Parameter Type Description
    config AliRtcScreenShareEncoderConfiguration* _Nonnull Predefined screen share encoding properties. Default value:
    • dimensions:[0,0]
    • frameRate:5
    • bitrate:0
    • rotation:0
  • setLocalViewConfig: Set the rendering window and drawing parameters for the local preview.
    - (int)setLocalViewConfig:(AliVideoCanvas *_Nullable)viewConfig forTrack:(AliRtcVideoTrack)track;
    Parameter description
    Parameter Type Description
    viewConfig AliVideoCanvas *_Nullable Rendering parameters, including the rendering window and rendering mode.
    track AliRtcVideoTrack The type of the video track.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note
    • Supports switching windows before and after joinChannel. If view in canvas or canvas is nil, rendering is stopped.
    • If you need to reset the render mode during playback, keep other member variables in canvas unchanged and modify only renderMode.
    • If you need to reset the mirror mode during playback, keep other member variables in canvas unchanged and modify only mirrorMode.
  • setCameraCapturerConfiguration: Set camera collection preferences.
    - (int)setCameraCapturerConfiguration:(AliRtcCameraCapturerConfiguration* _Nonnull)config;
    Parameter description
    Parameter Type Description
    config AliRtcCameraCapturerConfiguration* _Nonnull The camera collection preference. Default value:
    • preference:0
    • cameraDirection:0
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • enableLocalVideo: Disable or re-enable local video collection.
    - (int)enableLocalVideo:(BOOL)enable;
    Parameter description
    Parameter Type Description
    enable BOOL YES indicates that it is back to normal. NO indicates that video collection is stopped. By default, YES is returned.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • muteLocalCamera: stops or resumes sending local video data.
    - (int)muteLocalCamera:(BOOL)mute forTrack:(AliRtcVideoTrack)track;
    Parameter description
    Parameter Type Description
    mute BOOL YES indicates that the video data sends black frames, and NO indicates that the video data returns to normal. The default value is NO.
    track AliRtcVideoTrack The type of the video track that needs to change the publishing status.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note This interface only controls whether black frames are sent on the specified video stream. The collection and data transmission will not stop. If you need to disable the collection, use the enableLocalVideo interface. If you need to stop the video data transmission, use the publishLocalVideoStream interface.
  • muteAllRemoteVideoRendering: Stop or resume all remote video rendering (iOS only).
    - (int)muteAllRemoteVideoRendering:(BOOL)mute;
    Parameter description
    Parameter Type Description
    mute BOOL YES indicates that rendering is stopped. NO indicates that rendering is resumed. The default value is NO.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note Stream pulling and decoding are not affected and support settings before and after joinChannel.
  • setRemoteViewConfig: Set the rendering window and drawing parameters for the remote video.
    - (int)setRemoteViewConfig:(AliVideoCanvas *_Nullable)canvas uid:(NSString *_Nonnull)uid forTrack:(AliRtcVideoTrack)track;
    Parameter description
    Parameter Type Description
    canvas AliVideoCanvas *_Nullable Rendering parameters, including the rendering window and rendering mode.
    uid NSString *_Nonnull The ID of the user.
    track AliRtcVideoTrack The type of the video track to be set.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note
    • Supports switching windows before and after joinChannel. If canvas is nil or view is nil, the corresponding stream is stopped.
    • If you need to reset the render mode during playback, keep other member variables in canvas unchanged and modify only renderMode.
    • If you need to reset the mirror mode during playback, keep other member variables in canvas unchanged and modify only mirrorMode.
  • isCameraOn: Check whether the camera is turned on.
    - (BOOL)isCameraOn;
    Return result

    YES indicates that the camera is turned on, and NO indicates that the camera is not turned on.

  • stopRecord: stops recording.
    - (void)stopRecord;
  • startRecord: starts recording (non-layout recording).
    - (BOOL)startRecord:(AliRtcRecordType)recordType recordFormat:(AliRtcRecordFormat)recordFormat filePath:(NSString*_Nonnull)filePath audioConfig:(AliRtcRecordAudioConfig*_Nullable)audioConfig videoConfig:(AliRtcRecordVideoConfig*_Nullable)videoConfig;
    Parameter description
    Parameter Type Description
    recordType AliRtcRecordType The recording format.
    recordFormat AliRtcRecordFormat The format of the recording.
    filePath NSString*_Nonnull The file path.
    audioConfig AliRtcRecordAudioConfig*_Nullable Record audio settings.
    videoConfig AliRtcRecordVideoConfig*_Nullable Video settings. The mobile terminal does not support recording videos.
    Return result

    YES indicates that the method call is successful and the NO method call fails.

  • setBeautyEffect: specifies whether to enable basic beautification. Currently, only whitening and skin grinding are supported.
    - (int)setBeautyEffect:(BOOL)enable config:(AliRtcBeautyConfig *_Nullable)config;
    Parameter description
    Parameter Type Description
    enable BOOL YES indicates enabled. NO indicates disabled. Default value: NO.
    config AliRtcBeautyConfig *_Nullable The basic beauty parameters.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setVideoEncoderConfiguration: Set video encoding properties.
    - (void)setVideoEncoderConfiguration:(AliRtcVideoEncoderConfiguration* _Nonnull)config;
    Parameter description
    Parameter Type Description
    config AliRtcVideoEncoderConfiguration* _Nonnull Predefined encoding properties. Default value:
    • dimensions:[640,480]
    • frameRate:15
    • bitrate:0
    • mirrorMode:0
    • orientationMode:0
    • rotation:0
  • addVideoWatermark: Add a watermark.
    - (int)addVideoWatermark:(AliRtcVideoTrack)track image:(NSString*_Nonnull)imageUrl config:(AliRtcWatermarkConfig *_Nullable)config;
    Parameter description
    Parameter Type Description
    track AliRtcVideoTrack The type of the data stream.
    imageUrl NSString*_Nonnull The path of the watermark image.
    config AliRtcWatermarkConfig *_Nullable Configure watermarks.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • clearVideoWatermark: clears the watermark information of the corresponding data stream.
    - (int)clearVideoWatermark:(AliRtcVideoTrack)track;
    Parameter description
    Parameter Type Description
    track AliRtcVideoTrack The type of the data stream.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • snapshotVideo: a screenshot (the screenshot result is returned by OnSnapshotComplete callback).
    - (int)snapshotVideo:(NSString*_Nullable)userId type:(AliRtcVideoTrack)type;
    Parameter description
    Parameter Type Description
    userId NSString*_Nullable The ID of the user.
    trackType AliRtcVideoTrack The type of the streams to query.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • switchCamera: Switch the front and rear cameras. The default is the front camera (iOS only).
    - (int)switchCamera;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getCurrentCameraDirection: Obtains the current camera direction. The default front camera (iOS only).
    - (AliRtcCameraDirection)getCurrentCameraDirection;
    Return result

    Returns a camera direction enumeration value.

  • setCameraZoom: Set the camera zoom ratio (iOS only).
    - (int)setCameraZoom:(float)zoom;
    Parameter description
    Parameter Type Description
    zoom float The level of the zoom. Default value: 1.0.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setCameraFlash: Sets whether the camera flash is on (iOS only).
    - (int)setCameraFlash:(BOOL)flash;
    Parameter description
    Parameter Type Description
    flash BOOL YES indicates that the flash is enabled, and NO indicates that the flash is disabled. The default value is NO.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • isCameraFocusPointSupported: Whether the camera supports manual focus (iOS only).
    - (BOOL)isCameraFocusPointSupported;
    Return result

    YES indicates support, NO indicates no support.

  • isCameraExposurePointSupported: Whether the camera supports setting the exposure area (iOS only).
    - (BOOL)isCameraExposurePointSupported;
    Return result

    YES indicates support, NO indicates no support.

  • setCameraFocusPoint: Set the camera to focus manually (iOS only).
    - (int)setCameraFocusPoint:(CGPoint)point;
    Parameter description
    Parameter Type Description
    point CGPoint The coordinates of the focus point.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setCameraExposurePoint: Set the camera exposure point (iOS only).
    - (int)setCameraExposurePoint:(CGPoint)point;
    Parameter description
    Parameter Type Description
    point CGPoint The coordinates of the exposure point.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • isCameraAutoFocusFaceModeSupported: Whether the camera supports face focus (iOS only).
    - (BOOL)isCameraAutoFocusFaceModeSupported;
    Return result

    YES indicates support, NO indicates no support.

  • setCameraAutoFocusFaceModeEnabled: Set the camera face focus (iOS only).
    - (BOOL)setCameraAutoFocusFaceModeEnabled:(BOOL)enable;
    Parameter description
    Parameter Type Description
    enable BOOL YES indicates that face focusing is enabled, and NO indicates that face focusing is disabled. The default value is NO.
    Return result

    YES indicates that the method call was successful, and NO indicates that the method call failed.

  • startScreenShare: Start screen sharing (iOS only).
    - (int)startScreenShare;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • stopScreenShare: Stop screen sharing.
    - (int)stopScreenShare;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setAudioOnlyMode: Set this parameter to audio-only mode or audio-video mode.
    - (int)setAudioOnlyMode:(BOOL)audioOnly;
    Parameter description
    Parameter Type Description
    audioOnly BOOL YES indicates that only audio streams are ingested and pulled. NO indicates that both audio and video are supported. Default value: NO.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • isAudioOnly: checks whether the audio-only mode is current.
    - (BOOL)isAudioOnly;
    Return result

    YES indicates the audio-only mode, and NO indicates the audio-video mode.

  • muteLocalMic: stops or resumes local audio data transmission.
    - (int)muteLocalMic:(BOOL)mute mode:(AliRtcMuteLocalAudioMode)mode;
    Parameter description
    Parameter Type Description
    mute BOOL YES indicates that the local audio sends an empty frame, and NO indicates that it returns to normal. The default value is NO.
    mode AliRtcMuteLocalAudioMode Mute mode. The default microphone mute mode.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note Mute just sends audio data as silent frames, and the acquisition and encoding modules are still working.
  • muteRemoteAudioPlaying: Stop or resume audio playback at the remote end.
    - (int)muteRemoteAudioPlaying:(NSString *_Nonnull)uid mute:(BOOL)mute;
    Parameter description
    Parameter Type Description
    uid NSString *_Nonnull The ID of the user.
    mute BOOL YES indicates that playback is stopped. NO indicates that playback is resumed. Default value: NO.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • muteAllRemoteAudioPlaying: Stop or resume all audio playback at the remote end.
    - (int)muteAllRemoteAudioPlaying:(BOOL)mute;
    Parameter description
    Parameter Type Description
    mute BOOL YES indicates that playback is stopped. NO indicates that playback is resumed. Default value: NO.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note Stream pulling and decoding are not affected. Supports settings before and after joinChannel.
  • startAudioCapture: enables audio collection.
    - (void)startAudioCapture;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note You can call this operation to enable audio capture in advance. If you do not set this parameter, the SDK will enable audio capture at an appropriate time.
  • stopAudioCapture: Disables audio collection.
    - (void)stopAudioCapture;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note This port can control the disabling of audio collection, which corresponds to the startAudioCapture.
  • startAudioPlayer: enables the audio playback device.
    - (void)startAudioPlayer;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note You can call this operation to enable audio playback in advance. If you do not set this parameter, the SDK will enable audio playback at the appropriate time.
  • stopAudioPlayer: Disables audio playback.
    - (void)stopAudioPlayer;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note This interface can control the disabling of audio playback, which corresponds to the stopAudioPlayer.
  • setRemoteAudioVolume: Sets the volume of a specified remote user for local playback.
    - (int)setRemoteAudioVolume:(NSString *_Nonnull)uid volume:(NSInteger)volume;
    Parameter description
    Parameter Type Description
    uid NSString *_Nonnull The ID of the user.
    volume NSInteger The playback volume. Valid values:[0,100], where 0 indicates mute and 100 indicates raw volume. Default value: 100.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • enableSpeakerphone: Set the audio output to the handset or speaker (iOS only).
    - (int)enableSpeakerphone:(BOOL)enable;
    Parameter description
    Parameter Type Description
    enable BOOL YES indicates speaker mode and NO indicates handset mode. The default value is YES.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • isEnableSpeakerphone: Gets the current audio output as an earpiece or speaker (iOS only).
    - (BOOL)isEnableSpeakerphone;
    Return result

    YES indicates speaker mode and NO indicates handset mode.

  • setRecordingVolume: Set the recording volume.
    - (int)setRecordingVolume:(NSInteger)volume;
    Parameter description
    Parameter Type Description
    volume NSInteger Valid values:[0,400]. 0 indicates mute. Default value: 100. If the value is greater than 100, the volume is amplified. If the value is less than 100, the volume is reduced.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setPlayoutVolume: Set the playback volume.
    - (int)setPlayoutVolume:(NSInteger)volume;
    Parameter description
    Parameter Type Description
    volume NSInteger Valid values:[0,400]. 0 indicates mute. Default value: 100. If the value is greater than 100, the volume is amplified. If the value is less than 100, the volume is reduced.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • enableAudioVolumeIndication: Set the volume callback frequency and smoothing factor.
    - (int)enableAudioVolumeIndication:(NSInteger)interval smooth:(NSInteger)smooth reportVad:(NSInteger)reportVad;
    Parameter description
    Parameter Type Description
    interval NSInteger The time interval. Unit: milliseconds. The minimum value must not be less than 10ms. We recommend that you set the value to 300 to 500ms. A value less than or equal to 0 indicates that the volume prompt and speaker prompt functions are not enabled.
    smooth NSInteger The smoothing coefficient. Valid values:[0,9]. The higher the value, the higher the smoothing degree. Otherwise, the lower the value, the better the real-time performance. We recommend that you set 3.
    reportVad NSInteger The speaker detection switch. Valid values:
    • 1: On, call back the status of each speaker through the onAudioVolumeCallback interface.
    • 0: disables the trace flag.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setAudioProfile: Set Audio Profile.
    - (int)setAudioProfile:(AliRtcAudioProfile)audio_profile audio_scene:(AliRtcAudioScenario)audio_scene;
    Parameter description
    Parameter Type Description
    audio_profile AliRtcAudioProfile The audio collection or encoding mode parameter. Default value: AliEngineBasicQualityMode.
    audio_scene AliRtcAudioScenario The audio scene mode parameter. Default value: AliEngineSceneDefaultMode.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setAudioSessionOperationRestriction: Set the control permissions of the SDK on AVAudioSession (iOS only).
    - (int)setAudioSessionOperationRestriction:(AliRtcAudioSessionOperationRestriction)restriction;
    Parameter description
    Parameter Type Description
    restriction AliRtcAudioSessionOperationRestriction The control permission. Default value: AliAudioSessionOperationRestrictionNone.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setDeviceVolumeType: Set the SDK device volume type (iOS only).
    - (int)setDeviceVolumeType:(AliRtcDeviceVolumeType)type;
    Parameter description
    Parameter Type Description
    type AliRtcDeviceVolumeType The volume type. Default value: AliRtcDeviceVolumeTypeAuto.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • enableAudioDTX: enables local audio traffic control (voice).
    - (int)enableAudioDTX:(BOOL)enable;
    Parameter description
    Parameter Type Description
    enable BOOL YES indicates on and NO indicates off. Default value: NO.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note The preceding call is valid. Enabling voice activity detection can reduce the number of bytes sent and save user traffic if no voice is detected.
  • enableAudioAMD: enables local audio traffic control (microphone).
    - (int)enableAudioAMD:(BOOL)enable;
    Parameter description
    Parameter Type Description
    enable BOOL YES indicates on and NO indicates off. Default value: NO.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note The preceding call is valid. Voice activity detection is enabled to stop sending audio packets when the microphone is detected to be muted or when the microphone is turned off.
  • setAudioEffectVoiceChangerMode: Set the sound effect mode.
    - (int)setAudioEffectVoiceChangerMode:(AliRtcAudioEffectVoiceChangerMode)mode;
    Parameter description
    Parameter Type Description
    mode AliRtcAudioEffectVoiceChangerMode The mode value. Default value: AliRtcSdk_AudioEffect_Voice_Changer_OFF.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setAudioEffectPitchValue: sets the tone sandhi parameters.
    - (int)setAudioEffectPitchValue:(double)value;
    Parameter description
    Parameter Type Description
    value double Valid values:[0.5,2.0]. The default value is 1.0, which indicates that the tone remains unchanged.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setAudioEffectReverbMode: sets the reverb mode.
    - (int)setAudioEffectReverbMode:(AliRtcAudioEffectReverbMode)mode;
    Parameter description
    Parameter Type Description
    mode AliRtcAudioEffectReverbMode The sound mode. Default value: AliRtcAudioEffectReverb_Off.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setAudioEffectReverbParamType: Set the reverb effect type and specific parameters.
    - (int)setAudioEffectReverbParamType:(AliRtcAudioEffectReverbParamType)type value:(float)value;
    Parameter description
    Parameter Type Description
    type AliRtcAudioEffectReverbParamType Sound reverberation mode.
    value float The value of the specific parameter.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • startAudioAccompanyWithFile: Start mixing.
    - (int)startAudioAccompanyWithFile:(NSString *_Nonnull)filePath onlyLocalPlay:(BOOL)onlyLocalPlay replaceMic:(BOOL)replaceMic loopCycles:(NSInteger)loopCycles;
    Parameter description
    Parameter Type Description
    filePath NSString *_Nonnull The path of the mixing file.
    onlyLocalPlay BOOL Specifies whether to play only locally.
    replaceMic BOOL Specifies whether to replace the MIC.
    loopCycles NSInteger The number of cycles. You can set this parameter to -1 or a positive integer.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • stopAudioAccompany: Stop mixing.
    - (int)stopAudioAccompany;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setAudioAccompanyVolume: Set the mixing volume (it takes effect only after startAudioAccompanyWithFile ).
    - (int)setAudioAccompanyVolume:(NSInteger)volume;
    Parameter description
    Parameter Type Description
    volume NSInteger The mixing volume. Valid values:[0,100]. Default value: 50.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setAudioAccompanyPublishVolume: Set the volume of the stream after mixing (it takes effect only after startAudioAccompanyWithFile ).
    - (int)setAudioAccompanyPublishVolume:(NSInteger)volume;
    Parameter description
    Parameter Type Description
    volume NSInteger The mixing volume. Valid values:[0,100]. Default value: 50.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getAudioAccompanyPublishVolume: obtains the remix volume of the stream.
    - (int)getAudioAccompanyPublishVolume;
    Return result

    The remix volume of the push stream is returned. 0 to 100 is returned as success. Others are returned as error codes.

  • setAudioAccompanyPlayoutVolume: specifies the volume of local playback after mixing. This parameter takes effect only after startAudioAccompanyWithFile.
    - (int)setAudioAccompanyPlayoutVolume:(NSInteger)volume;
    Parameter description
    Parameter Type Description
    volume NSInteger The mixing volume. Valid values:[0,100]. Default value: 50.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getAudioAccompanyPlayoutVolume: obtains the local playback volume of the remix.
    - (int)getAudioAccompanyPlayoutVolume;
    Return result

    This function returns the local playback volume of the remix. If 0 to 100 is returned, the system returns the following error codes.

  • pauseAudioAccompany: The mixing is paused.
    public abstract int pauseAudioAccompany();
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • resumeAudioAccompany: Start mixing again.
    - (int)pauseAudioAccompany;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getAudioAccompanyDuration: obtains the duration of the accompaniment file.
    - (int)getAudioAccompanyDuration;
    Return result

    The duration of the returned accompaniment file (unit: ms). A value less than 0 indicates an error code.

  • getAudioAccompanyCurrentPosition: Obtains the music file playback progress.
    - (int)getAudioAccompanyCurrentPosition;
    Return result

    Returns the playback progress of the music file (unit: ms). A value less than 0 indicates an error code.

  • setAudioAccompanyPosition: specifies the playback position of the audio file.
    - (int)setAudioAccompanyPosition:(int)pos;
    Parameter description
    Parameter Type Description
    pos int The location of the progress bar. Unit: milliseconds.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • preloadAudioEffectWithSoundId: preloads the audio file.
    - (int)preloadAudioEffectWithSoundId:(NSInteger)soundId filePath:(NSString *_Nonnull)filePath;
    Parameter description
    Parameter Type Description
    soundId NSInteger The ID assigned by the user to the sound effect file.
    filePath NSString *_Nonnull The path of the sound effect file.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • unloadAudioEffectWithSoundId: deletes the preloaded sound file.
    - (int)unloadAudioEffectWithSoundId:(NSInteger)soundId;
    Parameter description
    Parameter Type Description
    soundId NSInteger The ID assigned by the user to the sound effect file.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • playAudioEffectWithSoundId: starts playing the sound effect.
    - (int)playAudioEffectWithSoundId:(NSInteger)soundId filePath:(NSString *_Nonnull)filePath cycles:(NSInteger)cycles publish:(BOOL)publish;
    Parameter description
    Parameter Type Description
    soundId NSInteger The ID assigned by the user to the sound effect file.
    filePath NSString *_Nonnull The path of the sound effect file.
    cycles NSInteger The number of cycles. You can set this parameter to -1 or a positive integer.
    publish BOOL Specifies whether to publish.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • stopAudioEffectWithSoundId: stops playing the sound effect.
    - (int)stopAudioEffectWithSoundId:(NSInteger)soundId;
    Parameter description
    Parameter Type Description
    soundId NSInteger The ID assigned by the user to the sound effect file.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • stopAllAudioEffects: stops playing all sound effects.
    - (int)stopAllAudioEffects;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setAudioEffectPublishVolumeWithSoundId: Set the audio ingest volume.
    - (int)setAudioEffectPublishVolumeWithSoundId:(NSInteger)soundId volume:(NSInteger)volume;
    Parameter description
    Parameter Type Description
    soundId NSInteger The ID assigned by the user to the sound effect file.
    volume NSInteger The mixing volume. Valid values:[0,100]. Default value: 50.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getAudioEffectPublishVolumeWithSoundId: obtains the volume of the ingest sound effect.
    - (int)getAudioEffectPublishVolumeWithSoundId:(NSInteger)soundId;
    Parameter description
    Parameter Type Description
    soundId NSInteger The ID assigned by the user to the sound effect file.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setAudioEffectPlayoutVolumeWithSoundId: Set the local playback volume of the sound effect.
    - (int)setAudioEffectPlayoutVolumeWithSoundId:(NSInteger)soundId volume:(NSInteger)volume;
    Parameter description
    Parameter Type Description
    soundId NSInteger The ID assigned by the user to the sound effect file.
    volume NSInteger The mixing volume. Valid values:[0,100]. Default value: 50.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getAudioEffectPlayoutVolumeWithSoundId: obtains the local playback volume of the sound effect.
    - (int)getAudioEffectPlayoutVolumeWithSoundId:(NSInteger)soundId;
    Parameter description
    Parameter Type Description
    soundId NSInteger The ID assigned by the user to the sound effect file.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setAllAudioEffectsPublishVolume: Set the local playback volume for all sound effects.
    - (int)setAllAudioEffectsPublishVolume:(NSInteger)volume;
    Parameter description
    Parameter Type Description
    volume NSInteger The mixing volume. Valid values:[0,100]. Default value: 50.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setAllAudioEffectsPlayoutVolume: Set the streaming volume of all sound effects.
    - (int)setAllAudioEffectsPlayoutVolume:(NSInteger)volume;
    Parameter description
    Parameter Type Description
    volume NSInteger The mixing volume. Valid values:[0,100]. Default value: 50.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • pauseAudioEffectWithSoundId: Pause the sound effect.
    - (int)pauseAudioEffectWithSoundId:(NSInteger)soundId;
    Parameter description
    Parameter Type Description
    soundId NSInteger The ID assigned by the user to the sound effect file.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • pauseAllAudioEffects: Pause all sound effects.
    - (int)pauseAllAudioEffects;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • resumeAudioEffectWithSoundId: restarts the sound effect.
    - (int)resumeAudioEffectWithSoundId:(NSInteger)soundId;
    Parameter description
    Parameter Type Description
    soundId NSInteger The ID assigned by the user to the sound effect file.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • resumeAllAudioEffects: Restart all sound effects.
    - (int)resumeAllAudioEffects;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • enableEarBack: enables ear return (iOS only).
    - (int)enableEarBack:(BOOL)enable;
    Parameter description
    Parameter Type Description
    enable BOOL YES indicates that ear return is enabled, and NO indicates that ear return is disabled. The default value is NO.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setEarBackVolume: Set the Ear Return Volume (iOS only).
    - (int)setEarBackVolume:(NSInteger)volume;
    Parameter description
    Parameter Type Description
    volume NSInteger Valid values:[0,100]. The default value is 100.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • registerVideoSampleObserver: Subscribe to video data output.
    - (void)registerVideoSampleObserver;
  • unRegisterVideoSampleObserver: Unsubscribe from video data output.
    - (void)unregisterVideoSampleObserver;
  • registerLocalVideoTexture: Subscribe to local video texture data (iOS only).
    - (void)registerLocalVideoTexture;
  • unregisterLocalVideoTexture: Cancels local video texture data output (iOS only).
    - (void)unregisterLocalVideoTexture;
  • subscribeAudioData: Subscribe to audio data output.
    - (void)subscribeAudioData:(AliRtcAudioSource)audioSource;
    Parameter description
    Parameter Type Description
    audioSource AliRtcAudioSource The type of the data.
  • unSubscribeAudioData: cancels audio data output.
    - (void)unSubscribeAudioData:(AliRtcAudioSource)audioSource;
    Parameter description
    Parameter Type Description
    audioSource AliRtcAudioSource The type of the data.
  • setSubscribeAudioNumChannel: Set the number of output audio channels (this parameter is not supported for data before mixing).
    - (void)setSubscribeAudioNumChannel:(AliRtcAudioNumChannel)audioNumChannel;
    Parameter description
    Parameter Type Description
    audioNumChannel AliRtcAudioNumChannel The number of channels. Default value: mono.
  • setSubscribeAudioSampleRate: specifies the output audio sample rate (this parameter is not supported for data before mixing).
    - (void)setSubscribeAudioSampleRate:(AliRtcAudioSampleRate)audioSampleRate;
    Parameter description
    Parameter Type Description
    audioSampleRate AliRtcAudioSampleRate sample rate. The default value is 44.1kHz.
  • setExternalVideoSource: Enable an external video input source.
    - (int)setExternalVideoSource:(BOOL)enable useTexture:(BOOL)useTexture sourceType:(AliRtcVideoSource)type renderMode:(AliRtcRenderMode)renderMode;
    Parameter description
    Parameter Type Description
    enable BOOL YES indicates on, and NO indicates off.
    useTexture BOOL Specifies whether to use the Texture mode.
    type AliRtcVideoSource The type of the streams to query.
    renderMode AliRtcRenderMode The rendering mode.
  • pushExternalVideoFrame: Input video data.
    - (int)pushExternalVideoFrame:(AliRtcVideoDataSample *_Nonnull)frame sourceType:(AliRtcVideoSource)type;
    Parameter description
    Parameter Type Description
    frame AliRtcVideoDataSample *_Nonnull Frame data.
    type AliRtcVideoSource The type of the streams to query.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setExternalAudioSource: specifies whether to enable an external audio input source.
    - (int)setExternalAudioSource:(BOOL)enable withSampleRate:(NSUInteger)sampleRate channelsPerFrame:(NSUInteger)channelsPerFrame;
    Parameter description
    Parameter Type Description
    enable BOOL YES indicates on and NO indicates off. Default value: NO.
    sampleRate NSUInteger sample rate, such as 16000Hz and 48000Hz.
    channelsPerFrame NSUInteger The number of channels, for example, 1 or 2.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • pushExternalAudioFrameRawData: Input audio data.
    - (int)pushExternalAudioFrameRawData:(void *_Nonnull)data samples:(NSUInteger)samples timestamp:(NSTimeInterval)timestamp;
    Parameter description
    Parameter Type Description
    data void *_Nonnull Audio data. We recommend that you do not use more than 40ms of data.
    samples NSUInteger sample rate, such as 16kHz and 48kHz.
    timestamp NSTimeInterval Timestamp.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setExternalAudioVolume: sets the mixing volume.
    - (int)setExternalAudioVolume:(int)vol;
    Parameter description
    Parameter Type Description
    vol int The mixing volume. Valid values:[1,100]. Default value: 50.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getExternalAudioVolume: obtains the mixing volume.
    - (int)getExternalAudioVolume;
    Return result

    Returns the current mixing volume.

  • setMixedWithMic: specifies whether to mix audio with the microphone.
    - (int)setMixedWithMic:(BOOL)mixed;
    Parameter description
    Parameter Type Description
    mixed BOOL YES indicates mixing, and NO indicates that the microphone is completely replaced to collect data. The default value is NO.
    Return result

    Returns the current mixing volume.

  • setExteranlAudioRender: specifies whether to enable external input audio playback.
    - (int)setExteranlAudioRender:(BOOL)enable sampleRate:(NSUInteger)sampleRate channelsPerFrame:(NSUInteger)channelsPerFrame;
    Parameter description
    Parameter Type Description
    enable BOOL YES indicates on and NO indicates off. Default value: NO.
    sampleRate NSUInteger sample rate, such as 16kHz and 48kHz.
    channelsPerFrame NSUInteger The number of channels, for example, 1 or 2.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • pushExternalAudioRenderRawData: Enter external audio playback data.
    - (int)pushExternalAudioRenderRawData:(const void* _Nullable)audioSamples sampleLength:(NSUInteger)sampleLength sampleRate:(NSUInteger)sampleRate channelsPerFrame:(NSUInteger)channelsPerFrame timestamp:(long long)timestamp;
    Parameter description
    Parameter Type Description
    audioSamples constvoid* _Nullable The audio data.
    sampleLength NSUInteger The length of the audio data.
    sampleRate NSUInteger The audio sample rate.
    channelsPerFrame NSUInteger The number of audio channels.
    timestamp long long Timestamp.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • startPublishLiveStreamWithURL: Enable bypass live streaming.
    - (int)startPublishLiveStreamWithURL:(NSString *_Nonnull)streamURL liveTranscoding:(AliRtcLiveTranscodingParam *_Nonnull)trancoding;
    Parameter description
    Parameter Type Description
    streamUrl NSString * The URL used to ingest streams to the LiveChannel.
    transcoding AliRtcLiveTranscodingParam * Parameters required for stream ingest.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • updatePublishLiveStreamWithURL: updates the parameters related to bypass live streaming.
    - (int)updatePublishLiveStreamWithURL:(NSString *_Nonnull)streamURL liveTranscoding:(AliRtcLiveTranscodingParam *_Nonnull)trancoding;
    Parameter description
    Parameter Type Description
    streamUrl NSString * The URL used to ingest streams to the LiveChannel.
    transcoding AliRtcLiveTranscodingParam * Parameters required for stream ingest.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • stopPublishLiveStreamWithURL: Stop bypass live streaming.
    - (int)stopPublishLiveStreamWithURL:(NSString *_Nonnull)streamURL;
    Parameter description
    Parameter Type Description
    streamUrl NSString *_Nonnull The URL used to ingest streams to the LiveChannel.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • startChannelRelay: Turn on cross-channel connection.
    - (int)startChannelRelay:(AliRtcChannelRelayConfiguration *_Nonnull)configuration;
    Parameter description
    Parameter Type Description
    configuration AliRtcChannelRelayConfiguration *_Nonnull The information about the requested time configurations.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • updateChannelRelay: Update cross-channel Lian Mai.
    - (int)updateChannelRelay:(AliRtcChannelRelayConfiguration *_Nonnull)configuration;
    Parameter description
    Parameter Type Description
    configuration AliRtcChannelRelayConfiguration *_Nonnull The information about the requested time configurations.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • stopChannelRelay: Stop cross-channel connection.
    - (int)stopChannelRelay;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • startPreview: starts the local preview (the camera is automatically turned on).
    - (int)startPreview;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note If view is not set, preview cannot be performed. You can open the preview before the joinChannel.
  • stopPreview: stops local preview.
    - (int)stopPreview;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note LeaveChannel automatically stops the local preview and automatically turns off the camera (if the camera stream is being pushed, the camera will not be turned off).
  • getOnlineRemoteUsers: Obtains the list of remote online users.
    - (NSArray<NSString *> *_Nullable)getOnlineRemoteUsers;
    Return result

    Returns a list of users (the user ID is saved).

  • getUserInfo: queries remote user information.
    - (NSDictionary *_Nullable)getUserInfo:(NSString *_Nonnull)uid;
    Parameter description
    Parameter Type Description
    uid NSString *_Nonnull The ID of the target user to obtain.
    Return result

    Returns a dictionary where the key keyword has the following meaning:

    key keyword Description
    userID The ID of the remote user.
    displayName The name of the remote user.
    sessionID The session ID of the remote user.
    isOnline Indicates whether the remote user is online.
    isCameraMirror Indicates whether camera stream mirroring is enabled for the remote user.
    isScreenMirror Indicates whether screen stream mirroring is enabled for the remote user.
    muteAudioPlaying Indicates whether this remote user is muted at the local end.
    preferCameraMaster Indicates whether Big Stream priority is enabled for remote users.
    hasCameraView Specifies whether this remote user's view of the camera stream is set.
    hasScreenView Specifies whether the view of this remote user screen stream is set.
    hasAudio Indicates whether the remote user pushed the audio stream.
    hasCameraMaster Indicates whether the remote user pushed the camera stream.
    hasCameraSlave Indicates whether the remote user pushed the camera stream.
    hasScreenSharing Indicates whether the remote user pushed the screen stream.
    requestAudio Specifies whether the local side has subscribed to the audio stream of this remote user.
    requestCameraMaster Specifies whether the local side has subscribed to the camera stream for this remote user.
    requestCameraSlave Specifies whether the local side has subscribed to the camera stream for this remote user.
    requestScreenSharing Specifies whether the local side has subscribed to the screen stream for this remote user.
    subScribedAudio Specifies whether the local side has pulled the audio stream of this remote user.
    subScribedCameraMaster Whether the local end has pulled the camera stream of this remote user.
    subScribedCamearSlave Whether the local side pulls to the camera stream of this remote user.
    subScribedScreenSharing Specifies whether the local side has pulled the screen stream for this remote user.
  • isUserOnline: queries whether a user is online.
    - (BOOL)isUserOnline:(NSString *_Nonnull)uid;
    Parameter description
    Parameter Type Description
    uid NSString *_Nonnull The ID of the user. Unique identifier assigned from the App server.
    Return result

    YES indicates online, and NO indicates offline.

  • getSdkVersion: obtains the SDK version number.
    + (NSString *_Nonnull)getSdkVersion;
    Return result

    The version of the stream ingest SDK for Android is returned.

  • getErrorDescription: Obtains the description of the error code.
    + (NSString *_Nullable)getErrorDescription:(NSInteger)errCode;
    Parameter description
    Parameter Type Description
    errorCode NSInteger The error code returned.
    Return result

    The error code description string is returned.

  • setClientRole: specifies a user role.
    - (int)setClientRole:(AliRtcClientRole)role;
    Parameter description
    Parameter Type Description
    role AliRtcClientRole The type of the user role. Default value: AliRtcClientRoleInteractive (anchor role).
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getCurrentClientRole: Get the user role (iOS only).
    - (AliRtcClientRole)getCurrentClientRole;
    Return result

    Returns the current user role.

  • startLastmileDetect: starts network quality detection.
    - (int)startLastmileDetect;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note Please call before the joinChannel. The probe result is called back in the onLastmileDetectResultWithQuality.
  • stopLastmileDetect: stops network quality detection.
    - (int)stopLastmileDetect;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • postFeedbackWithUid:SDK feedback.
    - (void)postFeedbackWithUid:(NSString *_Nullable)uid channleId:(NSString *_Nullable)channelId description:(NSString *_Nonnull)description type:(AliRtcFeedbackType)type timeStamp:(NSTimeInterval)timeStamp;
    Parameter description
    Parameter Type Description
    uid NSString *_Nullable The current UID (null allowed).
    channelId NSString *_Nullable The current channel ID (null allowed).
    description NSString *_Nullable Problem description (both Chinese and English are supported and cannot be empty).
    type AliRtcFeedbackType The type of the problem.
    timeStamp NSTimeInterval The time when the problem occurred (Unix timestamp, which can be the approximate time without being particularly precise, or 0).
  • sendMediaExtensionMsg: sends media extension information.
    - (int)sendMediaExtensionMsg:(NSData *_Nonnull)data repeatCount:(int)repeatCount;
    Parameter description
    Parameter Type Description
    data NSData *_Nonnull The extended information of the instance.
    repeatCount int The number of times the episode list repeats after the first playback is complete.
    Return result
    • A value of 0 indicates that the operation is successful.
    • -1: The stream is not ingested.
    • -2: parameter error.
    • -3: Send too frequently. We recommend that you send it later.
  • startIntelligentDenoise: Enable intelligent noise reduction.
    - (int)startIntelligentDenoise;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note
    • This interface can control and turn on the intelligent noise reduction function during the call.
    • This feature is turned off by default, which may lead to increased power consumption. Intelligent noise reduction is suitable for scenarios such as meetings and education, and is not suitable for scenarios with background music.
  • stopIntelligentDenoise: disables intelligent noise reduction.
    - (void)stopIntelligentDenoise;
    Note This interface can control to turn off the intelligent noise reduction function during the call.
  • refreshAuthInfo: refreshes the authentication information.
    - (int)refreshAuthInfo:(AliRtcAuthInfo *_Nonnull)authInfo;
    Parameter description
    Parameter Type Description
    authInfo AliRtcAuthInfo *_Nonnull The authentication information.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getCurrentConnectionStatus: obtains the current network connection status.
    - (AliRtcConnectionStatus)getCurrentConnectionStatus;
    Return result

    Returns the status of the current network link. For more information about the status, see AliRtcConnectionStatus.

  • enableDelegateMainQueue: specifies whether to distribute the callback to the main thread (iOS only).
    - (int)enableDelegateMainQueue:(BOOL)enable;
    Parameter description
    Parameter Type Description
    enable BOOL YES indicates that the callback is distributed to the main thread queue. NO indicates that the callback is not distributed to the main thread queue. The default value is YES.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • setDelegateQueue: specifies the callback thread queue (iOS only).
    - (int)setDelegateQueue:(NSOperationQueue *_Nullable)queue;
    Parameter description
    Parameter Type Description
    queue NSOperationQueue *_Nullable The callback queue. The default value is to use the main thread queue.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

    Note
    • If you call enableDelegateMainQueue :YES, the callback thread is the primary thread.
    • If you call enableDelegateMainQueue :NO, you can call this operation to specify the callback thread. If you do not set this parameter, the default sub-thread of the SDK is used.
  • startScreenShareWithDesktopId: Screen sharing based on desktop ID (Mac only).
    - (int)startScreenShareWithDesktopId:(int)desktopId config:(AliRtcScreenShareConfig * _Nonnull)config;
    Parameter description
    Parameter Type Description
    desktopId int The ID of the desktop, which can be obtained through the getScreenShareSourceInfoWithType interface.
    config AliRtcScreenShareConfig * _Nonnull Screen sharing configuration.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • startScreenShareWithWindowId: Screen sharing based on the window ID (Mac only).
    - (int)startScreenShareWithWindowId:(int)windowId config:(AliRtcScreenShareConfig * _Nonnull)config;
    Parameter description
    Parameter Type Description
    windowId int The ID of the window, which can be obtained through the getScreenShareSourceInfoWithType interface.
    config AliRtcScreenShareConfig * _Nonnull Screen sharing configuration.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getScreenShareSourceInfoWithType: Get screen sharing source information (Mac only).
    - (NSArray<AliRtcScreenSourceInfo *> * _Nullable)getScreenShareSourceInfoWithType:(AliRtcScreenShareType)type;
    Parameter description
    Parameter Type Description
    type AliRtcScreenShareType The type of screen sharing.
    Return result

    A list is returned. The object type in the list is the screen sharing source information AliRtcScreenSourceInfo.

  • updateScreenShareConfig: Update the screen sharing configuration (Mac only).
    - (int)updateScreenShareConfig:(AliRtcScreenShareConfig * _Nonnull)config;
    Parameter description
    Parameter Type Description
    config AliRtcScreenShareConfig * _Nonnull Screen sharing configuration.
    Return result

    A list is returned. The object type in the list is the screen sharing source information AliRtcScreenSourceInfo.

  • setRecordingDeviceVolume: Set the audio capture device volume (Mac only).
    - (int)setRecordingDeviceVolume:(NSInteger)volume;
    Parameter description
    Parameter Type Description
    volume NSInteger Volume range:[0,100]. The default value is the current microphone volume.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getRecordingDeviceVolume: Get the audio capture device volume (Mac only).
    - (int)getRecordingDeviceVolume;
    Return result

    Returns the audio collection device volume (volume range:[0,100]). -1 indicates that the method call failed.

  • setPlayoutDeviceVolume: Set the audio playback device volume (Mac only).
    - (int)setPlayoutDeviceVolume:(NSInteger)volume;
    Parameter description
    Parameter Type Description
    volume NSInteger Volume range:[0,100]. The default value is the current speaker volume.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getPlayoutDeviceVolume: Get the audio playback device volume (Mac only).
    - (int)getPlayoutDeviceVolume;
    Return result

    Returns the audio playback device volume (volume range:[0,100]). -1 indicates that the method call failed.

  • setExternalAudioRenderVolume: Sets the playback volume of externally input audio (Mac only).
    - (int)setExternalAudioRenderVolume:(int)vol;
    Parameter description
    Parameter Type Description
    vol int Volume range:[0,100]. Default value: 50.
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • getExternalAudioRenderVolume: Gets the playback volume of the externally input audio (Mac only).
    - (int)getExternalAudioRenderVolume;
    Return result

    Returns the audio playback volume (volume range:[0,100]).

  • getAudioCaptures: Get a list of recording devices in the system (Mac only).
    - (NSArray<AliRtcDeviceInfo *> *_Nullable)getAudioCaptures;
  • getCurrentAudioCapture: Gets the recording device name used (Mac only).
    - (NSString *_Nullable)getCurrentAudioCapture;
  • getCurrentAudioCaptureID: Gets the ID of the recording device used (Mac only).
    - (NSString *_Nullable)getCurrentAudioCaptureID;
  • setCurrentAudioCapture: Set the recording device by name (Mac only).
    - (void)setCurrentAudioCapture:(NSString *_Nonnull)capture;
    Parameter description
    Parameter Type Description
    capture NSString *_Nonnull The name of the recording device to set.
  • setCurrentAudioCaptureWithID: Set the recording device by ID (Mac only).
    - (void)setCurrentAudioCaptureWithID:(NSString *_Nonnull)captureID;
    Parameter description
    Parameter Type Description
    captureID NSString *_Nonnull The ID of the recording device to be set.
  • getAudioRenderers: Get a list of speakers in the system (Mac only).
    - (NSArray<AliRtcDeviceInfo *> *_Nullable)getAudioRenderers;
  • getCurrentAudioRenderer: Gets the name of the speaker currently in use (Mac only).
    - (NSString *_Nullable)getCurrentAudioRenderer;
  • getCurrentAudioRendererID: Gets the speaker ID currently in use (Mac only).
    - (NSString *_Nullable)getCurrentAudioRendererID;
  • setCurrentAudioRenderer: Set the speaker by name (Mac only).
    - (void)setCurrentAudioRenderer:(NSString *_Nonnull)renderer;
    Parameter description
    Parameter Type Description
    renderer NSString *_Nonnull The name of the speaker device to set.
  • setCurrentAudioRendererWithID: Set the speaker by ID (Mac only).
    - (void)setCurrentAudioRendererWithID:(NSString *_Nonnull)rendererID;
    Parameter description
    Parameter Type Description
    rendererID NSString *_Nonnull The ID of the speaker device to set.
  • getCameraList: Get a list of cameras (Mac only).
    - (NSArray<AliRtcDeviceInfo *> *_Nullable)getCameraList;
  • getCurrentCamera: Gets the name of the camera currently in use (Mac only).
    - (NSString *_Nullable)getCurrentCamera;
  • getCurrentCameraID: Gets the ID of the camera currently in use (Mac only).
    - (NSString *_Nullable)getCurrentCameraID;
  • setCurrentCamera: Set the camera by name (Mac only).
    - (void)setCurrentCamera:(NSString *_Nonnull)camera;
    Parameter description
    Parameter Type Description
    camera NSString *_Nonnull The name of the camera device to set.
  • setCurrentCameraWithID: Set the camera by ID (Mac only).
    - (void)setCurrentCameraWithID:(NSString *_Nonnull)cameraID;
    Parameter description
    Parameter Type Description
    cameraID NSString *_Nonnull The ID of the camera device that you want to set.
  • startTestAudioRecordWithName: Start testing the audio capture device (Mac only).
    - (int)startTestAudioRecordWithName:(NSString *_Nonnull)deviceName;
    Parameter description
    Parameter Type Description
    deviceName NSString *_Nonnull The audio collection device name.
  • stopTestAudioRecord: Stop testing the audio capture device (Mac only).
    - (int)stopTestAudioRecord;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • startTestAudioPlayoutWithName: Start testing the audio playback device (Mac only).
    - (int)startTestAudioPlayoutWithName:(NSString *_Nonnull)deviceName filePath:(NSString *_Nonnull)filePath loopCycles:(NSInteger)loopCycles;
    Parameter description
    Parameter Type Description
    deviceName NSString *_Nonnull The audio collection device name.
    filePath NSString *_Nonnull The path of the audio file.
    loopCycles NSInteger The number of repeated playback times. -1 indicates loop playback.
  • stopTestAudioPlayout: Stop testing the audio playback device (Mac only).
    - (int)stopTestAudioPlayout;
    Return result

    0 indicates that the method call was successful. Others indicate that the method call failed.

  • startRecord: Start recording (Mac only).
    - (BOOL)startRecord:(NSString*_Nonnull)filePath recordLayout:(AliRtcRecordVideoLayout*_Nonnull)recordLayout;
    Parameter description
    Parameter Type Description
    filePath NSString*_Nonnull The file path.
    recordLayout AliRtcRecordVideoLayout*_Nonnull Video window layout settings.
    Return result

    YES indicates that the method call was successful, and NO indicates that the method call failed.

  • pauseRecord: Pause recording (Mac only).
    - (BOOL)pauseRecord;
    Return result

    YES indicates that the method call was successful, and NO indicates that the method call failed.

  • resumeRecord: reopens recording (Mac only).
    - (BOOL)resumeRecord;
    Return result

    YES indicates that the method call was successful, and NO indicates that the method call failed.

  • UpdateRecordLayout: Update recording information (Mac only).
    - (BOOL)UpdateRecordLayout:(AliRtcRecordVideoLayout*_Nonnull)layout;
    Parameter description
    Parameter Type Description
    layout AliRtcRecordVideoLayout*_Nonnull Video window layout settings.
    Return result

    YES indicates that the method call was successful, and NO indicates that the method call failed.

  • addRecordTemplate: Add a recording template (Mac only).
    - (BOOL)addRecordTemplate:(AliRtcRecordTemplate*_Nonnull)recordTemplate;
    Parameter description
    Parameter Type Description
    recordTemplate AliRtcRecordTemplate*_Nonnull The recording template.
    Return result

    YES indicates that the method call was successful, and NO indicates that the method call failed.

  • getClientRole: obtains the user role (Mac only).
    - (AliRtcClientRole)getClientRole;
    Return result

    Returns the current user role.

  • showDebugView: displays the dashboard.
    - (int)showDebugView:(UITextView * _Nonnull)view showType:(AliRtcShowDebugViewType)showType userId:(NSString * _Nullable)userId;
    Parameter description
    Parameter Type Description
    view UITextView * View displayed externally.
    showType AliRtcShowDebugViewType The display type. Valid values:
    • 0 (default): Not displayed.
    • 1: audio.
    • 2: video.
    • 3: network.
    • 4: All.
    Note For data that is not publicly available, you can set special values.
    userId NSString * The corresponding user data.
    Return result

    0 indicates that the method call was successful. Non -0 indicates that the method call failed.

  • getVideoCaptureData: obtains collected data.
    - (BOOL)getVideoCaptureData:(AliRtcVideoTrack)videoTrack videoSample:(AliRtcVideoDataSample**)p_sample;
    Parameter description
    Parameter Type Description
    videoTrack AliRtcVideoTrack The type of the video stream.
    p_sample AliRtcVideoDataSample ** The video sample.
    Return result

    YES indicates that the method call was successful, and NO indicates that the method call failed.

  • getVideoPreEncoderData: obtains pre-encoding data.
    - (BOOL)getVideoPreEncoderData:(AliRtcVideoTrack)videoTrack videoSample:(AliRtcVideoDataSample**)p_sample;
    Parameter description
    Parameter Type Description
    videoTrack AliRtcVideoTrack The type of the video stream.
    p_sample AliRtcVideoDataSample ** The video sample.
    Return result

    YES indicates that the method call was successful, and NO indicates that the method call failed.

  • getVideoRenderData: Proactively obtains stream pulling data.
    - (BOOL)getVideoRenderData:(NSString*)uid videoTrack:(AliRtcVideoTrack)videoTrack videoSample:(AliRtcVideoDataSample**)p_sample;
    Parameter description
    Parameter Type Description
    uid NSString * The ID of the remote user.
    videoTrack AliRtcVideoTrack The type of the video stream.
    p_sample AliRtcVideoDataSample ** The video sample.
    Return result

    YES indicates that the method call was successful, and NO indicates that the method call failed.

  • GetPublishLiveStreamStateWithURL: obtains the status of bypass live streaming.
    - (AliRtcLiveTranscodingState)GetPublishLiveStreamStateWithURL:(NSString *_Nonnull)streamURL;
    Parameter description
    Parameter Type Description
    streamURL NSString * The URL used to ingest streams to the LiveChannel.
    Return result

    Return to the bypass live status.

  • setRecordingDeviceMute: Mute audio capture device (Mac only).
    - (int)setRecordingDeviceMute:(BOOL)mute;
    Parameter description
    Parameter Type Description
    mute BOOL Indicates whether the device is muted. Valid values:
    • TRUE: The device is set to mute.
    • FALSE: The device is set to non-silent.
    Return result

    0 indicates that the method call was successful. Non -0 indicates that the method call failed.

  • getRecordingDeviceMute: Gets the audio capture device mute status (Mac only).
    - (BOOL)getRecordingDeviceMute;
    Return result

    YES indicates that the method call was successful, and NO indicates that the method call failed.

  • setPlaybackDeviceMute: Mute audio playback device (Mac only).
    - (int)setPlaybackDeviceMute:(BOOL)mute;
    Parameter description
    Parameter Type Description
    mute BOOL Indicates whether the device is muted. Valid values:
    • TRUE: The device is set to mute.
    • FALSE: The device is set to non-silent.
    Return result

    0 indicates that the method call was successful. Non -0 indicates that the method call failed.

  • getPlaybackDeviceMute: Gets the mute status of the audio playback device (Mac only).
    - (BOOL)getPlaybackDeviceMute;
    Return result

    YES indicates that the method call was successful, and NO indicates that the method call failed.

  • enableBackgroundExchange: Turn virtual background replacement on or off (Mac only).
    - (int)enableBackgroundExchange:(BOOL)enable imagePath:(NSString *_Nonnull)path scalMode:(AliRtcBokehScaleModel)mode;
    Parameter description
    Parameter Type Description
    enable BOOL Specifies whether to enable the background replacement feature. Valid values:
    • YES: enabled.
    • NO: disabled.
    path NSString The path of the local image. The JPG and PNG formats are supported.
    mode AliRtcBokehScaleModel The zoom mode of the background image. Valid values:
    • AliRtcBokehScaleModelCrop: geometric cropping.
    • AliRtcBokehScaleModelFill: Fill black edges.
    Return result

    0 indicates that the method call was successful. Non -0 indicates that the method call failed.

  • enableBackgroundBlur: Turn on or off the virtual background blurring feature (Mac only).
    - (int)enableBackgroundBlur:(BOOL)enable blurDegree:(uint32_t)blurDegree;
    Parameter description
    Parameter Type Description
    enable BOOL Specifies whether to enable the background blurring feature. Valid values:
    • YES: enabled.
    • NO: disabled.
    blurDegree uint32_t The degree of blurring. Valid values:[0,100].
    Return result

    0 indicates that the method call was successful. Non -0 indicates that the method call failed.