이 페이지는 현재 영어로만 제공되며 한국어 버전은 곧 제공될 예정입니다. 기다려 주셔서 감사드립니다.

TUIRoomEngine

Copyright (c) 2024 Tencent. All rights reserved.

Module: TUIRoomEngine @ TUIKitEngine.
Function: TUIRoomEngine Main function APIs.
Version: 12.0

TUIRoomEngine

TUIRoomEngine

FuncList
DESC
Destroy the TUIRoomEngine instance (singleton mode)
After creating a TUIRoomEngine instance, you should login with sdkAppId, userId and userSig then you can call TUIRoomEngine instance and other function.
Log out of your account. If you are in the room, there will be active leaving room and destroying resource operations.
Update user name and avatar for logged-in user.
Return the basic information of the logged-in user, including nickname and avatar.
Update user basic information for logged-in user.
Set event observer.
Remove event observer.
Create a room.
Dismiss the room.
Enter a room.
Enter a room.
Enter a room.
Exit the room.
Fetch room information.
Fetch room information.
Update room name (only support for administrators or room owner).
Update room seat mode (only support for administrators or room owner).
Update room password.
Get room metadata.
Set room metadata, if the key already exists, update its value, if not, add the key.
Set the local camera to preview the render view.
Open the local camera.
Close the local camera.
Start publishing local video stream, default enabled.
Stop publishing local video stream.
Update video encoding quality.
Set the video encoding parameters.
Set the video resolution mode (horizontal resolution or vertical resolution).
Turn on gravity sensing mode. (only availble on mobile OS and the camera capture scene inside the SDK).
Start screen sharing (only available on mobile OS).
Start screen sharing (only available on Mac OS).
Stop screen sharing.
Get the sharable screen and windows (only available on Mac OS)
Select the screen or windows to share (only available on Mac OS)
Open local microphone.
Close the local microphone.
Update audio encoding quality.
Pause publishing the local audio stream.
Resume publishing the local audio stream.
Set the render view for remote user.
Start playing the remote user's video stream.
Stop playing the remote user's video stream.
Mute the remote user's audio stream.
Get the list of user in the room.
Get user information.
Change user role (only support for administrators or room owner).
Change user nickname in the room (only support to change all user for administrators or room owner, user can only change by self).
Kick the remote user out of the room (only support for administrators or room owner).
Add a tag for the user (only support for administrators or room owner).
Remove tag for user (only support for room owner).
Get user information in the room based on the tag.
Set custom information for room users.
The owner or administrator control that all users whether can open device. For example: all users are prohibited from opening the microphone(only available in the conference scenario).
Request the remote user to open the media device (only support for administrators or room owner).
Close remote user media devices (only support for administrators or room owner).
Apply to open the local media device (available to general users).
Set the maximum number of seat (only available before entering room and when creating room).
Get seat list.
Lock the seat (only support for administrators or room owner).
Take the seat.
Leave the seat.
Move to seat.
Invite user to take the seat (only support for administrators or room owner).
Kick off the user from seat (only support for administrators or room owner).
Get the request list of users who want to take the seat in the room (only support for administrators or room owner).
Disable the ability of remote users to send messages (only support for administrators or room owner).
Disable the ability of all users to send messages (only support for administrators or room owner).
Cancel request.
Response request.
Set the beauty level.
Set whitening level.
Get the extension.
Get device management class.
Get live-connection management class.
Call experimental APIs.

destroySharedInstance

destroySharedInstance

Destroy the TUIRoomEngine instance (singleton mode)

loginWithSDKAppId:userId:userSig:onSuccess:onError:

loginWithSDKAppId:userId:userSig:onSuccess:onError:
+ (void)loginWithSDKAppId:
(NSInteger)sdkAppId
userId:
(NSString *)userId
userSig:
(NSString *)userSig
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

After creating a TUIRoomEngine instance, you should login with sdkAppId, userId and userSig then you can call TUIRoomEngine instance and other function.

If a user is kicked off while online, the SDK will notify you through the $onKickedOffLine$ callback in $TUIRoomObserver$.
Param
DESC
sdkAppId
It is Application ID. You can see the SDKAppId by creating an application in the TRTC Console.
userId
User ID, it is the unique identifier used by Tencent Cloud to distinguish users.
userSig
The user signature designed by Tencent Cloud based on the UserId, which is used to access Tencent Cloud services. More details, see UserSig

logout:onError:

logout:onError:
+ (void)logout:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Log out of your account. If you are in the room, there will be active leaving room and destroying resource operations.

