ZegoExpressEngine Class Reference

Inherits from NSObject
Declared in ZegoExpressEngine.h

Other Methods

+ createEngineWithProfile:eventHandler:

The basic configuration information is used to create the engine.

+ (ZegoExpressEngine *)createEngineWithProfile:(ZegoEngineProfile *)profile eventHandler:(nullable id<ZegoEventHandler>)eventHandler

Parameters

profile

The basic configuration information is used to create the engine.

eventHandler

Event notification callback. [nil] means not receiving any callback notifications.It can also be managed later via [setEventHandler]. If [createEngine] is called repeatedly and the [destroyEngine] function is not called to destroy the engine before the second call, the eventHandler will not be updated.

Return Value

engine singleton instance.

Declared In

ZegoExpressEngine.h

+ destroyEngine:

Notification callback for destroy engine completion. Developers can listen to this callback to ensure that device hardware resources are released. If the developer only uses SDK to implement audio and video functions, this parameter can be passed [nil].

+ (void)destroyEngine:(nullable ZegoDestroyCompletionCallback)callback

Parameters

callback

Notification callback for destroy engine completion. Developers can listen to this callback to ensure that device hardware resources are released. If the developer only uses SDK to implement audio and video functions, this parameter can be passed [nil].

Declared In

ZegoExpressEngine.h

+ sharedEngine

Engine singleton instance

+ (ZegoExpressEngine *)sharedEngine

Return Value

Engine singleton instance

Declared In

ZegoExpressEngine.h

+ setEngineConfig:

Advanced engine configuration

+ (void)setEngineConfig:(ZegoEngineConfig *)config

Parameters

config

Advanced engine configuration

Declared In

ZegoExpressEngine.h

+ setLogConfig:

log configuration.

+ (void)setLogConfig:(ZegoLogConfig *)config

Parameters

config

log configuration.

Declared In

ZegoExpressEngine.h

+ setLocalProxyConfig:enable:

proxy info.

+ (void)setLocalProxyConfig:(NSArray<ZegoProxyInfo*> *)proxyList enable:(BOOL)enable

Parameters

proxyList

proxy info.

enable

enable proxy or not.

Declared In

ZegoExpressEngine.h

+ setCloudProxyConfig:token:enable:

proxy info.

+ (void)setCloudProxyConfig:(NSArray<ZegoProxyInfo*> *)proxyList token:(NSString *)token enable:(BOOL)enable

Parameters

proxyList

proxy info.

token

token. if use appsign auth, ignore.

enable

enable proxy or not.

Declared In

ZegoExpressEngine.h

+ setLicense:

license.

+ (void)setLicense:(NSString *)license

Parameters

license

license.

Declared In

ZegoExpressEngine.h

+ setRoomMode:

Room mode. Description: Used to set the room mode. Use cases: If you need to enter multiple rooms at the same time for publish-play stream, please turn on the multi-room mode through this interface. Required: True. Default value: ZEGO_ROOM_MODE_SINGLE_ROOM.

+ (void)setRoomMode:(ZegoRoomMode)mode

Parameters

mode

Room mode. Description: Used to set the room mode. Use cases: If you need to enter multiple rooms at the same time for publish-play stream, please turn on the multi-room mode through this interface. Required: True. Default value: ZEGO_ROOM_MODE_SINGLE_ROOM.

Declared In

ZegoExpressEngine.h

+ setGeoFence:area:

Geo fence type. Description: Used to set the geo fence type.

+ (void)setGeoFence:(ZegoGeoFenceType)type area:(NSArray<NSNumber*> *)area

Parameters

type

Geo fence type. Description: Used to set the geo fence type.

area

Geo fence area. Description: Used to describe the range of geo fence.

Declared In

ZegoExpressEngine.h

+ getVersion

SDK version.

+ (NSString *)getVersion

Return Value

SDK version.

Declared In

ZegoExpressEngine.h

+ setApiCalledCallback:

Method execution result callback.

+ (void)setApiCalledCallback:(nullable id<ZegoApiCalledEventHandler>)callback

Parameters

callback

Method execution result callback.

Declared In

ZegoExpressEngine.h

+ isFeatureSupported:

Type of feature to query.

+ (BOOL)isFeatureSupported:(ZegoFeatureType)featureType

Parameters

featureType

Type of feature to query.

Return Value

Whether the specified feature is supported. YES: supported; NO: not supported.

Declared In

ZegoExpressEngine.h

– setEventHandler:

Event notification callback. If the eventHandler is set to [nil], all the callbacks set previously will be cleared. Developers should monitor the corresponding callbacks according to their own business scenarios. The main callback functions of the SDK are here.

- (void)setEventHandler:(nullable id<ZegoEventHandler>)eventHandler

Parameters

eventHandler

Event notification callback. If the eventHandler is set to [nil], all the callbacks set previously will be cleared. Developers should monitor the corresponding callbacks according to their own business scenarios. The main callback functions of the SDK are here.

Declared In

ZegoExpressEngine.h

– setRoomScenario:

Room scenario.

- (void)setRoomScenario:(ZegoScenario)scenario

Parameters

scenario

Room scenario.

Declared In

ZegoExpressEngine.h

– uploadLog

Available since: 1.1.0 Description: By default, SDK creates and prints log files in the App’s default directory. Each log file defaults to a maximum of 5MB. Three log files are written over and over in a circular fashion. When calling this function, SDK will auto package and upload the log files to the ZEGO server. Use cases: Developers can provide a business “feedback” channel in the App. When users feedback problems, they can call this function to upload the local log information of SDK to help locate user problems. When to call: After [createEngine]. Restrictions: The frequency limit is once per minute. Caution: 1.After calling this interface to upload logs, if you call [destroyEngine] or exit the App too quickly, there may be a failure.It is recommended to wait a few seconds, and then call [destroyEngine] or exit the App after receiving the upload success callback. 2.If you want to call before [createEngine], use the [submitLog] interface.

- (void)uploadLog

Declared In

ZegoExpressEngine.h

– uploadLog:

Log upload result callback.

- (void)uploadLog:(nullable ZegoUploadLogResultCallback)callback

Parameters

callback

Log upload result callback.

Declared In

ZegoExpressEngine.h

+ submitLog

Available since: 3.7.0 Description: By default, SDK creates and prints log files in the App’s default directory. Each log file defaults to a maximum of 5MB. Three log files are written over and over in a circular fashion. When calling this function, SDK will auto package and upload the log files to the ZEGO server. Use cases: Developers can provide a business “feedback” channel in the App. When users feedback problems, they can call this function to upload the local log information of SDK to help locate user problems. When to call: None. Restrictions: The frequency limit is once per minute. Caution: 1.After calling this interface to upload logs, if you call [destroyEngine] or exit the App too quickly, there may be a failure.It is recommended to wait a few seconds, and then call [destroyEngine] or exit the App after receiving the upload success callback. 2.It is supported to call before [createEngine]. If it had called [createEngine] before, the last appid will be used to upload the log, otherwise the log will not be uploaded until the next [createEngine].

+ (void)submitLog

Declared In

ZegoExpressEngine.h

– enableDebugAssistant:

Whether to enable the debug assistant.

- (void)enableDebugAssistant:(BOOL)enable

Parameters

enable

Whether to enable the debug assistant.

Declared In

ZegoExpressEngine.h

– callExperimentalAPI:

Parameters in the format of a JSON string, please consult ZEGO technical support for details.

- (NSString *)callExperimentalAPI:(NSString *)params

Parameters

params

Parameters in the format of a JSON string, please consult ZEGO technical support for details.

Return Value

Returns an argument in the format of a JSON string, please consult ZEGO technical support for details.

Declared In

ZegoExpressEngine.h

+ new

Please use [+createEngineWithAppID:appSign:isTestEnv:scenario:eventHandler:] instead

+ (instancetype)new

Declared In

ZegoExpressEngine.h

– init

Please use [+createEngineWithAppID:appSign:isTestEnv:scenario:eventHandler:] instead

- (instancetype)init

Declared In

ZegoExpressEngine.h

+ createEngineWithAppID:appSign:isTestEnv:scenario:eventHandler:

Deprecated since 2.14.0, please use the method with the same name without [isTestEnv] parameter instead. (Deprecated: Deprecated since 2.14.0, please use the method with the same name without [isTestEnv] parameter instead.)

+ (ZegoExpressEngine *)createEngineWithAppID:(unsigned int)appID appSign:(NSString *)appSign isTestEnv:(BOOL)isTestEnv scenario:(ZegoScenario)scenario eventHandler:(nullable id<ZegoEventHandler>)eventHandler

Parameters

appID

Application ID issued by ZEGO for developers, please apply from the ZEGO Admin Console https://console.zegocloud.com The value ranges from 0 to 4294967295.

appSign

Application signature for each AppID, please apply from the ZEGO Admin Console. Application signature is a 64 character string. Each character has a range of ‘0’ ~ ‘9’, ‘a’ ~ ‘z’. AppSign 2.17.0 and later allows nil or no transmission. If the token is passed empty or not passed, the token must be entered in the [ZegoRoomConfig] parameter for authentication when the [loginRoom] interface is called to login to the room.

isTestEnv

[Deprecated] For providing better and more standardized services, starting from 2021-11-16, ZEGO no longer classifies environments into production environments and testing environments. f you create your project in ZEGO Admin Console on/before 2021-11-16, refer to Testing environment deprecation to upgrade the SDK and adjust related codes.

scenario

The room scenario. the SDK will optimize the audio and video configuration for the specified scenario to achieve the best effect in this scenario. After specifying the scenario, you can call other APIs to adjusting the audio and video configuration. Differences between scenarios and how to choose a suitable scenario, please refer to https://docs.zegocloud.com/article/14940

eventHandler

Event notification callback. [nil] means not receiving any callback notifications.It can also be managed later via [setEventHandler]. If [createEngine] is called repeatedly and the [destroyEngine] function is not called to destroy the engine before the second call, the eventHandler will not be updated.

Return Value

Engine singleton instance.

Declared In

ZegoExpressEngine.h

Room Methods

– loginRoom:user:

Room ID, a string of up to 128 bytes in length. Caution: 1. room ID is defined by yourself. 2. Only support numbers, English characters and ‘~’, ‘!’, ‘@’, ‘#’, ‘$’, ‘%’, ‘^’, ‘&’, ‘*’, ‘(’, ‘)’, ‘_’, ‘+’, ‘=’, ‘-’, ‘`’, ‘;’, ‘’’, ‘,’, ‘.’, ‘<’, ‘>’, ‘/’, ‘\’. 3. If you need to communicate with the Web SDK, please do not use ‘%’.

- (void)loginRoom:(NSString *)roomID user:(ZegoUser *)user

Parameters

roomID

Room ID, a string of up to 128 bytes in length. Caution: 1. room ID is defined by yourself. 2. Only support numbers, English characters and ‘~’, ‘!’, ‘@’, ‘#’, ‘$’, ‘%’, ‘^’, ‘&’, ‘*’, ‘(’, ‘)’, ‘_’, ‘+’, ‘=’, ‘-’, ‘`’, ‘;’, ‘’’, ‘,’, ‘.’, ‘<’, ‘>’, ‘/’, ‘\’. 3. If you need to communicate with the Web SDK, please do not use ‘%’.

user

User object instance, configure userID, userName. Note that the userID needs to be globally unique with the same appID, otherwise the user who logs in later will kick out the user who logged in first.

Declared In

ZegoExpressEngine+Room.h

– loginRoom:user:config:

Room ID, a string of up to 128 bytes in length. Caution: 1. room ID is defined by yourself. 2. Only support numbers, English characters and ‘~’, ‘!’, ‘@’, ‘#’, ‘$’, ‘%’, ‘^’, ‘&’, ‘*’, ‘(’, ‘)’, ‘_’, ‘+’, ‘=’, ‘-’, ‘`’, ‘;’, ‘’’, ‘,’, ‘.’, ‘<’, ‘>’, ‘/’, ‘\’. 3. If you need to communicate with the Web SDK, please do not use ‘%’.

- (void)loginRoom:(NSString *)roomID user:(ZegoUser *)user config:(ZegoRoomConfig *)config

Parameters

roomID

Room ID, a string of up to 128 bytes in length. Caution: 1. room ID is defined by yourself. 2. Only support numbers, English characters and ‘~’, ‘!’, ‘@’, ‘#’, ‘$’, ‘%’, ‘^’, ‘&’, ‘*’, ‘(’, ‘)’, ‘_’, ‘+’, ‘=’, ‘-’, ‘`’, ‘;’, ‘’’, ‘,’, ‘.’, ‘<’, ‘>’, ‘/’, ‘\’. 3. If you need to communicate with the Web SDK, please do not use ‘%’.

user

User object instance, configure userID, userName. Note that the userID needs to be globally unique with the same appID, otherwise the user who logs in later will kick out the user who logged in first.

config

Advanced room configuration.

Declared In

ZegoExpressEngine+Room.h

– loginRoom:user:config:callback:

Room ID, a string of up to 128 bytes in length. Caution: 1. room ID is defined by yourself. 2. Only support numbers, English characters and ‘~’, ‘!’, ‘@’, ‘#’, ‘$’, ‘%’, ‘^’, ‘&’, ‘*’, ‘(’, ‘)’, ‘_’, ‘+’, ‘=’, ‘-’, ‘`’, ‘;’, ‘’’, ‘,’, ‘.’, ‘<’, ‘>’, ‘/’, ‘\’. 3. If you need to communicate with the Web SDK, please do not use ‘%’.

- (void)loginRoom:(NSString *)roomID user:(ZegoUser *)user config:(ZegoRoomConfig *)config callback:(ZegoRoomLoginCallback)callback

Parameters

roomID

Room ID, a string of up to 128 bytes in length. Caution: 1. room ID is defined by yourself. 2. Only support numbers, English characters and ‘~’, ‘!’, ‘@’, ‘#’, ‘$’, ‘%’, ‘^’, ‘&’, ‘*’, ‘(’, ‘)’, ‘_’, ‘+’, ‘=’, ‘-’, ‘`’, ‘;’, ‘’’, ‘,’, ‘.’, ‘<’, ‘>’, ‘/’, ‘\’. 3. If you need to communicate with the Web SDK, please do not use ‘%’.

user

User object instance, configure userID, userName. Note that the userID needs to be globally unique with the same appID, otherwise the user who logs in later will kick out the user who logged in first.

config

Advanced room configuration.

callback

The callback of this login result, if you need detailed room status, please pay attention to the [onRoomStateChanged] callback. Required: No. Default value: nil.Caution: If the connection is retried multiple times due to network problems, the retry status will not be thrown by this callback.

Declared In

ZegoExpressEngine+Room.h

– logoutRoom

Available since: 2.9.0 Description: This API will log out the current user has logged in the room, if user logs in more than one room, all the rooms will be logged out. Use cases: In the same room, users can conduct live broadcast, audio and video calls, etc. When to call /Trigger: After successfully logging in to the room, if the room is no longer used, the user can call the function [logoutRoom]. Restrictions: None. Caution: 1. Exiting the room will stop all publishing and playing streams for user, and inner audio and video engine will stop, and then SDK will auto stop local preview UI. If you want to keep the preview ability when switching rooms, please use the [switchRoom] method. 2. If the user is not logged in to the room, calling this function will also return success. Related callbacks: After calling this function, you will receive [onRoomStateChanged] (Not supported before 2.18.0, please use [onRoomStateUpdate]) callback notification successfully exits the room, while other users in the same room will receive the [onRoomUserUpdate] callback notification(On the premise of enabling isUserStatusNotify configuration). Related APIs: Users can use [loginRoom], [switchRoom] functions to log in or switch rooms.

- (void)logoutRoom

Declared In

ZegoExpressEngine+Room.h

– logoutRoomWithCallback:

The callback of this logout room result, if you need detailed room status, please pay attention to the [onRoomStateChanged] callback. Required: No. Default value: nil.

- (void)logoutRoomWithCallback:(ZegoRoomLogoutCallback)callback

Parameters

callback

The callback of this logout room result, if you need detailed room status, please pay attention to the [onRoomStateChanged] callback. Required: No. Default value: nil.

Declared In

ZegoExpressEngine+Room.h

– logoutRoom:

Room ID, a string of up to 128 bytes in length. Caution: 1. Only support numbers, English characters and ‘~’, ‘!’, ‘@’, ‘#’, ‘$’, ‘%’, ‘^’, ‘&’, ‘*’, ‘(’, ‘)’, ‘_’, ‘+’, ‘=’, ‘-’, ‘`’, ‘;’, ‘’’, ‘,’, ‘.’, ‘<’, ‘>’, ‘/’, ‘\’. 2. If you need to communicate with the Web SDK, please do not use ‘%’.

- (void)logoutRoom:(NSString *)roomID

Parameters

roomID

