Real-Time Communication

Tencent Real-Time Communication Client APIs

Product Documentation

©2013-2019 Tencent Cloud. All rights reserved. Page 1 of 184 Tencent Real-Time Communication

Copyright Notice

©2013-2019 Tencent Cloud. All rights reserved.

Copyright in this document is exclusively owned by Tencent Cloud. You must not reproduce, modify, copy or distribute in any way, in whole or in part, the contents of this document without Tencent Cloud's the prior written consent.

Trademark Notice

All trademarks associated with Tencent Cloud and its services are owned by Tencent Cloud (Beijing) Company Limited and its affiliated companies. Trademarks of third parties referred to in this document are owned by their respective proprietors.

Service Statement

This document is intended to provide users with general information about Tencent Cloud's products and services only and does not form part of Tencent Cloud's terms and conditions. Tencent Cloud's products or services are subject to change. Specific products and services and the standards applicable to them are exclusively provided for in Tencent Cloud's applicable terms and conditions.

©2013-2019 Tencent Cloud. All rights reserved. Page 2 of 184 Tencent Real-Time Communication

Contents

Client APIs iOS & macOS Overview Error Codes Android Overview Error Codes All Platforms (C++) Overview Error Codes Web Overview Error Codes Electron Overview Error Codes Flutter Overview Error Codes Unity Overview Error Codes Desktop Browser Overview Error Codes

©2013-2019 Tencent Cloud. All rights reserved. Page 3 of 184 Tencent Real-Time Communication

Client APIs iOS & macOS Overview

Last updated:2021-09-09 11:40:52

Create Instance And Event Callback

API DESC

sharedInstance Create TRTCCloud instance (singleton mode)

destroySharedIntance Terminate TRTCCloud instance (singleton mode)

delegate Set TRTC event callback

delegateQueue Set the queue that drives the TRTCCloudDelegate event callback

Room APIs

API DESC

enterRoom Enter room

exitRoom Exit room

switchRole Switch role

switchRoom Switch room

connectOtherRoom Request cross-room call

disconnectOtherRoom Exit cross-room call

Set subscription mode (which must be set before room entry for setDefaultStreamRecvMode it to take effect)

createSubCloud Create room subinstance (for concurrent multi-room listen/watch)

destroySubCloud Terminate room subinstance

CDN APIs

API DESC

©2013-2019 Tencent Cloud. All rights reserved. Page 4 of 184 Tencent Real-Time Communication

API DESC

startPublishing Start publishing audio/video streams to Tencent Cloud CSS CDN

stopPublishing Stop publishing audio/video streams to Tencent Cloud CSS CDN

startPublishCDNStream Start publishing audio/video streams to non-Tencent Cloud CDN

stopPublishCDNStream Stop publishing audio/video streams to non-Tencent Cloud CDN

Set the layout and transcoding parameters of On-Cloud setMixTranscodingConfig MixTranscoding

Video APIs

API DESC

startLocalPreview Enable the preview image of local camera (mobile)

startLocalPreview Enable the preview image of local camera (desktop)

updateLocalView Update the preview image of local camera

stopLocalPreview Stop camera preview

muteLocalVideo Pause/Resume publishing local video stream

setVideoMuteImage Set placeholder image during local video pause

Subscribe to remote user's video stream and bind video startRemoteView rendering control

updateRemoteView Update remote user's video rendering control

Stop subscribing to remote user's video stream and release stopRemoteView rendering control

Stop subscribing to all remote users' video streams and release stopAllRemoteView all rendering resources

muteRemoteVideoStream Pause/Resume subscribing to remote user's video stream

muteAllRemoteVideoStreams Pause/Resume subscribing to all remote users' video streams

setVideoEncoderParam Set the encoding parameters of video encoder

setNetworkQosParam Set network quality control parameters

©2013-2019 Tencent Cloud. All rights reserved. Page 5 of 184 Tencent Real-Time Communication

API DESC

setLocalRenderParams Set the rendering parameters of local video image

setRemoteRenderParams Set the rendering mode of remote video image

setVideoEncoderRotation Set the direction of image output by video encoder

setVideoEncoderMirror Set the mirror mode of image output by encoder

setGSensorMode Set the adaptation mode of G-sensor

enableEncSmallVideoStream Enable dual-channel encoding mode with big and small images

setRemoteVideoStreamType Switch the big/small image of specified remote user

snapshotVideo Screencapture video

Audio APIs

API DESC

startLocalAudio Enable local audio capturing and publishing

stopLocalAudio Stop local audio capturing and publishing

muteLocalAudio Pause/Resume publishing local audio stream

muteRemoteAudio Pause/Resume playing back remote audio stream

muteAllRemoteAudio Pause/Resume playing back all remote users' audio streams

setAudioRoute Set audio route

setRemoteAudioVolume Set the audio playback volume of remote user

setAudioCaptureVolume Set the capturing volume of local audio

getAudioCaptureVolume Get the capturing volume of local audio

setAudioPlayoutVolume Set the playback volume of remote audio

getAudioPlayoutVolume Get the playback volume of remote audio

enableAudioVolumeEvaluation Enable volume reminder

startAudioRecording Start audio recording

©2013-2019 Tencent Cloud. All rights reserved. Page 6 of 184 Tencent Real-Time Communication

API DESC

stopAudioRecording Stop audio recording

startLocalRecording Start local media recording

stopLocalRecording Stop local media recording

Device management APIs

API DESC

getDeviceManager Get device management class (TXDeviceManager)

Beauty filter and watermark APIs

API DESC

getBeautyManager Get beauty filter management class (TXBeautyManager)

setWatermark Add watermark

Background music and sound effect APIs

API DESC

Get sound effect management class getAudioEffectManager (TXAudioEffectManager)

startSystemAudioLoopback Enable system audio capturing (for desktop systems only)

stopSystemAudioLoopback Stop system audio capturing (for desktop systems only)

setSystemAudioLoopbackVolume Set the volume of system audio capturing

Screen APIs

API DESC

Start in-app (for iOS 13.0 and startScreenCaptureInApp above only)

Start system-level screen sharing (for iOS 11.0 startScreenCaptureByReplaykit and above only)

©2013-2019 Tencent Cloud. All rights reserved. Page 7 of 184 Tencent Real-Time Communication

API DESC

Start desktop screen sharing (for desktop startScreenCapture systems only)

stopScreenCapture Stop screen sharing

pauseScreenCapture Pause screen sharing

resumeScreenCapture Resume screen sharing

Enumerate shareable screens and windows (for getScreenCaptureSourcesWithThumbnailSize macOS only)

Select the screen or window to (for selectScreenCaptureTarget macOS only)

Set the video encoding parameters of screen setSubStreamEncoderParam sharing (i.e., substream) (for desktop systems only)

Set the audio mixing volume of screen sharing setSubStreamMixVolume (for desktop systems only)

Add specified windows to the exclusion list of addExcludedShareWindow screen sharing (for desktop systems only)

Remove specified windows from the exclusion removeExcludedShareWindow list of screen sharing (for desktop systems only)

Remove all windows from the exclusion list of removeAllExcludedShareWindows screen sharing (for desktop systems only)

Add specified windows to the inclusion list of addIncludedShareWindow screen sharing (for desktop systems only)

Remove specified windows from the inclusion removeIncludedShareWindow list of screen sharing (for desktop systems only)

Remove all windows from the inclusion list of removeAllIncludedShareWindows screen sharing (for desktop systems only)

Custom capturing and rendering APIs

API DESC

enableCustomVideoCapture Enable/Disable custom video capturing mode

©2013-2019 Tencent Cloud. All rights reserved. Page 8 of 184 Tencent Real-Time Communication

API DESC

sendCustomVideoData Deliver captured video frames to SDK

enableCustomAudioCapture Enable custom audio capturing mode

sendCustomAudioData Deliver captured audio data to SDK

enableMixExternalAudioFrame Enable/Disable custom audio track

mixExternalAudioFrame Mix custom audio track into SDK

Set the publish volume and playback volume setMixExternalAudioVolume of mixed custom audio track

generateCustomPTS Generate custom capturing timestamp

Set video data callback for third-party beauty setLocalVideoProcessDelegete filters

Set the callback of custom rendering for local setLocalVideoRenderDelegate video

Set the callback of custom rendering for setRemoteVideoRenderDelegate remote video

setAudioFrameDelegate Set custom audio data callback

Set the callback format of original audio setCapturedRawAudioFrameDelegateFormat frames captured by local mic

Set the callback format of preprocessed local setLocalProcessedAudioFrameDelegateFormat audio frames

Set the callback format of audio frames to be setMixedPlayAudioFrameDelegateFormat played back by system

enableCustomAudioRendering Enabling custom audio playback

getCustomAudioRenderingFrame Getting playable audio data

Custom message sending APIs

API DESC

sendCustomCmdMsg Use UDP channel to send custom message to all users in room

©2013-2019 Tencent Cloud. All rights reserved. Page 9 of 184 Tencent Real-Time Communication

API DESC

sendSEIMsg Use SEI channel to send custom message to all users in room

Network test APIs

API DESC

startSpeedTest Start network speed test (used before room entry)

stopSpeedTest Stop network speed test

Debugging APIs

API DESC

getSDKVersion Get SDK version information

setLogLevel Set log output level

setConsoleEnabled Enable/Disable console log printing

setLogCompressEnabled Enable/Disable local log compression

setLogDirPath Set local log storage path

setLogDelegate Set log callback

showDebugView Display dashboard

setDebugViewMargin Set dashboard margin

callExperimentalAPI Call experimental APIs

Disused APIs

API DESC

setMicVolumeOnMixing Set mic volume

Set the strength of beauty, brightening, and rosy setBeautyStyle skin filters

setEyeScaleLevel Set the strength of eye enlarging filter

setFaceScaleLevel Set the strength of face slimming filter

©2013-2019 Tencent Cloud. All rights reserved. Page 10 of 184 Tencent Real-Time Communication

API DESC

setFaceVLevel Set the strength of chin slimming filter

Set the strength of chin lengthening/shortening setChinLevel filter

setFaceShortLevel Set the strength of face shortening filter

setNoseSlimLevel Set the strength of nose slimming filter

selectMotionTmpl Set animated sticker

setMotionMute Mute animated sticker

startScreenCapture Start screen sharing

setFilter Set color filter

setFilterConcentration Set the strength of color filter

setGreenScreenFile Set green screen video

playBGM Start background music

stopBGM Stop background music

pauseBGM Stop background music

resumeBGM Stop background music

getBGMDuration Get the total length of background music in ms

setBGMPosition Set background music playback progress

setBGMVolume Set background music volume

Set the local playback volume of background setBGMPlayoutVolume music

Set the remote playback volume of background setBGMPublishVolume music

setReverbType Set reverb effect

setVoiceChangerType Set voice changing type

playAudioEffect Play sound effect

©2013-2019 Tencent Cloud. All rights reserved. Page 11 of 184 Tencent Real-Time Communication

API DESC

setAudioEffectVolume Set sound effect volume

setAudioEffectVolume Stop sound effect

stopAllAudioEffects Stop all sound effects

setAllAudioEffectsVolume Set the volume of all sound effects

pauseAudioEffect Pause sound effect

resumeAudioEffect Pause sound effect

enableAudioEarMonitoring Enable or disable in-ear monitoring

startRemoteView Start displaying remote video image

Stop displaying remote video image and pulling stopRemoteView the video data stream of remote user

setRemoteViewFillMode Set the rendering mode of remote image

setRemoteViewRotation Set the clockwise rotation angle of remote image

setLocalViewFillMode Set the rendering mode of local image

setLocalViewRotation Set the clockwise rotation angle of local image

Set the mirror mode of local camera's preview setLocalViewMirror image

Start displaying the substream image of remote startRemoteSubStreamView user

Stop displaying the substream image of remote stopRemoteSubStreamView user

setRemoteSubStreamViewFillMode Set the fill mode of substream image

Set the clockwise rotation angle of substream setRemoteSubStreamViewRotation image

setPriorRemoteVideoStreamType Specify whether to view the big or small image

setAudioQuality Set sound quality

startLocalAudio Set sound quality

©2013-2019 Tencent Cloud. All rights reserved. Page 12 of 184 Tencent Real-Time Communication

API DESC

switchCamera Switch camera

isCameraZoomSupported Query whether the current camera supports zoom

setZoom Set camera zoom ratio (focal length)

isCameraTorchSupported Query whether the device supports flash

enbaleTorch Enable/Disable flash

isCameraFocusPositionInPreviewSupported Query whether the camera supports setting focus

setFocusPosition Set the focal position of camera

Query whether the device supports the automatic isCameraAutoFocusFaceModeSupported recognition of face position

enableAutoFaceFoucs Enable/Disable face auto focus

startCameraDeviceTestInView Start camera test

stopCameraDeviceTest Start camera test

startMicDeviceTest Start mic test

stopMicDeviceTest Start mic test

startSpeakerDeviceTest Start speaker test

stopSpeakerDeviceTest Stop speaker test

getMicDevicesList Get the list of mics

getCurrentMicDevice Get the current mic device

setCurrentMicDevice Select the currently used mic

getCurrentMicDeviceVolume Get the current mic volume

setCurrentMicDeviceVolume Set the current mic volume

getCurrentMicDeviceMute Get the mute status of the current system mic

setCurrentMicDeviceMute Set the mute status of the current system mic

getSpeakerDevicesList Get the list of speakers

©2013-2019 Tencent Cloud. All rights reserved. Page 13 of 184 Tencent Real-Time Communication

API DESC

getCurrentSpeakerDevice Get the currently used speaker

setCurrentSpeakerDevice Set the speaker to use

getCurrentSpeakerDeviceVolume Get the current speaker volume

setCurrentSpeakerDeviceVolume Set the current speaker volume

getCurrentSpeakerDeviceMute Get the mute status of the current system speaker

setCurrentSpeakerDeviceMute Set whether to mute the current system speaker

getCameraDevicesList Get the list of cameras

getCurrentCameraDevice Get the currently used camera

setCurrentCameraDevice Set the camera to be used currently

setSystemVolumeType Setting the system volume type (for mobile OS)

snapshotVideo Screencapture video

enableCustomVideoCapture Enable custom video capturing mode

sendCustomVideoData Deliver captured video data to SDK

tart in-app screen sharing (for iOS 13.0 and above startScreenCaptureInApp only)

Start system-level screen sharing (for iOS 11.0 startScreenCaptureByReplaykit and above only)

muteLocalVideo Pause/Resume publishing local video stream

Pause/Resume subscribing to remote user's video muteRemoteVideoStream stream

Error and warning events

API DESC

onError Error event callback

onWarning Warning event callback

©2013-2019 Tencent Cloud. All rights reserved. Page 14 of 184 Tencent Real-Time Communication

Room event callback

API DESC

onEnterRoom Whether room entry is successful

onExitRoom Room exit

onSwitchRole Role switching

onSwitchRoom Result of room switching

onConnectOtherRoom Result of requesting cross-room call

onDisconnectOtherRoom Result of ending cross-room call

User event callback

API DESC

onRemoteUserEnterRoom A user entered the room

onRemoteUserLeaveRoom A user exited the room

onUserVideoAvailable A remote user published/unpublished primary stream video

onUserSubStreamAvailable A remote user published/unpublished substream video

onUserAudioAvailable A remote user published/unpublished audio

The SDK started rendering the first video frame of the local or onFirstVideoFrame a remote user

onFirstAudioFrame The SDK started playing the first audio frame of a remote user

onSendFirstLocalVideoFrame The first local video frame was published

onSendFirstLocalAudioFrame The first local audio frame was published

onRemoteVideoStatusUpdated Change of remote video status

Callback of statistics on network and technical metrics

API DESC

onNetworkQuality Real-time network quality statistics

©2013-2019 Tencent Cloud. All rights reserved. Page 15 of 184 Tencent Real-Time Communication

API DESC

onStatistics Real-time statistics on technical metrics

Callback of connection to the cloud

API DESC

onConnectionLost The SDK was disconnected from the cloud

onTryToReconnect The SDK is reconnecting to the cloud

onConnectionRecovery The SDK is reconnected to the cloud

Callback of hardware events

API DESC

onCameraDidReady The camera is ready

onMicDidReady The mic is ready

onAudioRouteChanged The audio route changed (for mobile devices only)

onUserVoiceVolume Volume

The status of a local device changed (for desktop OS onDevice only)

onAudioDeviceCaptureVolumeChanged The capturing volume of the mic changed

onAudioDevicePlayoutVolumeChanged The playback volume changed

Whether system audio capturing is enabled onSystemAudioLoopbackError successfully (for macOS only)

Callback of the receipt of a custom message

API DESC

onRecvCustomCmdMsgUserId Receipt of custom message

onMissCustomCmdMsgUserId Loss of custom message

onRecvSEIMsg Receipt of SEI message

©2013-2019 Tencent Cloud. All rights reserved. Page 16 of 184 Tencent Real-Time Communication

CDN event callback

API DESC

onStartPublishing Started publishing to Tencent Cloud CSS CDN

onStopPublishing Stopped publishing to Tencent Cloud CSS CDN

onStartPublishCDNStream Started publishing to non-Tencent Cloud’s live streaming CDN

onStopPublishCDNStream Stopped publishing to non-Tencent Cloud’s live streaming CDN

Set the layout and transcoding parameters for On-Cloud onSetMixTranscodingConfig MixTranscoding

Screen sharing event callback

API DESC

onScreenCaptureStarted Screen sharing started

onScreenCapturePaused Screen sharing was paused

onScreenCaptureResumed Screen sharing was resumed

onScreenCaptureStoped Screen sharing stopped

Callback of local recording and screenshot events

API DESC

onLocalRecordBegin Local recording started

onLocalRecording Local media is being recorded

onLocalRecordComplete Local recording stopped

Disused callbacks

API DESC

onUserEnter An anchor entered the room (disused)

onUserExit An anchor left the room (disused)

onAudioEffectFinished Audio effects ended (disused)

©2013-2019 Tencent Cloud. All rights reserved. Page 17 of 184 Tencent Real-Time Communication

Callback of custom video processing

API DESC

onRenderVideoFrame Custom video rendering

onProcessVideoFrame Video processing by third-party beauty filters

onGLContextDestory The OpenGL context in the SDK was destroyed

Callback of custom audio processing

API DESC

onCapturedRawAudioFrame Raw audio data captured locally

Audio data captured by the local mic and pre-processed by the onLocalProcessedAudioFrame audio module

onRemoteUserAudioFrame Audio data of each remote user before audio mixing

Data mixed from each channel before being submitted to the onMixedPlayAudioFrame system for playback

Data mixed from all the captured and to-be-played audio in the onMixedAllAudioFrame SDK

Other event callbacks

API DESC

onLog Printing of local log

Definitions of video enumerated values

API DESC

TRTCVideoResolution Video resolution

TRTCVideoResolutionMode Video aspect ratio mode

TRTCVideoStreamType Video stream type

TRTCVideoFillMode Video image fill mode

TRTCVideoRotation Video image rotation direction

©2013-2019 Tencent Cloud. All rights reserved. Page 18 of 184 Tencent Real-Time Communication

API DESC

TRTCVideoPixelFormat Video pixel format

TRTCVideoBufferType Video data transfer method

TRTCVideoMirrorType Video mirror type

TRTCSnapshotSourceType Data source of local video screenshot

Definitions of network enumerated values

API DESC

TRTCAppScene Use cases

TRTCRoleType Role

TRTCQosControlMode QoS control mode (disused)

TRTCVideoQosPreference Image quality preference

TRTCQualityInfo Network quality

TRTCAVStatusType Audio/Video playback status

TRTCAVStatusChangeReason Reasons for playback status changes

Definitions of audio enumerated values

API DESC

TRTCAudioSampleRate Audio sample rate

TRTCAudioQuality Sound quality

TRTCAudioRoute Audio route (i.e., audio playback mode)

TRTCReverbType Audio reverb mode

TRTCVoiceChangerType Voice changing type

Definitions of other enumerated values

API DESC

©2013-2019 Tencent Cloud. All rights reserved. Page 19 of 184 Tencent Real-Time Communication

API DESC

TRTCLogLevel Log level

TRTCGSensorMode G-sensor switch (for mobile devices only)

TRTCTranscodingConfigMode Layout mode of On-Cloud MixTranscoding

TRTCRecordType Media recording type

TRTCMixInputType Stream mix input type

TRTCMediaDeviceType Device type (for desktop platforms only)

TRTCAudioRecordingContent Audio recording content type

Definitions of core TRTC classes

API DESC

TRTCParams Room entry parameters

TRTCVideoEncParam Video encoding parameters

TRTCNetworkQosParam Network QoS control parameter set

TRTCRenderParams Rendering parameters of video image

TRTCQualityInfo Network quality

TRTCVolumeInfo Volume

TRTCSpeedTestResult Network speed test result

TRTCVideoFrame Video frame information

TRTCAudioFrame Audio frame data

Description information of each video image in On-Cloud TRTCMixUser MixTranscoding

Layout and transcoding parameters of On-Cloud TRTCTranscodingConfig MixTranscoding

Push parameters required to be set when publishing TRTCPublishCDNParam audio/video streams to non-Tencent Cloud CDN

TRTCAudioRecordingParams Local audio file recording parameters

©2013-2019 Tencent Cloud. All rights reserved. Page 20 of 184 Tencent Real-Time Communication

API DESC

TRTCLocalRecordingParams Local media file recording parameters

TRTCAudioEffectParam Sound effect parameter (disused)

TRTCSwitchRoomConfig Room switch parameter

TRTCAudioFrameDelegateFormat Format parameter of custom audio callback

©2013-2019 Tencent Cloud. All rights reserved. Page 21 of 184 Tencent Real-Time Communication

Error Codes

Last updated:2021-07-20 11:02:10

Error Codes

Basic error codes

Code Value Description

ERR_NULL 0 No error

Error codes for room entry

TRTCCloud.enterRoom() will trigger this type of error codes if cross-room co-anchoring fails. You can use the callback functions TRTCCloudDelegate.onEnterRoom() and TRTCCloudDelegate.OnError() to capture related notifications.

Code Value Description

ERR_ROOM_ENTER_FAIL -3301 Failed to enter the room

Empty room entry parameter. Please check whether valid ERR_ENTER_ROOM_PARAM_NULL -3316 parameters are passed in to the TRTCCloud.enterRoom(): API when it is called

Incorrect room entry parameter ERR_SDK_APPID_INVALID -3317 sdkAppId

Incorrect room entry parameter ERR_ROOM_ID_INVALID -3318 roomId

Incorrect room entry parameter ERR_USER_ID_INVALID -3319 userID

Incorrect room entry parameter ERR_USER_SIG_INVALID -3320 userSig

The room entry request timed out. ERR_ROOM_REQUEST_ENTER_ROOM_TIMEOUT -3308 Please check the network

©2013-2019 Tencent Cloud. All rights reserved. Page 22 of 184 Tencent Real-Time Communication

Code Value Description

Unavailable service. Please check whether the remained validity period in minutes in the package ERR_SERVER_INFO_SERVICE_SUSPENDED -100013 is greater than 0 and whether the Tencent Cloud account is in arrears

Error codes for room exit

TRTCCloud.exitRoom() will trigger this type of error codes if cross-room co-anchoring fails. You can use the callback function TRTCCloudDelegate.OnError() to capture related notifications.

Code Value Description

ERR_ROOM_REQUEST_QUIT_ROOM_TIMEOUT -3325 The room exit request timed out

Error codes for devices (camera, mic, and speaker)

You can use the callback function TRTCCloudDelegate.OnError() to capture related notifications.

Code Value Description

Failed to enable the camera; for example, the configuration program (driver) of the camera on Windows or macOS was exceptional. In this case, ERR_CAMERA_START_FAIL -1301 please try to disable and then enable the camera again, restart the device, or update the configuration program

The camera is not authorized. This error usually ERR_CAMERA_NOT_AUTHORIZED -1314 occurs on mobile devices and may be caused by permission denial by user

Incorrect camera parameter settings (unsupported ERR_CAMERA_SET_PARAM_FAIL -1315 value or other causes)

The camera is being used. Please try to enable ERR_CAMERA_OCCUPY -1316 another camera

©2013-2019 Tencent Cloud. All rights reserved. Page 23 of 184 Tencent Real-Time Communication

Code Value Description

Failed to enable the mic; for example, the configuration program (driver) of the mic on Windows or macOS was exceptional. In this case, ERR_MIC_START_FAIL -1302 please try to disable and then enable the mic again, restart the device, or update the configuration program

The mic is not authorized. This error usually ERR_MIC_NOT_AUTHORIZED -1317 occurs on mobile devices and may be caused by permission denial by user

ERR_MIC_SET_PARAM_FAIL -1318 Failed to set mic parameters

The mic is being used. For example, if the mobile ERR_MIC_OCCUPY -1319 device is on a call, the mic will fail to be enabled

ERR_MIC_STOP_FAIL -1320 Failed to disable the mic

Failed to enable the speaker; for example, the configuration program (driver) of the speaker on Windows or macOS was exceptional. In this case, ERR_SPEAKER_START_FAIL -1321 please try to disable and then enable the speaker again, restart the device, or update the configuration program

ERR_SPEAKER_SET_PARAM_FAIL -1322 Failed to set the speaker parameters

ERR_SPEAKER_STOP_FAIL -1323 Failed to disable the speaker

Error codes for screen sharing

You can use the callback function TRTCCloudDelegate.OnError() to capture related notifications.

Code Value Description

©2013-2019 Tencent Cloud. All rights reserved. Page 24 of 184 Tencent Real-Time Communication

Code Value Description

Failed to start screen sharing. If this error occurs on a mobile device, it may be caused by permission ERR_SCREEN_CAPTURE_START_FAIL -1308 denial by user; if on Windows or macOS, please check whether parameters of the screen sharing API meet the requirements

Screen sharing failed. Please use Android 5.0 or above if the device ERR_SCREEN_CAPTURE_UNSURPORT -1309 is on Android or use iOS 11.0 or above if the device is on iOS

No permission to ERR_SERVER_CENTER_NO_PRIVILEDGE_PUSH_SUB_VIDEO -102015 upstream substream

Other users are ERR_SERVER_CENTER_ANOTHER_USER_PUSH_SUB_VIDEO -102016 upstreaming substream

Screencapturing was ERR_SCREEN_CAPTURE_STOPPED -7001 stopped by the system

Error code for encoding and decoding

You can use the callback function TRTCCloudDelegate.OnError() to capture related notifications.

Code Value Description

Failed to encode video frames; for example, when a user switches from one application to another one on an iOS device, the hardware encoder may ERR_VIDEO_ENCODE_FAIL -1303 be released by the system; and after the user switches back, this error may be thrown before the hardware encoder is restarted

ERR_UNSUPPORTED_RESOLUTION -1305 Unsupported video resolution

©2013-2019 Tencent Cloud. All rights reserved. Page 25 of 184 Tencent Real-Time Communication

Code Value Description

Failed to encode audio frames; for example, the ERR_AUDIO_ENCODE_FAIL -1304 SDK could not process the custom audio data passed in

ERR_UNSUPPORTED_SAMPLERATE -1306 Unsupported audio sample rate

Error codes for custom capturing

You can use the callback function TRTCCloudDelegate.OnError() to capture related notifications.

Code Value Description

ERR_PIXEL_FORMAT_UNSUPPORTED -1327 Unsupported pixel format

ERR_BUFFER_TYPE_UNSUPPORTED -1328 Unsupported buffer type

