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.API | Description |
Creates a TUICallEngine instance (singleton mode). | |
Terminates a TUICallEngine instance (singleton mode). | |
Authenticates the basic audio/video call capabilities. | |
Registers an event listener. | |
Unregisters an event listener. | |
Makes a one-to-one call. | |
Accepts a call. | |
Rejects a call. | |
Ignores a call. | |
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 |
TUICallKit.CreateInstance();
TUICallKit.destroyInstance();
login(sdkAppId: number;userId: string;userSig: string;onSuccess?: (data: String) => void;onError?: (errCode: number, errMsg: string) => void;): void {}
Parameter | Type | Description |
sdkAppId | Number | |
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 |
on(type: TUICallEvent, listener: (params: any) => void): void {}
Parameter | Type | Description |
type | TUICallEvent | Registers an event listener. |
off(type: TUICallEvent): void {}
Parameter | Type | Description |
type | TUICallEvent | Unregister an event listener. |
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 | ||
callParams | An additional parameter, such as roomID, call timeout, offline push info,etc.For details, please refer to callParams |
accept(onSuccess?: (data: String) => void;onError?: (errCode: number, errMsg: string) => void;): void {}
reject(onSuccess?: (data: String) => void;onError?: (errCode: number, errMsg: string) => void;): void {}
ignore(onSuccess?: (data: String) => void;onError?: (errCode: number, errMsg: string) => void;): void {}
hangup(onSuccess?: (data: String) => void;onError?: (errCode: number, errMsg: string) => void;): void {}
switchCallMediaType(mediaType: MediaType): void {}
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(userId: string;): void {}
Parameter | Type | Description |
userId | string | The target user ID. |
openCamera(camera?: Camera;viewId: string;onSuccess?: (data: String) => void;onError?: (errCode: number, errMsg: string) => void;): void {}
Parameter | Type | Description |
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(camera: Camera): void {}
Parameter | Type | Description |
camera | This parameter is used to set the front and back cameras. Camera.Front: Front camera. Camera.Back: Rear camera. |
closeCamera(): void {}
openMicrophone(onSuccess?: (data: String) => void;onError?: (errCode: number, errMsg: string) => void;): void {}
closeMicrophone(onSuccess?: (data: String) => void;onError?: (errCode: number, errMsg: string) => void;): void {}
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(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 | 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_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(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(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(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(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 |
Was this page helpful?