Room ID, a string of up to 128 bytes in length. Caution: 1. Only support numbers, English characters and ‘~’, ‘!’, ‘@’, ‘#’, ‘$’, ‘%’, ‘^’, ‘&’, ‘*’, ‘(’, ‘)’, ‘_’, ‘+’, ‘=’, ‘-’, ‘`’, ‘;’, ‘’’, ‘,’, ‘.’, ‘<’, ‘>’, ‘/’, ‘\’. 2. If you need to communicate with the Web SDK, please do not use ‘%’.

Declared In

ZegoExpressEngine+Room.h

– logoutRoomWithCallback:callback:

Room ID, a string of up to 128 bytes in length. Caution: 1. Only support numbers, English characters and ‘~’, ‘!’, ‘@’, ‘#’, ‘$’, ‘%’, ‘^’, ‘&’, ‘*’, ‘(’, ‘)’, ‘_’, ‘+’, ‘=’, ‘-’, ‘`’, ‘;’, ‘’’, ‘,’, ‘.’, ‘<’, ‘>’, ‘/’, ‘\’. 2. If you need to communicate with the Web SDK, please do not use ‘%’.

- (void)logoutRoomWithCallback:(NSString *)roomID callback:(ZegoRoomLogoutCallback)callback

Parameters

roomID

Room ID, a string of up to 128 bytes in length. Caution: 1. Only support numbers, English characters and ‘~’, ‘!’, ‘@’, ‘#’, ‘$’, ‘%’, ‘^’, ‘&’, ‘*’, ‘(’, ‘)’, ‘_’, ‘+’, ‘=’, ‘-’, ‘`’, ‘;’, ‘’’, ‘,’, ‘.’, ‘<’, ‘>’, ‘/’, ‘\’. 2. If you need to communicate with the Web SDK, please do not use ‘%’.

callback

The callback of this logout room result, if you need detailed room status, please pay attention to the [onRoomStateChanged] callback. Required: No. Default value: nil.

Declared In

ZegoExpressEngine+Room.h

– switchRoom:toRoomID:

Current roomID.

- (void)switchRoom:(NSString *)fromRoomID toRoomID:(NSString *)toRoomID

Parameters

fromRoomID

Current roomID.

toRoomID

The next roomID.

Declared In

ZegoExpressEngine+Room.h

– switchRoom:toRoomID:config:

Current roomID.

- (void)switchRoom:(NSString *)fromRoomID toRoomID:(NSString *)toRoomID config:(ZegoRoomConfig *)config

Parameters

fromRoomID

Current roomID.

toRoomID

The next roomID.

config

Advanced room configuration.

Declared In

ZegoExpressEngine+Room.h

– renewToken:roomID:

The token that needs to be renew.

- (void)renewToken:(NSString *)token roomID:(NSString *)roomID

Parameters

token

The token that needs to be renew.

roomID

Room ID.

Declared In

ZegoExpressEngine+Room.h

– setRoomExtraInfo:forKey:roomID:callback:

value if the extra info.

- (void)setRoomExtraInfo:(NSString *)value forKey:(NSString *)key roomID:(NSString *)roomID callback:(nullable ZegoRoomSetRoomExtraInfoCallback)callback

Parameters

value

value if the extra info.

key

key of the extra info.

roomID

Room ID.

callback

Callback for setting room extra information.

Declared In

ZegoExpressEngine+Room.h

– getRoomStreamList:streamListType:

Room ID.

- (ZegoRoomStreamList *)getRoomStreamList:(NSString *)roomID streamListType:(ZegoRoomStreamListType)streamListType

Parameters

roomID

Room ID.

streamListType

Get type

Return Value

return stream list

Declared In

ZegoExpressEngine+Room.h

RangeAudio Methods

– createRangeAudio

range audio instance, nil will be returned when the maximum number is exceeded.

- (nullable ZegoRangeAudio *)createRangeAudio

Return Value

range audio instance, nil will be returned when the maximum number is exceeded.

Declared In

ZegoExpressEngine+RangeAudio.h

– destroyRangeAudio:

The range audio instance object to be destroyed.

- (void)destroyRangeAudio:(ZegoRangeAudio *)rangeAudio

Parameters

rangeAudio

The range audio instance object to be destroyed.

Declared In

ZegoExpressEngine+RangeAudio.h

AudioVADClient Methods

– createAudioVADClient

audio vad client instance.

- (nullable ZegoAudioVADClient *)createAudioVADClient

Return Value

audio vad client instance.

Declared In

ZegoExpressEngine+AudioVADClient.h

– destroyAudioVADClient:

The audio vad client instance object to be destroyed.

- (void)destroyAudioVADClient:(ZegoAudioVADClient *)client

Parameters

client

The audio vad client instance object to be destroyed.

Declared In

ZegoExpressEngine+AudioVADClient.h

IM Methods

– createRealTimeSequentialDataManager:

Fill in the room ID that has been logged in, and all related stuff will be do in this room.

- (nullable ZegoRealTimeSequentialDataManager *)createRealTimeSequentialDataManager:(NSString *)roomID

Parameters

roomID

Fill in the room ID that has been logged in, and all related stuff will be do in this room.

Return Value

The real-time sequential data manager instance, nil will be returned when the maximum number is exceeded.

Declared In

ZegoExpressEngine+IM.h

– destroyRealTimeSequentialDataManager:

The real time sequential data manager instance to be destroyed.

- (void)destroyRealTimeSequentialDataManager:(ZegoRealTimeSequentialDataManager *)manager

Parameters

manager

The real time sequential data manager instance to be destroyed.

Declared In

ZegoExpressEngine+IM.h

– sendBroadcastMessage:roomID:callback:

The content of the message. Required: Yes. Value range: The length does not exceed 1024 bytes.

- (void)sendBroadcastMessage:(NSString *)message roomID:(NSString *)roomID callback:(nullable ZegoIMSendBroadcastMessageCallback)callback

Parameters

message

The content of the message. Required: Yes. Value range: The length does not exceed 1024 bytes.

roomID

Room ID, a string of up to 128 bytes in length. Caution: 1. room ID is defined by yourself. 2. Only support numbers, English characters and ‘~’, ‘!’, ‘@’, ‘#’, ‘$’, ‘%’, ‘^’, ‘&’, ‘*’, ‘(’, ‘)’, ‘_’, ‘+’, ‘=’, ‘-’, ‘`’, ‘;’, ‘’’, ‘,’, ‘.’, ‘<’, ‘>’, ‘/’, ‘\’. 3. If you need to communicate with the Web SDK, please do not use ‘%’.

callback

Send a notification of the result of a broadcast message. Required: No. Caution: Passing [nil] means not receiving callback notifications.

Declared In

ZegoExpressEngine+IM.h

– sendBarrageMessage:roomID:callback:

The content of the message. Required: Yes. Value range: The length does not exceed 1024 bytes.

- (void)sendBarrageMessage:(NSString *)message roomID:(NSString *)roomID callback:(nullable ZegoIMSendBarrageMessageCallback)callback

Parameters

message

The content of the message. Required: Yes. Value range: The length does not exceed 1024 bytes.

roomID

Room ID, a string of up to 128 bytes in length. Caution: 1. room ID is defined by yourself. 2. Only support numbers, English characters and ‘~’, ‘!’, ‘@’, ‘#’, ‘$’, ‘%’, ‘^’, ‘&’, ‘*’, ‘(’, ‘)’, ‘_’, ‘+’, ‘=’, ‘-’, ‘`’, ‘;’, ‘’’, ‘,’, ‘.’, ‘<’, ‘>’, ‘/’, ‘\’. 3. If you need to communicate with the Web SDK, please do not use ‘%’.

callback

Send barrage message result callback.Required: No. Caution: Passing [nil] means not receiving callback notifications.

Declared In

ZegoExpressEngine+IM.h

– sendCustomCommand:toUserList:roomID:callback:

Custom command content. Required: Yes. Value range: The maximum length is 1024 bytes. Caution: To protect privacy, please do not fill in sensitive user information in this interface, including but not limited to mobile phone number, ID number, passport number, real name, etc.

- (void)sendCustomCommand:(NSString *)command toUserList:(nullable NSArray<ZegoUser*> *)toUserList roomID:(NSString *)roomID callback:(nullable ZegoIMSendCustomCommandCallback)callback

Parameters

command

Custom command content. Required: Yes. Value range: The maximum length is 1024 bytes. Caution: To protect privacy, please do not fill in sensitive user information in this interface, including but not limited to mobile phone number, ID number, passport number, real name, etc.

toUserList

List of recipients of signaling. Required: Yes. Value range: user list or [nil]. Caution: When it is [nil], the SDK will send custom signaling back to all users in the room

roomID

Room ID, a string of up to 128 bytes in length. Caution: 1. room ID is defined by yourself. 2. Only support numbers, English characters and ‘~’, ‘!’, ‘@’, ‘#’, ‘$’, ‘%’, ‘^’, ‘&’, ‘*’, ‘(’, ‘)’, ‘_’, ‘+’, ‘=’, ‘-’, ‘`’, ‘;’, ‘’’, ‘,’, ‘.’, ‘<’, ‘>’, ‘/’, ‘\’. 3. If you need to communicate with the Web SDK, please do not use ‘%’.

callback

Send a notification of the signaling result. Required: No. Caution: Passing [nil] means not receiving callback notifications.

Declared In

ZegoExpressEngine+IM.h

– sendTransparentMessage:roomID:callback:

- (void)sendTransparentMessage:(ZegoRoomSendTransparentMessage *)message roomID:(NSString *)roomID callback:(nullable ZegoRoomSendTransparentMessageCallback)callback

Parameters

message

ZegoRoomSendTransparentMessage

roomID

Room ID, a string of up to 128 bytes in length. Caution: 1. room ID is defined by yourself. 2. Only support numbers, English characters and ‘~’, ‘!’, ‘@’, ‘#’, ‘$’, ‘%’, ‘^’, ‘&’, ‘*’, ‘(’, ‘)’, ‘_’, ‘+’, ‘=’, ‘-’, ‘`’, ‘;’, ‘’’, ‘,’, ‘.’, ‘<’, ‘>’, ‘/’, ‘\’. 3. If you need to communicate with the Web SDK, please do not use ‘%’.

callback

Send a notification of the signaling result. Required: No. Caution: Passing [nil] means not receiving callback notifications.

Declared In

ZegoExpressEngine+IM.h

MediaDataPublisher Methods

– createMediaDataPublisher:

Config the media data publisher.

- (nullable ZegoMediaDataPublisher *)createMediaDataPublisher:(ZegoMediaDataPublisherConfig *)config

Parameters

config

Config the media data publisher.

Return Value

Media data publisher instance.

Declared In

ZegoExpressEngine+MediaDataPublisher.h

– destroyMediaDataPublisher:

The media data publisher instance object to be destroyed

- (void)destroyMediaDataPublisher:(ZegoMediaDataPublisher *)mediaDataPublisher

Parameters

mediaDataPublisher

The media data publisher instance object to be destroyed

Declared In

ZegoExpressEngine+MediaDataPublisher.h

Mixer Methods

– startMixerTask:callback:

Mixing task object. Required: Yes.

- (void)startMixerTask:(ZegoMixerTask *)task callback:(nullable ZegoMixerStartCallback)callback

Parameters

task

Mixing task object. Required: Yes.

callback

Start notification of mixing task results.Required: No. Caution: Passing [nil] means not receiving callback notifications.

Declared In

ZegoExpressEngine+Mixer.h

– stopMixerTask:callback:

Mixing task object. Required: Yes.

- (void)stopMixerTask:(ZegoMixerTask *)task callback:(nullable ZegoMixerStopCallback)callback

Parameters

task

Mixing task object. Required: Yes.

callback

Stop stream mixing task result callback notification.Required: No. Caution: Passing [nil] means not receiving callback notifications.

Declared In

ZegoExpressEngine+Mixer.h

– startAutoMixerTask:callback:

Auto mix stream task object

- (void)startAutoMixerTask:(ZegoAutoMixerTask *)task callback:(nullable ZegoMixerStartCallback)callback

Parameters

task

Auto mix stream task object

callback

Start auto mix stream task result callback notification

Declared In

ZegoExpressEngine+Mixer.h

– stopAutoMixerTask:callback:

Auto mix stream task object

- (void)stopAutoMixerTask:(ZegoAutoMixerTask *)task callback:(nullable ZegoMixerStopCallback)callback

Parameters

task

Auto mix stream task object

callback

Stop auto mix stream task result callback notification

Declared In

ZegoExpressEngine+Mixer.h

Record Methods

– startRecordingCapturedData:channel:

Record config.

- (void)startRecordingCapturedData:(ZegoDataRecordConfig *)config channel:(ZegoPublishChannel)channel

Parameters

config

Record config.

channel

Publishing stream channel.

Declared In

ZegoExpressEngine+Record.h

– stopRecordingCapturedData:

Publishing stream channel.

- (void)stopRecordingCapturedData:(ZegoPublishChannel)channel

Parameters

channel

Publishing stream channel.

Declared In

ZegoExpressEngine+Record.h

– setDataRecordEventHandler:

Data record event handler.

- (void)setDataRecordEventHandler:(nullable id<ZegoDataRecordEventHandler>)eventHandler

Parameters

eventHandler

Data record event handler.

Declared In

ZegoExpressEngine+Record.h

ReplayKit Methods

– prepareForReplayKit

Only use in the ReplayKit sub-process, don’t use it in the main App process Note: This function is only available in ZegoExpressVideo SDK!

- (void)prepareForReplayKit

Declared In

ZegoExpressEngine+ReplayKit.h

– setReplayKitMicrophoneVolume:

The range is 0 ~ 200. The default is 100.

- (void)setReplayKitMicrophoneVolume:(int)volume

Parameters

volume

The range is 0 ~ 200. The default is 100.

Declared In

ZegoExpressEngine+ReplayKit.h

– setReplayKitApplicationVolume:

The range is 0 ~ 200. The default is 100.

- (void)setReplayKitApplicationVolume:(int)volume

Parameters

volume

The range is 0 ~ 200. The default is 100.

Declared In

ZegoExpressEngine+ReplayKit.h

– handleReplayKitSampleBuffer:bufferType:

Video or audio buffer returned by ReplayKit

- (void)handleReplayKitSampleBuffer:(CMSampleBufferRef)sampleBuffer bufferType:(RPSampleBufferType)bufferType

Parameters

sampleBuffer

Video or audio buffer returned by ReplayKit

bufferType

Buffer type returned by ReplayKit

Declared In

ZegoExpressEngine+ReplayKit.h

Preprocess Methods

– setLowlightEnhancement:channel:

Low light enhancement mode.

- (void)setLowlightEnhancement:(ZegoLowlightEnhancementMode)mode channel:(ZegoPublishChannel)channel

Parameters

mode

Low light enhancement mode.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Preprocess.h

– enableAEC:

Whether to enable echo cancellation, YES: enable, NO: disable

- (void)enableAEC:(BOOL)enable

Parameters

enable

Whether to enable echo cancellation, YES: enable, NO: disable

Declared In

ZegoExpressEngine+Preprocess.h

– enableHeadphoneAEC:

Whether to enable, YES: enable, NO: disable

- (void)enableHeadphoneAEC:(BOOL)enable

Parameters

enable

Whether to enable, YES: enable, NO: disable

Declared In

ZegoExpressEngine+Preprocess.h

– setAECMode:

Echo cancellation mode

- (void)setAECMode:(ZegoAECMode)mode

Parameters

mode

Echo cancellation mode

Declared In

ZegoExpressEngine+Preprocess.h

– enableAGC:

Whether to enable automatic gain control, YES: enable, NO: disable

- (void)enableAGC:(BOOL)enable

Parameters

enable

Whether to enable automatic gain control, YES: enable, NO: disable

Declared In

ZegoExpressEngine+Preprocess.h

– enableANS:

Whether to enable noise suppression, YES: enable, NO: disable

- (void)enableANS:(BOOL)enable

Parameters

enable

Whether to enable noise suppression, YES: enable, NO: disable

Declared In

ZegoExpressEngine+Preprocess.h

– enableTransientANS:

Whether to enable transient noise suppression, YES: enable, NO: disable

- (void)enableTransientANS:(BOOL)enable

Parameters

enable

Whether to enable transient noise suppression, YES: enable, NO: disable

Declared In

ZegoExpressEngine+Preprocess.h

– setANSMode:

Audio Noise Suppression mode

- (void)setANSMode:(ZegoANSMode)mode

Parameters

mode

Audio Noise Suppression mode

Declared In

ZegoExpressEngine+Preprocess.h

– enableSpeechEnhance:level:

Whether to enable speech enhancement, YES: enable, NO: disable

- (void)enableSpeechEnhance:(BOOL)enable level:(int)level

Parameters

enable

Whether to enable speech enhancement, YES: enable, NO: disable

level

Enhancement level; The value range is [0, 10]