setSelfInfoWithUserName:avatarUrl:onSuccess:onError:

setSelfInfoWithUserName:avatarUrl:onSuccess:onError:
+ (void)setSelfInfoWithUserName:
(NSString *)userName
avatarUrl:
(NSString *)avatarURL
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Update user name and avatar for logged-in user.

Param
DESC
avatarURL
User avatar URL.
userName
User name.

getSelfInfo

getSelfInfo

Return the basic information of the logged-in user, including nickname and avatar.

Return Desc:

TUILoginUserInfo User login information.

setSelfInfo:onSuccess:onError:

setSelfInfo:onSuccess:onError:
+ (void)setSelfInfo:
(TUILoginUserInfo *)userInfo
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Update user basic information for logged-in user.

Param
DESC
userInfo
Local user information.

addObserver:

addObserver:
- (void)addObserver:
(id<TUIRoomObserver>)observer

Set event observer.

You can use TUIRoomObserver to receive roomEngine events. More details, see TUIRoomObserver.
Param
DESC
observer
Listening instance.

removeObserver:

removeObserver:
- (void)removeObserver:
(id<TUIRoomObserver>)observer

Remove event observer.

Param
DESC
observer
The event observer to be removed.

createRoom:onSuccess:onError:

createRoom:onSuccess:onError:
- (void)createRoom:
(TUIRoomInfo *)roomInfo
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Create a room.

You can create a conference room or live room through this API.
Param
DESC
roomInfo
Room information. More details, see TUIRoomInfo.

destroyRoom:onError:

destroyRoom:onError:
- (void)destroyRoom:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Dismiss the room.

After the room was dismissed, the SDK notifies the users in the room through the onRoomDismissed callback in $TUIRoomObserver$.

enterRoom:onSuccess:onError:

enterRoom:onSuccess:onError:
- (void)enterRoom:
(NSString *)roomId
onSuccess:
(TUIRoomInfoBlock)onSuccess
onError:
(TUIErrorBlock)onError

Enter a room.

Param
DESC
roomId
Room ID.
Note
The limit on the number of rooms that a single device can enter at the same time is: 1 for conference and 3 for live . If the limit is exceeded, the device will exit the earliest joined room. When multiple devices log in with the same account, only one device is allowed to enter a conference room with the same ID. When other devices try to enter, the earlier entered device will be kicked out.
After entered the room, the SDK will notify the user in the room through the $onRemoteUserEnterRoom$ callback in $TUIRoomObserver$.

enterRoom:roomType:onSuccess:onError:

enterRoom:roomType:onSuccess:onError:
- (void)enterRoom:
(NSString *)roomId
roomType:
(TUIRoomType)roomType
onSuccess:
(TUIRoomInfoBlock)onSuccess
onError:
(TUIErrorBlock)onError

Enter a room.

Param
DESC
roomId
Room ID.
roomType
Room type. More details, see TUIRoomType.
Note
The limit on the number of rooms that a single device can enter at the same time is: 1 for conference and 3 for live . If the limit is exceeded, the device will exit the earliest joined room. When multiple devices log in with the same account, only one device is allowed to enter a conference room with the same ID. When other devices try to enter, the earlier entered device will be kicked out.
After entered the room, the SDK will notify the user in the room through the $onRemoteUserEnterRoom$ callback in $TUIRoomObserver$.

enterRoom:roomType:options:onSuccess:onError:

enterRoom:roomType:options:onSuccess:onError:
- (void)enterRoom:
(NSString *)roomId
roomType:
(TUIRoomType)roomType
options:
(TUIEnterRoomOptions *)options
onSuccess:
(TUIRoomInfoBlock)onSuccess
onError:
(TUIErrorBlock)onError

Enter a room.

Param
DESC
options
Roon options. More details, see TUIEnterRoomOptions.
roomId
Room ID.
roomType
Room type. More details, see TUIRoomType.
Note
The limit on the number of rooms that a single device can enter at the same time is: 1 for conference and 3 for live . If the limit is exceeded, the device will exit the earliest joined room. When multiple devices log in with the same account, only one device is allowed to enter a conference room with the same ID. When other devices try to enter, the earlier entered device will be kicked out.
After entering the room, the SDK will notify the user in the room through the $onRemoteUserEnterRoom$ callback in $TUIRoomObserver$.

exitRoom:onSuccess:onError:

exitRoom:onSuccess:onError:
- (void)exitRoom:
(BOOL)syncWaiting
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Exit the room.

