/** - Entry parameters - As a TRTC SDK entry parameter, only the parameter is filled in correctly can we enter the audio and video room specified by Roomid smoothly */ export declare class TRTCParams { /** - [Field description] Application logo [Must -fill], Tencent Video Cloud is based on SDKAppid for billing statistics. - [Recommended value] After the real -time audio and video console is created and applied, you can get the ID in the account information page */ sdkAppId: number; /** - [Field description] User logo [Must -fill], the userid of the current user is equivalent to the username. - [Recommended value] Limit length is 32 bytes, and only allows the English letters (A-ZA-Z), numbers (0-9), and sub-rigid symbols. */ userId: string; /** - [Field description] User signature [Must -fill], the current userID verification signature is equivalent to using the login password of the cloud service. - [Recommended value] For the specific calculation method, please refer to [How to calculate usersig](https://trtc.io/document/35166)。 */ userSig: string; /** - [Field description] The room number [must be filled], the user (Userid) in the same room can see each other and make video calls - [Recommended value] Value range: 1-4294967294. */ roomId?: number; /** - [Field description] String room number, users in the same room (Userid) can see each other and make video calls. - [Recommended value] the length limit is 64 bytes. The following 89 characters are supported: - Uppercase and lowercase letters (a–z and A–Z) - Digits (0–9) - Space, "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", and ",". - [Note] roomId and strRoomId must fill in one. If you choose strRoomId, roomId needs to be filled as 0. If both are filled, the roomId will be preferred. Please note that when the same SDKAppID interoperability, be sure to choose the same type of room number type to avoid affecting interoperability. */ strRoomId?: string; /** - [Field description] role in the live streaming scenario, which is applicable only to the live streaming scenario (TRTC_APP_SCENE_LIVE or TRTC_APP_SCENE_VOICE_CHATROOM) but doesn't take effect in the call scenario. - [Recommended value] Default value: anchor (TRTCRoleAnchor) */ role?: number; /** - [Field description] specified `streamId` in Tencent Cloud CSS, which is optional. After setting this field, you can play back the user's audio/video stream on Tencent Cloud CSS CDN through a standard pull scheme (FLV or HLS). - [Recommended value] this parameter can contain up to 64 bytes and can be left empty. We recommend you use 'sdkappid_roomid_userid_main' as the streamid , which is easier to identify and will not cause conflicts in your multiple applications. - [Note] To use Tencent Cloud CSS CDN, you need to enable the auto-relayed live streaming feature on the "Function Configuration" page in the console first. - For more information, please see [CDN Relayed Live Streaming](https://www.tencentcloud.com/document/product/647/35242). */ streamId?: string; /** - [Field description] on-cloud recording field, which is optional and used to specify whether to record the user's audio/video stream in the cloud. - [Recommended value] it can contain up to 64 bytes. Letters (a–z and A–Z), digits (0–9), underscores, and hyphens are allowed. - For more information, please see [On-Cloud Recording and Playback](https://www.tencentcloud.com/document/product/647/35426). */ userDefineRecordId?: string; /** - [Field description] permission credential used for permission control, which is optional. If you want only users with the specified `userId` values to enter a room, you need to use `privateMapKey` to restrict the permission. - [Recommended value] we recommend you use this parameter only if you have high security requirements. For more information, please see [Enabling Advanced Permission Control](https://trtc.io/document/35157). */ privateMapKey?: string; /** - [Field description] business data, which is optional. This field is needed only by some advanced features. - [Recommended value] do not set this field on your own. */ businessInfo?: string; constructor(params: { sdkAppId: number; userId: string; userSig: string; roomId?: number; strRoomId?: string; role?: number; streamId?: string; userDefineRecordId?: string; privateMapKey?: string; businessInfo?: string; }); } /** - Key type definition variable */ export declare class TRTCCloudDef { static TRTC_SDK_VERSION: String; /** - Aspect ratio: 1:1; resolution: 120x120; recommended bitrate (VideoCall): 80 Kbps; recommended bitrate (LIVE): 120 Kbps. */ static TRTC_VIDEO_RESOLUTION_120_120: number; /** - Aspect ratio: 1:1; resolution: 160x160; recommended bitrate (VideoCall): 100 Kbps; recommended bitrate (LIVE): 150 Kbps. */ static TRTC_VIDEO_RESOLUTION_160_160: number; /** - Aspect ratio: 1:1; resolution: 270x270; recommended bitrate (VideoCall): 200 Kbps; recommended bitrate (LIVE): 300 Kbps. */ static TRTC_VIDEO_RESOLUTION_270_270: number; /** - Aspect ratio: 1:1; resolution: 480x480; recommended bitrate (VideoCall): 350 Kbps; recommended bitrate (LIVE): 500 Kbps. */ static TRTC_VIDEO_RESOLUTION_480_480: number; /** - Aspect ratio: 4:3; resolution: 160x120; recommended bitrate (VideoCall): 100 Kbps; recommended bitrate (LIVE): 150 Kbps. */ static TRTC_VIDEO_RESOLUTION_160_120: number; /** - Aspect ratio: 4:3; resolution: 240x180; recommended bitrate (VideoCall): 150 Kbps; recommended bitrate (LIVE): 250 Kbps. */ static TRTC_VIDEO_RESOLUTION_240_180: number; /** - Aspect ratio: 4:3; resolution: 280x210; recommended bitrate (VideoCall): 200 Kbps; recommended bitrate (LIVE): 300 Kbps. */ static TRTC_VIDEO_RESOLUTION_280_210: number; /** - Aspect ratio: 4:3; resolution: 320x240; recommended bitrate (VideoCall): 250 Kbps; recommended bitrate (LIVE): 375 Kbps. */ static TRTC_VIDEO_RESOLUTION_320_240: number; /** - Aspect ratio: 4:3; resolution: 400x300; recommended bitrate (VideoCall): 300 Kbps; recommended bitrate (LIVE): 450 Kbps. */ static TRTC_VIDEO_RESOLUTION_400_300: number; /** - Aspect ratio: 4:3; resolution: 480x360; recommended bitrate (VideoCall): 400 Kbps; recommended bitrate (LIVE): 600 Kbps. */ static TRTC_VIDEO_RESOLUTION_480_360: number; /** - Aspect ratio: 4:3; resolution: 640x480; recommended bitrate (VideoCall): 600 Kbps; recommended bitrate (LIVE): 900 Kbps. */ static TRTC_VIDEO_RESOLUTION_640_480: number; /** - Aspect ratio: 4:3; resolution: 960x720; recommended bitrate (VideoCall): 1000 Kbps; recommended bitrate (LIVE): 1500 Kbps. */ static TRTC_VIDEO_RESOLUTION_960_720: number; /** - Aspect ratio: 16:9; resolution: 160x90; recommended bitrate (VideoCall): 150 Kbps; recommended bitrate (LIVE): 250 Kbps. */ static TRTC_VIDEO_RESOLUTION_160_90: number; /** - Aspect ratio: 16:9; resolution: 256x144; recommended bitrate (VideoCall): 200 Kbps; recommended bitrate (LIVE): 300 Kbps. */ static TRTC_VIDEO_RESOLUTION_256_144: number; /** - Aspect ratio: 16:9; resolution: 320x180; recommended bitrate (VideoCall): 250 Kbps; recommended bitrate (LIVE): 400 Kbps. */ static TRTC_VIDEO_RESOLUTION_320_180: number; /** - Aspect ratio: 16:9; resolution: 480x270; recommended bitrate (VideoCall): 350 Kbps; recommended bitrate (LIVE): 550 Kbps. */ static TRTC_VIDEO_RESOLUTION_480_270: number; /** - Aspect ratio: 16:9; resolution: 640x360; recommended bitrate (VideoCall): 500 Kbps; recommended bitrate (LIVE): 900 Kbps. */ static TRTC_VIDEO_RESOLUTION_640_360: number; /** - Aspect ratio: 16:9; resolution: 960x540; recommended bitrate (VideoCall): 850 Kbps; recommended bitrate (LIVE): 1300 Kbps. */ static TRTC_VIDEO_RESOLUTION_960_540: number; /** - Aspect ratio: 16:9; resolution: 1280x720; recommended bitrate (VideoCall): 1200 Kbps; recommended bitrate (LIVE): 1800 Kbps. */ static TRTC_VIDEO_RESOLUTION_1280_720: number; /** - Aspect ratio: 16:9; resolution: 1920x1080; recommended bitrate (VideoCall): 2000 Kbps; recommended bitrate (LIVE): 3000 Kbps. */ static TRTC_VIDEO_RESOLUTION_1920_1080: number; /** * @name 1.2 Video width and high ratio mode * * - Horizontal screen resolution:TRTCVideoResolution_640_360 + TRTCVideoResolutionModeLandscape = 640 × 360 * - Vertical screen resolution:TRTCVideoResolution_640_360 + TRTCVideoResolutionModePortrait = 360 × 640 * * */ /** - Horizontal screen resolution */ static TRTC_VIDEO_RESOLUTION_MODE_LANDSCAPE: number; /** - Vertical screen resolution */ static TRTC_VIDEO_RESOLUTION_MODE_PORTRAIT: number; /** * @name 1.3 Video flow type * * There are three different audio and video streams inside TRTC, which are: * - HD big image: it is generally used to transfer video data from the camera. * - Smooth small image: it has the same content as the big image, but with lower resolution and bitrate and thus lower definition. * - Substream image: it is generally used for screen sharing. Only one user in the room is allowed to publish the substream video image at any time, while other users must wait for this user to close the substream before they can publish their own substream. * * @note * - If the anchor's uplink network and performance are better, you can send the two -way picture at the same time. * - SDK does not support opening small pictures alone, and small pictures must be attached to the main screen. * */ /** - HD big image: it is generally used to transfer video data from the camera. */ static TRTC_VIDEO_STREAM_TYPE_BIG: number; /** - Smooth small image: it has the same content as the big image, but with lower resolution and bitrate and thus lower definition. */ static TRTC_VIDEO_STREAM_TYPE_SMALL: number; /** - Substream image: it is generally used for screen sharing. Only one user in the room is allowed to publish the substream video image at any time, while other users must wait for this user to close the substream before they can publish their own substream. */ static TRTC_VIDEO_STREAM_TYPE_SUB: number; /** * @name 1.4 Video (or network) quality constant definition * TRTC evaluates the current network quality once every two seconds. The evaluation results are divided into six levels: `Excellent` indicates the best, and `Down` indicates the worst. */ /** - Undefined */ static TRTC_QUALITY_UNKNOWN: number; /** - The current network is excellent */ static TRTC_QUALITY_Excellent: number; /** - The current network is good */ static TRTC_QUALITY_Good: number; /** - The current network is fair */ static TRTC_QUALITY_Poor: number; /** - The current network is bad */ static TRTC_QUALITY_Bad: number; /** - The current network is very bad */ static TRTC_QUALITY_Vbad: number; /** - The current network cannot meet the minimum requirements of TRTC */ static TRTC_QUALITY_Down: number; /** * @name 1.5 Video screen filling mode * If the display resolution of the screen does not equal the original resolution of the picture, you need to set the fill mode of the screen: * - TRTCVideoFillMode_Fill: The image is covered with the screen, and the video part of the display window will be cut, and the screen display may be incomplete. * - TRTCVideoFillMode_Fit: The image is filled with the screen long, and the short -sided area will be filled with black, and the content of the picture is complete. */ /** - The image is covered with the screen, and the video part of the display window will be cut */ static TRTC_VIDEO_RENDER_MODE_FILL: number; /** - The image is filled with the screen long, and the short -sided area will be filled with black */ static TRTC_VIDEO_RENDER_MODE_FIT: number; /** * @name 1.6 Video screen rotation direction * TRTC provides rotation angle setting APIs for local and remote images. The following rotation angles are all clockwise. */ /** - No rotation */ static TRTC_VIDEO_ROTATION_0: number; /** - Clockwise rotation by 90 degrees */ static TRTC_VIDEO_ROTATION_90: number; /** - Clockwise rotation by 180 degrees */ static TRTC_VIDEO_ROTATION_180: number; /** - Clockwise rotation by 270 degrees */ static TRTC_VIDEO_ROTATION_270: number; /** * @name 1.7 Beauty (skin smoothing) filter algorithm * * TRTC has multiple built-in skin smoothing algorithms. You can select the one most suitable for your product. * */ /** - Smooth style, which uses a more radical algorithm for more obvious effect and is suitable for show live streaming. */ static TRTC_BEAUTY_STYLE_SMOOTH: number; /** - Natural style, which retains more facial details for more natural effect and is suitable for most live streaming use cases. */ static TRTC_BEAUTY_STYLE_NATURE: number; /** - Pitu style, which is provided by YouTu Lab. Its skin smoothing effect is between the smooth style and the natural style, that is, it retains more skin details than the smooth style and has a higher skin smoothing degree than the natural style. */ static TRTC_BEAUTY_STYLE_PITU: number; /** * @name 1.8 Video pixel format * * TRTC provides custom video capturing and rendering features. * - For the custom capturing feature, you can use the following enumerated values to describe the pixel format of the video you capture. * - For the custom rendering feature, you can specify the pixel format of the video you expect the SDK to call back. * */ /** - Undefined format */ static TRTC_VIDEO_PIXEL_FORMAT_UNKNOWN: number; /** - YUV I420 */ static TRTC_VIDEO_PIXEL_FORMAT_I420: number; /** - OpenGL 2D texture format */ static TRTC_VIDEO_PIXEL_FORMAT_Texture_2D: number; /** - OES external texture format (for Android) */ static TRTC_VIDEO_PIXEL_FORMAT_TEXTURE_EXTERNAL_OES: number; /** - NV21 format */ static TRTC_VIDEO_PIXEL_FORMAT_NV21: number; /** * @name 1.9 Video mirror type * * Video mirroring refers to the left-to-right flipping of the video image, especially for the local camera preview image. After mirroring is enabled, it can bring anchors a familiar "look into the mirror" experience. */ /** - Auto mode: mirror the front camera's image but not the rear camera's image (for mobile devices only). */ static TRTC_VIDEO_MIRROR_TYPE_AUTO: number; /** - Mirror the images of both the front and rear cameras. */ static TRTC_VIDEO_MIRROR_TYPE_ENABLE: number; /** - Disable mirroring for both the front and rear cameras. */ static TRTC_VIDEO_MIRROR_TYPE_DISABLE: number; /** * @name 2.1 Use cases * TRTC features targeted optimizations for common audio/video application scenarios to meet the differentiated requirements in various verticals. * - Live streaming scenario (LIVE): including `LIVE` (audio + video) and `VoiceChatRoom` (pure audio). In the live streaming scenario, users are divided into two roles: "anchor" and "audience". A single room can sustain up to 100,000 concurrent online users. This is suitable for live streaming to a large audience. * - Real-Time scenario (RTC): including `VideoCall` (audio + video) and `AudioCall` (pure audio). In the real-time scenario, there is no role difference between users, but a single room can sustain only up to 300 concurrent online users. This is suitable for small-scale real-time communication. */ /** - In the video call scenario, 720p and 1080p HD image quality is supported. A single room can sustain up to 300 concurrent online 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 diagnosis], [small class], [video interview], etc. */ static TRTC_APP_SCENE_VIDEOCALL: number; /** - In the interactive video live streaming scenario, mic can be turned on/off smoothly without waiting for switchover, and the anchor latency is as low as less than 300 ms. Live streaming to hundreds of thousands of concurrent users in the audience role is supported with the playback latency down to 1,000 ms. - Use cases: [low-latency interactive live streaming], [big class], [anchor competition], [video dating room], [online interactive classroom], [remote training], [large-scale conferencing], etc. - **Note:** In this scenario, you must use the `role` field in `TRTCParams` to specify the role of the current user. */ static TRTC_APP_SCENE_LIVE: number; /** - Audio call scenario, where the `SPEECH` sound quality is used by default. A single room can sustain up to 300 concurrent online 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. */ static TRTC_APP_SCENE_AUDIOCALL: number; /** - In the interactive audio live streaming scenario, mic can be turned on/off smoothly without waiting for switchover, and the anchor latency is as low as less than 300 ms. Live streaming to hundreds of thousands of concurrent users in the audience role is supported with the playback latency down to 1,000 ms. - Use cases: [audio club], [online karaoke room], [music live room], [FM radio], etc. - **Note:** In this scenario, you must use the `role` field in `TRTCParams` to specify the role of the current user. */ static TRTC_APP_SCENE_VOICE_CHATROOM: number; /** - Anchor */ static TRTCRoleAnchor: number; /** - Audience */ static TRTCRoleAudience: number; /** - Client-based control, which is for internal debugging of SDK and shall not be used by users. */ static VIDEO_QOS_CONTROL_CLIENT: number; /** - On-cloud control, which is the default and recommended mode. */ static VIDEO_QOS_CONTROL_SERVER: number; /** @name 2.4 Image quality preference - TRTC has two control modes in weak network environments: "ensuring clarity" and "ensuring smoothness". Both modes will give priority to the transfer of audio data. */ /** - Ensuring smoothness: in this mode, when the current network is unable to transfer a clear and smooth video image, the smoothness of the image will be given priority, but there will be blurs. */ static TRTC_VIDEO_QOS_PREFERENCE_SMOOTH: number; /** - Ensuring clarity (default value): in this mode, when the current network is unable to transfer a clear and smooth video image, the clarity of the image will be given priority, but there will be lags. */ static TRTC_VIDEO_QOS_PREFERENCE_CLEAR: number; /** - @name 3.1 Audio sample rate - The audio sample rate is used to measure the audio fidelity. A higher sample rate indicates higher fidelity. If there is music in the use case, `TRTCAudioSampleRate48000` is recommended. */ /** - 16 kHz sample rate */ static TRTCAudioSampleRate16000: number; /** - 32 kHz sample rate */ static TRTCAudioSampleRate32000: number; /** - 44.1 kHz sample rate */ static TRTCAudioSampleRate44100: number; /** - 48 kHz sample rate */ static TRTCAudioSampleRate48000: number; /** * @name 3.2 Sound quality * * The audio sound quality is used to measure the preservation of sound. */ /** - Speech mode: sample rate: 16 kHz; mono channel; bitrate: 16 Kbps. This mode has the best resistance among all modes and is suitable for audio call scenarios, such as online meeting and audio call. */ static TRTC_AUDIO_QUALITY_SPEECH: number; /** - Default mode: sample rate: 48 kHz; mono channel; bitrate: 50 Kbps. This mode is between the speech mode and the music mode as the default mode in the SDK and is recommended. */ static TRTC_AUDIO_QUALITY_DEFAULT: number; /** - Music mode: sample rate: 48 kHz; full-band stereo; bitrate: 128 Kbps. This mode is suitable for scenarios where Hi-Fi music transfer is required, such as online karaoke and music live streaming. */ static TRTC_AUDIO_QUALITY_MUSIC: number; /** - Speakerphone: the speaker at the bottom is used for playback (hands-free). With relatively high volume, it is used to play music out loud. */ static TRTC_AUDIO_ROUTE_SPEAKER: number; /** - Earpiece: the receiver at the top is used for playback. With relatively low volume, it is suitable for call scenarios that require privacy. */ static TRTC_AUDIO_ROUTE_EARPIECE: number; /** - PCM */ static TRTC_AUDIO_FRAME_FORMAT_PCM: number; /** - Auto: In the auto mode, call volume is used for anchors, and media volume for audience. This mode is suitable for live streaming scenarios. - If the scenario you select during `enterRoom` is `TRTC_APP_SCENE_LIVE` or `TRTCAppSceneVoiceChatRoom` , the SDK will automatically use this mode. */ static TRTCSystemVolumeTypeAuto: number; /** - Media volume: In this mode, media volume is used in all scenarios. It is rarely used, mainly suitable for music scenarios with demanding requirements on audio quality. - Use this mode if most of your users use peripheral devices such as audio cards. Otherwise, it is not recommended. */ static TRTCSystemVolumeTypeMedia: number; /** - Call volume: In this mode, the audio module does not change its work mode when users switch between anchors and audience, enabling seamless mic on/off. This mode is suitable for scenarios where users need to switch frequently between anchors and audience. - If the scenario you select during `enterRoom` is `TRTC_APP_SCENE_VIDEOCALL` or `TRTC_APP_SCENE_AUDIOCALL` , the SDK will automatically use this mode. */ static TRTCSystemVolumeTypeVOIP: number; /** - Do not display debugging information in the rendering control */ static TRTC_DEBUG_VIEW_LEVEL_GONE: number; /** - Display audio/video statistics in the rendering control */ static TRTC_DEBUG_VIEW_LEVEL_STATUS: number; /** - Display audio/video statistics and key historical events in the rendering control */ static TRTC_DEBUG_VIEW_LEVEL_ALL: number; /** * - Output logs at all levels */ static TRTC_LOG_LEVEL_VERBOSE: number; /** * - Output logs at the DEBUG, INFO, WARNING, ERROR, and FATAL levels */ static TRTC_LOG_LEVEL_DEBUG: number; /** * - Output logs at the INFO, WARNING, ERROR, and FATAL levels */ static TRTC_LOG_LEVEL_INFO: number; /** * - Output logs at the WARNING, ERROR, and FATAL levels */ static TRTC_LOG_LEVEL_WARN: number; /** * - Output logs at the ERROR and FATAL levels */ static TRTC_LOG_LEVEL_ERROR: number; /** * - Output logs at the FATAL level */ static TRTC_LOG_LEVEL_FATAL: number; /** * - Do not output any SDK logs */ static TRTC_LOG_LEVEL_NULL: number; /** * @name 4.3 G-sensor switch (for mobile devices only) */ /** - Do not adapt to G-sensor orientation */ static TRTC_GSENSOR_MODE_DISABLE: number; /** - Adapt to G-sensor orientation. default value */ static TRTC_GSENSOR_MODE_UIAUTOLAYOUT: number; /** - Adapt to G-sensor orientation */ static TRTC_GSENSOR_MODE_UIFIXLAYOUT: number; /** * @name 4.4 Layout mode of On-Cloud MixTranscoding * */ /** - Undefined */ static TRTC_TranscodingConfigMode_Unknown: number; /** - Manual layout mode - In this mode, you need to specify the precise position of each video image. This mode has the highest degree of freedom, but its ease of use is the worst: - You need to enter all the parameters in `TRTCTranscodingConfig`, including the position coordinates of each video image (TRTCMixUser). - You need to listen on the `onUserVideoAvailable()` and `onUserAudioAvailable()` event callbacks in `TRTCCloudDelegate` and constantly adjust the `mixUsers` parameter according to the audio/video status of each user with mic on in the current room. */ static TRTC_TranscodingConfigMode_Manual: number; /** - Pure audio mode - This mode is suitable for pure audio scenarios such as audio call (AudioCall) and audio chat room (VoiceChatRoom). - You only need to set it once through the `setMixTranscodingConfig()` API after room entry, and then the SDK will automatically mix the audio of all mic-on users in the room into the current user's live stream. - You don't need to set the `mixUsers` parameter in `TRTCTranscodingConfig`; instead, you only need to set the `audioSampleRate`, `audioBitrate` and `audioChannels` parameters. */ static TRTC_TranscodingConfigMode_Template_PureAudio: number; /** - Preset layout mode - This is the most popular layout mode, because it allows you to set the position of each video image in advance through placeholders, and then the SDK automatically adjusts it dynamically according to the number of video images in the room. - In this mode, you still need to set the `mixUsers` parameter, but you can set userId as a "placeholder". Placeholder values include: - "$PLACE_HOLDER_REMOTE$" : image of remote user. Multiple images can be set. - "$PLACE_HOLDER_LOCAL_MAIN$" : local camera image. Only one image can be set. - "$PLACE_HOLDER_LOCAL_SUB$" : local screen sharing image. Only one image can be set. - In this mode, you don't need to listen on the `onUserVideoAvailable()` and `onUserAudioAvailable()` callbacks in `TRTCCloudDelegate` to make real-time adjustments. - Instead, you only need to call `setMixTranscodingConfig()` once after successful room entry. Then, the SDK will automatically populate the placeholders you set with real userId values. */ static TRTC_TranscodingConfigMode_Template_PresetLayout: number; /** - Screen sharing mode - This mode is suitable for screen sharing-based use cases such as online education and supported only by the SDKs for Windows and macOS. - In this mode, the SDK will first build a canvas according to the target resolution you set (through the `videoWidth` and `videoHeight` parameters). - Before the teacher enables screen sharing, the SDK will scale up the teacher's camera image and draw it onto the canvas. - After the teacher enables screen sharing, the SDK will draw the video image shared on the screen onto the same canvas. - The purpose of this layout mode is to ensure consistency in the output resolution of the mixtranscoding module and avoid problems with blurred screen during course replay and webpage playback (web players don't support adjustable resolution). - Meanwhile, the audio of mic-on students will be mixed into the teacher's audio/video stream by default. - Video content is primarily the shared screen in teaching mode, and it is a waste of bandwidth to transfer camera image and screen image at the same time. - Therefore, the recommended practice is to directly draw the camera image onto the current screen through the `setLocalVideoRenderCallback` API. - In this mode, you don't need to set the `mixUsers` parameter in `TRTCTranscodingConfig`, and the SDK will not mix students' images so as not to interfere with the screen sharing effect. - You can set width x height in `TRTCTranscodingConfig` to 0 px x 0 px, and the SDK will automatically calculate a suitable resolution based on the aspect ratio of the user's current screen. - If the teacher's current screen width is less than or equal to 1920 px, the SDK will use the actual resolution of the teacher's current screen. - If the teacher's current screen width is greater than 1920 px, the SDK will select one of the three resolutions of 1920x1080 (16:9), 1920x1200 (16:10), and 1920x1440 (4:3) according to the current screen aspect ratio. */ static TRTC_TranscodingConfigMode_Template_ScreenSharing: number; /** - Android video rendering uses TextureView */ static TRTC_VideoView_TextureView: number; /** - Android video rendering uses SurfaceView */ static TRTC_VideoView_SurfaceView: number; } /** - Room switch parameter */ export type TRTCSwitchRoomConfig = { /** - [Field description] user signature, which is optional. It is the authentication signature corresponding to the current userId and acts as the login password. If you don't specify the newly calculated `userSig` during room switch, the SDK will continue to use the `userSig` you specified during room entry (enterRoom). This requires you to ensure that the old `userSig` is still within the validity period allowed by the signature at the moment of room switch; otherwise, room switch will fail. - [Recommended value] for the calculation method, please see [UserSig](https://trtc.io/document/35166). */ userSig: string; /** - [Field description] numeric room ID, which is optional. Users in the same room can see one another and make audio/video calls. - [Recommended value] value range: 1–4294967294. */ roomId?: number; /** - [Field description] string-type room ID, which is optional. Users in the same room can see one another and make audio/video calls. */ strRoomId?: string; /** - [Field description] permission credential used for permission control, which is optional. If you want only users with the specified `userId` values to enter a room, you need to use `privateMapKey` to restrict the permission. - [Recommended value] we recommend you use this parameter only if you have high security requirements. For more information, please see [Enabling Advanced Permission Control](https://trtc.io/document/35157). */ privateMapKey?: string; }; /** - Video encoding parameters - These settings determine the quality of image viewed by remote users as well as the image quality of recorded video files in the cloud. */ export type TRTCVideoEncParam = { /** - Field description: video resolution - Recommended value: - For mobile video call, we recommend you select a resolution of 360x640 or below and select `Portrait` (portrait resolution) for `resMode`. - For mobile live streaming, we recommend you select a resolution of 540x960 and select `Portrait` (portrait resolution) for `resMode`. - Note: to use a portrait resolution, please specify `resMode` as `Portrait`; for example, when used together with `Portrait`, 640x360 represents 360x640. */ videoResolution: number; /** - Field description: resolution mode (landscape/portrait) - Recommended value: for mobile platforms (iOS and Android), `Portrait` is recommended; for desktop platforms (Windows and macOS), `Landscape` is recommended. - Note: to use a portrait resolution, please specify `resMode` as `Portrait`; for example, when used together with `Portrait`, 640x360 represents 360x640. */ videoResolutionMode: number; /** - Field description: video capturing frame rate - Recommended value: 15 or 20 fps. If the frame rate is lower than 5 fps, there will be obvious lagging; if lower than 10 fps but higher than 5 fps, there will be slight lagging; if higher than 20 fps, the bandwidth will be wasted (the frame rate of movies is generally 24 fps). - Note: the front cameras on certain Android phones do not support a capturing frame rate higher than 15 fps. For some Android phones that focus on beautification features, the capturing frame rate of the front cameras may be lower than 10 fps. */ videoFps: number; /** - Field description: target video bitrate. The SDK encodes streams at the target video bitrate and will actively reduce the bitrate only in weak network environments. - Recommended value: please see the optimal bitrate for each specification in `TRTCVideoResolution`. You can also slightly increase the optimal bitrate. For example, `TRTC_VIDEO_RESOLUTION_1280_720` corresponds to the target bitrate of 1,200 Kbps. You can also set the bitrate to 1,500 Kbps for higher definition. - Note:you can set the videoBitrate and minVideoBitrate parameters at the same time to restrict the SDK's adjustment range of the video bitrate: - If you want to "ensure clarity while allowing lag in weak network environments", you can set minVideoBitrate to 60% of videoBitrate . - If you want to "ensure smoothness while allowing blur in weak network environments", you can set minVideoBitrate to a low value, for example, 100 Kbps. - If you set videoBitrate and minVideoBitrate to the same value, it is equivalent to disabling the adaptive adjustment capability of the SDK for the video bitrate. */ videoBitrate: number; /** - Field description: minimum video bitrate. The SDK will reduce the bitrate to as low as the value specified by `minVideoBitrate` to ensure the smoothness only if the network conditions are poor. - Note: default value: 0, indicating that a reasonable value of the lowest bitrate will be automatically calculated by the SDK according to the resolution you specify. - Recommended value: you can set the `videoBitrate` and `minVideoBitrate` parameters at the same time to restrict the SDK's adjustment range of the video bitrate: - If you want to "ensure clarity while allowing lag in weak network environments", you can set `minVideoBitrate` to 60% of videoBitrate . - If you want to "ensure smoothness while allowing blur in weak network environments", you can set `minVideoBitrate` to a low value, for example, 100 Kbps. - If you set `videoBitrate` and `minVideoBitrate` to the same value, it is equivalent to disabling the adaptive adjustment capability of the SDK for the video bitrate. */ minVideoBitrate: number; /** - Field description: whether to allow dynamic resolution adjustment. Once enabled, this field will affect on-cloud recording. - Recommended value: this feature is suitable for scenarios that don't require on-cloud recording. After it is enabled, the SDK will intelligently select a suitable resolution according to the current network conditions to avoid the inefficient encoding mode of "large resolution + small bitrate". */ enableAdjustRes: boolean; }; /** - Network QoS control parameter set - Network QoS control parameter. The settings determine the QoS control policy of the SDK in weak network conditions (e.g., whether to "ensure clarity" or "ensure smoothness"). */ export type TRTCNetworkQosParam = { /** - Field description: whether to ensure smoothness or clarity - Recommended value: ensuring clarity - Note: - Ensuring smoothness: in this mode, when the current network is unable to transfer a clear and smooth video image, the smoothness of the image will be given priority, but there will be blurs. See TRTC_VIDEO_QOS_PREFERENCE_SMOOTH - Ensuring clarity (default value): in this mode, when the current network is unable to transfer a clear and smooth video image, the clarity of the image will be given priority, but there will be lags. See TRTC_VIDEO_QOS_PREFERENCE_CLEAR */ preference: number; /** - Field description: QoS control mode (disused) - Recommended value: on-cloud control */ controlMode: number; }; /** - Rendering parameters of video image */ export type TRTCRenderParams = { /** - Field description: clockwise image rotation angle - Recommended value: rotation angles of 90, 180, and 270 degrees are supported. Default value: TRTC_VIDEO_ROTATION_0 */ rotation: number; /** - Field description: image fill mode - Recommended value: fill (the image may be stretched or cropped) or fit (there may be black bars in unmatched areas). Default value: TRTC_VIDEO_RENDER_MODE_FILL */ fillMode: number; /** - Field description: image mirror mode - Recommended value: default value: TRTC_VIDEO_MIRROR_TYPE_AUTO */ mirrorType: number; }; /** - Description information of each video image in On-Cloud MixTranscoding - TRTCMixUser is used to specify the location, size, layer, and stream type of each video image in On-Cloud MixTranscoding. */ export type TRTCMixUser = { /** - userId participating in mixed flow */ userId: string; /** - Participate in the mixed stream is located at Roomid, null means the current room */ roomId?: string; /** - Layer position x coordinate (absolute pixel value) */ x: number; /** - Layer position Y coordinate (absolute pixel value) */ y: number; /** - Layer position width (absolute pixel value) */ width: number; /** - Layer position height (absolute pixel value) */ height: number; /** - Layer level (1-15) cannot be repeated */ zOrder: number; /** - The participation is the main road screen (TRTC_VIDEO_STREAM_TYPE_BIG, default) or screen sharing (TRTC_VIDEO_STREAM_TYPE_SUB) */ streamType?: number; /** - Whether it is pure audio mode. true: pure audio; false (default): audio and video */ pureAudio?: boolean; }; /** - Layout and transcoding parameters of On-Cloud MixTranscoding - These parameters are used to specify the layout position information of each video image and the encoding parameters of mixtranscoding during On-Cloud MixTranscoding. */ export type TRTCTranscodingConfig = { /** - Field description: `appId` of Tencent Cloud CSS - Recommended value: please click Application Management > Application Information in the [TRTC console](https://console.tencentcloud.com/trtc) and get the appId in Relayed Live Streaming Info . */ appId?: number; /** - Field description: `bizId` of Tencent Cloud CSS - Recommended value: please click Application Management > Application Information in the [TRTC console](https://console.tencentcloud.com/trtc) and get the appId in Relayed Live Streaming Info . */ bizId?: number; /** - Field description: layout mode */ mode: number; /** - Field description: specify the target resolution (width) of On-Cloud MixTranscoding - Recommended value: 360 px. If you only mix audio streams, please set both width and height to 0; otherwise, there will be a black background in the live stream after mixtranscoding. */ videoWidth: number; /** - Field description: specify the target resolution (height) of On-Cloud MixTranscoding - Recommended value: 640 px. If you only mix audio streams, please set both width and height to 0; otherwise, there will be a black background in the live stream after mixtranscoding. */ videoHeight: number; /** - Field description: specify the target video bitrate (Kbps) of On-Cloud MixTranscoding - Recommended value: if you enter 0, TRTC will estimate a reasonable bitrate value based on `videoWidth` and `videoHeight`. You can also refer to the recommended bitrate value in the video resolution enumeration definition (in the comment section). */ videoBitrate: number; /** - Field description: specify the target video frame rate (fps) of On-Cloud MixTranscoding - Recommended value: default value: 15 fps. Value range: (0,30]. */ videoFramerate: number; /** - Field description: specify the target video keyframe interval (GOP) of On-Cloud MixTranscoding - Recommended value: default value: 2 (in seconds). Value range: [1,8]. */ videoGOP: number; /** - Field description: specify the background color of the mixed video image. - Recommended value: default value: 0x000000, which means black and is in the format of hex number; for example: "0x61B9F1" represents the RGB color (97,158,241). */ backgroundColor?: number; /** - Field description: specify the background image of the mixed video image. - Recommended value: default value: null, indicating not to set the background image. - Note: TRTC's backend service will mix the image specified by the URL address into the final stream.URL link length is limited to 512 bytes. The image size is limited to 10MB.Support png, jpg, jpeg, bmp format. */ backgroundImage?: string; /** - Field description: specify the target audio sample rate of On-Cloud MixTranscoding - Recommended value: default value: 48000 Hz. Valid values: 12000 Hz, 16000 Hz, 22050 Hz, 24000 Hz, 32000 Hz, 44100 Hz, 48000 Hz. */ audioSampleRate: number; /** - Field description: specify the target audio bitrate of On-Cloud MixTranscoding - Recommended value: default value: 64 Kbps. Value range: [32,192]. */ audioBitrate: number; /** - Field description: specify the number of sound channels of On-Cloud MixTranscoding - Recommended value: default value: 1, which means mono channel. Valid values: 1: mono channel; 2: dual channel. */ audioChannels: number; /** - Field description: specify the position, size, layer, and stream type of each video image in On-Cloud MixTranscoding */ mixUsers?: Array; /** - Field description: ID of the live stream output to CDN - Recommended value: default value: null, that is, the audio/video streams in the room will be mixed into the audio/video stream of the caller of this API. - If you don't set this parameter, the SDK will execute the default logic, that is, it will mix the multiple audio/video streams in the room into the audio/video stream of the caller of this API, i.e., A + B => A. - If you set this parameter, the SDK will mix the audio/video streams in the room into the live stream you specify, i.e., A + B => C (C is the streamId you specify). */ streamId: string; }; /** - Voice changing type - This enumerated value is used to set the voice changing mode in the live streaming scenario and is often used in show live streaming. */ export declare enum TXVoiceChangerType { /** - Disable voice changing */ TXLiveVoiceChangerType_0 = 0, /** - Child */ TXLiveVoiceChangerType_1 = 1, /** - Girl */ TXLiveVoiceChangerType_2 = 2, /** - Middle-Aged man */ TXLiveVoiceChangerType_3 = 3, /** - Heavy metal */ TXLiveVoiceChangerType_4 = 4, /** - Nasal */ TXLiveVoiceChangerType_5 = 5, /** - Punk */ TXLiveVoiceChangerType_6 = 6, /** - Trapped beast */ TXLiveVoiceChangerType_7 = 7, /** - Otaku */ TXLiveVoiceChangerType_8 = 8, /** - Electronic */ TXLiveVoiceChangerType_9 = 9, /** - Robot */ TXLiveVoiceChangerType_10 = 10, /** - Ethereal */ TXLiveVoiceChangerType_11 = 11 } /** - Audio reverb mode - This enumerated value is used to set the audio reverb mode in the live streaming scenario and is often used in show live streaming. */ export declare enum TXVoiceReverbType { /** - Disable reverb */ TXLiveVoiceReverbType_0 = 0, /** - KTV */ TXLiveVoiceReverbType_1 = 1, /** - Small room */ TXLiveVoiceReverbType_2 = 2, /** - Hall */ TXLiveVoiceReverbType_3 = 3, /** - Deep */ TXLiveVoiceReverbType_4 = 4, /** - Resonant */ TXLiveVoiceReverbType_5 = 5, /** - Metallic */ TXLiveVoiceReverbType_6 = 6, /** - Husky */ TXLiveVoiceReverbType_7 = 7 } export declare enum TXSystemVolumeType { /** - Auto: In the auto mode, call volume is used for anchors, and media volume for audience. This mode is suitable for live streaming scenarios. - If the scenario you select during `enterRoom` is `TRTC_APP_SCENE_LIVE` or `TRTCAppSceneVoiceChatRoom` , the SDK will automatically use this mode. */ TXSystemVolumeTypeAuto = 0, /** - Media volume: In this mode, media volume is used in all scenarios. It is rarely used, mainly suitable for music scenarios with demanding requirements on audio quality. - Use this mode if most of your users use peripheral devices such as audio cards. Otherwise, it is not recommended. */ TXSystemVolumeTypeMedia = 1, /** - Call volume: In this mode, the audio module does not change its work mode when users switch between anchors and audience, enabling seamless mic on/off. This mode is suitable for scenarios where users need to switch frequently between anchors and audience. - If the scenario you select during `enterRoom` is `TRTC_APP_SCENE_VIDEOCALL` or `TRTC_APP_SCENE_AUDIOCALL` , the SDK will automatically use this mode. */ TXSystemVolumeTypeVOIP = 2 } export declare enum TRTCRecordType { /** * Record audio only. */ TRTCRecordTypeAudio = 0, /** * Record video only. */ TRTCRecordTypeVideo = 1, /** * Record both audio and video simultaneously. */ TRTCRecordTypeBoth = 2 } /** - Background music playback information */ export type AudioMusicParam = { /** - music ID */ id: number; /** - absolute path of the music file or url.the mp3,aac,m4a,wav supported. */ path: string; /** - number of times the music track is looped - Valid values: 0 or any positive integer. 0 (default) indicates that the music is played once, 1 twice, and so on. */ loopCount?: number; /** - whether to send the music to remote users - Valid values: `true` remote users can hear the music played locally; `false` (default) only the local user can hear the music. */ publish?: boolean; /** - whether the music played is a short music track - Valid values: `true` short music track that needs to be looped; `false` (default) normal-length music track */ isShortFile?: boolean; /** - the point in time in milliseconds for starting music playback */ startTimeMS?: number; /** - the point in time in milliseconds for ending music playback. 0 indicates that playback continues till the end of the music track. */ endTimeMS?: number; }; /** - Recording parameter - - [Field description] File path (required), the preservation path of recording file. This path requires the user to designate by itself, please make sure the path exists and can be written. - - [Special Instructions] This path needs to be accurate to the file name and format suffix. The format suffix determines the format of the recording file. The current support format is PCM, WAV, and AAC. For example, the specified path is PATH/To/Audio.aac, a AAC format file is generated. Please specify a legal path with read and write permissions, otherwise the recording file cannot be generated. */ export type TRTCAudioRecordingParams = { filePath: string; }; /** - Push parameters required to be set when publishing audio/video streams to non-Tencent Cloud CDN */ export type TRTCPublishCDNParam = { /** - Field description: `appId` of Tencent Cloud CSS - Recommended value: please click Application Management > Application Information in the [TRTC console](https://console.tencentcloud.com/trtc) and get the appId in Relayed Live Streaming Info . */ appId: number; /** - Field description: `bizId` of Tencent Cloud CSS - Recommended value: please click Application Management > Application Information in the [TRTC console](https://console.tencentcloud.com/trtc) and get the appId in Relayed Live Streaming Info . */ bizId: number; /** - Field description: specify the push address (in RTMP format) of this audio/video stream at the third-party live streaming service provider - Recommended value: the push URL rules vary greatly by service provider. Please enter a valid push URL according to the requirements of the target service provider. TRTC's backend server will push audio/video streams in the standard format to the third-party service provider according to the URL you enter. */ url: string; }; export type TRTCSpeedTestParams = { /** - Expected downstream bandwidth */ expectedDownBandwidth: number; /** - Expected Upstream Bandwidth */ expectedUpBandwidth: number; /** - Speed ​​test scenario */ scene: number; /** - Application Identification */ sdkAppId: number; /** - User ID */ userId: string; /** - User Signature */ userSig: string; }; export type TRTCLocalRecordingParams = { /** * The address (path) where the recording will be saved (Required). * @note Please ensure this path has both read and write permissions and is valid. If the path is invalid or permissions are insufficient, the recording file cannot be generated. */ filePath: string; /** * media recording type. The default value is TRTCRecordType.TRTCRecordTypeBoth, which means both audio and video will be recorded simultaneously. */ recordType?: TRTCRecordType; /** * Recording information update frequency. The unit is milliseconds (ms), with a valid range of [1000, 10000]. The default value is -1, which means no callback will be executed. */ interval?: number; /** * Maximum duration per recorded file segment. The unit is milliseconds (ms), with a minimum value of 10000. The default value is 0, which indicates that the recording will not be split into segments. */ maxDurationPerFile?: number; }; //# sourceMappingURL=trtc_cloud_def.d.ts.map