TRTCMeeting
has the following features based on Tencent Real-Time Communication (TRTC) and Tencent Cloud Chat:TRTCMeeting
is an open-source class depending on two closed-source Tencent Cloud SDKs. For the specific implementation process, see Group Audio/Video Room (Flutter).MeetingRoom
feature of the Chat SDK is used to implement chat rooms in meetings.API | Description |
Gets a singleton object. | |
Terminates a singleton object. | |
Sets an event listener. | |
Terminates an event listener. | |
Logs in. | |
Logs out. | |
Sets the profile. |
API | Description |
Creates meeting room (called by host). | |
Closes the meeting room (called by host). | |
Enters meeting room (called by participant). | |
Leaves meeting room (called by participant). | |
Gets the list of all users in the room. It takes effect only if it is called after enterMeeting() . | |
Gets the details of a specified user in the room. It takes effect only if it is called after enterMeeting() . |
API | Description |
Plays back the video of a specified remote member. | |
Stops playing back the video of a specified remote member. | |
Sets the rendering parameters of a remote video. | |
Mutes/Unmutes a specified remote member's audio. | |
Mutes/Unmutes all remote users. | |
Pauses/Resumes a specified remote member's video stream. | |
Pauses/Resumes receiving all remote video streams. |
API | Description |
Enables preview of the local video. | |
Stops local video capturing and preview. | |
Switches between the front and rear cameras. | |
Sets video encoder parameters. | |
Sets the mirror mode for local preview. |
API | Description |
Starts mic capturing. | |
Stops mic capturing. | |
Mutes/Unmutes local audio. | |
Sets whether to play sound from the device’s speaker or receiver. | |
Sets mic capturing volume. | |
Sets playback volume. | |
Starts audio recording. | |
Stops audio recording. | |
Enables volume reminder. |
API | Description |
Starts screen sharing. | |
Stops screen sharing. | |
Pauses screen sharing. | |
Resumes screen sharing. |
API | Description |
API | Description |
Broadcasts a text chat message in a meeting, which is generally used for chat. | |
Sends a custom text chat message. |
API | Description |
Callback for error. | |
Callback for warning. | |
You were kicked offline because another user logged in with the same account. |
API | Description |
The meeting room was closed. | |
Network status. | |
User volume. |
API | Description |
You entered the meeting. | |
You left the meeting. | |
A new member joined the meeting. | |
A member left the meeting. |
API | Description |
A member turned their mic on/off. | |
A member turned their camera on/off. | |
A member enabled/disabled the substream image. |
API | Description |
A text chat message was received. | |
A custom message was received. |
API | Description |
Screen sharing started. | |
Screen sharing paused. | |
Screen sharing resumed. | |
Screen sharing stopped. |
static Future<TRTCMeeting> sharedInstance();
static void destroySharedInstance();
TRTCMeeting
instance can no longer be used. You need to call sharedInstance again to get a new instance.TRTCMeetingDelegate
to get various status notifications of TRTCMeeting.void registerListener(MeetingListenerFunc func);
func
is the delegation callback of TRTCMeeting
.void unRegisterListener(MeetingListenerFunc func);
Future<ActionCallback> login(int sdkAppId, String userId, String userSig);
Parameter | Type | Description |
sdkAppId | int | |
userId | String | The ID of current user, which is a string that can contain only letters (a-z and A-Z), digits (0–9), hyphens (-), and underscores (_). |
userSig | String | Tencent Cloud's proprietary security signature. For how to calculate and use it, see FAQs > UserSig. |
Future<ActionCallback> logout();
Future<ActionCallback> setSelfProfile(String userName, String avatarURL);
Parameter | Type | Description |
userName | String | Username |
avatarURL | String | User profile photo URL. |
Future<ActionCallback> createMeeting(int roomId);
Parameter | Type | Description |
roomId | int | The meeting room ID. You need to assign and manage the IDs in a centralized manner. |
createMeeting()
and passes in roomId
to create a meeting, the result of which is returned via ActionCallback
. startCameraPreview()
to enable camera preview. At this time, the beauty filter parameters can be adjusted.startMicrophone()
to enable mic capturing.Future<ActionCallback> destroyMeeting(int roomId);
Parameter | Type | Description |
roomId | int | The meeting room ID. You need to assign and manage the IDs in a centralized manner. |
Future<ActionCallback> enterMeeting(int roomId);
Parameter | Type | Description |
roomId | int | The meeting room ID. |
enterMeeting()
and passes in roomId
to enter the meeting room.startCameraPreview()
to enable camera preview and calls startMicrophone()
to enable mic capturing.onUserVideoAvailable
event and calls startRemoteView()
and passes in the userId
of the target member to start playback.Future<ActionCallback> leaveMeeting();
enterMeeting()
.Future<UserListCallback> getUserInfoList(List<String> userIdList);
Parameter | Type | Description |
userIdList | List<String> | List of userId values to obtain. |
enterMeeting()
.Future<UserListCallback> getUserInfo(String userId);
Parameter | Type | Description |
userId | String | The user ID. |
Future<void> startRemoteView(String userId, int streamType, int viewId);
Parameter | Type | Description |
userId | String | The user ID. |
streamType | int | |
viewId | int | viewId generated by TRTCCloudVideoView |
Future<void> stopRemoteView(String userId, int streamType);
Parameter | Type | Description |
userId | String | The user ID. |
streamType | int |
Future<void> setRemoteViewParam(String userId, int streamType,{int fillMode, int rotation, int mirrorType});
Parameter | Type | Description |
userId | String | The user ID. |
streamType | int | |
fillMode | int | The video image rendering mode. Valid values: Fill (default) or Fit. For more information, see TRTC SDK. |
rotation | int | |
type | int |
Future<void> muteRemoteAudio(String userId, bool mute);
Parameter | Type | Description |
userId | String | The user ID. |
mute | boolean | true : Mute; false : Unmute |
Future<void> muteAllRemoteAudio(bool mute);
Parameter | Type | Description |
mute | boolean | true : Mute; false : Unmute |
Future<void> muteRemoteVideoStream(String userId, bool mute);
Parameter | Type | Description |
userId | String | The user ID. |
mute | boolean | true: Pause; false: Resume |
Future<void> muteAllRemoteVideoStream(bool mute);
Parameter | Type | Description |
mute | boolean | true: Pause; false: Resume |
Future<void> startCameraPreview(bool isFront, int viewId);
Parameter | Type | Description |
isFront | boolean | true: Front camera; false: Rear camera. |
viewId | int | viewId generated by TRTCCloudVideoView |
Future<void> stopCameraPreview();
Future<void> switchCamera(bool isFront);
Parameter | Type | Description |
isFront | boolean | true: Front camera; false: Rear camera. |
Future<void> setVideoEncoderParam({int videoFps,int videoBitrate,int videoResolution,int videoResolutionMode,});
Parameter | Type | Description |
videoFps | int | Video capturing frame rate. |
videoBitrate | int | The video bitrate. The SDK encodes streams at the target video bitrate and will actively reduce the bitrate only if the network conditions are poor. |
videoResolution | int | Resolution. |
videoResolutionMode | int | The resolution mode. |
Future<void> setLocalViewMirror(bool isMirror);
Parameter | Type | Description |
isMirror | boolean | Whether to enable mirroring preview mode. true : Yes; false : No. |
Future<void> startMicrophone({int quality});
Parameter | Type | Description |
quality | int |
Future<void> stopMicrophone();
Future<void> muteLocalAudio(bool mute);
Parameter | Type | Description |
mute | boolean | true : Mute; false : Unmute |
Future<void> setSpeaker(bool useSpeaker);
Parameter | Type | Description |
useSpeaker | boolean | true : Speaker; false : Receiver |
Future<void> setAudioCaptureVolume(int volume);
Parameter | Type | Description |
volume | int | The capture volume. Value range: 0–100. Default value: 100. |
Future<void> setAudioPlayoutVolume(int volume);
Parameter | Type | Description |
volume | int | The playback volume. Value range: 0–100. Default value: 100. |
Future<int?> startAudioRecording(String filePath);
Parameter | Type | Description |
filePath | String | The storage path of the audio recording file. Specify the path according to your specific needs and ensure that the specified path exists and is writable. This path must be accurate to the file name and extension. The extension determines the format of the audio recording file. Currently, supported formats include PCM, WAV, and AAC. |
Future<void> stopAudioRecording();
Future<void> enableAudioVolumeEvaluation(int intervalMs);
Parameter | Type | Description |
intervalMs | int | Sets the interval in ms for triggering the onUserVoiceVolume callback. The minimum interval is 100 ms. If the value is smaller than 0, the callback will be disabled. We recommend you set this parameter to 300 ms. |
Future<void> startScreenCapture({int videoFps,int videoBitrate,int videoResolution,int videoResolutionMode,String appGroup,});
Parameter | Type | Description |
videoFps | int | The frame rate for video capturing. |
videoBitrate | int | The video bitrate. The SDK encodes streams at the target video bitrate and will actively reduce the bitrate only if the network conditions are poor. |
videoResolution | int | The video resolution. |
videoResolutionMode | int | The resolution mode. |
appGroup | String | This parameter takes effect only for iOS and can be ignored for Android. It is the Application Group Identifier shared by the primary app and broadcast process. |
Future<void> stopScreenCapture();
Future<void> pauseScreenCapture();
Future<void> resumeScreenCapture();
getDeviceManager();
getBeautyManager();
TXBeautyManager
:Future<ActionCallback> sendRoomTextMsg(String message);
Parameter | Type | Description |
message | String | A text chat message. |
Future<ActionCallback> sendRoomCustomMsg(String cmd, String message);
Parameter | Type | Description |
cmd | String | A custom command word used to distinguish between different message types. |
message | String | A text chat message. |
TRTCMeetingDelegate
Event Callback APIsParameter | Type | Description |
errCode | int | The error code. |
errMsg | String | The error message. |
extraInfo | String | Extended field. Certain error codes may carry extra information for troubleshooting. |
Parameter | Type | Description |
warningCode | int | The warning code. |
warningMsg | String | The warning message. |
extraInfo | String | Extended field. Certain error codes may carry extra information for troubleshooting. |
Parameter | Type | Description |
roomId | String | The meeting room ID. |
Parameter | Type | Description |
localQuality | TRTCCloudDef.TRTCQuality | The upstream network quality. |
remoteQuality | List<TRTCCloudDef.TRTCQuality> | The downstream network quality. |
Parameter | Type | Description |
userVolumes | List | Volume of every currently speaking user in the room. Value range: 0-100. |
totalVolume | int | Total volume level of all remote members. Value range: 0–100. |
Parameter | Type | Description |
result | int | A value greater than 0 indicates the time (in ms) at which the meeting was joined. A value smaller than 0 indicates the error code thrown while joining the meeting. |
Parameter | Type | Description |
reason | int | The reason for leaving the meeting. 0: The user actively called leaveMeeting to leave the meeting; 1: The user was kicked out of the meeting by the server; 2: The meeting was closed. |
Parameter | Type | Description |
userId | String | The user ID of the new member who enters the room. |
Parameter | Type | Description |
userId | String | The user ID of the member who leaves the room. |
Parameter | Type | Description |
userId | String | The user ID. |
available | boolean | true: The mic is enabled; false: The mic is disabled. |
Parameter | Type | Description |
userId | String | The user ID. |
available | boolean | true: The camera is enabled; false: The camera is disabled. |
Parameter | Type | Description |
userId | String | The user ID. |
available | boolean | true: The substream is enabled; false: The substream is disabled. |
Parameter | Type | Description |
message | String | A text chat message. |
sendId | String | The message sender's user ID. |
userAvatar | String | The sender's profile photo. |
userName | String | The sender's username. |
Parameter | Type | Description |
command | String | A custom command word used to distinguish between different message types. |
message | String | A text chat message. |
sendId | String | The sender's user ID. |
userAvatar | String | The sender's profile photo. |
userName | String | The sender's username. |
Parameter | Type | Description |
reason | int | The reason screen sharing stopped. 0: The user actively stopped; 1: Screen sharing stopped as the shared window was closed. |
Was this page helpful?