Declared In

ZegoExpressEngine+Preprocess.h

– enableAudioMixing:

Whether to enable audio mixting, YES: enable, NO: disable

- (void)enableAudioMixing:(BOOL)enable

Parameters

enable

Whether to enable audio mixting, YES: enable, NO: disable

Declared In

ZegoExpressEngine+Preprocess.h

– setAudioMixingHandler:

Audio mixing callback handler

- (void)setAudioMixingHandler:(nullable id<ZegoAudioMixingHandler>)handler

Parameters

handler

Audio mixing callback handler

Declared In

ZegoExpressEngine+Preprocess.h

– muteLocalAudioMixing:

Whether to mute local audio mixting, YES: mute, NO: unmute

- (void)muteLocalAudioMixing:(BOOL)mute

Parameters

mute

Whether to mute local audio mixting, YES: mute, NO: unmute

Declared In

ZegoExpressEngine+Preprocess.h

– setAudioMixingVolume:

The audio mixing volume, range from 0 to 200, 100 as default.

- (void)setAudioMixingVolume:(int)volume

Parameters

volume

The audio mixing volume, range from 0 to 200, 100 as default.

Declared In

ZegoExpressEngine+Preprocess.h

– setAudioMixingVolume:type:

The audio mixing volume, range from 0 to 200, 100 as default.

- (void)setAudioMixingVolume:(int)volume type:(ZegoVolumeType)type

Parameters

volume

The audio mixing volume, range from 0 to 200, 100 as default.

type

Local playback volume / Remote playback volume

Declared In

ZegoExpressEngine+Preprocess.h

– startEffectsEnv

Available since: 2.16.0 Description: Enable the Effects beauty environment. The SDK uses the specified video frame data type for transmission. The Windows platform only supports video frame raw data, the Apple platform only supports CVPixelBuffer, and the Android platform only supports texture2d. Use cases: It is often used in scenes such as video calls and live broadcasts. Default value: When this function is not called, the beauty environment is not activated by default. When to call: Must be called before calling [startPreview], [startPublishingStream]. If you need to modify the configuration, please call [logoutRoom] to log out of the room first, otherwise it will not take effect. Related APIs: [enableEffectsBeauty] switch beauty, [setEffectsBeautyParam] set beauty parameters. Caution: This beauty function is the basic function. If it does not meet the expectations of the developer, you can use the custom video pre-processing function [enableCustomVideoProcessing] or the custom video capture function [enableCustomVideoCapture] docking and constructing the AI ​​Effects SDK [ZegoEffects] https://doc-zh.zego.im/article/9556 for best results. Restrictions: This function only supports Android system 5.0 and above, Android SDK version 21 and above. Note: This function is only available in ZegoExpressVideo SDK!

- (void)startEffectsEnv

Declared In

ZegoExpressEngine+Preprocess.h

– stopEffectsEnv

Available since: 2.16.0 Description: Disable the Effects beauty environment. Use cases: It is often used in scenes such as video calls and live broadcasts. When to call: Must be called before calling [startPreview], [startPublishingStream]. If you need to modify the configuration, please call [logoutRoom] to log out of the room first, otherwise it will not take effect. Related APIs: [enableEffectsBeauty] switch beauty, [setEffectsBeautyParam] set beauty parameters. Caution: This beauty function is the basic function. If it does not meet the expectations of the developer, you can use the custom video pre-processing function [enableCustomVideoProcessing] or the custom video capture function [enableCustomVideoCapture] docking and constructing the AI ​​Effects SDK [ZegoEffects] for best results. Restrictions: This function only supports Android system 5.0 and above, Android SDK version 21 and above. Note: This function is only available in ZegoExpressVideo SDK!

- (void)stopEffectsEnv

Declared In

ZegoExpressEngine+Preprocess.h

– enableEffectsBeauty:

Whether to enable the beauty effect, YES is enabled; NO is disabled, and the default is NO.

- (void)enableEffectsBeauty:(BOOL)enable

Parameters

enable

Whether to enable the beauty effect, YES is enabled; NO is disabled, and the default is NO.

Declared In

ZegoExpressEngine+Preprocess.h

– setEffectsBeautyParam:

Beauty option param.

- (void)setEffectsBeautyParam:(ZegoEffectsBeautyParam *)param

Parameters

param

Beauty option param.

Declared In

ZegoExpressEngine+Preprocess.h

– setAudioEqualizerGain:bandGain:

Band frequency index, the value range is [0, 9], corresponding to 10 frequency bands, and the center frequencies are [31, 62, 125, 250, 500, 1K, 2K, 4K, 8K, 16K] Hz.

- (void)setAudioEqualizerGain:(int)bandIndex bandGain:(float)bandGain

Parameters

bandIndex

Band frequency index, the value range is [0, 9], corresponding to 10 frequency bands, and the center frequencies are [31, 62, 125, 250, 500, 1K, 2K, 4K, 8K, 16K] Hz.

bandGain

Band gain for the index, the value range is [-15, 15]. Default value is 0, if all gain values in all frequency bands are 0, EQ function will be disabled.

Declared In

ZegoExpressEngine+Preprocess.h

– setVoiceChangerPreset:

The voice changer preset enumeration.

- (void)setVoiceChangerPreset:(ZegoVoiceChangerPreset)preset

Parameters

preset

The voice changer preset enumeration.

Declared In

ZegoExpressEngine+Preprocess.h

– setVoiceChangerParam:

Voice changer parameters.

- (void)setVoiceChangerParam:(ZegoVoiceChangerParam *)param

Parameters

param

Voice changer parameters.

Declared In

ZegoExpressEngine+Preprocess.h

– setReverbPreset:

The reverberation preset enumeration.

- (void)setReverbPreset:(ZegoReverbPreset)preset

Parameters

preset

The reverberation preset enumeration.

Declared In

ZegoExpressEngine+Preprocess.h

– setReverbAdvancedParam:

Reverb advanced parameter.

- (void)setReverbAdvancedParam:(ZegoReverbAdvancedParam *)param

Parameters

param

Reverb advanced parameter.

Declared In

ZegoExpressEngine+Preprocess.h

– setReverbEchoParam:

The reverberation echo parameter.

- (void)setReverbEchoParam:(ZegoReverbEchoParam *)param

Parameters

param

The reverberation echo parameter.

Declared In

ZegoExpressEngine+Preprocess.h

– enableVirtualStereo:angle:

YES to turn on the virtual stereo, NO to turn off the virtual stereo.

- (void)enableVirtualStereo:(BOOL)enable angle:(int)angle

Parameters

enable

YES to turn on the virtual stereo, NO to turn off the virtual stereo.

angle

The angle of the sound source in virtual stereo in the range of -1 ~ 360, with 90 being directly in front, 0 / 180 / 270 corresponding to the rightmost and leftmost respectively. In particular, when set to -1, it is all round virtual stereo effects.

Declared In

ZegoExpressEngine+Preprocess.h

– enablePlayStreamVirtualStereo:angle:streamID:

YES to turn on the virtual stereo, NO to turn off the virtual stereo.

- (void)enablePlayStreamVirtualStereo:(BOOL)enable angle:(int)angle streamID:(NSString *)streamID

Parameters

enable

YES to turn on the virtual stereo, NO to turn off the virtual stereo.

angle

The angle of the sound source in virtual stereo in the range of 0 ~ 360, with 90 being directly in front, 0 / 180 / 270 corresponding to the rightmost and leftmost respectively.

streamID

Stream ID.

Declared In

ZegoExpressEngine+Preprocess.h

– setElectronicEffects:mode:tonal:

YES to turn on the electronic sound effect, NO to turn off the electronic sound effect.

- (void)setElectronicEffects:(BOOL)enable mode:(ZegoElectronicEffectsMode)mode tonal:(int)tonal

Parameters

enable

YES to turn on the electronic sound effect, NO to turn off the electronic sound effect.

mode

Mode of Electronic Effects reference.

tonal

The starting pitch of an electric tone in a given mode, representing 12 semitones in one octave of the sound, in the range [0, 11].

Declared In

ZegoExpressEngine+Preprocess.h

– enableColorEnhancement:params:channel:

Whether to enable, YES: enable, NO: disable

- (void)enableColorEnhancement:(BOOL)enable params:(ZegoColorEnhancementParams *)params channel:(ZegoPublishChannel)channel

Parameters

enable

Whether to enable, YES: enable, NO: disable

params

Color enhancement parameters.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Preprocess.h

– enableBeautify:

Deprecated since 2.16.0, please use the [enableEffectsBeauty] function instead. (Deprecated: Deprecated since 2.16.0, please use the [enableEffectsBeauty] function instead.)

- (void)enableBeautify:(ZegoBeautifyFeature)featureBitmask

Parameters

featureBitmask

Beauty features, bitmask format, you can choose to enable several features in [ZegoBeautifyFeature] at the same time

Declared In

ZegoExpressEngine+Preprocess.h

– enableBeautify:channel:

Deprecated since 2.16.0, please use the [enableEffectsBeauty] function instead. (Deprecated: Deprecated since 2.16.0, please use the [enableEffectsBeauty] function instead.)

- (void)enableBeautify:(ZegoBeautifyFeature)featureBitmask channel:(ZegoPublishChannel)channel

Parameters

featureBitmask

Beauty features, bitmask format, you can choose to enable several features in [ZegoBeautifyFeature] at the same time

channel

Publishing stream channel

Declared In

ZegoExpressEngine+Preprocess.h

– setBeautifyOption:

Deprecated since 2.16.0, please use the [setEffectsBeautyParam] function instead. (Deprecated: Deprecated since 2.16.0, please use the [setEffectsBeautyParam] function instead.)

- (void)setBeautifyOption:(ZegoBeautifyOption *)option

Parameters

option

Beautify option.

Declared In

ZegoExpressEngine+Preprocess.h

– setBeautifyOption:channel:

Deprecated since 2.16.0, please use the [setEffectsBeautyParam] function instead. (Deprecated: Deprecated since 2.16.0, please use the [setEffectsBeautyParam] function instead.)

- (void)setBeautifyOption:(ZegoBeautifyOption *)option channel:(ZegoPublishChannel)channel

Parameters

option

Beautify option.

channel

stream publish channel.

Declared In

ZegoExpressEngine+Preprocess.h

Device Methods

– muteMicrophone:

Whether to mute (disable) the microphone, YES: mute (disable) microphone, NO: enable microphone.

- (void)muteMicrophone:(BOOL)mute

Parameters

mute

Whether to mute (disable) the microphone, YES: mute (disable) microphone, NO: enable microphone.

Declared In

ZegoExpressEngine+Device.h

– isMicrophoneMuted

Whether the microphone is muted; YES: the microphone is muted; NO: the microphone is enable (not muted).

- (BOOL)isMicrophoneMuted

Return Value

Whether the microphone is muted; YES: the microphone is muted; NO: the microphone is enable (not muted).

Declared In

ZegoExpressEngine+Device.h

– muteSpeaker:

Whether to mute (disable) speaker audio output, YES: mute (disable) speaker audio output, NO: enable speaker audio output.

- (void)muteSpeaker:(BOOL)mute

Parameters

mute

Whether to mute (disable) speaker audio output, YES: mute (disable) speaker audio output, NO: enable speaker audio output.

Declared In

ZegoExpressEngine+Device.h

– isSpeakerMuted

Whether the speaker is muted; YES: the speaker is muted; NO: the speaker is enable (not muted).

- (BOOL)isSpeakerMuted

Return Value

Whether the speaker is muted; YES: the speaker is muted; NO: the speaker is enable (not muted).

Declared In

ZegoExpressEngine+Device.h

– getAudioDeviceList:

Audio device type

- (NSArray<ZegoDeviceInfo*> *)getAudioDeviceList:(ZegoAudioDeviceType)deviceType

Parameters

deviceType

Audio device type

Return Value

Audo device List

Declared In

ZegoExpressEngine+Device.h

– getDefaultAudioDeviceID:

Audio device type

- (NSString *)getDefaultAudioDeviceID:(ZegoAudioDeviceType)deviceType

Parameters

deviceType

Audio device type

Return Value

Default Audio device ID

Declared In

ZegoExpressEngine+Device.h

– useAudioDevice:deviceType:

ID of a device obtained by [getAudioDeviceList]

- (void)useAudioDevice:(NSString *)deviceID deviceType:(ZegoAudioDeviceType)deviceType

Parameters

deviceID

ID of a device obtained by [getAudioDeviceList]

deviceType

Audio device type

Declared In

ZegoExpressEngine+Device.h

– getAudioDeviceVolume:deviceType:

ID of a device obtained by [getAudioDeviceList]

- (int)getAudioDeviceVolume:(NSString *)deviceID deviceType:(ZegoAudioDeviceType)deviceType

Parameters

deviceID

ID of a device obtained by [getAudioDeviceList]

deviceType

Audio device type

Return Value

Device volume

Declared In

ZegoExpressEngine+Device.h

– setAudioDeviceVolume:deviceType:volume:

ID of a device obtained by [getAudioDeviceList]

- (void)setAudioDeviceVolume:(NSString *)deviceID deviceType:(ZegoAudioDeviceType)deviceType volume:(int)volume

Parameters

deviceID

ID of a device obtained by [getAudioDeviceList]

deviceType

Audio device type

volume

Device volume

Declared In

ZegoExpressEngine+Device.h

– startAudioDeviceVolumeMonitor:deviceType:

ID of a device obtained by [getAudioDeviceList]

- (void)startAudioDeviceVolumeMonitor:(NSString *)deviceID deviceType:(ZegoAudioDeviceType)deviceType

Parameters

deviceID

ID of a device obtained by [getAudioDeviceList]

deviceType

Audio device type

Declared In

ZegoExpressEngine+Device.h

– stopAudioDeviceVolumeMonitor:deviceType:

ID of a device obtained by [getAudioDeviceList]

- (void)stopAudioDeviceVolumeMonitor:(NSString *)deviceID deviceType:(ZegoAudioDeviceType)deviceType

Parameters

deviceID

ID of a device obtained by [getAudioDeviceList]

deviceType

Audio device type

Declared In

ZegoExpressEngine+Device.h

– muteAudioDevice:deviceType:mute:

ID of a device obtained by [getAudioDeviceList]

- (void)muteAudioDevice:(NSString *)deviceID deviceType:(ZegoAudioDeviceType)deviceType mute:(BOOL)mute

Parameters

deviceID

ID of a device obtained by [getAudioDeviceList]

deviceType

Audio device type

mute

Whether to mute the audio device; YES means to mute the audio device; NO means to unmute the audio device.

Declared In

ZegoExpressEngine+Device.h

– setAudioDeviceMode:

Audio device mode

- (void)setAudioDeviceMode:(ZegoAudioDeviceMode)deviceMode

Parameters

deviceMode

Audio device mode

Declared In

ZegoExpressEngine+Device.h

– isAudioDeviceMuted:deviceType:

ID of a device obtained by [getAudioDeviceList]

- (BOOL)isAudioDeviceMuted:(NSString *)deviceID deviceType:(ZegoAudioDeviceType)deviceType

Parameters

deviceID

ID of a device obtained by [getAudioDeviceList]

deviceType

Audio device type

Return Value

Whether the audio device is muted; YES means the audio device is muted; NO means the audio device is not muted.

Declared In

ZegoExpressEngine+Device.h

– enableAudioCaptureDevice:

Whether to enable the audio capture device, YES: enable audio capture device, NO: disable audio capture device.

- (void)enableAudioCaptureDevice:(BOOL)enable

Parameters

enable

Whether to enable the audio capture device, YES: enable audio capture device, NO: disable audio capture device.

Declared In

ZegoExpressEngine+Device.h

– getAudioRouteType

Available since: 1.1.0 Description: Audio routing refers to the audio output device that an app uses to play audio, and common audio routes are: speakers, handsets, headphones, Bluetooth devices, and so on. When to call: After creating the engine [createEngine]. Restrictions: Not supported under win or mac platforms. Related APIs: Set audio route to speaker [setAudioRouteToSpeaker].

- (ZegoAudioRoute)getAudioRouteType

Declared In

ZegoExpressEngine+Device.h

– setAudioRouteToSpeaker:

Whether to use the built-in speaker to play sound, YES: use the built-in speaker to play sound, NO: use the highest priority audio output device scheduled by the current system to play sound

- (void)setAudioRouteToSpeaker:(BOOL)defaultToSpeaker

Parameters

defaultToSpeaker

Whether to use the built-in speaker to play sound, YES: use the built-in speaker to play sound, NO: use the highest priority audio output device scheduled by the current system to play sound

Declared In

ZegoExpressEngine+Device.h

– enableCamera:

Whether to turn on the camera, YES: turn on camera, NO: turn off camera

- (void)enableCamera:(BOOL)enable

Parameters

enable

Whether to turn on the camera, YES: turn on camera, NO: turn off camera