After left the room, the SDK will notify the user in the room through the onRemoteUserLeaveRoom callback in $TUIRoomObserver$.
Param
DESC
syncWaiting
true: wait for exit request finished, false: exit immediately.

fetchRoomInfo:onError:

fetchRoomInfo:onError:
- (void)fetchRoomInfo:
(TUIRoomInfoBlock)onSuccess
onError:
(TUIErrorBlock)onError

Fetch room information.

You can get room information through this API.

fetchRoomInfo:roomType:onSuccess:onError:

fetchRoomInfo:roomType:onSuccess:onError:
- (void)fetchRoomInfo:
(NSString*)roomId
roomType:
(TUIRoomType)roomType
onSuccess:
(TUIRoomInfoBlock)onSuccess
onError:
(TUIErrorBlock)onError

Fetch room information.

Param
DESC
roomId
Room ID.
roomType
Room type. More details, see TUIRoomType.

Return Desc:

Successfully fetched the room information callback, which will include room information of $TUIRoomInfo.

updateRoomNameByAdmin:onSuccess:onError:

updateRoomNameByAdmin:onSuccess:onError:
- (void)updateRoomNameByAdmin:
(NSString *)roomName
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Update room name (only support for administrators or room owner).

After the room name was updated, the SDK notifies users in the room through the onRoomNameChanged callback in $TUIRoomObserver$.
Param
DESC
roomName
Room name.

updateRoomSeatModeByAdmin:onSuccess:onError:

updateRoomSeatModeByAdmin:onSuccess:onError:
- (void)updateRoomSeatModeByAdmin:
(TUISeatMode)seatMode
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Update room seat mode (only support for administrators or room owner).

After the room seat mode was updated, the SDK will notify users in the room through the onRoomSeatModeChanged callback in $TUIRoomObserver$.
Param
DESC
seatMode
TUISeatModeFreeToTake: Free to take seat mode, users can take the seat without application;
TUISeatModeApplyToTake: Apply to take seat mode, users can only take the seat after the owner or administrator approved.

updateRoomPasswordByAdmin:onSuccess:onError:

updateRoomPasswordByAdmin:onSuccess:onError:
- (void)updateRoomPasswordByAdmin:
(NSString *)password
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Update room password.

Param
DESC
password
Room password.

getRoomMetadata:onSuccess:onError:

getRoomMetadata:onSuccess:onError:
- (void)getRoomMetadata:
(NSArray<NSString *> *)keys
onSuccess:
(TUIRoomMetadataResponseBlock)onSuccess
onError:
(TUIErrorBlock)onError

Get room metadata.

Param
DESC
keys
Room metadata key list, if keys are passed as empty, all metadata will be retrieved.

setRoomMetadataByAdmin

setRoomMetadataByAdmin

Set room metadata, if the key already exists, update its value, if not, add the key.

Param
DESC
metadata
Key-Value in room metadata.

setLocalVideoView:

setLocalVideoView:
- (void)setLocalVideoView:
(TUIVideoView *__nullable)view

Set the local camera to preview the render view.

Param
DESC
view
Render view.

openLocalCamera:quality:onSuccess:onError:

openLocalCamera:quality:onSuccess:onError:
- (void)openLocalCamera:
(BOOL)isFront
quality:
(TUIVideoQuality)quality
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Open the local camera.

After opened the local camera in the room, the local video stream is published by default, and the SDK notifies the users in the room through the $onUserVideoStateChanged$ callback in $TUIRoomObserver$.
Param
DESC
isFront
YES: front NO: rear (only available on mobile OS).

closeLocalCamera

closeLocalCamera

Close the local camera.

After closed the local camera in the room, the SDK notifies users in the room through the onUserVideoStateChanged callback in $TUIRoomObserver$.

startPushLocalVideo

startPushLocalVideo

Start publishing local video stream, default enabled.

After published the local video, if your local camera is opening, the SDK will notify users in the room through the onUserVideoStateChanged callback in $TUIRoomObserver$.

stopPushLocalVideo

stopPushLocalVideo

Stop publishing local video stream.

After stopped published local video, the SDK notifies users in the room through the onUserVideoStateChanged callback in $TUIRoomObserver$.

updateVideoQuality:

updateVideoQuality:
- (void)updateVideoQuality:
(TUIVideoQuality)quality

Update video encoding quality.

updateVideoQualityEx:params:

updateVideoQualityEx:params:
- (void)updateVideoQualityEx:
(TUIVideoStreamType)streamType
params:

Set the video encoding parameters.

Param
DESC
params
Encoding parameters of the video. More details, see TUIRoomVideoEncoderParams.
streamType
The type of video stream. More details, see TUIVideoStreamType.

setVideoResolutionMode:resolutionMode:

setVideoResolutionMode:resolutionMode:
- (void)setVideoResolutionMode:
(TUIVideoStreamType)streamType
resolutionMode:
(TUIResolutionMode)resolutionMode

Set the video resolution mode (horizontal resolution or vertical resolution).

Param
DESC
resolutionMode
Resolution mode. More details, see TUIResolutionMode.
streamType
The type of video stream. More details, see TUIVideoStreamType.

enableGravitySensor:

enableGravitySensor:
- (void)enableGravitySensor:
(BOOL)enable

Turn on gravity sensing mode. (only availble on mobile OS and the camera capture scene inside the SDK).

Param
DESC
enable
YES: Open NO: Close.
Note
After turning on gravity sensing, if the device on the collection end rotates, the images on the collection end and the audience will be rendered accordingly to ensure that the image in the field of view is always facing up.

startScreenCaptureByReplaykit:

startScreenCaptureByReplaykit:
- (void)startScreenCaptureByReplaykit:
(NSString *)appGroup

Start screen sharing (only available on mobile OS).

After screen sharing started, the SDK notifies users in the room through the onUserVideoStateChanged callback in $TUIRoomObserver$.

startScreenCapture:onSuccess:onError:

startScreenCapture:onSuccess:onError:
- (void)startScreenCapture:
(TUIVideoView *)view
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Start screen sharing (only available on Mac OS).

After screen sharing started, the SDK notifies users in the room through the onUserVideoStateChanged callback in $TUIRoomObserver$.
Param
DESC
view
The render view can be set a null value, it means not displaying the preview screen locally.
Note
The API can capture the screen content of the entire Mac OS, or capture and share the window content you select.

stopScreenCapture

stopScreenCapture

Stop screen sharing.

After screen sharing ended, the SDK notifies users in the room through the onUserVideoStateChanged callback in $TUIRoomObserver$ and also notifies you through the onUserScreenCaptureStopped callback.

getScreenCaptureSources

getScreenCaptureSources

Get the sharable screen and windows (only available on Mac OS)

The user can use the API to select the screen and window that can be shared. Through the API, you can query the ID, name, and thumbnail of the window that can be shared in the current system.
Note
The returned list contains screens and application windows. The screen is the first element in the list. If the user has more monitors, each monitor is a sharing target.

Return Desc:

The list of windows, including screens.

selectScreenCaptureTarget:

selectScreenCaptureTarget:
- (void)selectScreenCaptureTarget:
(NSString *)targetId

Select the screen or windows to share (only available on Mac OS)

After you obtain the screen and window that can be shared through getScreenCaptureSources, you can call the API to select the target screen or window.
During the screen sharing, you can also call the API to change the sharing target.
Param
DESC
targetId
Selected sharing source.

openLocalMicrophone:onSuccess:onError:

openLocalMicrophone:onSuccess:onError:
- (void)openLocalMicrophone:
(TUIAudioQuality)quality
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Open local microphone.

After opened the local microphone in a room, the SDK notifies users in the room through the onUserAudioStateChanged callback in $TUIRoomObserver$.
Param
DESC
quality
Audio quality.

closeLocalMicrophone

closeLocalMicrophone

Close the local microphone.

After closed the local microphone in the room, the SDK notifies the users in the room through the onUserAudioStateChanged callback in $TUIRoomObserver$.

updateAudioQuality:

updateAudioQuality:
- (void)updateAudioQuality:
(TUIAudioQuality)quality

Update audio encoding quality.

muteLocalAudio

muteLocalAudio

Pause publishing the local audio stream.

If you have opened your microphone and call the API to pause publishing the local audio stream, the SDK will notify the users in the room through the onUserAudioStateChanged callback in $TUIRoomObserver$.

unmuteLocalAudio:onError:

unmuteLocalAudio:onError:
- (void)unmuteLocalAudio:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Resume publishing the local audio stream.

If you have opened your microphone and call the API to resume publishing the local audio stream, the SDK will notify the users in the room through the onUserAudioStateChanged callback in $TUIRoomObserver$.

setRemoteVideoView:streamType:view:

setRemoteVideoView:streamType:view:
- (void)setRemoteVideoView:
(NSString *)userId
streamType:
(TUIVideoStreamType)streamType
view:
(TUIVideoView *__nullable)view

