Menu

Overview

Last updated: 2023-10-09 11:54:15Download PDF

TRTCCloud

Basic APIs

API
Description
Creates a TRTCCloud singleton.
Destroys a TRTCCloud singleton.
Registers an event listener.
Unregisters an event listener.

Room APIs

API
Description
Enters a room. If the room does not exist, the system will create one automatically.
Exits a room.
Switches roles. This API works only in live streaming scenarios (TRTC_APP_SCENE_LIVE and TRTC_APP_SCENE_VOICE_CHATROOM).
Sets the audio/video data receiving mode, which must be set before room entry to take effect.
Requests a cross-room call (anchor competition).
Exits a cross-room call.
Switches rooms.

CDN APIs

API
Description
Starts pushing to Tencent Cloud’s live streaming CDN.
Stops pushing to Tencent Cloud’s live streaming CDN.
Starts relaying to the live streaming CDN of a non-Tencent Cloud vendor.
Stops relaying to the live streaming CDN of a non-Tencent Cloud vendor.
Sets On-Cloud MixTranscoding parameters.

Video APIs

API
Description
Enables preview of the local video.
Stops local video capturing and preview.
Pauses/Resumes pushing local video data.
Starts displaying the image of a remote user.
Stops displaying the video image of a remote user and pulling the user’s video stream.
Stops displaying the video images of all users and pulling their video streams.
Pauses/Resumes receiving a specified remote video stream.
Pauses/Resumes receiving all remote video streams.
Sets video encoder parameters.
Sets QoS control parameters.
Sets the rendering mode of the local image.
Sets remote image parameters.
Sets the rotation of encoded video images, i.e., images presented to remote users and recorded by the server.
Sets the mirror mode of encoded images.
Sets the adaptation mode of the G-sensor.
Enables the dual-channel (big and small images) encoding mode.
Switches between the small and big images of a specified user.
Takes a video screenshot.

Audio APIs

API
Description
Enables local audio capturing and upstream data transfer.
Disables local audio capturing and upstream data transfer.
Mutes/Unmutes the local audio.
Sets the image to be pushed when local video pushing is paused.
Sets the audio route.
Mutes/Unmutes the audio of a specified remote user.
Mutes/Unmutes all users.
Sets the SDK capturing volume.
Gets the SDK capturing volume.
Sets the SDK playback volume.
Gets the SDK playback volume.
Enables volume reminders.
Starts audio recording.
Stops audio recording.
Sets the system volume type used during calls.

Device management APIs

API
Description
Gets the device management module. For details, see device management APIs.

Beauty filter APIs

API
Description
Gets the beauty filter management object. For details, see the document on beauty filter management.
Adds watermarks.

Music and voice effect APIs

API
Description
Gets the audio effect management class TXAudioEffectManager, which is used to manage background music, short audio effects, and voice effects. For details, see the document on audio effect management.

Substream APIs

API
Description
Starts screen sharing.
Stops screen sharing.
Pauses screen sharing.
Resumes screen sharing.

Custom message sending APIs

API
Description
Sends a custom message to all users in the room.
Embeds small-volume custom data in video frames.

Network testing APIs

API
Description
Starts network speed testing. This may compromise the quality of video calls and should be avoided during a video call.
Stops server speed testing.

Log APIs

API
Description
Gets the SDK version.
Sets the log output level.
Changes the path to save logs.
Enables/Disables local log compression.
Enables/Disables console log printing.

TRTCCloudListener

Callback APIs for the TRTC video call feature

Error and warning event callback APIs

API
Description
Error callback. This indicates that the SDK encountered an irrecoverable error. Such errors must be listened for, and UI messages should be displayed to users if necessary.
Warning callback. This alerts you to non-serious problems such as lag or recoverable decoding failure.

Room event callback APIs

API
Description
Callback of room entry
Callback of room exit
Callback of role switching
Callback of the result of requesting a cross-room call (anchor competition)
Callback of the result of ending a cross-room call (anchor competition)
Callback of the result of room switching (switchRoom)

User event callback APIs

API
Description
Callback of the entry of a user
Callback of the exit of a user
Callback of whether a remote user has a playable primary image (usually the image of the camera)
Callback of whether a remote user has a playable substream image (usually the screen sharing image)
Callback of whether a remote user has playable audio
Callback of rendering the first video frame of the local user or a remote user
Callback of playing the first audio frame of a remote user. No notifications are sent for local audio.
Callback of sending the first local video frame
Callback of sending the first local audio frame

Callback APIs for background music playback

Callback APIs for background music playback
API
Description
Callback of starting music playback
Callback of the music playback progress
Callback of ending music playback

Callback APIs for statistics on network quality and technical metrics

API
Description
Callback of network quality. This callback is triggered every 2 seconds to collect statistics on the quality of current upstream and downstream data transfer.
Callback of statistics on technical metrics

Server event callback APIs

API
Description
Callback of the disconnection of the SDK from the server
Callback of the SDK trying to connect to the server again
Callback of the reconnection of the SDK to the server
Callback of server speed test results. The SDK tests the speed of multiple server addresses, and the result of each test is returned through this callback.

Hardware event callback APIs

API
Description
Callback of the camera being ready
Callback of the mic being ready
Callback of volume, including the volume of each userId and the total remote volume

Custom message receiving callback APIs

API
Description
Callback of receiving a custom message
Callback of losing a custom message
Callback of receiving an SEI message

Callback APIs for CDN relayed push

API
Description
Callback of starting to push to Tencent Cloud’s live streaming CDN, which corresponds to the startPublishing() API in TRTCCloud
Callback of stopping pushing to Tencent Cloud’s live streaming CDN, which corresponds to the stopPublishing() API in TRTCCloud
Callback of the completion of starting relayed push to CDNs
Callback of the completion of stopping relayed push to CDNs
Callback of setting On-Cloud MixTranscoding parameters, which corresponds to the setMixTranscodingConfig() API in TRTCCloud

Screen sharing callback APIs

API
Description
Callback of starting screen sharing
Callback of pausing screen sharing via the calling of pauseScreenCapture()
Callback of resuming screen sharing via the calling of resumeScreenCapture()
Callback of stopping screen sharing

Screenshot callback API

API
Description
Callback of the completion of a screenshot

Definitions of Key Classes

Class
Description
Variables for key class definitions
Room entry parameters
Room switching parameters
Video encoding parameters
QoS control parameters
Remote image parameters
Position of the image of each channel in On-Cloud MixTranscoding
On-Cloud MixTranscoding configuration
Definitions of voice changing types (little girl, middle-aged man, metal, foreign accent, etc.)
Definitions of reverb effect types (karaoke, room, hall, low and deep, resonant, etc.)
Parameters for music and voice effect setting APIs
Audio recording parameters
CDN relayed push parameters