Declared In

ZegoExpressEngine+Device.h

– enableCamera:channel:

Whether to turn on the camera, YES: turn on camera, NO: turn off camera

- (void)enableCamera:(BOOL)enable channel:(ZegoPublishChannel)channel

Parameters

enable

Whether to turn on the camera, YES: turn on camera, NO: turn off camera

channel

Publishing stream channel

Declared In

ZegoExpressEngine+Device.h

– useFrontCamera:

Whether to use the front camera, YES: use the front camera, NO: use the the rear camera.

- (void)useFrontCamera:(BOOL)enable

Parameters

enable

Whether to use the front camera, YES: use the front camera, NO: use the the rear camera.

Declared In

ZegoExpressEngine+Device.h

– useFrontCamera:channel:

Whether to use the front camera, YES: use the front camera, NO: use the the rear camera.

- (void)useFrontCamera:(BOOL)enable channel:(ZegoPublishChannel)channel

Parameters

enable

Whether to use the front camera, YES: use the front camera, NO: use the the rear camera.

channel

Publishing stream channel

Declared In

ZegoExpressEngine+Device.h

– isCameraFocusSupported:

Publishing stream channel

- (BOOL)isCameraFocusSupported:(ZegoPublishChannel)channel

Parameters

channel

Publishing stream channel

Return Value

Whether to support focus, support is YES, not support is NO.

Declared In

ZegoExpressEngine+Device.h

– setCameraFocusMode:channel:

focus mode.

- (void)setCameraFocusMode:(ZegoCameraFocusMode)mode channel:(ZegoPublishChannel)channel

Parameters

mode

focus mode.

channel

Publishing stream channel

Declared In

ZegoExpressEngine+Device.h

– setCameraFocusPointInPreviewX:y:channel:

Normalized X axis coordinate value, effective value [0,1].

- (void)setCameraFocusPointInPreviewX:(float)x y:(float)y channel:(ZegoPublishChannel)channel

Parameters

x

Normalized X axis coordinate value, effective value [0,1].

y

Normalized Y axis coordinate value, effective value [0,1].

channel

Publishing stream channel

Declared In

ZegoExpressEngine+Device.h

– setCameraExposureMode:channel:

Exposure mode.

- (void)setCameraExposureMode:(ZegoCameraExposureMode)mode channel:(ZegoPublishChannel)channel

Parameters

mode

Exposure mode.

channel

Publishing stream channel

Declared In

ZegoExpressEngine+Device.h

– setCameraExposurePointInPreviewX:y:channel:

Normalized X axis coordinate value, effective value [0,1].

- (void)setCameraExposurePointInPreviewX:(float)x y:(float)y channel:(ZegoPublishChannel)channel

Parameters

x

Normalized X axis coordinate value, effective value [0,1].

y

Normalized Y axis coordinate value, effective value [0,1].

channel

Publishing stream channel

Declared In

ZegoExpressEngine+Device.h

– setCameraExposureCompensation:

Camera exposure, the value range is [-1,1], the default 0, -1 tends to darken, 1 tends to brighten.

- (void)setCameraExposureCompensation:(float)value

Parameters

value

Camera exposure, the value range is [-1,1], the default 0, -1 tends to darken, 1 tends to brighten.

Declared In

ZegoExpressEngine+Device.h

– setCameraExposureCompensation:channel:

Camera exposure, the value range is [-1,1], the default 0, -1 tends to darken, 1 tends to brighten.

- (void)setCameraExposureCompensation:(float)value channel:(ZegoPublishChannel)channel

Parameters

value

Camera exposure, the value range is [-1,1], the default 0, -1 tends to darken, 1 tends to brighten.

channel

Publishing stream channel

Declared In

ZegoExpressEngine+Device.h

– setCameraZoomFactor:

The zoom factor of the camera, the minimum value is 1.0, and the maximum value is the return value of [getCameraMaxZoomFactor].

- (void)setCameraZoomFactor:(float)factor

Parameters

factor

The zoom factor of the camera, the minimum value is 1.0, and the maximum value is the return value of [getCameraMaxZoomFactor].

Declared In

ZegoExpressEngine+Device.h

– setCameraZoomFactor:channel:

The zoom factor of the camera, the minimum value is 1.0, and the maximum value is the return value of [getCameraMaxZoomFactor].

- (void)setCameraZoomFactor:(float)factor channel:(ZegoPublishChannel)channel

Parameters

factor

The zoom factor of the camera, the minimum value is 1.0, and the maximum value is the return value of [getCameraMaxZoomFactor].

channel

Publishing stream channel

Declared In

ZegoExpressEngine+Device.h

– getCameraMaxZoomFactor

The maximum zoom factor of the camera.

- (float)getCameraMaxZoomFactor

Return Value

The maximum zoom factor of the camera.

Declared In

ZegoExpressEngine+Device.h

– getCameraMaxZoomFactor:

Publishing stream channel

- (float)getCameraMaxZoomFactor:(ZegoPublishChannel)channel

Parameters

channel

Publishing stream channel

Return Value

The maximum zoom factor of the camera.

Declared In

ZegoExpressEngine+Device.h

– enableCameraAdaptiveFPS:minFPS:maxFPS:channel:

Whether to enable camera adaptive frame rate. YES means on, NO means off.Off by default.

- (void)enableCameraAdaptiveFPS:(BOOL)enable minFPS:(int)minFPS maxFPS:(int)maxFPS channel:(ZegoPublishChannel)channel

Parameters

enable

Whether to enable camera adaptive frame rate. YES means on, NO means off.Off by default.

minFPS

Desired minimum frame rate, 15 recommended. Unit: fps.

maxFPS

Desired minimum frame rate, 25 recommended. Unit: fps.

channel

Publishing stream channel.

Declared In

ZegoExpressEngine+Device.h

– useVideoDevice:

ID of a device obtained by [getVideoDeviceList]

- (void)useVideoDevice:(NSString *)deviceID

Parameters

deviceID

ID of a device obtained by [getVideoDeviceList]

Declared In

ZegoExpressEngine+Device.h

– useVideoDevice:channel:

ID of a device obtained by [getVideoDeviceList]

- (void)useVideoDevice:(NSString *)deviceID channel:(ZegoPublishChannel)channel

Parameters

deviceID

ID of a device obtained by [getVideoDeviceList]

channel

Publishing stream channel

Declared In

ZegoExpressEngine+Device.h

– getVideoDeviceList

Video device List

- (NSArray<ZegoDeviceInfo*> *)getVideoDeviceList

Return Value

Video device List

Declared In

ZegoExpressEngine+Device.h

– getDefaultVideoDeviceID

Default video device ID

- (NSString *)getDefaultVideoDeviceID

Return Value

Default video device ID

Declared In

ZegoExpressEngine+Device.h

– startSoundLevelMonitor

Available since: 1.1.0 Description: After starting monitoring, you can receive local audio sound level via [onCapturedSoundLevelUpdate] callback, and receive remote audio sound level via [onRemoteSoundLevelUpdate] callback. Before entering the room, you can call [startPreview] with this function and combine it with [onCapturedSoundLevelUpdate] callback to determine whether the audio device is working properly. Use cases: During the publishing and playing process, determine who is talking on the wheat and do a UI presentation, in the host K song scene, has been published or played under the premise that the host or audience to see the tone and volume change animation. When to call: After the engine is created [createEngine]. Caution: 1. [onCapturedSoundLevelUpdate] and [onRemoteSoundLevelUpdate] callback notification period is 100 ms. 2. After the sound monitoring is started, even if the local audio capture is not started, [onCapturedSoundLevelUpdate] will have a callback, and the sound level is 0.

- (void)startSoundLevelMonitor

Declared In

ZegoExpressEngine+Device.h

– startSoundLevelMonitor:

Monitoring time period of the sound level, in milliseconds, has a value range of [100, 3000]. Default is 100 ms.

- (void)startSoundLevelMonitor:(unsigned int)millisecond

Parameters

millisecond

Monitoring time period of the sound level, in milliseconds, has a value range of [100, 3000]. Default is 100 ms.

Declared In

ZegoExpressEngine+Device.h

– startSoundLevelMonitorWithConfig:

Configuration for starts the sound level monitor.

- (void)startSoundLevelMonitorWithConfig:(ZegoSoundLevelConfig *)config

Parameters

config

Configuration for starts the sound level monitor.

Declared In

ZegoExpressEngine+Device.h

– stopSoundLevelMonitor

Available since: 1.1.0 Description: After the monitoring is stopped, the callback of the local/remote audio sound level will be stopped. When to call: After the engine is created [createEngine]. Related APIs: Soundwave monitoring can be initiated via [startSoundLevelMonitor].

- (void)stopSoundLevelMonitor

Declared In

ZegoExpressEngine+Device.h

– startAudioSpectrumMonitor

Available since: 1.1.0 Description: After starting monitoring, you can receive local audio spectrum via [onCapturedAudioSpectrumUpdate] callback, and receive remote audio spectrum via [onRemoteAudioSpectrumUpdate] callback. Use cases: In the host K song scene, has been published or played under the premise that the host or audience to see the tone and volume change animation. When to call: After the engine is created [createEngine]. Caution: [onCapturedAudioSpectrumUpdate] and [onRemoteAudioSpectrumUpdate] callback notification period is 100 ms.

- (void)startAudioSpectrumMonitor

Declared In

ZegoExpressEngine+Device.h

– startAudioSpectrumMonitor:

Monitoring time period of the audio spectrum, in milliseconds, has a value range of [100, 3000]. Default is 100 ms.

- (void)startAudioSpectrumMonitor:(unsigned int)millisecond

Parameters

millisecond

Monitoring time period of the audio spectrum, in milliseconds, has a value range of [100, 3000]. Default is 100 ms.

Declared In

ZegoExpressEngine+Device.h

– stopAudioSpectrumMonitor

Available since: 1.1.0 Description: After the monitoring is stopped, the callback of the local/remote audio spectrum will be stopped. When to call: After the engine is created [createEngine]. Related APIs: Audio spectrum monitoring can be initiated via [startAudioSpectrumMonitor].

- (void)stopAudioSpectrumMonitor

Declared In

ZegoExpressEngine+Device.h

– enableHeadphoneMonitor:

Whether to use headphone monitor, YES: enable, NO: disable

- (void)enableHeadphoneMonitor:(BOOL)enable

Parameters

enable

Whether to use headphone monitor, YES: enable, NO: disable

Declared In

ZegoExpressEngine+Device.h

– setHeadphoneMonitorVolume:

headphone monitor volume, range from 0 to 200, 60 as default.

- (void)setHeadphoneMonitorVolume:(int)volume

Parameters

volume

headphone monitor volume, range from 0 to 200, 60 as default.

Declared In

ZegoExpressEngine+Device.h

– enableMixSystemPlayout:

Whether to mix system playout.

- (void)enableMixSystemPlayout:(BOOL)enable

Parameters

enable

Whether to mix system playout.

Declared In

ZegoExpressEngine+Device.h

– setMixSystemPlayoutVolume:

the volume. Valid range [0, 200], default is 100.

- (void)setMixSystemPlayoutVolume:(int)volume

Parameters

volume

the volume. Valid range [0, 200], default is 100.

Declared In

ZegoExpressEngine+Device.h

– enableMixEnginePlayout:

Whether to mix engine playout

- (void)enableMixEnginePlayout:(BOOL)enable

Parameters

enable

Whether to mix engine playout

Declared In

ZegoExpressEngine+Device.h

– startAudioVADStableStateMonitor:

audio VAD monitor type.

- (void)startAudioVADStableStateMonitor:(ZegoAudioVADStableStateMonitorType)type

Parameters

type

audio VAD monitor type.

Declared In

ZegoExpressEngine+Device.h

– startAudioVADStableStateMonitor:millisecond:

audio VAD monitor type.

- (void)startAudioVADStableStateMonitor:(ZegoAudioVADStableStateMonitorType)type millisecond:(int)millisecond

Parameters

type

audio VAD monitor type.

millisecond

monitoring period default 3000. value of [200, 10000]

Declared In

ZegoExpressEngine+Device.h

– stopAudioVADStableStateMonitor:

audio VAD monitor type.

- (void)stopAudioVADStableStateMonitor:(ZegoAudioVADStableStateMonitorType)type

Parameters

type

audio VAD monitor type.

Declared In

ZegoExpressEngine+Device.h

– getCurrentAudioDevice:

Audio device type.Required:Yes.

- (ZegoDeviceInfo *)getCurrentAudioDevice:(ZegoAudioDeviceType)deviceType

Parameters

deviceType

Audio device type.Required:Yes.

Return Value

Audio device information.

Declared In

ZegoExpressEngine+Device.h

Player Methods

– startPlayingStream:canvas:

Stream ID, a string of up to 256 characters. Caution: Only support numbers, English characters and ‘-’, ‘_’.

- (void)startPlayingStream:(NSString *)streamID canvas:(nullable ZegoCanvas *)canvas

Parameters

streamID

Stream ID, a string of up to 256 characters. Caution: Only support numbers, English characters and ‘-’, ‘_’.

canvas

The view used to display the play audio and video stream’s image. When the view is set to [nil], no video is displayed, only audio is played.

Declared In

ZegoExpressEngine+Player.h

– startPlayingStream:canvas:config:

Stream ID, a string of up to 256 characters. Caution: Only support numbers, English characters and ‘-’, ‘_’.

- (void)startPlayingStream:(NSString *)streamID canvas:(nullable ZegoCanvas *)canvas config:(ZegoPlayerConfig *)config

Parameters

streamID

Stream ID, a string of up to 256 characters. Caution: Only support numbers, English characters and ‘-’, ‘_’.

canvas

The view used to display the play audio and video stream’s image. When the view is set to [nil], no video is displayed, only audio is played.

config

Advanced player configuration Room [roomID] in [ZegoPlayerConfig] is the login roomID.

Declared In

ZegoExpressEngine+Player.h

– startPlayingStream:

Stream ID, a string of up to 256 characters. Caution: Only support numbers, English characters and ‘-’, ‘_’.

- (void)startPlayingStream:(NSString *)streamID

Parameters

streamID

Stream ID, a string of up to 256 characters. Caution: Only support numbers, English characters and ‘-’, ‘_’.

Declared In

ZegoExpressEngine+Player.h

– startPlayingStream:config:

Stream ID, a string of up to 256 characters. Caution: Only support numbers, English characters and ‘-’, ‘_’.

- (void)startPlayingStream:(NSString *)streamID config:(ZegoPlayerConfig *)config

Parameters

streamID

Stream ID, a string of up to 256 characters. Caution: Only support numbers, English characters and ‘-’, ‘_’.

config

Advanced player configuration.

Declared In

ZegoExpressEngine+Player.h

– startPlayingStreamInScene:canvas:config:

Stream ID, a string of up to 256 characters. Caution: Only support numbers, English characters and ‘-’, ‘_’.

- (void)startPlayingStreamInScene:(NSString *)streamID canvas:(nullable ZegoCanvas *)canvas config:(ZegoScenePlayerConfig *)config

Parameters

streamID

Stream ID, a string of up to 256 characters. Caution: Only support numbers, English characters and ‘-’, ‘_’.

canvas

The view used to display the play audio and video stream’s image. When the view is set to [nil], no video is displayed, only audio is played.

config

Advanced scene player configuration.

Declared In

ZegoExpressEngine+Player.h

– startPlayingStreamInScene:config:

Stream ID, a string of up to 256 characters. Caution: Only support numbers, English characters and ‘-’, ‘_’.

- (void)startPlayingStreamInScene:(NSString *)streamID config:(ZegoScenePlayerConfig *)config

Parameters

streamID

Stream ID, a string of up to 256 characters. Caution: Only support numbers, English characters and ‘-’, ‘_’.

config

Advanced scene player configuration.

Declared In

ZegoExpressEngine+Player.h

– stopPlayingStream:

Stream ID.

- (void)stopPlayingStream:(NSString *)streamID

Parameters

streamID

Stream ID.

Declared In

ZegoExpressEngine+Player.h

– setPlayStreamDecryptionKey:streamID:

The decryption key, note that the key length only supports 16/24/32 bytes.

- (void)setPlayStreamDecryptionKey:(NSString *)key streamID:(NSString *)streamID

Parameters

key

The decryption key, note that the key length only supports 16/24/32 bytes.

streamID

Stream ID.

Declared In

ZegoExpressEngine+Player.h

– setPlayStreamCrossAppInfo:streamID:

Information for cross App playing stream.

- (void)setPlayStreamCrossAppInfo:(ZegoCrossAppInfo *)info streamID:(NSString *)streamID

Parameters

info

Information for cross App playing stream.

streamID

Stream ID.

Declared In

ZegoExpressEngine+Player.h

– takePlayStreamSnapshot:callback:

Stream ID to be snapshot.