Error codes for CDN binding and mixtranscoding

You can use the callback functions TRTCCloudDelegate.onStartPublishing() and TRTCCloudDelegate.onSetMixTranscodingConfig() to capture related notifications.

Code Value Description

The relayed push request ERR_PUBLISH_CDN_STREAM_REQUEST_TIME_OUT -3321 timed out

The On-Cloud MixTranscoding ERR_CLOUD_MIX_TRANSCODING_REQUEST_TIME_OUT -3322 request timed out

The returned packet of ERR_PUBLISH_CDN_STREAM_SERVER_FAILED -3323 relayed push is exceptional

The returned packet of On- ERR_CLOUD_MIX_TRANSCODING_SERVER_FAILED -3324 Cloud MixTranscoding is exceptional

Signaling timed out when ERR_ROOM_REQUEST_START_PUBLISHING_TIMEOUT -3333 starting pushing to Tencent Cloud LVB CDN

Signaling was exceptional ERR_ROOM_REQUEST_START_PUBLISHING_ERROR -3334 when starting pushing to Tencent Cloud LVB CDN

©2013-2019 Tencent Cloud. All rights reserved. Page 26 of 184 Tencent Real-Time Communication

Code Value Description

Signaling timed out when ERR_ROOM_REQUEST_STOP_PUBLISHING_TIMEOUT -3335 stopping pushing to Tencent Cloud LVB CDN

Signaling was exceptional ERR_ROOM_REQUEST_STOP_PUBLISHING_ERROR -3336 when stopping pushing to Tencent Cloud LVB CDN

Error codes for cross-room co-anchoring

TRTCCloud.ConnectOtherRoom() will trigger this type of error codes if cross-room co-anchoring fails. You can use the callback function TRTCCloudDelegate.onConnectOtherRoom() to capture related notifications.

Code Value Description

The co- anchoring ERR_ROOM_REQUEST_CONN_ROOM_TIMEOUT -3326 request timed out

The request for exiting co- ERR_ROOM_REQUEST_DISCONN_ROOM_TIMEOUT -3327 anchoring timed out

Invalid ERR_ROOM_REQUEST_CONN_ROOM_INVALID_PARAM -3328 parameter

The current role is viewer, and cross- room co- anchoring cannot be ERR_CONNECT_OTHER_ROOM_AS_AUDIENCE -3330 requested or stopped. switchRole() needs to be used to switch the role to anchor first

©2013-2019 Tencent Cloud. All rights reserved. Page 27 of 184 Tencent Real-Time Communication

Code Value Description

Cross-room co- ERR_SERVER_CENTER_CONN_ROOM_NOT_SUPPORT -102031 anchoring unsupported

The number of co-anchoring ERR_SERVER_CENTER_CONN_ROOM_REACH_MAX_NUM -102032 calls has reached the upper limit

The number of retries for cross-room co- ERR_SERVER_CENTER_CONN_ROOM_REACH_MAX_RETRY_TIMES -102033 anchoring has reached the upper limit

The request for cross-room ERR_SERVER_CENTER_CONN_ROOM_REQ_TIMEOUT -102034 co-anchoring timed out

Incorrect format of the ERR_SERVER_CENTER_CONN_ROOM_REQ -102035 cross-room co- anchoring request

No signature ERR_SERVER_CENTER_CONN_ROOM_NO_SIG -102036 for cross-room co-anchoring

Failed to decrypt the ERR_SERVER_CENTER_CONN_ROOM_DECRYPT_SIG -102037 signature for cross-room co- anchoring

The key for decrypting the cross-room co- ERR_SERVER_CENTER_CONN_ROOM_NO_KEY -102038 anchoring signature was not found

©2013-2019 Tencent Cloud. All rights reserved. Page 28 of 184 Tencent Real-Time Communication

Code Value Description

An error occurred when parsing a ERR_SERVER_CENTER_CONN_ROOM_PARSE_SIG -102039 signature for cross-room co- anchoring

Incorrect timestamp of ERR_SERVER_CENTER_CONN_ROOM_INVALID_SIG_TIME -102040 the cross-room co-anchoring signature

Incorrect cross-room co- ERR_SERVER_CENTER_CONN_ROOM_SIG_GROUPID -102041 anchoring signature

No co- ERR_SERVER_CENTER_CONN_ROOM_NOT_CONNED -102042 anchoring in this room

The user did ERR_SERVER_CENTER_CONN_ROOM_USER_NOT_CONNED -102043 not initiate co- anchoring

Cross-room co- ERR_SERVER_CENTER_CONN_ROOM_FAILED -102044 anchoring failed

Failed to cancel cross- ERR_SERVER_CENTER_CONN_ROOM_CANCEL_FAILED -102045 room co- anchoring

The room to be called in ERR_SERVER_CENTER_CONN_ROOM_CONNED_ROOM_NOT_EXIST -102046 co-anchoring does not exist

©2013-2019 Tencent Cloud. All rights reserved. Page 29 of 184 Tencent Real-Time Communication

Code Value Description

The number of rooms that can join co- ERR_SERVER_CENTER_CONN_ROOM_CONNED_REACH_MAX_ROOM -102047 anchoring has reached the upper limit

The user to be called in co- ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_NOT_EXIST -102048 anchoring does not exist

The user to be called in co- ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_DELETED -102049 anchoring was deleted

The number of users that can join co- ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_FULL -102050 anchoring has reached the upper limit

Disordered co- anchoring ERR_SERVER_CENTER_CONN_ROOM_INVALID_SEQ -102051 request numbers

Warning Codes

Warning codes do not require your special attention, and you can choose whether to prompt the current user accordingly.

Code Value Description

An error occurred while enabling the hardware encoder, and the WARNING_HW_ENCODER_START_FAIL 1103 encoder was automatically switch to

©2013-2019 Tencent Cloud. All rights reserved. Page 30 of 184 Tencent Real-Time Communication

Code Value Description

The current CPU utilization is too high to meet software WARNING_VIDEO_ENCODER_SW_TO_HW 1107 encoding needs, and the hardware encoder was automatically switch to

Insufficient frame rate for video capturing through camera. This WARNING_INSUFFICIENT_CAPTURE_FPS 1108 error may occur in Android mobile devices with an in-built beauty filter algorithm

Failed to enable the software WARNING_SW_ENCODER_START_FAIL 1109 encoder

Camera resolution was lowered to meet the balance between WARNING_REDUCE_CAPTURE_RESOLUTION 1110 current frame rate and performance

No available camera device WARNING_CAMERA_DEVICE_EMPTY 1111 detected

No available mic device WARNING_MICROPHONE_DEVICE_EMPTY 1201 detected

No available speaker device WARNING_SPEAKER_DEVICE_EMPTY 1202 detected

The current application is not WARNING_MICROPHONE_NOT_AUTHORIZED 1203 authorized to use the mic

The audio capturing device is WARNING_MICROPHONE_DEVICE_ABNORMAL 1204 unavailable (for example, it is in use)

The audio playback device is WARNING_SPEAKER_DEVICE_ABNORMAL 1205 unavailable (for example, it is in use)

Failed to decode the current WARNING_VIDEO_FRAME_DECODE_FAIL 2101 video frame

Failed to decode the current WARNING_AUDIO_FRAME_DECODE_FAIL 2102 audio frame

©2013-2019 Tencent Cloud. All rights reserved. Page 31 of 184 Tencent Real-Time Communication

Code Value Description

WARNING_VIDEO_PLAY_LAG 2105 Video playback lagged

Failed to enable the hardware WARNING_HW_DECODER_START_FAIL 2106 decoder, and the software decoder was used

The hardware decoder failed to decode the first I frame of the WARNING_VIDEO_DECODER_HW_TO_SW 2108 current stream, and the SDK automatically switched to the software decoder

Failed to enable the software WARNING_SW_DECODER_START_FAIL 2109 decoder

WARNING_VIDEO_RENDER_FAIL 2110 Failed to render video

Capturing is already in progress. WARNING_START_CAPTURE_IGNORED 4000 The request to enable capturing is ignored

Failed to write the recorded WARNING_AUDIO_RECORDING_WRITE_FAIL 7001 audio to a file

WARNING_ROOM_DISCONNECT 5101 Network connection was closed

The current role is viewer, so WARNING_IGNORE_UPSTREAM_FOR_AUDIENCE 6001 upstream audio/video data is ignored

Unstable network condition: the WARNING_NET_BUSY 1101 upstream bandwidth is too low, and data is restricted

Publishing error. The network was disconnected, and is being WARNING_RTMP_SERVER_RECONNECT 1102 reconnected. Maximum retry count: 3.

Playback error. The network was disconnected and is being WARNING_LIVE_STREAM_SERVER_RECONNECT 2103 reconnected. Maximum retry count: 3.

©2013-2019 Tencent Cloud. All rights reserved. Page 32 of 184 Tencent Real-Time Communication

Code Value Description

Unstable transmission of packets from the network. This may be caused by insufficient WARNING_RECV_DATA_LAG 2104 downstream bandwidth or uneven outbound stream from the anchor

WARNING_RTMP_DNS_FAIL 3001 LVB error. DNS resolution failed

LVB error. connection WARNING_RTMP_SEVER_CONN_FAIL 3002 failed

LVB error. Handshake with the WARNING_RTMP_SHAKE_FAIL 3003 RTMP server failed

LVB error. The server actively WARNING_RTMP_SERVER_BREAK_CONNECT 3004 closed the connection

LVB error. RTMP read/write WARNING_RTMP_READ_WRITE_FAIL 3005 failed, and connection will be closed

LVB error. RTMP write failed WARNING_RTMP_WRITE_FAIL 3006 (SDK internal error code, which will not be thrown out)

LVB error. RTMP read failed (SDK WARNING_RTMP_READ_FAIL 3007 internal error code, which will not be thrown out)

LVB error. If no data is sent in WARNING_RTMP_NO_DATA 3008 30s, the server will actively close the connection

LVB error. Failed to call "connect" to connect to the WARNING_PLAY_LIVE_STREAM_INFO_CONNECT_FAIL 3009 server (SDK internal error code, which will not be thrown out)

LVB error. Connection failed since there was no video in the WARNING_NO_STEAM_SOURCE_FAIL 3010 stream address (SDK internal error code, which will not be thrown out)

©2013-2019 Tencent Cloud. All rights reserved. Page 33 of 184 Tencent Real-Time Communication

Code Value Description

Network disconnected. WARNING_ROOM_RECONNECT 5102 Automatic reconnection has been enabled

Unstable network condition: the WARNING_ROOM_NET_BUSY 5103 upstream bandwidth is too low, and data upload is restricted

©2013-2019 Tencent Cloud. All rights reserved. Page 34 of 184 Tencent Real-Time Communication

Android Overview

Last updated:2021-09-09 11:41:49

Create Instance And Event Callback

API DESC

sharedInstance Create TRTCCloud instance (singleton mode)

destroySharedInstance Terminate TRTCCloud instance (singleton mode)

setListener Set TRTC event callback

setListenerHandler Set the queue that drives the TRTCCloudDelegate event callback

Room APIs

API DESC

enterRoom Enter room

exitRoom Exit room

switchRole Switch role

switchRoom Switch room

ConnectOtherRoom Request cross-room call

DisconnectOtherRoom Exit cross-room call

Set subscription mode (which must be set before room entry for setDefaultStreamRecvMode it to take effect)

createSubCloud Create room subinstance (for concurrent multi-room listen/watch)

destroySubCloud Terminate room subinstance

CDN APIs

API DESC

startPublishing Start publishing audio/video streams to Tencent Cloud CSS CDN

©2013-2019 Tencent Cloud. All rights reserved. Page 35 of 184 Tencent Real-Time Communication

API DESC

stopPublishing Stop publishing audio/video streams to Tencent Cloud CSS CDN

startPublishCDNStream Start publishing audio/video streams to non-Tencent Cloud CDN

stopPublishCDNStream Stop publishing audio/video streams to non-Tencent Cloud CDN

Set the layout and transcoding parameters of On-Cloud setMixTranscodingConfig MixTranscoding

Video APIs

API DESC

startLocalPreview Enable the preview image of local camera (mobile)

updateLocalView Update the preview image of local camera

stopLocalPreview Stop camera preview

muteLocalVideo Pause/Resume publishing local video stream

setVideoMuteImage Set placeholder image during local video pause

Subscribe to remote user's video stream and bind video startRemoteView rendering control

updateRemoteView Update remote user's video rendering control

Stop subscribing to remote user's video stream and release stopRemoteView rendering control

Stop subscribing to all remote users' video streams and release stopAllRemoteView all rendering resources

muteRemoteVideoStream Pause/Resume subscribing to remote user's video stream

muteAllRemoteVideoStreams Pause/Resume subscribing to all remote users' video streams

setVideoEncoderParam Set the encoding parameters of video encoder

setNetworkQosParam Set network quality control parameters

setLocalRenderParams Set the rendering parameters of local video image

setRemoteRenderParams Set the rendering mode of remote video image

©2013-2019 Tencent Cloud. All rights reserved. Page 36 of 184 Tencent Real-Time Communication

API DESC

setVideoEncoderRotation Set the direction of image output by video encoder

setVideoEncoderMirror Set the mirror mode of image output by encoder

setGSensorMode Set the adaptation mode of G-sensor

enableEncSmallVideoStream Enable dual-channel encoding mode with big and small images

setRemoteVideoStreamType Switch the big/small image of specified remote user

snapshotVideo Screencapture video

Audio APIs

API DESC

startLocalAudio Enable local audio capturing and publishing

stopLocalAudio Stop local audio capturing and publishing

muteLocalAudio Pause/Resume publishing local audio stream

muteRemoteAudio Pause/Resume playing back remote audio stream

muteAllRemoteAudio Pause/Resume playing back all remote users' audio streams

setAudioRoute Set audio route

setRemoteAudioVolume Set the audio playback volume of remote user

setAudioCaptureVolume Set the capturing volume of local audio

getAudioCaptureVolume Get the capturing volume of local audio

setAudioPlayoutVolume Set the playback volume of remote audio

getAudioPlayoutVolume Get the playback volume of remote audio

enableAudioVolumeEvaluation Enable volume reminder

startAudioRecording Start audio recording

stopAudioRecording Stop audio recording

startLocalRecording Start local media recording

©2013-2019 Tencent Cloud. All rights reserved. Page 37 of 184 Tencent Real-Time Communication

API DESC

stopLocalRecording Stop local media recording

Query whether a certain audio capability is supported (only for checkAudioCapabilitySupport Android)

Device management APIs

API DESC

getDeviceManager Get device management class (TXDeviceManager)

Beauty filter and watermark APIs

API DESC

getBeautyManager Get beauty filter management class (TXBeautyManager)

setWatermark Add watermark

Background music and sound effect APIs

API DESC

getAudioEffectManager Get sound effect management class (TXAudioEffectManager)

Screen sharing APIs

API DESC

startScreenCapture Start screen sharing

stopScreenCapture Stop screen sharing

pauseScreenCapture Pause screen sharing

resumeScreenCapture Resume screen sharing

Set the video encoding parameters of screen sharing (i.e., setSubStreamEncoderParam substream) (for desktop systems only)

Custom capturing and rendering APIs

©2013-2019 Tencent Cloud. All rights reserved. Page 38 of 184 Tencent Real-Time Communication

API DESC

enableCustomVideoCapture Enable/Disable custom video capturing mode

sendCustomVideoData Deliver captured video frames to SDK

enableCustomAudioCapture Enable custom audio capturing mode

sendCustomAudioData Deliver captured audio data to SDK

enableMixExternalAudioFrame Enable/Disable custom audio track

mixExternalAudioFrame Mix custom audio track into SDK

Set the publish volume and playback volume of setMixExternalAudioVolume mixed custom audio track

generateCustomPTS Generate custom capturing timestamp

Set video data callback for third-party beauty setLocalVideoProcessListener filters

Set the callback of custom rendering for local setLocalVideoRenderListener video

Set the callback of custom rendering for remote setRemoteVideoRenderListener video

setAudioFrameListener Set custom audio data callback

Set the callback format of original audio frames setCapturedRawAudioFrameCallbackFormat captured by local mic

Set the callback format of preprocessed local setLocalProcessedAudioFrameCallbackFormat audio frames

Set the callback format of audio frames to be setMixedPlayAudioFrameCallbackFormat played back by system

enableCustomAudioRendering Enabling custom audio playback

getCustomAudioRenderingFrame Getting playable audio data

Custom message sending APIs

API DESC

©2013-2019 Tencent Cloud. All rights reserved. Page 39 of 184 Tencent Real-Time Communication

API DESC

sendCustomCmdMsg Use UDP channel to send custom message to all users in room

sendSEIMsg Use SEI channel to send custom message to all users in room

Network test APIs

API DESC

startSpeedTest Start network speed test (used before room entry)

stopSpeedTest Stop network speed test

Debugging APIs

API DESC

getSDKVersion Get SDK version information

setLogLevel Set log output level

setConsoleEnabled Enable/Disable console log printing

setLogCompressEnabled Enable/Disable local log compression

setLogDirPath Set local log storage path

setLogListener Set log callback

showDebugView Display dashboard

setDebugViewMargin Set dashboard margin

callExperimentalAPI Call experimental APIs

setNetEnv Set TRTC backend cluster (for use by Tencent Cloud R&D team only)

Disused APIs

API DESC

setMicVolumeOnMixing Set mic volume

Set the strength of beauty, brightening, and rosy setBeautyStyle skin filters

©2013-2019 Tencent Cloud. All rights reserved. Page 40 of 184 Tencent Real-Time Communication

API DESC

setEyeScaleLevel Set the strength of eye enlarging filter

setFaceSlimLevel Set the strength of face slimming filter

setFaceVLevel Set the strength of chin slimming filter

Set the strength of chin lengthening/shortening setChinLevel filter

setFaceShortLevel Set the strength of face shortening filter

setNoseSlimLevel Set the strength of nose slimming filter

selectMotionTmpl Set animated sticker

setMotionMute Mute animated sticker

setFilter Set color filter

setFilterConcentration Set the strength of color filter

setGreenScreenFile Set green screen video

playBGM Start background music

stopBGM Stop background music

pauseBGM Stop background music

resumeBGM Stop background music

getBGMDuration Get the total length of background music in ms

setBGMPosition Set background music playback progress

setBGMVolume Set background music volume

Set the local playback volume of background setBGMPlayoutVolume music

Set the remote playback volume of background setBGMPublishVolume music

setReverbType Set reverb effect

setVoiceChangerType Set voice changing type

©2013-2019 Tencent Cloud. All rights reserved. Page 41 of 184 Tencent Real-Time Communication

API DESC

playAudioEffect Play sound effect

setAudioEffectVolume Set sound effect volume

setAudioEffectVolume Stop sound effect

stopAllAudioEffects Stop all sound effects

setAllAudioEffectsVolume Set the volume of all sound effects

pauseAudioEffect Pause sound effect

resumeAudioEffect Pause sound effect

enableAudioEarMonitoring Enable or disable in-ear monitoring

startRemoteView Start displaying remote video image

Stop displaying remote video image and pulling stopRemoteView the video data stream of remote user

setRemoteViewFillMode Set the rendering mode of remote image

setRemoteViewRotation Set the clockwise rotation angle of remote image

setLocalViewFillMode Set the rendering mode of local image

setLocalViewRotation Set the clockwise rotation angle of local image

Set the mirror mode of local camera's preview setLocalViewMirror image

Start displaying the substream image of remote startRemoteSubStreamView user

Stop displaying the substream image of remote stopRemoteSubStreamView user

setRemoteSubStreamViewFillMode Set the fill mode of substream image

Set the clockwise rotation angle of substream setRemoteSubStreamViewRotation image

setPriorRemoteVideoStreamType Specify whether to view the big or small image

setAudioQuality Set sound quality

©2013-2019 Tencent Cloud. All rights reserved. Page 42 of 184 Tencent Real-Time Communication

API DESC

startLocalAudio Set sound quality

switchCamera Switch camera

isCameraZoomSupported Query whether the current camera supports zoom

setZoom Set camera zoom ratio (focal length)

isCameraTorchSupported Query whether the device supports flash

enableTorch Enable/Disable flash

isCameraFocusPositionInPreviewSupported Query whether the camera supports setting focus

setFocusPosition Set the focal position of camera

Query whether the device supports the automatic isCameraAutoFocusFaceModeSupported recognition of face position

setSystemVolumeType Setting the system volume type (for mobile OS)

enableCustomVideoCapture Enable custom video capturing mode

sendCustomVideoData Deliver captured video data to SDK

startScreenCapture Start screen sharing

muteLocalVideo Pause/Resume publishing local video stream

Pause/Resume subscribing to remote user's video muteRemoteVideoStream stream

Error and warning events

API DESC

onError Error event callback

onWarning Warning event callback

Room event callback

API DESC

onEnterRoom Whether room entry is successful

©2013-2019 Tencent Cloud. All rights reserved. Page 43 of 184 Tencent Real-Time Communication

API DESC

onExitRoom Room exit

onSwitchRole Role switching

onSwitchRoom Result of room switching

onConnectOtherRoom Result of requesting cross-room call

onDisConnectOtherRoom Result of ending cross-room call

User event callback

API DESC

onRemoteUserEnterRoom A user entered the room

onRemoteUserLeaveRoom A user exited the room

onUserVideoAvailable A remote user published/unpublished primary stream video

onUserSubStreamAvailable A remote user published/unpublished substream video

onUserAudioAvailable A remote user published/unpublished audio

The SDK started rendering the first video frame of the local or onFirstVideoFrame a remote user

onFirstAudioFrame The SDK started playing the first audio frame of a remote user

onSendFirstLocalVideoFrame The first local video frame was published

onSendFirstLocalAudioFrame The first local audio frame was published

onRemoteVideoStatusUpdated Change of remote video status

Callback of statistics on network and technical metrics

API DESC

onNetworkQuality Real-time network quality statistics

onStatistics Real-time statistics on technical metrics

Callback of connection to the cloud

©2013-2019 Tencent Cloud. All rights reserved. Page 44 of 184 Tencent Real-Time Communication

API DESC

onConnectionLost The SDK was disconnected from the cloud

onTryToReconnect The SDK is reconnecting to the cloud

onConnectionRecovery The SDK is reconnected to the cloud

onSpeedTest Result of server speed testing

Callback of hardware events

API DESC

onCameraDidReady The camera is ready

onMicDidReady The mic is ready

onAudioRouteChanged The audio route changed (for mobile devices only)

onUserVoiceVolume Volume

Callback of the receipt of a custom message

API DESC

onRecvCustomCmdMsg Receipt of custom message

onMissCustomCmdMsg Loss of custom message

onRecvSEIMsg Receipt of SEI message

CDN event callback

API DESC

onStartPublishing Started publishing to Tencent Cloud CSS CDN

onStopPublishing Stopped publishing to Tencent Cloud CSS CDN

onStartPublishCDNStream Started publishing to non-Tencent Cloud’s live streaming CDN

onStopPublishCDNStream Stopped publishing to non-Tencent Cloud’s live streaming CDN

Set the layout and transcoding parameters for On-Cloud onSetMixTranscodingConfig MixTranscoding

©2013-2019 Tencent Cloud. All rights reserved. Page 45 of 184 Tencent Real-Time Communication

Screen sharing event callback

API DESC

onScreenCaptureStarted Screen sharing started

onScreenCapturePaused Screen sharing was paused

onScreenCaptureResumed Screen sharing was resumed

onScreenCaptureStopped Screen sharing stopped

Callback of local recording and screenshot events

API DESC

onLocalRecordBegin Local recording started

onLocalRecording Local media is being recorded

onLocalRecordComplete Local recording stopped

Disused callbacks

API DESC

onUserEnter An anchor entered the room (disused)

onUserExit An anchor left the room (disused)

onAudioEffectFinished Audio effects ended (disused)

Callback of custom video processing

API DESC

onRenderVideoFrame Custom video rendering

onGLContextCreated An OpenGL context was created in the SDK.

onProcessVideoFrame Video processing by third-party beauty filters

onGLContextDestory The OpenGL context in the SDK was destroyed

Callback of custom audio processing

©2013-2019 Tencent Cloud. All rights reserved. Page 46 of 184 Tencent Real-Time Communication

API DESC

onCapturedRawAudioFrame Raw audio data captured locally

Audio data captured by the local mic and pre-processed by the onLocalProcessedAudioFrame audio module

onRemoteUserAudioFrame Audio data of each remote user before audio mixing

Data mixed from each channel before being submitted to the onMixedPlayAudioFrame system for playback

Data mixed from all the captured and to-be-played audio in the onMixedAllAudioFrame SDK

Other event callbacks

API DESC

onLog Printing of local log

Definitions of video enumerated values

API DESC

TRTCVideoResolution Video resolution

TRTCVideoResolutionMode Video aspect ratio mode

TRTCVideoStreamType Video stream type

TRTCVideoFillMode Video image fill mode

TRTCVideoRotation Video image rotation direction

TRTCVideoPixelFormat Video pixel format

TRTCVideoBufferType Video data transfer method

TRTCVideoMirrorType Video mirror type

TRTCSnapshotSourceType Data source of local video screenshot

Definitions of network enumerated values

API DESC

©2013-2019 Tencent Cloud. All rights reserved. Page 47 of 184 Tencent Real-Time Communication

API DESC

TRTCAppScene Use cases

TRTCRoleType Role

TRTCQosControlMode QoS control mode (disused)

TRTCVideoQosPreference Image quality preference

TRTCQuality Network quality

TRTCAVStatusType Audio/Video playback status

TRTCAVStatusChangeReason Reasons for playback status changes

Definitions of audio enumerated values

API DESC

TRTCAudioSampleRate Audio sample rate

TRTCAudioQuality Sound quality

TRTCAudioRoute Audio route (i.e., audio playback mode)

TRTCReverbType Audio reverb mode

TRTCVoiceChangerType Voice changing type

Audio capability type supported by the system (only for Android TRTCAudioCapabilityType devices)

Definitions of other enumerated values

API DESC

TRTCLogLevel Log level

TRTCGSensorMode G-sensor switch (for mobile devices only)

TRTCTranscodingConfigMode Layout mode of On-Cloud MixTranscoding

TRTCRecordType Media recording type

TRTCMixInputType Stream mix input type

©2013-2019 Tencent Cloud. All rights reserved. Page 48 of 184 Tencent Real-Time Communication

API DESC

TRTCAudioRecordingContent Audio recording content type

Definitions of core TRTC classes

API DESC

TRTCParams Room entry parameters

TRTCVideoEncParam Video encoding parameters

TRTCNetworkQosParam Network QoS control parameter set

TRTCRenderParams Rendering parameters of video image

TRTCQuality Network quality

TRTCVolumeInfo Volume

TRTCSpeedTestResult Network speed test result

Video texture data (for Android only and including texture ID TRTCTexture and EGL environment)

TRTCVideoFrame Video frame information

TRTCAudioFrame Audio frame data

Description information of each video image in On-Cloud TRTCMixUser MixTranscoding

Layout and transcoding parameters of On-Cloud TRTCTranscodingConfig MixTranscoding

Push parameters required to be set when publishing TRTCPublishCDNParam audio/video streams to non-Tencent Cloud CDN

TRTCAudioRecordingParams Local audio file recording parameters

TRTCLocalRecordingParams Local media file recording parameters

TRTCAudioEffectParam Sound effect parameter (disused)

TRTCSwitchRoomConfig Room switch parameter

