Options
All
  • Public
  • Public/Protected
  • All
Menu
  • Key class definition variable

Hierarchy

  • TRTCCloudDef

Index

Constructors

Properties

Constructors

Properties

TRTCAudioSampleRate16000: number = 16000
  • @name 3.1 Audio sample rate
  • Audio sample rate is an indicator of audio fidelity. A higher sample rate indicates higher fidelity. If your application scenario involves music, we recommend that you use TRTCAudioSampleRate48000.
  • 16 kHz sample rate
TRTCAudioSampleRate32000: number = 32000
  • 32 kHz sample rate
TRTCAudioSampleRate44100: number = 44100
  • 44.1 kHz sample rate
TRTCAudioSampleRate48000: number = 48000
  • 48 kHz sample rate
TRTCRoleAnchor: number = 20
  • Anchor
TRTCRoleAudience: number = 21
  • Audience
TRTCSystemVolumeTypeAuto: number = 0
  • Call volume is used for anchors and media volume for audience (not co-anchoring). This mode is suitable for live streaming scenarios.
  • If you set the scenario to TRTC_APP_SCENE_LIVE or TRTC_APP_SCENE_VOICE_CHATROOM when calling enterRoom, the SDK will use this mode by default.
TRTCSystemVolumeTypeMedia: number = 1
  • Media volume is used throughout a call. This mode is not used often, only under special circumstances such as when the anchor uses an external sound card.
TRTCSystemVolumeTypeVOIP: number = 2
  • Call volume is used throughout a call. This is suitable for conferencing scenarios.
  • If you set the scenario to TRTC_APP_SCENE_VIDEOCALL or TRTC_APP_SCENE_AUDIOCALL when calling enterRoom, the SDK will use this mode by default.
TRTC_APP_SCENE_AUDIOCALL: number = 2
  • Audio calls support 48 kHz stereo audio. Each room allows up to 300 concurrent users, and up to 50 of them can speak simultaneously.
  • Use cases: [one-to-one audio call], [audio conferencing with up to 300 participants], [audio chat], [online Werewolf], etc.
TRTC_APP_SCENE_LIVE: number = 1
  • Interactive live video streaming allows smooth mic on/off without waiting. Anchor latency is lower than 300 ms and playback latency lower than 1,000 ms. Up to 100,000 users can play the anchor’s video at the same time.
  • Use cases: [low-latency live video streaming], [interactive classroom for up to 100,000 participants], [live video competition], [video dating room], [remote training], [large-scale conferencing], etc.

  • Note: In this scenario, you must specify a role for the user via the role parameter in TRTCParams.

TRTC_APP_SCENE_VIDEOCALL: number = 0
  • Video calls support 720p and 1080p HD video. Each room allows up to 300 concurrent users, and up to 50 of them can speak simultaneously.
  • Use cases: [one-to-one video call], [video conferencing with up to 300 participants], [online medical consultation], [video chat], [video interview], etc.
TRTC_APP_SCENE_VOICE_CHATROOM: number = 3
  • Interactive live audio streaming allows smooth mic on/off without waiting. Anchor latency is lower than 300 ms and playback latency lower than 1,000 ms. Up to 100,000 users can play the anchor’s audio at the same time.
  • Use cases: [low-latency live audio streaming], [live audio co-anchoring], [audio chat room], [karaoke room], [FM radio], etc.

  • Note: In this scenario, you must specify a role for the user via the role parameter in TRTCParams.

TRTC_AUDIO_FRAME_FORMAT_PCM: number = 1
  • PCM
TRTC_AUDIO_QUALITY_DEFAULT: number = 2
  • Default: mono audio with a sample rate of 48 kHz and a bitrate of 50 Kbps. This is the default audio quality used by the SDK and is recommended.
TRTC_AUDIO_QUALITY_MUSIC: number = 3
  • Music: stereo and fullband audio with a sample rate of 48 kHz and a bitrate of 128 Kbps, suitable for music scenarios with high requirements on fidelity, such as karaoke and live music streaming
TRTC_AUDIO_QUALITY_SPEECH: number = 1
  • Speech: mono audio with a sample rate of 16 kHz and a bitrate of 16 Kbps, suitable for online conferencing, audio calls, etc.
TRTC_AUDIO_ROUTE_EARPIECE: number = 1
  • Receiver