- (void)takePlayStreamSnapshot:(NSString *)streamID callback:(ZegoPlayerTakeSnapshotCallback)callback

Parameters

streamID

Stream ID to be snapshot.

callback

Results of take play stream snapshot.

Declared In

ZegoExpressEngine+Player.h

– setPlayVolume:streamID:

Volume percentage. The value ranges from 0 to 200, and the default value is 100.

- (void)setPlayVolume:(int)volume streamID:(NSString *)streamID

Parameters

volume

Volume percentage. The value ranges from 0 to 200, and the default value is 100.

streamID

Stream ID.

Declared In

ZegoExpressEngine+Player.h

– setAllPlayStreamVolume:

Volume percentage. The value ranges from 0 to 200, and the default value is 100.

- (void)setAllPlayStreamVolume:(int)volume

Parameters

volume

Volume percentage. The value ranges from 0 to 200, and the default value is 100.

Declared In

ZegoExpressEngine+Player.h

– setPlayStreamVideoType:streamID:

Video stream type.

- (void)setPlayStreamVideoType:(ZegoVideoStreamType)streamType streamID:(NSString *)streamID

Parameters

streamType

Video stream type.

streamID

Stream ID.

Declared In

ZegoExpressEngine+Player.h

– setPlayStreamBufferIntervalRange:min:max:

Stream ID.

- (void)setPlayStreamBufferIntervalRange:(NSString *)streamID min:(unsigned int)min max:(unsigned int)max

Parameters

streamID

Stream ID.

min

The lower limit of the buffer adaptation interval, in milliseconds. The default value is 0ms.

max

The upper limit of the buffer adaptation interval, in milliseconds. The default value is 4000ms.

Declared In

ZegoExpressEngine+Player.h

– setPlayStreamFocusOn:

Stream ID.

- (void)setPlayStreamFocusOn:(NSString *)streamID

Parameters

streamID

Stream ID.

Declared In

ZegoExpressEngine+Player.h

– mutePlayStreamAudio:streamID:

Whether it can receive the audio data of the specified remote user when streaming, “YES” means prohibition, “NO” means receiving, the default value is “NO”.

- (void)mutePlayStreamAudio:(BOOL)mute streamID:(NSString *)streamID

Parameters

mute

Whether it can receive the audio data of the specified remote user when streaming, “YES” means prohibition, “NO” means receiving, the default value is “NO”.

streamID

Stream ID.

Declared In

ZegoExpressEngine+Player.h

– mutePlayStreamVideo:streamID:

Whether it is possible to receive the video data of the specified remote user when streaming, “YES” means prohibition, “NO” means receiving, the default value is “NO”. The default value for automatically played streams within the SDK is NO.

- (void)mutePlayStreamVideo:(BOOL)mute streamID:(NSString *)streamID

Parameters

mute

Whether it is possible to receive the video data of the specified remote user when streaming, “YES” means prohibition, “NO” means receiving, the default value is “NO”. The default value for automatically played streams within the SDK is NO.

streamID

Stream ID.

Declared In

ZegoExpressEngine+Player.h

– muteAllPlayStreamAudio:

Whether it is possible to receive audio data from all remote users when streaming, “YES” means prohibition, “NO” means receiving, and the default value is “NO”.

- (void)muteAllPlayStreamAudio:(BOOL)mute

Parameters

mute

Whether it is possible to receive audio data from all remote users when streaming, “YES” means prohibition, “NO” means receiving, and the default value is “NO”.

Declared In

ZegoExpressEngine+Player.h

– muteAllPlayAudioStreams:

Whether it is possible to receive audio data from all remote users when streaming, “YES” means prohibition, “NO” means receiving, and the default value is “NO”.

- (void)muteAllPlayAudioStreams:(BOOL)mute

Parameters

mute

Whether it is possible to receive audio data from all remote users when streaming, “YES” means prohibition, “NO” means receiving, and the default value is “NO”.

Declared In

ZegoExpressEngine+Player.h

– muteAllPlayStreamVideo:

Whether it is possible to receive all remote users' video data when streaming, “YES” means prohibition, “NO” means receiving, and the default value is “NO”.

- (void)muteAllPlayStreamVideo:(BOOL)mute

Parameters

mute

Whether it is possible to receive all remote users' video data when streaming, “YES” means prohibition, “NO” means receiving, and the default value is “NO”.

Declared In

ZegoExpressEngine+Player.h

– muteAllPlayVideoStreams:

Whether it is possible to receive all remote users' video data when streaming, “YES” means prohibition, “NO” means receiving, and the default value is “NO”.

- (void)muteAllPlayVideoStreams:(BOOL)mute

Parameters

mute

Whether it is possible to receive all remote users' video data when streaming, “YES” means prohibition, “NO” means receiving, and the default value is “NO”.

Declared In

ZegoExpressEngine+Player.h

– enableHardwareDecoder:

Whether to turn on hardware decoding switch, YES: enable hardware decoding, NO: disable hardware decoding.

- (void)enableHardwareDecoder:(BOOL)enable

Parameters

enable

Whether to turn on hardware decoding switch, YES: enable hardware decoding, NO: disable hardware decoding.

Declared In

ZegoExpressEngine+Player.h

– enableCheckPoc:

Whether to turn on frame order detection, YES: enable check poc, NO: disable check poc.

- (void)enableCheckPoc:(BOOL)enable

Parameters

enable

Whether to turn on frame order detection, YES: enable check poc, NO: disable check poc.

Declared In

ZegoExpressEngine+Player.h

– isVideoDecoderSupported:

Video codec id.Required: Yes.

- (BOOL)isVideoDecoderSupported:(ZegoVideoCodecID)codecID

Parameters

codecID

Video codec id.Required: Yes.

Return Value

Whether the specified video decoding format is supported; YES means supported, you can use this decoding format for playing stream; NO means not supported, the SDK does not recommend users to play streams of this encoding format. If users force the play, low frame rates may occur.

Declared In

ZegoExpressEngine+Player.h

– isVideoDecoderSupported:codecBackend:

Video codec id. Required: Yes.

- (int)isVideoDecoderSupported:(ZegoVideoCodecID)codecID codecBackend:(ZegoVideoCodecBackend)codecBackend

Parameters

codecID

Video codec id. Required: Yes.

codecBackend

Backend implementation of decoder. Required: Yes.

Return Value

Whether the specified video decoding format is supported; 0 means not supported, and the decoding format cannot be used for play stream; 1 means support, you can use this decoding format for playing stream; 2 means not confirmed, it is recommended to call this interface later.

Declared In

ZegoExpressEngine+Player.h

– setPlayStreamsAlignmentProperty:

Setting the stream alignment mode.

- (void)setPlayStreamsAlignmentProperty:(ZegoStreamAlignmentMode)mode

Parameters

mode

Setting the stream alignment mode.

Declared In

ZegoExpressEngine+Player.h

– enableVideoSuperResolution:enable:

The ID of the stream that currently needs to turn on or off overscore.

- (void)enableVideoSuperResolution:(NSString *)streamID enable:(BOOL)enable

Parameters

streamID

The ID of the stream that currently needs to turn on or off overscore.

enable

Whether to enable super resolution, it is not enabled by default.

Declared In

ZegoExpressEngine+Player.h

– initVideoSuperResolution

Available since: 3.3.0 Description: After the super resolution is initialized, the super resolution function can be used normally Use cases: Live streaming scenario. When to call: Video super resolution is only valid for playing stream video. Needs to be called after [createEngine]. Caution: 1. Initializing the video screen is divided into time-consuming operations, and frequent initialization and de-initialization are not recommended; 2. This function requires a special package, please contact ZEGO technical support.

- (void)initVideoSuperResolution

Declared In

ZegoExpressEngine+Player.h

– uninitVideoSuperResolution

Available since: 3.3.0 Description: After deinitializing the super resolution, the SDK will release the resources occupied by the super resolution and make the super resolution function unavailable. Use cases: Live streaming scenario. When to call: Needs to be called after [initVideoSuperResolution]. Caution: Initializing the video screen is divided into time-consuming operations, and frequent initialization and de-initialization are not recommended.

- (void)uninitVideoSuperResolution

Declared In

ZegoExpressEngine+Player.h

– updatePlayingCanvas:canvas:

Stream ID, a string of up to 256 characters. Caution: Only support numbers, English characters and ‘-’, ‘_’.

- (int)updatePlayingCanvas:(NSString *)streamID canvas:(nullable ZegoCanvas *)canvas

Parameters

streamID

Stream ID, a string of up to 256 characters. Caution: Only support numbers, English characters and ‘-’, ‘_’.

canvas

The view used to display the play audio and video stream’s image. When the view is set to [nil], no video is displayed, only audio is played.

Return Value

Error code, please refer to the error codes document https://doc-en.zego.im/en/5548.html for details.

Declared In

ZegoExpressEngine+Player.h

– setPlayStreamBufferIntervalRange:streamID:

Deprecated since 3.4.0, please use [setPlayStreamBufferIntervalRange:min:max:] instead. (Deprecated: Deprecated since 3.4.0, please use [setPlayStreamBufferIntervalRange:min:max:] instead.)

- (void)setPlayStreamBufferIntervalRange:(NSRange)range streamID:(NSString *)streamID

Parameters

range

The buffer adaptive interval range.

streamID

Stream ID.

Declared In

ZegoExpressEngine+Player.h

ScreenCapture Methods

– getScreenCaptureSourcesWithThumbnailSize:iconSize:

Get the thumbnail size corresponding to the window, the thumbnail can be used to draw on the window selection interface. (unit is pixel)

- (NSArray<ZegoScreenCaptureSourceInfo*> *)getScreenCaptureSourcesWithThumbnailSize:(CGSize)thumbnailSize iconSize:(CGSize)iconSize

Parameters

thumbnailSize

Get the thumbnail size corresponding to the window, the thumbnail can be used to draw on the window selection interface. (unit is pixel)

iconSize

Get the size of the icon corresponding to the program. (unit is pixel)

Return Value

List of capture source info objects.

Declared In

ZegoExpressEngine+ScreenCapture.h

– createScreenCaptureSource:sourceType:

The specified screen ID or window ID.

- (nullable ZegoScreenCaptureSource *)createScreenCaptureSource:(unsigned int)sourceId sourceType:(ZegoScreenCaptureSourceType)sourceType

Parameters

sourceId

The specified screen ID or window ID.

sourceType

The specified screen source type.

Return Value

The screen capture instance, nil will be returned when the maximum number is exceeded.

Declared In

ZegoExpressEngine+ScreenCapture.h

– destroyScreenCaptureSource:

The screen capture source instance to be destroyed.

- (void)destroyScreenCaptureSource:(ZegoScreenCaptureSource *)source

Parameters

source

The screen capture source instance to be destroyed.

Declared In

ZegoExpressEngine+ScreenCapture.h

– setAppGroupID:

The host app and the extension app should belong to the same App Group, and the AppGroupID needs to be passed in here.

- (void)setAppGroupID:(NSString *)groupID

Parameters

groupID

The host app and the extension app should belong to the same App Group, and the AppGroupID needs to be passed in here.

Declared In

ZegoExpressEngine+ScreenCapture.h

– startScreenCaptureInApp:

Screen capture parameter configuration.

- (void)startScreenCaptureInApp:(ZegoScreenCaptureConfig *)config

Parameters

config

Screen capture parameter configuration.

Declared In

ZegoExpressEngine+ScreenCapture.h

– startScreenCapture:

Screen capture parameter configuration.

- (void)startScreenCapture:(ZegoScreenCaptureConfig *)config

Parameters

config

Screen capture parameter configuration.

Declared In

ZegoExpressEngine+ScreenCapture.h

– stopScreenCapture

Available since: 3.1.0 Description: Stop screen capture.

- (void)stopScreenCapture

Declared In

ZegoExpressEngine+ScreenCapture.h

– updateScreenCaptureConfig:

Screen capture parameter configuration.

- (void)updateScreenCaptureConfig:(ZegoScreenCaptureConfig *)config

Parameters

config

Screen capture parameter configuration.

Declared In

ZegoExpressEngine+ScreenCapture.h

Utilities Methods

– startPerformanceMonitor:

Monitoring time period(in milliseconds), the value range is [1000, 10000]. Default value is 2000 ms.

- (void)startPerformanceMonitor:(unsigned int)millisecond

Parameters

millisecond

Monitoring time period(in milliseconds), the value range is [1000, 10000]. Default value is 2000 ms.

Declared In

ZegoExpressEngine+Utilities.h

– stopPerformanceMonitor

Available since: 1.19.0 Description: Stop system performance monitoring. After the monitoring is stopped, the [onPerformanceStatusUpdate] callback will not triggered. Use cases: Monitor system performance can help user quickly locate and solve performance problems and improve user experience. When to call: It needs to be called after [createEngine]. Restrictions: None. Related APIs: Call [startPerformanceMonitor] to start system performance monitoring.

- (void)stopPerformanceMonitor

Declared In

ZegoExpressEngine+Utilities.h

– startNetworkProbe:callback:

network probe config.

- (void)startNetworkProbe:(ZegoNetworkProbeConfig *)config callback:(nullable ZegoNetworkProbeResultCallback)callback

Parameters

config

network probe config.

callback

Network probe result callback.

Declared In

ZegoExpressEngine+Utilities.h

– stopNetworkProbe

Available since: 2.3.0 Description: Stop network probe. Use cases: Before pushing and pulling the stream, detect and locate some possible network problems. When to call: It needs to be called after [createEngine]. Restrictions: None. Related APIs: Call [startNetworkProbe] to start network probe.

- (void)stopNetworkProbe

Declared In

ZegoExpressEngine+Utilities.h

– startNetworkSpeedTest:

Network speed test configuration.

- (void)startNetworkSpeedTest:(ZegoNetworkSpeedTestConfig *)config

Parameters

config

Network speed test configuration.

Declared In

ZegoExpressEngine+Utilities.h

– startNetworkSpeedTest:interval:

Network speed test configuration.

- (void)startNetworkSpeedTest:(ZegoNetworkSpeedTestConfig *)config interval:(unsigned int)interval

Parameters

config

Network speed test configuration.

interval

Interval of network speed test. In milliseconds, default is 3000 ms.

Declared In

ZegoExpressEngine+Utilities.h

– stopNetworkSpeedTest

Available since: 1.20.0 Description: Stop network speed test. Use cases: This function can be used to detect whether the network environment is suitable for pushing/pulling streams with specified bitrates. When to call: It needs to be called after [createEngine]. Restrictions: None. Caution: After the network speed test stopped, [onNetworkSpeedTestQualityUpdate] callback will not be triggered. Related APIs: Call [startNetworkSpeedTest] to start network speed test.

- (void)stopNetworkSpeedTest

Declared In

ZegoExpressEngine+Utilities.h

– getNetworkTimeInfo

Available since: 2.9.0 Description: Obtain synchronization network time(NTP), including timestamp and maximum deviation. Use cases: When performing multi-terminal synchronization behaviors, network time synchronization is required. When to call: It needs to be called after [createEngine]. Restrictions: None.

- (ZegoNetworkTimeInfo *)getNetworkTimeInfo

Declared In

ZegoExpressEngine+Utilities.h

– startDumpData:

Dump data config.

- (void)startDumpData:(ZegoDumpDataConfig *)config

Parameters

config

Dump data config.

Declared In

ZegoExpressEngine+Utilities.h

– stopDumpData

Available since: 3.10.0 Description: Stop dumping data. Use cases: This is a debugging tool. When there is a problem with audio capturing, 3A processing, or other environment processing during publish, you can dump the audio data and upload it to the ZEGO server for further analysis. When to call: It needs to be called after [startDumpData]. Restrictions: None. Caution: It will trigger the [onUploadDumpData] callback.

- (void)stopDumpData

Declared In

ZegoExpressEngine+Utilities.h

– uploadDumpData

Available since: 3.10.0 Description: Upload dumped data to the ZEGO server. Use cases: This is a debugging tool. When there is a problem with audio capturing, 3A processing, or other environment processing during publish, you can dump the audio data and upload it to the ZEGO server for further analysis. When to call: It needs to be called after [stopDumpData]. Restrictions: None. Caution: It will trigger the [onUploadDumpData] callback when dump data uploaded.

- (void)uploadDumpData

Declared In

ZegoExpressEngine+Utilities.h

– removeDumpData

Available since: 3.10.0 Description: Remove dumped data. Use cases: This is a debugging tool. When there is a problem with audio capturing, 3A processing, or other environment processing during publish, you can dump the audio data and upload it to the ZEGO server for further analysis. When to call: It needs to be called after [stopDumpData]. If the dump data is to be uploaded to the ZEGO server, it should be deleted after the upload is successful. Restrictions: None.

- (void)removeDumpData

Declared In

ZegoExpressEngine+Utilities.h

AudioEffectPlayer Methods

– createAudioEffectPlayer