TRTCAudioFrameCallbackFormat Format parameter of custom audio callback

©2013-2019 Tencent Cloud. All rights reserved. Page 49 of 184 Tencent Real-Time Communication

Error Codes

Last updated:2021-09-07 10:30:14

Error Codes

Basic error codes

Code Value Description

ERR_NULL 0 No error.

Error codes for room entry

TRTCCloud.enterRoom() triggers this type of error codes if room entry fails. You can use the callback APIs TRTCCloudDelegate.onEnterRoom() and TRTCCloudDelegate.OnError() to capture notifications about room entry errors.

Code Value Description

ERR_ROOM_ENTER_FAIL -3301 Failed to enter room.

Empty room entry parameters. Please check whether valid ERR_ENTER_ROOM_PARAM_NULL -3316 parameters are passed in the TRTCCloud.enterRoom(): API when it is called.

ERR_SDK_APPID_INVALID -3317 Invalid sdkAppId .

ERR_ROOM_ID_INVALID -3318 Invalid roomId .

ERR_USER_ID_INVALID -3319 Invalid userID .

ERR_USER_SIG_INVALID -3320 Invalid userSig .

Room entry request timed out. ERR_ROOM_REQUEST_ENTER_ROOM_TIMEOUT -3308 Please check your network.

Service unavailable. Please check whether there are remaining ERR_SERVER_INFO_SERVICE_SUSPENDED -100013 minutes in your packages and whether your Tencent Cloud account has overdue payment.

©2013-2019 Tencent Cloud. All rights reserved. Page 50 of 184 Tencent Real-Time Communication

Error code for room exit

TRTCCloud.exitRoom() triggers this error code if room exit fails. You can use the callback API TRTCCloudDelegate.OnError() to capture notifications about the error.

Code Value Description

ERR_ROOM_REQUEST_QUIT_ROOM_TIMEOUT -3325 Room exit request timed out.

Error codes for devices (camera, mic, and speaker)

You can use the callback API TRTCCloudDelegate.OnError() to capture notifications about device errors.

Code Value Description

Failed to turn camera on. This error occurs when, for example, there is a problem with the camera configuration program (driver) on Windows or ERR_CAMERA_START_FAIL -1301 macOS. In this case, turn the camera off and on again, restart the camera, or update the configuration program.

Camera not authorized. This error usually occurs ERR_CAMERA_NOT_AUTHORIZED -1314 on mobile devices and may be because users denied camera permission.

Failed to set camera parameters (unsupported ERR_CAMERA_SET_PARAM_FAIL -1315 values or others).

ERR_CAMERA_OCCUPY -1316 Camera occupied. Try using another camera.

Failed to turn mic on. This error occurs when, for example, there is a problem with the mic configuration program (driver) on Windows or ERR_MIC_START_FAIL -1302 macOS. In this case, turn the mic off and on again, restart the mic, or update the configuration program.

Mic not authorized. This error usually occurs on ERR_MIC_NOT_AUTHORIZED -1317 mobile devices and may be because users denied mic permission.

ERR_MIC_SET_PARAM_FAIL -1318 Failed to set mic parameters.

©2013-2019 Tencent Cloud. All rights reserved. Page 51 of 184 Tencent Real-Time Communication

Code Value Description

Mic occupied. This error occurs when, for example, ERR_MIC_OCCUPY -1319 the user is in a call on the mobile device, in which case TRTC will fail to turn the mic on.

ERR_MIC_STOP_FAIL -1320 Failed to turn mic off.

Failed to turn speaker on. This error occurs when, for example, there is a problem with the speaker configuration program (driver) on Windows or ERR_SPEAKER_START_FAIL -1321 macOS. In this case, turn the speaker off and on again, restart the speaker, or update the configuration program.

ERR_SPEAKER_SET_PARAM_FAIL -1322 Failed to set speaker parameters.

ERR_SPEAKER_STOP_FAIL -1323 Failed to turn speaker off.

Error codes for screen sharing

You can use the callback API TRTCCloudDelegate.OnError() to capture notifications about screen sharing errors.

Code Value Description

Failed to start screen recording. If this error occurs on a mobile device, it may be because users denied screen recording ERR_SCREEN_CAPTURE_START_FAIL -1308 permission; if it occurs on Windows or macOS, check whether the parameters of the screen recording API are set as required.

©2013-2019 Tencent Cloud. All rights reserved. Page 52 of 184 Tencent Real-Time Communication

Code Value Description

Screen recording failed. If you use Android, make sure its ERR_SCREEN_CAPTURE_UNSURPORT -1309 version is 5.0 or above; if you use iOS, make sure its version is 11.0 or above.

No permission to send ERR_SERVER_CENTER_NO_PRIVILEDGE_PUSH_SUB_VIDEO -102015 substream video images.

Another user is ERR_SERVER_CENTER_ANOTHER_USER_PUSH_SUB_VIDEO -102016 sending substream video images.

Screen recording ERR_SCREEN_CAPTURE_STOPPED -7001 stopped by the system.

Error codes for encoding and decoding

You can use the callback API TRTCCloudDelegate.OnError() to capture notifications about encoding and decoding errors.

Code Value Description

Failed to encode video frames. This error occurs when, for example, a user on iOS switches to another app, which may cause ERR_VIDEO_ENCODE_FAIL -1303 the system to release the hardware encoder. When the user switches back, this error may be thrown before the hardware encoder is restarted.

PUSH_ERR_UNSUPPORTED_RESOLUTION -1305 Unsupported video resolution.

Failed to encode audio frames. This error occurs when, for example, the SDK could ERR_AUDIO_ENCODE_FAIL -1304 not process the custom audio data passed in.

PUSH_ERR_UNSUPPORTED_SAMPLERATE -1306 Unsupported audio sample rate.

©2013-2019 Tencent Cloud. All rights reserved. Page 53 of 184 Tencent Real-Time Communication

Error codes for custom capturing

You can use the callback API TRTCCloudDelegate.OnError() to capture notifications about custom capturing errors.

Code Value Description

ERR_PIXEL_FORMAT_UNSUPPORTED -1327 Unsupported pixel format.

ERR_BUFFER_TYPE_UNSUPPORTED -1328 Unsupported buffer type.

Error codes for CDN binding and stream mixing

You can use the callback APIs TRTCCloudDelegate.onStartPublishing() and TRTCCloudDelegate.onSetMixTranscodingConfig() to capture notifications about CDN binding and stream mixing errors.

Code Value Description

Relayed push request timed ERR_PUBLISH_CDN_STREAM_REQUEST_TIME_OUT -3321 out.

On-Cloud MixTranscoding ERR_CLOUD_MIX_TRANSCODING_REQUEST_TIME_OUT -3322 request timed out.

Abnormal response packets ERR_PUBLISH_CDN_STREAM_SERVER_FAILED -3323 for relayed push.

Abnormal response packets ERR_CLOUD_MIX_TRANSCODING_SERVER_FAILED -3324 for On-Cloud MixTranscoding.

Signaling of starting to push ERR_ROOM_REQUEST_START_PUBLISHING_TIMEOUT -3333 to Tencent Cloud’s live streaming CDN timed out.

Abnormal signaling of ERR_ROOM_REQUEST_START_PUBLISHING_ERROR -3334 starting to push to Tencent Cloud’s live streaming CDN.

Signaling of stopping pushing ERR_ROOM_REQUEST_STOP_PUBLISHING_TIMEOUT -3335 to Tencent Cloud’s live streaming CDN timed out.

Abnormal signaling of ERR_ROOM_REQUEST_STOP_PUBLISHING_ERROR -3336 stopping pushing to Tencent Cloud’s live streaming CDN.

©2013-2019 Tencent Cloud. All rights reserved. Page 54 of 184 Tencent Real-Time Communication

Error codes for cross-room co-anchoring

TRTCCloud.ConnectOtherRoom() triggers this type of error codes if cross-room co-anchoring fails. You can use the callback API TRTCCloudDelegate.onConnectOtherRoom() to capture notifications about co- anchoring errors.

Code Value Description

Co-anchoring ERR_ROOM_REQUEST_CONN_ROOM_TIMEOUT -3326 request timed out.

Request to exit ERR_ROOM_REQUEST_DISCONN_ROOM_TIMEOUT -3327 co-anchoring timed out.

Invalid ERR_ROOM_REQUEST_CONN_ROOM_INVALID_PARAM -3328 parameter.

You are in the role of audience and cannot initiate or end co- ERR_CONNECT_OTHER_ROOM_AS_AUDIENCE -3330 anchoring. You need to switch to the anchor role using switchRole() .

Cross-room co- ERR_SERVER_CENTER_CONN_ROOM_NOT_SUPPORT -102031 anchoring not supported.

Reached the upper limit of ERR_SERVER_CENTER_CONN_ROOM_REACH_MAX_NUM -102032 co-anchoring calls.

Reached the upper limit of ERR_SERVER_CENTER_CONN_ROOM_REACH_MAX_RETRY_TIMES -102033 retries for cross-room co- anchoring.

©2013-2019 Tencent Cloud. All rights reserved. Page 55 of 184 Tencent Real-Time Communication

Code Value Description

Cross-room co- anchoring ERR_SERVER_CENTER_CONN_ROOM_REQ_TIMEOUT -102034 request timed out.

Incorrect format of ERR_SERVER_CENTER_CONN_ROOM_REQ -102035 cross-room co- anchoring request.

No signature ERR_SERVER_CENTER_CONN_ROOM_NO_SIG -102036 for cross-room co-anchoring.

Failed to decrypt ERR_SERVER_CENTER_CONN_ROOM_DECRYPT_SIG -102037 signature for cross-room co- anchoring.

Decryption key for cross-room ERR_SERVER_CENTER_CONN_ROOM_NO_KEY -102038 co-anchoring signature not found.

Signature parsing error ERR_SERVER_CENTER_CONN_ROOM_PARSE_SIG -102039 for cross-room co-anchoring.

Incorrect timestamp of ERR_SERVER_CENTER_CONN_ROOM_INVALID_SIG_TIME -102040 cross-room co- anchoring signature.

Incorrect cross-room co- ERR_SERVER_CENTER_CONN_ROOM_SIG_GROUPID -102041 anchoring signature.

©2013-2019 Tencent Cloud. All rights reserved. Page 56 of 184 Tencent Real-Time Communication

Code Value Description

No co- ERR_SERVER_CENTER_CONN_ROOM_NOT_CONNED -102042 anchoring in this room.

The user did ERR_SERVER_CENTER_CONN_ROOM_USER_NOT_CONNED -102043 not initiate co- anchoring.

Failed to start ERR_SERVER_CENTER_CONN_ROOM_FAILED -102044 cross-room co- anchoring.

Failed to cancel cross- ERR_SERVER_CENTER_CONN_ROOM_CANCEL_FAILED -102045 room co- anchoring.

Room being connected for ERR_SERVER_CENTER_CONN_ROOM_CONNED_ROOM_NOT_EXIST -102046 co-anchoring does not exist.

The room being connected ERR_SERVER_CENTER_CONN_ROOM_CONNED_REACH_MAX_ROOM -102047 reached the upper limit of co-anchoring calls.

The user being called for co- ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_NOT_EXIST -102048 anchoring does not exist.

The user being called for co- ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_DELETED -102049 anchoring was deleted.

©2013-2019 Tencent Cloud. All rights reserved. Page 57 of 184 Tencent Real-Time Communication

Code Value Description

All resources of the user being called ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_FULL -102050 for co- anchoring are occupied.

Sequence number for co- ERR_SERVER_CENTER_CONN_ROOM_INVALID_SEQ -102051 anchoring not in sequential order.

Warning Codes

Warning codes do not require your special attention. You can choose whether to prompt the user depending on the situation.

Code Value Description

Failed to start hardware WARNING_HW_ENCODER_START_FAIL 1103 encoder. The SDK automatically switched to software encoder.

Insufficient CPU for software WARNING_VIDEO_ENCODER_SW_TO_HW 1107 encoder. The SDK automatically switched to hardware encoder.

Insufficient frame rate of video captured by camera. This error WARNING_INSUFFICIENT_CAPTURE_FPS 1108 may occur on Android devices with built-in beauty filter algorithms.

WARNING_SW_ENCODER_START_FAIL 1109 Failed to start software encoder.

Camera resolution reduced for WARNING_REDUCE_CAPTURE_RESOLUTION 1110 balance between frame rate and performance.

WARNING_CAMERA_DEVICE_EMPTY 1111 No available camera detected.

©2013-2019 Tencent Cloud. All rights reserved. Page 58 of 184 Tencent Real-Time Communication

Code Value Description

WARNING_MICROPHONE_DEVICE_EMPTY 1201 No available mic detected.

WARNING_SPEAKER_DEVICE_EMPTY 1202 No available speaker detected.

User did not grant the WARNING_MICROPHONE_NOT_AUTHORIZED 1203 application mic access.

No audio capturing device WARNING_MICROPHONE_DEVICE_ABNORMAL 1204 available (for example, because the device is occupied).

No audio playback device WARNING_SPEAKER_DEVICE_ABNORMAL 1205 available (for example, because the device is occupied).

Failed to decode current video WARNING_VIDEO_FRAME_DECODE_FAIL 2101 frame.

Failed to decode current audio WARNING_AUDIO_FRAME_DECODE_FAIL 2102 frame.

WARNING_VIDEO_PLAY_LAG 2105 Video playback stuttering.

Failed to start hardware WARNING_HW_DECODER_START_FAIL 2106 decoder. Software decoder is used instead.

Hardware decoder failed to decode first I-frame of current WARNING_VIDEO_DECODER_HW_TO_SW 2108 stream. The SDK automatically switched to software decoder.

WARNING_SW_DECODER_START_FAIL 2109 Failed to start software decoder.

WARNING_VIDEO_RENDER_FAIL 2110 Failed to render video.

Video capturing already started. WARNING_START_CAPTURE_IGNORED 4000 Request ignored.

Failed to write recorded audio to WARNING_AUDIO_RECORDING_WRITE_FAIL 7001 file.

WARNING_ROOM_DISCONNECT 5101 Network disconnected.

©2013-2019 Tencent Cloud. All rights reserved. Page 59 of 184 Tencent Real-Time Communication

Code Value Description

You are in the role of audience. WARNING_IGNORE_UPSTREAM_FOR_AUDIENCE 6001 The request to send audio/video data is ignored.

Bad network connection: data WARNING_NET_BUSY 1101 upload blocked due to limited upstream bandwidth.

Live streaming error. Network WARNING_RTMP_SERVER_RECONNECT 1102 disconnected. Reconnecting (max. attempts: 3).

Live streaming error. Network WARNING_LIVE_STREAM_SERVER_RECONNECT 2103 disconnected. Reconnecting (max. attempts: 3).

Unstable incoming packets. This may be caused by insufficient WARNING_RECV_DATA_LAG 2104 downstream bandwidth or unstable streams from the anchor.

Live streaming error. DNS WARNING_RTMP_DNS_FAIL 3001 resolution failed.

Live streaming error. Failed to WARNING_RTMP_SEVER_CONN_FAIL 3002 connect to server.

Live streaming error. Handshake WARNING_RTMP_SHAKE_FAIL 3003 with RTMP server failed.

Live streaming error. Connection WARNING_RTMP_SERVER_BREAK_CONNECT 3004 dropped by server.

Live streaming error. RTMP WARNING_RTMP_READ_WRITE_FAIL 3005 read/write failed. Disconnecting.

Live streaming error. RTMP write failed. This is an internal error WARNING_RTMP_WRITE_FAIL 3006 code of the SDK and is not thrown.

©2013-2019 Tencent Cloud. All rights reserved. Page 60 of 184 Tencent Real-Time Communication

Code Value Description

Live streaming error. RTMP read failed. This is an internal error WARNING_RTMP_READ_FAIL 3007 code of the SDK and is not thrown.

Live streaming error. Server WARNING_RTMP_NO_DATA 3008 disconnected as no data is sent for over 30 seconds.

Live streaming error. Failed to call connect to connect to WARNING_PLAY_LIVE_STREAM_INFO_CONNECT_FAIL 3009 server. This is an internal error code of the SDK and is not thrown.

Live streaming error. Connection failed as there was no video in WARNING_NO_STEAM_SOURCE_FAIL 3010 the stream address. This is an internal error code of the SDK and is not thrown.

Network disconnected. WARNING_ROOM_RECONNECT 5102 Reconnecting.

Bad network connection: data WARNING_ROOM_NET_BUSY 5103 upload blocked due to limited upstream bandwidth.

©2013-2019 Tencent Cloud. All rights reserved. Page 61 of 184 Tencent Real-Time Communication

All Platforms (C++) Overview

Last updated:2021-09-09 11:42:28

Create Instance And Event Callback

API DESC

getTRTCShareInstance Create TRTCCloud instance (singleton mode)

destroyTRTCShareInstance Terminate TRTCCloud instance (singleton mode)

addCallback Set TRTC event callback

removeCallback Remove TRTC event callback

Room APIs

API DESC

enterRoom Enter room

exitRoom Exit room

switchRole Switch role

switchRoom Switch room

connectOtherRoom Request cross-room call

disconnectOtherRoom Exit cross-room call

Set subscription mode (which must be set before room entry for setDefaultStreamRecvMode it to take effect)

createSubCloud Create room subinstance (for concurrent multi-room listen/watch)

destroySubCloud Terminate room subinstance

CDN APIs

API DESC

startPublishing Start publishing audio/video streams to Tencent Cloud CSS CDN

©2013-2019 Tencent Cloud. All rights reserved. Page 62 of 184 Tencent Real-Time Communication

API DESC

stopPublishing Stop publishing audio/video streams to Tencent Cloud CSS CDN

startPublishCDNStream Start publishing audio/video streams to non-Tencent Cloud CDN

stopPublishCDNStream Stop publishing audio/video streams to non-Tencent Cloud CDN

Set the layout and transcoding parameters of On-Cloud setMixTranscodingConfig MixTranscoding

Video APIs

API DESC

startLocalPreview Enable the preview image of local camera (mobile)

startLocalPreview Enable the preview image of local camera (desktop)

updateLocalView Update the preview image of local camera

stopLocalPreview Stop camera preview

muteLocalVideo Pause/Resume publishing local video stream

Subscribe to remote user's video stream and bind video startRemoteView rendering control

updateRemoteView Update remote user's video rendering control

Stop subscribing to remote user's video stream and release stopRemoteView rendering control

Stop subscribing to all remote users' video streams and release stopAllRemoteView all rendering resources

muteRemoteVideoStream Pause/Resume subscribing to remote user's video stream

muteAllRemoteVideoStreams Pause/Resume subscribing to all remote users' video streams

setVideoEncoderParam Set the encoding parameters of video encoder

setNetworkQosParam Set network quality control parameters

setLocalRenderParams Set the rendering parameters of local video image

setRemoteRenderParams Set the rendering mode of remote video image

©2013-2019 Tencent Cloud. All rights reserved. Page 63 of 184 Tencent Real-Time Communication

API DESC

setVideoEncoderRotation Set the direction of image output by video encoder

setVideoEncoderMirror Set the mirror mode of image output by encoder

enableSmallVideoStream Enable dual-channel encoding mode with big and small images

setRemoteVideoStreamType Switch the big/small image of specified remote user

snapshotVideo Screencapture video

Audio APIs

API DESC

startLocalAudio Enable local audio capturing and publishing

stopLocalAudio Stop local audio capturing and publishing

muteLocalAudio Pause/Resume publishing local audio stream

muteRemoteAudio Pause/Resume playing back remote audio stream

muteAllRemoteAudio Pause/Resume playing back all remote users' audio streams

setRemoteAudioVolume Set the audio playback volume of remote user

setAudioCaptureVolume Set the capturing volume of local audio

getAudioCaptureVolume Get the capturing volume of local audio

setAudioPlayoutVolume Set the playback volume of remote audio

getAudioPlayoutVolume Get the playback volume of remote audio

enableAudioVolumeEvaluation Enable volume reminder

startAudioRecording Start audio recording

stopAudioRecording Stop audio recording

startLocalRecording Start local media recording

stopLocalRecording Stop local media recording

Device management APIs

©2013-2019 Tencent Cloud. All rights reserved. Page 64 of 184 Tencent Real-Time Communication

API DESC

getDeviceManager Get device management class (TXDeviceManager)

Beauty filter and watermark APIs

API DESC

setBeautyStyle Set special effects such as beauty, brightening, and rosy skin filters

setWaterMark Add watermark

Background music and sound effect APIs

API DESC

Get sound effect management class getAudioEffectManager (TXAudioEffectManager)

startSystemAudioLoopback Enable system audio capturing (for desktop systems only)

stopSystemAudioLoopback Stop system audio capturing (for desktop systems only)

setSystemAudioLoopbackVolume Set the volume of system audio capturing

Screen sharing APIs

API DESC

startScreenCapture Start desktop screen sharing (for desktop systems only)

stopScreenCapture Stop screen sharing

pauseScreenCapture Pause screen sharing

resumeScreenCapture Resume screen sharing

Enumerate shareable screens and windows (for desktop getScreenCaptureSources systems only)

Select the screen or window to share (for desktop systems selectScreenCaptureTarget only)

Set the video encoding parameters of screen sharing (i.e., setSubStreamEncoderParam substream) (for desktop systems only)

©2013-2019 Tencent Cloud. All rights reserved. Page 65 of 184 Tencent Real-Time Communication

API DESC

Set the audio mixing volume of screen sharing (for desktop setSubStreamMixVolume systems only)

Add specified windows to the exclusion list of screen sharing addExcludedShareWindow (for desktop systems only)

Remove specified windows from the exclusion list of screen removeExcludedShareWindow sharing (for desktop systems only)

Remove all windows from the exclusion list of screen sharing removeAllExcludedShareWindow (for desktop systems only)

Add specified windows to the inclusion list of screen sharing addIncludedShareWindow (for desktop systems only)

Remove specified windows from the inclusion list of screen removeIncludedShareWindow sharing (for desktop systems only)

Remove all windows from the inclusion list of screen sharing removeAllIncludedShareWindow (for desktop systems only)

Custom capturing and rendering APIs

API DESC

enableCustomVideoCapture Enable/Disable custom video capturing mode

sendCustomVideoData Deliver captured video frames to SDK

enableCustomAudioCapture Enable custom audio capturing mode

sendCustomAudioData Deliver captured audio data to SDK

enableMixExternalAudioFrame Enable/Disable custom audio track

mixExternalAudioFrame Mix custom audio track into SDK

Set the publish volume and playback volume of setMixExternalAudioVolume mixed custom audio track

generateCustomPTS Generate custom capturing timestamp

setLocalVideoProcessCallback Set video data callback for third-party beauty filters

setLocalVideoRenderCallback Set the callback of custom rendering for local video

©2013-2019 Tencent Cloud. All rights reserved. Page 66 of 184 Tencent Real-Time Communication

API DESC

Set the callback of custom rendering for remote setRemoteVideoRenderCallback video

setAudioFrameCallback Set custom audio data callback

Set the callback format of audio frames to be played setMixedPlayAudioFrameCallbackFormat back by system

enableCustomAudioRendering Enabling custom audio playback

getCustomAudioRenderingFrame Getting playable audio data

Custom message sending APIs

API DESC

sendCustomCmdMsg Use UDP channel to send custom message to all users in room

sendSEIMsg Use SEI channel to send custom message to all users in room

Network test APIs

API DESC

startSpeedTest Start network speed test (used before room entry)

stopSpeedTest Stop network speed test

Debugging APIs

API DESC

getSDKVersion Get SDK version information

setLogLevel Set log output level

setConsoleEnabled Enable/Disable console log printing

setLogCompressEnabled Enable/Disable local log compression

setLogDirPath Set local log storage path

setLogCallback Set log callback

©2013-2019 Tencent Cloud. All rights reserved. Page 67 of 184 Tencent Real-Time Communication

API DESC

showDebugView Display dashboard

callExperimentalAPI Call experimental APIs

Disused APIs

API DESC

enableCustomVideoCapture Enable custom video capturing mode

sendCustomVideoData Deliver captured video data to SDK

muteLocalVideo Pause/Resume publishing local video stream

muteRemoteVideoStream Pause/Resume subscribing to remote user's video stream

Error and warning events

API DESC

onError Error event callback

onWarning Warning event callback

Room event callback

API DESC

onEnterRoom Whether room entry is successful

onExitRoom Room exit

onSwitchRole Role switching

onSwitchRoom Result of room switching

onConnectOtherRoom Result of requesting cross-room call

onDisconnectOtherRoom Result of ending cross-room call

User event callback

API DESC

©2013-2019 Tencent Cloud. All rights reserved. Page 68 of 184 Tencent Real-Time Communication

API DESC

onRemoteUserEnterRoom A user entered the room

onRemoteUserLeaveRoom A user exited the room

onUserVideoAvailable A remote user published/unpublished primary stream video

onUserSubStreamAvailable A remote user published/unpublished substream video

onUserAudioAvailable A remote user published/unpublished audio

The SDK started rendering the first video frame of the local or onFirstVideoFrame a remote user

onFirstAudioFrame The SDK started playing the first audio frame of a remote user

onSendFirstLocalVideoFrame The first local video frame was published

onSendFirstLocalAudioFrame The first local audio frame was published

onRemoteVideoStatusUpdated Change of remote video status

Callback of statistics on network and technical metrics

API DESC

onNetworkQuality Real-time network quality statistics

onStatistics Real-time statistics on technical metrics

Callback of connection to the cloud

API DESC

onConnectionLost The SDK was disconnected from the cloud

onTryToReconnect The SDK is reconnecting to the cloud

onConnectionRecovery The SDK is reconnected to the cloud

onSpeedTest Result of server speed testing

Callback of hardware events

API DESC

©2013-2019 Tencent Cloud. All rights reserved. Page 69 of 184 Tencent Real-Time Communication

API DESC

onCameraDidReady The camera is ready

onMicDidReady The mic is ready

onUserVoiceVolume Volume

The status of a local device changed (for desktop OS onDeviceChange only)

onAudioDeviceCaptureVolumeChanged The capturing volume of the mic changed

onAudioDevicePlayoutVolumeChanged The playback volume changed

Whether system audio capturing is enabled onSystemAudioLoopbackError successfully (for macOS only)

onTestMicVolume Volume during mic test

onTestSpeakerVolume Volume during speaker test

Callback of the receipt of a custom message

API DESC

onRecvCustomCmdMsg Receipt of custom message

onMissCustomCmdMsg Loss of custom message

onRecvSEIMsg Receipt of SEI message

CDN event callback

API DESC

onStartPublishing Started publishing to Tencent Cloud CSS CDN

onStopPublishing Stopped publishing to Tencent Cloud CSS CDN

onStartPublishCDNStream Started publishing to non-Tencent Cloud’s live streaming CDN

onStopPublishCDNStream Stopped publishing to non-Tencent Cloud’s live streaming CDN

Set the layout and transcoding parameters for On-Cloud onSetMixTranscodingConfig MixTranscoding

©2013-2019 Tencent Cloud. All rights reserved. Page 70 of 184 Tencent Real-Time Communication

Screen sharing event callback

API DESC

onScreenCaptureStarted Screen sharing started

onScreenCapturePaused Screen sharing was paused

onScreenCaptureResumed Screen sharing was resumed

onScreenCaptureStoped Screen sharing stopped

onScreenCaptureCovered The shared window was covered (for Windows only)

Callback of local recording and screenshot events

API DESC

onLocalRecordBegin Local recording started