TRTC_AUDIO_ROUTE_SPEAKER: number = 0
  • Speaker
TRTC_BEAUTY_STYLE_NATURE: number = 1
  • Natural, which retains more facial details and is more natural
TRTC_BEAUTY_STYLE_PITU: number = 2
  • Pitu style, which is more natural and retains more facial details than the smooth style
TRTC_BEAUTY_STYLE_SMOOTH: number = 0
  • Smooth, which features more obvious skin smoothing effect and is suitable for showrooms
TRTC_DEBUG_VIEW_LEVEL_ALL: number = 2
  • The upper part of the UI displays the status logs, and the lower part displays the key events
TRTC_DEBUG_VIEW_LEVEL_GONE: number = 0
  • The UI doesn't display logs
TRTC_DEBUG_VIEW_LEVEL_STATUS: number = 1
  • The upper part of the UI displays the status logs
TRTC_GSENSOR_MODE_DISABLE: number = 0
  • Disable the G-sensor
TRTC_GSENSOR_MODE_UIAUTOLAYOUT: number = 1
  • Enable the G-sensor (default)
TRTC_GSENSOR_MODE_UIFIXLAYOUT: number = 2
  • The same as UIAutoLayout and to be disused
TRTC_LOG_LEVEL_DEBUG: number = 1
  • Output DEBUG, INFO, WARNING, ERROR, and FATAL logs
TRTC_LOG_LEVEL_ERROR: number = 4
  • Output ERROR and FATAL logs
TRTC_LOG_LEVEL_FATAL: number = 5
  • Output FATAL logs
TRTC_LOG_LEVEL_INFO: number = 2
  • Output INFO, WARNING, ERROR, and FATAL logs
TRTC_LOG_LEVEL_NULL: number = 6
  • Off
TRTC_LOG_LEVEL_VERBOSE: number = 0
  • Output all logs
TRTC_LOG_LEVEL_WARN: number = 3
  • Output WARNING, ERROR, and FATAL logs
TRTC_QUALITY_Bad: number = 4
  • Bad
TRTC_QUALITY_Down: number = 6
  • Unavailable
TRTC_QUALITY_Excellent: number = 1
  • Excellent
TRTC_QUALITY_Good: number = 2
  • Good
TRTC_QUALITY_Poor: number = 3
  • Mediocre
TRTC_QUALITY_UNKNOWN: number = 0
  • Unknown
TRTC_QUALITY_Vbad: number = 5
  • Very bad
TRTC_REVERB_TYPE_0: number = 0
  • Off
TRTC_REVERB_TYPE_1: number = 1
  • Karaoke
TRTC_REVERB_TYPE_2: number = 2
  • Room
TRTC_REVERB_TYPE_3: number = 3
  • Hall
TRTC_REVERB_TYPE_4: number = 4
  • Deep
TRTC_REVERB_TYPE_5: number = 5
  • Resonant
TRTC_REVERB_TYPE_6: number = 6
  • Metallic
TRTC_REVERB_TYPE_7: number = 7
  • Husky
TRTC_SDK_VERSION: String = '0.0.0.0'
TRTC_TranscodingConfigMode_Manual: number = 1
  • Manual mode. This mode is the most flexible, allowing you to mix streams as needed, but it is the most difficult to use.
  • In this mode, you need to specify all the parameters in TRTCTranscodingConfig and listen for the onUserVideoAvailable() and onUserAudioAvailable() callbacks in TRTCCloudDelegate.
  • The callbacks keep you up to date about the users who are sending audio and video in the room so that you can modify the mixUsers parameter accordingly. Otherwise, mixtranscoding will fail.
TRTC_TranscodingConfigMode_Template_PresetLayout: number = 3
  • Preset layout mode, which allows you to set the layout of images in advance through placeholders
  • In this mode, you need to set the mixUsers parameter and can use the following placeholders for userId.
    • $PLACE_HOLDER_REMOTE$: the image of a remote user. You can use this placeholder for multiple users.
    • $PLACE_HOLDER_LOCAL_MAIN$: the local camera image. You can use this placeholder for only one user.
    • $PLACE_HOLDER_LOCAL_SUB$: the local screen sharing image. You can use this placeholder for only one user.
  • You don't need to listen for the onUserVideoAvailable() or onUserAudioAvailable() callback in TRTCCloudDelegate.
  • Just call setMixTranscodingConfig() once after successful room entry, and the SDK will automatically replace the placeholders with actual userId values.
