tencent cloud

Feedback

TUIRoom (Windows and macOS)

Last updated: 2022-03-01 12:23:20

    TUIRoom is based on Tencent Real-Time Communication (TRTC) and Instant Messaging (IM). Its features include:

    • The anchor can create a room, and the member can enter the room ID to join the room.
    • The participants can share their screens with each other.
    • All users can send various text and custom messages.

    TUIRoom is an open-source class depending on two closed-source Tencent Cloud SDKs. For the specific implementation process, please see Group Audio/Video Room (for Windows and macOS).

    • TRTC SDK: the TRTC SDK is used as the low-latency video conferencing component.
    • IM SDK: the IM SDK for C++ is used to implement the chat room feature.

    TUIRoom API Overview

    Basic functions of TUIRoomCore

    API Description
    GetInstance Gets a singleton object.
    DestroyInstance Terminates a singleton object.
    SetCallback Sets event callback.

    Room APIs

    API Description
    login Logs in.
    logout Logs out.
    CreateRoom Creates a room (called by anchor).
    DestroyRoom Terminates a room (called by anchor).
    EnterRoom Enters a room (called by participant).
    LeaveRoom Exits a room (called by participant or anchor).
    GetRoomInfo Gets the room information.
    GetRoomUsers Gets the information of all users in the room.
    GetUserInfo Gets the information of a user.
    TransferRoomMaster Transfers the anchor permission (called by anchor).

    Local audio/video operation APIs

    API Description
    StartCameraPreview Enables the preview of the local video.
    StopCameraPreview Stops local video capturing and preview.
    UpdateCameraPreview Updates the local video rendering window.
    StartLocalAudio Enables mic capturing.
    StopLocalAudio Stops mic capturing.
    StartSystemAudioLoopback Enables system audio capturing.
    StopSystemAudioLoopback Disables system audio capturing.
    SetVideoMirror Sets the mirroring preview mode of the local image.

    Remote user APIs

    API Description
    StartRemoteView Subscribes to and plays back the remote video image of a specified member.
    StopRemoteView Unsubscribes from and stops the playback of a remote video image.
    UpdateRemoteView Updates the video rendering window of a remote user.

    Chat message sending APIs

    API Description
    SendChatMessage Sends a chat message.
    SendCustomMessage Sends a custom message.

    Room control APIs

    API Description
    MuteUserMicrophone Enables/Disables the mic of a specified user.
    MuteAllUsersMicrophone Enables/Disables the mic of all users and syncs the status to room information.
    MuteUserCamera Enables/Disables the camera of a specified user.
    MuteAllUsersCamera Enables/Disables the camera of all users and syncs the status to room information.
    MuteChatRoom Mutes/Unmutes the chat room (called by anchor).
    KickOffUser Removes a specified user in the room (called by anchor).
    StartCallingRoll Starts calling roll by the anchor.
    StopCallingRoll Stops calling roll by the anchor.
    ReplyCallingRoll Replies to roll call by a member.
    SendSpeechInvitation Invites a member to speak by the anchor.
    CancelSpeechInvitation Cancels invitation to a member for speech by the anchor.
    ReplySpeechInvitation Accepts/Rejects the speech invitation from the anchor by a member.
    SendSpeechApplication Applies for speech by a member.
    CancelSpeechApplication Cancels speech application by a member.
    ReplySpeechApplication Approves/Rejects the speech application of a member by the anchor.
    ForbidSpeechApplication Forbids speech application by the anchor.
    SendOffSpeaker Stops the speech of a member by the anchor.
    SendOffAllSpeakers Stops the speech of all members by the anchor.
    ExitSpeechState Stops speaking by a member and changes their role to audience.

    Basic component API functions

    API Description
    GetDeviceManager Gets the local settings management object ITXDeviceManager.
    GetScreenShareManager Gets the screen sharing management object IScreenShareManager.

    On-cloud recording API functions

    API Description
    StartCloudRecord Starts on-cloud recording.
    StopCloudRecord Stops on-cloud recording.

    Beauty filter APIs

    API Description
    SetBeautyStyle Sets a beauty filter.

    Settings APIs

    API Description
    SetVideoQosPreference Sets network bandwidth limit parameters.

    SDK version acquisition APIs

    API Description
    GetSDKVersion Gets the SDK version.

    TUIRoomCoreCallback API Overview

    Callbacks for error events

    API Description
    OnError Callback for error.

    Basic event callbacks

    API Description
    OnLogin Login.
    OnLogout Logout.
    OnCreateRoom Room creation.
    OnDestroyRoom Room dismissal.
    OnEnterRoom Room entry.
    OnExitRoom Room exit.
    OnFirstVideoFrame The first video frame.
    OnUserVoiceVolume Volume level.
    OnRoomMasterChanged Anchor change.

    Remote user event callbacks

    API Description
    OnRemoteUserEnter A remote user entered the room.
    OnRemoteUserLeave A remote user exited the room.
    OnRemoteUserCameraAvailable Whether a remote user enabled the camera.
    OnRemoteUserScreenAvailable Whether a remote user enabled screen sharing.
    OnRemoteUserAudioAvailable Whether a remote user enabled mic.
    OnRemoteUserEnterSpeechState A remote user started speaking.
    OnRemoteUserExitSpeechState A remote user stopped speaking.

    Message event callback APIs

    API Description
    OnReceiveChatMessage A text message was received.
    OnReceiveCustomMessage A custom message was received.

    Room control event callbacks

    API Description
    OnReceiveSpeechInvitation A member received a speech invitation from the anchor.
    OnReceiveInvitationCancelled A member received a speech invitation cancellation from the anchor.
    OnReceiveReplyToSpeechInvitation The anchor received the acceptance to a speech invitation by a member.
    OnReceiveSpeechApplication The anchor received a speech application from a member.
    OnSpeechApplicationCancelled A member canceled a speech application.
    OnReceiveReplyToSpeechApplication The anchor approved a speech application.
    OnSpeechApplicationForbidden The anchor rejected a speech application.
    OnOrderedToExitSpeechState A member was asked to stop speaking.
    OnCallingRollStarted The anchor started a roll call.
    OnCallingRollStopped The anchor stopped a roll call.
    OnMemberReplyCallingRoll A member replied to roll call.
    OnChatRoomMuted The anchor muted/unmuted the room.
    OnMicrophoneMuted The anchor disabled the mic.
    OnCameraMuted The anchor disabled the camera.

    Callback APIs for statistics on network quality and technical metrics

    API Description
    OnStatistics Statistics on technical metrics.
    OnNetworkQuality Network quality.

    Screen sharing event callbacks

    API Description
    OnScreenCaptureStarted Screen sharing started.
    OnScreenCaptureStopped Screen sharing stopped.

    Video recording callbacks

    API Description
    OnRecordError Recording error.
    OnRecordComplete Recording completion.
    OnRecordProgress Recording progress.

    Local device test callbacks

    API Description
    OnTestSpeakerVolume Speaker volume level.
    OnTestMicrophoneVolume Mic volume level.
    OnAudioDeviceCaptureVolumeChanged System capturing volume level adjustment.
    OnAudioDevicePlayoutVolumeChanged System playback volume level adjustment.

    Basic Functions of TUIRoomCore

    GetInstance

    This API is used to get a TUIRoomCore singleton object.

    static TUIRoomCore* GetInstance();
    

    DestroyInstance

    static void DestroyInstance();
    

    SetCallback

    This API is used to set the event callback of TUIRoomCore. You can use TUIRoomCoreCallback to get different status notifications of TUIRoomCore.

    virtual void SetCallback(const TUIRoomCoreCallback* callback) = 0;
    

    Login

    This API is used to log in to the Tencent backend server.

    virtual int Login(int sdk_appid, const std::string& user_id, const std::string& user_sig) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    sdk_appid int You can view SDKAppID in Application Management > Application Info of the TRTC console.
    user_id string 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 business account system.
    user_sig string Tencent Cloud's proprietary security signature. For more information on how to get it, please see UserSig.

    Logout

    This API is used to log out of the Tencent backend server.

    virtual int Logout() = 0;
    

    CreateRoom

    This API is used to create a room (called by the anchor).

    virtual int CreateRoom(const std::string& room_id, TUISpeechMode speech_mode) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    room_id string Room ID. You need to assign and manage the IDs in a centralized manner.
    speech_mode TUISpeechMode Speech mode.

    Generally, the anchor calls the APIs in the following steps:

    1. The anchor calls CreateRoom() to create a room, the result of which is returned via OnCreateRoom.
    2. The anchor calls EnterRoom() to enter the room.
    3. The anchor calls StartCameraPreview() to enable camera capturing and preview.
    4. The anchor calls StartLocalAudio() to enable the local mic.

    DestroyRoom

    This API is used to terminate a room (called by the anchor).

    virtual int DestroyRoom() = 0;
    

    EnterRoom

    This API is used to enter a room (called by a participant).

    virtual int EnterRoom(const std::string& room_id) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    room_id string Room ID.

    Generally, a participant enters a room in the following steps:

    1. The participant calls EnterRoom and passes in room_id to enter the room.
    2. The participant calls startCameraPreview() to enable camera preview and calls StartLocalAudio() to enable mic capturing.
    3. The participant receives the OnRemoteUserCameraAvailable event and calls StartRemoteView() to start playback.

    LeaveRoom

    This API is used to exit a room (called by a participant).

    virtual int LeaveRoom() = 0;
    

    GetRoomInfo

    This API is used to get the room information.

    virtual TUIRoomInfo GetRoomInfo() = 0;
    

    GetRoomUsers

    This API is used to get the information of all users in the room.

    virtual std::vector GetRoomUsers() = 0;
    

    GetUserInfo

    This API is used to get the information of a user in the room.

    virtual const TUIUserInfo* GetUserInfo(const std::string& user_id) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.

    SetSelfProfile

    This API is used to set the user attributes.

    virtual int SetSelfProfile(const std::string& user_name, const std::string& avatar_url) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_name string User name.
    avatar_url string User profile photo URL.

    TransferRoomMaster

    This API is used to transfer a group to another user.

    virtual int TransferRoomMaster(const std::string& user_id) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.

    Local Push APIs

    StartCameraPreview

    This API is used to start the preview of the local camera.

    virtual int StartCameraPreview(const liteav::TXView& view) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    view liteav::TXView Window handle.

    StopCameraPreview

    This API is used to stop the preview of the local camera.

    virtual int StopCameraPreview() = 0;
    

    UpdateCameraPreview

    This API is used to update the preview image of the local video.

    virtual int UpdateCameraPreview(const liteav::TXView& view) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    view liteav::TXView Window handle.

    StartLocalAudio

    This API is used to enable the local audio device.

    virtual int StartLocalAudio(const liteav::TRTCAudioQuality& quality) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    view liteav::TXView Window handle.

    StopLocalAudio

    This API is used to disable the local audio device.

    virtual int StopLocalAudio() = 0;
    

    StartSystemAudioLoopback

    This API is used to enable system audio capturing.

    virtual int StartSystemAudioLoopback() = 0;
    

    StopSystemAudioLoopback

    This API is used to disable system audio capturing.

    virtual int StopSystemAudioLoopback() = 0;
    

    SetVideoMirror

    This API is used to set mirroring mode.

    virtual int SetVideoMirror(bool mirror) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    mirror bool Whether to enable the mirroring mode.

    Remote User APIs

    StartRemoteView

    This API is used to subscribe to a remote user's video stream.

    virtual int StartRemoteView(const std::string& user_id, const liteav::TXView& view,
          TUIStreamType type = TUIStreamType::kStreamTypeCamera) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string ID of the user whose video image is to be played back.
    liteav::TXView TXView view control that carries the video image.
    type TUIStreamType Stream type.

    StopRemoteView

    This API is used to unsubscribe from and stop the playback of a remote video image.

    virtual int StopRemoteView(const std::string& user_id,
           TUIStreamType type = TUIStreamType::kStreamTypeCamera) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string ID of the user whose video image is to be stopped.
    type TUIStreamType Stream type.

    UpdateRemoteView

    This API is used to updates the rendering window of a remote video.

    virtual int UpdateRemoteView(const std::string& user_id, TUIStreamType type, liteav::TXView& view) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.
    type TUIStreamType Stream type.
    view liteav::TXView Rendering window handle.

    Message Sending APIs

    SendChatMessage

    This API is used to send text messages.

    virtual int SendChatMessage(const std::string& message) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    message string Message content.

    SendCustomMessage

    Sending Custom Messages

    virtual int SendCustomMessage(const std::string& message) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    message string Message content.

    Room Control APIs

    MuteUserMicrophone

    This API is used to enable/disable the mic of the specified user.

    virtual int MuteUserMicrophone(const std::string& user_id, bool mute, Callback callback) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.
    mute bool Whether to disable.
    callback Callback API callback.

    MuteAllUsersMicrophone

    This API is used to enable/disable the mic of all users.

    virtual int MuteAllUsersMicrophone(bool mute) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    mute bool Whether to disable.

    MuteUserCamera

    This API is used to enable/disable the camera of the specified user.

    virtual int MuteUserCamera(const std::string& user_id, bool mute, Callback callback) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.
    mute bool Whether to disable.
    callback Callback API callback.

    MuteAllUsersCamera

    This API is used to enable/disable the camera of all users.

    virtual int MuteAllUsersCamera(bool mute) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    mute bool Whether to disable.

    MuteChatRoom

    This API is used to mute/unmute the chat room.

    virtual int MuteChatRoom(bool mute) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    mute bool Whether to disable.

    KickOffUser

    This API is used by the anchor to remove a member.

    virtual int KickOffUser(const std::string& user_id, Callback callback) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.
    callback Callback API callback.

    StartCallingRoll

    This API is used by the anchor to start roll call.

    virtual int StartCallingRoll() = 0;
    

    StopCallingRoll

    This API is used by the anchor to stop roll call.

    virtual int StopCallingRoll() = 0;
    

    ReplyCallingRoll

    This API is used by a member to reply to roll call.

    virtual int ReplyCallingRoll(Callback callback) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    callback Callback API callback.

    SendSpeechInvitation

    This API is used by the anchor to invite a member to speak.

    virtual int SendSpeechInvitation(const std::string& user_id, Callback callback) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.
    callback Callback API callback.

    CancelSpeechInvitation

    This API is used by the anchor to cancel the speech invitation to a member.

    virtual int CancelSpeechInvitation(const std::string& user_id, Callback callback) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.
    callback Callback API callback.

    ReplySpeechInvitation

    This API is used by a member to accept/reject the speech invitation from the anchor.

    virtual int ReplySpeechInvitation(bool agree, Callback callback) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    agree bool Whether to approve.
    callback Callback API callback.

    SendSpeechApplication

    This API is used by a member to apply to speak.

    virtual int SendSpeechApplication(Callback callback) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    callback Callback API callback.

    CancelSpeechApplication

    This API is used by a member to cancel the speech application.

    virtual int CancelSpeechApplication(Callback callback) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    callback Callback API callback.

    ReplySpeechApplication

    This API is used by the anchor to approve/reject the speech application of a member.

    virtual int ReplySpeechApplication(const std::string& user_id, bool agree, Callback callback) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.
    callback Callback API callback.

    ForbidSpeechApplication

    This API is used by the anchor to forbid speech application.

    virtual int ForbidSpeechApplication(bool forbid) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    forbid bool Whether to forbid.

    SendOffSpeaker

    This API is used by the anchor to stop the speech of the specified member.

    virtual int SendOffSpeaker(const std::string& user_id, Callback callback) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.
    callback Callback API callback.

    SendOffAllSpeakers

    This API is used by the anchor to stop the speech of all members.

    virtual int SendOffAllSpeakers(Callback callback) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    callback Callback API callback.

    ExitSpeechState

    This API is used for a member to stop speaking and change their role to audience.

    virtual int ExitSpeechState() = 0;
    

    Basic Component APIs

    GetDeviceManager

    This API is used to get the device management object pointer.

    virtual liteav::ITXDeviceManager* GetDeviceManager() = 0;
    

    GetScreenShareManager

    This API is used to get the screen sharing management object pointer.

    virtual IScreenShareManager* GetScreenShareManager() = 0;
    

    On-Cloud Recording APIs

    StartCloudRecord

    This API is used to start on-cloud recording.

    virtual int StartCloudRecord() = 0;
    

    StopCloudRecord

    This API is used to stop on-cloud recording.

    virtual int StopCloudRecord() = 0;
    

    Beauty Filter APIs

    SetBeautyStyle

    This API is used to set effect levels of beauty, brightening, and rosy skin filters.

    virtual int SetBeautyStyle(liteav::TRTCBeautyStyle style, uint32_t beauty_level,
           uint32_t whiteness_level, uint32_t ruddiness_level) = 0;
    

    You can do the following using TXBeautyManager:

    • Set the beauty filter style to smooth or natural. The smooth style features more obvious skin smoothing effect.
    • Set the strength of the beauty filter. Value range: 0-9. 0 indicates that the filter is disabled. The larger the value, the more obvious the effect.
    • Set the strength of the skin brightening filter. Value range: 0-9. 0 indicates that the filter is disabled. The larger the value, the more obvious the effect.

    The parameters are as detailed below:

    Parameter Type Description
    style liteav::TRTCBeautyStyle Beauty filter style.
    beauty_level uint32_t strength of the beauty filter.
    whiteness_level uint32_t Strength of the skin brightening filter.
    ruddiness_level uint32_t Strength of the rosy skin filter.

    Settings APIs

    SetVideoQosPreference

    set QoS parameters

    virtual int SetVideoQosPreference(TUIVideoQosPreference preference) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    preference TUIVideoQosPreference Network bandwidth limit policy.

    SDK Version Acquisition APIs

    GetSDKVersion

    This API is used to get SDK version information.

    virtual const char* GetSDKVersion() = 0;
    

    Error Event Callbacks

    OnError

    void OnError(int code, const std::string& message);
    

    The parameters are as detailed below:

    Parameter Type Description
    code int Error code
    message string Error message.

    Basic Event Callbacks

    OnLogin

    virtual void OnLogin(int code, const std::string& message) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    code int Error code
    message string Login message or error message of login failure.

    OnLogout

    virtual void OnLogout(int code, const std::string& message) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    code int Error code
    message string Error message.

    OnCreateRoom

    Room creation.

    virtual void OnCreateRoom(int code, const std::string& message) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    code int Error code
    message string Error message.

    OnDestroyRoom

    Room dismissal.

    virtual void OnDestroyRoom(int code, const std::string& message) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    code int Error code
    message string Error message.

    OnEnterRoom

    Room entry.

    virtual void OnEnterRoom(int code, const std::string& message) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    code int Error code
    message string Error message.

    OnExitRoom

    Room exit.

    virtual void OnExitRoom(TUIExitRoomType type, const std::string& message) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    type TUIExitRoomType Room exit type.
    message string Error message.

    OnFirstVideoFrame

    Rendering the first frame of the local video or a remote user started.

    virtual void OnFirstVideoFrame(const std::string& user_id, const TUIStreamType stream_type) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.
    stream_type TUIStreamType Stream type.

    OnUserVoiceVolume

    User volume level.

    virtual void OnUserVoiceVolume(const std::string& user_id, int volume)
    
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.
    volume int User volume level. Value range: 0–100.

    OnRoomMasterChanged

    Anchor change.

    virtual void OnRoomMasterChanged(const std::string& user_id) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.

    Remote User Callbacks

    OnRemoteUserEnter

    A remote user entered the room.

    virtual void OnRemoteUserEnter(const std::string& user_id) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.

    OnRemoteUserLeave

    A remote user exited the room.

    virtual void OnRemoteUserLeave(const std::string& user_id) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.

    OnRemoteUserCameraAvailable

    Whether a remote user enabled the camera.

    virtual void OnRemoteUserCameraAvailable(const std::string& user_id, bool available) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.
    available bool true: enabled; false: disabled.

    OnRemoteUserScreenAvailable

    Whether a remote user enabled screen sharing.

    virtual void OnRemoteUserScreenAvailable(const std::string& user_id, bool available) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.
    available bool true: enabled; false: disabled.

    OnRemoteUserAudioAvailable

    Whether a remote user enabled mic.

    virtual void OnRemoteUserAudioAvailable(const std::string& user_id, bool available) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.
    available bool true: enabled; false: disabled.

    OnRemoteUserEnterSpeechState

    A remote user started speaking.

    virtual void OnRemoteUserEnterSpeechState(const std::string& user_id) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.

    OnRemoteUserExitSpeechState

    A remote user stopped speaking.

    virtual void OnRemoteUserExitSpeechState(const std::string& user_id) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.

    Chat Room Message Event Callbacks

    OnReceiveChatMessage

    Callback for receiving a text message.

    virtual void OnReceiveChatMessage(const std::string& user_id, const std::string& message) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.
    message string Text message.

    OnReceiveCustomMessage

    Callback for receiving a custom message.

    virtual void OnReceiveCustomMessage(const std::string& user_id, const std::string& message) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.
    message string Custom message.

    Room Control Message Callbacks

    OnReceiveSpeechInvitation

    A user received a speech invitation from the anchor.

    virtual void OnReceiveSpeechInvitation() = 0;
    

    OnReceiveInvitationCancelled

    A user received a speech invitation cancellation from the anchor.

    virtual void OnReceiveInvitationCancelled() = 0;
    

    OnReceiveReplyToSpeechInvitation

    The anchor received the acceptance to a speech invitation by a member.

    virtual void OnReceiveReplyToSpeechInvitation(const std::string& user_id, bool agree) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.
    agree bool Whether the invitation was accepted.

    OnReceiveSpeechApplication

    The anchor received a speech application from a member.

    virtual void OnReceiveSpeechApplication(const std::string& user_id) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.

    OnSpeechApplicationCancelled

    A user canceled a speech application.

    virtual void OnSpeechApplicationCancelled(const std::string& user_id) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.

    OnReceiveReplyToSpeechApplication

    The anchor approved a speech application.

    virtual void OnReceiveReplyToSpeechApplication(bool agree) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    agree bool Whether to approve.

    OnSpeechApplicationForbidden

    The anchor forbidden a speech application.

    virtual void OnSpeechApplicationForbidden(bool forbidden) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    forbidden bool Whether to forbid.

    OnOrderedToExitSpeechState

    A member was asked to stop speaking.

    virtual void OnOrderedToExitSpeechState() = 0;
    

    OnCallingRollStarted

    The anchor started a roll call.

    virtual void OnCallingRollStarted() = 0;
    

    OnCallingRollStopped

    The anchor stopped a roll call.

    virtual void OnCallingRollStopped() = 0;
    

    OnMemberReplyCallingRoll

    A member replied to roll call.

    virtual void OnMemberReplyCallingRoll(const std::string& user_id) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    user_id string User ID.

    OnChatRoomMuted

    The anchor muted/unmuted the room.

    virtual void OnChatRoomMuted(bool muted) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    muted bool Whether to disable.

    OnMicrophoneMuted

    The anchor disabled the mic.

    virtual void OnMicrophoneMuted(bool muted) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    muted bool Whether to disable.

    OnCameraMuted

    The anchor disabled the camera.

    virtual void OnCameraMuted(bool muted) = 0;
    

    The parameters are as detailed below:

    Parameter Type Description
    muted bool Whether to disable.

    Statistics Collection and Quality Callbacks

    OnStatistics

    Callback of technical metric statistics.

    virtual void OnStatistics(const liteav::TRTCStatistics& statis) {}
    

    The parameters are as detailed below:

    Parameter Type Description
    statis liteav::TRTCStatistics Statistics.

    OnNetworkQuality

    Network quality.

    virtual void OnNetworkQuality(const liteav::TRTCQualityInfo& local_quality, liteav::TRTCQualityInfo* remote_quality,
           uint32_t remote_quality_count) {}
    

    The parameters are as detailed below:

    Parameter Type Description
    local_quality liteav::TRTCQualityInfo Local user quality information.
    remote_quality liteav::TRTCQualityInfo* Pointer to the remote user quality information.
    remote_quality_count uint32_t Number of remote users.

    Screen Sharing Event Callbacks

    OnScreenCaptureStarted

    Screen sharing started.

    virtual void OnScreenCaptureStarted() {}
    

    OnScreenCaptureStopped

    Screen sharing stopped.

    void OnScreenCaptureStopped(int reason) {}
    

    The parameters are as detailed below:

    Parameter Type Description
    reason int Reason for stop. 0: the user stopped proactively; 1: stopped due to preemption by another application.

    Video Recording Callbacks

    OnRecordError

    Recording error.

    virtual void OnRecordError(TXLiteAVLocalRecordError error, const std::string& messgae) {}
    

    The parameters are as detailed below:

    Parameter Type Description
    error TXLiteAVLocalRecordError Error message.
    messgae string Error description.

    OnRecordComplete

    Recording completion.

    virtual void OnRecordComplete(const std::string& path) {}
    

    The parameters are as detailed below:

    Parameter Type Description
    path string Error description.

    OnRecordProgress

    Recording progress.

    virtual void OnRecordProgress(int duration, int file_size) {}
    

    The parameters are as detailed below:

    Parameter Type Description
    duration int File duration.
    file_size int File size.

    Local Device Test Callbacks

    OnTestSpeakerVolume

    Speaker volume level.

    virtual void OnTestSpeakerVolume(uint32_t volume) {}
    

    The parameters are as detailed below:

    Parameter Type Description
    volume uint32_t Volume level.

    OnTestMicrophoneVolume

    Mic volume level.

    virtual void OnTestMicrophoneVolume(uint32_t volume) {}
    

    The parameters are as detailed below:

    Parameter Type Description
    volume uint32_t Volume level.

    OnAudioDeviceCaptureVolumeChanged

    System capturing volume level adjustment.

    virtual void OnAudioDeviceCaptureVolumeChanged(uint32_t volume, bool muted) {}
    

    The parameters are as detailed below:

    Parameter Type Description
    volume uint32_t Volume level.
    muted bool Whether to disable.

    OnAudioDevicePlayoutVolumeChanged

    System playback volume level adjustment.

    virtual void OnAudioDevicePlayoutVolumeChanged(uint32_t volume, bool muted) {}
    

    The parameters are as detailed below:

    Parameter Type Description
    volume uint32_t Volume level.
    muted bool Whether to disable.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support