このページは現在英語版のみで提供されており、日本語版も近日中に提供される予定です。ご利用いただきありがとうございます。

APIの概要

Overview

Basic APIs

API
Description
Creates a TRTCCloud singleton.
Releases a TRTCCloud singleton.
Sets the callback API TRTCCloudCallback.
Removes event callback.

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 non-Tencent Cloud addresses.
Sets On-Cloud MixTranscoding parameters.

Video APIs

API
Description
Enables local video preview (only custom rendering is supported currently).
Stops local video capturing and preview.
Pauses/Resumes sending local video data.
Starts pulling and displaying the image of a specified remote user (only custom rendering is supported currently).
Stops displaying and pulling the video image of a remote user.
Stops displaying and pulling the video images of all remote users.
Pauses/Resumes receiving the video stream of a specified remote user.
Pauses/Resumes receiving all remote video streams.
Sets video encoder parameters.
Sets QoS control parameters.
Sets the mirror mode of encoded images.

Audio APIs

API
Description
Enables local audio capturing and upstream data transfer.
Disables local audio capturing and upstream data transfer.
Mutes/Unmutes local audio.
Mutes/Unmutes a specified remote user.
Mutes/Unmutes all remote users.
Sets the playback volume of a remote user.
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.

Device management APIs

API
Description
Gets the device management module. For details, please see Specific Device Management APIs.

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, please see Specific Music and Voice Effect APIs.

Custom video rendering APIs

API
Description
Sets custom rendering for the local video.
Sets custom rendering for the video of a remote user.

Custom message sending APIs

API
Description
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.
Calls the experimental API.

TRTCCloudCallback

Callback APIs for the TRTC audio 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 reminders 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 user has turned the camera on
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 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 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
Callback of connecting/disconnecting a local device


Custom message receiving callback APIs

API
Description
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
Sets On-Cloud MixTranscoding parameters, which corresponds to the setMixTranscodingConfig() API in TRTCCloud


Definitions of Key Classes

Class
Description
Room entry parameters
Video encoding parameters
On-Cloud MixTranscoding configuration
Room switching parameters
QoS control parameters
Reverb effects (karaoke, room, hall, low and deep, resonant, etc.)
Parameters for music and voice effect setting APIs
Audio recording parameters


Specific Device Management APIs

API
Description
Gets whether the front camera is being used.
Switches cameras.
Gets the maximum zoom level of the current camera.
Sets the zoom level of the current camera.
Gets whether automatic facial recognition is supported.
Enables/Disables automatic facial recognition.
Sets camera focus.
Enables/Disables flash.
Sets the system volume type to use during calls.
Sets the audio route.


Specific Music and Voice Effect APIs

API
Description
Sets the voice change effects (karaoke, room, hall, low and deep, resonant, etc.)
Sets the callback of the playback progress of background music.
Starts playing background music.
Stops playing background music.
Pauses background music.
Resumes playing background music.
Sets the remote playback volume of background music, i.e., the volume heard by remote users.
Sets the local playback volume of background music.
Sets the local and remote playback volume of background music.
Changes the pitch of background music.
Changes the playback speed of background music.
Gets the playback progress (ms) of background music.
Sets the playback progress (ms) of background music.
Gets the length (ms) of the background music file.