Set the render view for remote user.

Param
DESC
streamType
The type of video stream. More details, see TUIVideoStreamType.
userId
Remote user ID.
view
Render view.

startPlayRemoteVideo:streamType:onPlaying:onLoading:onError:

startPlayRemoteVideo:streamType:onPlaying:onLoading:onError:
- (void)startPlayRemoteVideo:
(NSString *)userId
streamType:
(TUIVideoStreamType)streamType
onPlaying:
(TUIPlayOnPlayingBlock)onPlaying
onLoading:
(TUIPlayOnLoadingBlock)onLoading
onError:
(TUIPlayOnErrorBlock)onError

Start playing the remote user's video stream.

Param
DESC
streamType
The type of video stream. More details, see TUIVideoStreamType.
userId
User ID.

stopPlayRemoteVideo:streamType:

stopPlayRemoteVideo:streamType:
- (void)stopPlayRemoteVideo:
(NSString *)userId
streamType:
(TUIVideoStreamType)streamType

Stop playing the remote user's video stream.

Param
DESC
streamType
The type of video stream. More details, see TUIVideoStreamType.
userId
User ID.

muteRemoteAudioStream:isMute:

muteRemoteAudioStream:isMute:
- (void)muteRemoteAudioStream:
(NSString *)userId
isMute:
(BOOL)isMute

Mute the remote user's audio stream.

Param
DESC
isMute
true: pause pulling remote user's audio stream, false: resume pulling remote user's audio stream.
userId
User ID.

getUserList:onSuccess:onError:

getUserList:onSuccess:onError:
- (void)getUserList:
(NSInteger)nextSequence
onSuccess:
(TUIUserListResponseBlock)onSuccess
onError:
(TUIErrorBlock)onError

Get the list of user in the room.

Param
DESC
nextSequence
Filling in 0 for the first request, if the returned data of the callback is not zero, paging is required, continue the operation until it is 0.

getUserInfo:onSuccess:onError:

getUserInfo:onSuccess:onError:
- (void)getUserInfo:
(NSString *)userId
onSuccess:
(TUIUserInfoBlock)onSuccess
onError:
(TUIErrorBlock)onError

Get user information.

Param
DESC
userId
User ID.

changeUserRole:role:onSuccess:onError:

changeUserRole:role:onSuccess:onError:
- (void)changeUserRole:
(NSString *)userId
role:
(TUIRole)role
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Change user role (only support for administrators or room owner).

After the user role changed, the SDK will notify the users in the room through the onUserInfoChanged callback in $TUIRoomObserver$.
Param
DESC
role
User role. More details, see TUIRole.
userId
User ID.

changeUserNameCard:nameCard:onSuccess:onError:

changeUserNameCard:nameCard:onSuccess:onError:
- (void)changeUserNameCard:
(NSString *)userId
nameCard:
(NSString *)nameCard
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Change user nickname in the room (only support to change all user for administrators or room owner, user can only change by self).

After the user nickname changed, the SDK will notify the users in the room through the onUserInfoChanged callback in $TUIRoomObserver$.
Param
DESC
nameCard
User nickname to set, maximum support is 32 bytes
userId
User ID to change.

kickRemoteUserOutOfRoom:onSuccess:onError:

kickRemoteUserOutOfRoom:onSuccess:onError:
- (void)kickRemoteUserOutOfRoom:
(NSString *)userId
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Kick the remote user out of the room (only support for administrators or room owner).

After the remote user is kicked off from the room, the SDK notifies the kicked user through the onKickedOutOfRoom callback in $TUIRoomObserver$ and notifies users in the room through onRemoteUserLeaveRoom.
Param
DESC
userId
User ID.

addCategoryTagForUsers:userList:onSuccess:onError:

addCategoryTagForUsers:userList:onSuccess:onError:
- (void)addCategoryTagForUsers:
(NSInteger)tag
userList:
(NSArray<NSString *> *)userList
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Add a tag for the user (only support for administrators or room owner).

Param
DESC
tag
Integer type, it is recommended that this value must be greater than or equal to 1000, you can customize it.
userList
User list.

removeCategoryTagForUsers:userList:onSuccess:onError:

removeCategoryTagForUsers:userList:onSuccess:onError:
- (void)removeCategoryTagForUsers:
(NSInteger)tag
userList:
(NSArray<NSString *> *)userList
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Remove tag for user (only support for room owner).