audio effect player instance, nil will be returned when the maximum number is exceeded.

- (nullable ZegoAudioEffectPlayer *)createAudioEffectPlayer

Return Value

audio effect player instance, nil will be returned when the maximum number is exceeded.

Declared In

ZegoExpressEngine+AudioEffectPlayer.h

– destroyAudioEffectPlayer:

The audio effect player instance object to be destroyed.

- (void)destroyAudioEffectPlayer:(ZegoAudioEffectPlayer *)audioEffectPlayer

Parameters

audioEffectPlayer

The audio effect player instance object to be destroyed.

Declared In

ZegoExpressEngine+AudioEffectPlayer.h

CustomVideoIO Methods

– enableCustomVideoRender:config:

enable or disable

- (void)enableCustomVideoRender:(BOOL)enable config:(nullable ZegoCustomVideoRenderConfig *)config

Parameters

enable

enable or disable

config

custom video render config

Declared In

ZegoExpressEngine+CustomVideoIO.h

– setCustomVideoRenderHandler:

Custom video render handler

- (void)setCustomVideoRenderHandler:(nullable id<ZegoCustomVideoRenderHandler>)handler

Parameters

handler

Custom video render handler

Declared In

ZegoExpressEngine+CustomVideoIO.h

– enableCapturedVideoCustomVideoRender:channel:

enable or disable

- (void)enableCapturedVideoCustomVideoRender:(BOOL)enable channel:(ZegoPublishChannel)channel

Parameters

enable

enable or disable

channel

publish channel

Declared In

ZegoExpressEngine+CustomVideoIO.h

– enableRemoteVideoCustomVideoRender:streamID:

enable or disable

- (void)enableRemoteVideoCustomVideoRender:(BOOL)enable streamID:(NSString *)streamID

Parameters

enable

enable or disable

streamID

Stream ID.

Declared In

ZegoExpressEngine+CustomVideoIO.h

– enableCustomVideoCapture:config:

enable or disable

- (void)enableCustomVideoCapture:(BOOL)enable config:(nullable ZegoCustomVideoCaptureConfig *)config

Parameters

enable

enable or disable

config

custom video capture config

Declared In

ZegoExpressEngine+CustomVideoIO.h

– enableCustomVideoCapture:config:channel:

enable or disable

- (void)enableCustomVideoCapture:(BOOL)enable config:(nullable ZegoCustomVideoCaptureConfig *)config channel:(ZegoPublishChannel)channel

Parameters

enable

enable or disable

config

custom video capture config

channel

publish channel

Declared In

ZegoExpressEngine+CustomVideoIO.h

– setCustomVideoCaptureHandler:

Custom video capture handler

- (void)setCustomVideoCaptureHandler:(nullable id<ZegoCustomVideoCaptureHandler>)handler

Parameters

handler

Custom video capture handler

Declared In

ZegoExpressEngine+CustomVideoIO.h

– sendCustomVideoCaptureTextureData:size:timestamp:

texture ID

- (void)sendCustomVideoCaptureTextureData:(GLuint)textureID size:(CGSize)size timestamp:(CMTime)timestamp

Parameters

textureID

texture ID

size

Video frame width and height

timestamp

Timestamp of this video frame

Declared In

ZegoExpressEngine+CustomVideoIO.h

– sendCustomVideoCaptureTextureData:size:timestamp:channel:

texture ID

- (void)sendCustomVideoCaptureTextureData:(GLuint)textureID size:(CGSize)size timestamp:(CMTime)timestamp channel:(ZegoPublishChannel)channel

Parameters

textureID

texture ID

size

Video frame width and height

timestamp

Timestamp of this video frame

channel

Publishing stream channel

Declared In

ZegoExpressEngine+CustomVideoIO.h

– sendCustomVideoCapturePixelBuffer:timestamp:

Video frame data to send to the SDK

- (void)sendCustomVideoCapturePixelBuffer:(CVPixelBufferRef)buffer timestamp:(CMTime)timestamp

Parameters

buffer

Video frame data to send to the SDK

timestamp

Timestamp of this video frame

Declared In

ZegoExpressEngine+CustomVideoIO.h

– sendCustomVideoCapturePixelBuffer:timestamp:channel:

Video frame data to send to the SDK

- (void)sendCustomVideoCapturePixelBuffer:(CVPixelBufferRef)buffer timestamp:(CMTime)timestamp channel:(ZegoPublishChannel)channel

Parameters

buffer

Video frame data to send to the SDK

timestamp

Timestamp of this video frame

channel

Publishing stream channel

Declared In

ZegoExpressEngine+CustomVideoIO.h

– sendCustomVideoCaptureEncodedData:params:timestamp:

video encoded frame data

- (void)sendCustomVideoCaptureEncodedData:(NSData *)data params:(ZegoVideoEncodedFrameParam *)params timestamp:(CMTime)timestamp

Parameters

data

video encoded frame data

params

video encoded frame param

timestamp

video frame reference time, UNIX timestamp.

Declared In

ZegoExpressEngine+CustomVideoIO.h

– sendCustomVideoCaptureEncodedData:params:timestamp:channel:

video frame encoded data

- (void)sendCustomVideoCaptureEncodedData:(NSData *)data params:(ZegoVideoEncodedFrameParam *)params timestamp:(CMTime)timestamp channel:(ZegoPublishChannel)channel

Parameters

data

video frame encoded data

params

video frame param

timestamp

video frame reference time, UNIX timestamp.

channel

Publishing stream channel

Declared In

ZegoExpressEngine+CustomVideoIO.h

– setCustomVideoCaptureFillMode:

View mode

- (void)setCustomVideoCaptureFillMode:(ZegoViewMode)mode

Parameters

mode

View mode

Declared In

ZegoExpressEngine+CustomVideoIO.h

– setCustomVideoCaptureFillMode:channel:

View mode

- (void)setCustomVideoCaptureFillMode:(ZegoViewMode)mode channel:(ZegoPublishChannel)channel

Parameters

mode

View mode

channel

Publishing stream channel

Declared In

ZegoExpressEngine+CustomVideoIO.h

– setCustomVideoCaptureFlipMode:

Flip mode

- (void)setCustomVideoCaptureFlipMode:(ZegoVideoFlipMode)mode

Parameters

mode

Flip mode

Declared In

ZegoExpressEngine+CustomVideoIO.h

– setCustomVideoCaptureFlipMode:channel:

Flip mode

- (void)setCustomVideoCaptureFlipMode:(ZegoVideoFlipMode)mode channel:(ZegoPublishChannel)channel

Parameters

mode

Flip mode

channel

Publishing stream channel

Declared In

ZegoExpressEngine+CustomVideoIO.h

– setCustomVideoCaptureRotation:channel:

Clockwise angle.

- (void)setCustomVideoCaptureRotation:(int)rotation channel:(ZegoPublishChannel)channel

Parameters

rotation

Clockwise angle.

channel

Publishing stream channel

Declared In

ZegoExpressEngine+CustomVideoIO.h

– setCustomVideoCaptureDeviceState:state:channel:

Whether the device is enable.

- (void)setCustomVideoCaptureDeviceState:(BOOL)isEnable state:(ZegoRemoteDeviceState)state channel:(ZegoPublishChannel)channel

Parameters

isEnable

Whether the device is enable.

state

The device state.

channel

Publishing stream channel

Declared In

ZegoExpressEngine+CustomVideoIO.h

– setCustomVideoCaptureRegionOfInterest:channel:

ROI rectangle area list, currently supports up to 6 areas.

- (void)setCustomVideoCaptureRegionOfInterest:(NSArray<ZegoRoiRect*> *)rectList channel:(ZegoPublishChannel)channel

Parameters

rectList

ROI rectangle area list, currently supports up to 6 areas.

channel

Publish channel

Declared In

ZegoExpressEngine+CustomVideoIO.h

– enableCustomVideoProcessing:config:

enable or disable. Required: Yes.

- (void)enableCustomVideoProcessing:(BOOL)enable config:(nullable ZegoCustomVideoProcessConfig *)config

Parameters

enable

enable or disable. Required: Yes.

config

custom video processing configuration. Required: Yes.Caution: If nil is passed, the platform default value is used.

Declared In

ZegoExpressEngine+CustomVideoIO.h

– enableCustomVideoProcessing:config:channel:

enable or disable. Required: Yes.

- (void)enableCustomVideoProcessing:(BOOL)enable config:(nullable ZegoCustomVideoProcessConfig *)config channel:(ZegoPublishChannel)channel

Parameters

enable

enable or disable. Required: Yes.

config

custom video processing configuration. Required: Yes.Caution: If nil is passed, the platform default value is used.

channel

Publishing stream channel.Required: No.Default value: Main publish channel.

Declared In

ZegoExpressEngine+CustomVideoIO.h

– setCustomVideoProcessHandler:

Custom video process handler.Required: Yes.

- (void)setCustomVideoProcessHandler:(nullable id<ZegoCustomVideoProcessHandler>)handler

Parameters

handler

Custom video process handler.Required: Yes.

Declared In

ZegoExpressEngine+CustomVideoIO.h

– sendCustomVideoProcessedCVPixelBuffer:timestamp:

CVPixelBuffer type video frame data to be sent to the SDK.Required: Yes.

- (void)sendCustomVideoProcessedCVPixelBuffer:(CVPixelBufferRef)buffer timestamp:(CMTime)timestamp

Parameters

buffer

CVPixelBuffer type video frame data to be sent to the SDK.Required: Yes.

timestamp

Timestamp of this video frame.Required: Yes.

Declared In

ZegoExpressEngine+CustomVideoIO.h

– sendCustomVideoProcessedCVPixelBuffer:timestamp:channel:

CVPixelBuffer type video frame data to be sent to the SDK.

- (void)sendCustomVideoProcessedCVPixelBuffer:(CVPixelBufferRef)buffer timestamp:(CMTime)timestamp channel:(ZegoPublishChannel)channel

Parameters

buffer

CVPixelBuffer type video frame data to be sent to the SDK.

timestamp

Timestamp of this video frame.

channel

Publishing stream channel.

Declared In

ZegoExpressEngine+CustomVideoIO.h

– sendCustomVideoProcessedCVPixelBuffer:timestamp:usage:channel:

CVPixelBuffer type video frame data to be sent to the SDK.

- (void)sendCustomVideoProcessedCVPixelBuffer:(CVPixelBufferRef)buffer timestamp:(CMTime)timestamp usage:(ZegoProcessedDataUsageType)usage channel:(ZegoPublishChannel)channel

Parameters

buffer

CVPixelBuffer type video frame data to be sent to the SDK.

timestamp

Timestamp of this video frame.

usage

Data usage

channel

Publishing stream channel.

Declared In

ZegoExpressEngine+CustomVideoIO.h

MediaPlayer Methods

– createMediaPlayer

Media player instance, nil will be returned when the maximum number is exceeded.

- (nullable ZegoMediaPlayer *)createMediaPlayer

Return Value

Media player instance, nil will be returned when the maximum number is exceeded.

Declared In

ZegoExpressEngine+MediaPlayer.h

– destroyMediaPlayer:

The media player instance object to be destroyed.

- (void)destroyMediaPlayer:(ZegoMediaPlayer *)mediaPlayer

Parameters

mediaPlayer

The media player instance object to be destroyed.

Declared In

ZegoExpressEngine+MediaPlayer.h

CustomAudioIO Methods

– enableCustomAudioCaptureProcessing:config:

Whether to enable local capture custom audio processing.

- (void)enableCustomAudioCaptureProcessing:(BOOL)enable config:(ZegoCustomAudioProcessConfig *)config

Parameters

enable

Whether to enable local capture custom audio processing.

config

Custom audio processing configuration.

Declared In

ZegoExpressEngine+CustomAudioIO.h

– enableCustomAudioCaptureProcessingAfterHeadphoneMonitor:config:

Whether to enable local capture custom audio processing.

- (void)enableCustomAudioCaptureProcessingAfterHeadphoneMonitor:(BOOL)enable config:(ZegoCustomAudioProcessConfig *)config

Parameters

enable

Whether to enable local capture custom audio processing.

config

Custom audio processing configuration.

Declared In

ZegoExpressEngine+CustomAudioIO.h

– enableAlignedAudioAuxData:param:

Whether to enable the feature of throwing alignmented audio aux frames.

- (void)enableAlignedAudioAuxData:(BOOL)enable param:(ZegoAudioFrameParam *)param

Parameters

enable

Whether to enable the feature of throwing alignmented audio aux frames.

param

param of audio frame. Currently supports 8k, 16k, 32k, 44.1k, 48k sampling rate, mono or stereo.

Declared In

ZegoExpressEngine+CustomAudioIO.h

– enableBeforeAudioPrepAudioData:param:

Whether to enable feature of throwing audio data before SDK internal audio preprocessing.

- (void)enableBeforeAudioPrepAudioData:(BOOL)enable param:(ZegoAudioFrameParam *)param

Parameters

enable

Whether to enable feature of throwing audio data before SDK internal audio preprocessing.

param

param of audio frame. Currently, it supports sampling rates of 0, 16k, 32k, 44.1k, and 48k. The 0 means using SDK internal value. It supports channels Unknown, Mono, and Stereo. The Unknown means using SDK internal value.

Declared In

ZegoExpressEngine+CustomAudioIO.h

– enableCustomAudioRemoteProcessing:config:

Whether to enable custom audio processing for remote playing stream.

- (void)enableCustomAudioRemoteProcessing:(BOOL)enable config:(ZegoCustomAudioProcessConfig *)config

Parameters

enable

Whether to enable custom audio processing for remote playing stream.

config

Custom audio processing configuration.

Declared In

ZegoExpressEngine+CustomAudioIO.h

– enableCustomAudioPlaybackProcessing:config:

Whether to enable custom audio processing for SDK playback audio data.

- (void)enableCustomAudioPlaybackProcessing:(BOOL)enable config:(ZegoCustomAudioProcessConfig *)config

Parameters

enable

Whether to enable custom audio processing for SDK playback audio data.

config

Custom audio processing configuration.

Declared In

ZegoExpressEngine+CustomAudioIO.h

– setCustomAudioProcessHandler:

Callback handler for custom audio processing.

- (void)setCustomAudioProcessHandler:(nullable id<ZegoCustomAudioProcessHandler>)handler

Parameters

handler

Callback handler for custom audio processing.

Declared In

ZegoExpressEngine+CustomAudioIO.h

– startAudioDataObserver:param:

The callback function bitmask marker for receive audio data, refer to enum [ZegoAudioDataCallbackBitMask], when this param converted to binary, 0b01 that means 1 << 0 for triggering [onCapturedAudioData], 0x10 that means 1 << 1 for triggering [onPlaybackAudioData], 0x100 that means 1 << 2 for triggering [onMixedAudioData], 0x1000 that means 1 << 3 for triggering [onPlayerAudioData]. The masks can be combined to allow different callbacks to be triggered simultaneously.

- (void)startAudioDataObserver:(ZegoAudioDataCallbackBitMask)observerBitMask param:(ZegoAudioFrameParam *)param

Parameters

observerBitMask

The callback function bitmask marker for receive audio data, refer to enum [ZegoAudioDataCallbackBitMask], when this param converted to binary, 0b01 that means 1 << 0 for triggering [onCapturedAudioData], 0x10 that means 1 << 1 for triggering [onPlaybackAudioData], 0x100 that means 1 << 2 for triggering [onMixedAudioData], 0x1000 that means 1 << 3 for triggering [onPlayerAudioData]. The masks can be combined to allow different callbacks to be triggered simultaneously.

param

param of audio frame.

Declared In

ZegoExpressEngine+CustomAudioIO.h

– stopAudioDataObserver

Available since: 1.1.0 Description: Disable audio data observering. Use cases: When develop need to monitor the original audio. When to call: After calling [startAudioDataObserver] to start audio data monitoring.

- (void)stopAudioDataObserver

Declared In

ZegoExpressEngine+CustomAudioIO.h

– setAudioDataHandler:

Audio data handler for receive audio data.

- (void)setAudioDataHandler:(nullable id<ZegoAudioDataHandler>)handler

Parameters

handler

Audio data handler for receive audio data.

Declared In

ZegoExpressEngine+CustomAudioIO.h

– enableCustomAudioIO:config:

Whether to enable custom audio IO, default is NO.

- (void)enableCustomAudioIO:(BOOL)enable config:(nullable ZegoCustomAudioConfig *)config

Parameters

enable

Whether to enable custom audio IO, default is NO.

config

Custom audio IO config.

Declared In

ZegoExpressEngine+CustomAudioIO.h

– enableCustomAudioIO:config:channel:

Whether to enable custom audio IO, default is NO.

- (void)enableCustomAudioIO:(BOOL)enable config:(nullable ZegoCustomAudioConfig *)config channel:(ZegoPublishChannel)channel

Parameters

enable

Whether to enable custom audio IO, default is NO.

