API | Description |
Gets a singleton object. | |
Terminates a singleton object. | |
Sets event callbacks. |
API | Description |
Logs in. | |
Logs out. | |
Creates a room (called by host). | |
Closes the room (called by host). | |
Enters a room (called by participant). | |
Leaves a room (called by participant). | |
Gets the room information. | |
Gets the information of all members in the room. | |
Gets the information of a user. | |
Transfers the host permissions (called by host). |
API | Description |
Enables preview of the local video. | |
Stops local video capturing and preview. | |
Updates the local video rendering window. | |
Enables mic capturing. | |
Stops mic capturing. | |
Enables system audio capturing. | |
Disables system audio capturing. | |
Sets the mirror mode for local video preview. |
API | Description |
Subscribes to and plays back the remote video image of a specified member. | |
Unsubscribes from and stops the playback of a remote video image. | |
Updates the video rendering window of a remote user. |
API | Description |
Sends a chat message. | |
Sends a custom message. |
API | Description |
Enables/Disables the mic of a specified user. | |
Enables/Disables the mics of all users and syncs the status to room information. | |
Enables/Disables the camera of a specified user. | |
Enables/Disables the cameras of all users and syncs the status to room information. | |
Enables/Disables chat messages (called by host). | |
Removes a specified user from the room (called by host). | |
Starts a roll call (called by host). | |
Stops a roll call (called by host). | |
Replies to a roll call (called by participant). | |
Sends a speech invitation to a participant (called by host). | |
Cancels a speech invitation sent to a participant (called by host). | |
Accepts/Rejects the speech invitation of the host (called by participant). | |
Sends a speech request (called by participant). | |
Cancels a speech request (called by participant). | |
Approves/Rejects the speech request of a participant (called by host). | |
Disables requests to speak (called by host). | |
Stops the speech of a participant (called by host). | |
Stops the speech of all members (called by host). | |
Exits the speaker mode (called by participant). |
API | Description |
Gets the local device management object ITXDeviceManager . | |
Gets the screen sharing management object IScreenShareManager . |
API | Description |
Starts on-cloud recording. | |
Stops on-cloud recording. |
API | Description |
Sets beauty filters. |
API | Description |
Sets network QoS control parameters. |
API | Description |
Gets the SDK version. |
TUIRoomCoreCallback
API OverviewAPI | Description |
Callback for error. |
API | Description |
The local user logged in. | |
The local user logged out. | |
The room was created. | |
The room was closed. | |
The local user entered the room. | |
The local user left the room. | |
Started rendering the first video frame. | |
The audio volume of a user. | |
The host changed. |
API | Description |
A remote user entered the room. | |
A remote user exited the room. | |
A remote user enabled/disabled their camera. | |
A remote user started/stopped screen sharing. | |
A remote user turned on/off their mic. | |
A remote user started speaking. | |
A remote user stopped speaking. |
API | Description |
A text chat message was received. | |
A custom message was received. |
API | Description |
A participant received a speech invitation from the host. | |
The speech invitation sent to a participant was canceled by the host. | |
A participant accepted the speech invitation sent by the host. | |
The host received a speech request from a participant. | |
A participant canceled a speech request. | |
The host approved a request to speak. | |
The host disabled requests to speak. | |
A participant was asked to stop speaking. | |
The host started a roll call (received by participants) | |
The host stopped a roll call (received by participants). | |
A participant replied to the roll call (received by the host). | |
The host disabled/enabled chat messages. | |
The host disabled mic use. | |
The host disabled camera use. |
API | Description |
Statistics on technical metrics. | |
Network quality. |
API | Description |
Screen sharing started. | |
Screen sharing stopped. |
API | Description |
Recording error. | |
Recording completed. | |
The recording progress. |
API | Description |
The speaker volume. | |
The mic volume. | |
The system capturing volume changed. | |
The system audio playback volume changed. |
static TUIRoomCore* GetInstance();
static void DestroyInstance();
TRTCChorusRoomDelegate
to get the callbacks.virtual void SetCallback(const TUIRoomCoreCallback* callback) = 0;
virtual int Login(int sdk_appid, const std::string& user_id, const std::string& user_sig) = 0;
Parameter | Type | Description |
sdk_appid | int | |
user_id | string | The ID of the current user, which is a string that can contain letters (a-z and A-Z), digits (0-9), hyphens (-), and underscores (_). We recommend you set it based on your own account system. |
user_sig | string | Tencent Cloud's proprietary security signature. For how to calculate and use it, see FAQs > UserSig. |
virtual int Logout() = 0;
virtual int CreateRoom(const std::string& room_id, TUISpeechMode speech_mode) = 0;
Parameter | Type | Description |
room_id | string | The room ID. You need to assign and manage the IDs in a centralized manner. |
speech_mode | TUISpeechMode | The speech mode. |
CreateRoom()
to create a room, the result of which is returned via OnCreateRoom
.EnterRoom()
to enter the room.StartCameraPreview()
to enable camera capturing and preview.StartLocalAudio()
to enable the local mic.virtual int DestroyRoom() = 0;
virtual int EnterRoom(const std::string& room_id) = 0;
Parameter | Type | Description |
room_id | string | The room ID. |
EnterRoom
(passing in room_id
) to enter the room.startCameraPreview()
to enable camera preview and calls StartLocalAudio()
to enable mic capturing.OnRemoteUserCameraAvailable
callback and calls StartRemoteView()
to start playback.virtual int LeaveRoom() = 0;
virtual TUIRoomInfo GetRoomInfo() = 0;
virtual std::vector<TUIUserInfo> GetRoomUsers() = 0;
virtual const TUIUserInfo* GetUserInfo(const std::string& user_id) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
virtual int SetSelfProfile(const std::string& user_name, const std::string& avatar_url) = 0;
Parameter | Type | Description |
user_name | string | The username. |
avatar_url | string | The URL of the user profile photo. |
virtual int TransferRoomMaster(const std::string& user_id) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
virtual int StartCameraPreview(const liteav::TXView& view) = 0;
Parameter | Type | Description |
view | liteav::TXView | The window handle. |
virtual int StopCameraPreview() = 0;
virtual int UpdateCameraPreview(const liteav::TXView& view) = 0;
Parameter | Type | Description |
view | liteav::TXView | The window handle. |
virtual int StartLocalAudio(const liteav::TRTCAudioQuality& quality) = 0;
Parameter | Type | Description |
view | liteav::TXView | The window handle. |
virtual int StopLocalAudio() = 0;
virtual int StartSystemAudioLoopback() = 0;
virtual int StopSystemAudioLoopback() = 0;
virtual int SetVideoMirror(bool mirror) = 0;
Parameter | Type | Description |
mirror | bool | Whether to mirror the video. |
virtual int StartRemoteView(const std::string& user_id, const liteav::TXView& view,TUIStreamType type = TUIStreamType::kStreamTypeCamera) = 0;
Parameter | Type | Description |
user_id | string | The ID of the user whose video image is to be played back. |
liteav::TXView | TXView | The view that loads the video. |
type | TUIStreamType | The stream type. |
virtual int StopRemoteView(const std::string& user_id,TUIStreamType type = TUIStreamType::kStreamTypeCamera) = 0;
Parameter | Type | Description |
user_id | string | The ID of the user whose video image is to be stopped. |
type | TUIStreamType | The stream type. |
virtual int UpdateRemoteView(const std::string& user_id, TUIStreamType type, liteav::TXView& view) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
type | TUIStreamType | The stream type. |
view | liteav::TXView | The rendering window handle. |
virtual int SendChatMessage(const std::string& message) = 0;
Parameter | Type | Description |
message | string | The message content. |
virtual int SendCustomMessage(const std::string& message) = 0;
Parameter | Type | Description |
message | string | The message content. |
virtual int MuteUserMicrophone(const std::string& user_id, bool mute, Callback callback) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
mute | bool | Whether to disable. |
callback | Callback | API callback. |
virtual int MuteAllUsersMicrophone(bool mute) = 0;
Parameter | Type | Description |
mute | bool | Whether to disable. |
virtual int MuteUserCamera(const std::string& user_id, bool mute, Callback callback) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
mute | bool | Whether to disable. |
callback | Callback | API callback. |
virtual int MuteAllUsersCamera(bool mute) = 0;
Parameter | Type | Description |
mute | bool | Whether to disable. |
virtual int MuteChatRoom(bool mute) = 0;
Parameter | Type | Description |
mute | bool | Whether to disable. |
virtual int KickOffUser(const std::string& user_id, Callback callback) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
callback | Callback | API callback. |
virtual int StartCallingRoll() = 0;
virtual int StopCallingRoll() = 0;
virtual int ReplyCallingRoll(Callback callback) = 0;
Parameter | Type | Description |
callback | Callback | API callback. |
virtual int SendSpeechInvitation(const std::string& user_id, Callback callback) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
callback | Callback | API callback. |
virtual int CancelSpeechInvitation(const std::string& user_id, Callback callback) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
callback | Callback | API callback. |
virtual int ReplySpeechInvitation(bool agree, Callback callback) = 0;
Parameter | Type | Description |
agree | bool | Whether to approve. |
callback | Callback | API callback. |
virtual int SendSpeechApplication(Callback callback) = 0;
Parameter | Type | Description |
callback | Callback | API callback. |
virtual int CancelSpeechApplication(Callback callback) = 0;
Parameter | Type | Description |
callback | Callback | API callback. |
virtual int ReplySpeechApplication(const std::string& user_id, bool agree, Callback callback) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
callback | Callback | API callback. |
virtual int ForbidSpeechApplication(bool forbid) = 0;
Parameter | Type | Description |
forbid | bool | Whether to disable. |
virtual int SendOffSpeaker(const std::string& user_id, Callback callback) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
callback | Callback | API callback. |
virtual int SendOffAllSpeakers(Callback callback) = 0;
Parameter | Type | Description |
callback | Callback | API callback. |
virtual int ExitSpeechState() = 0;
virtual liteav::ITXDeviceManager* GetDeviceManager() = 0;
virtual IScreenShareManager* GetScreenShareManager() = 0;
virtual int StartCloudRecord() = 0;
virtual int StopCloudRecord() = 0;
virtual int SetBeautyStyle(liteav::TRTCBeautyStyle style, uint32_t beauty_level,uint32_t whiteness_level, uint32_t ruddiness_level) = 0;
Parameter | Type | Description |
style | liteav::TRTCBeautyStyle | The beauty style. |
beauty_level | uint32_t | The strength of the beauty effect. |
whiteness_level | uint32_t | The strength of the skin brightening effect. |
ruddiness_level | uint32_t | The strength of the rosy skin effect. |
virtual int SetVideoQosPreference(TUIVideoQosPreference preference) = 0;
Parameter | Type | Description |
preference | TUIVideoQosPreference | The network QoS policy. |
virtual const char* GetSDKVersion() = 0;
void OnError(int code, const std::string& message);
Parameter | Type | Description |
code | int | The error code. |
message | string | The error message. |
virtual void OnLogin(int code, const std::string& message) = 0;
Parameter | Type | Description |
code | int | The error code. |
message | string | The login information or error message for login failure. |
virtual void OnLogout(int code, const std::string& message) = 0;
Parameter | Type | Description |
code | int | The error code. |
message | string | The error message. |
virtual void OnCreateRoom(int code, const std::string& message) = 0;
Parameter | Type | Description |
code | int | The error code. |
message | string | The error message. |
virtual void OnDestroyRoom(int code, const std::string& message) = 0;
Parameter | Type | Description |
code | int | The error code. |
message | string | The error message. |
virtual void OnEnterRoom(int code, const std::string& message) = 0;
Parameter | Type | Description |
code | int | The error code. |
message | string | The error message. |
virtual void OnExitRoom(TUIExitRoomType type, const std::string& message) = 0;
Parameter | Type | Description |
type | TUIExitRoomType | The room exit type. |
message | string | The error message. |
virtual void OnFirstVideoFrame(const std::string& user_id, const TUIStreamType stream_type) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
stream_type | TUIStreamType | The stream type. |
virtual void OnUserVoiceVolume(const std::string& user_id, int volume)
Parameter | Type | Description |
user_id | string | The user ID. |
volume | int | The volume level. Value range: 0-100. |
virtual void OnRoomMasterChanged(const std::string& user_id) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
virtual void OnRemoteUserEnter(const std::string& user_id) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
virtual void OnRemoteUserLeave(const std::string& user_id) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
virtual void OnRemoteUserCameraAvailable(const std::string& user_id, bool available) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
available | bool | true: Enabled; false: Disabled. |
virtual void OnRemoteUserScreenAvailable(const std::string& user_id, bool available) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
available | bool | true: Enabled; false: Disabled. |
virtual void OnRemoteUserAudioAvailable(const std::string& user_id, bool available) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
available | bool | true: Enabled; false: Disabled. |
virtual void OnRemoteUserEnterSpeechState(const std::string& user_id) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
virtual void OnRemoteUserExitSpeechState(const std::string& user_id) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
virtual void OnReceiveChatMessage(const std::string& user_id, const std::string& message) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
message | string | The message content. |
virtual void OnReceiveCustomMessage(const std::string& user_id, const std::string& message) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
message | string | The custom message content. |
virtual void OnReceiveSpeechInvitation() = 0;
virtual void OnReceiveInvitationCancelled() = 0;
virtual void OnReceiveReplyToSpeechInvitation(const std::string& user_id, bool agree) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
agree | bool | Whether the invitation was accepted. |
virtual void OnReceiveSpeechApplication(const std::string& user_id) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
virtual void OnSpeechApplicationCancelled(const std::string& user_id) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
virtual void OnReceiveReplyToSpeechApplication(bool agree) = 0;
Parameter | Type | Description |
agree | bool | Whether the request was approved. |
virtual void OnSpeechApplicationForbidden(bool forbidden) = 0;
Parameter | Type | Description |
forbidden | bool | Whether requests to speak were disabled. |
virtual void OnOrderedToExitSpeechState() = 0;
virtual void OnCallingRollStarted() = 0;
virtual void OnCallingRollStopped() = 0;
virtual void OnMemberReplyCallingRoll(const std::string& user_id) = 0;
Parameter | Type | Description |
user_id | string | The user ID. |
virtual void OnChatRoomMuted(bool muted) = 0;
Parameter | Type | Description |
muted | bool | Disabled or not. |
virtual void OnMicrophoneMuted(bool muted) = 0;
Parameter | Type | Description |
muted | bool | Disabled or not. |
virtual void OnCameraMuted(bool muted) = 0;
Parameter | Type | Description |
muted | bool | Disabled or not. |
virtual void OnStatistics(const liteav::TRTCStatistics& statis) {}
Parameter | Type | Description |
statis | liteav::TRTCStatistics | Statistics. |
virtual void OnNetworkQuality(const liteav::TRTCQualityInfo& local_quality, liteav::TRTCQualityInfo* remote_quality,uint32_t remote_quality_count) {}
Parameter | Type | Description |
local_quality | liteav::TRTCQualityInfo | The network quality of the local user. |
remote_quality | liteav::TRTCQualityInfo* | The network quality of remote users. |
remote_quality_count | uint32_t | The number of remote users. |
virtual void OnScreenCaptureStarted() {}
void OnScreenCaptureStopped(int reason) {}
Parameter | Type | Description |
reason | int | The reason screen sharing stopped. 0: The user stopped screen sharing; 1: Screen sharing was interrupted by another application. |
virtual void OnRecordError(TXLiteAVLocalRecordError error, const std::string& messgae) {}
Parameter | Type | Description |
error | TXLiteAVLocalRecordError | The error. |
messgae | string | The error message. |
virtual void OnRecordComplete(const std::string& path) {}
Parameter | Type | Description |
path | string | The error description. |
virtual void OnRecordProgress(int duration, int file_size) {}
Parameter | Type | Description |
duration | int | The file duration. |
file_size | int | The file size. |
virtual void OnTestSpeakerVolume(uint32_t volume) {}
Parameter | Type | Description |
volume | uint32_t | The volume level. |
virtual void OnTestMicrophoneVolume(uint32_t volume) {}
Parameter | Type | Description |
volume | uint32_t | The volume level. |
virtual void OnAudioDeviceCaptureVolumeChanged(uint32_t volume, bool muted) {}
Parameter | Type | Description |
volume | uint32_t | The volume level. |
muted | bool | Whether capturing was disabled. |
virtual void OnAudioDevicePlayoutVolumeChanged(uint32_t volume, bool muted) {}
Parameter | Type | Description |
volume | uint32_t | The volume level. |
muted | bool | Whether playback was disabled. |
Was this page helpful?