Param
DESC
tag
Integer type, it is recommended that this value must be greater than or equal to 1000, you can customize it.
userList
User list.

getUserListByTag:nextSequence:onSuccess:onError:

getUserListByTag:nextSequence:onSuccess:onError:
- (void)getUserListByTag:
(NSInteger)tag
nextSequence:
(NSInteger)nextSequence
onSuccess:
(TUIUserListResponseBlock)onSuccess
onError:
(TUIErrorBlock)onError

Get user information in the room based on the tag.

Param
DESC
nextSequence
Filling in 0 for the first request, if the returned data of the callback is not zero, paging is required, continue the operation until it is 0.
tag
Integer type, it is recommended that this value must be greater than or equal to 1000, you can customize it.

setCustomInfoForUser:onSuccess:onError:

setCustomInfoForUser:onSuccess:onError:
- (void)setCustomInfoForUser:
(NSString *)userId
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Set custom information for room users.

Param
DESC
customInfo
Custom information.
userId
User userId.

disableDeviceForAllUserByAdmin:isDisable:onSuccess:onError:

disableDeviceForAllUserByAdmin:isDisable:onSuccess:onError:
- (void)disableDeviceForAllUserByAdmin:
(TUIMediaDevice)device
isDisable:
(BOOL)isDisable
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

The owner or administrator control that all users whether can open device. For example: all users are prohibited from opening the microphone(only available in the conference scenario).

After the API call is successful:
If the device type is MICROPHONE , the SDK will notify the users in the room through onAllUserMicrophoneDisableChanged in $TUIRoomObserver$.
If the device type is CAMERA , the SDK will notify the users in the room through onAllUserCameraDisableChanged in $TUIRoomObserver$.
If the device type is SCREEN_SHARING , the SDK will notify the users in the room through onScreenShareForAllUserDisableChanged in $TUIRoomObserver$.
Param
DESC
device
Device. More details, see: TUIMediaDevice.
isDisable
true: disable user to open device, false: enable user to open device.

openRemoteDeviceByAdmin:device:timeout:onAccepted:onRejected:onCancelled:onTimeout:onError:

openRemoteDeviceByAdmin:device:timeout:onAccepted:onRejected:onCancelled:onTimeout:onError:
- (TUIRequest *)openRemoteDeviceByAdmin:
(NSString *)userId
device:
(TUIMediaDevice)device
timeout:
(NSTimeInterval)timeout
onAccepted:
(nullable TUIRequestAcceptedBlock)onAccepted
onRejected:
(nullable TUIRequestRejectedBlock)onRejected
onCancelled:
(nullable TUIRequestCancelledBlock)onCancelled
onTimeout:
(nullable TUIRequestTimeoutBlock)onTimeout
onError:
(nullable TUIRequestErrorBlock)onError

Request the remote user to open the media device (only support for administrators or room owner).

After calling the API, the SDK will notify the requested user through onRequestReceived in $TUIRoomObserver$.
Param
DESC
device
Media device. More details, see: TUIMediaDevice.
timeout
Timeout time, in seconds. If it is set to 0, the SDK will not execute timeout detection and will not trigger a timeout callback.
userId
User ID.

Return Desc:

TUIRequest Request body.

closeRemoteDeviceByAdmin:device:onSuccess:onError:

closeRemoteDeviceByAdmin:device:onSuccess:onError:
- (void)closeRemoteDeviceByAdmin:
(NSString *)userId
device:
(TUIMediaDevice)device
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Close remote user media devices (only support for administrators or room owner).

After the API call is successful:
If the device type is MICROPHONE, the SDK will notify the users in the room through onUserAudioStateChanged in $TUIRoomObserver$.
If the device type is CAMERA or SCREEN_SHARING, the SDK will notify the users in the room through onUserVideoStateChanged in $TUIRoomObserver$.
Param
DESC
device
Media device. More details, see: TUIMediaDevice.
userId
User ID.

applyToAdminToOpenLocalDevice:timeout:onAccepted:onRejected:onCancelled:onTimeout:onError:

applyToAdminToOpenLocalDevice:timeout:onAccepted:onRejected:onCancelled:onTimeout:onError:
- (TUIRequest *)applyToAdminToOpenLocalDevice:
(TUIMediaDevice)device
timeout:
(NSTimeInterval)timeout
onAccepted:
(nullable TUIRequestAcceptedBlock)onAccepted
onRejected:
(nullable TUIRequestRejectedBlock)onRejected
onCancelled:
(nullable TUIRequestCancelledBlock)onCancelled
onTimeout:
(nullable TUIRequestTimeoutBlock)onTimeout
onError:
(nullable TUIRequestErrorBlock)onError