config

Custom audio IO config.

channel

Specify the publish channel to enable custom audio IO.

Declared In

ZegoExpressEngine+CustomAudioIO.h

– sendCustomAudioCaptureAACData:dataLength:configLength:timestamp:samples:param:channel:

AAC buffer data.

- (void)sendCustomAudioCaptureAACData:(unsigned char *)data dataLength:(unsigned int)dataLength configLength:(unsigned int)configLength timestamp:(CMTime)timestamp samples:(unsigned int)samples param:(ZegoAudioFrameParam *)param channel:(ZegoPublishChannel)channel

Parameters

data

AAC buffer data.

dataLength

The total length of the buffer data.

configLength

The length of AAC specific config (Note: The AAC encoded data length is ‘encodedLength = dataLength - configLength’).Value range: [0,64]

timestamp

The UNIX timestamp of this AAC audio frame.

samples

The number of samples for this AAC audio frame.Value range: [480,512,1024,1960,2048].

param

The param of this AAC audio frame.

channel

Publish channel for capturing audio frames.

Declared In

ZegoExpressEngine+CustomAudioIO.h

– sendCustomAudioCapturePCMData:dataLength:param:

PCM buffer data.

- (void)sendCustomAudioCapturePCMData:(unsigned char *)data dataLength:(unsigned int)dataLength param:(ZegoAudioFrameParam *)param

Parameters

data

PCM buffer data.

dataLength

The total length of the buffer data.

param

The param of this PCM audio frame.

Declared In

ZegoExpressEngine+CustomAudioIO.h

– sendCustomAudioCapturePCMData:dataLength:param:channel:

PCM buffer data.

- (void)sendCustomAudioCapturePCMData:(unsigned char *)data dataLength:(unsigned int)dataLength param:(ZegoAudioFrameParam *)param channel:(ZegoPublishChannel)channel

Parameters

data

PCM buffer data.

dataLength

The total length of the buffer data.

param

The param of this PCM audio frame.

channel

Publish channel for capturing audio frames.

Declared In

ZegoExpressEngine+CustomAudioIO.h

– fetchCustomAudioRenderPCMData:dataLength:param:

A block of memory for storing audio PCM data that requires user to manage the memory block’s lifecycle, the SDK will copy the audio frame rendering data to this memory block.

- (void)fetchCustomAudioRenderPCMData:(unsigned char *)data dataLength:(unsigned int)dataLength param:(ZegoAudioFrameParam *)param

Parameters

data

A block of memory for storing audio PCM data that requires user to manage the memory block’s lifecycle, the SDK will copy the audio frame rendering data to this memory block.

dataLength

The length of the audio data to be fetch this time (dataLength = duration * sampleRate * channels * 2(16 bit depth i.e. 2 Btye)).

param

Specify the parameters of the fetched audio frame. sampleRate in ZegoAudioFrameParam must assignment

Declared In

ZegoExpressEngine+CustomAudioIO.h

– sendReferenceAudioPCMData:dataLength:param:

PCM buffer data

- (void)sendReferenceAudioPCMData:(unsigned char *)data dataLength:(unsigned int)dataLength param:(ZegoAudioFrameParam *)param

Parameters

data

PCM buffer data

dataLength

The total length of the buffer data

param

The param of this PCM audio frame

Declared In

ZegoExpressEngine+CustomAudioIO.h

AIVoiceChanger Methods

– createAIVoiceChanger

AI voice changer instance.

- (nullable ZegoAIVoiceChanger *)createAIVoiceChanger

Return Value

AI voice changer instance.

Declared In

ZegoExpressEngine+AIVoiceChanger.h

– destroyAIVoiceChanger:

The AI voice changer instance object to be destroyed.

- (void)destroyAIVoiceChanger:(ZegoAIVoiceChanger *)aiVoiceChanger

Parameters

aiVoiceChanger

The AI voice changer instance object to be destroyed.

Declared In

ZegoExpressEngine+AIVoiceChanger.h

Publisher Methods

– startPublishingStream:

Stream ID, a string of up to 256 characters. Caution: 1. Stream ID is defined by you. 2. needs to be globally unique within the entire AppID. If in the same AppID, different users publish each stream and the stream ID is the same, which will cause the user to publish the stream failure. You cannot include URL keywords, otherwise publishing stream and playing stream will fails. 3. Only support numbers, English characters and ‘-’, ‘_’.

- (void)startPublishingStream:(NSString *)streamID

Parameters

streamID

Stream ID, a string of up to 256 characters. Caution: 1. Stream ID is defined by you. 2. needs to be globally unique within the entire AppID. If in the same AppID, different users publish each stream and the stream ID is the same, which will cause the user to publish the stream failure. You cannot include URL keywords, otherwise publishing stream and playing stream will fails. 3. Only support numbers, English characters and ‘-’, ‘_’.

Declared In

ZegoExpressEngine+Publisher.h

– startPublishingStream:channel:

Stream ID, a string of up to 256 characters. Caution: 1. Stream ID is defined by you. 2. needs to be globally unique within the entire AppID. If in the same AppID, different users publish each stream and the stream ID is the same, which will cause the user to publish the stream failure. You cannot include URL keywords, otherwise publishing stream and playing stream will fails. 3. Only support numbers, English characters and ‘-’, ‘_’.

- (void)startPublishingStream:(NSString *)streamID channel:(ZegoPublishChannel)channel

Parameters

streamID

Stream ID, a string of up to 256 characters. Caution: 1. Stream ID is defined by you. 2. needs to be globally unique within the entire AppID. If in the same AppID, different users publish each stream and the stream ID is the same, which will cause the user to publish the stream failure. You cannot include URL keywords, otherwise publishing stream and playing stream will fails. 3. Only support numbers, English characters and ‘-’, ‘_’.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– startPublishingStream:config:channel:

Stream ID, a string of up to 256 characters. Caution: 1. Stream ID is defined by you. 2. needs to be globally unique within the entire AppID. If in the same AppID, different users publish each stream and the stream ID is the same, which will cause the user to publish the stream failure. You cannot include URL keywords, otherwise publishing stream and playing stream will fails. 3. Only support numbers, English characters and ‘-’, ‘_’.

- (void)startPublishingStream:(NSString *)streamID config:(ZegoPublisherConfig *)config channel:(ZegoPublishChannel)channel

Parameters

streamID

Stream ID, a string of up to 256 characters. Caution: 1. Stream ID is defined by you. 2. needs to be globally unique within the entire AppID. If in the same AppID, different users publish each stream and the stream ID is the same, which will cause the user to publish the stream failure. You cannot include URL keywords, otherwise publishing stream and playing stream will fails. 3. Only support numbers, English characters and ‘-’, ‘_’.

config

Advanced publish configuration.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– startPublishingStreamInScene:channel:config:

Stream ID, a string of up to 256 characters. Caution: 1. Stream ID is defined by you. 2. needs to be globally unique within the entire AppID. If in the same AppID, different users publish each stream and the stream ID is the same, which will cause the user to publish the stream failure. You cannot include URL keywords, otherwise publishing stream and playing stream will fails. 3. Only support numbers, English characters and ‘-’, ‘_’.

- (void)startPublishingStreamInScene:(NSString *)streamID channel:(ZegoPublishChannel)channel config:(ZegoScenePublisherConfig *)config

Parameters

streamID

Stream ID, a string of up to 256 characters. Caution: 1. Stream ID is defined by you. 2. needs to be globally unique within the entire AppID. If in the same AppID, different users publish each stream and the stream ID is the same, which will cause the user to publish the stream failure. You cannot include URL keywords, otherwise publishing stream and playing stream will fails. 3. Only support numbers, English characters and ‘-’, ‘_’.

channel

Publish stream channel.

config

Advanced scene publish configuration.

Declared In

ZegoExpressEngine+Publisher.h

– stopPublishingStream

Available since: 1.1.0 Description: The user stops sending local audio and video streams, and other users in the room will receive a stream deletion notification. Use cases: It can be used to stop publish streams in real-time connecting wheat, live broadcast and other scenarios. When to call: After [startPublishingStream]. Restrictions: None. Caution: 1. After stopping the streaming, other users in the same room can receive the delete notification of the stream by listening to the [onRoomStreamUpdate] callback. 2. If the user has initiated publish flow, this function must be called to stop the publish of the current stream before publishing the new stream (new streamID), otherwise the new stream publish will return a failure. 3. After stopping streaming, the developer should stop the local preview based on whether the business situation requires it.

- (void)stopPublishingStream

Declared In

ZegoExpressEngine+Publisher.h

– stopPublishingStream:

Publish stream channel.

- (void)stopPublishingStream:(ZegoPublishChannel)channel

Parameters

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– setStreamExtraInfo:callback:

Stream extra information, a string of up to 1024 characters.

- (void)setStreamExtraInfo:(NSString *)extraInfo callback:(nullable ZegoPublisherSetStreamExtraInfoCallback)callback

Parameters

extraInfo

Stream extra information, a string of up to 1024 characters.

callback

Set stream extra information execution result notification.

Declared In

ZegoExpressEngine+Publisher.h

– setStreamExtraInfo:channel:callback:

Stream extra information, a string of up to 1024 characters.

- (void)setStreamExtraInfo:(NSString *)extraInfo channel:(ZegoPublishChannel)channel callback:(nullable ZegoPublisherSetStreamExtraInfoCallback)callback

Parameters

extraInfo

Stream extra information, a string of up to 1024 characters.

channel

Publish stream channel.

callback

Set stream extra information execution result notification.

Declared In

ZegoExpressEngine+Publisher.h

– startPreview:

The view used to display the preview image. If the view is set to nil, no preview will be made.

- (void)startPreview:(nullable ZegoCanvas *)canvas

Parameters

canvas

The view used to display the preview image. If the view is set to nil, no preview will be made.

Declared In

ZegoExpressEngine+Publisher.h

– startPreview:channel:

The view used to display the preview image. If the view is set to nil, no preview will be made.

- (void)startPreview:(nullable ZegoCanvas *)canvas channel:(ZegoPublishChannel)channel

Parameters

canvas

The view used to display the preview image. If the view is set to nil, no preview will be made.

channel

Publish stream channel

Declared In

ZegoExpressEngine+Publisher.h

– startPreview

Available since: 1.1.0 Description: Call this function after creating the engine and before publishing/playing a stream, and then the engine will start to capture audio. Use cases: Can check whether the audio equipment works ok by calling this function and by the soundlevel function of Engine. When to call: After [createEngine]. Restrictions: None. Caution: 1. The preview function does not require you to log in to the room or publish the stream first. But after exiting the room, SDK internally actively stops previewing by default. 2. When this function is called, the audio engine module inside SDK will start, and it will start to try to collect audio.

- (void)startPreview

Declared In

ZegoExpressEngine+Publisher.h

– stopPreview

Available since: 1.1.0 Description: This function can be called to stop the preview when the preview is not needed locally. Caution: Stopping the preview will not affect the publish stream and playing stream functions.

- (void)stopPreview

Declared In

ZegoExpressEngine+Publisher.h

– stopPreview:

Publish stream channel

- (void)stopPreview:(ZegoPublishChannel)channel

Parameters

channel

Publish stream channel

Declared In

ZegoExpressEngine+Publisher.h

– setVideoConfig:

Video configuration, the SDK provides a common setting combination of resolution, frame rate and bit rate, they also can be customized.

- (void)setVideoConfig:(ZegoVideoConfig *)config

Parameters

config

Video configuration, the SDK provides a common setting combination of resolution, frame rate and bit rate, they also can be customized.

Declared In

ZegoExpressEngine+Publisher.h

– setVideoConfig:channel:

Video configuration, the SDK provides a common setting combination of resolution, frame rate and bit rate, they also can be customized.

- (void)setVideoConfig:(ZegoVideoConfig *)config channel:(ZegoPublishChannel)channel

Parameters

config

Video configuration, the SDK provides a common setting combination of resolution, frame rate and bit rate, they also can be customized.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– getVideoConfig

Video configuration object

- (ZegoVideoConfig *)getVideoConfig

Return Value

Video configuration object

Declared In

ZegoExpressEngine+Publisher.h

– getVideoConfig:

Publish stream channel

- (ZegoVideoConfig *)getVideoConfig:(ZegoPublishChannel)channel

Parameters

channel

Publish stream channel

Return Value

Video configuration object

Declared In

ZegoExpressEngine+Publisher.h

– setPublishDualStreamConfig:channel:

config info.

- (void)setPublishDualStreamConfig:(NSArray<ZegoPublishDualStreamConfig*> *)configList channel:(ZegoPublishChannel)channel

Parameters

configList

config info.

channel

ZegoPublishChannel.

Declared In

ZegoExpressEngine+Publisher.h

– setVideoMirrorMode:

Mirror mode for previewing or publishing the stream.

- (void)setVideoMirrorMode:(ZegoVideoMirrorMode)mirrorMode

Parameters

mirrorMode

Mirror mode for previewing or publishing the stream.

Declared In

ZegoExpressEngine+Publisher.h

– setVideoMirrorMode:channel:

Mirror mode for previewing or publishing the stream.

- (void)setVideoMirrorMode:(ZegoVideoMirrorMode)mirrorMode channel:(ZegoPublishChannel)channel

Parameters

mirrorMode

Mirror mode for previewing or publishing the stream.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– setAppOrientation:

Video orientation.

- (void)setAppOrientation:(UIInterfaceOrientation)orientation

Parameters

orientation

Video orientation.

Declared In

ZegoExpressEngine+Publisher.h

– setAppOrientation:channel:

Video orientation.

- (void)setAppOrientation:(UIInterfaceOrientation)orientation channel:(ZegoPublishChannel)channel

Parameters

orientation

Video orientation.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– setAudioConfig:

Audio config.

- (void)setAudioConfig:(ZegoAudioConfig *)config

Parameters

config

Audio config.

Declared In

ZegoExpressEngine+Publisher.h

– setAudioConfig:channel:

Audio config.

- (void)setAudioConfig:(ZegoAudioConfig *)config channel:(ZegoPublishChannel)channel

Parameters

config

Audio config.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– getAudioConfig

Audio config.

- (ZegoAudioConfig *)getAudioConfig

Return Value

Audio config.

Declared In

ZegoExpressEngine+Publisher.h

– getAudioConfig:

Publish stream channel.

- (ZegoAudioConfig *)getAudioConfig:(ZegoPublishChannel)channel

Parameters

channel

Publish stream channel.

Return Value

Audio config.

Declared In

ZegoExpressEngine+Publisher.h

– setPublishStreamEncryptionKey:

The encryption key, note that the key length only supports 16/24/32 bytes.

- (void)setPublishStreamEncryptionKey:(NSString *)key

Parameters

key

The encryption key, note that the key length only supports 16/24/32 bytes.

Declared In

ZegoExpressEngine+Publisher.h

– setPublishStreamEncryptionKey:channel:

The encryption key, note that the key length only supports 16/24/32 bytes.

- (void)setPublishStreamEncryptionKey:(NSString *)key channel:(ZegoPublishChannel)channel

Parameters

key

The encryption key, note that the key length only supports 16/24/32 bytes.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– takePublishStreamSnapshot:

Results of take publish stream snapshot.

- (void)takePublishStreamSnapshot:(ZegoPublisherTakeSnapshotCallback)callback

Parameters

callback

Results of take publish stream snapshot.

Declared In

ZegoExpressEngine+Publisher.h

– takePublishStreamSnapshot:channel:

Results of take publish stream snapshot.

- (void)takePublishStreamSnapshot:(ZegoPublisherTakeSnapshotCallback)callback channel:(ZegoPublishChannel)channel

Parameters

callback

Results of take publish stream snapshot.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– mutePublishStreamAudio:

Whether to stop sending audio streams, YES means not to send audio stream, and NO means sending audio stream. The default is NO.

- (void)mutePublishStreamAudio:(BOOL)mute

Parameters

mute

Whether to stop sending audio streams, YES means not to send audio stream, and NO means sending audio stream. The default is NO.

Declared In

ZegoExpressEngine+Publisher.h

– mutePublishStreamAudio:channel:

Whether to stop sending audio streams, YES means not to send audio stream, and NO means sending audio stream. The default is NO.

- (void)mutePublishStreamAudio:(BOOL)mute channel:(ZegoPublishChannel)channel

Parameters

mute

Whether to stop sending audio streams, YES means not to send audio stream, and NO means sending audio stream. The default is NO.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– mutePublishStreamVideo:

Whether to stop sending video streams, YES means not to send video stream, and NO means sending video stream. The default is NO.

- (void)mutePublishStreamVideo:(BOOL)mute

Parameters

mute

Whether to stop sending video streams, YES means not to send video stream, and NO means sending video stream. The default is NO.

Declared In

ZegoExpressEngine+Publisher.h

– mutePublishStreamVideo:channel:

