방 비밀번호
Description of the Feature
TUIRoomKit supports room encryption. You can use TUIRoomKit to schedule or create a password-protected room. If the UI Interaction of TUIRoomKit does not meet your product requirements, you can use TUIRoomEngineSDK to custom the Room Password interaction features. For details, please refer to Key Code.
Use instructions
Creating password room
After successfully integrating TUIRoomKit and logging in, you can create a password room. For creating a password room on different platforms, please refer to:
Please ensure that you have successfully connected to TUIRoomKit and logged in successfully, then you can create a password-protected room by calling the following example code:
ConferenceDefine.StartConferenceParams params = new ConferenceDefine.StartConferenceParams("222222"); // Please replace "222222" with your own defined room number params.passWord = "123456"; // Please replace "123456" with your set password (pure digits, up to 6 characters) Intent intent = new Intent(this, ConferenceMainActivity.class); intent.putExtra(KEY_START_CONFERENCE_PARAMS, params); startActivity(intent);
Note:
The room can be entered only with a password of pure digits, up to 6 characters.
Please ensure you have successfully connected to TUIRoomKit and logged in, then you can create a password-protected room by using the following sample code:
import TUIRoomKitfunc quickStartConference() {let vc = ConferenceMainViewController()let params = StartConferenceParams(roomId: "111111") // Please replace "111111" with your defined room numberparams.password = "123456" // Please replace "123456" with your defined room passwordvc.setStartConferenceParams(params: params)navigationController?.pushViewController(vc, animated: true)}
#import "TUIRoomKit/TUIRoomKit-Swift.h"- (void)quickStartConference {ConferenceMainViewController * vc = [[ConferenceMainViewController alloc]init];StartConferenceParams * params = [[StartConferenceParams alloc]initWithRoomId: @"111111" // Please replace "111111" with your custom room numberisOpenMicrophone:YESisOpenCamera:NOisOpenSpeaker:YESisMicrophoneDisableForAllUser:NOisCameraDisableForAllUser:NOisSeatEnabled:NOname:@"YourRoomName"password:@"123456"]; // Please replace "123456" with your custom room password[vc setStartConferenceParamsWithParams:params];[self.navigationController pushViewController:vc animated:YES];}
Note:
The room can be entered only with a password of pure digits, up to 6 characters.
Please ensure you have successfully connected to TUIRoomKit and logged in, then you can create a password-protected room by using the following sample code:
// Note the package name. If you are using the vue2 version, please change the package name to @tencentcloud/roomkit-web-vue2.7import { conference } from '@tencentcloud/roomkit-web-vue3';conference.start('123456', { // Please replace "123456" with your own defined room numberroomName: 'TestRoom',isSeatEnabled: false,isOpenCamera: false,isOpenMicrophone: false,password: '123456', // Please replace "123456" with your set password (pure digits, up to 6 characters)});
Note:
The room can be entered only with a password of pure digits, up to 6 characters.
Schedule password-protected room
To schedule a password-protected room, please refer to Schedule conference (Android&iOS&Flutter) or Schedule conference (Web&Electron)instructions to open the scheduling interface and set the password. The interaction scheme is as follows:
Invited Members Enter Room: They can enter the room via the meeting list or room number, without needing a password.
Non-invited Members Enter Room: They can only enter the room via the room number and must enter the correct password.
Android & iOS | | |
Schedule password room | Non-invited members enter the room with password | Invited members can directly enter the room |
| | |
Web | | |
Creating password room | Non-invited members enter the room with password | Invited members can directly enter the room |
| | |
Note:
If the scheduled conference UI does not meet your needs, you need to implement the feature according to your own UI interaction design. For related API calls, please refer to Key Code.
Feature customization
If the current UI does not meet your needs, you can achieve the desired UI effect by modifying the source code. For different platforms, please refer to:
You can achieve the desired UI effect by modifying the source code under Android/TUIRoomKit/tuiroomkit/src/main/java/com/tencent/cloud/tuikit/roomkit/view/page/widget/ScheduleConference/view directory. To facilitate your UI customization, here we introduce the files related to room password.
// Location: Android/TUIRoomKit/tuiroomkit/src/main/java/com/tencent/cloud/tuikit/roomkit/view/page/widget/ScheduleConference/viewview├── EnterConferencePasswordView.java // Password Input Popup Interface└── SetConferenceEncryptView.java // Schedule Conference Password Setting Interface
You can modify the source code in the iOS/TUIRoomKit/Source/View directory to achieve the desired UI Effect. To facilitate easier customization, this document provides an introduction to the room password files.
view├── ConferencePasswordView.swift // Password Input Popup Interface└── ScheduleConferenceDataHelper.swift // Schedule Conference Password Popup Style Interface
You can modify the source code in the following directories to achieve the desired UI Effect. To facilitate easier customization, this document provides an introduction to the room password files.
// Location: TUIRoomKit/Web/roomkit/vue3/src/TUIRoom/components/PreRoom├── PasswordDialog.vue // Password Input Popup InterfaceScheduleConference/ScheduleConferencePanel├── ScheduleConferencePanelPC.vue // Schedule Conference Password Setting Interface Web└── ScheduleConferencePanelH5.vue // Schedule Conference Password Setting Interface H5
You can modify the source code in the following directories to achieve the desired UI Effect. To facilitate easier customization, this document provides an introduction to the room password files.
// Location: TUIRoomKit/Electron/roomkit/vue3/src/TUIRoom/components/PreRoom├── PasswordDialog.vue // Password input popup interfaceScheduleConference/ScheduleConferencePanel├── ScheduleConferencePanelPC.vue // Schedule Conference Password Setting Interface Web└── ScheduleConferencePanelH5.vue // Schedule Conference Password Setting Interface H5
Note:
If you have any requirements or feedback, you can contact: info_rtc@tencent.com.
Key code
To create a password room, please refer to different platforms:
public abstract void createRoom(TUIRoomDefine.RoomInfo roomInfo, TUIRoomDefine.ActionCallback callback);
You can set the room password by configuring the password field of the roomInfo parameter. For more details, please refer to createRoom.
Below is the sample code:
TUIRoomDefine.RoomInfo roomInfo = new TUIRoomDefine.RoomInfo();roomInfo.roomId = "222222"; // Please replace "222222" with your own defined room numberroomInfo.password = "123456" // Please replace "123456" with your set password (pure digits, up to 6 characters)TUIRoomEngine.sharedInstance().createRoom(roomInfo, new TUIRoomDefine.ActionCallback() {@Overridepublic void onSuccess() {// Callback for successful room creation}@Overridepublic void onError(TUICommonDefine.Error error, String message) {// Callback for failed room creation}});
- (void)createRoom:(TUIRoomInfo *)roomInfo onSuccess:(TUISuccessBlock)onSuccess onError:(TUIErrorBlock)onError NS_SWIFT_NAME(createRoom(_:onSuccess:onError:));
You can set the room password by configuring the password field of the roomInfo parameter. For more details, please refer to createRoom.
Below is the sample code:
import RTCRoomEnginefunc createRoom() {let roomInfo = TUIRoomInfo()roomInfo.roomId = "111111" // Please replace "111111" with your custom room numberroomInfo.password = "123456" // Please replace "123456" with your custom room passwordTUIRoomEngine.sharedInstance().createRoom(roomInfo) {print("CreateRoom success")} onError: { code, message inprint("CreateRoom error, code:\(code), message:\(message)")}}
#import "RTCRoomEngine/TUIRoomDefine.h"#import "RTCRoomEngine/TUIRoomEngine.h"- (void)createRoom {TUIRoomInfo * roomInfo = [[TUIRoomInfo alloc] init];roomInfo.roomId = @"111111"; // Please replace "111111" with your custom room numberroomInfo.password = @"123456"; // Please replace "123456" with your custom room password[[TUIRoomEngine sharedInstance] createRoom:roomInfo onSuccess:^{NSLog(@"CreateRoom success");} onError:^(TUIError code, NSString * _Nonnull message) {NSLog(@"CreateRoom error, code:%ld, message:%@", (long)code, message);}];}
You can set the room password by configuring the password field. For more details, please refer to start.
Below is the sample code:
// Note the package name. If you are using the vue2 version, please change the package name to @tencentcloud/roomkit-web-vue2.7import { conference } from '@tencentcloud/roomkit-web-vue3';conference.start('123456', { // Please replace "123456" with your own defined room numberroomName: 'TestRoom',isSeatEnabled: false,isOpenCamera: false,isOpenMicrophone: false,password: '123456', // Please replace "123456" with your set password (pure digits, up to 6 characters)});
To schdedule a password room, please refer to different platforms:
public abstract void scheduleConference(ConferenceInfo conferenceInfo, TUIRoomDefine.ActionCallback callback);
You can set the room password by configuring the password field of the conferenceInfo parameter. For more details, please refer to scheduleConference. Example code is as follows:
TUIConferenceListManager manager = TUIRoomEngine.sharedInstance().getExtension(CONFERENCE_LIST_MANAGER);TUIConferenceListManager.ConferenceInfo conferenceInfo = new TUIConferenceListManager.ConferenceInfo();conferenceInfo.basicRoomInfo.roomId = "222222"; // Please replace "222222" with your own defined room numberconferenceInfo.basicRoomInfo.password = "123456"; // Please replace "123456" with your set password (pure digits, up to 6 characters)manager.scheduleConference(conferenceInfo, new TUIRoomDefine.ActionCallback() {@Overridepublic void onSuccess() {// Successful callback for booking a room}@Overridepublic void onError(TUICommonDefine.Error error, String message) {// Failed callback for booking a room}});
- (void)scheduleConference:(TUIConferenceInfo *)conferenceInfo onSuccess:(TUISuccessBlock)onSuccess onError:(TUIErrorBlock)onError NS_SWIFT_NAME(scheduleConference(_:onSuccess:onError:));
You can set the room password by configuring the password field of the conferenceInfo parameter. For more details, please refer to scheduleConference. Example code is as follows:
import RTCRoomEnginefunc scheduleConference() {let manager = TUIRoomEngine.sharedInstance().getExtension(extensionType: .conferenceListManager) as? TUIConferenceListManagerlet conferenceInfo = TUIConferenceInfo()conferenceInfo.basicRoomInfo.roomId = "111111" // Please replace "111111" with your custom room numberconferenceInfo.basicRoomInfo.password = "123456" // Please replace "123456" with your custom room passwordmanager?.scheduleConference(conferenceInfo, onSuccess: {print("ScheduleConference success")}, onError: { code, message inprint("ScheduleConference failed, code:\(code), message:\(message)")})}
#import "RTCRoomEngine/TUIRoomEngine.h"#import "RTCRoomEngine/TUIConferenceListManager.h"- (void)scheduleConference {TUIConferenceListManager * manager = [[TUIRoomEngine sharedInstance] getExtension: TUIExtensionTypeConferenceListManager];TUIConferenceInfo * conferenceInfo = [[TUIConferenceInfo alloc] init];conferenceInfo.basicRoomInfo.roomId = @"111111"; // Please replace "111111" with your custom room numberconferenceInfo.basicRoomInfo.password = @"123456"; // Please replace "123456" with your custom room password[manager scheduleConference:conferenceInfo onSuccess:^{NSLog(@"ScheduleConference success");} onError:^(TUIError code, NSString * _Nonnull message) {NSLog(@"ScheduleConference failed, code:%ld, message:%@", (long)code, message);}];}
Enter password room
public abstract void enterRoom(String roomId, TUIRoomDefine.RoomType roomType, TUIRoomDefine.EnterRoomOptions options, TUIRoomDefine.GetRoomInfoCallback callback);
You can set the room password by setting the password field of the options parameter. For detailed API information, please refer to enterRoom. Sample code is as follows:
String roomId = "222222"; // Please replace "222222" with the room number you are joiningTUIRoomDefine.EnterRoomOptions options = new TUIRoomDefine.EnterRoomOptions();options.password = "123456"; // Please replace "123456" with your set password (pure digits, up to 6 characters)TUIRoomEngine.sharedInstance().enterRoom(roomId, TUIRoomDefine.RoomType.CONFERENCE, options, new TUIRoomDefine.GetRoomInfoCallback() {@Overridepublic void onSuccess(TUIRoomDefine.RoomInfo engineRoomInfo) {// Successful room entry callback}@Overridepublic void onError(TUICommonDefine.Error error, String message) {// Failed room entry callbackif (error == TUICommonDefine.Error.WRONG_PASSWORD) {// Wrong password, handle the incorrect entry password business here.}}});
- (void)enterRoom:(NSString *)roomId roomType:(TUIRoomType)roomType options:(TUIEnterRoomOptions *)options onSuccess:(TUIRoomInfoBlock)onSuccess onError:(TUIErrorBlock)onError NS_SWIFT_NAME(enterRoom(_:roomType:options:onSuccess:onError:));
You can set the room password by configuring the password field in the options parameter. For more details, please refer to enterRoom. Sample code is as follows:
import RTCRoomEnginefunc enterRoom() {let roomId = "111111" // Please replace "111111" with your custom room numberlet options = TUIEnterRoomOptions()options.password = "123456" // Please replace "123456" with your custom room passwordTUIRoomEngine.sharedInstance().enterRoom(roomId, roomType: .conference, options: options) { roomInfo inprint("EnterRoom success")} onError: { code, message inprint("EnterRoom failed, code:\(code), message:\(message)")}}
#import "RTCRoomEngine/TUIRoomEngine.h"- (void)enterRoom {NSString * roomId = @"111111"; // Please replace "111111" with your custom room numberTUIEnterRoomOptions * options = [[TUIEnterRoomOptions alloc] init];options.password = @"123456"; // Please replace "123456" with your custom room password[[TUIRoomEngine sharedInstance] enterRoom:roomId roomType:TUIRoomTypeConference options:options onSuccess:^(TUIRoomInfo * _Nullable roomInfo) {NSLog(@"EnterRoom success");} onError:^(TUIError code, NSString * _Nonnull message) {NSLog(@"EnterRoom failed, code:%ld, message:%@", (long)code, message);}];}
Below is the sample code:
// Note the package name. If you are using the vue2 version, please change the package name to @tencentcloud/roomkit-web-vue2.7import { conference } from '@tencentcloud/roomkit-web-vue3';conference.join('123456', { // Please replace "123456" with the room number you are joiningisOpenCamera: false,isOpenMicrophone: false,password: 'Set your room password', // Please replace "123456" with your set password (pure digits, up to 6 characters)});