tencent cloud

Tencent Real-Time Communication

소식 및 공지 사항
제품 업데이트
Tencent Cloud 오디오/비디오 단말 SDK 재생 업그레이드 및 권한 부여 인증 추가
TRTC 월간 구독 패키지 출시 관련 안내
제품 소개
제품 개요
기본 개념
제품 기능
제품 장점
응용 시나리오
성능 데이터
구매 가이드
Billing Overview
무료 시간 안내
Monthly subscription
Pay-as-you-go
TRTC Overdue and Suspension Policy
과금 FAQ
Refund Instructions
신규 사용자 가이드
Demo 체험
Call
개요(TUICallKit)
Activate the Service
Run Demo
빠른 통합(TUICallKit)
오프라인 푸시
Conversational Chat
온클라우드 녹화(TUICallKit)
AI Noise Reduction
UI 사용자 정의
Calls integration to Chat
Additional Features
No UI Integration
Server APIs
Client APIs
Solution
ErrorCode
릴리스 노트
FAQs
라이브 스트리밍
Billing of Video Live Component
Overview
Activating the Service (TUILiveKit)
Demo 실행
No UI Integration
UI Customization
Live Broadcast Monitoring
Video Live Streaming
Voice Chat Room
Advanced Features
Client APIs
Server APIs
Error Codes
Release Notes
FAQs
RTC Engine
Activate Service
SDK 다운로드
API 코드 예시
Usage Guidelines
API 클라이언트 API
고급 기능
RTC RESTFUL API
History
Introduction
API Category
Room Management APIs
Stream mixing and relay APIs
On-cloud recording APIs
Data Monitoring APIs
Pull stream Relay Related interface
Web Record APIs
AI Service APIs
Cloud Slicing APIs
Cloud Moderation APIs
Making API Requests
Call Quality Monitoring APIs
Usage Statistics APIs
Data Types
Appendix
Error Codes
콘솔 가이드
애플리케이션 관리
사용량 통계
모니터링 대시보드
개발 보조
Solution
Real-Time Chorus
FAQs
과금 개요
기능 관련
UserSig 관련
방화벽 제한 처리
설치 패키지 용량 축소 관련 질문
Andriod 및 iOS 관련
Web 관련
Flutter 관련
Electron 관련
TRTCCalling Web 관련
멀티미디어 품질 관련
기타 질문
Protocols and Policies
컴플라이언스 인증
보안 백서
정보 보안에 관한 참고 사항
Service Level Agreement
Apple Privacy Policy: PrivacyInfo.xcprivacy
TRTC 정책
개인 정보 보호 정책
데이터 처리 및 보안 계약
용어집

TUICallEngine

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2025-02-26 14:17:50

TUICallEngine APIs

TUICallEngine is an audio/video call component that does not include UI elements. If TUICallKit does not meet your requirements, you can use the APIs of TUICallEngine to customize your project.

Overview

API
Description
Creates a TUICallEngine instance (singleton mode).
Terminates a TUICallEngine instance (singleton mode).
login
Authenticates the basic audio/video call capabilities.
on
Registers an event listener.
off
Unregisters an event listener.
call
Makes a one-to-one call.
accept
Accepts a call.
reject
Rejects a call.
ignore
Ignores a call.
hangup
Ends a call.
Changes the call type, for example, from video call to audio call.
Subscribes to the video stream of a remote user.
Unsubscribes from the video stream of a remote user.
Turns the camera on.
Switches between the front and rear cameras.
Turns the camera off.
Turns the mic on.
Turns the mic off.
Selects the audio playback device (receiver or speaker).
Set the rendering mode of video image.
Set the encoding parameters of video encoder.
Set beauty level, support turning off default beauty.
Sets the alias and profile photo.
Sets whether to enable multi-device login for TUICallEngine

Details

CreateInstance

This API is used to create a TUICallEngine singleton.
TUICallKit.CreateInstance();

destroyInstance

This API is used to terminate a TUICallEngine singleton.
TUICallKit.destroyInstance();

login

This API is used to initialize TUICallEngine. Call it to authenticate the call service and perform other required actions before you call other APIs.
login(
sdkAppId: number;
userId: string;
userSig: string;
onSuccess?: (data: String) => void;
onError?: (errCode: number, errMsg: string) => void;
): void {}
Parameter
Type
Description
sdkAppId
Number
The unique identifier SDKAppID for the audio and video application created in Tencent RTC Console.
userId
String
Customers define their own User ID based on their business. You can only include letters (a-z, A-Z), digits (0-9), underscores, and hyphens.
userSig
String
SDKSecretKey for the audio and video application created in Tencent RTC Console.

on

This API is used to register an event listener to listen for TUICallEvents events.
on(type: TUICallEvent, listener: (params: any) => void): void {}
Parameter
Type
Description
type
TUICallEvent
Registers an event listener.

off

This API is used to unregister an event listener.
off(type: TUICallEvent): void {}
Parameter
Type
Description
type
TUICallEvent
Unregister an event listener.

call

This API is used to make a (one-to-one) call.
call(
userId: string;
mediaType: MediaType;
callParams?: CallParams;
onSuccess?: (data: String) => void;
onError?: (errCode: number, errMsg: string) => void;
): void {}
Parameter
Type
Description
userId
string
The target user ID.
mediaType
MediaType
which can be video or audio. For details, please refer to MediaType.
callParams
An additional parameter, such as roomID, call timeout, offline push info,etc.For details, please refer to callParams

accept

