TUIRoomEngine
TUIRoomEngine APIs
TUIRoomEngine API is a no UI interface for multi-person audio and video rooms, you can use these APIs to perform custom encapsulation based on your business needs.
sharedInstance
Create TUIRoomEngine Instance.
Note:
static TUIRoomEngine sharedInstance()
return: TUIRoomEngine instance.
destroySharedInstance
Destroy TUIRoomEngine instance.
Note:
void destroySharedInstance()
login
Log in to roomEngine interface, you need to initialize user information first, then you can enter the room and perform a series of operations.
Note:
static Future<TUIActionCallback> login(int sdkAppId,String userId,String userSig)
Parameter:
Parameters | Type | Meaning |
sdkAppId | int | Get sdkAppId information from Application Information |
userId | String | User ID |
userSig | String |
logout
Logout Interface, which includes proactively leaving the room and destroying resources.
Note:
static Future<TUIActionCallback> logout()
setSelfInfo
Set Local Username and Avatar.
Note:
static Future<TUIActionCallback> setSelfInfo(String userName, String avatarURL)
Parameter:
Parameters | Type | Meaning |
userName | String | Username |
avatarUrl | String | User's profile photo |
setLoginUserInfo
Set Login User Information.
Note:
static Future<TUIActionCallback> setLoginUserInfo(TUILoginUserInfo userInfo)
Parameter:
Parameters | Type | Meaning |
userInfo | TUILoginUserInfo | User Information |
getSelfInfo
Obtain Basic Information of Local User Login.
Note:
static TUILoginUserInfo getSelfInfo()
return: User log in to information.
addObserver
Add TUIRoomEngine event callback.
Note:
void addObserver(TUIRoomObserver observer)
Parameter:
Parameters | Type | Meaning |
observer | TUIRoomObserver | TUIRoomEngine event callback |
removeObserver
Remove TUIRoomEngine event callback.
Note:
void removeObserver(TUIRoomObserver observer)
Parameters | Type | Meaning |
observer | TUIRoomObserver | TUIRoomEngine event callback |
createRoom
The host creates a room, and the user who calls createRoom is the owner of the room. When creating a room, you can set the room ID, room name, and whether the room allows users to initiate audio and video, send messages, and other features.
Note:
Future<TUIActionCallback> createRoom(TUIRoomInfo roomInfo)
Parameter:
Parameters | Type | Meaning |
roomInfo | Room Basic Information |
destroyRoom
Destroy room interface. The room must be destroyed by the owner. After destroying the room, it cannot be entered.
Note:
Future<TUIActionCallback> destroyRoom()
enterRoom
Enter room interface.
Note:
Future<TUIValueCallBack<TUIRoomInfo>> enterRoom(String roomId,{TUIRoomType roomType = TUIRoomType.conference,TUIEnterRoomOptions? options})
Parameter:
Parameters | Type | Meaning |
roomId | String | Room number, string type |
roomType | TUIRoomType | Room type |
options | TUIEnterRoomOptions | Optional parameters for entering the room |
exitRoom
Leave room interface, users can leave the room via exitRoom after executing enterRoom.
Note:
Future<TUIActionCallback> exitRoom(bool syncWaiting)
Parameter:
Parameters | Type | Meaning |
syncWaiting | bool | Whether to exit the room synchronously |
connectOtherRoom
Connect to Other Rooms.
Note:
Used to apply for a cross-room mic connection in live streaming scenarios.
TUIRequest connectOtherRoom(String roomId,String userId,int timeout,TUIRequestCallback? requestCallback)
Parameter:
Parameters | Type | Meaning |
roomId | String | Room ID |
userId | String | User ID |
timeout | int | Time |
callback | TUIRequestCallback | Callback for connecting to other rooms request |
Return:Request Body
disconnectOtherRoom
Disconnect from Other Rooms.
Note:
Used to disconnect cross-room mic connections in live streaming scenarios.
Future<TUIActionCallback> disconnectOtherRoom()
fetchRoomInfo
Obtain room information.
Note:
Future<TUIValueCallBack<TUIRoomInfo>> fetchRoomInfo()
updateRoomNameByAdmin
Update Room Name.
Note:
Future<TUIActionCallback> updateRoomNameByAdmin(String roomName)
Parameter:
Parameters | Type | Meaning |
roomName | String | Room Name |
updateRoomSeatModeByAdmin
Set room microphone mode (only administrators or group owners can call this).
Note:
Future<TUIActionCallback> updateRoomSeatModeByAdmin(TUISeatMode mode)
Parameters | Type | Meaning |
mode | Room mode |
setLocalVideoView
Set the view controls for local user video rendering.
Note:
void setLocalVideoView(int viewId)
Parameter:
Parameters | Type | Meaning |
viewId | int | int64 type value of the pending view pointer, this viewId can be converted to the corresponding native platform's view, and the video footage will be rendered on this view |
openLocalCamera
Turn on the local camera and start video stream acquisition.
Note:
Future<TUIActionCallback> openLocalCamera(bool isFront,TUIVideoQuality quality)
Parameter:
Parameters | Type | Meaning |
isFront | bool | Whether to use the front-facing camera |
quality | Video Quality |
closeLocalCamera
Turns the local camera off.
Note:
void closeLocalCamera()
updateVideoQuality
Set local video parameters.
Note:
void updateVideoQuality(TUIVideoQuality quality)
Parameter:
Parameters | Type | Meaning |
quality | Video Quality |
updateVideoQualityEx
Set local video encoder parameters.
Note:
void updateVideoQualityEx(TUIVideoStreamType streamType, TUIRoomVideoEncoderParams params);
Parameters | Type | Meaning |
streamType | TUIVideoStreamType | Video stream type |
params | TUIRoomVideoEncoderParams | Video Encoder Parameters |
setVideoResolutionMode
Set video encoder resolution mode (landscape resolution or portrait resolution).
Note:
void setVideoResolutionMode(TUIVideoStreamType streamType, TUIResolutionMode resolutionMode);
Parameters | Type | Meaning |
streamType | TUIVideoStreamType | Video stream type |
resolutionMode | TUIResolutionMode | Resolution Mode |
enableGravitySensor
Enable gravity sensing mode.
Note:
void enableGravitySensor(bool enable);
Parameters | Type | Meaning |
enable | bool | Whether Enabled |
startPushLocalVideo
Start pushing the local video stream to the remote.
Note:
void startPushLocalVideo()
stopPushLocalVideo
Stop pushing local video streams to the remote.
Note:
void stopPushLocalVideo()
startScreenSharing
Starting Screen Sharing
Note:
Future<void> startScreenSharing({String appGroup = ''})
stopScreenSharing
End Screen Sharing
Note:
Future<void> stopScreenSharing()
openLocalMicrophone
Enable the local mic.
Note:
Future<TUIActionCallback> openLocalMicrophone(TUIAudioQuality quality)
Parameters | Type | Meaning |
quality | Audio Quality |
closeLocalMicrophone
Disable the local mic.
Note:
void closeLocalMicrophone()
updateAudioQuality
Update local audio encoding quality settings.
Note:
void updateAudioQuality(TUIAudioQuality quality)
Parameter:
Parameters | Type | Meaning |
quality | Audio Quality |
muteLocalAudio
Stop pushing local audio streams to the remote.
Note:
Future<TUIActionCallback> muteLocalAudio()
unMuteLocalAudio
Start pushing the local audio stream to the remote.
Note:
Future<TUIActionCallback> unMuteLocalAudio()
setRemoteVideoView
Set the view controls for remote user video rendering.
Note:
void setRemoteVideoView(String userId,TUIVideoStreamType streamType,int viewId)
Parameter:
Parameters | Type | Meaning |
userId | String | User ID |
streamType | User stream type | |
viewId | int | int64 type value of the pending view pointer, this viewId can be converted to the corresponding native platform's view, and the video footage will be rendered on this view |
startPlayRemoteVideo
Start playing the remote user's video stream.
Note:
void startPlayRemoteVideo(String userId,TUIVideoStreamType streamType,TUIPlayCallback? callback)
Parameter:
Parameters | Type | Meaning |
userId | String | User ID |
streamType | User stream type | |
callback | TUIPlayCallback? | Playback result callback |
stopPlayRemoteVideo
Stop playing the remote user's video stream.
Note:
void stopPlayRemoteVideo(String userId,TUIVideoStreamType streamType)
Parameter:
Parameters | Type | Meaning |
userId | String | User ID |
streamType | User stream type |
muteRemoteAudioStream
Mute remote user.
Note:
void muteRemoteAudioStream(String userId, boolean isMute);
Parameter:
Parameters | Type | Meaning |
userId | String | User ID |
isMute | bool | Whether to mute |
getUserList
Get the current room user list. Note that the maximum number of users that can be pulled at one time is 100.
Note:
Future<TUIValueCallBack<TUIUserListResult>> getUserList(int nextSequence)
Parameter:
Parameters | Type | Meaning |
nextSequence | int | Pagination pull flag. Fill in 0 for the first pull. If nextSeq is not zero in the callback, pagination is needed. Pass in nextSeq to pull again until nextSeq is zero in the callback |
getUserInfo
Get the detailed information of users.
Note:
Future<TUIValueCallBack<TUIUserInfo>> getUserInfo(String userId)
Parameter:
Parameters | Type | Meaning |
userId | String | Get detailed information of this user based on userId |
changeUserRole
Change the user's role. Only administrators or group owners can call this.
Note:
Future<TUIActionCallback> changeUserRole(String userId,TUIRole role)
Parameter:
Parameters | Type | Meaning |
userId | String | User ID |
role | User Role |
changeUserNameCard
Change the nickname of a user in the room.
Note:
Future<TUIActionCallback> changeUserNameCard(String userId, String nameCard);
Parameter:
Parameters | Type | Meaning |
userId | String | User ID |
nameCard | String | User Nickname |
kickRemoteUserOutOfRoom
Remove a user from the room. Only administrators or group owners can call this.
Note:
Future<TUIActionCallback> kickRemoteUserOutOfRoom(String userId)
Parameter:
Parameters | Type | Meaning |
userId | String | User ID |
addCategoryTagForUsers
Add tags for users. Only the room owner can call this.
Note:
Future<TUIActionCallback> addCategoryTagForUsers(int tag, List<String> userList);
Parameter:
Parameters | Type | Meaning |
tag | int | Mark type. Numeric type, greater than or equal to 1000. You can define it yourself. |
userList | List<String> | User list |
removeCategoryTagForUsers
Remove tags for users. Only the room owner can call this.
Note:
Future<TUIActionCallback> removeCategoryTagForUsers(int tag, List<String> userList);
Parameter:
Parameters | Type | Meaning |
tag | int | Type. Numeric type, greater than or equal to 1000. You can define it yourself. |
userList | List<String> | User list |
getUserListByTag
Get user information in the room based on labels
Remove tags for users. Only the room owner can call this.
Note:
Future<TUIValueCallBack<TUIUserListResult>> getUserListByTag(int tag, int nextSequence);
Parameter:
Parameters | Type | Meaning |
tag | int | Type. Numeric type, greater than or equal to 1000. You can define it yourself. |
nextSequence | int | Pagination pull flag. Fill in 0 for the first pull. If nextSequence is not zero in the callback, pagination is needed. Pass it in to pull again until it is zero |
setCustomInfoForUser
Set customized information for members in the room
Note:
Future<TUIActionCallback> setCustomInfoForUser(String userId,HashMap<String, String> customInfo);
Parameter:
Parameters | Type | Meaning |
userId | String | userId |
customInfo | HashMap<String, String> | Customized Information |
disableDeviceForAllUserByAdmin
All Users Media Device Management, only administrators or group owners can invoke.
Note:
Future<TUIActionCallback> disableDeviceForAllUserByAdmin(TUIMediaDevice device,bool isDisable)
Parameters | Type | Meaning |
device | Device | |
isDisable | bool | Whether to disable |
openRemoteDeviceByAdmin
Request Remote User to Open Media Device, only administrators or group owners can invoke.
Note:
TUIRequest openRemoteDeviceByAdmin(String userId,TUIMediaDevice device,int timeout,TUIRequestCallback? requestCallback)
Parameters | Type | Meaning |
userId | String | User ID |
device | Device | |
timeout | int | Timeout period, unit: seconds. If set to 0, the SDK will not perform timeout detection and will not trigger a timeout callback |
requestCallback | TUIRequestCallback? | Operation result callback |
closeRemoteDeviceByAdmin
Close Remote User Media Device, only administrators or group owners can invoke.
Note:
Future<TUIActionCallback> closeRemoteDeviceByAdmin(String userId,TUIMediaDevice device)
Parameters | Type | Meaning |
userId | String | User ID |
device | Device |
applyToAdminToOpenLocalDevice
All Users Media Device Management lock.
Note:
TUIRequest applyToAdminToOpenLocalDevice(TUIMediaDevice device,int timeout,TUIRequestCallback? requestCallback)
Parameters | Type | Meaning |
device | Device | |
timeout | int | Timeout period, unit: seconds. If set to 0, the SDK will not perform timeout detection and will not trigger a timeout callback |
callback | TUIRequestCallback? | Operation result callback |
setMaxSeatCount
Set the maximum number of microphone slots. It can only be set before entering the room or when creating the room.
Future<TUIActionCallback> setMaxSeatCount(int maxSeatCount)
Parameters | Type | Meaning |
maxSeatCount | int | Maximum Number of Microphones |
getSeatApplicationList
Host/Administrator retrieves the list of requests from users applying to speak in the room.
Note:
Future<TUIValueCallBack<List<TUIRequest>>> getSeatApplicationList();
lockSeatByAdmin
Lock microphone position (includes location lock, audio status lock, video status lock).
Note:
Future<TUIActionCallback> lockSeatByAdmin(int seatIndex,TUISeatLockParams lockParams)
Parameters | Type | Meaning |
seatIndex | int | Microphone slot number |
lockParams | Mute Microphone parameter |
getSeatList
Get the microphone position list.
Note:
Future<TUIValueCallBack<List<TUISeatInfo>>> getSeatList()
takeSeat
Local Microphone On.
Note:
Meeting scenario:applyToSpeak mode requires an application to the host or administrator before taking the mic. Other modes do not support taking the mic.
Live streaming scenario:freeToSpeak mode allows free mic access. After taking the mic, open the microphone to speak; applySpeakAfterTakingSeat mode requires an application to the host or administrator before taking the mic. Other modes do not support taking the mic.
This function applies to conference room type and live room type (conference & livingRoom).
TUIRequest takeSeat(int seatIndex,int timeout,TUIRequestCallback? requestCallback)
Parameter:
Parameters | Type | Meaning |
seatIndex | int | Microphone slot number |
timeout | int | Timeout period, unit: seconds. If set to 0, the SDK will not perform timeout detection and will not trigger a timeout callback |
requestCallback | TUIRequestCallback? | Invoke interface callback to notify the request status |
Return: Request Body
leaveSeat
Local Microphone Off.
Note:
Future<TUIActionCallback> leaveSeat()
moveToSeat
Move Microphone.
Note:
Future<TUIActionCallback> moveToSeat(int targetSeatIndex);
Parameters | Type | Meaning |
seatIndex | int | Microphone slot number |
takeUserOnSeatByAdmin
Host/Administrator invites users to go on stage.
Note:
TUIRequest takeUserOnSeatByAdmin(int seatIndex,String userId,int timeout,TUIRequestCallback? requestCallback)
Parameters | Type | Meaning |
seatIndex | int | Microphone slot number |
userId | String | User ID |
timeout | int | Timeout period, unit: seconds. If set to 0, the SDK will not perform timeout detection and will not trigger a timeout callback |
requestCallback | TUIRequestCallback? | Invoke interface callback to notify the request status |
Return: Request Body
kickUserOffSeatByAdmin
Host/Administrator removes users from the mic.
Note:
Future<TUIActionCallback> kickUserOffSeatByAdmin(int seatIndex,String userId)
Parameters | Type | Meaning |
seatIndex | int | Microphone slot number |
userId | String | User ID |
disableSendingMessageByAdmin
Disable the remote user's ability to send text messages (only administrators or group owners can call this).
Note:
Future<TUIActionCallback> disableSendingMessageByAdmin(String userId,bool isDisable)
Parameters | Type | Meaning |
userId | String | User ID |
isDisable | bool | Whether to disable |
disableSendingMessageForAllUser
Disable all users' ability to send text messages (only administrators or group owners can call this).
Note:
Future<TUIActionCallback> disableSendingMessageForAllUser(bool isDisable)
Parameters | Type | Meaning |
isDisable | bool | Whether to disable |
cancelRequest
Cancel the already sent request.
Note:
Future<TUIActionCallback> cancelRequest(String requestId)
Parameter:
Parameters | Type | Meaning |
requestId | String | Request ID |
responseRemoteRequest
Respond to the remote user's request.
Note:
Future<TUIActionCallback> responseRemoteRequest(String requestId,bool agree)
Parameter:
Parameters | Type | Meaning |
requestId | String | Request ID |
agree | bool | Do you agree? |
callExperimentalAPI
Calls an experimental API.
Note:
void callExperimentalAPI(String jsonStr);
Parameters | Type | Meaning |
jsonStr | String | Interface Information |
setBeautyLevel
Set beauty filter effect level
Note:
void setBeautyLevel(int beautyStyle, int beautyLevel);
Parameters | Type | Meaning |
beautyStyle | int | Beauty filter style |
beautyLevel | int | Beauty filter effect level |
setWhitenessLevel
Set brightening filter effect level
Note:
void setWhitenessLevel(int whitenessLevel);
Parameters | Type | Meaning |
whitenessLevel | int | Brightening filter effect level |
getExtension
Get plugins
Note:
dynamic getExtension(TUIExtensionType extensionType);
Parameters | Type | Meaning |
extensionType | TUIExtensionType | Plugin Type |
getMediaDeviceManager
Get device management class
Note:
TUIRoomDeviceManager getMediaDeviceManager();
- TUIRoomEngine APIs
- sharedInstance
- destroySharedInstance
- login
- logout
- setSelfInfo
- setLoginUserInfo
- getSelfInfo
- addObserver
- removeObserver
- createRoom
- destroyRoom
- enterRoom
- exitRoom
- connectOtherRoom
- disconnectOtherRoom
- fetchRoomInfo
- updateRoomNameByAdmin
- updateRoomSeatModeByAdmin
- setLocalVideoView
- openLocalCamera
- closeLocalCamera
- updateVideoQuality
- updateVideoQualityEx
- setVideoResolutionMode
- enableGravitySensor
- startPushLocalVideo
- stopPushLocalVideo
- startScreenSharing
- stopScreenSharing
- openLocalMicrophone
- closeLocalMicrophone
- updateAudioQuality
- muteLocalAudio
- unMuteLocalAudio
- setRemoteVideoView
- startPlayRemoteVideo
- stopPlayRemoteVideo
- muteRemoteAudioStream
- getUserList
- getUserInfo
- changeUserRole
- changeUserNameCard
- kickRemoteUserOutOfRoom
- addCategoryTagForUsers
- removeCategoryTagForUsers
- getUserListByTag
- setCustomInfoForUser
- disableDeviceForAllUserByAdmin
- openRemoteDeviceByAdmin
- closeRemoteDeviceByAdmin
- applyToAdminToOpenLocalDevice
- setMaxSeatCount
- getSeatApplicationList
- lockSeatByAdmin
- getSeatList
- takeSeat
- leaveSeat
- moveToSeat
- takeUserOnSeatByAdmin
- kickUserOffSeatByAdmin
- disableSendingMessageByAdmin
- disableSendingMessageForAllUser
- cancelRequest
- responseRemoteRequest
- callExperimentalAPI
- setBeautyLevel
- setWhitenessLevel
- getExtension
- getMediaDeviceManager