onLocalRecording Local media is being recorded

onLocalRecordComplete Local recording stopped

onSnapshotComplete Finished taking a local screenshot

Disused callbacks

API DESC

onUserEnter An anchor entered the room (disused)

onUserExit An anchor left the room (disused)

onAudioEffectFinished Audio effects ended (disused)

onPlayBGMBegin Started playing background music (disused)

onPlayBGMProgress Playback progress of background music (disused)

onPlayBGMComplete Background music stopped (disused)

Callback of custom video processing

API DESC

©2013-2019 Tencent Cloud. All rights reserved. Page 71 of 184 Tencent Real-Time Communication

API DESC

onRenderVideoFrame Custom video rendering

onProcessVideoFrame Video processing by third-party beauty filters

Callback of custom audio processing

API DESC

onCapturedRawAudioFrame Raw audio data captured locally

Audio data captured by the local mic and pre-processed by the onLocalProcessedAudioFrame audio module

onPlayAudioFrame Audio data of each remote user before audio mixing

Data mixed from each channel before being submitted to the onMixedPlayAudioFrame system for playback

Other event callbacks

API DESC

onLog Printing of local log

Definitions of video enumerated values

API DESC

TRTCVideoResolution Video resolution

TRTCVideoResolutionMode Video aspect ratio mode

TRTCVideoStreamType Video stream type

TRTCVideoFillMode Video image fill mode

TRTCVideoRotation Video image rotation direction

TRTCVideoPixelFormat Video pixel format

TRTCVideoBufferType Video data transfer method

TRTCVideoMirrorType Video mirror type

©2013-2019 Tencent Cloud. All rights reserved. Page 72 of 184 Tencent Real-Time Communication

API DESC

TRTCSnapshotSourceType Data source of local video screenshot

Definitions of network enumerated values

API DESC

TRTCAppScene Use cases

TRTCRoleType Role

TRTCQosControlMode QoS control mode (disused)

TRTCVideoQosPreference Image quality preference

TRTCQualityInfo Network quality

TRTCAVStatusType Audio/Video playback status

TRTCAVStatusChangeReason Reasons for playback status changes

Definitions of audio enumerated values

API DESC

TRTCAudioQuality Sound quality

Definitions of other enumerated values

API DESC

TRTCLogLevel Log level

TRTCTranscodingConfigMode Layout mode of On-Cloud MixTranscoding

TRTCLocalRecordType Media recording type

TRTCMixInputType Stream mix input type

TRTCDeviceType Device type (for desktop platforms only)

TRTCAudioRecordingContent Audio recording content type

Definitions of core TRTC classes

©2013-2019 Tencent Cloud. All rights reserved. Page 73 of 184 Tencent Real-Time Communication

API DESC

TRTCParams Room entry parameters

TRTCVideoEncParam Video encoding parameters

TRTCNetworkQosParam Network QoS control parameter set

TRTCRenderParams Rendering parameters of video image

TRTCQualityInfo Network quality

TRTCVolumeInfo Volume

TRTCSpeedTestResult Network speed test result

TRTCVideoFrame Video frame information

TRTCAudioFrame Audio frame data

Description information of each video image in On-Cloud TRTCMixUser MixTranscoding

Layout and transcoding parameters of On-Cloud TRTCTranscodingConfig MixTranscoding

Push parameters required to be set when publishing TRTCPublishCDNParam audio/video streams to non-Tencent Cloud CDN

TRTCAudioRecordingParams Local audio file recording parameters

TRTCLocalRecordingParams Local media file recording parameters

TRTCAudioEffectParam Sound effect parameter (disused)

TRTCSwitchRoomConfig Room switch parameter

TRTCAudioFrameCallbackFormat Format parameter of custom audio callback

TRTCScreenCaptureSourceInfo Screen sharing target information (for desktop systems only)

ITRTCScreenCaptureSourceList List of sharable screens and windows

©2013-2019 Tencent Cloud. All rights reserved. Page 74 of 184 Tencent Real-Time Communication

Error Codes

Last updated:2021-09-07 10:28:49

Error Codes

Basic error codes

Code Value Description

ERR_NULL 0 No error.

Error codes for room entry

TRTCCloud.enterRoom() triggers this type of error codes if room entry fails. You can use the callback APIs TRTCCloudDelegate.onEnterRoom() and TRTCCloudDelegate.OnError() to capture notifications about room entry errors.

Code Value Description

ERR_ROOM_ENTER_FAIL -3301 Failed to enter room.

Empty room entry parameters. Please check whether valid ERR_ENTER_ROOM_PARAM_NULL -3316 parameters are passed in the TRTCCloud.enterRoom(): API when it is called.

ERR_SDK_APPID_INVALID -3317 Invalid sdkAppId .

ERR_ROOM_ID_INVALID -3318 Invalid roomId .

ERR_USER_ID_INVALID -3319 Invalid userID .

ERR_USER_SIG_INVALID -3320 Invalid userSig .

Room entry request timed out. ERR_ROOM_REQUEST_ENTER_ROOM_TIMEOUT -3308 Please check your network.

Service unavailable. Please check whether there are remaining ERR_SERVER_INFO_SERVICE_SUSPENDED -100013 minutes in your packages and whether your Tencent Cloud account has overdue payment.

©2013-2019 Tencent Cloud. All rights reserved. Page 75 of 184 Tencent Real-Time Communication

Error code for room exit

TRTCCloud.exitRoom() triggers this error code if room exit fails. You can use the callback API TRTCCloudDelegate.OnError() to capture notifications about the error.

Code Value Description

ERR_ROOM_REQUEST_QUIT_ROOM_TIMEOUT -3325 Room exit request timed out.

Error codes for devices (camera, mic, and speaker)

You can use the callback API TRTCCloudDelegate.OnError() to capture notifications about device errors.

Code Value Description

Failed to turn camera on. This error occurs when, for example, there is a problem with the camera configuration program (driver) on Windows or ERR_CAMERA_START_FAIL -1301 macOS. In this case, turn the camera off and on again, restart the camera, or update the configuration program.

Camera not authorized. This error usually occurs ERR_CAMERA_NOT_AUTHORIZED -1314 on mobile devices and may be because users denied camera permission.

Failed to set camera parameters (unsupported ERR_CAMERA_SET_PARAM_FAIL -1315 values or others).

ERR_CAMERA_OCCUPY -1316 Camera occupied. Try using another camera.

Failed to turn mic on. This error occurs when, for example, there is a problem with the mic configuration program (driver) on Windows or ERR_MIC_START_FAIL -1302 macOS. In this case, turn the mic off and on again, restart the mic, or update the configuration program.

Mic not authorized. This error usually occurs on ERR_MIC_NOT_AUTHORIZED -1317 mobile devices and may be because users denied mic permission.

ERR_MIC_SET_PARAM_FAIL -1318 Failed to set mic parameters.

©2013-2019 Tencent Cloud. All rights reserved. Page 76 of 184 Tencent Real-Time Communication

Code Value Description

Mic occupied. This error occurs when, for example, ERR_MIC_OCCUPY -1319 the user is in a call on the mobile device, in which case TRTC will fail to turn the mic on.

ERR_MIC_STOP_FAIL -1320 Failed to turn mic off.

Failed to turn speaker on. This error occurs when, for example, there is a problem with the speaker configuration program (driver) on Windows or ERR_SPEAKER_START_FAIL -1321 macOS. In this case, turn the speaker off and on again, restart the speaker, or update the configuration program.

ERR_SPEAKER_SET_PARAM_FAIL -1322 Failed to set speaker parameters.

ERR_SPEAKER_STOP_FAIL -1323 Failed to turn speaker off.

Error codes for screen sharing

You can use the callback API TRTCCloudDelegate.OnError() to capture notifications about screen sharing errors.

Code Value Description

Failed to start screen recording. If this error occurs on a mobile device, it may be because users denied screen recording ERR_SCREEN_CAPTURE_START_FAIL -1308 permission; if it occurs on Windows or macOS, check whether the parameters of the screen recording API are set as required.

©2013-2019 Tencent Cloud. All rights reserved. Page 77 of 184 Tencent Real-Time Communication

Code Value Description

Screen recording failed. If you use Android, make sure its ERR_SCREEN_CAPTURE_UNSURPORT -1309 version is 5.0 or above; if you use iOS, make sure its version is 11.0 or above.

No permission to send ERR_SERVER_CENTER_NO_PRIVILEDGE_PUSH_SUB_VIDEO -102015 substream video images.

Another user is ERR_SERVER_CENTER_ANOTHER_USER_PUSH_SUB_VIDEO -102016 sending substream video images.

Screen recording ERR_SCREEN_CAPTURE_STOPPED -7001 stopped by the system.

Error codes for encoding and decoding

You can use the callback API TRTCCloudDelegate.OnError() to capture notifications about encoding and decoding errors.

Code Value Description

Failed to encode video frames. This error occurs when, for example, a user on iOS switches to another app, which may cause ERR_VIDEO_ENCODE_FAIL -1303 the system to release the hardware encoder. When the user switches back, this error may be thrown before the hardware encoder is restarted.

PUSH_ERR_UNSUPPORTED_RESOLUTION -1305 Unsupported video resolution.

Failed to encode audio frames. This error occurs when, for example, the SDK could ERR_AUDIO_ENCODE_FAIL -1304 not process the custom audio data passed in.

PUSH_ERR_UNSUPPORTED_SAMPLERATE -1306 Unsupported audio sample rate.

©2013-2019 Tencent Cloud. All rights reserved. Page 78 of 184 Tencent Real-Time Communication

Error codes for custom capturing

You can use the callback API TRTCCloudDelegate.OnError() to capture notifications about custom capturing errors.

Code Value Description

ERR_PIXEL_FORMAT_UNSUPPORTED -1327 Unsupported pixel format.

ERR_BUFFER_TYPE_UNSUPPORTED -1328 Unsupported buffer type.

Error codes for CDN binding and stream mixing

You can use the callback APIs TRTCCloudDelegate.onStartPublishing() and TRTCCloudDelegate.onSetMixTranscodingConfig() to capture notifications about CDN binding and stream mixing errors.

Code Value Description

Relayed push request timed ERR_PUBLISH_CDN_STREAM_REQUEST_TIME_OUT -3321 out.

On-Cloud MixTranscoding ERR_CLOUD_MIX_TRANSCODING_REQUEST_TIME_OUT -3322 request timed out.

Abnormal response packets ERR_PUBLISH_CDN_STREAM_SERVER_FAILED -3323 for relayed push.

Abnormal response packets ERR_CLOUD_MIX_TRANSCODING_SERVER_FAILED -3324 for On-Cloud MixTranscoding.

Signaling of starting to push ERR_ROOM_REQUEST_START_PUBLISHING_TIMEOUT -3333 to Tencent Cloud’s live streaming CDN timed out.

Abnormal signaling of ERR_ROOM_REQUEST_START_PUBLISHING_ERROR -3334 starting to push to Tencent Cloud’s live streaming CDN.

Signaling of stopping pushing ERR_ROOM_REQUEST_STOP_PUBLISHING_TIMEOUT -3335 to Tencent Cloud’s live streaming CDN timed out.

Abnormal signaling of ERR_ROOM_REQUEST_STOP_PUBLISHING_ERROR -3336 stopping pushing to Tencent Cloud’s live streaming CDN.

©2013-2019 Tencent Cloud. All rights reserved. Page 79 of 184 Tencent Real-Time Communication

Error codes for cross-room co-anchoring

TRTCCloud.ConnectOtherRoom() triggers this type of error codes if cross-room co-anchoring fails. You can use the callback API TRTCCloudDelegate.onConnectOtherRoom() to capture notifications about co- anchoring errors.

Code Value Description

Co-anchoring ERR_ROOM_REQUEST_CONN_ROOM_TIMEOUT -3326 request timed out.

Request to exit ERR_ROOM_REQUEST_DISCONN_ROOM_TIMEOUT -3327 co-anchoring timed out.

Invalid ERR_ROOM_REQUEST_CONN_ROOM_INVALID_PARAM -3328 parameter.

You are in the role of audience and cannot initiate or end co- ERR_CONNECT_OTHER_ROOM_AS_AUDIENCE -3330 anchoring. You need to switch to the anchor role using switchRole() .

Cross-room co- ERR_SERVER_CENTER_CONN_ROOM_NOT_SUPPORT -102031 anchoring not supported.

Reached the upper limit of ERR_SERVER_CENTER_CONN_ROOM_REACH_MAX_NUM -102032 co-anchoring calls.

Reached the upper limit of ERR_SERVER_CENTER_CONN_ROOM_REACH_MAX_RETRY_TIMES -102033 retries for cross-room co- anchoring.

©2013-2019 Tencent Cloud. All rights reserved. Page 80 of 184 Tencent Real-Time Communication

Code Value Description

Cross-room co- anchoring ERR_SERVER_CENTER_CONN_ROOM_REQ_TIMEOUT -102034 request timed out.

Incorrect format of ERR_SERVER_CENTER_CONN_ROOM_REQ -102035 cross-room co- anchoring request.

No signature ERR_SERVER_CENTER_CONN_ROOM_NO_SIG -102036 for cross-room co-anchoring.

Failed to decrypt ERR_SERVER_CENTER_CONN_ROOM_DECRYPT_SIG -102037 signature for cross-room co- anchoring.

Decryption key for cross-room ERR_SERVER_CENTER_CONN_ROOM_NO_KEY -102038 co-anchoring signature not found.

Signature parsing error ERR_SERVER_CENTER_CONN_ROOM_PARSE_SIG -102039 for cross-room co-anchoring.

Incorrect timestamp of ERR_SERVER_CENTER_CONN_ROOM_INVALID_SIG_TIME -102040 cross-room co- anchoring signature.

Incorrect cross-room co- ERR_SERVER_CENTER_CONN_ROOM_SIG_GROUPID -102041 anchoring signature.

©2013-2019 Tencent Cloud. All rights reserved. Page 81 of 184 Tencent Real-Time Communication

Code Value Description

No co- ERR_SERVER_CENTER_CONN_ROOM_NOT_CONNED -102042 anchoring in this room.

The user did ERR_SERVER_CENTER_CONN_ROOM_USER_NOT_CONNED -102043 not initiate co- anchoring.

Failed to start ERR_SERVER_CENTER_CONN_ROOM_FAILED -102044 cross-room co- anchoring.

Failed to cancel cross- ERR_SERVER_CENTER_CONN_ROOM_CANCEL_FAILED -102045 room co- anchoring.

Room being connected for ERR_SERVER_CENTER_CONN_ROOM_CONNED_ROOM_NOT_EXIST -102046 co-anchoring does not exist.

The room being connected ERR_SERVER_CENTER_CONN_ROOM_CONNED_REACH_MAX_ROOM -102047 reached the upper limit of co-anchoring calls.

The user being called for co- ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_NOT_EXIST -102048 anchoring does not exist.

The user being called for co- ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_DELETED -102049 anchoring was deleted.

©2013-2019 Tencent Cloud. All rights reserved. Page 82 of 184 Tencent Real-Time Communication

Code Value Description

All resources of the user being called ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_FULL -102050 for co- anchoring are occupied.

Sequence number for co- ERR_SERVER_CENTER_CONN_ROOM_INVALID_SEQ -102051 anchoring not in sequential order.

Warning Codes

Warning codes do not require your special attention. You can choose whether to prompt the user depending on the situation.

Code Value Description

Failed to start hardware WARNING_HW_ENCODER_START_FAIL 1103 encoder. The SDK automatically switched to software encoder.

Insufficient CPU for software WARNING_VIDEO_ENCODER_SW_TO_HW 1107 encoder. The SDK automatically switched to hardware encoder.

Insufficient frame rate of video captured by camera. This error WARNING_INSUFFICIENT_CAPTURE_FPS 1108 may occur on Android devices with built-in beauty filter algorithms.

WARNING_SW_ENCODER_START_FAIL 1109 Failed to start software encoder.

Camera resolution reduced for WARNING_REDUCE_CAPTURE_RESOLUTION 1110 balance between frame rate and performance.

WARNING_CAMERA_DEVICE_EMPTY 1111 No available camera detected.

©2013-2019 Tencent Cloud. All rights reserved. Page 83 of 184 Tencent Real-Time Communication

Code Value Description

WARNING_MICROPHONE_DEVICE_EMPTY 1201 No available mic detected.

WARNING_SPEAKER_DEVICE_EMPTY 1202 No available speaker detected.

User did not grant the WARNING_MICROPHONE_NOT_AUTHORIZED 1203 application mic access.

No audio capturing device WARNING_MICROPHONE_DEVICE_ABNORMAL 1204 available (for example, because the device is occupied).

No audio playback device WARNING_SPEAKER_DEVICE_ABNORMAL 1205 available (for example, because the device is occupied).

Failed to decode current video WARNING_VIDEO_FRAME_DECODE_FAIL 2101 frame.

Failed to decode current audio WARNING_AUDIO_FRAME_DECODE_FAIL 2102 frame.

WARNING_VIDEO_PLAY_LAG 2105 Video playback stuttering.

Failed to start hardware WARNING_HW_DECODER_START_FAIL 2106 decoder. Software decoder is used instead.

Hardware decoder failed to decode first I-frame of current WARNING_VIDEO_DECODER_HW_TO_SW 2108 stream. The SDK automatically switched to software decoder.

WARNING_SW_DECODER_START_FAIL 2109 Failed to start software decoder.

WARNING_VIDEO_RENDER_FAIL 2110 Failed to render video.

Video capturing already started. WARNING_START_CAPTURE_IGNORED 4000 Request ignored.

Failed to write recorded audio to WARNING_AUDIO_RECORDING_WRITE_FAIL 7001 file.

WARNING_ROOM_DISCONNECT 5101 Network disconnected.

©2013-2019 Tencent Cloud. All rights reserved. Page 84 of 184 Tencent Real-Time Communication

Code Value Description

You are in the role of audience. WARNING_IGNORE_UPSTREAM_FOR_AUDIENCE 6001 The request to send audio/video data is ignored.

Bad network connection: data WARNING_NET_BUSY 1101 upload blocked due to limited upstream bandwidth.

Live streaming error. Network WARNING_RTMP_SERVER_RECONNECT 1102 disconnected. Reconnecting (max. attempts: 3).

Live streaming error. Network WARNING_LIVE_STREAM_SERVER_RECONNECT 2103 disconnected. Reconnecting (max. attempts: 3).

Unstable incoming packets. This may be caused by insufficient WARNING_RECV_DATA_LAG 2104 downstream bandwidth or unstable streams from the anchor.

Live streaming error. DNS WARNING_RTMP_DNS_FAIL 3001 resolution failed.

Live streaming error. Failed to WARNING_RTMP_SEVER_CONN_FAIL 3002 connect to server.

Live streaming error. Handshake WARNING_RTMP_SHAKE_FAIL 3003 with RTMP server failed.

Live streaming error. Connection WARNING_RTMP_SERVER_BREAK_CONNECT 3004 dropped by server.

Live streaming error. RTMP WARNING_RTMP_READ_WRITE_FAIL 3005 read/write failed. Disconnecting.

Live streaming error. RTMP write failed. This is an internal error WARNING_RTMP_WRITE_FAIL 3006 code of the SDK and is not thrown.

©2013-2019 Tencent Cloud. All rights reserved. Page 85 of 184 Tencent Real-Time Communication

Code Value Description

Live streaming error. RTMP read failed. This is an internal error WARNING_RTMP_READ_FAIL 3007 code of the SDK and is not thrown.

Live streaming error. Server WARNING_RTMP_NO_DATA 3008 disconnected as no data is sent for over 30 seconds.

Live streaming error. Failed to call connect to connect to WARNING_PLAY_LIVE_STREAM_INFO_CONNECT_FAIL 3009 server. This is an internal error code of the SDK and is not thrown.

Live streaming error. Connection failed as there was no video in WARNING_NO_STEAM_SOURCE_FAIL 3010 the stream address. This is an internal error code of the SDK and is not thrown.

Network disconnected. WARNING_ROOM_RECONNECT 5102 Reconnecting.

Bad network connection: data WARNING_ROOM_NET_BUSY 5103 upload blocked due to limited upstream bandwidth.

©2013-2019 Tencent Cloud. All rights reserved. Page 86 of 184 Tencent Real-Time Communication

Web Overview

Last updated:2021-08-12 10:39:23

Supported Platforms

Proposed by Google, the WebRTC technology is well supported by Chrome (desktop), Edge (desktop), (desktop), and (desktop and mobile), but poorly or not supported by other platforms such as browsers on Android.

If your application scenario is mainly in the education sector, consider using TRTC SDK for Electron, which supports big and small (dual-channel) images, with more flexible screen sharing schemes and better recovery capabilities on poor network connections.

Minimum Browser Receive Send Screen SDK Version OS Browser Version (Playback) (Publish) Sharing Requirement Requirement

macOS Supported Safari 11+ Supported Supported (on Safari - (desktop) 13+)

Supported Chrome (on 56+ Supported Supported - (desktop) Chrome 72+)

Supported Firefox (on 56+ Supported Supported 4.7.0+ (desktop) Firefox 66+)

Edge 80+ Supported Supported Supported 4.7.0+ (desktop)

WeChat built-in Not Not - Supported - browser supported supported (desktop)

©2013-2019 Tencent Cloud. All rights reserved. Page 87 of 184 Tencent Real-Time Communication

WeCom - Supported Not Not - built-in supported supported browser (desktop)

Supported Chrome (on 56+ Supported Supported - (desktop) Chrome 72+)

QQ Browser Not (desktop, 10.4+ Supported Supported - supported WebKit core)

Supported Firefox (on 56+ Supported Supported 4.7.0+ (desktop) Firefox Windows 66+)

Edge 80+ Supported Supported Supported 4.7.0+ (desktop)

WeChat built-in Not Not - Supported - browser supported supported (desktop)

WeCom built-in Not Not - Supported - browser supported supported (desktop)

iOS Safari Not 11+ Supported Supported - 11.1.2+ (mobile) supported

iOS Chrome Not Not - Supported - 12.1.4+ (mobile) supported supported

iOS Chrome Not - Supported Supported - 14.3+ (mobile) supported

WeChat iOS Not Not built-in - Supported - 12.1.4+ supported supported browser

©2013-2019 Tencent Cloud. All rights reserved. Page 88 of 184 Tencent Real-Time Communication

iOS WeChat WeChat Supported Supported Not - 14.3+ built-in 6.5+ supported browser

WeCom iOS Not Not built-in - Supported - 12.1.4+ supported supported browser

Chrome Not - Supported Supported - (mobile) supported

QQ Not Not Not Browser - - supported supported supported (mobile)

UC Not Not Not Browser - - supported supported supported (mobile)

WeChat built-in Android Not browser - Supported Supported - supported (TBS core)

WeChat built-in Not browser - Supported Supported - supported (XWEB core)

WeCom Not built-in - Supported Supported - supported browser

API Guide

The tutorials below offer detailed instructions on how to use different APIs.

Feature Sample Code

Audio/Video call Tutorial

Interactive live streaming Tutorial

©2013-2019 Tencent Cloud. All rights reserved. Page 89 of 184 Tencent Real-Time Communication

Feature Sample Code

Switching cameras/mics Tutorial

Setting local video attributes Tutorial

Dynamically enabling/disabling local audio/video Tutorial

Screen sharing Tutorial

Detecting volume Tutorial

Custom capturing and rendering Tutorial

Limit on the number of upstream users in a room Tutorial

Adding background music and audio effects Tutorial

TRTC

Note: This document applies to TRTC SDK for Web 4.x.x.

TRTC is the main entry to TRTC SDK for Web. You can use TRTC methods to create a client object ( Client ) and local audio/video stream object ( Stream ) for real-time communication, check a browser's compatibility and whether it supports screen sharing, as well as set the log output level and enable/disable log upload.

API Description

VERSION Version of TRTC SDK for Web

Checks whether a browser is compatible with the TRTC SDK for checkSystemRequirements Web. If not, ask users to download the latest version of Chrome.

Checks whether a browser supports screen sharing. Call this isScreenShareSupported method before creating a screen sharing stream.

getDevices Gets the list of media input/output devices.

getCameras Gets the list of cameras.

©2013-2019 Tencent Cloud. All rights reserved. Page 90 of 184 Tencent Real-Time Communication

API Description

getMicrophones Gets the list of mics.

getSpeakers Gets the list of speakers.

Creates a client object for real-time audio/video calls. This method createClient needs to be called only once for each call.

Creates a local Stream object, which uses the publish() method createStream to publish local audio/video stream.

TRTC.Logger

TRTC.Logger provides methods for log settings, including log output level setting and log upload enabling/disabling.

API Description

setLogLevel Sets the log output level.

enableUploadLog Enables log upload.

disableUploadLog Disables log upload.

Client

A client object ( Client ) is created through createClient() and represents an audio/video call.

API Description

Sets proxy servers. This method is suitable where you deploy proxy setProxyServer servers, e.g., Nginx + Coturn, by yourself.

Sets TURN servers. This method is used together with setTurnServer setProxyServer() and is suitable where you deploy proxy and TURN servers by yourself.

Enters a room. This starts an audio/video call. If the room does not join exist, the system will create one.

leave Exits a room. This ends an audio/video call.

©2013-2019 Tencent Cloud. All rights reserved. Page 91 of 184 Tencent Real-Time Communication

API Description

Publishes the local audio/video stream. This method can be called only publish after room entry using the join() method. Only one local stream can be published in one audio/video call.

unpublish Unpublishes the local stream.

subscribe Subscribes to a remote stream.

unsubscribe Unsubscribes from a remote stream.

Switches user roles. This method works only in the interactive live switchRole streaming mode ( live ).

on Listens for client object events.

getRemoteMutedState Gets the audio/video mute status of remote users in room.

Gets audio statistics of published local streams. This method can be getLocalAudioStats used only after publish() is called.

Gets video statistics of published local streams. This method can be getLocalVideoStats used only after publish() is called.

getRemoteAudioStats Gets audio statistics of all remote streams.

getRemoteVideoStats Gets video statistics of all remote streams.

LocalStream

A local audio/video stream is created through createStream. LocalStream is a subclass of Stream.

API Description

initialize Initializes a local audio/video stream object.

Sets audio parameters. This method works only if it is called before setAudioProfile initialize().

Sets video parameters. This method works only if it is called before setVideoProfile initialize().

Sets screen sharing parameters. This method works only if it is called setScreenProfile before initialize().

©2013-2019 Tencent Cloud. All rights reserved. Page 92 of 184 Tencent Real-Time Communication

API Description

Sets video content hint. This is mainly used to improve video encoding setVideoContentHint quality in different scenarios. This method works only if it is called before initialize().

switchDevice Switches the media input device.

addTrack Adds an audio or a video track.

removeTrack Removes the video track of a stream.

replaceTrack Replaces the audio or video track of a stream.

play Starts playing an audio/video stream.

stop Stops playing an audio/video stream.

resume Resumes playing an audio/video stream.

close Closes an audio/video stream.

muteAudio Disables the audio track of a stream.

muteVideo Disables the video track of a stream.

unmuteAudio Enables the audio track of a stream.

unmuteVideo Enables the video track of a stream.

getId Gets the stream ID.

getUserId Gets the ID of the user to whom the stream belongs.

setAudioOutput Sets the audio output device.

Gets the current volume. This method works only if there is audio data getAudioLevel in the local stream or a remote stream.

hasAudio Specifies whether there is an audio track.

hasVideo Specifies whether there is a video track.

