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 the preview image of 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 room 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 room members (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 enabled/disabled 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. |
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. |
+ (instancetype)shareInstance;
+ (void)destroyInstance;
TUIRoomCoreDelegate
to get the callbacks.- (void)setDelegate:(id<TUIRoomCoreDelegate>)delegate;
Parameter | Type | Description |
delegate | TUIRoomCoreDelegate | The event callback class. |
- (void)createRoom:(NSString *)roomIdspeechMode:(TUIRoomSpeechMode)speechModecallback:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
roomId | NSString | The room ID. You need to assign and manage the IDs in a centralized manner. |
speechMode | TUIRoomSpeechMode | The speech mode. |
callback | TUIRoomActionCallback | The room creation result. |
createRoom()
to create a room, the result of which is returned via TUIRoomActionCallback
.startCameraPreview()
to enable camera capturing and preview.startLocalAudio()
to enable the local mic.- (void)destroyRoom:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
callback | TUIRoomActionCallback | The room closing result. |
- (void)enterRoom:(NSString *)roomIdcallback:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
roomId | NSString | The room ID. |
callback | TUIRoomActionCallback | 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:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
callback | TUIRoomActionCallback | The result. |
- (nullable TUIRoomInfo *)getRoomInfo;
- (nullable NSArray<TUIRoomUserInfo *> *)getRoomUsers;
- (void)getUserInfo:(NSString *)userIdcallback:(TUIRoomUserInfoCallback)callback;
Parameter | Type | Description |
userId | NSString | The user ID. |
callback | TUIRoomUserInfoCallback | Room member details. |
- (void)setSelfProfile:(NSString *)userNameavatarURL:(NSString *)avatarURLcallback:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
userName | NSString | The username. |
avatarURL | NSString | The URL of the user profile photo. |
callback | TUIRoomActionCallback | Whether the setting succeeded. |
- (void)transferRoomMaster:(NSString *)userIdcallback:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
userId | NSString | The user ID. |
callback | TUIRoomActionCallback | The result. |
- (void)startCameraPreview:(BOOL)isFrontview:(UIView *)view;
Parameter | Type | Description |
isFront | BOOL | YES: Front camera; NO: Rear camera. |
view | UIView | Control that carries the video image. |
- (void)stopCameraPreview;
- (void)startLocalAudio:(TRTCAudioQuality)quality;
Parameter | Type | Description |
quality | TRTCAudioQuality | The sound quality. |
- (void)stopLocalAudio;
- (void)setVideoMirror:(TRTCVideoMirrorType)type;
Parameter | Type | Description |
type | TRTCVideoMirrorType | The mirror mode. |
- (void)setSpeaker:(BOOL)isUseSpeaker;
Parameter | Type | Description |
isUseSpeaker | BOOL | YES: Speaker; NO: Receiver. |
- (void)startRemoteView:(NSString *)userIdview:(UIView *)viewstreamType:(TUIRoomStreamType)streamTypecallback:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
userId | NSString | The ID of the user whose video image is to be played back. |
view | UIView | The view that loads video images. |
streamType | TUIRoomStreamType | The stream type. |
callback | TUIRoomActionCallback | The result. |
- (void)stopRemoteView:(NSString *)userIdstreamType:(TUIRoomStreamType)streamTypecallback:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
userId | NSString | The ID of the user whose video image is to be stopped. |
streamType | TUIRoomStreamType | The stream type. |
callback | TUIRoomActionCallback | The result. |
- (void)switchCamera:(BOOL)isFront;
Parameter | Type | Description |
isFront | BOOL | YES: Front camera; NO: Rear camera. |
- (void)sendChatMessage:(NSString *)messagecallback:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
message | NSString | The message content. |
callback | TUIRoomActionCallback | The result. |
- (void)muteUserMicrophone:(NSString *)userIdmute:(BOOL)mutecallback:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
userId | NSString | The user ID. |
mute | BOOL | Whether to disable. |
callback | TUIRoomActionCallback | The result. |
- (void)muteAllUsersMicrophone:(BOOL)mutecallback:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
mute | BOOL | Whether to disable. |
callback | TUIRoomActionCallback | The result. |
- (void)muteUserCamera:(NSString *)userIdmute:(BOOL)mutecallback:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
userId | NSString | The user ID. |
mute | BOOL | Whether to disable. |
callback | TUIRoomActionCallback | The result. |
- (void)muteAllUsersCamera:(BOOL)mutecallback:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
mute | BOOL | Whether to disable. |
callback | TUIRoomActionCallback | The result. |
- (void)muteChatRoom:(BOOL)mutecallback:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
mute | BOOL | Whether to disable. |
callback | TUIRoomActionCallback | The result. |
- (void)kickOffUser:(NSString *)userIdcallback:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
userId | NSString | The user ID. |
callback | TUIRoomActionCallback | The result. |
- (void)startCallingRoll:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
callback | TUIRoomActionCallback | The result. |
- (void)stopCallingRoll:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
callback | TUIRoomActionCallback | The result. |
- (void)replyCallingRoll:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
callback | TUIRoomActionCallback | The result. |
- (void)sendSpeechInvitation:(NSString *)userIdcallback:(TUIRoomInviteeCallback)callback
Parameter | Type | Description |
userId | NSString | The user ID. |
callback | TUIRoomInviteeCallback | The result. |
- (void)cancelSpeechInvitation:(NSString *)userIdcallback:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
userId | NSString | The user ID. |
callback | TUIRoomActionCallback | The result. |
- (void)replySpeechInvitation:(BOOL)agreecallback:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
agree | bool | Whether to approve. |
callback | TUIRoomActionCallback | The result. |
- (void)sendSpeechApplication:(TUIRoomInviteeCallback)callback;
Parameter | Type | Description |
callback | TUIRoomInviteeCallback | The result. |
- (void)cancelSpeechApplication:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
callback | TUIRoomActionCallback | The result. |
- (void)replySpeechApplication:(BOOL)agreeuserId:(NSString *)userIdcallback:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
agree | BOOL | Whether to approve. |
userId | NSString | The user ID. |
callback | TUIRoomActionCallback | The result. |
- (void)forbidSpeechApplication:(BOOL)forbidcallback:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
forbid | BOOL | Whether to disable. |
callback | TUIRoomActionCallback | The result. |
- (void)sendOffSpeaker:(NSString *)userIdcallback:(TUIRoomInviteeCallback)callback;
Parameter | Type | Description |
userId | NSString | The user ID. |
callback | TUIRoomInviteeCallback | The result. |
- (void)sendOffAllSpeakers:(TUIRoomInviteeCallback)callback;
Parameter | Type | Description |
callback | TUIRoomInviteeCallback | The result. |
- (void)exitSpeechState:(TUIRoomActionCallback)callback;
Parameter | Type | Description |
callback | TUIRoomActionCallback | The result. |
- (void)startScreenCapture:(TRTCVideoEncParam *)encParam API_AVAILABLE(ios(11.0));
Parameter | Type | Description |
encParams | TRTCVideoEncParam | Sets encoding parameters for screen sharing. |
- (void)stopScreenCapture API_AVAILABLE(ios(11.0));
- (TXBeautyManager *)getBeautyManager;
- (void)setVideoQosPreference:(TRTCNetworkQosParam *)preference;
Parameter | Type | Description |
preference | TRTCNetworkQosParam | The network QoS policy. |
- (void)setAudioQuality:(TRTCAudioQuality)quality;
Parameter | Type | Description |
quality | TRTCAudioQuality |
- (void)setVideoResolution:(TRTCVideoResolution)resolution;
Parameter | Type | Description |
resolution | TRTCVideoResolution |
- (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:(BOOL)enable;
Parameter | Type | Description |
bEnable | BOOL | YES: Enable. NO: Disable. |
onUserVolumeUpdate
callback.- (void)setAudioPlayVolume:(NSInteger)volume;
Parameter | Type | Description |
volume | int | The playback volume. Value range: 0-100. Default value: 100. |
- (void)setAudioCaptureVolume:(NSInteger)volume;
Parameter | Type | Description |
volume | int | The capturing volume. Value range: 0-100. Default value: 100. |
- (void)startFileDumping:(TRTCAudioRecordingParams *)params;
Parameter | Type | Description |
params | TRTCAudioRecordingParams |
leaveRoom
is called, audio recording will stop automatically.- (void)stopFileDumping;
- (NSInteger)getSdkVersion;
- (void)onError:(NSInteger)code message:(NSString *)message;
Parameter | Type | Description |
code | NSInteger | The error code. |
message | NSString | The error message. |
- (void)onDestroyRoom;
- (void)onUserVoiceVolume:(NSString *)userId volume:(NSInteger)volume;
Parameter | Type | Description |
userId | NSString | The user ID. |
volume | NSInteger | The volume. Value range: 0-100. |
- (void)onRoomMasterChanged:(NSString *)previousUserIdcurrentUserId:(NSString *)currentUserId;
Parameter | Type | Description |
previousUserId | NSString | The host’s user ID before the change. |
currentUserId | NSString | The host's user ID after the change. |
- (void)onRemoteUserEnter:(NSString *)userId;
Parameter | Type | Description |
userId | NSString | The user ID. |
- (void)onRemoteUserLeave:(NSString *)userId;
Parameter | Type | Description |
userId | NSString | The user ID. |
- (void)onRemoteUserCameraAvailable:(NSString *)userIdavailable:(BOOL)available;
Parameter | Type | Description |
userId | NSString | The user ID. |
available | BOOL | YES: Enabled; NO: Disabled. |
- (void)onRemoteUserScreenVideoAvailable:(NSString *)userIdavailable:(BOOL)available;
Parameter | Type | Description |
userId | NSString | The user ID. |
available | BOOL | Whether the user enabled/disabled screen sharing. |
- (void)onRemoteUserAudioAvailable:(NSString *)userIdavailable:(BOOL)available;
Parameter | Type | Description |
userId | NSString | User ID. |
available | BOOL | Whether the user enabled/disabled their mic. |
- (void)onRemoteUserEnterSpeechState:(NSString *)userId;
Parameter | Type | Description |
userId | NSString | The user ID. |
- (void)onRemoteUserExitSpeechState:(NSString *)userId;
Parameter | Type | Description |
userId | NSString | The user ID. |
- (void)onReceiveChatMessage:(NSString *)userId message:(NSString *)message;
Parameter | Type | Description |
userId | NSString | The user ID. |
message | NSString | The message content. |
- (void)onReceiveSpeechInvitation:(NSString *)userId;
Parameter | Type | Description |
userId | NSString | The host's user ID. |
- (void)onReceiveInvitationCancelled:(NSString *)userId;
Parameter | Type | Description |
userId | NSString | The host's user ID. |
void onReceiveSpeechApplication(String userId);
Parameter | Type | Description |
userId | NSString | User ID. |
- (void)onSpeechApplicationCancelled:(NSString *)userId;
Parameter | Type | Description |
userId | NSString | The user ID. |
- (void)onSpeechApplicationForbidden:(BOOL)isForbidden userId:(NSString *)userId;
Parameter | Type | Description |
isForbidden | BOOL | Disabled or not. |
userId | NSString | User ID. |
- (void)onOrderedToExitSpeechState:(NSString *)userId;
Parameter | Type | Description |
userId | NSString | The host's user ID. |
- (void)onCallingRollStarted:(NSString *)userId;
Parameter | Type | Description |
userId | NSString | The host's user ID. |
- (void)onCallingRollStopped:(NSString *)userId;
Parameter | Type | Description |
userId | NSString | The host's user ID. |
- (void)onMemberReplyCallingRoll:(NSString *)userId;
Parameter | Type | Description |
userId | NSString | The user ID. |
- (void)onChatRoomMuted:(BOOL)muted userId:(NSString *)userId;
Parameter | Type | Description |
muted | BOOL | Disabled or not. |
userId | NSString | The host's user ID. |
- (void)onMicrophoneMuted:(BOOL)muted userId:(NSString *)userId;
Parameter | Type | Description |
muted | BOOL | Disabled or not. |
userId | NSString | The host's user ID. |
- (void)onCameraMuted:(BOOL)muted userId:(NSString *)userId;
Parameter | Type | Description |
muted | BOOL | Disabled or not. |
userId | NSString | The host's user ID. |
- (void)onReceiveKickedOff:(NSString *)userId;
Parameter | Type | Description |
userId | NSString | The user ID of the host/admin. |
- (void)onStatistics:(TRTCStatistics *)statistics;
Parameter | Type | Description |
statis | TRTCStatistics | Statistics. |
- (void)onNetworkQuality:(TRTCQualityInfo *)localQuality remoteQuality:(NSArray<TRTCQualityInfo *> *)remoteQuality;
Parameter | Type | Description |
localQuality | TRTCQualityInfo | The upstream network quality. |
remoteQuality | NSArray<TRTCQualityInfo *> | The downstream network quality. |
- (void)onScreenCaptureStarted;
- (void)onScreenCaptureStopped:(NSInteger)reason;
Parameter | Type | Description |
reason | NSInteger | The reason. 0: The user stopped screen sharing; 1: Screen sharing was interrupted by another application. |
Was this page helpful?