Only  $9.9! Get 50,000 minutes with our Starter Plan, perfect for your MVP project.
Only $9.9! Get 50,000 minutes with our Starter Plan, perfect for your MVP project.
Grab It Now 
RTC Engine
Overview
  • Web
    • Demo Quick Run
    • SDK Quick Start
    • Basic Features
      • Screen Sharing
      • Live Streaming
      • Media Device
      • Audio Volume
      • Set Encoding Profile
      • Detect Network Quality
      • Detect Capabilities
    • Advance Features
      • Enable AI Denoiser
      • Enable Audio Mixer
      • Enable Watermark
      • Enable Beauty and Effects
      • SEI Message
      • Custom Capturing and Rendering
    • Best Practices
      • Optimize Multi-Person Video Calls
      • Handle Autoplay Restriction
      • Handle Firewall Restriction
    • API List
    • Released Notes
    • Supported Platforms
    • Web FAQs
  • Android
    • Integration
      • 1.API Examples
      • 2.Importing the SDK
      • 3.Entering a Room
      • 4.Subscribing to Audio/Video Streams
      • 5.Publish Audio/Video Streams
      • 6.Exiting a Room
      • 7.Sensing Network Quality
      • 8.Enabling Screen Sharing
      • 9.Setting Video Quality
      • 10.Rotating Videos
    • Testing Newwork Quality
    • Custom Capturing and Rendering
    • Custom Audio Capturing and Playback
    • Client APIs
      • Overview
      • TRTCCloud
      • TRTCStatistics
      • TRTCCloudListener
      • TXAudioEffectManager
      • TXBeautyManager
      • TXDeviceManager
      • Type Definition
      • Deprecated Interface
      • Error Codes
    • Release Notes
  • iOS
    • Integration
      • 1.API Examples
      • 2.Importing the SDK
      • 3.Entering a Room
      • 4.Subscribing to Audio/Video Streams
      • 5.Publish Audio/Video Streams
      • 6.Exiting a Room
      • 7.Sensing Network Quality
      • 8.Enabling Screen Sharing
      • 9.Setting Video Quality
      • 10.Rotating Videos
    • Testing Network Quality
    • Custom Capturing and Rendering
    • Custom Audio Capturing and Playback
    • Client APIs
      • Overview
      • TRTCCloud
      • TRTCCloudDelegate
      • TRTCStatistics
      • TXAudioEffectManager
      • TXBeautyManager
      • TXDeviceManager
      • Type Definition
      • Deprecated Interface
      • ErrorCode
    • Release Notes
  • macOS
    • Integration
      • 1.API Examples
      • 2.Importing the SDK
      • 3.Entering a Room
      • 4.Subscribing to Audio/Video Streams
      • 5.Publish Audio/Video Streams
      • 6.Exiting a Room
      • 7.Sensing Network Quality
      • 8.Enabling Screen Sharing
      • 9.Sharing Computer Audio
      • 10.Setting Video Quality
      • 11.Rotating Videos
    • Testing Hardware Devices
    • Testing Network Quality
    • Custom Capturing and Rendering
    • Custom Audio Capturing and Playback
    • Client APIs
      • Overview
      • TRTCCloud
      • TRTCCloudDelegate
      • TRTCStatistics
      • TXAudioEffectManager
      • TXBeautyManager
      • TXDeviceManager
      • Type Definition
      • Deprecated Interface
      • ErrorCode
      • Release Notes
    • Release Notes
  • Windows C++
    • Integration
      • 1.API Examples
      • 2.Importing the SDK
      • 3.Entering a Room
      • 4.Subscribing to Audio/Video Streams
      • 5.Publish Audio/Video Streams
      • 6.Exiting a Room
      • 7.Sensing Network Quality
      • 8.Enabling Screen Sharing
      • 9.Setting Video Quality
      • 10.Rotating Videos
    • Testing Hardware Devices
    • Testing Network Quality
    • Custom Capturing and Rendering
    • Custom Audio Capturing and Playback
    • Client APIs
      • Overview
      • ITRTCCloud
      • ITRTCStatistics
      • TRTCCloudCallback
      • ITXAudioEffectManager
      • ITXDeviceManager
      • Type Definition
      • Deprecated Interface
      • Error Codes
    • Release Notes
  • Electron
    • Integration
      • 1.API Examples
      • 2.Importing the SDK
      • 3.Entering a Room
      • 4.Subscribing to Audio/Video Streams
      • 5.Publish Audio/Video Streams
      • 6.Exiting a Room
      • 7.Sensing Network Quality
      • 8.Enabling Screen Sharing
      • 9.Sharing Computer Audio
      • 10.Setting Video Quality
      • 11.Rotating Videos
    • Client APIs
      • Overview
      • Error Codes
  • Flutter
    • Integration
      • 1.API Examples
      • 2.Importing the SDK
      • 3.Entering a Room
      • 4.Subscribing to Audio/Video Streams
      • 5.Publish Audio/Video Streams
      • 6.Exiting a Room
      • 7.Sensing Network Quality
      • 8.Enabling Screen Sharing
      • 9.Sharing Computer Audio
      • 10.Setting Video Quality
      • 11.Rotating Videos
    • Client APIs
      • Overview
      • Error Codes
  • Unity
    • Integration
      • 1.API Examples
      • 2Importing the SDK
    • Client APIs
      • Overview
      • Error Codes
  • Qt
    • Integration
      • 1.Importing the SDK
  • Overview
    • Overview
    • Features
    • Performance Statistics
  • Pricing
    • RTC-Engine Packages
    • Billing of On-Cloud Recording
    • Billing of MixTranscoding and Relay to CDN
    • Billing Explanation for Subscription Package Duration
    • Billing of Monitoring Dashboard
    • Free Minutes
    • Pay-As-You-Go
  • Concepts
  • FAQs
    • FAQs for Beginners
    • Migration Guide
      • Twilio Video to Tencent RTC
      • Billing
      • Features
      • UserSig
      • Firewall Restrictions
      • How to Downsize Installation Package
      • TRTCCalling for Web
      • Audio and Video Quality
      • Others