Whether to stop sending video streams, YES means not to send video stream, and NO means sending video stream. The default is NO.

- (void)mutePublishStreamVideo:(BOOL)mute channel:(ZegoPublishChannel)channel

Parameters

mute

Whether to stop sending video streams, YES means not to send video stream, and NO means sending video stream. The default is NO.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– setStreamAlignmentProperty:channel:

Whether to enable the stream mixing precision alignment function.

- (void)setStreamAlignmentProperty:(int)alignment channel:(ZegoPublishChannel)channel

Parameters

alignment

Whether to enable the stream mixing precision alignment function.

channel

Publish stream channel

Declared In

ZegoExpressEngine+Publisher.h

– enableTrafficControl:property:

Whether to enable traffic control. The default is ture.

- (void)enableTrafficControl:(BOOL)enable property:(ZegoTrafficControlProperty)property

Parameters

enable

Whether to enable traffic control. The default is ture.

property

Adjustable property of traffic control, bitmask OR format. Should be one or the combinations of [ZegoTrafficControlProperty] enumeration. [AdaptiveFPS] as default.

Declared In

ZegoExpressEngine+Publisher.h

– enableTrafficControl:property:channel:

Whether to enable traffic control. The default is ture.

- (void)enableTrafficControl:(BOOL)enable property:(ZegoTrafficControlProperty)property channel:(ZegoPublishChannel)channel

Parameters

enable

Whether to enable traffic control. The default is ture.

property

Adjustable property of traffic control, bitmask format. Should be one or the combinations of [ZegoTrafficControlProperty] enumeration. [AdaptiveFPS] as default.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– setMinVideoBitrateForTrafficControl:mode:

Minimum video bitrate threshold for traffic control(kbps).

- (void)setMinVideoBitrateForTrafficControl:(int)bitrate mode:(ZegoTrafficControlMinVideoBitrateMode)mode

Parameters

bitrate

Minimum video bitrate threshold for traffic control(kbps).

mode

Video sending mode below the minimum bitrate.

Declared In

ZegoExpressEngine+Publisher.h

– setMinVideoBitrateForTrafficControl:mode:channel:

Minimum video bitrate (kbps).

- (void)setMinVideoBitrateForTrafficControl:(int)bitrate mode:(ZegoTrafficControlMinVideoBitrateMode)mode channel:(ZegoPublishChannel)channel

Parameters

bitrate

Minimum video bitrate (kbps).

mode

Video sending mode below the minimum bitrate.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– setMinVideoFpsForTrafficControl:channel:

The minimum video frame rate threshold for traffic control(fps).

- (void)setMinVideoFpsForTrafficControl:(int)fps channel:(ZegoPublishChannel)channel

Parameters

fps

The minimum video frame rate threshold for traffic control(fps).

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– setMinVideoResolutionForTrafficControl:height:channel:

The flow controls the width of the lowest video resolution.

- (void)setMinVideoResolutionForTrafficControl:(int)width height:(int)height channel:(ZegoPublishChannel)channel

Parameters

width

The flow controls the width of the lowest video resolution.

height

The flow controls the height of the lowest video resolution.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– setTrafficControlFocusOn:

When LOCAL_ONLY is selected, only the local network status is concerned. When choosing REMOTE, also take into account the remote network.

- (void)setTrafficControlFocusOn:(ZegoTrafficControlFocusOnMode)mode

Parameters

mode

When LOCAL_ONLY is selected, only the local network status is concerned. When choosing REMOTE, also take into account the remote network.

Declared In

ZegoExpressEngine+Publisher.h

– setTrafficControlFocusOn:channel:

When LOCAL_ONLY is selected, only the local network status is concerned. When choosing REMOTE, also take into account the remote network.

- (void)setTrafficControlFocusOn:(ZegoTrafficControlFocusOnMode)mode channel:(ZegoPublishChannel)channel

Parameters

mode

When LOCAL_ONLY is selected, only the local network status is concerned. When choosing REMOTE, also take into account the remote network.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– setCaptureVolume:

The volume gain percentage, the range is 0 ~ 200, and the default value is 100, which means 100% of the original collection volume of the device.

- (void)setCaptureVolume:(int)volume

Parameters

volume

The volume gain percentage, the range is 0 ~ 200, and the default value is 100, which means 100% of the original collection volume of the device.

Declared In

ZegoExpressEngine+Publisher.h

– setAudioCaptureStereoMode:

Audio stereo capture mode.

- (void)setAudioCaptureStereoMode:(ZegoAudioCaptureStereoMode)mode

Parameters

mode

Audio stereo capture mode.

Declared In

ZegoExpressEngine+Publisher.h

– addPublishCdnUrl:streamID:callback:

CDN relay address, supported address format is rtmp, rtmps.

- (void)addPublishCdnUrl:(NSString *)targetURL streamID:(NSString *)streamID callback:(nullable ZegoPublisherUpdateCdnUrlCallback)callback

Parameters

targetURL

CDN relay address, supported address format is rtmp, rtmps.

streamID

Stream ID.

callback

The execution result of update the relay CDN operation.

Declared In

ZegoExpressEngine+Publisher.h

– addPublishCdnUrl:streamID:timeout:callback:

CDN relay address, supported address format is rtmp, rtmps.

- (void)addPublishCdnUrl:(NSString *)targetURL streamID:(NSString *)streamID timeout:(int)timeout callback:(nullable ZegoPublisherUpdateCdnUrlCallback)callback

Parameters

targetURL

CDN relay address, supported address format is rtmp, rtmps.

streamID

Stream ID.

timeout

Timeout. Callback if it does not start in the time. Default is 0, which means no timeout. Valid range is [5, 600], in seconds. Less than 0 will be reset to 0, 1 to 4 will be reset to 5, and a greater than 600 will be reset to 600.

callback

The execution result of update the relay CDN operation.

Declared In

ZegoExpressEngine+Publisher.h

– removePublishCdnUrl:streamID:callback:

CDN relay address, supported address format rtmp.

- (void)removePublishCdnUrl:(NSString *)targetURL streamID:(NSString *)streamID callback:(nullable ZegoPublisherUpdateCdnUrlCallback)callback

Parameters

targetURL

CDN relay address, supported address format rtmp.

streamID

Stream ID.

callback

The execution result of update the relay CDN operation.

Declared In

ZegoExpressEngine+Publisher.h

– enablePublishDirectToCDN:config:

Whether to enable direct publish CDN, YES: enable direct publish CDN, NO: disable direct publish CDN.

- (void)enablePublishDirectToCDN:(BOOL)enable config:(nullable ZegoCDNConfig *)config

Parameters

enable

Whether to enable direct publish CDN, YES: enable direct publish CDN, NO: disable direct publish CDN.

config

CDN configuration, if nil, use Zego’s background default configuration.

Declared In

ZegoExpressEngine+Publisher.h

– enablePublishDirectToCDN:config:channel:

Whether to enable direct publish CDN, YES: enable direct publish CDN, NO: disable direct publish CDN.

- (void)enablePublishDirectToCDN:(BOOL)enable config:(nullable ZegoCDNConfig *)config channel:(ZegoPublishChannel)channel

Parameters

enable

Whether to enable direct publish CDN, YES: enable direct publish CDN, NO: disable direct publish CDN.

config

CDN configuration, if nil, use Zego’s background default configuration.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– setPublishWatermark:isPreviewVisible:

The upper left corner of the watermark layout is the origin of the coordinate system, and the area cannot exceed the size set by the encoding resolution. If it is nil, the watermark is cancelled.

- (void)setPublishWatermark:(nullable ZegoWatermark *)watermark isPreviewVisible:(BOOL)isPreviewVisible

Parameters

watermark

The upper left corner of the watermark layout is the origin of the coordinate system, and the area cannot exceed the size set by the encoding resolution. If it is nil, the watermark is cancelled.

isPreviewVisible

Whether the watermark can be seen in the local preview.

Declared In

ZegoExpressEngine+Publisher.h

– setPublishWatermark:isPreviewVisible:channel:

The upper left corner of the watermark layout is the origin of the coordinate system, and the area cannot exceed the size set by the encoding resolution. If it is nil, the watermark is cancelled.

- (void)setPublishWatermark:(nullable ZegoWatermark *)watermark isPreviewVisible:(BOOL)isPreviewVisible channel:(ZegoPublishChannel)channel

Parameters

watermark

The upper left corner of the watermark layout is the origin of the coordinate system, and the area cannot exceed the size set by the encoding resolution. If it is nil, the watermark is cancelled.

isPreviewVisible

the watermark is visible on local preview

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– setSEIConfig:

SEI configuration. The SEI defined by ZEGO is used by default.

- (void)setSEIConfig:(ZegoSEIConfig *)config

Parameters

config

SEI configuration. The SEI defined by ZEGO is used by default.

Declared In

ZegoExpressEngine+Publisher.h

– sendSEI:

SEI data.

- (void)sendSEI:(NSData *)data

Parameters

data

SEI data.

Declared In

ZegoExpressEngine+Publisher.h

– sendSEI:channel:

SEI data.

- (void)sendSEI:(NSData *)data channel:(ZegoPublishChannel)channel

Parameters

data

SEI data.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– sendSEISyncWithCustomVideo:timeStampNs:channel:

SEI data.

- (void)sendSEISyncWithCustomVideo:(NSData *)data timeStampNs:(unsigned long long)timeStampNs channel:(ZegoPublishChannel)channel

Parameters

data

SEI data.

timeStampNs

video frame reference time, UNIX timestamp, in nanosecond.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– sendAudioSideInfo:timeStampMs:channel:

Audio side info data.

- (void)sendAudioSideInfo:(NSData *)data timeStampMs:(double)timeStampMs channel:(ZegoPublishChannel)channel

Parameters

data

Audio side info data.

timeStampMs

timeStampMs, derived from custom audio processing, in milliseconds. If you fill in 0, it is sent along with the frame that is currently ready to be sent.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– enableHardwareEncoder:

Whether to enable hardware encoding, YES: enable hardware encoding, NO: disable hardware encoding.

- (void)enableHardwareEncoder:(BOOL)enable

Parameters

enable

Whether to enable hardware encoding, YES: enable hardware encoding, NO: disable hardware encoding.

Declared In

ZegoExpressEngine+Publisher.h

– setCapturePipelineScaleMode:

The capture scale timing mode.

- (void)setCapturePipelineScaleMode:(ZegoCapturePipelineScaleMode)mode

Parameters

mode

The capture scale timing mode.

Declared In

ZegoExpressEngine+Publisher.h

– setDummyCaptureImagePath:channel:

Picture file path

- (void)setDummyCaptureImagePath:(NSString *)filePath channel:(ZegoPublishChannel)channel

Parameters

filePath

Picture file path

channel

Publish channel.

Declared In

ZegoExpressEngine+Publisher.h

– enableH265EncodeFallback:

Whether to enable H.265 coding automatically fallback to H.264 coding, YES: enable, NO: disable, and the default value is YES

- (void)enableH265EncodeFallback:(BOOL)enable

Parameters

enable

Whether to enable H.265 coding automatically fallback to H.264 coding, YES: enable, NO: disable, and the default value is YES

Declared In

ZegoExpressEngine+Publisher.h

– isVideoEncoderSupported:

Video codec id. Required: Yes.

- (BOOL)isVideoEncoderSupported:(ZegoVideoCodecID)codecID

Parameters

codecID

Video codec id. Required: Yes.

Return Value

Whether the specified video encoding is supported.Value range: YES means support, you can use this encoding format for publish; NO means the is not supported, and the encoding format cannot be used for publish.

Declared In

ZegoExpressEngine+Publisher.h

– isVideoEncoderSupported:codecBackend:

Video codec id. Required: Yes.

- (int)isVideoEncoderSupported:(ZegoVideoCodecID)codecID codecBackend:(ZegoVideoCodecBackend)codecBackend

Parameters

codecID

Video codec id. Required: Yes.

codecBackend

Backend implementation of encoder. Required: Yes.

Return Value

Whether the specified video encoding format is supported; 0 means not supported, and the encoding format cannot be used for publish stream; 1 means support, you can use this encoding format for publish stream; 2 means not confirmed, it is recommended to call this interface later.

Declared In

ZegoExpressEngine+Publisher.h

– setAppOrientationMode:

Orientation mode of the video.

- (void)setAppOrientationMode:(ZegoOrientationMode)mode

Parameters

mode

Orientation mode of the video.

Declared In

ZegoExpressEngine+Publisher.h

– setVideoSource:

Video capture source.

- (int)setVideoSource:(ZegoVideoSourceType)source

Parameters

source

Video capture source.

Declared In

ZegoExpressEngine+Publisher.h

– setVideoSource:instanceID:

Video capture source.

- (int)setVideoSource:(ZegoVideoSourceType)source instanceID:(unsigned int)instanceID

Parameters

source

Video capture source.

instanceID

Video capture source instance id.

Declared In

ZegoExpressEngine+Publisher.h

– setVideoSource:channel:

Video capture source.

- (int)setVideoSource:(ZegoVideoSourceType)source channel:(ZegoPublishChannel)channel

Parameters

source

Video capture source.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– setVideoSource:instanceID:channel:

Video capture source.

- (int)setVideoSource:(ZegoVideoSourceType)source instanceID:(unsigned int)instanceID channel:(ZegoPublishChannel)channel

Parameters

source

Video capture source.

instanceID

Video capture source instance id.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– setAudioSource:

Audio capture source.

- (int)setAudioSource:(ZegoAudioSourceType)source

Parameters

source

Audio capture source.

Declared In

ZegoExpressEngine+Publisher.h

– setAudioSource:channel:

Audio capture source.

- (int)setAudioSource:(ZegoAudioSourceType)source channel:(ZegoPublishChannel)channel

Parameters

source

Audio capture source.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– setAudioSource:config:

Audio capture source.

- (int)setAudioSource:(ZegoAudioSourceType)source config:(ZegoAudioSourceMixConfig *)config

Parameters

source

Audio capture source.

config

Audio capture source mix config.

Declared In

ZegoExpressEngine+Publisher.h

– enableVideoObjectSegmentation:type:channel:

Whether to enable video object segmentation, off by default.

- (void)enableVideoObjectSegmentation:(BOOL)enable type:(ZegoObjectSegmentationType)type channel:(ZegoPublishChannel)channel

Parameters

enable

Whether to enable video object segmentation, off by default.

type

The type of object segmentation.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– enableVideoObjectSegmentation:config:channel:

Whether to enable video object segmentation, off by default.

- (void)enableVideoObjectSegmentation:(BOOL)enable config:(ZegoObjectSegmentationConfig *)config channel:(ZegoPublishChannel)channel

Parameters

enable

Whether to enable video object segmentation, off by default.

config

The type of object segmentation.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– enableAlphaChannelVideoEncoder:alphaLayout:channel:

Enable video encoder alpha channel support, off by default.

- (void)enableAlphaChannelVideoEncoder:(BOOL)enable alphaLayout:(ZegoAlphaLayoutType)alphaLayout channel:(ZegoPublishChannel)channel

Parameters

enable

Enable video encoder alpha channel support, off by default.

alphaLayout

Specify the layout position of the alpha channel data.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

– setCameraStabilizationMode:channel:

The camera stabilization mode. \niOS:See Apple AVCaptureVideoStabilizationMode definition for details. The default value is 0. \nAndroid:AUTO:-1, OFF:0. The default value is 0.

- (void)setCameraStabilizationMode:(int)mode channel:(ZegoPublishChannel)channel

Parameters

mode

The camera stabilization mode. \niOS:See Apple AVCaptureVideoStabilizationMode definition for details. The default value is 0. \nAndroid:AUTO:-1, OFF:0. The default value is 0.

channel

Publish stream channel.

Declared In

ZegoExpressEngine+Publisher.h

RangeScene Methods

– createRangeScene

range scene instance object.

- (nullable ZegoRangeScene *)createRangeScene

Return Value

range scene instance object.

Declared In

ZegoExpressEngine+RangeScene.h

– destroyRangeScene:

The range scene instance object to be destroyed.

- (void)destroyRangeScene:(ZegoRangeScene *)rangeScene

Parameters

rangeScene

The range scene instance object to be destroyed.

Declared In

ZegoExpressEngine+RangeScene.h

CopyrightedMusic Methods

– createCopyrightedMusic

copyrighted music instance, multiple calls to this function return the same object.

- (nullable ZegoCopyrightedMusic *)createCopyrightedMusic

Return Value

copyrighted music instance, multiple calls to this function return the same object.

Declared In

ZegoExpressEngine+CopyrightedMusic.h

– destroyCopyrightedMusic:

The copyrighted music instance object to be destroyed.

- (void)destroyCopyrightedMusic:(ZegoCopyrightedMusic *)copyrightedMusic

Parameters

copyrightedMusic

The copyrighted music instance object to be destroyed.

Declared In

ZegoExpressEngine+CopyrightedMusic.h