Apply to open the local media device (available to general users).

After the API call is successful, the SDK will notify the requested user through onRequestRequestReceived in $TUIRoomObserver$.
Param
DESC
device
Media device. More details, see:TUIMediaDevice.
timeout
Timeout time, in seconds. If it is set to 0, the SDK will not execute timeout detection and will not trigger a timeout callback.

Return Desc:

TUIRequest: Request body.

setMaxSeatCount:onSuccess:onError:

setMaxSeatCount:onSuccess:onError:
- (void)setMaxSeatCount:
(NSUInteger)maxSeatCount
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Set the maximum number of seat (only available before entering room and when creating room).

Param
DESC
maxSeatCount
Maximum number of seat.

getSeatList:onError:

getSeatList:onError:
- (void)getSeatList:
(TUISeatListResponseBlock)onSuccess
onError:
(TUIErrorBlock)onError

Get seat list.

lockSeatByAdmin:lockMode:onSuccess:onError:

lockSeatByAdmin:lockMode:onSuccess:onError:
- (void)lockSeatByAdmin:
(NSInteger)seatIndex
lockMode:
(TUISeatLockParams *)lockParams
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Lock the seat (only support for administrators or room owner).

If the lockParams is lockSeat, it means that the current seat can not be taken by all users and the user will be kicked off if the seat was taken.
If the lockParams is lockVideo/lockAudio, it means that the current seat can not publish video/audio stream.
Param
DESC
lockParams
Seat lock parameter. More details, see: $TUISeatLockParam$.
seatIndex
Seat index.

takeSeat:timeout:onAccepted:onRejected:onCancelled:onTimeout:onError:

takeSeat:timeout:onAccepted:onRejected:onCancelled:onTimeout:onError:
- (TUIRequest *)takeSeat:
(NSInteger)seatIndex
timeout:
(NSTimeInterval)timeout
onAccepted:
(TUIRequestAcceptedBlock)onAccepted
onRejected:
(TUIRequestRejectedBlock)onRejected
onCancelled:
(TUIRequestCancelledBlock)onCancelled
onTimeout:
(TUIRequestTimeoutBlock)onTimeout
onError:
(TUIRequestErrorBlock)onError

Take the seat.

The user can publish audio/video stream after taking the seat when isSeatEnable is true.
After taking the seat successfully, the SDK will notify the users in the room through $onSeatListChanged$ in $TUIRoomObserver$.
Param
DESC
seatIndex
Seat index. If the seat is not enabled or the sequence of seats is not concerned, just fill in -1.
timeout
Timeout time, in seconds. If it is set to 0, the SDK will not execute timeout detection and will not trigger a timeout callback.
Note
When the TUISeatMode is ApplyToTake, the operation to take seat need approval from the owner or administrator.
When the TUISeatMode is FreeToTake, you can take seat freely.

Return Desc:

TUIRequest Request body.

leaveSeat:onError:

leaveSeat:onError:
- (void)leaveSeat:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Leave the seat.

The user can not publish audio/video stream after leaving the seat when isSeatEnable is true.
After leaving seat successfully, the SDK will notify the users in the room through onSeatListChanged in $TUIRoomObserver$.

moveToSeat:onSuccess:onError:

moveToSeat:onSuccess:onError:
- (void)moveToSeat:
(NSInteger)targetSeatIndex
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Move to seat.

After moving seat successfully, the SDK will notify the users in the room through onSeatListChanged in $TUIRoomObserver$.

takeUserOnSeatByAdmin:userId:timeout:onAccepted:onRejected:onCancelled:onTimeout:onError:

takeUserOnSeatByAdmin:userId:timeout:onAccepted:onRejected:onCancelled:onTimeout:onError:
- (TUIRequest *)takeUserOnSeatByAdmin:
(NSInteger)seatIndex
userId:
(NSString *)userId
timeout:
(NSTimeInterval)timeout
onAccepted:
(TUIRequestAcceptedBlock)onAccepted
onRejected:
(TUIRequestRejectedBlock)onRejected
onCancelled:
(TUIRequestCancelledBlock)onCancelled
onTimeout:
(TUIRequestTimeoutBlock)onTimeout
onError:
(TUIRequestErrorBlock)onError

Invite user to take the seat (only support for administrators or room owner).