TRTC_TranscodingConfigMode_Template_PureAudio: number = 2
  • Audio-only mode, which is suitable for audio-only scenarios such as audio call (AudioCall) and audio chat room (VoiceChatRoom)
  • You only need to set the mode once through the setMixTranscodingConfig() API after room entry, and the SDK will automatically mix the audios of all mic-on users in the room into the current user's stream.
  • In this mode, you only need to set audioSampleRate, audioBitrate, and audioChannels in TRTCTranscodingConfig, not mixUsers.
TRTC_TranscodingConfigMode_Template_ScreenSharing: number = 4
  • Screen sharing mode, which is suitable for scenarios such as online education. This mode is supported only by the SDK for Windows and macOS.
  • The SDK will first build a canvas according to the target resolution you set (through the videoWidth and videoHeight parameters).
  • When the teacher is not sharing his or her screen, the SDK stretches the teacher’s camera image to fit the canvas. After the teacher enables screen sharing, the SDK does the same to the screen sharing image.
  • This ensures consistency in the resolution of the mixed stream and prevents video pixelation during replay and web-based streaming (web players cannot play videos with changing resolution).
  • Meanwhile, the audios of mic-on students will be mixed into the teacher's audio/video stream.
  • Given that screen sharing images are the main content in education scenarios, publishing both the camera and screen sharing images would be a waste of bandwidth.
  • We recommend that you use setLocalVideoRenderCallback() to draw the camera image onto the shared screen.
  • In this mode, you don't need to set the mixUsers parameter in TRTCTranscodingConfig. For better screen sharing experience, the SDK does not mix students' images.
  • You can set both width and height in TRTCTranscodingConfig to 0, and the SDK will work out an appropriate resolution based on the user’s screen size.
    • If the teacher's screen width is 1920 px or smaller, the SDK will use the actual resolution of the teacher's screen.
    • If the teacher's screen width is greater than 1920 px, the SDK will use 1920 × 1080 (16:9), 1920 × 1200 (16:10), or 1920 × 1440 (4:3).
TRTC_TranscodingConfigMode_Unknown: number = 0
  • Invalid value
TRTC_VIDEO_MIRROR_TYPE_AUTO: number = 0
  • Mirror the front camera but not the rear camera
TRTC_VIDEO_MIRROR_TYPE_DISABLE: number = 2
  • Mirror neither the front nor rear camera
TRTC_VIDEO_MIRROR_TYPE_ENABLE: number = 1
  • Mirror both the front and rear cameras
TRTC_VIDEO_PIXEL_FORMAT_I420: number = 1
  • YUV I420
TRTC_VIDEO_PIXEL_FORMAT_NV21: number = 4
TRTC_VIDEO_PIXEL_FORMAT_TEXTURE_EXTERNAL_OES: number = 3
TRTC_VIDEO_PIXEL_FORMAT_Texture_2D: number = 2
  • OpenGL 2D texture
TRTC_VIDEO_PIXEL_FORMAT_UNKNOWN: number = 0
  • Unknown
TRTC_VIDEO_QOS_PREFERENCE_CLEAR: number = 2
  • Prioritize clarity under poor network conditions (default)
TRTC_VIDEO_QOS_PREFERENCE_SMOOTH: number = 1
name

2.4 Video quality preference

  • You can specify whether to prioritize clarity or smoothness under poor network conditions. Both modes give top priority to the transfer of audio data.
  • Smooth: This mode prioritizes smoothness on a weak network. If a user's network connection is poor, the video will become blurry.
  • Clear: This mode (default) prioritizes clarity on a weak network. If a user's network connection is poor, the video will stutter, but its definition won’t drop dramatically.
  • Prioritize smoothness under poor network conditions
TRTC_VIDEO_RENDER_MODE_FILL: number = 0
  • The image is scaled to fill the entire screen, and the excess parts are cropped.
TRTC_VIDEO_RENDER_MODE_FIT: number = 1
  • The long side of the image is stretched to fit the screen, and the blank area is filled with black bars.
