API | Description |
Gets a singleton object. | |
Terminates a singleton object. | |
Sets event callbacks. |
API | Description |
Creates a room (called by host). | |
Closes the room (called by host). | |
Enters a room (called by participant) | |
Leaves a room (called by participant). | |
Gets the room information. | |
Gets the information of all users in the room. | |
Gets the information of a user. | |
Transfers the host permissions to another user (called by host). |
API | Description |
Enables preview of the local video. | |
Stops local video capturing and preview. | |
Enables mic capturing. | |
Stops mic capturing. | |
Sets the mirror mode for local video preview. | |
Sets whether to play sound from the device’s speaker or receiver. |
API | Description |
Subscribes to and plays back the remote video image of a specified member. | |
Unsubscribes from and stops the playback of a remote video image. |
API | Description |
Sends a chat message. | |
Sends a custom message. |
API | Description |
Enables/Disables the mic of a specified user. | |
Enables/Disables the mics of all users and syncs the status to room information. | |
Enables/Disables the camera of a specified user. | |
Enables/Disables the cameras of all users and syncs the status to room information. | |
Disables/Enables chat messages (called by host). | |
Removes a specified user from the room (called by host). | |
Starts a roll call (called by host). | |
Stops a roll call (called by host). | |
Replies to a roll call (called by participant). | |
Sends a speech invitation to a participant (called by host). | |
Cancels a speech invitation sent to a participant (called by host). | |
Accepts/Rejects the speech invitation of the host (called by participant). | |
Sends a speech request (called by participant). | |
Approves/Rejects the speech request of a participant (called by host). | |
Disables requests to speak (called by host). | |
Stops the speech of a participant (called by host). | |
Stops the speech of all members in the room (called by host). | |
Exits the speaker mode (called by participant). |
API | Description |
Starts screen sharing. | |
Stops screen sharing. |
API | Description |
API | Description |
Sets network QoS control parameters. |
API | Description |
Gets the SDK version. |
API | Description |
Callback for error. |
API | Description |
The room was closed. | |
The audio volume of a user. | |
The host changed. |
API | Description |
A remote user entered the room. | |
A remote user exited the room. | |
A remote user turned on/off their camera. | |
A remote user started/stopped screen sharing. | |
A remote user turned on/off their mic. | |
A remote user started speaking. | |
A remote user stopped speaking. |
API | Description |
A text chat message was received. | |
A custom message was received. |
API | Description |
A participant received a speech invitation from the host. | |
The speech invitation sent to a participant was canceled by the host. | |
The host received a speech request from a participant. | |
A participant canceled a speech request. | |
The host disabled requests to speak. | |
A participant was asked to stop speaking. | |
The host started a roll call (received by participants) | |
The host stopped a roll call (received by participants). | |
A participant replied to the roll call (received by the host). | |
The host disabled/enabled chat messages. | |
The host disabled mic use. | |
The host disabled camera use. | |
The host removed a participant from the room (received by the participant). |
API | Description |
Statistics on technical metrics. | |
Network quality. |
API | Description |
Screen sharing started. | |
Screen sharing stopped. |
public static TUIRoomCore getInstance(Context context);
Parameter | Type | Description |
context | Context | Android context, which will be converted to ApplicationContext for the calling of system APIs. |
void destroyInstance();
TUIRoomCoreListener
to get the callbacks.void setListener(TUIRoomCoreListener listener);
Parameter | Type | Description |
listener | TUIRoomCoreListener | The event callback class. |
void createRoom(String roomId, TUIRoomCoreDef.SpeechMode speechMode, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
roomId | String | The room ID. You need to assign and manage the IDs in a centralized manner. |
speechMode | TUIRoomCoreDef.SpeechMode | The speech mode. |
callback | TUIRoomCoreCallback.ActionCallback | The result of room creation. |
createRoom()
to create a room, the result of which is returned via TUIRoomCoreCallback.ActionCallback
.startCameraPreview()
to enable camera capturing and preview.startLocalAudio()
to enable the local mic.void destroyRoom(TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
callback | UIRoomCoreCallback.ActionCallback | The room closing result. |
void enterRoom(String roomId, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
roomId | String | The room ID. |
callback | UIRoomCoreCallback.ActionCallback | The result. |
enterRoom
(passing in roomId
) to enter the room.startCameraPreview()
to enable camera preview and calls startLocalAudio()
to enable mic capturing.onRemoteUserCameraAvailable
callback and calls startRemoteView()
to start playback.void leaveRoom(TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
callback | UIRoomCoreCallback.ActionCallback | The result. |
TUIRoomCoreDef.RoomInfo getRoomInfo();
List<TUIRoomCoreDef.UserInfo> getRoomUsers();
void getUserInfo(String userId, TUIRoomCoreCallback.UserInfoCallback callback);
Parameter | Type | Description |
userId | String | The user ID. |
callback | UIRoomCoreCallback.UserInfoCallback | The room member details. |
void setSelfProfile(String userName, String avatarURL, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
userName | String | The username. |
avatarURL | String | The URL of the user profile photo. |
callback | TUIRoomCoreCallback.ActionCallback | Whether the setting succeeded. |
void transferRoomMaster(String userId, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
userId | String | The user ID. |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void startCameraPreview(boolean isFront, TXCloudVideoView view);
Parameter | Type | Description |
isFront | boolean | true : Front camera; false : Rear camera |
view | TXCloudVideoView | The view that loads video images. |
void stopCameraPreview();
void startLocalAudio(int quality);
Parameter | Type | Description |
quality | int | The audio quality. Valid values: TRTC_AUDIO_QUALITY_MUSIC TRTC_AUDIO_QUALITY_DEFAULT TRTC_AUDIO_QUALITY_SPEECH. |
void stopLocalAudio();
void setVideoMirror(int type);
Parameter | Type | Description |
type | int | The mirror mode. |
void setSpeaker(boolean isUseSpeaker);
Parameter | Type | Description |
isUseSpeaker | boolean | true: Speaker; false: Receiver. |
void startRemoteView(String userId, TXCloudVideoView view, TUIRoomCoreDef.SteamType streamType, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
userId | String | The ID of the user whose video image is to be played back. |
view | TXCloudVideoView | The view that loads video images |
streamType | TUIRoomCoreDef.SteamType | The stream type. |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void stopRemoteView(String userId, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
userId | String | The ID of the user whose video image is to be stopped. |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void switchCamera(boolean isFront);
Parameter | Type | Description |
isFront | boolean | true: Front camera; false: Rear camera. |
void sendChatMessage(String message, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
message | String | The message content. |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void sendCustomMessage(String data, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
data | String | The message content. |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void muteUserMicrophone(String userId, boolean mute, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
userId | String | The user ID. |
mute | boolean | Whether to disable. |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void muteAllUsersMicrophone(boolean mute, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
mute | boolean | Whether to disable. |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void muteUserCamera(String userId, boolean mute, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
userId | String | The user ID. |
mute | boolean | Whether to disable. |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void muteAllUsersCamera(boolean mute, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
mute | boolean | Whether to disable. |
callback | TUIRoomCoreCallback.ActionCallback | Callback of the result. |
void muteChatRoom(boolean mute, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
mute | boolean | Whether to disable. |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void kickOffUser(String userId, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
userId | String | The user ID. |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void startCallingRoll(TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void stopCallingRoll(TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void replyCallingRoll(TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void sendSpeechInvitation(String userId, TUIRoomCoreCallback.InvitationCallback callback);
Parameter | Type | Description |
userId | String | The user ID. |
callback | TUIRoomCoreCallback.InvitationCallback | The result. |
void cancelSpeechInvitation(String userId, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
userId | String | The user ID. |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void replySpeechInvitation(boolean agree, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
agree | bool | Whether to accept. |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void sendSpeechApplication(TUIRoomCoreCallback.InvitationCallback callback);
Parameter | Type | Description |
callback | TUIRoomCoreCallback.InvitationCallback | The result. |
void cancelSpeechApplication(TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void replySpeechApplication(boolean agree, String userId, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
agree | boolean | Whether to approve. |
userId | String | The user ID. |
callback | TUIRoomCoreCallback.ActionCallback | Callback of the result. |
void forbidSpeechApplication(boolean forbid, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
forbid | boolean | Whether to disable. |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void sendOffSpeaker(String userId, TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
userId | String | The user ID. |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void sendOffAllSpeakers(TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void exitSpeechState(TUIRoomCoreCallback.ActionCallback callback);
Parameter | Type | Description |
callback | TUIRoomCoreCallback.ActionCallback | The result. |
void startScreenCapture(TRTCCloudDef.TRTCVideoEncParam encParams, TRTCCloudDef.TRTCScreenShareParams screenShareParams);
Parameter | Type | Description |
encParams | TRTCCloudDef.TRTCVideoEncParam | Screen sharing encoding parameters. We recommend you use the above configuration. If you set encParams to null , the encoding parameter settings before startScreenCapture is called will be used. |
screenShareParams | TRTCCloudDef.TRTCScreenShareParams | Special screen sharing configuration. We recommend you set this to floatingView , which can prevent the application from being closed by the system and help protect user privacy. |
void stopScreenCapture();
TXBeautyManager getBeautyManager();
void setVideoQosPreference(TRTCCloudDef.TRTCNetworkQosParam preference);
Parameter | Type | Description |
preference | TRTCNetworkQosParam | The network QoS policy. |
void setAudioQuality(int quality);
Parameter | Type | Description |
quality | int |
void setVideoResolution(int resolution);
Parameter | Type | Description |
resolution | int |
void setVideoFps(int fps);
Parameter | Type | Description |
fps | int | The video capturing frame rate. |
void setVideoBitrate(int bitrate);
Parameter | Type | Description |
bitrate | int | The bitrate. The SDK encodes streams at the target video bitrate. However, it may reduce the bitrate if network conditions are poor. For more information, see TRTC SDK. |
TRTCVideoResolution
value. For a better viewing experience, you can slightly increase the bitrate. For example, the recommended bitrate for TRTC_VIDEO_RESOLUTION_1280_720
is 1,200 Kbps. You can set the bitrate to 1,500 Kbps.void enableAudioEvaluation(boolean enable);
Parameter | Type | Description |
enable | boolean | true: Enable; false: Disable. |
onUserVolumeUpdate
callback.void setAudioPlayVolume(int volume);
Parameter | Type | Description |
volume | int | The payback volume. Value range: 0-100. Default value: 100. |
void setAudioCaptureVolume(int volume);
Parameter | Type | Description |
volume | int | The capturing volume. Value range: 0-100. Default value: 100. |
void startFileDumping(TRTCCloudDef.TRTCAudioRecordingParams trtcAudioRecordingParams);
Parameter | Type | Description |
trtcAudioRecordingParams | TRTCCloudDef.TRTCAudioRecordingParams |
leaveRoom
is called, audio recording will stop automatically.void stopFileDumping();
int getSdkVersion();
void onError(int code, String message);
Parameter | Type | Description |
code | int | The error code |
message | String | The error message. |
void onDestroyRoom();
void onUserVoiceVolume(String userId, int volume);
Parameter | Type | Description |
userId | String | The user ID. |
volume | int | The volume. Value range: 0-100. |
void onRoomMasterChanged(String previousUserId, String currentUserId);
Parameter | Type | Description |
previousUserId | String | The host’s user ID before the change. |
currentUserId | String | The host’s user ID after the change. |
void onRemoteUserEnter(String userId);
Parameter | Type | Description |
userId | String | The user ID. |
void onRemoteUserLeave(String userId);
Parameter | Type | Description |
userId | String | The user ID. |
void onRemoteUserCameraAvailable(String userId, boolean available);
Parameter | Type | Description |
userId | String | The user ID. |
available | boolean | true: Enabled; false: Disabled. |
void onRemoteUserScreenVideoAvailable(String userId, boolean available);
Parameter | Type | Description |
userId | String | The User ID. |
available | boolean | Whether the user enabled/disabled screen sharing. |
void onRemoteUserAudioAvailable(String userId, boolean available);
Parameter | Type | Description |
userId | String | The user ID. |
available | boolean | Whether the user enabled/disabled their mic. |
void onRemoteUserEnterSpeechState(String userId);
Parameter | Type | Description |
userId | String | The user ID. |
void onRemoteUserExitSpeechState(String userId);
Parameter | Type | Description |
userId | String | The user ID. |
void onReceiveChatMessage(String userId, String message);
Parameter | Type | Description |
userId | String | The user ID. |
message | String | The message content. |
void onReceiveRoomCustomMsg(String userId, String data);
Parameter | Type | Description |
userId | String | The user ID. |
message | String | The custom message content. |
void onReceiveSpeechInvitation(String userId);
Parameter | Type | Description |
userId | String | The host's user ID. |
void onReceiveInvitationCancelled(String userId);
Parameter | Type | Description |
userId | String | The host's user ID. |
void onReceiveSpeechApplication(String userId);
Parameter | Type | Description |
userId | String | The user ID. |
void onSpeechApplicationCancelled(String userId);
Parameter | Type | Description |
userId | String | The user ID. |
void onSpeechApplicationForbidden(boolean isForbidden);
Parameter | Type | Description |
isForbidden | boolean | Whether to disable. |
void onOrderedToExitSpeechState(String userId);
Parameter | Type | Description |
userId | String | The host's user ID. |
void onCallingRollStarted(String userId);
void onCallingRollStopped(String userId);
void onMemberReplyCallingRoll(String userId);
Parameter | Type | Description |
userId | String | The user ID. |
void onChatRoomMuted(boolean muted);
Parameter | Type | Description |
muted | boolean | Disabled or not. |
void onMicrophoneMuted(boolean muted);
Parameter | Type | Description |
muted | boolean | Disabled or not. |
void onCameraMuted(boolean muted);
Parameter | Type | Description |
muted | boolean | Disabled or not. |
void onReceiveKickedOff(String userId);
Parameter | Type | Description |
userId | String | The user ID of the host/admin. |
void onStatistics(TRTCStatistics statistics);
Parameter | Type | Description |
statis | TRTCStatistics | Statistics. |
void onNetworkQuality(TRTCCloudDef.TRTCQuality localQuality, List<TRTCCloudDef.TRTCQuality> remoteQuality);
Parameter | Type | Description |
localQuality | TRTCCloudDef.TRTCQuality | The upstream network quality. |
remoteQuality | List&lt;TRTCCloudDef.TRTCQuality&gt; | The downstream network quality. |
void onScreenCaptureStarted();
void onScreenCaptureStopped(int reason);
Parameter | Type | Description |
reason | int | The reason. 0: The user stopped screen sharing; 1: Screen sharing was interrupted by another application. |
Was this page helpful?