After the API call is successful, the SDK will notify the invited user through onRequestReceived in $TUIRoomObserver$.
Param
DESC
seatIndex
Seat index.
timeout
Timeout time, in seconds. If it is set to 0, the SDK will not execute timeout detection and will not trigger a timeout callback.
userId
User ID.

Return Desc:

TUIRequest: Request body.

kickUserOffSeatByAdmin:userId:onSuccess:onError:

kickUserOffSeatByAdmin:userId:onSuccess:onError:
- (void)kickUserOffSeatByAdmin:
(NSInteger)seatIndex
userId:
(NSString *)userId
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Kick off the user from seat (only support for administrators or room owner).

After the API call is successful, the SDK will notify the users in the room through onSeatListChanged in $TUIRoomObserver$.
Param
DESC
seatIndex
Seat index. If the seat is not enabled and the sequence of seats is not concerned, just fill in -1.
userId
User ID.

getSeatApplicationList:onError:

getSeatApplicationList:onError:
- (void)getSeatApplicationList:
(TUIRequestListResponseBlock)onSuccess
onError:
(TUIErrorBlock)onError

Get the request list of users who want to take the seat in the room (only support for administrators or room owner).

disableSendingMessageByAdmin:isDisable:onSuccess:onError:

disableSendingMessageByAdmin:isDisable:onSuccess:onError:
- (void)disableSendingMessageByAdmin:
(NSString *)userId
isDisable:
(BOOL)isDisable
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Disable the ability of remote users to send messages (only support for administrators or room owner).

After disabling the ability of remote users to send messages, the SDK notifies the disabled user through onSendMessageForUserDisableChanged in $TUIRoomObserver$.
Param
DESC
isDisable
true: disable user to send message, false: enable user to send message.
userId
User ID.

disableSendingMessageForAllUser:onSuccess:onError:

disableSendingMessageForAllUser:onSuccess:onError:
- (void)disableSendingMessageForAllUser:
(BOOL)isDisable
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Disable the ability of all users to send messages (only support for administrators or room owner).

After disabling the ability of all users to send messages, the SDK notifies users in the room through onSendMessageForAllUserDisableChanged in $TUIRoomObserver$.
Param
DESC
isDisable
true: disable all users to send message, false: enable all users to send message.

cancelRequest:onSuccess:onError:

cancelRequest:onSuccess:onError:
- (void)cancelRequest:
(NSString *)requestId
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Cancel request.

After cancelling a request, the SDK will notify the requested user through onRequestCancelled in $TUIRoomObserver$.
Param
DESC
requestId
Request ID (get from the sent request).
Note
The API can be used to cancel a request that has been sent.

responseRemoteRequest:agree:onSuccess:onError:

responseRemoteRequest:agree:onSuccess:onError:
- (void)responseRemoteRequest:
(NSString *)requestId
agree:
(BOOL)agree
onSuccess:
(TUISuccessBlock)onSuccess
onError:
(TUIErrorBlock)onError

Response request.

Param
DESC
agree
YES: Agree the request, NO: Reject the request.
requestId
Request ID (get from the sent request or notification of the OnRequestReceived event).
Note
When received a request, you can use this API to reply the received request.

setBeautyLevel:beautyLevel:

setBeautyLevel:beautyLevel:
- (void)setBeautyLevel:
(NSInteger)beautyStyle
beautyLevel:
(float)beautyLevel

Set the beauty level.

Param
DESC
beautyLevel
Beauty level, the value range is 0 - 9; 0 indicates to disable the filter, and 9 indicates the most obvious effect.
beautyStyle
Beauty style: TXBeautyStyleSmooth: Smooth; TXBeautyStyleNature: Natural; TXBeautyStylePitu: Pitu style.

setWhitenessLevel:

setWhitenessLevel:
- (void)setWhitenessLevel:
(float)whitenessLevel

Set whitening level.

Param
DESC
whitenessLevel
Whitening level, ranging from 0 - 9; 0 indicates to disable the filter, and 9 indicates the most obvious effect.

getExtension:

getExtension:
- (id) getExtension:
(TUIExtensionType)extensionType

Get the extension.

Param
DESC
extensionType
Extension type. More deatils, see TUIExtensionType.

getMediaDeviceManager

getMediaDeviceManager

Get device management class.

getLiveConnectionManager

getLiveConnectionManager

Get live-connection management class.

callExperimentalAPI:

callExperimentalAPI:
+ (id)callExperimentalAPI:
(NSString *)jsonStr

Call experimental APIs.