getAudioTrack Gets the audio track of a stream.

getVideoTrack Gets the video track of a stream.

getVideoFrame Gets the current video frame.

©2013-2019 Tencent Cloud. All rights reserved. Page 93 of 184 Tencent Real-Time Communication

API Description

on Listens for stream events.

RemoteStream

A remote audio/video stream is obtained via the Client.on('stream-added') callback. RemoteStream is a subclass of Stream.

API Description

Gets the remote stream type. This method is mainly used to determine getType whether a remote stream is an audio/video primary stream or a video substream (which is usually a screen sharing stream).

play Starts playing an audio/video stream.

stop Stops playing an audio/video stream.

resume Resumes playing an audio/video stream.

close Closes an audio/video stream.

muteAudio Disables the audio track of a stream.

muteVideo Disables the video track of a stream.

unmuteAudio Enables the audio track of a stream.

unmuteVideo Enables the video track of a stream.

getId Gets the stream ID.

getUserId Gets the ID of the user to whom the stream belongs.

setAudioOutput Sets the audio output device.

setAudioVolume Sets the playback volume.

Gets the current volume. This method works only if there is audio data in the getAudioLevel local stream or a remote stream.

hasAudio Specifies whether there is an audio track.

hasVideo Specifies whether there is a video track.

©2013-2019 Tencent Cloud. All rights reserved. Page 94 of 184 Tencent Real-Time Communication

API Description

getAudioTrack Gets the audio track of a stream.

getVideoTrack Gets the video track of a stream.

getVideoFrame Gets the current video frame.

on Listens for stream events.

RtcError

RtcError is the error object.

API Description

getCode Gets the error code.

Contact Us

If you have any questions, please us at [email protected].

©2013-2019 Tencent Cloud. All rights reserved. Page 95 of 184 Tencent Real-Time Communication

Error Codes

Last updated:2021-08-12 10:40:27

Note: This document applies to TRTC SDK for Web 4.x.x.

Error Code Definitions

Error Key getCode Description Code

INVALID_PARAMETER 4096 0x1000 Invalid parameter.

INVALID_OPERATION 4097 0x1001 Invalid operation.

Failed to establish signaling SIGNAL_CAHNNEL_SETUP_FAILED 16385 0x4001 channel.

SIGNAL_CHANNEL_ERROR 16386 0x4002 Signaling channel error.

ICE_TRANSPORT_ERROR 16387 0x4003 ICE transport connection error.

JOIN_ROOM_FAILED 16388 0x4004 Failed to enter room.

CREATE_OFFER_FAILED 16389 0x4005 Failed to create SDP offer.

CLIENT_BANNED 16448 0x4040 User was kicked out.

Media transmission service timed SERVER_TIMEOUT 16449 0x4041 out.

Remote stream subscription timed SUBSCRIPTION_TIMEOUT 16450 0x4042 out.

UNKNOWN 65535 0xFFFF Unknown error.

Account Errors

©2013-2019 Tencent Cloud. All rights reserved. Page 96 of 184 Tencent Real-Time Communication

Error Type Description Code

userSig has expired. Please generate again. If the signature expires Account 70001 immediately after generation, check whether the validity period is too system short or set to 0.

The length of userSig is 0. Please access sign_src to get the source Account 70002 code for signature calculation and check the parameters to make sure that system the signature is calculated correctly.

Account userSig verification failed. Please check whether userSig has been 70003 system truncated due to short buffer length, etc.

Account userSig verification failed. Please check whether userSig has been 70004 system truncated due to short buffer length, etc.

Account userSig verification failed. Please check whether the userSig generated 70005 system is correct with the help of a tool.

Account userSig verification failed. Please check whether the userSig generated 70006 system is correct with the help of a tool.

Account userSig verification failed. Please check whether the userSig generated 70007 system is correct with the help of a tool.

Account userSig verification failed. Please check whether the userSig generated 70008 system is correct with the help of a tool.

Account Failed to verify userSig with the business public key. Please check 70009 system whether the private key and sdkAppId used to generate userSig match.

Account userSig verification failed. Please check whether the userSig generated 70010 system is correct with the help of a tool.

Account userId in userSig is different from that in the request. Please check 70013 system whether the userId entered during login is the same as that in userSig .

sdkAppId in userSig is different from that in the request. Please check Account 70014 whether the sdkAppId entered during login is the same as that in system userSig .

Account The verification method for this sdkAppId and account type was not 70015 system found. Please check whether account integration has been performed.

Account The length of the public key pulled is 0. Please check whether a public key 70016 system has been uploaded. If it was just uploaded, try again in 10 minutes.

©2013-2019 Tencent Cloud. All rights reserved. Page 97 of 184 Tencent Real-Time Communication

Error Type Description Code

Internal validation of third-party ticket timed out. Please try again. If the Account 70017 problem persists after multiple retries, contact TLS account support over system QQ at 3268519604.

Account 70018 Internal validation of third-party ticket failed. system

Account The ticket field for HTTPS-based validation is empty. Please enter the 70019 system correct userSig .

Account sdkAppId was not found. Please make sure you have configured it in 70020 system Tencent Cloud.

Account 70052 Invalid userSig . Please generate a new one and try again. system

Account 70101 Empty request packet. system

Account 70102 Incorrect account type in request packet. system

Account 70103 Incorrect phone number format. system

Account 70104 Incorrect email address format. system

Account 70105 Incorrect TLS account format. system

Account 70106 Invalid account format type. system

Account 70107 userId was not registered. system

Account 70113 Invalid batch number. system

Account 70114 Restricted for security reasons. system

©2013-2019 Tencent Cloud. All rights reserved. Page 98 of 184 Tencent Real-Time Communication

Error Type Description Code

Account 70115 The uin does not match that of the sdkAppId developer. system

Account 70140 sdkAppId and acctype do not match. system

Account 70145 Incorrect account type. system

Account Internal error. Please try again. If the problem persists after multiple 70169 system retries, contact TLS account support over QQ at 3268519604.

Account Internal error. Please try again. If the problem persists after multiple 70201 system retries, contact TLS account support over QQ at 3268519604.

Account Internal error. Please try again. If the problem persists after multiple 70202 system retries, contact TLS account support over QQ at 3268519604.

Account Internal error. Please try again. If the problem persists after multiple 70203 system retries, contact TLS account support over QQ at 3268519604.

Account 70204 sdkAppId has no matching acctype . system

Account 70205 Failed to find acctype . Please try again. system

Account 70206 Invalid batch number in request. system

Account 70207 Internal error. Please try again. system

Account 70208 Internal error. Please try again. system

Account 70209 Failed to get developer's uin . system

Account 70210 uin in request is not developer’s. system

Account 70211 Invalid uin in request. system

©2013-2019 Tencent Cloud. All rights reserved. Page 99 of 184 Tencent Real-Time Communication

Error Type Description Code

Account Internal error. Please try again. If the problem persists after multiple 70212 system retries, contact TLS account support over QQ at 3268519604.

Failed to access internal data. Please try again. If the problem persists Account 70213 after multiple retries, contact TLS account support over QQ at system 3268519604.

Account 70214 Internal ticket validation failed. system

Account 70221 Invalid login status. Please authenticate your login with UserSig again. system

Account 70222 Internal error. Please try again. system

Account Internal error. Please try again. If the problem persists after multiple 70225 system retries, please contact TLS account support over QQ at 3268519604

Account Internal error. Please try again. If the problem persists after multiple 70231 system retries, contact TLS account support over QQ at 3268519604.

Account 70236 User signature verification failed. system

Account Internal error. Please try again. If the problem persists after multiple 70308 system retries, contact TLS account support over QQ at 3268519604.

Account 70346 Ticket validation failed. system

Account 70347 Ticket expired and validation failed. system

Account Internal error. Please try again. If the problem persists after multiple 70348 system retries, contact TLS account support over QQ at 3268519604.

Account Internal timeout. Please try again. If the problem persists after multiple 70362 system retries, contact TLS account support over QQ at 3268519604.

Account 70401 Internal error. Please try again. system

©2013-2019 Tencent Cloud. All rights reserved. Page 100 of 184 Tencent Real-Time Communication

Error Type Description Code

Account Invalid parameter. Please check whether all required fields are filled in and 70402 system the values entered meet the requirements.

Account The initiator is not the application admin and is not authorized to perform 70403 system the operation.

Account The account is temporarily locked due to failed login and multiple retries. 70050 system Please check whether the ticket is correct and try again in a minute.

Account Blocked account. Please contact TLS account support over QQ at 70051 system 3268519604.

Room Entry Errors

Error Message Code

Service is suspended due to overdue payments. Log in to the TRTC console, find the 10006 application you created, and click Application Info to view the status of your TRTC service.

-10011 Unknown server error. Please try again.

roomId not passed in or does not meet requirements. To use roomId in string type, -10012 set useStringRoomId to true when calling TRTC.createClient .

-10013 userSig authentication failed.

-10015 Failed to get server node on server. Please try again.

-10016 Failed to create room on server. Check if roomId meets QoS requirements.

After advanced permission control is enabled, client.join does not carry -10018 privateMapKey or privateMapKey is . For details, see Enabling Advanced Permission Control.

After advanced permission control is enabled, privateMapKey carried by client.join -10019 does not meet the requirements. For details, see Enabling Advanced Permission Control.

-10020 Server connection timed out. Please try again.

©2013-2019 Tencent Cloud. All rights reserved. Page 101 of 184 Tencent Real-Time Communication

Common Errors and Solutions

The following errors must be fixed through application-side intervention. For example, if camera access is denied, the application needs to prompt users to grant it camera access in order to be able to make video calls.

Error Message Reason Solution

publish timeout Publishing timed out. Refresh and call publish() again.

join room timeout Room entry timed out Refresh the page and try again.

DTLS Transport DTLS connection timed connection timeout Refresh and try again. out. (10s)

failed to connect to WebSocket connection remote server via Refresh and try again. failed. websocket

ICE/DTLS Transport Failed to establish media Check firewall configuration. connection failed transport connection.

previous publishing Do not call publish() again after is ongoing, please Already publishing. publishing. avoid re-publishing

The device was inaccessible due to an Please test the device before making a AbortError unknown device/system call. error.

Handle the error according to the error The device was message returned, and send this message inaccessible due to a to the user: “The camera/mic cannot be NotReadableError hardware, browser or accessed. Please make sure that no other webpage error. applications are requesting access and try again.”

Unable to find the media (audio, video, or screen Please test the device before making a NotFoundError sharing) of the request call. parameter.

©2013-2019 Tencent Cloud. All rights reserved. Page 102 of 184 Tencent Real-Time Communication

Error Message Reason Solution

The user has rejected the current browser Remind the user that video calls are not NotAllowedError instance’s request to possible without camera/mic access. access the camera/mic or share screens.

SignalChannel WebSocket Refresh and try again. reconnect failed disconnected.

duplicate publishing, please unpublish and Repeated publish calls. Call unpublish() first before publish() . then re-publish