RTC Engine

API List

API Details

TRTC

1. TRTC is the main entry for TRTC SDK, providing APIs such as create trtc instance(TRTC.create), TRTC.getCameraList, TRTC.getMicrophoneList, TRTC.isSupported.
2. trtc instance, provides the core capability for real-time audio and video calls.
Enter room trtc.enterRoom
Exit room trtc.exitRoom
Turn on camera trtc.startLocalVideo
Turn on microphone trtc.startLocalAudio
Turn off camera trtc.stopLocalVideo
Turn off microphone trtc.stopLocalAudio
Play remote video trtc.startRemoteVideo
Stop playing remote video trtc.stopRemoteVideo
Mute/unmute remote audio trtc.muteRemoteAudio

TRTC Static Methods

Name
Description
create
Create a TRTC object for implementing functions such as entering a room, previewing, pushing, and pulling streams.
Set the log output level It is recommended to set the DEBUG level during development and testing, which includes detailed prompt information. The default output level is INFO, which includes the log information of the main functions of the SDK.
Check if the TRTC Web SDK is supported by the current browser
Returns the list of camera devices Note
Returns the list of microphone devices Note
Returns the list of speaker devices For security reasons, the label and deviceId fields may be empty before the user authorizes access to the camera or microphone. Therefore, it is recommended to call this interface to obtain device details after the user authorizes access.
Set the current speaker for audio playback

TRTC Methods

Name
Description
enterRoom
Enter a video call room.
exitRoom
Exit the current audio and video call room.
Switches the user role, only effective in TRTC.TYPE.SCENE_LIVE interactive live streaming mode.
destroy
Destroy the TRTC instance
Start collecting audio from the local microphone and publish it to the current room.
Update the configuration of the local microphone.
Stop collecting and publishing the local microphone.
Start collecting video from the local camera, play the camera's video on the specified HTMLElement tag, and publish the camera's video to the current room.
Update the local camera configuration.
Stop capturing, previewing, and publishing the local camera.
Start screen sharing.
Update screen sharing configuration
Stop screen sharing.
Play remote video
Update remote video playback configuration
Used to stop remote video playback.
Mute a remote user and stop pulling audio data from that user. Only effective for the current user, other users in the room can still hear the muted user's voice.
Used to control the playback volume of remote audio.
Enables or disables the volume callback.
on
Listen to the TRTC events
off
Remove event listener
Get video snapshot
Get video track
Get video snapshot
Get audio track
Send SEI message
Start plugin
Update plugin
Stop plugin
Note
For FAQs, see Web.

Error Code

TRTC SDK defines 8 types of error codes. TRTC will throws error in the APIs and TRTC.EVENT.ERROR event and you can get the RtcError object for handling error.
Key
Code
Description
5000
The parameters passed in when calling the interface do not meet the API requirements.
Handling suggestion: Please check whether the passed-in parameters comply with the API specifications, such as whether the parameter type is correct.
5100
The prerequisite requirements of the API are not met when calling the interface.
Handling suggestion: Please check whether the calling logic complies with the API prerequisite requirements according to the corresponding API document.

For example:
1. Switching roles before entering the room successfully.
2. The remote user and stream being played do not exist.
5200
The current environment does not support this function, indicating that the current browser does not support calling the corresponding API.
Handling suggestion: Usually, TRTC.isSupported can be used to perceive which capabilities the current browser supports. If the browser does not support it, you need to guide the user to use a browser that supports this capability. Reference: Detect Capabilities
5300
Capturing media devices failed. The following interfaces will throw this error code when an exception occurs: startLocalVideo, updateLocalVideo, startLocalAudio, updateLocalAudio, startScreenShare, updateScreenShare

Handling suggestion: Guide the user to check whether the device has a camera and microphone, whether the system has authorized the browser, and whether the browser has authorized the page. It is recommended to increase the device detection process before entering the room to confirm whether the microphone and camera exist and can be captured normally before proceeding to the next call operation. Usually, this exception can be avoided after the device check.
Implementation reference: Detect Capabilities
If you need to distinguish more detailed exception categories, you can process according to the extraCode
5400
Got server error.

Reasons: expired userSig, Tencent Cloud account arrears, TRTC service not enabled, etc.
Handling suggestion: Refer to the extraCode.
5500
The exception that the SDK cannot solve after multiple retries under the condition of meeting the API call requirements, usually caused by browser or network problems. The following interfaces will throw this error code when an exception occurs: enterRoom, startLocalVideo, startLocalAudio, startScreenShare, startRemoteVideo, switchRole
Handling suggestions:
Confirm whether the domain name and port required for communication meet your network environment requirements, refer to Handle Firewall Restriction.
Other issues need to be handled by engineers. Submit an issue in github.
5998
The error code thrown when the API execution is aborted.

When the API is called or repeatedly called without meeting the API lifecycle, the API will abort execution to avoid meaningless operations.
For example: Call enterRoom, startLocalVideo continuously, and call exitRoom without entering the room.
The following interfaces will throw this error code when an exception occurs: enterRoom, startLocalVideo, startLocalAudio, startScreenShare, startRemoteVideo, switchRole
Handling suggestions: Capture and identify this error code, then avoid unnecessary calls in business logic, or you can do nothing, because the SDK has done side-effect-free processing, you only need to identify and ignore this error code when catching it.
5999
Unknown error.
Handling suggestions: Submit an issue in github.

Contact Us

Contact us on telegram.