This API is used to accept a call. After receiving the onCallReceived() callback, you can call this API to accept the call.
accept(
onSuccess?: (data: String) => void;
onError?: (errCode: number, errMsg: string) => void;
): void {}

reject

This API is used to reject a call. After receiving the onCallReceived() callback, you can call this API to reject the call.
reject(
onSuccess?: (data: String) => void;
onError?: (errCode: number, errMsg: string) => void;
): void {}

ignore

This API is used to ignore a call. After receiving the onCallReceived(), you can call this API to ignore the call. The caller will receive the onUserLineBusy callback.
ignore(
onSuccess?: (data: String) => void;
onError?: (errCode: number, errMsg: string) => void;
): void {}

hangup

This API is used to end a call.
hangup(
onSuccess?: (data: String) => void;
onError?: (errCode: number, errMsg: string) => void;
): void {}

switchCallMediaType

This API is used to change the call type.
switchCallMediaType(mediaType: MediaType): void {}
Parameter
Type
Description
mediaType
MediaType
The call type, which can be video or audio. For details, For details, please refer to MediaType.

startRemoteView

This API is used to subscribe to the video stream of a remote user. For it to work, make sure you call it after setRenderView.
startRemoteView(
userId: string;
viewId: string;
onPlaying: (params: any) => void;
onLoading: (params: any) => void;
): void {}
Parameter
Type
Description
userId
string
The target user ID.
viewId
string
The target view ID.

stopRemoteView

This API is used to unsubscribe from the video stream of a remote user.
stopRemoteView(userId: string;): void {}
Parameter
Type
Description
userId
string
The target user ID.

openCamera

This API is used to turn the camera on.
openCamera(
camera?: Camera;
viewId: string;
onSuccess?: (data: String) => void;
onError?: (errCode: number, errMsg: string) => void;): void {}
Parameter
Type
Description
camera
Camera
This parameter is used to set the front and back cameras.
Camera.Front: Front camera.
Camera.Back: Rear camera.
viewId
string
The target view ID. We recommend that you set the view ID to the user's user ID

switchCamera

This API is used to switch between the front and rear cameras.
switchCamera(camera: Camera): void {}
Parameter
Type
Description
camera
Camera
This parameter is used to set the front and back cameras.
Camera.Front: Front camera.
Camera.Back: Rear camera.

closeCamera

This API is used to turn the camera off.
closeCamera(): void {}

openMicrophone

This API is used to turn the mic on.
openMicrophone(
onSuccess?: (data: String) => void;
onError?: (errCode: number, errMsg: string) => void;
): void {}

closeMicrophone

This API is used to turn the mic off.
closeMicrophone(
onSuccess?: (data: String) => void;
onError?: (errCode: number, errMsg: string) => void;
): void {}

selectAudioPlaybackDevice

This API is used to select the audio playback device (receiver or speaker). In call scenarios, you can use this API to turn on/off hands-free mode.
selectAudioPlaybackDevice(
device: AudioPlaybackDevice;
onSuccess?: (data: String) => void;
onError?: (errCode: number, errMsg: string) => void;
): void {}
Parameter
Type
Description
device
This parameter is used to set the front and back cameras.
AudioPlaybackDevice.Earpiece
AudioPlaybackDevice.Speakerphone

setVideoRenderParams

Set the rendering mode of video image.
setVideoRenderParams(
userId: string;
videoRender?: {
fillMode?: FillMode;
rotation?: Rotation;
};
onSuccess?: (data: String) => void;
onError?: (errCode: number, errMsg: string) => void;
): void {}
Parameter
Type
Description
userId
string
The target user ID.
fillMode
FillMode
the video image will be centered and scaled to fill the entire display area, where parts that exceed the area will be cropped. The displayed image may be incomplete in this mode.

rotation
Rotation
Rotation.Rotation_0: No rotation
Rotation.Rotation_90: Clockwise rotation by 90 degrees
Rotation.Rotation_180: Clockwise rotation by 180 degrees
Rotation.Rotation_270: Clockwise rotation by 0 degrees

setVideoEncoderParams

Set the encoding parameters of video encoder.
This setting can determine the quality of image viewed by remote users, which is also the image quality of on-cloud recording files.
setVideoEncoderParams(
videoEncoder?: {
resolution?: Resolution;
resolutionMode?: ResolutionMode;
};
onSuccess?: (data: String) => void;
onError?: (errCode: number, errMsg: string) => void;
): void {}
Parameter
Type
Description
resolution
Video resolution
resolutionMode
Video aspect ratio mode

setBeautyLevel

Set beauty level, support turning off default beauty.
setBeautyLevel(
level: number;
onSuccess?: (data: String) => void;
onError?: (errCode: number, errMsg: string) => void;
): void {}
Parameter
Type
Description
level
number
Beauty level,range: 0 - 9, 0 means turning off the effect, 9 means the most obvious effect.

setSelfInfo

This API is used to set the alias and profile photo. The alias cannot exceed 500 bytes, and the profile photo is specified by a URL.
setSelfInfo(
nickname: string;
avatar?: string;
onSuccess?: (data: String) => void;
onError?: (errCode: number, errMsg: string) => void;
): void {}
Parameter
Type
Description
nickname
string
The alias.
avatar
string
The URL of the profile photo.

enableMultiDeviceAbility

This API is used to set whether to enable multi-device login for TUICallEngine (supported by the Group Call package).
enableMultiDeviceAbility(
enable: boolean;
onSuccess?: (data: String) => void;
onError?: (errCode: number, errMsg: string) => void;
): void {}
Parameter
Type
Description
enable
boolean
set whether to enable multi-device login for TUICallEngine

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백