The browser could not Make sure that the value of OverconstrainedError get the cameraId/ microphoneId` is a valid non- cameraId / microphoneId . empty string.

TRTC SDK for desktop browsers failed with RtcError: no valid ice regard to hole punching Check firewall configuration. candidate found via Session Traversal Utilities for NAT (STUN).

©2013-2019 Tencent Cloud. All rights reserved. Page 103 of 184 Tencent Real-Time Communication

Electron Overview

Last updated:2021-04-15 10:41:57

TRTCCloud @ TXLiteAVSDK

APIs for Tencent Cloud’s video call feature

Documentation: TRTC Electron SDK Sample code: TRTC Electron Demo

Creating TRTC objects

const TRTCCloud = require('trtc-electron-sdk').default; // import TRTCCloud from 'trtc-electron-sdk'; this.rtcCloud = new TRTCCloud();

Since version 7.9.348, TRTC SDK for Electron has integrated trtc.d.ts for developers using TypeScript.

import TRTCCloud from 'trtc-electron-sdk';

const rtcCloud: TRTCCloud = new TRTCCloud(); // Get the SDK version number. rtcCloud.getSDKVersion();

Setting callback

subscribeEvents = (rtcCloud) => { rtcCloud.on('onError', (errcode, errmsg) => { console.info('trtc_demo: onError :' + errcode + " msg" + errmsg); }); rtcCloud.on('onEnterRoom', (elapsed) => { console.info('trtc_demo: onEnterRoom elapsed:' + elapsed); }); rtcCloud.on('onExitRoom', (reason) => { console.info('onExitRoom: userenter reason:' + reason); }); };

©2013-2019 Tencent Cloud. All rights reserved. Page 104 of 184 Tencent Real-Time Communication

subscribeEvents(this.rtcCloud);

Creating and terminating ITRTCCloud singletons

API Description

Creates a ITRTCCloud singleton object during dynamic DLL getTRTCShareInstance loading.

destroyTRTCShareInstance Releases a ITRTCCloud singleton object and frees up resources.

Room APIs

API Description

Enters a room. If the room does not exist, the system will create one enterRoom automatically.

exitRoom Exits a room.

switchRoom Switches rooms.

Switches roles. This API applies only to the live streaming modes switchRole ( TRTCAppSceneLIVE and TRTCAppSceneVoiceChatRoom ).

connectOtherRoom Requests cross-room co-anchoring (anchor competition).

disconnectOtherRoom Ends cross-room co-anchoring (anchor competition).

CDN APIs

API Description

startPublishing Starts pushing to Tencent Cloud’s live streaming CDN.

stopPublishing Stops pushing to Tencent Cloud’s live streaming CDN.

Starts relaying to the live streaming CDN of a non-Tencent Cloud startPublishCDNStream vendor.

Stops relaying to the live streaming CDN of a non-Tencent Cloud stopPublishCDNStream vendor.

setMixTranscodingConfig Sets On-Cloud MixTranscoding parameters.

©2013-2019 Tencent Cloud. All rights reserved. Page 105 of 184 Tencent Real-Time Communication

Video APIs

API Description

startLocalPreview Enables capture and preview of the local camera.

stopLocalPreview Disables capture and preview of the local camera.

muteLocalVideo Block/Unblocks local video.

startRemoteView Starts displaying the video image of a remote user.

Stops displaying the video image of a remote user and stopRemoteView pulling the user’s video stream.

Stops displaying the video images of all users and pulling stopAllRemoteView their video streams.

muteRemoteVideoStream Pauses receiving a specified remote video stream.

muteAllRemoteVideoStreams Stops receiving all remote video streams.

setVideoEncoderParam Sets video encoder parameters.

setNetworkQosParam Sets QoS control parameters.

Sets rendering parameters for the local image (primary setLocalRenderParams stream).

setLocalViewFillMode Disused API: sets the rendering mode of the local image.

setRemoteRenderParams Sets rendering parameters for a remote image.

setRemoteViewFillMode Disused API: sets the rendering mode of a remote image.

Disused API: sets the clockwise rotation degree of the local setLocalViewRotation image.

Disused API: sets the clockwise rotation degree of a remote setRemoteViewRotation image.

Sets the rotation degree of encoded video images, i.e., setVideoEncoderRotation images presented to remote users and recorded by the server.

Disused API: sets the mirror mode of the local camera's setLocalViewMirror preview image.

setVideoEncoderMirror Sets the mirror mode of encoded images.

©2013-2019 Tencent Cloud. All rights reserved. Page 106 of 184 Tencent Real-Time Communication

enableSmallVideoStream Enables the dual-channel (big and small images) encoding mode.

Sets whether to view the big or small image of a specified setRemoteVideoStreamType userId .

setPriorRemoteVideoStreamType Disused API: sets video quality preferences for viewers.

snapshotVideo Takes a video screenshot.

Audio APIs

API Description

startLocalAudio Enables local audio capture and upstream data transfer.

stopLocalAudio Disables local audio capture and upstream data transfer.

muteLocalAudio Mutes local audio.

Mutes a remote user and stops pulling the user’s audio muteRemoteAudio stream.

muteAllRemoteAudio Mutes all remote users and stops pulling their audio streams.

setAudioCaptureVolume Sets the SDK capture volume.

getAudioCaptureVolume Gets the SDK capture volume.

setAudioPlayoutVolume Sets the SDK playback volume.

getAudioPlayoutVolume Gets the SDK playback volume.

enableAudioVolumeEvaluation Enables/Disables volume reminders.

startAudioRecording Starts audio recording.

stopAudioRecording Stops audio recording.

setAudioQuality Disused API: sets audio quality.

setRemoteAudioVolume Sets the playback volume of a remote user.

Camera APIs

API Description

©2013-2019 Tencent Cloud. All rights reserved. Page 107 of 184 Tencent Real-Time Communication

getCameraDevicesList Gets the camera list.

setCurrentCameraDevice Sets the camera to use.

getCurrentCameraDevice Gets the camera currently in use.

Audio device APIs

API Description

getMicDevicesList Gets the mic list.

getCurrentMicDevice Gets the mic currently in use.

setCurrentMicDevice Sets the mic to use.

getCurrentMicDeviceVolume Gets the current mic volume.

setCurrentMicDeviceVolume Sets the current mic volume.

setCurrentMicDeviceMute Mutes/Unmutes the current mic.

getCurrentMicDeviceMute Gets whether the current mic is muted.

getSpeakerDevicesList Gets the speaker list.

getCurrentSpeakerDevice Gets the speaker currently in use.

setCurrentSpeakerDevice Sets the speaker to use.

getCurrentSpeakerVolume Gets the current speaker volume.

setCurrentSpeakerVolume Sets the current speaker volume.

setCurrentSpeakerDeviceMute Mutes/Unmutes the current speaker.

getCurrentSpeakerDeviceMute Gets whether the current speaker is muted.

Beauty filter APIs

API Description

setBeautyStyle Sets the strength of the beauty, brightening, and rosy skin filters.

setWaterMark Sets watermarks.

Substream APIs

©2013-2019 Tencent Cloud. All rights reserved. Page 108 of 184 Tencent Real-Time Communication

API Description

Disused API: starts rendering the substream (screen startRemoteSubStreamView sharing) image of a remote user.

Disused API: stops rendering the substream (screen stopRemoteSubStreamView sharing) image of a remote user.

Disused API: sets the rendering mode of substream setRemoteSubStreamViewFillMode (screen sharing) images.

Disused API: sets the clockwise rotation degree of setRemoteSubStreamViewRotation substream (screen sharing) images.

getScreenCaptureSources Enumerates shareable windows.

Sets screen sharing parameters. This method can be selectScreenCaptureTarget called during screen sharing.

startScreenCapture Starts screen sharing.

pauseScreenCapture Pauses screen sharing.

resumeScreenCapture Resumes screen sharing.

stopScreenCapture Stops screen sharing.

Sets encoder parameters for substream (screen sharing) setSubStreamEncoderParam images.

Sets the audio mixing volume of substream (screen setSubStreamMixVolume sharing) images.

Custom message sending APIs

API Description

sendCustomCmdMsg Sends a custom message to all users in the room.

sendSEIMsg Embeds small-volume custom data in video frames.

Background audio mixing APIs

API Description

playBGM Disused API: starts background music.

©2013-2019 Tencent Cloud. All rights reserved. Page 109 of 184 Tencent Real-Time Communication

stopBGM Disused API: stops background music.

pauseBGM Disused API: pauses background music.

resumeBGM Disused API: resumes background music.

Disused API: gets the total length of the background music getBGMDuration file, in milliseconds.

Disused API: sets the playback progress of background setBGMPosition music.

setBGMVolume Disused API: sets background music volume.

Disused API: sets the local playback volume of background setBGMPlayoutVolume music.

Disused API: sets the remote playback volume of setBGMPublishVolume background music.

Enables system audio capture. Currently, the SDK does not support system audio mixing on macOS or 64-bit Windows. startSystemAudioLoopback This API can be called only on 32-bit Windows for the time being.

Disables system audio capture Currently, the SDK does not support system audio mixing on macOS or 64-bit Windows. stopSystemAudioLoopback This API can be called only on 32-bit Windows for the time being.

Sets the system audio capture volume. Currently, the SDK does not support system audio mixing on macOS or 64-bit setSystemAudioLoopbackVolume Windows. This API can be called only on 32-bit Windows for the time being.

startPlayMusic Starts background music.

stopPlayMusic Stops background music.

pausePlayMusic Pauses background music.

resumePlayMusic Resumes background music.

Gets the total length of the background music file, in getMusicDurationInMS milliseconds.

seekMusicToPosInTime Sets the playback progress of background music.

setAllMusicVolume Sets background music volume. This API is used to control

©2013-2019 Tencent Cloud. All rights reserved. Page 110 of 184 Tencent Real-Time Communication

the playback volume of background music.

setMusicPlayoutVolume Sets the local playback volume of background music.

setMusicPublishVolume Sets the remote playback volume of background music.

Audio effect APIs

API Description

playAudioEffect Disused API: plays an audio effect.

setAudioEffectVolume Disused API: sets the volume of an audio effect.

stopAudioEffect Disused API: stops an audio effect.

stopAllAudioEffects Disused API: stops all audio effects.

setAllAudioEffectsVolume Disused API: sets the volume of all audio effects.

pauseAudioEffect Disused API: pauses an audio effect.

resumeAudioEffect Disused API: resumes an audio effect.

Device and network testing APIs

API Description

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

stopSpeedTest Stops server speed testing.

startCameraDeviceTest Starts camera testing.

stopCameraDeviceTest Stops camera testing.

startMicDeviceTest Starts mic testing.

stopMicDeviceTest Stops mic testing.

startSpeakerDeviceTest Starts speaker testing.

stopSpeakerDeviceTest Stops speaker testing.

Log APIs

©2013-2019 Tencent Cloud. All rights reserved. Page 111 of 184 Tencent Real-Time Communication

API Description

getSDKVersion Gets the SDK version.

setLogLevel Sets the log output level.

setConsoleEnabled Enables/Disables console log printing.

setLogCompressEnabled Enables/Disables local log compression.

setLogDirPath Sets the path to save logs.

setLogCallback Sets the log callback.

callExperimentalAPI Calls the experimental API.

Disused APIs

API Description

setMicVolumeOnMixing This API has been disused since version 6.9.

TRTCCallback @ TXLiteAVSDK

Callback APIs for Tencent Cloud’s video call feature.

Error and warning event callback APIs

API Description

Error callback, which indicates that the SDK encountered an irrecoverable error onError and must be listened on. The corresponding UI reminders should be displayed based on the actual conditions.

Warning callback. This alerts you to non-serious problems such as or onWarning recoverable decoding failure.

Room event callback APIs

API Description

onEnterRoom Callback of room entry

onExitRoom Callback of room exit

©2013-2019 Tencent Cloud. All rights reserved. Page 112 of 184 Tencent Real-Time Communication

onSwitchRole Callback of role switching

Callback of the result of requesting cross-room co-anchoring (anchor onConnectOtherRoom competition)

Callback of the result of ending cross-room co-anchoring (anchor onDisconnectOtherRoom competition)

onSwitchRoom Callback of room switching

User event callback APIs

API Description

onRemoteUserEnterRoom Callback of the entry of a user

onRemoteUserLeaveRoom Callback of the exit of a user

onUserVideoAvailable Callback of whether a user has enabled the camera

onUserSubStreamAvailable Callback of whether a user has started screen sharing

onUserAudioAvailable Callback of whether a user is sending audio data

Callback of the rendering of the first video frame of the local onFirstVideoFrame user or remote users

Callback of the playing of the first audio frame of a remote user. onFirstAudioFrame No notifications are sent for local audio

onSendFirstLocalVideoFrame Callback of the sending of the first local video frame

onSendFirstLocalAudioFrame Callback of the sending of the first local audio frame

onUserEnter Disused API: callback of the entry of an anchor

onUserExit Disused API: callback of the exit of an anchor

Callback of statistics on quality and technical metrics

API Description

Network quality. This callback is triggered every 2 seconds to collect onNetworkQuality statistics on the quality of current upstream and downstream data transfer.

onStatistics Callback of statistics on technical metrics

©2013-2019 Tencent Cloud. All rights reserved. Page 113 of 184 Tencent Real-Time Communication

Server event callbacks

API Description

onConnectionLost Callback of the disconnection of the SDK from the server

onTryToReconnect Callback of the SDK trying to connect to the server again

onConnectionRecovery Callback of the reconnection of the SDK to the server

Callback of server speed test results. The SDK tests the speed of onSpeedTest multiple server IPs, and the result of each test is returned through this callback.

Hardware event callback APIs

API Description

onCameraDidReady Callback of the camera being ready

onMicDidReady Callback of the mic being ready

Callback of volume, including the volume of each onUserVoiceVolume userId and the total remote volume

Callback of the connection/disconnection of a local onDeviceChange device

onTestMicVolume Callback of mic testing volume

onTestSpeakerVolume Callback of speaker testing volume

Callback of volume change of the current audio onAudioDeviceCaptureVolumeChanged capture device

Callback of volume change of the current audio onAudioDevicePlayoutVolumeChanged playback device

Custom message receiving callback APIs

API Description

onRecvCustomCmdMsg Callback of the receipt of a custom message

onMissCustomCmdMsg Callback of the missing of a custom message

onRecvSEIMsg Callback of the receipt of an SEI message

©2013-2019 Tencent Cloud. All rights reserved. Page 114 of 184 Tencent Real-Time Communication

Callback APIs for CDN relayed push

API Description

Callback of starting to push to Tencent Cloud’s live streaming onStartPublishing CDN, which corresponds to the startPublishing() API in TRTCCloud

Callback of stopping pushing to Tencent Cloud’s live streaming onStopPublishing CDN, which corresponds to the stopPublishing() API in TRTCCloud .

onStartPublishCDNStream Callback of the completion of starting relayed push to CDNs

onStopPublishCDNStream Callback of the completion of stopping relayed push to CDNs

Callback of setting On-Cloud MixTranscoding parameters, which onSetMixTranscodingConfig corresponds to the setMixTranscodingConfig() API in TRTCCloud

Audio effect callback API

API Description

onAudioEffectFinished Disused API: callback of ending audio effect playback

Screen sharing callback APIs

API Description

Callback of screencapturing failure because the target window is onScreenCaptureCovered covered. This callback can be used to prompt users to move the window.

onScreenCaptureStarted Callback of starting screen sharing

onScreenCapturePaused Callback of pausing screen sharing

onScreenCaptureResumed Callback of resuming screen sharing

onScreenCaptureStopped Callback of stopping screen sharing

Screenshot callback API

API Description

onSnapshotComplete Callback of the completion of a screenshot

©2013-2019 Tencent Cloud. All rights reserved. Page 115 of 184 Tencent Real-Time Communication

Background music callbacks APIs

API Description

onPlayBGMBegin Disused API: callback of starting background music

onPlayBGMProgress Disused API: callback of the playback progress of background music

onPlayBGMComplete Disused API: callback of ending background music playback

Definitions of Key Classes

Key classes

Class Description

TRTCParams Room entry parameters

TRTCVideoEncParam Video encoding parameters

TRTCNetworkQosParam QoS control parameters

TRTCQualityInfo Video quality

TRTCVolumeInfo Volume

TRTCSpeedTestResult Network speed testing result

Position of the image of each channel in On-Cloud TRTCMixUser MixTranscoding

TRTCTranscodingConfig On-Cloud MixTranscoding configuration

TRTCPublishCDNParam CDN relayed push parameters

TRTCAudioRecordingParams Audio recording parameters

TRTCLocalStatistics Local audio/video statistics

TRTCRemoteStatistics Remote audio/video statistics

TRTCStatistics Statistics

Enumerated values

Enumerated Value Description

©2013-2019 Tencent Cloud. All rights reserved. Page 116 of 184 Tencent Real-Time Communication

TRTCVideoResolution Video resolution

TRTCVideoResolutionMode Video resolution mode

TRTCVideoStreamType Video stream type

TRTCQuality Image quality

TRTCVideoFillMode Video image fill mode

TRTCBeautyStyle Beauty filter (skin smoothing) algorithm

TRTCAppScene Application scenario

Role, which applies only to live streaming scenarios TRTCRoleType ( TRTCAppSceneLIVE ).

TRTCQosControlMode QoS control mode

TRTCVideoQosPreference Image quality preference

TRTCDeviceState Device operation

TRTCDeviceType Device type

TRTCWaterMarkSrcType Watermark source type

TRTCTranscodingConfigMode Configuration mode for stream mixing parameters

©2013-2019 Tencent Cloud. All rights reserved. Page 117 of 184 Tencent Real-Time Communication

Error Codes

Last updated:2020-05-28 17:53:50

Error Codes

Basic error codes

Code Value Description

ERR_NULL 0 No error

Error codes for room entry

TRTCCloud.enterRoom() will trigger this type of error codes if cross-room co-anchoring fails. You can use the callback functions TRTCCloudDelegate.onEnterRoom() and TRTCCloudDelegate.OnError() to capture related notifications.

Code Value Description

ERR_ROOM_ENTER_FAIL -3301 Failed to enter the room

Empty room entry parameter. Please check whether valid ERR_ENTER_ROOM_PARAM_NULL -3316 parameters are passed in to the enterRoom:appScene: API when it is called

Incorrect room entry parameter ERR_SDK_APPID_INVALID -3317 sdkAppId

Incorrect room entry parameter ERR_ROOM_ID_INVALID -3318 roomId

Incorrect room entry parameter ERR_USER_ID_INVALID -3319 userID

Incorrect room entry parameter ERR_USER_SIG_INVALID -3320 userSig

The room entry request timed out. ERR_ROOM_REQUEST_ENTER_ROOM_TIMEOUT -3308 Please check the network

©2013-2019 Tencent Cloud. All rights reserved. Page 118 of 184 Tencent Real-Time Communication

Code Value Description

Unavailable service. Please check whether the remained validity period in minutes in the package ERR_SERVER_INFO_SERVICE_SUSPENDED -100013 is greater than 0 and whether the Tencent Cloud account is in arrears

Error codes for room exit

TRTCCloud.exitRoom() will trigger this type of error codes if cross-room co-anchoring fails. You can use the callback function TRTCCloudDelegate.OnError() to capture related notifications.

Code Value Description

ERR_ROOM_REQUEST_QUIT_ROOM_TIMEOUT -3325 The room exit request timed out

Error codes for devices (camera, mic, and speaker)

You can use the callback function TRTCCloudDelegate.OnError() to capture related notifications.

Code Value Description

Failed to enable the camera; for example, the configuration program (driver) of the camera on Windows or macOS was exceptional. In this case, ERR_CAMERA_START_FAIL -1301 please try to disable and then enable the camera again, restart the device, or update the configuration program

The camera is not authorized. This error usually ERR_CAMERA_NOT_AUTHORIZED -1314 occurs on mobile devices and may be caused by permission denial by user

Incorrect camera parameter settings (unsupported ERR_CAMERA_SET_PARAM_FAIL -1315 value or other causes)

The camera is being used. Please try to enable ERR_CAMERA_OCCUPY -1316 another camera

©2013-2019 Tencent Cloud. All rights reserved. Page 119 of 184 Tencent Real-Time Communication

Code Value Description

Failed to enable the mic; for example, the configuration program (driver) of the mic on Windows or macOS was exceptional. In this case, ERR_MIC_START_FAIL -1302 please try to disable and then enable the mic again, restart the device, or update the configuration program

The mic is not authorized. This error usually ERR_MIC_NOT_AUTHORIZED -1317 occurs on mobile devices and may be caused by permission denial by user

ERR_MIC_SET_PARAM_FAIL -1318 Failed to set mic parameters

The mic is being used. For example, if the mobile ERR_MIC_OCCUPY -1319 device is on a call, the mic will fail to be enabled

ERR_MIC_STOP_FAIL -1320 Failed to disable the mic

Failed to enable the speaker; for example, the configuration program (driver) of the speaker on Windows or macOS was exceptional. In this case, ERR_SPEAKER_START_FAIL -1321 please try to disable and then enable the speaker again, restart the device, or update the configuration program

ERR_SPEAKER_SET_PARAM_FAIL -1322 Failed to set the speaker parameters

ERR_SPEAKER_STOP_FAIL -1323 Failed to disable the speaker

Error codes for screen sharing

You can use the callback function TRTCCloudDelegate.OnError() to capture related notifications.

Code Value Description

©2013-2019 Tencent Cloud. All rights reserved. Page 120 of 184 Tencent Real-Time Communication

Code Value Description

Failed to start screencapturing. If this error occurs on a mobile device, it may be caused by permission denial by ERR_SCREEN_CAPTURE_START_FAIL -1308 user; if on Windows or macOS, please check whether parameters of the screencapturing API meet the requirements

Screencapturing failed. Please use Android v5.0 or above if the ERR_SCREEN_CAPTURE_UNSURPORT -1309 device is on Android or use iOS v11.0 or above if the device is on iOS

No permission to ERR_SERVER_CENTER_NO_PRIVILEDGE_PUSH_SUB_VIDEO -102015 upstream secondary channel

Other users are ERR_SERVER_CENTER_ANOTHER_USER_PUSH_SUB_VIDEO -102016 upstreaming secondary channel

Screecapturing was ERR_SCREEN_CAPTURE_STOPPED -7001 stopped by the system

Error code for encoding and decoding

You can use the callback function TRTCCloudDelegate.OnError() to capture related notifications.

Code Value Description

Failed to encode video frames; for example, when a user switches from an iOS device to another device, the hardware encoder may be released ERR_VIDEO_ENCODE_FAIL -1303 by the system; and after the user switches back, this error may be thrown before the hardware encoder is restarted

©2013-2019 Tencent Cloud. All rights reserved. Page 121 of 184 Tencent Real-Time Communication

Code Value Description

ERR_UNSUPPORTED_RESOLUTION -1305 Unsupported video resolution

Failed to encode audio frames; for example, the ERR_AUDIO_ENCODE_FAIL -1304 SDK could not process the custom audio data passed in

ERR_UNSUPPORTED_SAMPLERATE -1306 Unsupported audio sample rate

Error codes for custom capture

You can use the callback function TRTCCloudDelegate.OnError() to capture related notifications.

Code Value Description

ERR_PIXEL_FORMAT_UNSUPPORTED -1327 Unsupported pixel format

ERR_BUFFER_TYPE_UNSUPPORTED -1328 Unsupported buffer type

Error codes for CDN binding and mixtranscoding

You can use the callback functions TRTCCloudDelegate.onStartPublishing() and TRTCCloudDelegate.onSetMixTranscodingConfig() to capture related notifications.

Code Value Description

The relayed push request ERR_PUBLISH_CDN_STREAM_REQUEST_TIME_OUT -3321 timed out

The On-Cloud MixTranscoding ERR_CLOUD_MIX_TRANSCODING_REQUEST_TIME_OUT -3322 request timed out

The returned packet of ERR_PUBLISH_CDN_STREAM_SERVER_FAILED -3323 relayed push is exceptional

The returned packet of On- ERR_CLOUD_MIX_TRANSCODING_SERVER_FAILED -3324 Cloud MixTranscoding is exceptional

Signaling timed out when ERR_ROOM_REQUEST_START_PUBLISHING_TIMEOUT -3333 starting pushing to Tencent Cloud LVB CDN

©2013-2019 Tencent Cloud. All rights reserved. Page 122 of 184 Tencent Real-Time Communication

Code Value Description

Signaling was exceptional ERR_ROOM_REQUEST_START_PUBLISHING_ERROR -3334 when starting pushing to Tencent Cloud LVB CDN

Signaling timed out when ERR_ROOM_REQUEST_STOP_PUBLISHING_TIMEOUT -3335 stopping pushing to Tencent Cloud LVB CDN

Signaling was exceptional ERR_ROOM_REQUEST_STOP_PUBLISHING_ERROR -3336 when stopping pushing to Tencent Cloud LVB CDN

Error codes for cross-room co-anchoring

TRTCCloud.ConnectOtherRoom() will trigger this type of error codes if cross-room co-anchoring fails. You can use the callback function TRTCCloudDelegate.onConnectOtherRoom() to capture related notifications.

Code Value Description

The co- anchoring ERR_ROOM_REQUEST_CONN_ROOM_TIMEOUT -3326 request timed out

The request for exiting co- ERR_ROOM_REQUEST_DISCONN_ROOM_TIMEOUT -3327 anchoring timed out

Invalid ERR_ROOM_REQUEST_CONN_ROOM_INVALID_PARAM -3328 parameter

©2013-2019 Tencent Cloud. All rights reserved. Page 123 of 184 Tencent Real-Time Communication

Code Value Description

The current role is viewer, and cross- room co- anchoring cannot be ERR_CONNECT_OTHER_ROOM_AS_AUDIENCE -3330 requested or stopped. switchRole() needs to be used to switch the role to anchor first

Cross-room co- ERR_SERVER_CENTER_CONN_ROOM_NOT_SUPPORT -102031 anchoring unsupported

The number of co-anchoring ERR_SERVER_CENTER_CONN_ROOM_REACH_MAX_NUM -102032 calls has reached the upper limit

The number of retries for cross-room co- ERR_SERVER_CENTER_CONN_ROOM_REACH_MAX_RETRY_TIMES -102033 anchoring has reached the upper limit

The request for cross-room ERR_SERVER_CENTER_CONN_ROOM_REQ_TIMEOUT -102034 co-anchoring timed out

Incorrect format of the ERR_SERVER_CENTER_CONN_ROOM_REQ -102035 cross-room co- anchoring request

©2013-2019 Tencent Cloud. All rights reserved. Page 124 of 184 Tencent Real-Time Communication

Code Value Description

No signature ERR_SERVER_CENTER_CONN_ROOM_NO_SIG -102036 for cross-room co-anchoring

Failed to decrypt the ERR_SERVER_CENTER_CONN_ROOM_DECRYPT_SIG -102037 signature for cross-room co- anchoring

The key for decrypting the cross-room co- ERR_SERVER_CENTER_CONN_ROOM_NO_KEY -102038 anchoring signature was not found

An error occurred when parsing a ERR_SERVER_CENTER_CONN_ROOM_PARSE_SIG -102039 signature for cross-room co- anchoring

Incorrect timestamp of ERR_SERVER_CENTER_CONN_ROOM_INVALID_SIG_TIME -102040 the cross-room co-anchoring signature

Incorrect cross-room co- ERR_SERVER_CENTER_CONN_ROOM_SIG_GROUPID -102041 anchoring signature

No co- ERR_SERVER_CENTER_CONN_ROOM_NOT_CONNED -102042 anchoring in this room

The user did ERR_SERVER_CENTER_CONN_ROOM_USER_NOT_CONNED -102043 not initiate co- anchoring

©2013-2019 Tencent Cloud. All rights reserved. Page 125 of 184 Tencent Real-Time Communication

Code Value Description

Cross-room co- ERR_SERVER_CENTER_CONN_ROOM_FAILED -102044 anchoring failed

Failed to cancel cross- ERR_SERVER_CENTER_CONN_ROOM_CANCEL_FAILED -102045 room co- anchoring

The room to be called in ERR_SERVER_CENTER_CONN_ROOM_CONNED_ROOM_NOT_EXIST -102046 co-anchoring does not exist

The number of rooms that can join co- ERR_SERVER_CENTER_CONN_ROOM_CONNED_REACH_MAX_ROOM -102047 anchoring has reached the upper limit

The user to be called in co- ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_NOT_EXIST -102048 anchoring does not exist

The user to be called in co- ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_DELETED -102049 anchoring was deleted

The number of users that can join co- ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_FULL -102050 anchoring has reached the upper limit

Disordered co- anchoring ERR_SERVER_CENTER_CONN_ROOM_INVALID_SEQ -102051 request numbers

©2013-2019 Tencent Cloud. All rights reserved. Page 126 of 184 Tencent Real-Time Communication

Warning Codes

Warning codes do not require your special attention, and you can choose whether to prompt the current user accordingly.

Code Value Description

An error occurred while enabling the WARNING_HW_ENCODER_START_FAIL 1103 hardware encoder, and the software encoder was automatically switch to

The current CPU utilization is too high to meet software encoding WARNING_VIDEO_ENCODER_SW_TO_HW 1107 needs, and the hardware encoder was automatically switch to

Insufficient frame rate for video capture through camera. This error WARNING_INSUFFICIENT_CAPTURE_FPS 1108 may occur in Android mobile devices with an in-built beauty filter algorithm

Failed to enable the software WARNING_SW_ENCODER_START_FAIL 1109 encoder

Camera resolution was lowered to WARNING_REDUCE_CAPTURE_RESOLUTION 1110 meet the balance between current frame rate and performance

Failed to decode the current video WARNING_VIDEO_FRAME_DECODE_FAIL 2101 frame

Failed to decode the current audio WARNING_AUDIO_FRAME_DECODE_FAIL 2102 frame

WARNING_VIDEO_PLAY_LAG 2105 Video playback lagged

Failed to enable the hardware WARNING_HW_DECODER_START_FAIL 2106 decoder, and the software decoder was used

The hardware decoder failed to decode the first I frame of the WARNING_VIDEO_DECODER_HW_TO_SW 2108 current stream, and the SDK automatically switched to the software decoder

©2013-2019 Tencent Cloud. All rights reserved. Page 127 of 184 Tencent Real-Time Communication

Code Value Description

Failed to enable the software WARNING_SW_DECODER_START_FAIL 2109 decoder

WARNING_VIDEO_RENDER_FAIL 2110 Failed to render video

WARNING_START_CAPTURE_IGNORED 4000 Video capture has started

Failed to write the recorded audio to WARNING_AUDIO_RECORDING_WRITE_FAIL 7001 a file

WARNING_ROOM_DISCONNECT 5101 Network connection was closed

The current role is viewer, so WARNING_IGNORE_UPSTREAM_FOR_AUDIENCE 6001 upstream audio/video data is ignored

©2013-2019 Tencent Cloud. All rights reserved. Page 128 of 184 Tencent Real-Time Communication

Flutter Overview

Last updated:2021-09-29 10:00:04

TRTCCloud

Basic APIs

API Description

sharedInstance Creates a TRTCCloud singleton.

destroySharedInstance Destroys a TRTCCloud singleton.

registerListener Registers an event listener.

unRegisterListener Unregisters an event listener.

Room APIs

API Description

Enters a room. If the room does not exist, the system will create enterRoom one automatically.

exitRoom Exits a room.

Switches roles. This API works only in live streaming scenarios switchRole ( TRTC_APP_SCENE_LIVE and TRTC_APP_SCENE_VOICE_CHATROOM ).

Sets the audio/video data receiving mode, which must be set setDefaultStreamRecvMode before room entry to take effect.

connectOtherRoom Requests a cross-room call (anchor competition).

disconnectOtherRoom Exits a cross-room call.

switchRoom Switches rooms.

CDN APIs

API Description

©2013-2019 Tencent Cloud. All rights reserved. Page 129 of 184 Tencent Real-Time Communication

API Description

startPublishing Starts pushing to Tencent Cloud’s live streaming CDN.

stopPublishing Stops pushing to Tencent Cloud’s live streaming CDN.

Starts relaying to the live streaming CDN of a non-Tencent Cloud startPublishCDNStream vendor.

Stops relaying to the live streaming CDN of a non-Tencent Cloud stopPublishCDNStream vendor.

setMixTranscodingConfig Sets On-Cloud MixTranscoding parameters.

Video APIs

API Description

startLocalPreview Enables preview of the local video.

stopLocalPreview Stops local video capturing and preview.

muteLocalVideo Pauses/Resumes pushing local video data.

startRemoteView Starts displaying the image of a remote user.

Stops displaying the video image of a remote user and pulling stopRemoteView the user’s video stream.

Stops displaying the video images of all users and pulling their stopAllRemoteView video streams.

muteRemoteVideoStream Pauses/Resumes receiving a specified remote video stream.

muteAllRemoteVideoStreams Pauses/Resumes receiving all remote video streams.

setVideoEncoderParam Sets video encoder parameters.

setNetworkQosParam Sets QoS control parameters.

setLocalRenderParams Sets the rendering mode of the local image.

setRemoteRenderParams Sets remote image parameters.

Sets the rotation of encoded video images, i.e., images setVideoEncoderRotation presented to remote users and recorded by the server.

setVideoEncoderMirror Sets the mirror mode of encoded images.

©2013-2019 Tencent Cloud. All rights reserved. Page 130 of 184 Tencent Real-Time Communication

API Description

setGSensorMode Sets the adaptation mode of the G-sensor.

Enables the dual-channel (big and small images) encoding enableEncSmallVideoStream mode.

setRemoteVideoStreamType Switches between the small and big images of a specified user.

snapshotVideo Takes a video screenshot.

Audio APIs

API Description

startLocalAudio Enables local audio capturing and upstream data transfer.

stopLocalAudio Disables local audio capturing and upstream data transfer.

muteLocalAudio Mutes/Unmutes the local audio.

Sets the image to be pushed when local video pushing is setVideoMuteImage paused.

setAudioRoute Sets the audio route.

muteRemoteAudio Mutes/Unmutes the audio of a specified remote user.

muteAllRemoteAudio Mutes/Unmutes all users.

setAudioCaptureVolume Sets the SDK capturing volume.

getAudioCaptureVolume Gets the SDK capturing volume.

setAudioPlayoutVolume Sets the SDK playback volume.

getAudioPlayoutVolume Gets the SDK playback volume.

enableAudioVolumeEvaluation Enables volume reminders.

startAudioRecording Starts audio recording.

stopAudioRecording Stops audio recording.

setSystemVolumeType Sets the system volume type used during calls.

Device management APIs

©2013-2019 Tencent Cloud. All rights reserved. Page 131 of 184 Tencent Real-Time Communication

API Description

Gets the device management module. For details, see device getDeviceManager management APIs.

Beauty filter APIs

API Description

Gets the beauty filter management object. For details, see the document getBeautyManager on beauty filter management.

setWatermark 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 getAudioEffectManager voice effects. For details, see the document on audio effect management.

Substream APIs

API Description

startScreenCapture Starts screen sharing.

stopScreenCapture Stops screen sharing.

pauseScreenCapture Pauses screen sharing.

resumeScreenCapture Resumes screen sharing.

Custom message sending APIs

API Description

sendCustomCmdMsg Sends a custom message to all users in the room.

sendSEIMsg Embeds small-volume custom data in video frames.

Network testing APIs

©2013-2019 Tencent Cloud. All rights reserved. Page 132 of 184 Tencent Real-Time Communication

API Description

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

stopSpeedTest Stops server speed testing.

Log APIs

API Description

getSDKVersion Gets the SDK version.

setLogLevel Sets the log output level.

setLogDirPath Changes the path to save logs.

setLogCompressEnabled Enables/Disables local log compression.

setConsoleEnabled 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. onError 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 onWarning recoverable decoding failure.

Room event callback APIs

API Description

onEnterRoom Callback of room entry

onExitRoom Callback of room exit

©2013-2019 Tencent Cloud. All rights reserved. Page 133 of 184 Tencent Real-Time Communication

API Description

onSwitchRole Callback of role switching

Callback of the result of requesting a cross-room call (anchor onConnectOtherRoom competition)

Callback of the result of ending a cross-room call (anchor onDisConnectOtherRoom competition)

onSwitchRoom Callback of the result of room switching ( switchRoom )

User event callback APIs

API Description

onRemoteUserEnterRoom Callback of the entry of a user

onRemoteUserLeaveRoom Callback of the exit of a user

Callback of whether a remote user has a playable primary image onUserVideoAvailable (usually the image of the camera)

Callback of whether a remote user has a playable substream onUserSubStreamAvailable image (usually the screen sharing image)

onUserAudioAvailable Callback of whether a remote user has playable audio

Callback of rendering the first video frame of the local user or a onFirstVideoFrame remote user

Callback of playing the first audio frame of a remote user. No onFirstAudioFrame notifications are sent for local audio.

onSendFirstLocalVideoFrame Callback of sending the first local video frame

onSendFirstLocalAudioFrame Callback of sending the first local audio frame

Callback APIs for background music playback

Callback APIs for background music playback

API Description

onMusicObserverStart Callback of starting music playback

onMusicObserverPlayProgress Callback of the music playback progress

©2013-2019 Tencent Cloud. All rights reserved. Page 134 of 184 Tencent Real-Time Communication

API Description

onMusicObserverComplete 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 onNetworkQuality collect statistics on the quality of current upstream and downstream data transfer.

onStatistics Callback of statistics on technical metrics

Server event callback APIs

API Description

onConnectionLost Callback of the disconnection of the SDK from the server

onTryToReconnect Callback of the SDK trying to connect to the server again

onConnectionRecovery Callback of the reconnection of the SDK to the server

Callback of server speed test results. The SDK tests the speed of onSpeedTest multiple server addresses, and the result of each test is returned through this callback.

Hardware event callback APIs

API Description

onCameraDidReady Callback of the camera being ready

onMicDidReady Callback of the mic being ready

Callback of volume, including the volume of each userId and the total onUserVoiceVolume remote volume

Custom message receiving callback APIs

API Description

onRecvCustomCmdMsg Callback of receiving a custom message

©2013-2019 Tencent Cloud. All rights reserved. Page 135 of 184 Tencent Real-Time Communication

API Description

onMissCustomCmdMsg Callback of losing a custom message

onRecvSEIMsg 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 onStartPublishing CDN, which corresponds to the startPublishing() API in TRTCCloud

Callback of stopping pushing to Tencent Cloud’s live streaming onStopPublishing CDN, which corresponds to the stopPublishing() API in TRTCCloud

onStartPublishCDNStream Callback of the completion of starting relayed push to CDNs

onStopPublishCDNStream Callback of the completion of stopping relayed push to CDNs

Callback of setting On-Cloud MixTranscoding parameters, which onSetMixTranscodingConfig corresponds to the setMixTranscodingConfig() API in TRTCCloud

Screen sharing callback APIs

API Description

onScreenCaptureStarted Callback of starting screen sharing

Callback of pausing screen sharing via the calling of onScreenCapturePaused pauseScreenCapture()

Callback of resuming screen sharing via the calling of onScreenCaptureResumed resumeScreenCapture()

onScreenCaptureStopped Callback of stopping screen sharing

Screenshot callback API

API Description

onSnapshotComplete Callback of the completion of a screenshot

©2013-2019 Tencent Cloud. All rights reserved. Page 136 of 184 Tencent Real-Time Communication

Definitions of Key Classes

Class Description

TRTCCloudDef Variables for key class definitions

TRTCParams Room entry parameters

TRTCSwitchRoomConfig Room switching parameters

TRTCVideoEncParam Video encoding parameters

TRTCNetworkQosParam QoS control parameters

TRTCRenderParams Remote image parameters

Position of the image of each channel in On-Cloud TRTCMixUser MixTranscoding

TRTCTranscodingConfig On-Cloud MixTranscoding configuration

Definitions of voice changing types (little girl, middle-aged man, TXVoiceChangerType metal, foreign accent, etc.)

Definitions of reverb effect types (karaoke, room, hall, low and TXVoiceReverbType deep, resonant, etc.)

AudioMusicParam Parameters for music and voice effect setting APIs

TRTCAudioRecordingParams Audio recording parameters

TRTCPublishCDNParam CDN relayed push parameters

©2013-2019 Tencent Cloud. All rights reserved. Page 137 of 184 Tencent Real-Time Communication

Error Codes

Last updated:2021-01-29 15:38:02

Error Codes

Basic error codes

Code Value Description

ERR_NULL 0 No error.

Error codes for room entry

TRTCCloud.enterRoom() will trigger this type of error codes if room entry fails. You can use the callback functions TRTCCloudDelegate.onEnterRoom() and TRTCCloudDelegate.OnError() to capture notifications about room entry errors.

Code Value Description

ERR_ROOM_ENTER_FAIL -3301 Failed to enter the room.

Empty room entry parameters. Please check whether valid ERR_ENTER_ROOM_PARAM_NULL -3316 parameters are passed in the TRTCCloud.enterRoom(): API when it is called.

ERR_SDK_APPID_INVALID -3317 Incorrect sdkAppId value.

ERR_ROOM_ID_INVALID -3318 Incorrect roomId value.

ERR_USER_ID_INVALID -3319 Incorrect userID value.

ERR_USER_SIG_INVALID -3320 Incorrect userSig value.

Room entry request timed out. ERR_ROOM_REQUEST_ENTER_ROOM_TIMEOUT -3308 Please check your network.

Service unavailable. Please check ERR_SERVER_INFO_SERVICE_SUSPENDED -100013 whether your Tencent Cloud account has overdue payment.

Error code for room exit

©2013-2019 Tencent Cloud. All rights reserved. Page 138 of 184 Tencent Real-Time Communication

TRTCCloud.exitRoom() will trigger this error code if room exit fails. You can use the callback function TRTCCloudDelegate.OnError() to capture notifications about the error.

Code Value Description

ERR_ROOM_REQUEST_QUIT_ROOM_TIMEOUT -3325 Room exit request timed out.

Error codes for devices (camera, mic, and speaker)

You can use the callback function TRTCCloudDelegate.OnError() to capture notifications about device errors.

Code Value Description

Failed to enable the camera. This error occurs when, for example, there is a problem with the camera configuration program (driver) on ERR_CAMERA_START_FAIL -1301 Windows or macOS. Do one of the following: disable the camera and then enable again, restart the camera, or update the configuration program.

Camera not authorized. This error usually occurs ERR_CAMERA_NOT_AUTHORIZED -1314 on mobile devices and may be because users denied camera permission.

Incorrect camera parameter settings (unsupported ERR_CAMERA_SET_PARAM_FAIL -1315 values or others).

ERR_CAMERA_OCCUPY -1316 Camera occupied. Try using another camera.

Failed to enable the mic. This error occurs when, for example, there is a problem with the mic configuration program (driver) on Windows or ERR_MIC_START_FAIL -1302 macOS. Do one of the following: disable the mic and then enable again, restart the mic, or update the configuration program.

Mic not authorized. This error usually occurs on ERR_MIC_NOT_AUTHORIZED -1317 mobile devices and may be because users denied mic permission.

ERR_MIC_SET_PARAM_FAIL -1318 Failed to set mic parameters.

Mic occupied. This error occurs when, for example, ERR_MIC_OCCUPY -1319 the user is in a call on the mobile device, in which case TRTC will fail to enable the mic.

©2013-2019 Tencent Cloud. All rights reserved. Page 139 of 184 Tencent Real-Time Communication

ERR_MIC_STOP_FAIL -1320 Failed to disable the mic.

Failed to enable the speaker. This error occurs when, for example, there is a problem with the speaker configuration program (driver) on ERR_SPEAKER_START_FAIL -1321 Windows or macOS. Do one of the following: disable the speaker and then enable again, restart the speaker, or update the configuration program.

ERR_SPEAKER_SET_PARAM_FAIL -1322 Failed to set speaker parameters.

ERR_SPEAKER_STOP_FAIL -1323 Failed to disable the speaker.

Error codes for screen sharing

You can use the callback function TRTCCloudDelegate.OnError() to capture notifications about screen sharing errors.

Code Value Description

Failed to start screencapturing. If this error occurs on a mobile device, it may be because the user denied screen sharing ERR_SCREEN_CAPTURE_START_FAIL -1308 permission; if it occurs on Windows or macOS, check whether the parameters of the screencapturing API are set as required.

Screencapturing failed. If you use Android, make sure its version is ERR_SCREEN_CAPTURE_UNSURPORT -1309 5.0 or above; if you use iOS, make sure its version is 11.0 or above.

No permission to send ERR_SERVER_CENTER_NO_PRIVILEDGE_PUSH_SUB_VIDEO -102015 substream video images.

ERR_SERVER_CENTER_ANOTHER_USER_PUSH_SUB_VIDEO -102016 Another user is

©2013-2019 Tencent Cloud. All rights reserved. Page 140 of 184 Tencent Real-Time Communication

sending a substream video image.

Screecapturing ERR_SCREEN_CAPTURE_STOPPED -7001 discontinued by the system.

Error codes for encoding and decoding

You can use the callback function TRTCCloudDelegate.OnError() to capture notifications about encoding and decoding errors.

Code Value Description

Failed to encode video frames. This error occurs when, for example, a user on iOS switches to another app, which may cause ERR_VIDEO_ENCODE_FAIL -1303 the system to release the hardware encoder. When the user switches back, this error may be thrown before the hardware encoder is restarted.

PUSH_ERR_UNSUPPORTED_RESOLUTION -1305 Unsupported video resolution.

Failed to encode audio frames. This error occurs when, for example, the SDK could ERR_AUDIO_ENCODE_FAIL -1304 not process the custom audio data passed in.

PUSH_ERR_UNSUPPORTED_SAMPLERATE -1306 Unsupported audio sampling rate.

Error codes for custom capture

You can use the callback function TRTCCloudDelegate.OnError() to capture notifications about custom capture errors.

Code Value Description

ERR_PIXEL_FORMAT_UNSUPPORTED -1327 Unsupported pixel format.

ERR_BUFFER_TYPE_UNSUPPORTED -1328 Unsupported buffer type.

Error codes for CDN binding and stream mixing

©2013-2019 Tencent Cloud. All rights reserved. Page 141 of 184 Tencent Real-Time Communication

You can use the callback functions TRTCCloudDelegate.onStartPublishing() and TRTCCloudDelegate.onSetMixTranscodingConfig() to capture notifications about CDN binding and stream mixing errors.

Code Value Description

Relayed push request timed ERR_PUBLISH_CDN_STREAM_REQUEST_TIME_OUT -3321 out.

On-Cloud MixTranscoding ERR_CLOUD_MIX_TRANSCODING_REQUEST_TIME_OUT -3322 request timed out.

Exceptional packet returning ERR_PUBLISH_CDN_STREAM_SERVER_FAILED -3323 for relayed push.

Exceptional packet returning ERR_CLOUD_MIX_TRANSCODING_SERVER_FAILED -3324 for On-Cloud MixTranscoding.

Signaling of starting to push ERR_ROOM_REQUEST_START_PUBLISHING_TIMEOUT -3333 to Tencent Cloud LVB CDN timed out.

Exceptional signaling of ERR_ROOM_REQUEST_START_PUBLISHING_ERROR -3334 starting to push to Tencent Cloud LVB CDN.

Signaling of stopping pushing ERR_ROOM_REQUEST_STOP_PUBLISHING_TIMEOUT -3335 to Tencent Cloud LVB CDN timed out.

Exceptional signaling of ERR_ROOM_REQUEST_STOP_PUBLISHING_ERROR -3336 stopping pushing to Tencent Cloud LVB CDN.

Error codes for cross-room co-anchoring

TRTCCloud.ConnectOtherRoom() will trigger this type of error codes if cross-room co-anchoring fails. You can use the callback function TRTCCloudDelegate.onConnectOtherRoom() to capture notifications about co-anchoring errors.

Code Value Description

Co-anchoring ERR_ROOM_REQUEST_CONN_ROOM_TIMEOUT -3326 request timed out.

©2013-2019 Tencent Cloud. All rights reserved. Page 142 of 184 Tencent Real-Time Communication

ERR_ROOM_REQUEST_DISCONN_ROOM_TIMEOUT -3327 Request of exiting co- anchoring timed out.

Invalid ERR_ROOM_REQUEST_CONN_ROOM_INVALID_PARAM -3328 parameter.

Current user is in the role of a viewer and cannot initiate or end co- ERR_CONNECT_OTHER_ROOM_AS_AUDIENCE -3330 anchoring. You need to switch to the anchor role ( switchRole() ) first.

Cross-room co- ERR_SERVER_CENTER_CONN_ROOM_NOT_SUPPORT -102031 anchoring not supported.

Reached the upper limit of ERR_SERVER_CENTER_CONN_ROOM_REACH_MAX_NUM -102032 co-anchoring calls.

Reached the upper limit of ERR_SERVER_CENTER_CONN_ROOM_REACH_MAX_RETRY_TIMES -102033 retries for cross-room co- anchoring.

Cross-room co- anchoring ERR_SERVER_CENTER_CONN_ROOM_REQ_TIMEOUT -102034 request timed out.

Incorrect format of ERR_SERVER_CENTER_CONN_ROOM_REQ -102035 cross-room co- anchoring request.

ERR_SERVER_CENTER_CONN_ROOM_NO_SIG -102036 No signature

©2013-2019 Tencent Cloud. All rights reserved. Page 143 of 184 Tencent Real-Time Communication

for cross-room co-anchoring.

Failed to decrypt ERR_SERVER_CENTER_CONN_ROOM_DECRYPT_SIG -102037 signature for cross-room co- anchoring.

Decryption key for cross-room ERR_SERVER_CENTER_CONN_ROOM_NO_KEY -102038 co-anchoring signature not found.

An error occurred when parsing ERR_SERVER_CENTER_CONN_ROOM_PARSE_SIG -102039 signature for cross-room co- anchoring.

Incorrect timestamp of ERR_SERVER_CENTER_CONN_ROOM_INVALID_SIG_TIME -102040 cross-room co- anchoring signature.

Incorrect cross- room co- ERR_SERVER_CENTER_CONN_ROOM_SIG_GROUPID -102041 anchoring signature.

No co- ERR_SERVER_CENTER_CONN_ROOM_NOT_CONNED -102042 anchoring in this room.

The user did ERR_SERVER_CENTER_CONN_ROOM_USER_NOT_CONNED -102043 not initiate co- anchoring.

Failed to start ERR_SERVER_CENTER_CONN_ROOM_FAILED -102044 cross-room co- anchoring.

ERR_SERVER_CENTER_CONN_ROOM_CANCEL_FAILED -102045 Failed to cancel cross-room co-

©2013-2019 Tencent Cloud. All rights reserved. Page 144 of 184 Tencent Real-Time Communication

anchoring.

Room being connected for ERR_SERVER_CENTER_CONN_ROOM_CONNED_ROOM_NOT_EXIST -102046 co-anchoring does not exist.

Reached the upper limit of ERR_SERVER_CENTER_CONN_ROOM_CONNED_REACH_MAX_ROOM -102047 co-anchoring rooms.

User being called for co- ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_NOT_EXIST -102048 anchoring does not exist.

User being called for co- ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_DELETED -102049 anchoring was deleted.

Resources of user being connected for ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_FULL -102050 co-anchoring are fully occupied.

Sequence number for co- ERR_SERVER_CENTER_CONN_ROOM_INVALID_SEQ -102051 anchoring not in sequential order.

Warning Codes

Warning codes do not require your special attention. You can choose whether to prompt the user depending on the situation.

Code Value Description

WARNING_HW_ENCODER_START_FAIL 1103 Failed to start hardware encoder. SDK automatically

©2013-2019 Tencent Cloud. All rights reserved. Page 145 of 184 Tencent Real-Time Communication

switches to software encoder.

Insufficient CPU for software WARNING_VIDEO_ENCODER_SW_TO_HW 1107 encoder. SDK automatically switches to hardware encoder.

Insufficient frame rate of video captured by camera. This error WARNING_INSUFFICIENT_CAPTURE_FPS 1108 may occur on Android devices with built-in beauty filter algorithms.

WARNING_SW_ENCODER_START_FAIL 1109 Failed to start software encoder.

Camera resolution reduced for WARNING_REDUCE_CAPTURE_RESOLUTION 1110 balance between frame rate and performance.

WARNING_CAMERA_DEVICE_EMPTY 1111 No available camera detected.

WARNING_MICROPHONE_DEVICE_EMPTY 1201 No available mic detected.

WARNING_SPEAKER_DEVICE_EMPTY 1202 No available speaker detected.

User denied mic permission to WARNING_MICROPHONE_NOT_AUTHORIZED 1203 app.

No audio capture device WARNING_MICROPHONE_DEVICE_ABNORMAL 1204 available (for example, because the device is occupied).

No audio playback device WARNING_SPEAKER_DEVICE_ABNORMAL 1205 available (for example, because the device is occupied).

Failed to decode current video WARNING_VIDEO_FRAME_DECODE_FAIL 2101 frame.

Failed to decode current audio WARNING_AUDIO_FRAME_DECODE_FAIL 2102 frame.

WARNING_VIDEO_PLAY_LAG 2105 Video playback lag.

Failed to start hardware WARNING_HW_DECODER_START_FAIL 2106 decoder. Software decoder is used instead.

WARNING_VIDEO_DECODER_HW_TO_SW 2108 Failed to decode first I-frame of

©2013-2019 Tencent Cloud. All rights reserved. Page 146 of 184 Tencent Real-Time Communication

current stream by hardware decoder. SDK automatically switches to software decoder.

WARNING_SW_DECODER_START_FAIL 2109 Failed to start software decoder.

WARNING_VIDEO_RENDER_FAIL 2110 Failed to render video.

Video capture already started. WARNING_START_CAPTURE_IGNORED 4000 Request ignored.

Failed to write recorded audio to WARNING_AUDIO_RECORDING_WRITE_FAIL 7001 file.

WARNING_ROOM_DISCONNECT 5101 Network disconnected.

Current user is in the role of a WARNING_IGNORE_UPSTREAM_FOR_AUDIENCE 6001 viewer. Request to send audio/video data ignored.

Bad network connection: data WARNING_NET_BUSY 1101 upload blocked due to limited upstream bandwidth.

Live streaming error. Network WARNING_RTMP_SERVER_RECONNECT 1102 disconnected. Attempting to reconnect (max. attempts: 3).

Live streaming error. Network WARNING_LIVE_STREAM_SERVER_RECONNECT 2103 disconnected. Attempting to reconnect (max. attempts: 3).

Unstable incoming packets. This may be caused by insufficient WARNING_RECV_DATA_LAG 2104 downstream bandwidth or unstable streams from the anchor.

Live streaming error. DNS WARNING_RTMP_DNS_FAIL 3001 resolution failed.

Live streaming error. Server WARNING_RTMP_SEVER_CONN_FAIL 3002 connection failed.

Live streaming error. Handshake WARNING_RTMP_SHAKE_FAIL 3003 with RTMP server failed.

WARNING_RTMP_SERVER_BREAK_CONNECT 3004 Live streaming error. Connection

©2013-2019 Tencent Cloud. All rights reserved. Page 147 of 184 Tencent Real-Time Communication

dropped by server.

Live streaming error. RTMP WARNING_RTMP_READ_WRITE_FAIL 3005 read/write failed. Disconnecting.

Live streaming error. RTMP write failed. This is an internal error WARNING_RTMP_WRITE_FAIL 3006 code of the SDK and is not thrown.

Live streaming error. RTMP read failed. This is an internal error WARNING_RTMP_READ_FAIL 3007 code of the SDK and is not thrown.

Live streaming error. Server WARNING_RTMP_NO_DATA 3008 disconnected as no data is sent for over 30 seconds.

Live streaming error. Failed to call connect to connect to WARNING_PLAY_LIVE_STREAM_INFO_CONNECT_FAIL 3009 server. This is an internal error code of the SDK and is not thrown.

Live streaming error. Connection failed for there was no video in WARNING_NO_STEAM_SOURCE_FAIL 3010 stream address. This is an internal error code of the SDK and is not thrown.

Network disconnected. WARNING_ROOM_RECONNECT 5102 Attempting to reconnect.

Bad network connection: data WARNING_ROOM_NET_BUSY 5103 upload blocked due to limited upstream bandwidth.

©2013-2019 Tencent Cloud. All rights reserved. Page 148 of 184 Tencent Real-Time Communication

Unity Overview

Last updated:2021-06-15 19:41:22

Overview

Basic APIs

API Description

getTRTCShareInstance Creates a TRTCCloud singleton.

destroyTRTCShareInstance Releases a TRTCCloud singleton.

addCallback Sets the callback API TRTCCloudCallback .

removeCallback Removes event callback.

Room APIs

API Description

Enters a room. If the room does not exist, the system will create enterRoom one automatically.

exitRoom Exits a room.

Switches roles. This API works only in live streaming scenarios switchRole ( TRTC_APP_SCENE_LIVE and TRTC_APP_SCENE_VOICE_CHATROOM ).

Sets the audio/video data receiving mode, which must be set setDefaultStreamRecvMode before room entry to take effect.

connectOtherRoom Requests a cross-room call (anchor competition).

disconnectOtherRoom Exits a cross-room call.

switchRoom Switches rooms.

CDN APIs

API Description

©2013-2019 Tencent Cloud. All rights reserved. Page 149 of 184 Tencent Real-Time Communication

API Description

startPublishing Starts pushing to Tencent Cloud’s live streaming CDN.

stopPublishing Stops pushing to Tencent Cloud’s live streaming CDN.

Starts relaying to the live streaming CDN of a non-Tencent Cloud startPublishCDNStream vendor.

stopPublishCDNStream Stops relaying to non-Tencent Cloud addresses.

setMixTranscodingConfig Sets On-Cloud MixTranscoding parameters.

Video APIs

API Description

Enables local video preview (only custom rendering is startLocalPreview supported currently).

stopLocalPreview Stops local video capturing and preview.

muteLocalVideo Pauses/Resumes sending local video data.

Starts pulling and displaying the image of a specified remote startRemoteView user (only custom rendering is supported currently).

stopRemoteView Stops displaying and pulling the video image of a remote user.

Stops displaying and pulling the video images of all remote stopAllRemoteView users.

Pauses/Resumes receiving the video stream of a specified muteRemoteVideoStream remote user.

muteAllRemoteVideoStreams Pauses/Resumes receiving all remote video streams.

setVideoEncoderParam Sets video encoder parameters.

setNetworkQosParam Sets QoS control parameters.

setVideoEncoderMirror Sets the mirror mode of encoded images.

Audio APIs

API Description

©2013-2019 Tencent Cloud. All rights reserved. Page 150 of 184 Tencent Real-Time Communication

API Description

startLocalAudio Enables local audio capturing and upstream data transfer.

stopLocalAudio Disables local audio capturing and upstream data transfer.

muteLocalAudio Mutes/Unmutes local audio.

muteRemoteAudio Mutes/Unmutes a specified remote user.

muteAllRemoteAudio Mutes/Unmutes all remote users.

setRemoteAudioVolume Sets the playback volume of a remote user.

setAudioCaptureVolume Sets the SDK capturing volume.

getAudioCaptureVolume Gets the SDK capturing volume.

setAudioPlayoutVolume Sets the SDK playback volume.

getAudioPlayoutVolume Gets the SDK playback volume.

enableAudioVolumeEvaluation Enables volume reminders.

startAudioRecording Starts audio recording.

stopAudioRecording Stops audio recording.

Device management APIs

API Description

Gets the device management module. For details, please see Specific getDeviceManager 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 getAudioEffectManager voice effects. For details, please see Specific Music and Voice Effect APIs.

Custom video rendering APIs

©2013-2019 Tencent Cloud. All rights reserved. Page 151 of 184 Tencent Real-Time Communication

API Description

setLocalVideoRenderCallback Sets custom rendering for the local video.

setRemoteVideoRenderCallback Sets custom rendering for the video of a remote user.

Custom message sending APIs

API Description

sendSEIMsg 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 startSpeedTest and should be avoided during a video call.

stopSpeedTest Stops server speed testing.

Log APIs

API Description

getSDKVersion Gets the SDK version.

setLogLevel Sets the log output level.

setLogDirPath Changes the path to save logs.

setLogCompressEnabled Enables/Disables local log compression.

callExperimentalAPI Calls the experimental API.

TRTCCloudCallback

Callback APIs for the TRTC audio call feature

Error and warning event callback APIs

API Description

©2013-2019 Tencent Cloud. All rights reserved. Page 152 of 184 Tencent Real-Time Communication

API Description

Error callback. This indicates that the SDK encountered an irrecoverable error. onError 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 onWarning recoverable decoding failure.

Room event callback APIs

API Description

onEnterRoom Callback of room entry

onExitRoom Callback of room exit

onSwitchRole Callback of role switching

Callback of the result of requesting a cross-room call (anchor onConnectOtherRoom competition)

Callback of the result of ending a cross-room call (anchor onDisConnectOtherRoom competition)

onSwitchRoom Callback of the result of room switching ( switchRoom )

User event callback APIs

API Description

onRemoteUserEnterRoom Callback of the entry of a user

onRemoteUserLeaveRoom Callback of the exit of a user

onUserVideoAvailable Callback of whether a user has turned the camera on

onUserAudioAvailable Callback of whether a remote user has playable audio

Callback of rendering the first video frame of the local user or a onFirstVideoFrame remote user

Callback of playing the first audio frame of a remote user. No onFirstAudioFrame notifications are sent for local audio.

onSendFirstLocalVideoFrame Callback of sending the first local video frame

©2013-2019 Tencent Cloud. All rights reserved. Page 153 of 184 Tencent Real-Time Communication

API Description

onSendFirstLocalAudioFrame 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 onNetworkQuality collect statistics on the current upstream and downstream data transfer.

onStatistics Callback of statistics on technical metrics

Server event callback APIs

API Description

onConnectionLost Callback of the disconnection of the SDK from the server

onTryToReconnect Callback of the SDK trying to connect to the server again

onConnectionRecovery Callback of the reconnection of the SDK to the server

Callback of server speed test results. The SDK tests the speed of onSpeedTest multiple server addresses, and the result of each test is returned through this callback.

Hardware event callback APIs

API Description

onCameraDidReady Callback of the camera being ready

onMicDidReady Callback of the mic being ready

Callback of volume, including the volume of each userId and the total onUserVoiceVolume remote volume

onDeviceChange Callback of connecting/disconnecting a local device

Custom message receiving callback APIs

API Description

onRecvSEIMsg Callback of receiving an SEI message

©2013-2019 Tencent Cloud. All rights reserved. Page 154 of 184 Tencent Real-Time Communication

Callback APIs for CDN relayed push

API Description

Callback of starting to push to Tencent Cloud’s live streaming onStartPublishing CDN, which corresponds to the startPublishing() API in TRTCCloud

Callback of stopping pushing to Tencent Cloud’s live streaming onStopPublishing CDN, which corresponds to the stopPublishing() API in TRTCCloud

onStartPublishCDNStream Callback of the completion of starting relayed push to CDNs

onStopPublishCDNStream Callback of the completion of stopping relayed push to CDNs

Sets On-Cloud MixTranscoding parameters, which corresponds to onSetMixTranscodingConfig the setMixTranscodingConfig() API in TRTCCloud

Definitions of Key Classes

Class Description

TRTCParams Room entry parameters

TRTCVideoEncParam Video encoding parameters

TRTCTranscodingConfig On-Cloud MixTranscoding configuration

TRTCSwitchRoomConfig Room switching parameters

TRTCNetworkQosParam QoS control parameters

TXVoiceReverbType Reverb effects (karaoke, room, hall, low and deep, resonant, etc.)

AudioMusicParam Parameters for music and voice effect setting APIs

TRTCAudioRecordingParams Audio recording parameters

Specific Device Management APIs

API Description

©2013-2019 Tencent Cloud. All rights reserved. Page 155 of 184 Tencent Real-Time Communication

API Description

isFrontCamera Gets whether the front camera is being used.

switchCamera Switches cameras.

getCameraZoomMaxRatio Gets the maximum zoom level of the current camera.

setCameraZoomRatio Sets the zoom level of the current camera.

isAutoFocusEnabled Gets whether automatic facial recognition is supported.

enableCameraAutoFocus Enables/Disables automatic facial recognition.

setCameraFocusPosition Sets camera focus.

enableCameraTorch Enables/Disables flash.

setSystemVolumeType Sets the system volume type to use during calls.

setAudioRoute Sets the audio route.

Specific Music and Voice Effect APIs

API Description

Sets the voice change effects (karaoke, room, hall, low and deep, setVoiceReverbType resonant, etc.)

setMusicObserver Sets the callback of the playback progress of background music.

startPlayMusic Starts playing background music.

stopPlayMusic Stops playing background music.

pausePlayMusic Pauses background music.

resumePlayMusic Resumes playing background music.

Sets the remote playback volume of background music, i.e., the setMusicPublishVolume volume heard by remote users.

setMusicPlayoutVolume Sets the local playback volume of background music.

setAllMusicVolume Sets the local and remote playback volume of background music.

©2013-2019 Tencent Cloud. All rights reserved. Page 156 of 184 Tencent Real-Time Communication

API Description

setMusicPitch Changes the pitch of background music.

setMusicSpeedRate Changes the playback speed of background music.

getMusicCurrentPosInMS Gets the playback progress (ms) of background music.

seekMusicToPosInMS Sets the playback progress (ms) of background music.

getMusicDurationInMS Gets the length (ms) of the background music file.

©2013-2019 Tencent Cloud. All rights reserved. Page 157 of 184 Tencent Real-Time Communication

Error Codes

Last updated:2021-05-20 16:24:30

Error Codes

Basic error codes

Code Value Description

ERR_NULL 0 No error.

Error codes for room entry

TRTCCloud.enterRoom() triggers this type of error codes if room entry fails. You can use the callback APIs TRTCCloudDelegate.onEnterRoom() and TRTCCloudDelegate.OnError() to capture notifications about room entry errors.

Code Value Description

ERR_ROOM_ENTER_FAIL -3301 Failed to enter room.

Empty room entry parameters. Please check whether valid ERR_ENTER_ROOM_PARAM_NULL -3316 parameters are passed in the TRTCCloud.enterRoom(): API when it is called.

ERR_SDK_APPID_INVALID -3317 Incorrect sdkAppId value.

ERR_ROOM_ID_INVALID -3318 Incorrect roomId value.

ERR_USER_ID_INVALID -3319 Incorrect userID value.

ERR_USER_SIG_INVALID -3320 Incorrect userSig value.

Room entry request timed out. ERR_ROOM_REQUEST_ENTER_ROOM_TIMEOUT -3308 Please check your network.

Service unavailable. Please check ERR_SERVER_INFO_SERVICE_SUSPENDED -100013 whether your Tencent Cloud account has overdue payment.

Error code for room exit

©2013-2019 Tencent Cloud. All rights reserved. Page 158 of 184 Tencent Real-Time Communication

TRTCCloud.exitRoom() triggers this error code if room exit fails. You can use the callback API TRTCCloudDelegate.OnError() to capture notifications about the error.

Code Value Description

ERR_ROOM_REQUEST_QUIT_ROOM_TIMEOUT -3325 Room exit request timed out.

Error codes for devices (camera, mic, and speaker)

You can use the callback API TRTCCloudDelegate.OnError() to capture notifications about device errors.

Code Value Description

Failed to turn camera on. This error occurs when, for example, there is a problem with the camera configuration program (driver) on Windows or ERR_CAMERA_START_FAIL -1301 macOS. In this case, turn the camera off and on again, restart the camera, or update the configuration program.

Camera not authorized. This error usually occurs ERR_CAMERA_NOT_AUTHORIZED -1314 on mobile devices and may be because users denied camera permission.

Incorrect camera parameter settings (unsupported ERR_CAMERA_SET_PARAM_FAIL -1315 values or others).

ERR_CAMERA_OCCUPY -1316 Camera occupied. Try using another camera.

Failed to turn mic on. This error occurs when, for example, there is a problem with the mic configuration program (driver) on Windows or ERR_MIC_START_FAIL -1302 macOS. In this case, turn the mic off and on again, restart the mic, or update the configuration program.

Mic not authorized. This error usually occurs on ERR_MIC_NOT_AUTHORIZED -1317 mobile devices and may be because users denied mic permission.

ERR_MIC_SET_PARAM_FAIL -1318 Failed to set mic parameters.

Mic occupied. This error occurs when, for example, ERR_MIC_OCCUPY -1319 the user is in a call on the mobile device, in which case TRTC will fail to turn the mic on.

©2013-2019 Tencent Cloud. All rights reserved. Page 159 of 184 Tencent Real-Time Communication

Code Value Description

ERR_MIC_STOP_FAIL -1320 Failed to turn the mic off.

Failed to turn speaker on. This error occurs when, for example, there is a problem with the speaker configuration program (driver) on Windows or ERR_SPEAKER_START_FAIL -1321 macOS. In this case, turn the speaker off and on again, restart the speaker, or update the configuration program.

ERR_SPEAKER_SET_PARAM_FAIL -1322 Failed to set speaker parameters.

ERR_SPEAKER_STOP_FAIL -1323 Failed to turn speaker off.

Error codes for screen sharing

You can use the callback API TRTCCloudDelegate.OnError() to capture notifications about screen sharing errors.

Code Value Description

Failed to start screencapturing. If this error occurs on a mobile device, it may be because the user denied screen sharing ERR_SCREEN_CAPTURE_START_FAIL -1308 permission; if it occurs on Windows or macOS, check whether the parameters of the screencapturing API are set as required.

Screencapturing failed. If you use Android, make sure its version is ERR_SCREEN_CAPTURE_UNSURPORT -1309 5.0 or above; if you use iOS, make sure its version is 11.0 or above.

©2013-2019 Tencent Cloud. All rights reserved. Page 160 of 184 Tencent Real-Time Communication

Code Value Description

No permission to send ERR_SERVER_CENTER_NO_PRIVILEDGE_PUSH_SUB_VIDEO -102015 substream video images.

Another user is ERR_SERVER_CENTER_ANOTHER_USER_PUSH_SUB_VIDEO -102016 sending substream video images.

Screencapturing ERR_SCREEN_CAPTURE_STOPPED -7001 stopped by the system.

Error codes for encoding and decoding

You can use the callback API TRTCCloudDelegate.OnError() to capture notifications about encoding and decoding errors.

Code Value Description

Failed to encode video frames. This error occurs when, for example, a user on iOS switches to another app, which may cause ERR_VIDEO_ENCODE_FAIL -1303 the system to release the hardware encoder. When the user switches back, this error may be thrown before the hardware encoder is restarted.

PUSH_ERR_UNSUPPORTED_RESOLUTION -1305 Unsupported video resolution.

Failed to encode audio frames. This error occurs when, for example, the SDK could ERR_AUDIO_ENCODE_FAIL -1304 not process the custom audio data passed in.

PUSH_ERR_UNSUPPORTED_SAMPLERATE -1306 Unsupported audio sample rate.

Error codes for custom capturing

You can use the callback API TRTCCloudDelegate.OnError() to capture notifications about custom capturing errors.

Code Value Description

ERR_PIXEL_FORMAT_UNSUPPORTED -1327 Unsupported pixel format.

©2013-2019 Tencent Cloud. All rights reserved. Page 161 of 184 Tencent Real-Time Communication

Code Value Description

ERR_BUFFER_TYPE_UNSUPPORTED -1328 Unsupported buffer type.

Error codes for CDN binding and stream mixing

You can use the callback APIs TRTCCloudDelegate.onStartPublishing() and TRTCCloudDelegate.onSetMixTranscodingConfig() to capture notifications about CDN binding and stream mixing errors.

Code Value Description

Relayed push request timed ERR_PUBLISH_CDN_STREAM_REQUEST_TIME_OUT -3321 out.

On-Cloud MixTranscoding ERR_CLOUD_MIX_TRANSCODING_REQUEST_TIME_OUT -3322 request timed out.

Abnormal response packets ERR_PUBLISH_CDN_STREAM_SERVER_FAILED -3323 for relayed push.

Abnormal response packets ERR_CLOUD_MIX_TRANSCODING_SERVER_FAILED -3324 for On-Cloud MixTranscoding.

Signaling of starting to push ERR_ROOM_REQUEST_START_PUBLISHING_TIMEOUT -3333 to Tencent Cloud’s live streaming CDN timed out.

Abnormal signaling of ERR_ROOM_REQUEST_START_PUBLISHING_ERROR -3334 starting to push to Tencent Cloud’s live streaming CDN.

Signaling of stopping pushing ERR_ROOM_REQUEST_STOP_PUBLISHING_TIMEOUT -3335 to Tencent Cloud’s live streaming CDN timed out.

Abnormal signaling of ERR_ROOM_REQUEST_STOP_PUBLISHING_ERROR -3336 stopping pushing to Tencent Cloud’s live streaming CDN.

Error codes for cross-room co-anchoring

TRTCCloud.ConnectOtherRoom() triggers this type of error codes if cross-room co-anchoring fails. You can use the callback API TRTCCloudDelegate.onConnectOtherRoom() to capture notifications about co- anchoring errors.

©2013-2019 Tencent Cloud. All rights reserved. Page 162 of 184 Tencent Real-Time Communication

Code Value Description

Co-anchoring ERR_ROOM_REQUEST_CONN_ROOM_TIMEOUT -3326 request timed out.

Request of exiting co- ERR_ROOM_REQUEST_DISCONN_ROOM_TIMEOUT -3327 anchoring timed out.

Invalid ERR_ROOM_REQUEST_CONN_ROOM_INVALID_PARAM -3328 parameter.

You are in the role of audience and cannot initiate or end co- ERR_CONNECT_OTHER_ROOM_AS_AUDIENCE -3330 anchoring. You need to switch to the anchor role using switchRole() .

Cross-room co- ERR_SERVER_CENTER_CONN_ROOM_NOT_SUPPORT -102031 anchoring not supported.

Reached the upper limit of ERR_SERVER_CENTER_CONN_ROOM_REACH_MAX_NUM -102032 co-anchoring calls.

Reached the upper limit of ERR_SERVER_CENTER_CONN_ROOM_REACH_MAX_RETRY_TIMES -102033 retries for cross-room co- anchoring.

Cross-room co- anchoring ERR_SERVER_CENTER_CONN_ROOM_REQ_TIMEOUT -102034 request timed out.

©2013-2019 Tencent Cloud. All rights reserved. Page 163 of 184 Tencent Real-Time Communication

Code Value Description

Incorrect format of ERR_SERVER_CENTER_CONN_ROOM_REQ -102035 cross-room co- anchoring request.

No signature ERR_SERVER_CENTER_CONN_ROOM_NO_SIG -102036 for cross-room co-anchoring.

Failed to decrypt ERR_SERVER_CENTER_CONN_ROOM_DECRYPT_SIG -102037 signature for cross-room co- anchoring.

Decryption key for cross-room ERR_SERVER_CENTER_CONN_ROOM_NO_KEY -102038 co-anchoring signature not found.

Signature parsing error ERR_SERVER_CENTER_CONN_ROOM_PARSE_SIG -102039 for cross-room co-anchoring.

Incorrect timestamp of ERR_SERVER_CENTER_CONN_ROOM_INVALID_SIG_TIME -102040 cross-room co- anchoring signature.

Incorrect cross-room co- ERR_SERVER_CENTER_CONN_ROOM_SIG_GROUPID -102041 anchoring signature.

No co- ERR_SERVER_CENTER_CONN_ROOM_NOT_CONNED -102042 anchoring in this room.

©2013-2019 Tencent Cloud. All rights reserved. Page 164 of 184 Tencent Real-Time Communication

Code Value Description

The user did ERR_SERVER_CENTER_CONN_ROOM_USER_NOT_CONNED -102043 not initiate co- anchoring.

Failed to start ERR_SERVER_CENTER_CONN_ROOM_FAILED -102044 cross-room co- anchoring.

Failed to cancel cross- ERR_SERVER_CENTER_CONN_ROOM_CANCEL_FAILED -102045 room co- anchoring.

Room being connected for ERR_SERVER_CENTER_CONN_ROOM_CONNED_ROOM_NOT_EXIST -102046 co-anchoring does not exist.

Reached the upper limit of ERR_SERVER_CENTER_CONN_ROOM_CONNED_REACH_MAX_ROOM -102047 co-anchoring rooms.

The user being called for co- ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_NOT_EXIST -102048 anchoring does not exist.

The user being called for co- ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_DELETED -102049 anchoring was deleted.

All resources of the user being called ERR_SERVER_CENTER_CONN_ROOM_CONNED_USER_FULL -102050 for co- anchoring are occupied.

©2013-2019 Tencent Cloud. All rights reserved. Page 165 of 184 Tencent Real-Time Communication

Code Value Description

Sequence number for co- ERR_SERVER_CENTER_CONN_ROOM_INVALID_SEQ -102051 anchoring not in sequential order.

Warning Codes

Warning codes do not require your special attention. You can choose whether to prompt the user depending on the situation.

Code Value Description

Failed to start hardware WARNING_HW_ENCODER_START_FAIL 1103 encoder. The SDK automatically switched to software encoder.

Insufficient CPU for software WARNING_VIDEO_ENCODER_SW_TO_HW 1107 encoder. The SDK automatically switched to hardware encoder.

Insufficient frame rate of video captured by camera. This error WARNING_INSUFFICIENT_CAPTURE_FPS 1108 may occur on Android devices with built-in beauty filter algorithms.

WARNING_SW_ENCODER_START_FAIL 1109 Failed to start software encoder.

Camera resolution reduced for WARNING_REDUCE_CAPTURE_RESOLUTION 1110 balance between frame rate and performance.

WARNING_CAMERA_DEVICE_EMPTY 1111 No camera detected.

User did not grant the WARNING_CAMERA_NOT_AUTHORIZED 1112 application camera access.

WARNING_MICROPHONE_DEVICE_EMPTY 1201 No mic detected.

WARNING_SPEAKER_DEVICE_EMPTY 1202 No speaker detected.

©2013-2019 Tencent Cloud. All rights reserved. Page 166 of 184 Tencent Real-Time Communication

Code Value Description

User did not grant the WARNING_MICROPHONE_NOT_AUTHORIZED 1203 application mic access.

No audio capturing device WARNING_MICROPHONE_DEVICE_ABNORMAL 1204 available (for example, because the device is occupied).

No audio playback device WARNING_SPEAKER_DEVICE_ABNORMAL 1205 available (for example, because the device is occupied).

Failed to decode current video WARNING_VIDEO_FRAME_DECODE_FAIL 2101 frame.

Failed to decode current audio WARNING_AUDIO_FRAME_DECODE_FAIL 2102 frame.

WARNING_VIDEO_PLAY_LAG 2105 Video playback lag.

Failed to start hardware WARNING_HW_DECODER_START_FAIL 2106 decoder. Software decoder is used instead.

Hardware decoder failed to decode first I-frame of current WARNING_VIDEO_DECODER_HW_TO_SW 2108 stream. The SDK automatically switched to software decoder.

WARNING_SW_DECODER_START_FAIL 2109 Failed to start software decoder.

WARNING_VIDEO_RENDER_FAIL 2110 Failed to render video.

Video capturing already started. WARNING_START_CAPTURE_IGNORED 4000 Request ignored.

Failed to write recorded audio to WARNING_AUDIO_RECORDING_WRITE_FAIL 7001 file.

WARNING_ROOM_DISCONNECT 5101 Network disconnected.

You are in the role of audience. WARNING_IGNORE_UPSTREAM_FOR_AUDIENCE 6001 The request to send audio/video data is ignored.

©2013-2019 Tencent Cloud. All rights reserved. Page 167 of 184 Tencent Real-Time Communication

Code Value Description

Bad network connection: data WARNING_NET_BUSY 1101 upload blocked due to limited upstream bandwidth.

Push error. The network is WARNING_RTMP_SERVER_RECONNECT 1102 disconnected and trying to reconnect (max. attempts: 3).

Pull error. The network is WARNING_LIVE_STREAM_SERVER_RECONNECT 2103 disconnected and trying to reconnect (max. attempts: 3).

Unstable incoming packets. This may be caused by insufficient WARNING_RECV_DATA_LAG 2104 downstream bandwidth or unstable streams from the anchor.

Live streaming error. DNS WARNING_RTMP_DNS_FAIL 3001 resolution failed.

Live streaming error. Server WARNING_RTMP_SEVER_CONN_FAIL 3002 connection failed.

Live streaming error. Handshake WARNING_RTMP_SHAKE_FAIL 3003 with RTMP server failed.

Live streaming error. Connection WARNING_RTMP_SERVER_BREAK_CONNECT 3004 dropped by server.

Live streaming error. RTMP WARNING_RTMP_READ_WRITE_FAIL 3005 read/write failed. Disconnecting.

Live streaming error. RTMP write failed. This is an internal error WARNING_RTMP_WRITE_FAIL 3006 code of the SDK and is not thrown.

Live streaming error. RTMP read failed. This is an internal error WARNING_RTMP_READ_FAIL 3007 code of the SDK and is not thrown.

©2013-2019 Tencent Cloud. All rights reserved. Page 168 of 184 Tencent Real-Time Communication

Code Value Description

Live streaming error. Server WARNING_RTMP_NO_DATA 3008 disconnected as no data is sent for over 30 seconds.

Live streaming error. Failed to call connect to connect to WARNING_PLAY_LIVE_STREAM_INFO_CONNECT_FAIL 3009 server. This is an internal error code of the SDK and is not thrown.

Live streaming error. Connection failed as there was no video in WARNING_NO_STEAM_SOURCE_FAIL 3010 the stream address. This is an internal error code of the SDK and is not thrown.

Network disconnected. WARNING_ROOM_RECONNECT 5102 Reconnecting.

Bad network connection: data WARNING_ROOM_NET_BUSY 5103 upload blocked due to limited upstream bandwidth.

©2013-2019 Tencent Cloud. All rights reserved. Page 169 of 184 Tencent Real-Time Communication

Desktop Browser Overview

Last updated:2021-04-14 19:00:19

Supported Platforms

Proposed by Google, the WebRTC technology is well supported by Chrome (desktop), Edge (desktop), Firefox (desktop), and Safari (desktop and mobile), but poorly or not supported by other platforms such as browsers on Android.

If your application scenario is mainly in the education sector, consider using TRTC SDK for Electron, which supports two-channel big/small video images, with more flexible screen sharing schemes and better recovery capabilities on poor network connections.

Minimum Browser Receive Send Screen SDK Version OS Browser Version (Playback) (Broadcast) Sharing Requiremen Requirement

Supported Safari 11+ Supported Supported (on Safari - (desktop) 13+)

Supported Chrome (on 56+ Supported Supported - (desktop) Chrome 72+) macOS

Supported Firefox (on 56+ Supported Supported 4.7.0+ (desktop) Firefox 66+)

Edge 80+ Supported Supported Supported 4.7.0+ (desktop)

Windows Supported Chrome (on 56+ Supported Supported - (desktop) Chrome 72+)

©2013-2019 Tencent Cloud. All rights reserved. Page 170 of 184 Tencent Real-Time Communication

QQ 10.4+ Supported Supported Not - browser supported (desktop, WebKit core)

Supported Firefox (on 56+ Supported Supported 4.7.0+ (desktop) Firefox 66+)

Edge 80+ Supported Supported Supported 4.7.0+ (desktop)

iOS Safari Not 11+ Supported Supported - 11.1.2+ (mobile) supported

WeChat iOS Not Not embedded - Supported - 12.1.4+ supported supported browser

WeChat iOS WeChat Not embedded Supported Supported - 14.3+ 6.5+ supported browser

QQ Not Not Not browser - - supported supported supported (mobile)

UC Not Not Not browser - - supported supported supported (mobile)

WeChat Android embedded Not - Supported Supported - browser supported (TBS core)

WeChat embedded Not browser - Supported Supported - supported (XWEB core)

API Guide

©2013-2019 Tencent Cloud. All rights reserved. Page 171 of 184 Tencent Real-Time Communication

The tutorials below offer detailed instructions on how to use different APIs.

Feature Sample Code

Basic audio/video call Tutorial

Interactive live streaming Tutorial

Switching cameras/mics Tutorial

Setting local video attributes Tutorial

Dynamically enabling/disabling local audio/video Tutorial

Sharing screen Tutorial

Detecting volume Tutorial

Custom capturing and playback rendering Tutorial

Specifying the maximum number of upstream users in a room Tutorial

Adding music and audio effects Tutorial

TRTC

Note:

This document applies to 4.x.x versions of TRTC SDK for desktop browsers.

TRTC is the main entry to TRTC SDK for desktop browsers. You can use TRTC methods to create a client object ( Client ) and local audio/video stream object ( Stream ) for real-time communication, check a browser's compatibility and whether it supports screen sharing, as well as set log levels and upload logs.

API Description

VERSION Gets the version number of TRTC SDK for desktop browsers.

Checks whether a browser supports TRTC SDK for desktop checkSystemRequirements browsers; if not, ask users to download the latest version of Chrome.

isScreenShareSupported Checks whether the browser supports screen sharing. Call this

©2013-2019 Tencent Cloud. All rights reserved. Page 172 of 184 Tencent Real-Time Communication

method before creating a screen sharing stream.

getDevices Returns the list of media input/output devices.

getCameras Returns the list of cameras.

getMicrophones Returns the list of mics.

getSpeakers Returns the list of speakers.

Creates a client object for real-time audio/video calls. This method createClient needs to be called only once for each call.

Creates a local Stream object, which uses the publish() method createStream to publish local audio/video stream.

TRTC.Logger

TRTC.Logger provides methods for log settings such as log output level setting and log upload enabling/disabling.

API Description

setLogLevel Sets the log output level.

enableUploadLog Enables log upload.

disableUploadLog Disables log upload.

Client

The audio/video call client object Client is created through createClient() and represents an audio/video call.

API Description

Sets proxy servers. This method is suitable where you deploy proxy setProxyServer servers, e.g., Nginx + Coturn, by yourself.

Sets TURN servers. This method is used along with setProxyServer() setTurnServer and is suitable where you deploy proxy and TURN servers by yourself.

join Enters a room, which starts an audio/video call. If the room does not

©2013-2019 Tencent Cloud. All rights reserved. Page 173 of 184 Tencent Real-Time Communication

exist, the system will create one.

leave Exits the current room, which ends the current audio/video call.

Publishes local audio/video stream. This method can be called only publish after room entry using the join() method. Only one local stream can be published in one audio/video call.

unpublish Unpublishes local stream.

subscribe Subscribes to a remote stream.

unsubscribe Unsubscribes from a remote stream.

Switches user roles. This method works only in the interactive live switchRole streaming mode ( live ).

on Listens for client object events.

Gets the list of the audio/video mute status of remote users in the getRemoteMutedState current room.

Gets audio statistics of published local streams. This method can be getLocalAudioStats used only after publish() is called.

Gets video statistics of published local streams. This method can be getLocalVideoStats used only after publish() is called.

getRemoteAudioStats Gets audio statistics of all current remote streams.

getRemoteVideoStats Gets video statistics of all current remote streams.

LocalStream

LocalStream (local audio/video stream) is created through createStream and is a subclass of Stream.

API Description

initialize Initializes local audio/video stream objects.

Sets audio profiles. This method can be used only before initialize() is setAudioProfile called.

Sets video profiles. This method can be used only before initialize() setVideoProfile is called.

©2013-2019 Tencent Cloud. All rights reserved. Page 174 of 184 Tencent Real-Time Communication

setScreenProfile Sets screen sharing profiles. This method can be used only before initialize() is called.

Sets video content hints, mainly in order to improve the video encoding setVideoContentHint quality in different scenarios. This method can be used only after initialize() is called.

switchDevice Switches media input devices.

addTrack Adds an audio or video track.

removeTrack Removes the video track.

replaceTrack Replaces audio or video track.

play Starts playing audio/video stream.

stop Stops playing audio/video stream.

resume Resumes playing audio/video stream.

close Closes audio/video stream.

muteAudio Disables the audio track.

muteVideo Disables the video track.

unmuteAudio Enables the audio track.

unmuteVideo Enables the video track.

getId Gets the unique stream ID.

getUserId Gets the ID of the user to whom the stream belongs.

setAudioOutput Sets the audio output device.

Gets the current audio level. This method works only if there is audio getAudioLevel data in local or remote stream.

hasAudio Specifies whether there is an audio track.

hasVideo Specifies whether there is a video track.

getAudioTrack Gets the audio track.

getVideoTrack Gets the video track.

getVideoFrame Gets the current video frame.

©2013-2019 Tencent Cloud. All rights reserved. Page 175 of 184 Tencent Real-Time Communication

on Listens for stream events.

RemoteStream

Remote audio/video stream, which is obtained by listening for the Client.on('stream-added') event and is a subclass of [Stream]() .

API Description

Gets the remote stream type. This method is mainly used to determine getType whether a remote stream is a primary audio/video stream or secondary video stream (which is usually a screen sharing stream).

play Starts playing audio/video stream.

stop Stops playing audio/video stream.

resume Resumes playing audio/video stream.

close Closes audio/video stream.

muteAudio Disables the audio track.

muteVideo Disables the video track.

unmuteAudio Enables the audio track.

unmuteVideo Enables the video track.

getId Gets the unique stream ID.

getUserId Gets the ID of the user to whom the stream belongs.

setAudioOutput Sets the audio output device.

setAudioVolume Sets the audio level.

Gets the current audio level. This method works only if there is audio data in getAudioLevel local or remote stream.

hasAudio Specifies whether there is an audio track.

hasVideo Specifies whether there is a video track.

getAudioTrack Gets the audio track.

getVideoTrack Gets the video track.

©2013-2019 Tencent Cloud. All rights reserved. Page 176 of 184 Tencent Real-Time Communication

getVideoFrame Gets the current video frame.

on Listens for stream events.

RtcError

RtcError object.

API Description

getCode Gets the error code.

©2013-2019 Tencent Cloud. All rights reserved. Page 177 of 184 Tencent Real-Time Communication

Error Codes

Last updated:2020-09-01 12:11:30

Note:

This document applies to TRTC SDK for Desktop Browser v4.x.x.

Error Code Definitions

Error Key getCode Description Code

INVALID_PARAMETER 4096 0x1000 Invalid parameter

INVALID_OPERATION 4097 0x1001 Invalid operation

Failed to establish the signaling SIGNAL_CAHNNEL_SETUP_FAILED 16385 0x4001 channel

SIGNAL_CHANNEL_ERROR 16386 0x4002 Error with the signaling channel

Error with the ICE transport ICE_TRANSPORT_ERROR 16387 0x4003 connection

JOIN_ROOM_FAILED 16388 0x4004 Failed to enter the room

CREATE_OFFER_FAILED 16389 0x4005 Failed to create an SDP offer

The user was kicked out of the CLIENT_BANNED 16448 0x4040 room

Media transmission service timed SERVER_TIMEOUT 16449 0x4041 out

Remote stream subscription timed SUBSCRIPTION_TIMEOUT 16450 0x4042 out

UNKOWN 65535 0xFFFF Unknown error

Account Error Messages

©2013-2019 Tencent Cloud. All rights reserved. Page 178 of 184 Tencent Real-Time Communication

Error Type Description Code

userSig has expired. Please try to generate a signature again. If the Account 70001 signature expires immediately after generation, please check whether the system validity period is too short or entered as 0 mistakenly

The length of userSig is 0. Please check whether the signature is Account correctly calculated. Access sign_src to get the plain source code for 70002 system signature calculation and verify the parameters to make sure that the signature is correctly calculated

Account userSig verification failed. Please check whether the content of userSig 70003 system has been truncated for reasons such as insufficient buffer length

Account userSig verification failed. Please check whether the content of userSig 70004 system has been truncated for reasons such as insufficient buffer length

Account userSig verification failed. Please use a tool to check whether the 70005 system generated userSig is correct

Account userSig verification failed. Please use a tool to check whether the 70006 system generated userSig is correct

Account userSig verification failed. Please use a tool to check whether the 70007 system generated userSig is correct

Account userSig verification failed. Please use a tool to check whether the 70008 system generated userSig is correct

Failed to verify userSig by using the business public key. Please check Account 70009 whether the private key used by the generated userSig matches system sdkAppId

Account userSig verification failed. Please use a tool to check whether the 70010 system generated userSig is correct

Account userId in userSig is different from that in the request. Please check 70013 system whether the userId set in login is the same as that in userSig

Account sdkAppId in userSig is different from that in the request. Please check 70014 system whether the sdkAppId set in login is the same as that in userSig

Account The verification method for this sdkAppId and account type was not 70015 system found. Please check whether account integration has been performed

70016 Account The length of the pulled public key is 0. Please check whether the public system key has been uploaded. If the public key was just uploaded again, please

©2013-2019 Tencent Cloud. All rights reserved. Page 179 of 184 Tencent Real-Time Communication

try again in 10 minutes

Internal verification of third-party credential timed out. Please try again. If Account 70017 the problem persists, please contact TLS account support over QQ at system 3268519604

Account 70018 Internal verification of third-party credential failed system

Account The credential field is empty for HTTPS-based verification. Please correctly 70019 system set userSig

Account sdkAppId was not found. Please check whether this parameter has been 70020 system configured in Tencent Cloud

Account 70052 Invalid userSig . Please generate a new one and try again system

Account 70101 Empty request packet system

Account 70102 Incorrect request packet account type system

Account 70103 Incorrect phone number format system

Account 70104 Incorrect email address format system

Account 70105 Incorrect TLS account format system

Account 70106 Invalid account format type system

Account 70107 userId was not registered system

Account 70113 Invalid quantity for batch operation system

Account 70114 Restricted for security reasons system

Account 70115 The uin is not the one of the developer of the corresponding sdkAppId system

©2013-2019 Tencent Cloud. All rights reserved. Page 180 of 184 Tencent Real-Time Communication

70140 Account sdkAppId does not match acctype system

Account 70145 Incorrect account type system

Account Internal error. Please try again. If the problem persists, please contact TLS 70169 system account support over QQ at 3268519604

Account Internal error. Please try again. If the problem persists, please contact TLS 70201 system account support over QQ at 3268519604

Account Internal error. Please try again. If the problem persists, please contact TLS 70202 system account support over QQ at 3268519604

Account Internal error. Please try again. If the problem persists, please contact TLS 70203 system account support over QQ at 3268519604

Account 70204 sdkAppId has no matching acctype system

Account 70205 Failed to find acctype . Please try again system

Account 70206 Invalid quantity for batch operation in the request system

Account 70207 Internal error. Please try again system

Account 70208 Internal error. Please try again system

Account 70209 Failed to get the developer's uin system

Account 70210 The uin in the request is not the one of the developer system

Account 70211 Invalid uin in the request system

Account Internal error. Please try again. If the problem persists, please contact TLS 70212 system account support over QQ at 3268519604

Account Failed to access internal data. Please try again. If the problem persists, 70213 system please contact TLS account support over QQ at 3268519604

©2013-2019 Tencent Cloud. All rights reserved. Page 181 of 184 Tencent Real-Time Communication

70214 Account Internal credential verification failed system

Account 70221 Invalid login status. Please use UserSig to authenticate again system

Account 70222 Internal error. Please try again system

Account Internal error. Please try again. If the problem persists, please contact TLS 70225 system account support over QQ at 3268519604

Account Internal error. Please try again. If the problem persists, please contact TLS 70231 system account support over QQ at 3268519604

Account 70236 user signature verification failed system

Account Internal error. Please try again. If the problem persists, please contact TLS 70308 system account support over QQ at 3268519604

Account 70346 Credential verification failed system

Account 70347 Credential verification failed due to expiration system

Account Internal error. Please try again. If the problem persists, please contact TLS 70348 system account support over QQ at 3268519604

Account Internal timeout. Please try again. If the problem persists, please contact 70362 system TLS account support over QQ at 3268519604

Account 70401 Internal error. Please try again system

Account Invalid parameter. Please check whether the required fields are all set and 70402 system parameter settings meet the requirements

Account The initiator of this operation is not the application admin and does not 70403 system have the permission

This account is temporarily prohibited from login due to excessive login Account 70050 failures and retries. Please check whether the credential is correct and system retry after 1 minute

Account Blocked account. Please contact TLS account support over QQ at 70051 system 3268519604

©2013-2019 Tencent Cloud. All rights reserved. Page 182 of 184 Tencent Real-Time Communication

Common Errors and Solutions

If an error in this type is reported, the application needs to intervene. For example, if the camera access is denied, the application needs to ask the user to grant the camera access before they can make audio and video calls.

Error Message Reason Solution

Please try to refresh and reconnect and publish timeout publish timed out then perform publish() again

join room timeout Room entry timed out Please refresh the page and enter again

DTLS Transport DTLS connection timed connection timeout Please try to refresh and reconnect out (10s)

failed to connect to WebSocket connection remote server via Please try to refresh and reconnect failed websocket

ICE/DTLS Transport Media transport tunnel Please check the firewall configuration connection failed creation failed

previous publishing Already in publishing Please avoid performing publish() again is ongoing, please status after publish avoid re-publishing

The device could not be Please check the device before making AbortError used for an unknown the call device/system reason

The device was Please process in response to the error inaccessible due to an reported by the browser and prompt the error in a certain NotReadableError user that "Please make sure that no other hardware device, applications are requesting access to the browser, or webpage on camera/mic and try again" the operating system

Unable to find the media type that satisfies the Please check the device before making NotFoundError request parameters, the call such as audio, video, and screen sharing

NotAllowedError The user has rejected the Please inform the user that it is impossible

©2013-2019 Tencent Cloud. All rights reserved. Page 183 of 184 Tencent Real-Time Communication

request to access audio, to make video or voice calls without video, or screen sharing camera/mic access made by the current browser instance

SignalChannel WebSocket disconnected Please try to refresh and reconnect reconnect failed

duplicate publishing, Please perform unpublish() before please unpublish and Repeated publish publish() then re-publish

The browser could not Please make sure that the value of OverconstrainedError get the cameraId / cameraId / microphoneId is a valid non- microphoneId empty string

The TRTC SDK for Web RtcError: no valid ice failed during STUN hole Please check the firewall configuration candidate found punching

Please log in to the TRTC Console, click Account service status the application you created, and click 10006 error error Account Info to view the service status in the account info tab

-100018 get tinyid Please check whether the entered userSig error error userSig is correct

©2013-2019 Tencent Cloud. All rights reserved. Page 184 of 184