TRTC_VIDEO_RESOLUTION_120_120: number = 1
  • Only landscape resolutions are defined below. To use portrait resolutions (e.g., 360 × 640), set TRTCVideoResolutionMode to Portrait.
  • Recommended bitrate: 80 Kbps for VideoCall, 120 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_1280_720: number = 112
  • Recommended bitrate: 1200 Kbps for VideoCall, 1800 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_160_120: number = 50
  • Recommended bitrate: 100 Kbps for VideoCall, 150 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_160_160: number = 3
  • Recommended bitrate: 100 Kbps for VideoCall, 150 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_160_90: number = 100
  • Recommended bitrate: 150 Kbps for VideoCall, 250 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_1920_1080: number = 114
  • Recommended bitrate: 2000 Kbps for VideoCall, 3000 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_240_180: number = 52
  • Recommended bitrate: 150 Kbps for VideoCall, 225 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_256_144: number = 102
  • Recommended bitrate: 200 Kbps for VideoCall, 300 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_270_270: number = 5
  • Recommended bitrate: 200 Kbps for VideoCall, 120 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_280_210: number = 54
  • Recommended bitrate: 200 Kbps for VideoCall, 300 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_320_180: number = 104
  • Recommended bitrate: 250 Kbps for VideoCall, 400 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_320_240: number = 56
  • Recommended bitrate: 250 Kbps for VideoCall, 375 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_400_300: number = 58
  • Recommended bitrate: 300 Kbps for VideoCall, 450 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_480_270: number = 106
  • Recommended bitrate: 350 Kbps for VideoCall, 550 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_480_360: number = 60
  • Recommended bitrate: 400 Kbps for VideoCall, 600 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_480_480: number = 7
  • Recommended bitrate: 350 Kbps for VideoCall, 120 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_640_360: number = 108
  • Recommended bitrate: 550 Kbps for VideoCall, 900 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_640_480: number = 62
  • Recommended bitrate: 600 Kbps for VideoCall, 900 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_960_540: number = 110
  • Recommended bitrate: 850 Kbps for VideoCall, 1300 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_960_720: number = 64
  • Recommended bitrate: 1000 Kbps for VideoCall, 1500 Kbps for LIVE
TRTC_VIDEO_RESOLUTION_MODE_LANDSCAPE: number = 0
  • Landscape resolution
TRTC_VIDEO_RESOLUTION_MODE_PORTRAIT: number = 1
  • Portrait resolution
TRTC_VIDEO_ROTATION_0: number = 0
  • Do not rotate
TRTC_VIDEO_ROTATION_180: number = 2
  • Rotate 180 degrees clockwise
TRTC_VIDEO_ROTATION_270: number = 3
  • Rotate 270 degrees clockwise
TRTC_VIDEO_ROTATION_90: number = 1
  • Rotate 90 degrees clockwise
TRTC_VIDEO_STREAM_TYPE_BIG: number = 0
  • Big-image stream
TRTC_VIDEO_STREAM_TYPE_SMALL: number = 1
  • Small-image stream
TRTC_VIDEO_STREAM_TYPE_SUB: number = 2
  • Substream (screen sharing)
TRTC_VOICE_CHANGER_TYPE_0: number = 0
  • Off
TRTC_VOICE_CHANGER_TYPE_1: number = 1
  • Child
TRTC_VOICE_CHANGER_TYPE_10: number = 10
  • Robot
TRTC_VOICE_CHANGER_TYPE_11: number = 11
  • Ethereal
TRTC_VOICE_CHANGER_TYPE_2: number = 2
  • Little girl
TRTC_VOICE_CHANGER_TYPE_3: number = 3
  • Middle-aged man
TRTC_VOICE_CHANGER_TYPE_4: number = 4
  • Metal
TRTC_VOICE_CHANGER_TYPE_5: number = 5
  • Nasal
TRTC_VOICE_CHANGER_TYPE_6: number = 6
  • Punk
TRTC_VOICE_CHANGER_TYPE_7: number = 7
  • Beast
TRTC_VOICE_CHANGER_TYPE_8: number = 8
  • Otaku
TRTC_VOICE_CHANGER_TYPE_9: number = 9
  • Electronic
TRTC_VideoView_SurfaceView: number = 2
  • Use SurfaceView for Android video rendering
TRTC_VideoView_TextureView: number = 1
  • Use TextureView for Android video rendering
VIDEO_QOS_CONTROL_CLIENT: number = 0
  • Local control, which is for internal debugging of the SDK and is not recommended
VIDEO_QOS_CONTROL_SERVER: number = 1
  • Cloud control (default)

Generated using TypeDoc