This topic describes the AliRtcEngine interface for the iOS and Mac SDKs.
API reference
For more information about all APIs, see AliRtcEngine.
Contents
Basic APIs
| API | Description | Minimum supported version |
| setH5CompatibleMode | Sets the H5 compatibility mode. | 1.1 |
| getH5CompatibleMode | Checks whether H5 compatibility mode is set. | 1.1 |
| sharedInstance | Creates an AliRtcEngine instance. | 1.17 |
| destroy | Releases the SDK instance. | 1.1 |
| uploadLog | Uploads logs. | 1.1 |
| setLogDirPath | Sets the path to save the SDK log file. | 1.17 |
| setLogLevel | Sets the log level. | 1.17 |
Channel APIs
| API | Description | Minimum supported version |
| joinChannel | Joins a channel. | 1.1 |
| leaveChannel | Leave the channel. | 1.1 |
| switchChannel | Switches to another channel. | 2.1 |
| isInCall | Checks whether the user is in a channel. | 1.1 |
| setChannelProfile | Sets the channel mode. | 1.15 |
| createChannelWithDelegate | Creates an AliRtcEngine sub-channel instance. | 2.1 |
| destroyChannel | Destroys the sub-channel created by createChannelWithDelegate. | 2.1 |
Publishing APIs
| API | Description | Minimum supported version |
| publishLocalVideoStream | Sets whether to publish the video stream. | 2.1 |
| isLocalVideoStreamPublished | Queries whether the video stream is allowed to be published. | 1.1 |
| isScreenSharePublished | Queries whether the screen stream is allowed to be published. | 1.1 |
| publishLocalAudioStream | Sets whether to publish the audio stream. | 2.1 |
| isLocalAudioStreamPublished | Queries whether the audio stream is allowed to be published. | 1.1 |
| publishLocalDualStream | Sets whether to publish the secondary video stream. | 2.1 |
| isDualStreamPublished | Queries whether the secondary video stream is allowed to be published. | 2.1 |
Subscription APIs
| API | Description | Minimum supported version |
| setRemoteVideoStreamType | Sets the subscribed camera stream type to high-quality or low-quality. | 2.1 |
| setRemoteDefaultVideoStreamType | Sets the default subscribed camera stream type to high-quality or low-quality. | 2.1 |
| setDefaultSubscribeAllRemoteAudioStreams | Sets whether to subscribe to audio streams by default. | 2.1 |
| subscribeAllRemoteAudioStreams | Stops or resumes receiving all remote audio streams. | 2.1 |
| subscribeRemoteAudioStream | Stops or resumes receiving the audio stream of a specific remote user. | 2.1 |
| setDefaultSubscribeAllRemoteVideoStreams | Sets whether to subscribe to video streams by default. | 2.1 |
| subscribeAllRemoteVideoStreams | Stops or resumes receiving all remote video streams. | 2.1 |
| subscribeRemoteVideoStream | Stops or resumes receiving the video stream of a specific remote user. | 2.1 |
Video APIs
| API | Description | Minimum supported version |
| setScreenShareEncoderConfiguration | Sets the screen sharing encoding properties. | 2.1 |
| setLocalViewConfig | Sets the rendering window and parameters for the local preview. | 1.1 |
| setCameraCapturerConfiguration | Sets the preferred camera capture settings. | 2.1 |
| enableLocalVideo | Disables or re-enables local video capture. | 2.1 |
| muteLocalCamera | Stops or resumes sending local video data. | 1.1 |
| muteAllRemoteVideoRendering | Stops or resumes rendering all remote videos (iOS only). | 2.1 |
| setRemoteViewConfig | Sets the rendering window and parameters for a remote video. | 1.1 |
| isCameraOn | Checks whether the camera is on. | 1.1 |
| stopRecord | Stops recording. | 1.17 |
| startRecord | Starts recording (non-layout recording). | 1.17 |
| setBeautyEffect | Sets whether to enable basic retouching. | 1.17.9 |
| setVideoEncoderConfiguration | Sets the video encoding properties. | 2.1 |
| addVideoWatermark | Adds a watermark. | 2.1 |
| clearVideoWatermark | Removes the watermark from the specified data stream. | 2.1 |
| snapshotVideo | Takes a snapshot. | 2.1 |
| switchCamera | Switches between the front and rear cameras (iOS only). | 1.1 |
| getCurrentCameraDirection | Gets the current camera direction. The front camera is used by default (iOS only). | 1.1 |
| setCameraZoom | Sets the camera zoom factor (iOS only). | 1.1 |
| setCameraFlash | Sets whether to turn on the camera flash (iOS only). | 1.14 |
| isCameraFocusPointSupported | Checks whether the camera supports manual focus (iOS only). | 1.14 |
| isCameraExposurePointSupported | Checks whether the camera supports setting an exposure area (iOS only). | 1.14 |
| setCameraFocusPoint | Sets the manual focus for the camera (iOS only). | 1.14 |
| setCameraExposurePoint | Sets the camera exposure point (iOS only). | 1.14 |
| isCameraAutoFocusFaceModeSupported | Checks whether the camera supports face-based auto focus (iOS only). | 2.1 |
| setCameraAutoFocusFaceModeEnabled | Sets face-based auto focus for the camera (iOS only). | 2.1 |
| getVideoCaptureData | Actively obtains captured data. | 2.4 |
| getVideoPreEncoderData | Actively obtains pre-encoding data. | 2.4 |
| getVideoRenderData | Actively obtains stream pulling data. | 2.4 |
Video Sharing APIs
| API | Description | Minimum supported version |
| startScreenShare | Starts screen sharing (iOS only). | 2.1 |
| startScreenShareWithDesktopId | Starts screen sharing based on the desktop ID (Mac only). | 2.1 |
| startScreenShareWithWindowId | Starts screen sharing based on the window ID (Mac only). | 2.1 |
| getScreenShareSourceInfoWithType | Gets the screen sharing source information (Mac only). | 2.1 |
| updateScreenShareConfig | Updates the screen sharing configuration (Mac only). | 2.1 |
| stopScreenShare | Stops screen sharing. | 2.1 |
Audio APIs
| API | Description | Minimum supported version |
| setAudioOnlyMode | Sets the mode to audio-only or audio and video. | 1.1 |
| isAudioOnly | Queries whether the current mode is audio-only. | 1.1 |
| muteLocalMic | Stops or resumes sending local audio data. | 1.1 |
| muteRemoteAudioPlaying | Stops or resumes playing a remote audio stream. | 1.1 |
| muteAllRemoteAudioPlaying | Stops or resumes playing all remote audio streams. | 1.16.2 |
| startAudioCapture | Starts audio capture. | 1.11 |
| stopAudioCapture | Stops audio capture. | 1.11 |
| startAudioPlayer | Starts the audio playback device. | 1.11 |
| stopAudioPlayer | Stops audio playback. | 1.11 |
| setRemoteAudioVolume | Sets the playback volume of a specified remote user. | 2.1 |
| enableSpeakerphone | Sets the audio output to the earpiece or speaker (iOS only). | 2.1 |
| isEnableSpeakerphone | Gets the current audio output device, earpiece or speaker (iOS only). | 2.1 |
| setRecordingVolume | Sets the recording volume. | 1.16.2 |
| setPlayoutVolume | Sets the playback volume. | 1.16.2 |
| setRecordingDeviceVolume | Sets the audio capture device volume (Mac only). | 2.1 |
| getRecordingDeviceVolume | Gets the audio capture device volume (Mac only). | 2.1 |
| setPlayoutDeviceVolume | Sets 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 of the external audio input (Mac only). | 2.1 |
| getExternalAudioRenderVolume | Gets the playback volume of the external audio input (Mac only). | 2.1 |
| enableAudioVolumeIndication | Sets the volume callback frequency and smoothing coefficient. | 1.17.9 |
| setAudioProfile | Sets the audio profile. | 2.1 |
| setAudioSessionOperationRestriction | Sets the SDK's control permission over AVAudioSession (iOS only). | 2.1 |
| setDeviceVolumeType | Sets the SDK device volume type (iOS only). | 2.1 |
| enableAudioDTX | Enables local audio traffic shaping (voice). | 2.1 |
| enableAudioAMD | Enables local audio traffic shaping (microphone). | 2.1 |
| setAudioEffectVoiceChangerMode | Sets the voice changer effect mode. | 2.1 |
| setAudioEffectPitchValue | Sets the pitch-shifting parameter. | 2.1 |
| setAudioEffectReverbMode | Sets the reverb effect mode. | 2.1 |
| setAudioEffectReverbParamType | Sets the reverb effect type and specific parameters. | 2.1 |
| enableEarBack | Enables in-ear monitoring (iOS only). | 1.15 |
| setEarBackVolume | Sets the in-ear monitoring volume (iOS only). | 1.15 |
| setRecordingDeviceMute | Mutes the audio capture device (macOS only). | 2.4 |
| getRecordingDeviceMute | Gets the mute status of the audio capture device (Mac only). | 2.4 |
| setPlaybackDeviceMute | Mutes the audio playback device (Mac only). | 2.4 |
| getPlaybackDeviceMute | Gets the mute status of the audio playback device (Mac only). | 2.4 |
Accompaniment and Sound Effects
| API | Description | Minimum supported version |
| startAudioAccompanyWithFile | Starts audio mixing. | 1.15 |
| stopAudioAccompany | Stops audio mixing. | 1.15 |
| setAudioAccompanyVolume | Sets the audio mixing volume. | 1.15 |
| setAudioAccompanyPublishVolume | Sets the volume of the mixed audio for stream ingest. | 1.15 |
| getAudioAccompanyPublishVolume | Gets the volume of the mixed audio for stream ingest. | 1.15 |
| setAudioAccompanyPlayoutVolume | Sets the local playback volume of the mixed audio. | 1.15 |
| getAudioAccompanyPlayoutVolume | Gets the local playback volume of the mixed audio. | 1.15 |
| pauseAudioAccompany | Pauses audio mixing. | 1.15 |
| resumeAudioAccompany | Resumes audio mixing. | 1.15 |
| getAudioAccompanyDuration | Gets the duration of the audio mixing file. | 1.17.30 |
| getAudioAccompanyCurrentPosition | Gets the playback progress of the music file. | 1.17.30 |
| setAudioAccompanyPosition | Sets the playback position of the audio file. | 1.17.30 |
| preloadAudioEffectWithSoundId | Preloads a sound effect file. | 1.15 |
| unloadAudioEffectWithSoundId | Unloads a preloaded sound effect file. | 1.15 |
| playAudioEffectWithSoundId | Starts playing a sound effect. | 1.15 |
| stopAudioEffectWithSoundId | Stops playing a sound effect. | 1.15 |
| stopAllAudioEffects | Stops playing all sound effects. | 1.15 |
| setAudioEffectPublishVolumeWithSoundId | Sets the stream ingest volume for a sound effect. | 1.15 |
| getAudioEffectPublishVolumeWithSoundId | Gets the stream ingest volume for a sound effect. | 1.15 |
| setAudioEffectPlayoutVolumeWithSoundId | Sets the local playback volume for a sound effect. | 1.15 |
| getAudioEffectPlayoutVolumeWithSoundId | Gets the local playback volume for a sound effect. | 1.15 |
| setAllAudioEffectsPublishVolume | Sets the local playback volume for all sound effects. | 1.15 |
| setAllAudioEffectsPlayoutVolume | Sets the stream ingest volume for all sound effects. | 1.15 |
| pauseAudioEffectWithSoundId | Pauses a sound effect. | 1.15 |
| pauseAllAudioEffects | Pauses all sound effects. | 1.15 |
| resumeAudioEffectWithSoundId | Resumes playing a sound effect. | 1.15 |
| resumeAllAudioEffects | Resumes playing all sound effects. | 1.15 |
Media Engine APIs
| API | Description | Minimum supported version |
| registerVideoSampleObserver | Registers video data outputs. | 1.17 |
| unRegisterVideoSampleObserver | Unregisters the video data output. | 1.17 |
| registerLocalVideoTexture | Registers an observer for local camera stream video OpenGL texture data (iOS only). | 1.15 |
| unregisterLocalVideoTexture | Unregisters the observer for local camera stream video OpenGL texture data (iOS only). | 1.15 |
| subscribeAudioData | Subscribes to audio data output. | 1.17 |
| unSubscribeAudioData | Unsubscribes from audio data output. | 1.17 |
| setSubscribeAudioNumChannel | Sets the number of output audio channels (not supported for pre-mixing data). | 2.1 |
| setSubscribeAudioSampleRate | Sets the output audio sample rate (not supported for pre-mixing data). | 2.1 |
| setExternalVideoSource | Enables an external video input source. | 2.1 |
| pushExternalVideoFrame | Inputs video data. | 2.1 |
| setExternalAudioSource | Sets whether to enable an external audio input source. | 1.17.9 |
| pushExternalAudioFrameRawData | Inputs audio data. | 1.17.9 |
| setExternalAudioVolume | Sets the audio mixing volume. | 1.17.9 |
| getExternalAudioVolume | Gets the audio mixing volume. | 1.17.9 |
| setMixedWithMic | Sets whether to mix with the audio captured by the microphone. | 1.17.9 |
| setExteranlAudioRender | Sets whether to enable playback of external audio input. | 1.17.9 |
| pushExternalAudioRenderRawData | Inputs external audio playback data. | 1.17.9 |
Live Stream Bypass APIs
| API | Description | Minimum supported version |
| startPublishLiveStreamWithURL | Starts bypass live streaming. | 2.4 |
| updatePublishLiveStreamWithURL | Updates bypass live streaming parameters. | 2.4 |
| stopPublishLiveStreamWithURL | Stops bypass live streaming. | 2.1 |
| GetPublishLiveStreamStateWithURL | Gets the bypass live streaming status. | 2.4 |
Cross-channel Co-hosting APIs
| API | Description | Minimum supported version |
| startChannelRelay | Starts cross-channel co-hosting. | 2.1 |
| updateChannelRelay | Updates cross-channel co-hosting. | 2.1 |
| stopChannelRelay | Stops cross-channel co-hosting. | 2.1 |
| enableBackgroundExchange | Enables or disables the virtual background replacement feature (Mac only). | 2.4 |
| enableBackgroundBlur | Enables or disables the virtual background blur feature (Mac only). | 2.4 |
Preview APIs
| API | Description | Minimum supported version |
| startPreview | Starts the local preview. | 1.1 |
| stopPreview | Stops the local preview. | 1.1 |
Remote User Query APIs
| API | Description | Minimum supported version |
| getOnlineRemoteUsers | Gets the list of online remote users. | 1.1 |
| getUserInfo | Queries remote user information. | 1.1 |
| isUserOnline | Queries whether a user is online. | 1.1 |
Device Management APIs (Mac only)
| API | Description | Minimum supported version |
| getAudioCaptures | Gets the list of recording devices in the system. | 1.1 |
| getCurrentAudioCapture | Gets the name of the recording device in use. | 1.1 |
| getCurrentAudioCaptureID | Gets the ID of the recording device in use. | 1.16.2 |
| setCurrentAudioCapture | Sets the recording device by name. | 1.1 |
| setCurrentAudioCaptureWithID | Sets 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 in use. | 1.1 |
| getCurrentAudioRendererID | Gets the ID of the speaker in use. | 1.16.2 |
| setCurrentAudioRenderer | Sets the speaker by name. | 1.1 |
| setCurrentAudioRendererWithID | Sets the speaker by ID. | 1.16.2 |
| getCameraList | Gets the camera list. | 1.1 |
| getCurrentCamera | Gets the name of the camera in use. | 1.1 |
| getCurrentCameraID | Gets the ID of the camera in use. | 1.16.2 |
| setCurrentCamera | Sets the camera by name. | 1.1 |
| setCurrentCameraWithID | Sets the camera by ID. | 1.16.2 |
| startTestAudioRecordWithName | Starts testing the audio capture device. | 1.16.2 |
| stopTestAudioRecord | Stops testing the audio capture device. | 1.16.2 |
| startTestAudioPlayoutWithName | Starts testing the audio playback device. | 1.16.2 |
| stopTestAudioPlayout | Stops testing the audio playback device. | 1.16.2 |
Video Layout Recording APIs (Mac only)
| API | Description | Minimum supported version |
| startRecord | Starts recording. | 2.1 |
| pauseRecord | Pauses recording. | 2.1 |
| resumeRecord | Resumes recording. | 2.1 |
| UpdateRecordLayout | Updates recording information. | 2.1 |
| addRecordTemplate | Adds a recording template. | 2.1 |
Other APIs
| API | Description | Minimum supported version |
| getSDKVersion | Gets the SDK version number. | 1.1 |
| getErrorDescription | Gets the description of an error code. | 2.1 |
| setClientRole | Sets the 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 | Starts the network quality probe. | 1.16.2 |
| stopLastmileDetect | Stops the network quality probe. | 1.16.2 |
| postFeedbackWithUid | Feedback on SDK issues. | 1.17.12 |
| sendMediaExtensionMsg | Sends media extension messages. | 1.17.1 |
| startIntelligentDenoise | Starts intelligent noise reduction. | 2.1 |
| stopIntelligentDenoise | Stops intelligent noise reduction. | 2.1 |
| refreshAuthInfo | Refreshes the authentication information. | 1.17.41 |
| getCurrentConnectionStatus | Gets the current network connection status. | 2.1 |
| enableDelegateMainQueue | Specifies whether to dispatch callbacks to the main thread (iOS only). | 2.1 |
| setDelegateQueue | Specifies the thread queue for callbacks (iOS only). | 2.1 |
| showDebugView | Shows the dashboard. | 2.4 |
API details
- setH5CompatibleMode: Sets whether to enable H5 compatibility.
Parameters+ (void)setH5CompatibleMode:(BOOL)comp;Name Type Description comp BOOL Specifies whether to enable H5 compatibility. `YES`: H5 compatibility is enabled. `NO`: H5 compatibility is disabled. The default value is `NO`. Important The current version does not support changing the H5 compatibility mode after an AliRtcEngine instance is created. You must call this method before you create the instance. - getH5CompatibleMode: Checks whether H5 compatibility mode is set.
Return value+ (BOOL)getH5CompatibleMode;`YES`: H5 compatibility is enabled. `NO`: H5 compatibility is disabled.
- sharedInstance: Creates an AliRtcEngine instance.
Parameters+ (instancetype _Nonnull )sharedInstance:(id<AliRtcEngineDelegate>_Nullable)delegate extras:(NSString *_Nullable)extras;Name Type Description delegate id<AliRtcEngineDelegate>_Nullable The delegate for listening to callbacks. extras NSString *_Nullable Configures special SDK features using JSON configurations. For more information, see extras feature description. If no special features are needed, you can pass an empty string: "". Important Only one primary instance can exist at a time. - destroy: Releases the SDK instance.
+ (void)destroy;Important Call this method after all operations are complete. - uploadLog: Uploads logs. By default, logs are automatically uploaded after a user leaves a session.
+ (void)uploadLog; - setLogDirPath: Sets the path to save the SDK log file.
Parameters+ (int)setLogDirPath:(NSString *_Nullable)logDirPath;
Return valueName Type Description logDirPath NSString *_Nullable The absolute path to save the log file. The default path for iOS is Library/Caches/Ali_RTC_Log. The default path for Mac is /Users/xxx/Documents/Ali_RTC_Log. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Important Call this method before you call any other SDK methods to prevent log loss. The application must ensure that the specified directory exists and is writable. - setLogLevel: Sets the log level.
Parameters- (void)setLogLevel:(AliRtcLogLevel)logLevel;Name Type Description logLevel AliRtcLogLevel The log level. The default value is AliRtcLogLevelInfo. - joinChannel: Joins a channel.
Parameters- (int)joinChannel:(AliRtcAuthInfo *_Nonnull)authInfo name:(NSString *_Nullable)userName onResult:(void(^_Nullable)(NSInteger errCode,NSString * _Nonnull channel,NSInteger elapsed))onResult;Name 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 invoked when the method call is complete. Note After you successfully join a channel, you must call leaveChannel to leave the current channel before joining another one. If you fail to join a channel and need to retry, you do not need to call leaveChannel first. - leaveChannel: Leaves a channel.
Return value- (int)leaveChannel;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note- For versions 1.15 and later, the engine can only be destroyed using the destroy method.
- For versions earlier than 1.15, the AliRtcEngine instance is destroyed when you leave a channel. To perform operations such as joining a channel again, you must re-initialize the AliRtcEngine instance by calling `getInstance`.
- If you are not in a channel, calling leaveChannel does not affect the instance, but it sends a notification message to other users in the channel.
- switchChannel: Switches to another channel.
Parameters- (int)switchChannel:(AliRtcAuthInfo *_Nonnull)authInfo;
Return valueName Type Description authInfo AliRtcAuthInfo The authentication information. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- If the ERR_SDK_INVALID_STATE error is returned, check if the channel mode or role is incorrect, or if you are not currently in a channel.
- If `ERR_INVALID_ARGUMENTS` is returned, check whether the authentication information is valid, or whether you are trying to join the same channel.
- `ERR_INNER` indicates an internal SDK state error.
Note- This method can be used only by a viewer (`AliRtcClientRolelive`) in interactive live streaming mode (`AliRtcInteractivelive`).
- This is an asynchronous method. After you successfully switch channels by calling this method, the SDK first triggers the onLeaveChannelResult callback for leaving the original channel, and then triggers the `onJoinChannelResult` callback for joining the new channel.
- isInCall: Checks whether the user is in a channel.
Return value- (BOOL)isInCall;`YES`: The user is in a channel. `NO`: The user is not in a channel.
- setChannelProfile: Sets the channel mode.
Parameters- (int)setChannelProfile:(AliRtcChannelProfile)profile;
Return valueName Type Description profile AliRtcChannelProfile The channel type. The default value is AliRtcCommunication. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note You can call this method only before you join a channel. You cannot change the channel mode during a session. You can change it after you leave the channel. - createChannelWithDelegate: Creates an AliRtcEngine sub-channel instance.
Parameters- (AliRtcEngine *_Nullable)createChannelWithDelegate:(id<AliRtcEngineDelegate>_Nonnull)delegate extras:(NSString *_Nullable)extras;
Return valueName Type Description delegate id<AliRtcEngineDelegate>_Nonnull The delegate of the returned SDK instance object. extras NSString *_Nullable Configures special SDK features using JSON configurations. For more information, see extras feature description. If no special features are needed, you can pass an empty string: @"". Returns a sub-channel instance on success, or `nil` on failure.
- destroyChannel: Destroys the sub-channel created by createChannelWithDelegate.
- (void)destroyChannel; - publishLocalVideoStream: Sets whether to publish the camera stream.
Parameters- (int)publishLocalVideoStream:(BOOL)enable;Name Type Description enable boolean `YES`: sends the video. `NO`: stops sending the video. The default value is `YES`. - isLocalVideoStreamPublished: Checks whether the camera stream is published.
Return value- (BOOL)isLocalVideoStreamPublished;`YES`: The camera stream is published. `NO`: The camera stream is not published.
- isScreenSharePublished: Checks whether the screen stream is published.
Return value- (BOOL)isScreenSharePublished;`YES`: The screen stream is published. `NO`: The screen stream is not published.
- publishLocalAudioStream: Sets whether to publish the audio stream.
Parameters- (int)publishLocalAudioStream:(BOOL)enable;
Return valueName Type Description enable boolean `YES`: sends the local audio stream. `NO`: stops the stream ingest. The default value is `YES`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- isLocalAudioStreamPublished: Checks whether the audio stream is published.
Return value- (BOOL)isLocalAudioStreamPublished;YES allows pushing, and NO disallows pushing.
- publishLocalDualStream: Sets whether to publish the secondary video stream.
Parameters- (int)publishLocalDualStream:(BOOL)enable;
Return valueName Type Description enable BOOL `YES`: publishes the secondary stream. `NO`: does not publish the secondary stream. The default value is `NO`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- isDualStreamPublished: Checks whether the secondary video stream is published.
Return value- (BOOL)isDualStreamPublished;YES allows pushing. NO disallows pushing.
- setRemoteVideoStreamType: Sets the subscribed camera stream type to high-quality or low-quality.
Parameters- (int)setRemoteVideoStreamType:(NSString *_Nonnull)uid type:(AliRtcVideoStreamType)streamType;
Return valueName Type Description uid NSString *_Nonnull The remote user ID. streamType AliRtcVideoStreamType The camera stream type. The default value is AliRtcVideoStreamTypeHigh (high-quality stream). A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setRemoteDefaultVideoStreamType: Sets the default subscribed camera stream type to high-quality or low-quality.
Parameters- (int)setRemoteDefaultVideoStreamType:(AliRtcVideoStreamType)streamType;
Return valueName Type Description streamType AliRtcVideoStreamType The camera stream type. The default value is AliRtcVideoStreamTypeHigh (high-quality stream). A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setDefaultSubscribeAllRemoteAudioStreams: Sets whether to subscribe to audio streams by default.
Parameters- (int)setDefaultSubscribeAllRemoteAudioStreams:(BOOL)sub;
Return valueName Type Description sub BOOL `YES`: receives user audio streams. `NO`: stops receiving user audio streams. The default value is `YES`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Important- You can call this method before or after you join a channel. If you call `setDefaultSubscribeAllRemoteAudioStreams:NO` after you join a channel, you will not receive audio streams from users who join the channel after the setting is applied.
- After you stop receiving audio streams, if you want to resume, call subscribeRemoteAudioStream:uid sub:YES and specify the UID of the remote user.
- To resume receiving audio streams from multiple users, you must call subscribeRemoteAudioStream multiple times. `setDefaultSubscribeAllRemoteAudioStreams:YES` only resumes receiving audio streams from users who join the channel later.
- subscribeAllRemoteAudioStreams: Stops or resumes receiving all remote audio streams.
Parameters- (int)subscribeAllRemoteAudioStreams:(BOOL)sub;
Return valueName Type Description sub BOOL `YES`: receives audio streams from all users. `NO`: stops receiving audio streams from all users. The default value is `YES`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note This method acts as a master switch for subscribing to remote audio streams. If you set this parameter to `NO`, you will unsubscribe from all remote audio streams in the current session. You will also not subscribe to new users who join later, even if setDefaultSubscribeAllRemoteAudioStreams:YES is set. - subscribeRemoteAudioStream: Stops or resumes receiving the audio stream of a specific remote user.
Parameters- (int)subscribeRemoteAudioStream:(NSString *_Nonnull)uid sub:(BOOL)sub;
Return valueName Type Description uid NSString *_Nonnull The remote user ID. sub BOOL `YES`: receives the audio stream of the specified user. `NO`: stops receiving the audio stream of the specified user. The default value is `YES`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note If you have previously called subscribeAllRemoteAudioStreams:NO to stop receiving all remote audio, you must call subscribeAllRemoteAudioStreams:YES before calling this method. The subscribeAllRemoteAudioStreams method provides global control, while the subscribeRemoteAudioStream method provides fine-grained control. - setDefaultSubscribeAllRemoteVideoStreams: Sets whether to subscribe to video streams by default.
Parameters- (int)setDefaultSubscribeAllRemoteVideoStreams:(BOOL)sub;
Return valueName Type Description sub boolean `YES`: receives user video streams. `NO`: does not receive user video streams. The default value is `YES`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note- You can call this method before or after you join a channel. If you call `setDefaultSubscribeAllRemoteVideoStreams:NO` after you join a channel, you will not receive video streams from users who join the channel after the setting is applied.
- After you stop receiving video streams, if you want to resume, call subscribeRemoteVideoStream:uid track:track sub:YES and specify the UID of the remote user.
- To resume receiving video streams from multiple users, you must call subscribeRemoteVideoStream multiple times. `setDefaultSubscribeAllRemoteVideoStreams:YES` only resumes receiving video streams from users who join the channel later.
- subscribeAllRemoteVideoStreams: Stops or resumes receiving all remote video streams.
Parameters- (int)subscribeAllRemoteVideoStreams:(BOOL)sub;
Return valueName Type Description sub BOOL `YES`: receives video streams from all users. `NO`: stops receiving video streams from all users. The default value is `YES`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note This method acts as a master switch for subscribing to remote video streams. If you set this parameter to `NO`, you will unsubscribe from all remote video streams in the current session. You will also not subscribe to new users who join later, even if setDefaultSubscribeAllRemoteVideoStreams:YES is set. - subscribeRemoteVideoStream: Stops or resumes receiving the video stream of a specific remote user.
Parameters- (int)subscribeRemoteVideoStream:(NSString *_Nonnull)uid track:(AliRtcVideoTrack)track sub:(BOOL)sub;
Return valueName Type Description uid NSString *_Nonnull The remote user ID. track AliRtcVideoTrack The video stream type. sub BOOL `YES`: receives the video stream of the specified user. `NO`: stops receiving the video stream of the specified user. The default value is `YES`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note- If you have previously called subscribeAllRemoteVideoStreams:NO to stop receiving all remote video streams, you must call subscribeAllRemoteVideoStreams:YES before calling this method.
- subscribeAllRemoteVideoStreams method provides global control, while the `subscribeRemoteVideoStream` method provides fine-grained control.
- setScreenShareEncoderConfiguration: Sets the encoding properties for screen sharing.
Parameters- (void)setScreenShareEncoderConfiguration:(AliRtcScreenShareEncoderConfiguration* _Nonnull)config;Name Type Description config AliRtcScreenShareEncoderConfiguration* _Nonnull The predefined screen sharing encoding properties. Default values: - dimensions: [0,0]
- frameRate: 5
- bitrate: 0
- rotation: 0
- setLocalViewConfig: Sets the rendering window and parameters for the local preview.
Parameters- (int)setLocalViewConfig:(AliVideoCanvas *_Nullable)viewConfig forTrack:(AliRtcVideoTrack)track;
Return valueName Type Description viewConfig AliVideoCanvas *_Nullable The rendering parameters, including the rendering window and rendering mode. track AliRtcVideoTrack The video track type. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note- You can switch windows before and after you call joinChannel. If `canvas` or `AliVideoCanvas::view` is `nil`, rendering stops.
- To reset the render mode during playback, keep the other member variables in the `canvas` object unchanged and modify only the `renderMode` member variable.
- To reset the mirror mode during playback, keep the other member variables in the `canvas` object unchanged and modify only the `mirrorMode` member variable.
- setCameraCapturerConfiguration: Sets the preferred camera capture settings.
Parameters- (int)setCameraCapturerConfiguration:(AliRtcCameraCapturerConfiguration* _Nonnull)config;
Return valueName Type Description config AliRtcCameraCapturerConfiguration* _Nonnull The preferred camera capture settings. Default values: - preference: 0
- cameraDirection: 0
A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- enableLocalVideo: Disables or re-enables local video capture.
Parameters- (int)enableLocalVideo:(BOOL)enable;
Return valueName Type Description enable BOOL `YES`: resumes normal operation. `NO`: stops video capture. The default value is `YES`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- muteLocalCamera: Stops or resumes sending local video data.
Parameters- (int)muteLocalCamera:(BOOL)mute forTrack:(AliRtcVideoTrack)track;
Return valueName Type Description mute BOOL `YES`: sends black frames instead of video data. `NO`: resumes normal operation. The default value is `NO`. track AliRtcVideoTrack The video track type whose publishing state needs to be changed. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note This method controls only whether to send black frames on the specified video stream. It does not stop video capture or data sending. To turn off video capture, use the enableLocalVideo method. To stop sending video data, use the publishLocalVideoStream method. - muteAllRemoteVideoRendering: Stops or resumes rendering all remote videos (iOS only).
Parameters- (int)muteAllRemoteVideoRendering:(BOOL)mute;
Return valueName Type Description mute BOOL `YES`: stops rendering. `NO`: resumes rendering. The default value is `NO`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note Stream pulling and decoding are not affected. You can call this method before or after you call joinChannel. - setRemoteViewConfig: Sets the rendering window and parameters for a remote video.
Parameters- (int)setRemoteViewConfig:(AliVideoCanvas *_Nullable)canvas uid:(NSString *_Nonnull)uid forTrack:(AliRtcVideoTrack)track;
Return valueName Type Description canvas AliVideoCanvas *_Nullable The rendering parameters, including the rendering window and rendering mode. uid NSString *_Nonnull The user ID. track AliRtcVideoTrack The video track type to set. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note- You can switch windows before and after you call joinChannel. If `canvas` or `view` is `nil`, rendering of the corresponding stream stops.
- To reset the render mode during playback, keep the other member variables in the `canvas` object unchanged and modify only the `renderMode` member variable.
- To reset the mirror mode during playback, keep the other member variables in the `canvas` object unchanged and modify only the `mirrorMode` member variable.
- isCameraOn: Checks whether the camera is on.
Return value- (BOOL)isCameraOn;`YES`: The camera is on. `NO`: The camera is not on.
- stopRecord: Stops recording.
- (void)stopRecord; - startRecord: Starts recording (non-layout recording).
Parameters- (BOOL)startRecord:(AliRtcRecordType)recordType recordFormat:(AliRtcRecordFormat)recordFormat filePath:(NSString*_Nonnull)filePath audioConfig:(AliRtcRecordAudioConfig*_Nullable)audioConfig videoConfig:(AliRtcRecordVideoConfig*_Nullable)videoConfig;
Return valueName Type Description recordType AliRtcRecordType The record type. recordFormat AliRtcRecordFormat The record format. filePath NSString*_Nonnull The file path. audioConfig AliRtcRecordAudioConfig*_Nullable The audio recording settings. videoConfig AliRtcRecordVideoConfig*_Nullable The video settings. Mobile devices do not support video recording. `YES` indicates that the method call is successful. `NO` indicates that the call failed.
- setBeautyEffect: Enables or disables basic retouching. This feature currently supports only whitening and smoothing.
Parameters- (int)setBeautyEffect:(BOOL)enable config:(AliRtcBeautyConfig *_Nullable)config;
Return valueName Type Description enable BOOL `YES`: enables the feature. `NO`: disables the feature. The default value is `NO`. config AliRtcBeautyConfig *_Nullable The basic retouching parameters. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setVideoEncoderConfiguration: Sets the video encoding properties.
Parameters- (void)setVideoEncoderConfiguration:(AliRtcVideoEncoderConfiguration* _Nonnull)config;Name Type Description config AliRtcVideoEncoderConfiguration* _Nonnull The predefined encoding properties. Default values: - dimensions: [640,480]
- frameRate: 15
- bitrate: 0
- mirrorMode: 0
- orientationMode: 0
- rotation: 0
- addVideoWatermark: Adds a watermark.
Parameters- (int)addVideoWatermark:(AliRtcVideoTrack)track image:(NSString*_Nonnull)imageUrl config:(AliRtcWatermarkConfig *_Nullable)config;
Return valueName Type Description track AliRtcVideoTrack The data stream type. imageUrl NSString*_Nonnull The path of the watermark image. config AliRtcWatermarkConfig *_Nullable The watermark configuration. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- clearVideoWatermark: Removes the watermark from the specified data stream.
Parameters- (int)clearVideoWatermark:(AliRtcVideoTrack)track;
Return valueName Type Description track AliRtcVideoTrack The data stream type. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- snapshotVideo: Takes a snapshot. The result is returned through the OnSnapshotComplete callback.
Parameters- (int)snapshotVideo:(NSString*_Nullable)userId type:(AliRtcVideoTrack)type;
Return valueName Type Description userId NSString*_Nullable The user ID. If empty, it refers to the local user. trackType AliRtcVideoTrack The stream type. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- switchCamera: Switches between the front and rear cameras. The front camera is used by default (iOS only).
Return value- (int)switchCamera;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- getCurrentCameraDirection: Retrieves the current camera direction. The front camera is used by default (iOS only).
Return value- (AliRtcCameraDirection)getCurrentCameraDirection;Returns the camera direction enumeration value.
- setCameraZoom: Sets the camera zoom factor (iOS only).
Parameters- (int)setCameraZoom:(float)zoom;
Return valueName Type Description zoom float The zoom level. The default value is 1.0. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setCameraFlash: Turns the camera flash on or off (iOS only).
Parameters- (int)setCameraFlash:(BOOL)flash;
Return valueName Type Description flash BOOL `YES`: turns on the flash. `NO`: turns off the flash. The default value is `NO`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- isCameraFocusPointSupported: Checks whether the camera supports manual focus (iOS only).
Return value- (BOOL)isCameraFocusPointSupported;`YES`: supported. `NO`: not supported.
- isCameraExposurePointSupported: Checks whether the camera supports setting an exposure area (iOS only).
Return value- (BOOL)isCameraExposurePointSupported;`YES`: supported. `NO`: not supported.
- setCameraFocusPoint: Sets the manual focus for the camera (iOS only).
Parameters- (int)setCameraFocusPoint:(CGPoint)point;
Return valueName Type Description point CGPoint The coordinates of the focus point. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setCameraExposurePoint: Sets the camera exposure point (iOS only).
Parameters- (int)setCameraExposurePoint:(CGPoint)point;
Return valueName Type Description point CGPoint The coordinates of the exposure point. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- isCameraAutoFocusFaceModeSupported: Checks whether the camera supports face-based auto focus (iOS only).
Return value- (BOOL)isCameraAutoFocusFaceModeSupported;`YES`: supported. `NO`: not supported.
- setCameraAutoFocusFaceModeEnabled: Enables or disables face-based auto focus for the camera (iOS only).
Parameters- (BOOL)setCameraAutoFocusFaceModeEnabled:(BOOL)enable;
Return valueName Type Description enable BOOL `YES`: enables face-based auto focus. `NO`: disables face-based auto focus. The default value is `NO`. `YES` indicates that the method call is successful. `NO` indicates that the call failed.
- startScreenShare: Starts screen sharing (iOS only).
Return value- (int)startScreenShare;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- stopScreenShare: Stops screen sharing.
Return value- (int)stopScreenShare;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setAudioOnlyMode: Sets the mode to audio-only or audio and video.
Parameters- (int)setAudioOnlyMode:(BOOL)audioOnly;
Return valueName Type Description audioOnly BOOL `YES`: only audio is ingested and pulled. `NO`: both audio and video are supported. The default value is `NO`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- isAudioOnly: Checks whether the current mode is audio-only.
Return value- (BOOL)isAudioOnly;`YES`: audio-only mode. `NO`: audio and video mode.
- muteLocalMic: Stops or resumes sending local audio data.
Parameters- (int)muteLocalMic:(BOOL)mute mode:(AliRtcMuteLocalAudioMode)mode;
Return valueName Type Description mute BOOL `YES`: sends empty frames instead of local audio. `NO`: resumes normal operation. The default value is `NO`. mode AliRtcMuteLocalAudioMode The mute mode. The default is microphone mute mode. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note Muting sends only silent audio frames. The capture and encoding modules continue to work. - muteRemoteAudioPlaying: Stops or resumes playing a remote audio stream.
Parameters- (int)muteRemoteAudioPlaying:(NSString *_Nonnull)uid mute:(BOOL)mute;
Return valueName Type Description uid NSString *_Nonnull The user ID. mute BOOL `YES`: stops playback. `NO`: resumes playback. The default value is `NO`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- muteAllRemoteAudioPlaying: Stops or resumes playing all remote audio streams.
Parameters- (int)muteAllRemoteAudioPlaying:(BOOL)mute;
Return valueName Type Description mute BOOL `YES`: stops playback. `NO`: resumes playback. The default value is `NO`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note Stream pulling and decoding are not affected. You can call this method before or after you call joinChannel. - startAudioCapture: Starts audio capture.
Return value- (void)startAudioCapture;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note This method lets you start audio capture in advance. If you do not call this method, the SDK starts audio capture at the appropriate time. - stopAudioCapture: Stops audio capture.
Return value- (void)stopAudioCapture;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note This method stops audio capture and is the counterpart to `startAudioCapture`. - startAudioPlayer: Starts the audio playback device.
Return value- (void)startAudioPlayer;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note This method lets you start audio playback in advance. If you do not call this method, the SDK starts audio playback at the appropriate time. - stopAudioPlayer: Stops audio playback.
Return value- (void)stopAudioPlayer;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note This method stops audio playback and is the counterpart to `startAudioPlayer`. - setRemoteAudioVolume: Sets the playback volume of a specified remote user.
Parameters- (int)setRemoteAudioVolume:(NSString *_Nonnull)uid volume:(NSInteger)volume;
Return valueName Type Description uid NSString *_Nonnull The user ID. volume NSInteger The playback volume. The range is [0, 100]. 0 means mute, and 100 means original volume. The default value is 100. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- enableSpeakerphone: Sets the audio output to the earpiece or speaker (iOS only).
Parameters- (int)enableSpeakerphone:(BOOL)enable;
Return valueName Type Description enable BOOL `YES`: speaker mode. `NO`: earpiece mode. The default value is `YES`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- isEnableSpeakerphone: Checks whether the audio output device is the speaker or the earpiece (iOS only).
Return value- (BOOL)isEnableSpeakerphone;`YES`: speaker mode. `NO`: earpiece mode.
- setRecordingVolume: Sets the recording volume.
Parameters- (int)setRecordingVolume:(NSInteger)volume;
Return valueName Type Description volume NSInteger The range is [0, 400]. 0 means mute. The default value is 100. A value greater than 100 increases the volume, and a value less than 100 decreases the volume. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setPlayoutVolume: Sets the playback volume.
Parameters- (int)setPlayoutVolume:(NSInteger)volume;
Return valueName Type Description volume NSInteger The range is [0, 400]. 0 means mute. The default value is 100. A value greater than 100 increases the volume, and a value less than 100 decreases the volume. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- enableAudioVolumeIndication: Sets the volume callback frequency and smoothing coefficient.
Parameters- (int)enableAudioVolumeIndication:(NSInteger)interval smooth:(NSInteger)smooth reportVad:(NSInteger)reportVad;
Return valueName Type Description interval NSInteger The time interval in milliseconds. The minimum value is 10 ms. We recommend setting it to 300-500 ms. A value less than or equal to 0 disables the volume and speaker detection features. smooth NSInteger The smoothing coefficient. The range is [0, 9]. A larger value provides more smoothing but less real-time performance. We recommend setting it to 3. reportVad NSInteger The speaker detection switch. Valid values: - 1: On. The status of each speaker is returned through the onAudioVolumeCallback method.
- 0: Off.
A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setAudioProfile: Sets the audio profile.
Parameters- (int)setAudioProfile:(AliRtcAudioProfile)audio_profile audio_scene:(AliRtcAudioScenario)audio_scene;
Return valueName Type Description audio_profile AliRtcAudioProfile The audio capture or encoding mode parameter. The default value is AliEngineBasicQualityMode. audio_scene AliRtcAudioScenario The audio scenario mode parameter. The default value is AliEngineSceneDefaultMode. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setAudioSessionOperationRestriction: Sets the SDK's control permission over AVAudioSession (iOS only).
Parameters- (int)setAudioSessionOperationRestriction:(AliRtcAudioSessionOperationRestriction)restriction;
Return valueName Type Description restriction AliRtcAudioSessionOperationRestriction The control permission. The default value is AliAudioSessionOperationRestrictionNone. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setDeviceVolumeType: Sets the SDK device volume type (iOS only).
Parameters- (int)setDeviceVolumeType:(AliRtcDeviceVolumeType)type;
Return valueName Type Description type AliRtcDeviceVolumeType The volume type. The default value is AliRtcDeviceVolumeTypeAuto. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- enableAudioDTX: Enables local audio traffic shaping (voice).
Parameters- (int)enableAudioDTX:(BOOL)enable;
Return valueName Type Description enable BOOL `YES`: enables the feature. `NO`: disables the feature. The default value is `NO`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note This method is effective when called before stream ingest. Enabling voice activity detection can reduce the number of bytes sent when no voice is detected, which saves user traffic. - enableAudioAMD: Enables local audio traffic shaping (microphone).
Parameters- (int)enableAudioAMD:(BOOL)enable;
Return valueName Type Description enable BOOL `YES`: enables the feature. `NO`: disables the feature. The default value is `NO`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note This method is effective when called before stream ingest. Enabling voice activity detection can stop the sending of audio packets when the microphone is muted or turned off. - setAudioEffectVoiceChangerMode: Sets the voice changer effect mode.
Parameters- (int)setAudioEffectVoiceChangerMode:(AliRtcAudioEffectVoiceChangerMode)mode;
Return valueName Type Description mode AliRtcAudioEffectVoiceChangerMode The mode value. The default value is AliRtcSdk_AudioEffect_Voice_Changer_OFF. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setAudioEffectPitchValue: Sets the pitch-shifting parameter.
Parameters- (int)setAudioEffectPitchValue:(double)value;
Return valueName Type Description value double The range is [0.5, 2.0]. The default value is 1.0, which means no pitch change. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setAudioEffectReverbMode: Sets the reverb effect mode.
Parameters- (int)setAudioEffectReverbMode:(AliRtcAudioEffectReverbMode)mode;
Return valueName Type Description mode AliRtcAudioEffectReverbMode The sound effect mode. The default value is AliRtcAudioEffectReverb_Off. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setAudioEffectReverbParamType: Sets the reverb effect type and specific parameters.
Parameters- (int)setAudioEffectReverbParamType:(AliRtcAudioEffectReverbParamType)type value:(float)value;
Return valueName Type Description type AliRtcAudioEffectReverbParamType The reverb effect mode. value float The specific parameter value. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- startAudioAccompanyWithFile: Starts audio mixing.
Parameters- (int)startAudioAccompanyWithFile:(NSString *_Nonnull)filePath onlyLocalPlay:(BOOL)onlyLocalPlay replaceMic:(BOOL)replaceMic loopCycles:(NSInteger)loopCycles;
Return valueName Type Description filePath NSString *_Nonnull The path of the audio mixing file. onlyLocalPlay BOOL Specifies whether to play locally only. replaceMic BOOL Specifies whether to replace the microphone. loopCycles NSInteger The number of loops (can be -1 or a positive integer). A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- stopAudioAccompany: Stops audio mixing.
Return value- (int)stopAudioAccompany;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setAudioAccompanyVolume: Sets the audio mixing volume. This method is effective only after you call startAudioAccompanyWithFile.
Parameters- (int)setAudioAccompanyVolume:(NSInteger)volume;
Return valueName Type Description volume NSInteger The audio mixing volume. The range is [0, 100]. The default value is 50. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setAudioAccompanyPublishVolume: Sets the stream ingest volume of the mixed audio. This method is effective only after you call startAudioAccompanyWithFile.
Parameters- (int)setAudioAccompanyPublishVolume:(NSInteger)volume;
Return valueName Type Description volume NSInteger The audio mixing volume. The range is [0, 100]. The default value is 50. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- getAudioAccompanyPublishVolume: Retrieves the stream ingest volume of the mixed audio.
Return value- (int)getAudioAccompanyPublishVolume;Returns the stream ingest volume of the mixed audio. A value from 0 to 100 indicates success. Other values are error codes.
- setAudioAccompanyPlayoutVolume: Sets the local playback volume of the mixed audio. This method is effective only after you call startAudioAccompanyWithFile.
Parameters- (int)setAudioAccompanyPlayoutVolume:(NSInteger)volume;
Return valueName Type Description volume NSInteger The audio mixing volume. The range is [0, 100]. The default value is 50. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- getAudioAccompanyPlayoutVolume: Retrieves the local playback volume of the mixed audio.
Return value- (int)getAudioAccompanyPlayoutVolume;Returns the local playback volume of the mixed audio. A value from 0 to 100 indicates success. Other values are error codes.
- pauseAudioAccompany: Pauses audio mixing.
Return valuepublic abstract int pauseAudioAccompany();A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- resumeAudioAccompany: Resumes audio mixing.
Return value- (int)pauseAudioAccompany;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- getAudioAccompanyDuration: Retrieves the duration of the audio mixing file.
Return value- (int)getAudioAccompanyDuration;Returns the duration of the audio mixing file in milliseconds. A value less than 0 is an error code.
- getAudioAccompanyCurrentPosition: Retrieves the playback progress of the music file.
Return value- (int)getAudioAccompanyCurrentPosition;Returns the playback progress of the music file in milliseconds. A value less than 0 is an error code.
- setAudioAccompanyPosition: Sets the playback position of the audio file.
Parameters- (int)setAudioAccompanyPosition:(int)pos;
Return valueName Type Description pos int The progress bar position in milliseconds. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- preloadAudioEffectWithSoundId: Preloads a sound effect file.
Parameters- (int)preloadAudioEffectWithSoundId:(NSInteger)soundId filePath:(NSString *_Nonnull)filePath;
Return valueName Type Description soundId NSInteger The ID assigned to the sound effect file by the user. filePath NSString *_Nonnull The path of the sound effect file. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- unloadAudioEffectWithSoundId: Unloads a preloaded sound effect file.
Parameters- (int)unloadAudioEffectWithSoundId:(NSInteger)soundId;
Return valueName Type Description soundId NSInteger The ID assigned to the sound effect file by the user. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- playAudioEffectWithSoundId: Starts playing a sound effect.
Parameters- (int)playAudioEffectWithSoundId:(NSInteger)soundId filePath:(NSString *_Nonnull)filePath cycles:(NSInteger)cycles publish:(BOOL)publish;
Return valueName Type Description soundId NSInteger The ID assigned to the sound effect file by the user. filePath NSString *_Nonnull The path of the sound effect file. cycles NSInteger The number of loops (can be -1 or a positive integer). publish BOOL Specifies whether to publish. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- stopAudioEffectWithSoundId: Stops playing a sound effect.
Parameters- (int)stopAudioEffectWithSoundId:(NSInteger)soundId;
Return valueName Type Description soundId NSInteger The ID assigned to the sound effect file by the user. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- stopAllAudioEffects: Stops playing all sound effects.
Return value- (int)stopAllAudioEffects;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setAudioEffectPublishVolumeWithSoundId: Sets the stream ingest volume for a sound effect.
Parameters- (int)setAudioEffectPublishVolumeWithSoundId:(NSInteger)soundId volume:(NSInteger)volume;
Return valueName Type Description soundId NSInteger The ID assigned to the sound effect file by the user. volume NSInteger The audio mixing volume. The range is [0, 100]. The default value is 50. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- getAudioEffectPublishVolumeWithSoundId: Retrieves the stream ingest volume for a sound effect.
Parameters- (int)getAudioEffectPublishVolumeWithSoundId:(NSInteger)soundId;
Return valueName Type Description soundId NSInteger The ID assigned to the sound effect file by the user. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setAudioEffectPlayoutVolumeWithSoundId: Sets the local playback volume for a sound effect.
Parameters- (int)setAudioEffectPlayoutVolumeWithSoundId:(NSInteger)soundId volume:(NSInteger)volume;
Return valueName Type Description soundId NSInteger The ID assigned to the sound effect file by the user. volume NSInteger The audio mixing volume. The range is [0, 100]. The default value is 50. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- getAudioEffectPlayoutVolumeWithSoundId: Retrieves the local playback volume for a sound effect.
Parameters- (int)getAudioEffectPlayoutVolumeWithSoundId:(NSInteger)soundId;
Return valueName Type Description soundId NSInteger The ID assigned to the sound effect file by the user. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setAllAudioEffectsPublishVolume: Sets the stream ingest volume for all sound effects.
Parameters- (int)setAllAudioEffectsPublishVolume:(NSInteger)volume;
Return valueName Type Description volume NSInteger The audio mixing volume. The range is [0, 100]. The default value is 50. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setAllAudioEffectsPlayoutVolume: Sets the local playback volume for all sound effects.
Parameters- (int)setAllAudioEffectsPlayoutVolume:(NSInteger)volume;
Return valueName Type Description volume NSInteger The audio mixing volume. The range is [0, 100]. The default value is 50. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- pauseAudioEffectWithSoundId: Pauses a sound effect.
Parameters- (int)pauseAudioEffectWithSoundId:(NSInteger)soundId;
Return valueName Type Description soundId NSInteger The ID assigned to the sound effect file by the user. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- pauseAllAudioEffects: Pauses all sound effects.
Return value- (int)pauseAllAudioEffects;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- resumeAudioEffectWithSoundId: Resumes playing a sound effect.
Parameters- (int)resumeAudioEffectWithSoundId:(NSInteger)soundId;
Return valueName Type Description soundId NSInteger The ID assigned to the sound effect file by the user. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- resumeAllAudioEffects: Resumes playing all sound effects.
Return value- (int)resumeAllAudioEffects;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- enableEarBack: Enables in-ear monitoring (iOS only).
Parameters- (int)enableEarBack:(BOOL)enable;
Return valueName Type Description enable BOOL `YES`: enables in-ear monitoring. `NO`: disables in-ear monitoring. The default value is `NO`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setEarBackVolume: Sets the in-ear monitoring volume (iOS only).
Parameters- (int)setEarBackVolume:(NSInteger)volume;
Return valueName Type Description volume NSInteger The range is [0, 100]. The default value is 100. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- registerVideoSampleObserver: Registers a video data observer.
- (void)registerVideoSampleObserver; - unRegisterVideoSampleObserver: Unregisters the video data observer.
- (void)unregisterVideoSampleObserver; - registerLocalVideoTexture: Registers an observer for local camera stream video OpenGL texture data (iOS only).
- (void)registerLocalVideoTexture; - unregisterLocalVideoTexture: Unregisters the observer for local camera stream video OpenGL texture data (iOS only).
- (void)unregisterLocalVideoTexture; - subscribeAudioData: Subscribes to audio data output.
Parameters- (void)subscribeAudioData:(AliRtcAudioSource)audioSource;Name Type Description audioSource AliRtcAudioSource The data type. - unSubscribeAudioData: Unsubscribes from audio data output.
Parameters- (void)unSubscribeAudioData:(AliRtcAudioSource)audioSource;Name Type Description audioSource AliRtcAudioSource The data type. - setSubscribeAudioNumChannel: Sets the number of output audio channels (not supported for pre-mixing data).
Parameters- (void)setSubscribeAudioNumChannel:(AliRtcAudioNumChannel)audioNumChannel;Name Type Description audioNumChannel AliRtcAudioNumChannel The number of sound channels. The default is mono. - setSubscribeAudioSampleRate: Sets the output audio sample rate (not supported for pre-mixing data).
Parameters- (void)setSubscribeAudioSampleRate:(AliRtcAudioSampleRate)audioSampleRate;Name Type Description audioSampleRate AliRtcAudioSampleRate The sample rate. The default is 44.1 kHz. - setExternalVideoSource: Enables an external video input source.
Parameters- (int)setExternalVideoSource:(BOOL)enable sourceType:(AliRtcVideoSource)type renderMode:(AliRtcRenderMode)renderMode;Name Type Description enable BOOL `YES`: enables the feature. `NO`: disables the feature. type AliRtcVideoSource The stream type. renderMode AliRtcRenderMode The rendering mode. - pushExternalVideoFrame: Inputs video data.
Parameters- (int)pushExternalVideoFrame:(AliRtcVideoDataSample *_Nonnull)frame sourceType:(AliRtcVideoSource)type;
Return valueName Type Description frame AliRtcVideoDataSample *_Nonnull The frame data. type AliRtcVideoSource The stream type. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setExternalAudioSource: Sets whether to enable an external audio input source.
Parameters- (int)setExternalAudioSource:(BOOL)enable withSampleRate:(NSUInteger)sampleRate channelsPerFrame:(NSUInteger)channelsPerFrame;
Return valueName Type Description enable BOOL `YES`: enables the feature. `NO`: disables the feature. The default value is `NO`. sampleRate NSUInteger The sample rate, such as 16000 Hz or 48000 Hz. channelsPerFrame NSUInteger The number of sound channels, such as 1 or 2. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- pushExternalAudioFrameRawData: Inputs audio data.
Parameters- (int)pushExternalAudioFrameRawData:(void *_Nonnull)data samples:(NSUInteger)samples timestamp:(NSTimeInterval)timestamp;
Return valueName Type Description data void *_Nonnull The audio data. We recommend not exceeding 40 ms of data. samples NSUInteger The sample rate, such as 16 kHz or 48 kHz. timestamp NSTimeInterval The timestamp. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setExternalAudioVolume: Sets the audio mixing volume.
Parameters- (int)setExternalAudioVolume:(int)vol;
Return valueName Type Description vol int The audio mixing volume. The range is [1, 100]. The default value is 50. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- getExternalAudioVolume: Retrieves the audio mixing volume.
Return value- (int)getExternalAudioVolume;Returns the current audio mixing volume.
- setMixedWithMic: Sets whether to mix with the audio captured by the microphone.
Parameters- (int)setMixedWithMic:(BOOL)mixed;
Return valueName Type Description mixed BOOL `YES`: mixes the audio. `NO`: completely replaces the microphone-captured data. The default value is `NO`. Retrieves the current audio mixing volume.
- setExteranlAudioRender: Sets whether to enable playback of external audio input.
Parameters- (int)setExteranlAudioRender:(BOOL)enable sampleRate:(NSUInteger)sampleRate channelsPerFrame:(NSUInteger)channelsPerFrame;
Return valueName Type Description enable BOOL `YES`: enables the feature. `NO`: disables the feature. The default value is `NO`. sampleRate NSUInteger The sample rate, such as 16 kHz or 48 kHz. channelsPerFrame NSUInteger The number of sound channels, such as 1 or 2. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- pushExternalAudioRenderRawData: Inputs external audio playback data.
Parameters- (int)pushExternalAudioRenderRawData:(const void* _Nullable)audioSamples sampleLength:(NSUInteger)sampleLength sampleRate:(NSUInteger)sampleRate channelsPerFrame:(NSUInteger)channelsPerFrame timestamp:(long long)timestamp;
Return valueName 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 The timestamp. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- startPublishLiveStreamWithURL: Starts bypass live streaming.
Parameters- (int)startPublishLiveStreamWithURL:(NSString *_Nonnull)streamURL liveTranscoding:(AliRtcLiveTranscodingParam *_Nonnull)trancoding;
Return valueName Type Description streamUrl NSString * The ingest URL. transcoding AliRtcLiveTranscodingParam * The parameters required for stream ingest. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- updatePublishLiveStreamWithURL: Updates bypass live streaming parameters.
Parameters- (int)updatePublishLiveStreamWithURL:(NSString *_Nonnull)streamURL liveTranscoding:(AliRtcLiveTranscodingParam *_Nonnull)trancoding;
Return valueName Type Description streamUrl NSString * The ingest URL. transcoding AliRtcLiveTranscodingParam * The parameters required for stream ingest. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- stopPublishLiveStreamWithURL: Stops bypass live streaming.
Parameters- (int)stopPublishLiveStreamWithURL:(NSString *_Nonnull)streamURL;
Return valueName Type Description streamUrl NSString *_Nonnull The ingest URL. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- startChannelRelay: Starts cross-channel co-hosting.
Parameters- (int)startChannelRelay:(AliRtcChannelRelayConfiguration *_Nonnull)configuration;
Return valueName Type Description configuration AliRtcChannelRelayConfiguration *_Nonnull The configuration information. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- updateChannelRelay: Updates cross-channel co-hosting.
Parameters- (int)updateChannelRelay:(AliRtcChannelRelayConfiguration *_Nonnull)configuration;
Return valueName Type Description configuration AliRtcChannelRelayConfiguration *_Nonnull The configuration information. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- stopChannelRelay: Stops cross-channel co-hosting.
Return value- (int)stopChannelRelay;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- startPreview: Starts the local preview. This method automatically turns on the camera.
Return value- (int)startPreview;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note If no view is set, the preview cannot be started. You can start the preview before you call joinChannel. - stopPreview: Stops the local preview.
Return value- (int)stopPreview;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note `leaveChannel` automatically stops the local preview and turns off the camera. If the camera stream is being published, the camera is not turned off. - getOnlineRemoteUsers: Retrieves the list of online remote users.
Return value- (NSArray<NSString *> *_Nullable)getOnlineRemoteUsers;Returns a list of user IDs.
- getUserInfo: Queries remote user information.
Parameters- (NSDictionary *_Nullable)getUserInfo:(NSString *_Nonnull)uid;
Return valueName Type Description uid NSString *_Nonnull The ID of the target user to query. Returns a dictionary. The keys are described as follows:
Key Meaning userID The ID of the remote user. displayName The name of the remote user. sessionID The session ID of the remote user. isOnline Whether the remote user is online. isCameraMirror Whether the remote user has enabled camera stream mirroring. isScreenMirror Whether the remote user has enabled screen stream mirroring. muteAudioPlaying Whether the local user has muted this remote user. preferCameraMaster Whether the remote user has prioritized the high-quality stream. hasCameraView Whether the local user has set a view for this remote user's camera stream. hasScreenView Whether the local user has set a view for this remote user's screen stream. hasAudio Whether the remote user has published an audio stream. hasCameraMaster Whether the remote user has published a high-quality camera stream. hasCameraSlave Whether the remote user has published a low-quality camera stream. hasScreenSharing Whether the remote user has published a screen stream. requestAudio Whether the local user has requested this remote user's audio stream. requestCameraMaster Whether the local user has requested this remote user's high-quality camera stream. requestCameraSlave Whether the local user has requested this remote user's low-quality camera stream. requestScreenSharing Whether the local user has requested this remote user's screen stream. subScribedAudio Whether the local user has pulled this remote user's audio stream. subScribedCameraMaster Whether the local user has pulled this remote user's high-quality camera stream. subScribedCamearSlave Whether the local user has pulled this remote user's low-quality camera stream. subScribedScreenSharing Whether the local user has pulled this remote user's screen stream. - isUserOnline: Queries whether a user is online.
Parameters- (BOOL)isUserOnline:(NSString *_Nonnull)uid;
Return valueName Type Description uid NSString *_Nonnull The user ID. A unique identifier assigned by the app server. `YES`: online. `NO`: offline.
- getSdkVersion: Retrieves the SDK version number.
Return value+ (NSString *_Nonnull)getSdkVersion;Returns the SDK version number.
- getErrorDescription: Retrieves the description of an error code.
Parameters+ (NSString *_Nullable)getErrorDescription:(NSInteger)errCode;
Return valueName Type Description errorCode NSInteger The error code. Returns the description string of the error code.
- setClientRole: Sets the user role.
Parameters- (int)setClientRole:(AliRtcClientRole)role;
Return valueName Type Description role AliRtcClientRole The user role type. The default value is AliRtcClientRolelive (viewer role). This is effective only in non-communication modes. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- getCurrentClientRole: Retrieves the user role (iOS only).
Return value- (AliRtcClientRole)getCurrentClientRole;Returns the current user role.
- startLastmileDetect: Starts the network quality probe.
Return value- (int)startLastmileDetect;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note Call this method before you call joinChannel. The probe result is returned in the onLastmileDetectResultWithQuality callback. - stopLastmileDetect: Stops the network quality probe.
Return value- (int)stopLastmileDetect;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- postFeedbackWithUid: Provides SDK feedback.
Parameters- (void)postFeedbackWithUid:(NSString *_Nullable)uid channleId:(NSString *_Nullable)channelId description:(NSString *_Nonnull)description type:(AliRtcFeedbackType)type timeStamp:(NSTimeInterval)timeStamp;Name Type Description uid NSString *_Nullable The current UID (can be empty). channelId NSString *_Nullable The current channel ID (can be empty). description NSString *_Nullable The problem description (supports Chinese and English, cannot be empty). type AliRtcFeedbackType The problem type. timeStamp NSTimeInterval The timestamp when the problem occurred (Unix timestamp, can be an approximate time, does not need to be precise, can also be 0). - sendMediaExtensionMsg: Sends media extension messages.
Parameters- (int)sendMediaExtensionMsg:(NSData *_Nonnull)data repeatCount:(int)repeatCount;
Return valueName Type Description data NSData *_Nonnull The extension message. repeatCount int The number of repetitions. - 0: Success.
- -1: No stream is being published.
- -2: Invalid parameter.
- -3: The message is sent too frequently. We recommend that you try again later.
- startIntelligentDenoise: Starts intelligent noise reduction.
Return value- (int)startIntelligentDenoise;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note- This method can be used to enable the intelligent noise reduction feature during a call.
- This feature is disabled by default. Enabling it may increase power consumption. Intelligent noise reduction is suitable for voice-centric scenarios, such as meetings and education, but not for scenarios with background music.
- stopIntelligentDenoise: Stops intelligent noise reduction.
- (void)stopIntelligentDenoise;Note This method can be used to disable the intelligent noise reduction feature during a call. - refreshAuthInfo: Refreshes the authentication information.
Parameters- (int)refreshAuthInfo:(AliRtcAuthInfo *_Nonnull)authInfo;
Return valueName Type Description authInfo AliRtcAuthInfo *_Nonnull The authentication information. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- getCurrentConnectionStatus: Retrieves the current network connection status.
Return value- (AliRtcConnectionStatus)getCurrentConnectionStatus;Returns the current network connection status. For more information about the status, see AliRtcConnectionStatus.
- enableDelegateMainQueue: Specifies whether to dispatch callbacks to the main thread (iOS only).
Parameters- (int)enableDelegateMainQueue:(BOOL)enable;
Return valueName Type Description enable BOOL `YES`: dispatches callbacks to the main thread queue. `NO`: does not dispatch callbacks to the main thread queue. The default value is `YES`. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- setDelegateQueue: Specifies the thread queue for callbacks (iOS only).
Parameters- (int)setDelegateQueue:(NSOperationQueue *_Nullable)queue;
Return valueName Type Description queue NSOperationQueue *_Nullable The callback queue. The default is the main thread queue. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
Note- If you call enableDelegateMainQueue:YES, this method setting is invalid, and callbacks are dispatched to the main thread.
- If you call enableDelegateMainQueue:NO, you can use this method to specify the callback thread. If you do not set a thread, the SDK's default subthread is used.
- startScreenShareWithDesktopId: Starts screen sharing based on the desktop ID (Mac only).
Parameters- (int)startScreenShareWithDesktopId:(int)desktopId config:(AliRtcScreenShareConfig * _Nonnull)config;
Return valueName Type Description desktopId int The desktop ID, which can be obtained by calling the getScreenShareSourceInfoWithType method. config AliRtcScreenShareConfig * _Nonnull The screen sharing configuration. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- startScreenShareWithWindowId: Starts screen sharing based on the window ID (Mac only).
Parameters- (int)startScreenShareWithWindowId:(int)windowId config:(AliRtcScreenShareConfig * _Nonnull)config;
Return valueName Type Description windowId int The window ID, which can be obtained by calling the getScreenShareSourceInfoWithType method. config AliRtcScreenShareConfig * _Nonnull The screen sharing configuration. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- getScreenShareSourceInfoWithType: Retrieves the screen sharing source information (Mac only).
Parameters- (NSArray<AliRtcScreenSourceInfo *> * _Nullable)getScreenShareSourceInfoWithType:(AliRtcScreenShareType)type;
Return valueName Type Description type AliRtcScreenShareType The screen sharing type. Returns a list of AliRtcScreenSourceInfo objects that contain the screen sharing source information.
- updateScreenShareConfig: Updates the screen sharing configuration (Mac only).
Parameters- (int)updateScreenShareConfig:(AliRtcScreenShareConfig * _Nonnull)config;
Return valueName Type Description config AliRtcScreenShareConfig * _Nonnull The screen sharing configuration. Returns a list of screen sharing source information objects (AliRtcScreenSourceInfo).
- setRecordingDeviceVolume: Sets the audio capture device volume (Mac only).
Parameters- (int)setRecordingDeviceVolume:(NSInteger)volume;
Return valueName Type Description volume NSInteger The volume range is [0, 100]. The default value is the current microphone volume. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- getRecordingDeviceVolume: Retrieves the audio capture device volume (Mac only).
Return value- (int)getRecordingDeviceVolume;Returns the audio capture device volume. The value ranges from 0 to 100. A value of -1 indicates that the method call failed.
- setPlayoutDeviceVolume: Sets the audio playback device volume (Mac only).
Parameters- (int)setPlayoutDeviceVolume:(NSInteger)volume;
Return valueName Type Description volume NSInteger The volume range is [0, 100]. The default value is the current speaker volume. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- getPlayoutDeviceVolume: Retrieves the audio playback device volume (Mac only).
Return value- (int)getPlayoutDeviceVolume;Returns the audio playback device volume. The value ranges from 0 to 100. A value of -1 indicates that the method call failed.
- setExternalAudioRenderVolume: Sets the playback volume of the external audio input (Mac only).
Parameters- (int)setExternalAudioRenderVolume:(int)vol;
Return valueName Type Description vol int The volume range is [0, 100]. The default value is 50. A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- getExternalAudioRenderVolume: Retrieves the playback volume of the external audio input (Mac only).
Return value- (int)getExternalAudioRenderVolume;Returns the audio playback volume. The value ranges from 0 to 100.
- getAudioCaptures: Retrieves a list of the recording devices in the system (Mac only).
- (NSArray<AliRtcDeviceInfo *> *_Nullable)getAudioCaptures; - getCurrentAudioCapture: Retrieves the name of the recording device in use (Mac only).
- (NSString *_Nullable)getCurrentAudioCapture; - getCurrentAudioCaptureID: Retrieves the ID of the recording device in use (Mac only).
- (NSString *_Nullable)getCurrentAudioCaptureID; - setCurrentAudioCapture: Sets the recording device by name (Mac only).
Parameters- (void)setCurrentAudioCapture:(NSString *_Nonnull)capture;Name Type Description capture NSString *_Nonnull The name of the recording device to set. - setCurrentAudioCaptureWithID: Sets the recording device by ID (Mac only).
Parameters- (void)setCurrentAudioCaptureWithID:(NSString *_Nonnull)captureID;Name Type Description captureID NSString *_Nonnull The ID of the recording device to set. - getAudioRenderers: Retrieves a list of the speakers in the system (Mac only).
- (NSArray<AliRtcDeviceInfo *> *_Nullable)getAudioRenderers; - getCurrentAudioRenderer: Retrieves the name of the speaker in use (Mac only).
- (NSString *_Nullable)getCurrentAudioRenderer; - getCurrentAudioRendererID: Retrieves the ID of the speaker in use (Mac only).
- (NSString *_Nullable)getCurrentAudioRendererID; - setCurrentAudioRenderer: Sets the speaker by name (Mac only).
Parameters- (void)setCurrentAudioRenderer:(NSString *_Nonnull)renderer;Name Type Description renderer NSString *_Nonnull The name of the speaker device to set. - setCurrentAudioRendererWithID: Sets the speaker by ID (Mac only).
Parameters- (void)setCurrentAudioRendererWithID:(NSString *_Nonnull)rendererID;Name Type Description rendererID NSString *_Nonnull The ID of the speaker device to set. - getCameraList: Retrieves the camera list (Mac only).
- (NSArray<AliRtcDeviceInfo *> *_Nullable)getCameraList; - getCurrentCamera: Retrieves the name of the camera in use (Mac only).
- (NSString *_Nullable)getCurrentCamera; - getCurrentCameraID: Retrieves the ID of the camera in use (Mac only).
- (NSString *_Nullable)getCurrentCameraID; - setCurrentCamera: Sets the camera by name (Mac only).
Parameters- (void)setCurrentCamera:(NSString *_Nonnull)camera;Name Type Description camera NSString *_Nonnull The name of the camera device to set. - setCurrentCameraWithID: Sets the camera by ID (Mac only).
Parameters- (void)setCurrentCameraWithID:(NSString *_Nonnull)cameraID;Name Type Description cameraID NSString *_Nonnull The ID of the camera device to set. - startTestAudioRecordWithName: Starts testing the audio capture device (Mac only).
Parameters- (int)startTestAudioRecordWithName:(NSString *_Nonnull)deviceName;Name Type Description deviceName NSString *_Nonnull The audio capture device name. - stopTestAudioRecord: Stops testing the audio capture device (Mac only).
Return value- (int)stopTestAudioRecord;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- startTestAudioPlayoutWithName: Starts testing the audio playback device (Mac only).
Parameters- (int)startTestAudioPlayoutWithName:(NSString *_Nonnull)deviceName filePath:(NSString *_Nonnull)filePath loopCycles:(NSInteger)loopCycles;Name Type Description deviceName NSString *_Nonnull The audio playback device name. filePath NSString *_Nonnull The audio file path. loopCycles NSInteger The number of times to repeat playback. -1 means loop playback. - stopTestAudioPlayout: Stops testing the audio playback device (Mac only).
Return value- (int)stopTestAudioPlayout;A value of 0 indicates that the method call is successful. Other values indicate that the call failed.
- startRecord: Starts recording (Mac only).
Parameters- (BOOL)startRecord:(NSString*_Nonnull)filePath recordLayout:(AliRtcRecordVideoLayout*_Nonnull)recordLayout;
Return valueName Type Description filePath NSString*_Nonnull The file path. recordLayout AliRtcRecordVideoLayout*_Nonnull The video window layout settings. `YES` indicates that the method call is successful. `NO` indicates that the call failed.
- pauseRecord: Pauses recording (Mac only).
Return value- (BOOL)pauseRecord;`YES` indicates that the method call is successful. `NO` indicates that the call failed.
- resumeRecord: Resumes recording (Mac only).
Return value- (BOOL)resumeRecord;`YES` indicates that the method call is successful. `NO` indicates that the call failed.
- UpdateRecordLayout: Updates recording information (Mac only).
Parameters- (BOOL)UpdateRecordLayout:(AliRtcRecordVideoLayout*_Nonnull)layout;
Return valueName Type Description layout AliRtcRecordVideoLayout*_Nonnull The video window layout settings. `YES` indicates that the method call is successful. `NO` indicates that the call failed.
- addRecordTemplate: Adds a recording template (Mac only).
Parameters- (BOOL)addRecordTemplate:(AliRtcRecordTemplate*_Nonnull)recordTemplate;
Return valueName Type Description recordTemplate AliRtcRecordTemplate*_Nonnull The recording template. `YES` indicates that the method call is successful. `NO` indicates that the call failed.
- getClientRole: Retrieves the user role (Mac only).
Return value- (AliRtcClientRole)getClientRole;Returns the current user role.
- showDebugView: Displays the dashboard.
Parameters- (int)showDebugView:(UITextView * _Nonnull)view showType:(AliRtcShowDebugViewType)showType userId:(NSString * _Nullable)userId;
Return valueParameter Type Description view UITextView * The view to display externally. showType AliRtcShowDebugViewType The display type. Valid values: - 0 (default): Do not show.
- 1: Audio.
- 2: Video.
- 3: Network.
- 4: All.
Note For non-public data, you can set a special value.userId NSString * The corresponding user data. A value of 0 indicates that the method call is successful. A non-zero value indicates that the call failed.
- getVideoCaptureData: Retrieves captured video data.
Parameters- (BOOL)getVideoCaptureData:(AliRtcVideoTrack)videoTrack videoSample:(AliRtcVideoDataSample**)p_sample;
Return valueParameter Type Description videoTrack AliRtcVideoTrack The video stream type. p_sample AliRtcVideoDataSample ** The video sample. `YES` indicates that the method call is successful. `NO` indicates that the call failed.
- getVideoPreEncoderData: Retrieves pre-encoding video data.
Parameters- (BOOL)getVideoPreEncoderData:(AliRtcVideoTrack)videoTrack videoSample:(AliRtcVideoDataSample**)p_sample;
Return valueParameter Type Description videoTrack AliRtcVideoTrack The video stream type. p_sample AliRtcVideoDataSample ** The video sample. `YES` indicates that the method call is successful. `NO` indicates that the call failed.
- getVideoRenderData: Retrieves stream pulling data.
Parameters- (BOOL)getVideoRenderData:(NSString*)uid videoTrack:(AliRtcVideoTrack)videoTrack videoSample:(AliRtcVideoDataSample**)p_sample;
Return valueParameter Type Description uid NSString * The remote user ID. videoTrack AliRtcVideoTrack The video stream type. p_sample AliRtcVideoDataSample ** The video sample. `YES` indicates that the method call is successful. `NO` indicates that the call failed.
- GetPublishLiveStreamStateWithURL: Retrieves the bypass live streaming status.
Parameters- (AliRtcLiveTranscodingState)GetPublishLiveStreamStateWithURL:(NSString *_Nonnull)streamURL;
Return valueParameter Type Description streamURL NSString * The ingest URL. Returns the bypass live streaming status.
- setRecordingDeviceMute: Mutes the audio capture device (Mac only).
Parameters- (int)setRecordingDeviceMute:(BOOL)mute;
Return valueParameter Type Description mute BOOL Specifies whether to mute the device. Valid values: - TRUE: Mutes the device.
- FALSE: The device is unmuted.
A value of 0 indicates that the method call is successful. A non-zero value indicates that the call failed.
- getRecordingDeviceMute: Retrieves the mute status of the audio capture device (Mac only).
Return value- (BOOL)getRecordingDeviceMute;`YES` indicates that the method call is successful. `NO` indicates that the call failed.
- setPlaybackDeviceMute: Mutes the audio playback device (Mac only).
Parameters- (int)setPlaybackDeviceMute:(BOOL)mute;
Return valueParameter Type Description mute BOOL Specifies whether to mute the device. Valid values: - TRUE: Mutes the device.
- FALSE: The device is unmuted.
A value of 0 indicates that the method call is successful. A non-zero value indicates that the call failed.
- getPlaybackDeviceMute: Retrieves the mute status of the audio playback device (Mac only).
Return value- (BOOL)getPlaybackDeviceMute;`YES` indicates that the method call is successful. `NO` indicates that the call failed.
- enableBackgroundExchange: Enables or disables the virtual background replacement feature (Mac only).
Parameters- (int)enableBackgroundExchange:(BOOL)enable imagePath:(NSString *_Nonnull)path scalMode:(AliRtcBokehScaleModel)mode;
Return valueParameter Type Description enable BOOL Specifies whether to enable the background replacement feature. Valid values: - YES: Enable.
- NO: Disable.
path NSString The local image path. Supports JPG and PNG formats. mode AliRtcBokehScaleModel The background image scaling mode. Valid values: - AliRtcBokehScaleModelCrop: Proportional clipping.
- AliRtcBokehScaleModelFill: Fill with black bars.
A value of 0 indicates that the method call is successful. A non-zero value indicates that the call failed.
- enableBackgroundBlur: Enables or disables the virtual background blur feature (Mac only).
Parameters- (int)enableBackgroundBlur:(BOOL)enable blurDegree:(uint32_t)blurDegree;
Return valueParameter Type Description enable BOOL Specifies whether to enable the background blur feature. Valid values: - YES: Enable.
- NO: Disable.
blurDegree uint32_t The degree of blur. The range is [0, 100]. A value of 0 indicates that the method call is successful. A non-zero value indicates that the call failed.