@tencent-rtc/mcp 1.7.2 → 1.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +25 -17
  3. package/knowledge/bm25.js +20 -11
  4. package/knowledge/path-meta.js +23 -1
  5. package/knowledge/search/generic-rerank.js +123 -0
  6. package/knowledge/search/search-pass.js +8 -1
  7. package/package.json +1 -1
  8. package/resource/index/manifest.json +1 -1
  9. package/resource/knowledge/callkit/best-practice/android/video-chat-dating.md +497 -0
  10. package/resource/knowledge/callkit/best-practice/flutter/android-keep-call-alive-background.md +79 -0
  11. package/resource/knowledge/callkit/best-practice/flutter/background-incoming-call-no-notification.md +99 -0
  12. package/resource/knowledge/callkit/best-practice/flutter/ios-keep-call-alive-background.md +93 -0
  13. package/resource/knowledge/callkit/best-practice/flutter/ios-startup-crash-version-voip.md +68 -0
  14. package/resource/knowledge/callkit/core-sdk/miniprogram/call-engine.md +386 -0
  15. package/resource/knowledge/callkit/core-sdk/miniprogram/call-event.md +315 -0
  16. package/resource/knowledge/callkit/faq/uniapp-miniprogram.md +204 -0
  17. package/resource/knowledge/callkit/preset/harmonyos/api.md +362 -0
  18. package/resource/knowledge/callkit/preset/harmonyos/integration.md +318 -0
  19. package/resource/knowledge/callkit/preset/miniprogram/api-uniapp.md +430 -0
  20. package/resource/knowledge/callkit/preset/miniprogram/api.md +293 -0
  21. package/resource/knowledge/callkit/preset/miniprogram/integration.md +294 -0
  22. package/resource/knowledge/callkit/preset/miniprogram/uniapp-integration.md +224 -0
  23. package/resource/knowledge/callkit/preset/uni-app/api.md +339 -0
  24. package/resource/knowledge/callkit/preset/uni-app/integration.md +243 -0
  25. package/resource/knowledge/chat/best-practice/common/web-sdk-log-level.md +76 -0
  26. package/resource/knowledge/chat/best-practice/miniprogram/desktop-wechat-miniprogram-error.md +79 -0
  27. package/resource/knowledge/chat/preset/react/h5/integration.md +964 -0
  28. package/resource/knowledge/chat/preset/vue/h5/integration.md +717 -0
  29. package/resource/knowledge/roomkit/best-practice/vue/screen-share-auto-stop-on-leave.md +62 -0
  30. package/resource/knowledge/roomkit/core-sdk/react/network-proxy.md +83 -0
  31. package/resource/knowledge/roomkit/core-sdk/vue/network-proxy.md +83 -0
  32. package/resource/knowledge/roomkit/core-sdk/vue/recording.md +245 -0
  33. package/resource/knowledge/roomkit/core-sdk/vue/whiteboard-annotation.md +196 -0
  34. package/resource/knowledge/roomkit/faq/error-code.md +103 -0
  35. package/resource/knowledge/roomkit/preset/harmonyos/integration.md +461 -0
  36. package/resource/knowledge/roomkit/preset/react/features/network-proxy.md +79 -0
  37. package/resource/knowledge/roomkit/preset/uniapp-app/integration.md +580 -0
  38. package/resource/knowledge/roomkit/preset/vue/features/ai-caption-translation.md +69 -0
  39. package/resource/knowledge/roomkit/preset/vue/features/ai-denoiser.md +67 -0
  40. package/resource/knowledge/roomkit/preset/vue/features/network-proxy.md +79 -0
  41. package/resource/knowledge/roomkit/preset/vue/features/recording.md +85 -0
  42. package/resource/knowledge/roomkit/preset/vue/features/whiteboard-annotation.md +86 -0
  43. package/resource/knowledge/rtcengine/web/plugin/23-advanced-support-detection.md +6 -6
  44. package/resource/knowledge/rtcengine/web/plugin/31-advanced-plugins-overview.md +8 -6
  45. package/resource/knowledge/rtcengine/web/plugin/42-advanced-realtime-transcriber.md +30 -10
  46. package/server.js +1 -1
  47. package/utils/preflight-route.js +18 -6
  48. package/utils/report-cls-client.js +1 -1
  49. package/utils/report-es-client.js +1 -1
@@ -0,0 +1,103 @@
1
+ ## Client error codes
2
+
3
+ ### Common error codes
4
+ | Error code | Description |
5
+ | --- | --- |
6
+ | 0 | Operation succeeded |
7
+ | -1 | Uncategorized common error |
8
+ | -2 | The request was rate-limited, please retry later |
9
+ | -1000 | SDKAppID not found, please confirm the application information in the <a href="https://console.cloud.tencent.com/vcube/project/manage">Tencent Cloud VCube SDK console</a> |
10
+ | -1001 | An invalid parameter was passed when calling the API, check whether the input parameters are valid |
11
+ | -1002 | Not logged in, please call the Login interface |
12
+ | -1003 | Failed to obtain permission, the audio/video permission is currently not authorized, check whether the device permission is enabled |
13
+ | -1004 | This feature requires an additional package, please enable the corresponding package as needed in the <a href="https://console.cloud.tencent.com/vcube/project/manage">Tencent Cloud VCube SDK console</a> |
14
+
15
+ ### Error definitions for local user rendering, video management, and audio management API callbacks
16
+ | Error code | Description |
17
+ | --- | --- |
18
+ | -1100 | System problem, failed to open the camera. Check whether the camera device is working properly |
19
+ | -1101 | The camera is not authorized by the system, check the system authorization |
20
+ | -1102 | The camera is occupied, check whether another process is using the camera |
21
+ | -1103 | There is currently no camera device, please plug in a camera device to resolve this problem |
22
+ | -1104 | System problem, failed to open the microphone. Check whether the microphone device is working properly |
23
+ | -1105 | The microphone is not authorized by the system, check the system authorization |
24
+ | -1106 | The microphone is occupied |
25
+ | -1107 | There is currently no microphone device |
26
+ | -1108 | Failed to obtain the screen sharing object, check the screen recording permission |
27
+ | -1109 | Failed to start screen sharing, check whether someone in the room is already sharing their screen |
28
+
29
+ ### Error definitions for room management related API callbacks
30
+ | Error code | Description |
31
+ | --- | --- |
32
+ | -2100 | The room does not exist when entering, or it may have been dismissed |
33
+ | -2101 | You must enter the room before using this feature |
34
+ | -2102 | The room owner does not support the exit-room operation. Conference room type: you can transfer ownership first, then exit. LivingRoom (live) room type: the room owner can only dismiss the room |
35
+ | -2103 | This operation is not supported for the current room type |
36
+ | -2104 | This operation is not supported in the current speaking mode |
37
+ | -2105 | Illegal room ID for creating a room, a custom ID must be printable ASCII characters (0x20-0x7e), up to 48 bytes |
38
+ | -2106 | The room ID is already in use, please choose another room ID |
39
+ | -2107 | Illegal room name, the name is up to 30 bytes, the character encoding must be UTF-8, if it contains Chinese |
40
+ | -2108 | The current user is already in another room. A single roomEngine instance only supports the user entering one room. To enter a different room, exit first or use a new roomEngine instance |
41
+
42
+ ### Error definitions for in-room user information API callbacks
43
+ | Error code | Description |
44
+ | --- | --- |
45
+ | -2200 | The user was not found |
46
+ | -2201 | The user was not found in the room |
47
+
48
+ ### Error definitions for in-room user speaking management API callbacks & in-room seat management API callbacks
49
+ | Error code | Description |
50
+ | --- | --- |
51
+ | -2300 | Room owner permission is required to operate |
52
+ | -2301 | Room owner or administrator permission is required to operate |
53
+ | -2310 | No permission for the signaling request, e.g. canceling an invitation not initiated by yourself. |
54
+ | -2311 | The signaling request ID is invalid or has already been processed. |
55
+ | -2340 | The maximum number of seats exceeds the package limit |
56
+ | -2341 | The current user is already on a seat |
57
+ | -2342 | The current seat is already occupied |
58
+ | -2343 | The current seat is locked |
59
+ | -2344 | The seat number does not exist |
60
+ | -2345 | The current user is not on a seat |
61
+ | -2346 | The number of people on seats is full |
62
+ | -2360 | The audio of the current seat is locked |
63
+ | -2361 | You need to apply to the room owner or administrator to turn on the microphone |
64
+ | -2370 | The video of the current seat is locked, the camera can be turned on only after the room owner unlocks the seat |
65
+ | -2371 | You need to apply to the room owner or administrator to turn on the camera |
66
+ | -2380 | The current room has enabled mute all |
67
+ | -2381 | You have been muted in the current room |
68
+
69
+ ## Server error codes
70
+ | Error code | Description |
71
+ | --- | --- |
72
+ | 83007 | The request was rate-limited |
73
+ | 84002 | The room does not exist |
74
+ | 84003 | The number of people in the room has exceeded the maximum package limit |
75
+ | 84004 | The user does not exist in the room |
76
+ | 84005 | The room already exists |
77
+ | 84006 | The room owner cannot exit the room |
78
+ | 85001 | The seats are full |
79
+ | 85002 | The seat is locked |
80
+ | 85003 | The user is already on a seat |
81
+ | 85004 | The seat is in use |
82
+ | 85005 | The seat number does not exist |
83
+ | 85006 | The seat audio is locked |
84
+ | 85007 | The seat video is locked |
85
+ | 85008 | Seats cannot be used in non-live scenarios |
86
+ | 87001 | Modifying member identity or room information is not allowed |
87
+ | 87002 | Insufficient permission, room owner or administrator identity is required |
88
+ | 87003 | IM group attribute update error |
89
+ | 87005 | IM group attribute retrieval exception |
90
+ | 87006 | Insufficient permission, only the room owner can operate |
91
+ | 87007 | Insufficient permission, only an administrator can operate |
92
+ | 87008 | Destroying the IM room is not allowed |
93
+ | 41001 | Error creating the IM group |
94
+ | 41002 | Error destroying the IM group |
95
+ | 41003 | Error adding an IM member |
96
+ | 41004 | Error deleting an IM member |
97
+ | 41005 | IM role change error |
98
+ | 42001 | Error scheduling the meeting |
99
+ | 42002 | Invalid scheduled meeting |
100
+ | 42003 | A scheduled meeting must be a conference scenario |
101
+ | 42004 | The scheduled meeting has not started |
102
+ | 42005 | The scheduled meeting has already started |
103
+ | 42006 | Too many invited members for the scheduled meeting, exceeding the count limit |
@@ -0,0 +1,461 @@
1
+ TUIRoomKit is a one-stop multi-person audio/video room solution provided by Tencent Cloud, integrating complete UI components and core features. Through this document, developers can quickly learn how to integrate TUIRoomKit into a project to implement multi-person audio/video room functionality. This document also explains in detail how to quickly replace image resources, localize text, and apply other personalized configurations, helping developers build audio/video applications that match their brand identity.
2
+
3
+ ## Prerequisites
4
+
5
+ ### Enable the service
6
+
7
+ Refer to Enable Service to obtain the TUIRoomKit trial version, and get the following information on the [Application Management](https://console.cloud.tencent.com/trtc) page:
8
+ - **SDKAppID**: The application identifier (required). Tencent Cloud performs billing statistics based on the SDKAppID.
9
+
10
+ - **SDKSecretKey**: The application secret key, used for the key information in the initialization configuration file.
11
+
12
+ ### Environment preparation
13
+ - Integrated development environment: 6.0.0.858 or later.
14
+
15
+ - Phone operating system: HarmonyOS 5.0.5 or later.
16
+
17
+ - API Version: 17 or later.
18
+
19
+ ## Quick integration
20
+
21
+ ### Step 1: Integrate the TUIRoomKit component
22
+
23
+ #### Download the source code
24
+
25
+ Download the [TUIKit Harmony](https://github.com/Tencent-RTC/TUIKit_Harmony) source code from GitHub:
26
+ ``` bash
27
+ git clone https://github.com/Tencent-RTC/TUIKit_Harmony.git
28
+ ```
29
+
30
+ #### Integrate the component
31
+
32
+ 2. In the `oh-package.json5` file of your project's `entry`, add the following plugin dependencies.
33
+
34
+ ``` json
35
+ "dependencies": {
36
+ "@tencentcloud/atomicxcore": "^4.1.0",
37
+ "@tencentcloud/atomicx": "file:../../../atomic_x",
38
+ "@tencentcloud/tuiroomkit": "file:../../../room",
39
+ }
40
+ ```
41
+
42
+ > **Note:**
43
+ >
44
+ > room and atomic_x can be placed anywhere, as long as the relative paths are set correctly in oh-package.json5.
45
+ >
46
+
47
+ 3. After modifying **oh-package.json5**, run the following command to install the local TUIKit components. Example:
48
+
49
+ ``` bash
50
+ ohpm install
51
+ ```
52
+
53
+ ohpm install will automatically install the required dependency libraries.
54
+
55
+ > **Note:**
56
+ >
57
+ > - When using the local integration solution, if you need to upgrade, you need to get the latest component code from GitHub and overwrite the atomic_x directory in your local project.
58
+ > - When your private modifications conflict with the remote, you need to merge and resolve the conflicts manually.
59
+
60
+ ### Step 2: Project configuration
61
+ 1. Permission configuration: In the module section of your project's entry module.json5, declare the following required permissions:
62
+
63
+ ``` json
64
+ "requestPermissions":[
65
+ {
66
+ "name" : "ohos.permission.INTERNET"
67
+ },
68
+ {
69
+ "name" : "ohos.permission.USE_BLUETOOTH"
70
+ },
71
+ {
72
+ "name" : "ohos.permission.GET_BUNDLE_INFO"
73
+ },
74
+ {
75
+ "name" : "ohos.permission.GET_NETWORK_INFO"
76
+ },
77
+ {
78
+ "name" : "ohos.permission.GET_WIFI_INFO"
79
+ },
80
+ {
81
+ "name" : "ohos.permission.MODIFY_AUDIO_SETTINGS"
82
+ },
83
+ {
84
+ "name" : "ohos.permission.MICROPHONE",
85
+ "reason": "$string:module_desc",
86
+ "usedScene": { "abilities": [ "EntryAbility" ], "when":"always" }
87
+ },
88
+ {
89
+ "name" : "ohos.permission.CAMERA",
90
+ "reason": "$string:module_desc",
91
+ "usedScene": { "abilities": [ "EntryAbility" ], "when":"always" }
92
+ },
93
+ {
94
+ "name" : "ohos.permission.KEEP_BACKGROUND_RUNNING"
95
+ },
96
+ ]
97
+ ```
98
+ 2. Module declaration: After an existing project has integrated the source code, you need to declare the modules in the build-profile.json5 file:
99
+
100
+ ``` bash
101
+ "modules": [
102
+ {
103
+ "name": "entry",
104
+ "srcPath": "./entry",
105
+ "targets": [
106
+ {
107
+ "name": "default",
108
+ "applyToProducts": [
109
+ "default"
110
+ ]
111
+ }
112
+ ]
113
+ },
114
+ {
115
+ "name": "tuiroomkit",
116
+ "srcPath": "../room", // Adjust according to the actual directory
117
+ "targets": [
118
+ {
119
+ "name": "default",
120
+ "applyToProducts": [
121
+ "default"
122
+ ]
123
+ }
124
+ ]
125
+ },
126
+ {
127
+ "name": "atomic_x",
128
+ "srcPath": "../atomic_x", // Adjust according to the actual directory
129
+ "targets": [
130
+ {
131
+ "name": "default",
132
+ "applyToProducts": [
133
+ "default"
134
+ ]
135
+ }
136
+ ]
137
+ }
138
+ ]
139
+ ```
140
+ 3. Declare backgroundModes. Under the UIAbility hosting the meeting UI (usually EntryAbility), add backgroundModes to the abilities node of module.json5:
141
+
142
+ ``` java
143
+ "abilities": [
144
+ {
145
+ "name": "EntryAbility",
146
+ // ... other configurations remain unchanged
147
+ "backgroundModes": [
148
+ "audioRecording",
149
+ "audioPlayback"
150
+ ]
151
+ }
152
+ ]
153
+ ```
154
+
155
+ ### Step 3: Login
156
+
157
+ After the code integration is complete, you need to complete the login operation, which is **a key step in using TUIRoomKit**. Only after a successful login can you use the various features of TUIRoomKit normally, so please carefully check whether the relevant parameters are configured correctly:
158
+
159
+ > **Note:**
160
+ > In the sample code, the login interface is called directly. However, in an actual project, it is strongly recommended that **you call TUIRoomKit's login service after completing your own user identity verification and related login operations**. This avoids issues such as chaotic business logic or data inconsistency caused by calling the login service too early, and it also better fits the existing user management and permission control system in your project.
161
+ >
162
+
163
+ 【ArkTS】
164
+ ``` typescript
165
+ import { LoginStore } from '@tencentcloud/atomicxcore'
166
+
167
+ try {
168
+ await LoginStore.shared().login(
169
+ 1400000000, // Replace with your SDKAPPID
170
+ 'userID', // Replace with your UserID
171
+ 'userSig', // Replace with your UserSig
172
+ );
173
+ // login success
174
+ } catch (error) {
175
+ // login error
176
+ }
177
+ ```
178
+
179
+ **Login interface parameter description:**
180
+ | Parameter | Type | Description |
181
+ | --- | --- | --- |
182
+ | <code>sdkAppID</code> | <code>number</code> | Obtained from the <a href="https://console.cloud.tencent.com/trtc">console</a>, usually a 10-digit integer starting with <code>140</code> or <code>160</code>. |
183
+ | <code>userID</code> | <code>string</code> | The unique ID of the current user, containing only English letters, digits, hyphens, and underscores. To avoid multi-end login conflicts, <strong>do not use</strong> simple IDs such as <code>1</code> or <code>123</code>. |
184
+ | <code>userSig</code> | <code>string</code> | The ticket used for Tencent Cloud authentication. For more information, see How to compute and use UserSig.<br>[Notes]<br>- Development environment: You can use the local <code>GenerateTestUserSig.genTestSig</code> function to generate userSig, or generate a temporary userSig through the <a href="https://console.cloud.tencent.com/im/tool-usersig">UserSig helper tool</a>.<br>- Production environment: To prevent key leakage, be sure to generate userSig on the server side. For details, see Generating UserSig on the server. |
185
+
186
+ ### Step 4: Set the avatar and nickname
187
+
188
+ A user logging in for the first time has no avatar or nickname information, and needs to set personal information through the `setSelfInfo` interface of `LoginStore`:
189
+ ``` typescript
190
+ import { LoginStore, UserProfile, ErrorInfo } from '@tencentcloud/atomicxcore';
191
+
192
+ try {
193
+ await LoginStore.shared().setSelfInfo(new UserProfile('userID', 'userName', 'avatarURL'));
194
+ console.info("setSelfInfo success");
195
+ } catch (error) {
196
+ const err = error as ErrorInfo;
197
+ console.error(`setSelfInfo failed [code: ${err.code}] ${err.message}`);
198
+ }
199
+ ```
200
+
201
+ **setSelfInfo interface parameter / return value description:**
202
+ | Parameter / return value | Type | Description |
203
+ | --- | --- | --- |
204
+ | <code>userProfile</code> | <code>UserProfile</code> | The core model of personal user information, including:<br>- userID: The user ID whose information is to be set.<br>- nickname: The nickname information.<br>- avatarURL: The avatar link. |
205
+
206
+ ### Step 5: Create a room
207
+
208
+ In the `TUIRoomKit` component, `RoomMainPage` is the core UI that integrates the complete multi-person audio/video room functionality. The following demonstrates for developers how to embed `RoomMainPage` into an application as the room owner.
209
+
210
+ #### **Implementation approach:**
211
+ 1. **Construct the room-entry configuration**: The configuration for whether to automatically turn on audio/video devices after entering the room.
212
+
213
+ 2. **Configure the room creation options**: Configure information such as the room name.
214
+
215
+ 3. **Initialize the room main page**: Initialize the room main page with the room owner identity.
216
+
217
+ 4. **Navigate to the room page**: Push `RoomMainPage` onto the navigation stack.
218
+
219
+ > **Note:**
220
+ >
221
+ > Harmony currently only supports creating standard rooms. If you need to create a large webinar room, refer to Web Quick Integration and use the Web end to create it.
222
+ >
223
+
224
+ #### **Sample code:**
225
+ ``` typescript
226
+ import {
227
+ RoomMainPage,
228
+ RoomBehavior,
229
+ ConnectConfig,
230
+ EnterRoomParams,
231
+ } from '@tencentcloud/tuiroomkit';
232
+ import { CreateRoomOptions } from '@tencentcloud/atomicxcore';
233
+
234
+ @Entry
235
+ @Component
236
+ struct YourMainPage {
237
+ private navStack: NavPathStack = new NavPathStack();
238
+
239
+ build() {
240
+ Navigation(this.navStack) {
241
+ Column() {
242
+ Button('Create room')
243
+ .onClick(() => this.createRoom())
244
+ }
245
+ .width('100%')
246
+ .height('100%')
247
+ .justifyContent(FlexAlign.Center)
248
+ }
249
+ .navDestination(this.routerMap)
250
+ .hideTitleBar(true)
251
+ }
252
+
253
+ private createRoom(): void {
254
+ // 1. Construct the room-entry configuration
255
+ const config = new ConnectConfig(
256
+ true, // autoEnableMicrophone: whether to automatically turn on the microphone after entering the room
257
+ true, // autoEnableCamera: whether to automatically turn on the camera after entering the room
258
+ true, // autoEnableSpeaker: whether to automatically turn on the speaker after entering the room
259
+ );
260
+
261
+ // 2. Configure the room creation options
262
+ const options = new CreateRoomOptions();
263
+ options.roomName = 'roomName'; // Room name
264
+
265
+ // 3. Configure the room-entry behavior (create room)
266
+ const behavior = RoomBehavior.create(options);
267
+
268
+ // 4. Navigate to the room page
269
+ const params = new EnterRoomParams('123456', behavior, config);
270
+ this.navStack.pushPath({ name: 'RoomMain', param: params });
271
+ }
272
+
273
+ @Builder
274
+ routerMap(name: string, param: Object) {
275
+ if (name === 'RoomMain') {
276
+ RoomMainDestination({ navStack: this.navStack, params: param as EnterRoomParams })
277
+ }
278
+ }
279
+ }
280
+
281
+ @Component
282
+ struct RoomMainDestination {
283
+ navStack: NavPathStack = new NavPathStack();
284
+ params?: EnterRoomParams;
285
+
286
+ build() {
287
+ NavDestination() {
288
+ RoomMainPage({
289
+ roomID: this.params?.roomID ?? '',
290
+ behavior: this.params?.behavior ?? RoomBehavior.join(),
291
+ config: this.params?.config ?? new ConnectConfig(),
292
+ onExit: () => {
293
+ this.navStack.pop();
294
+ },
295
+ })
296
+ }
297
+ .hideTitleBar(true)
298
+ .width('100%')
299
+ .height('100%')
300
+ .onBackPressed(() => true)
301
+ }
302
+ }
303
+ ```
304
+
305
+ **Detailed description of RoomMainPage constructor parameters:**
306
+ | Parameter | Type | Description |
307
+ | --- | --- | --- |
308
+ | <code>roomID</code> | <code>string</code> | - A string-type unique identifier of the room.<br>- The length is limited to 0-48 bytes.<br>- It is recommended to contain only digits, English letters (case-sensitive), underscores (_), and hyphens (-). Avoid using spaces and Chinese characters. |
309
+ | <code>behavior</code> | <code>RoomBehavior</code> | - The initialization source of the room main page.<br>- Parameter meanings:<br>- create: Create a room with the room owner identity; this method requires constructing the CreateRoomOptions room creation configuration.<br>- join: Join a room as a participant. |
310
+ | <code>config</code> | <code>ConnectConfig</code> | The configuration for audio/video device control after entering the room. |
311
+
312
+ **Detailed description of ConnectConfig parameters:**
313
+ | Parameter | Type | Description |
314
+ | --- | --- | --- |
315
+ | autoEnableMicrophone | <code>boolean</code> | - Whether to automatically turn on the microphone after entering the room.<br>- Parameter meanings:<br>- true: Turn on automatically (default value).<br>- false: Do not turn on automatically. |
316
+ | autoEnableCamera | <code>boolean</code> | - Whether to automatically turn on the camera after entering the room.<br>- Parameter meanings:<br>- true: Turn on automatically (default value).<br>- false: Do not turn on automatically. |
317
+ | autoEnableSpeaker | <code>boolean</code> | - Whether to automatically turn on the speaker after entering the room.<br>- Parameter meanings:<br>- true: Turn on automatically (default value).<br>- false: Do not turn on automatically. |
318
+
319
+ ### Step 6: Join a room
320
+
321
+ The following demonstrates for developers how to embed `RoomMainPage` into an application as a participant.
322
+
323
+ #### **Implementation approach:**
324
+ 1. **Construct the room-entry configuration**: The configuration for whether to automatically turn on audio/video devices after entering the room.
325
+
326
+ 2. **Initialize the room main page**: Initialize the room main page with the participant identity.
327
+
328
+ 3. **Navigate to the room page**: Push `RoomMainPage` onto the navigation stack.
329
+
330
+ #### Sample code:
331
+ ``` typescript
332
+ import {
333
+ RoomMainPage,
334
+ RoomBehavior,
335
+ ConnectConfig,
336
+ EnterRoomParams,
337
+ } from '@tencentcloud/tuiroomkit';
338
+
339
+ @Entry
340
+ @Component
341
+ struct YourMainPage {
342
+ private navStack: NavPathStack = new NavPathStack();
343
+
344
+ build() {
345
+ Navigation(this.navStack) {
346
+ Column() {
347
+ Button('Join room')
348
+ .onClick(() => this.enterRoom())
349
+ }
350
+ .width('100%')
351
+ .height('100%')
352
+ .justifyContent(FlexAlign.Center)
353
+ }
354
+ .navDestination(this.routerMap)
355
+ .hideTitleBar(true)
356
+ }
357
+
358
+ private enterRoom(): void {
359
+ // 1. Construct the room-entry configuration
360
+ const config = new ConnectConfig(
361
+ true, // autoEnableMicrophone: whether to automatically turn on the microphone after entering the room
362
+ true, // autoEnableCamera: whether to automatically turn on the camera after entering the room
363
+ true, // autoEnableSpeaker: whether to automatically turn on the speaker after entering the room
364
+ );
365
+
366
+ // 2. Configure the room-entry behavior (join room)
367
+ const behavior = RoomBehavior.join();
368
+
369
+ // 3. Navigate to the room page
370
+ const params = new EnterRoomParams('roomID', behavior, config);
371
+ this.navStack.pushPath({ name: 'RoomMain', param: params });
372
+ }
373
+
374
+ @Builder
375
+ routerMap(name: string, param: Object) {
376
+ if (name === 'RoomMain') {
377
+ RoomMainDestination({ navStack: this.navStack, params: param as EnterRoomParams })
378
+ }
379
+ }
380
+ }
381
+
382
+ @Component
383
+ struct RoomMainDestination {
384
+ navStack: NavPathStack = new NavPathStack();
385
+ params?: EnterRoomParams;
386
+
387
+ build() {
388
+ NavDestination() {
389
+ RoomMainPage({
390
+ roomID: this.params?.roomID ?? '',
391
+ behavior: this.params?.behavior ?? RoomBehavior.join(),
392
+ config: this.params?.config ?? new ConnectConfig(),
393
+ onExit: () => {
394
+ this.navStack.pop();
395
+ },
396
+ })
397
+ }
398
+ .hideTitleBar(true)
399
+ .width('100%')
400
+ .height('100%')
401
+ .onBackPressed(() => true)
402
+ }
403
+ }
404
+ ```
405
+
406
+ **For detailed parameter descriptions, refer to:** [Detailed description of RoomMainPage constructor parameters]( Detailed description of constructor parameters) and [Detailed description of ConnectConfig parameters]( Detailed description of parameters).
407
+
408
+ > **Note:**
409
+ > When using the TUIRoomKit component to enter a large webinar room, make sure the room ID of the webinar room created on the Web end starts with `webinar_`.
410
+ >
411
+
412
+ ## Core features
413
+
414
+ After integrating the `RoomMainPage` code, developers get a complete multi-person audio/video page that internally includes member management, audio/video device control, room information display, and more. This is the core of the `TUIRoomKit` component.
415
+
416
+ ## UI customization
417
+
418
+ The `RoomMainPage` room main page is feature-rich and highly customizable. Developers can customize the UI according to actual product needs to fit their business interaction scenarios. The following shows developers the view components in `RoomMainPage` in detail, making it easy for developers to modify quickly.
419
+
420
+ **Detailed description of the components in `RoomMainPage`**
421
+
422
+ |Component|Feature description|Customization suggestions|
423
+ |---------|---------|---------|
424
+ |[RoomMainPage](https://github.com/Tencent-RTC/TUIKit_Harmony/blob/main/room/src/main/ets/pages/RoomMainPage.ets)|The room main view container, responsible for coordinating the layout and data flow of the sub-components.|You can adjust the overall background, safe area adaptation, and component show/hide logic.|
425
+ |[RoomTopBarView](https://github.com/Tencent-RTC/TUIKit_Harmony/blob/main/room/src/main/ets/pages/main/RoomTopBarView.ets)|The top navigation bar, containing room information, camera and audio controls, and the exit-room feature entry.|You can replace icons, adjust background transparency, and add custom buttons (e.g. recording, windowing).|
426
+ |[RoomView](https://github.com/Tencent-RTC/TUIKit_Harmony/blob/main/room/src/main/ets/pages/main/RoomView.ets)|The video stream display area, using a waterfall layout to manage multiple users' video views.|You can modify the layout algorithm (rows/columns, spacing), pagination indicator style, and empty-state view.|
427
+ |[ParticipantVideoItemView](https://github.com/Tencent-RTC/TUIKit_Harmony/blob/main/room/src/main/ets/pages/main/room_view/ParticipantVideoItemView.ets)|A single video stream cell, carrying the user's video view and basic information.|You can customize the video rendering layer, user info panel (avatar, badge), and interactive controls (voice waveform).|
428
+ |[RoomBottomBarView](https://github.com/Tencent-RTC/TUIKit_Harmony/blob/main/room/src/main/ets/pages/main/RoomBottomBarView.ets)|The bottom toolbar, integrating the microphone, camera, and member management operation buttons.|You can rearrange the button order, modify button styles (color, size), and add business-related features (e.g. screen sharing, in-meeting calling, beauty).|
429
+
430
+ ## Icon customization
431
+
432
+ After integrating the TUIRoomKit component, developers can directly replace the icon resources under the component according to actual UI interaction needs to fit their business scenarios.
433
+
434
+ TUIRoomKit uses the `src/main/resources/base/media` directory to manage the image resources required by the UI. You can directly replace the image files in this directory to customize the icons required by the UI.
435
+
436
+ **List of commonly used image files**
437
+
438
+ |Icon|File name|Description|
439
+ |---------|---------|---------|
440
+ ||room_camera_off.png|Camera off icon|
441
+ ||room_camera_on.png|Camera on icon|
442
+ ||room_mic_off.png|Microphone off icon|
443
+ ||room_mic_on_empty.png|Microphone on icon|
444
+ ||room_administrator_icon.png|Administrator identity icon|
445
+ ||room_owner_icon.png|Room owner identity icon|
446
+
447
+ ## Text customization
448
+
449
+ TUIRoomKit uses standard HarmonyOS resource files to manage the text displayed by the UI. You can directly modify JSON resource files such as `string.json` in the corresponding language folder under the atomic_x/src/main/resources/ directory to adjust the text you need.
450
+
451
+ ## FAQs
452
+
453
+ ### Do I need to call login every time I enter a room?
454
+
455
+ No. Usually you only need to complete a single `LoginStore.shared.login` call. We recommend that you associate `LoginStore.shared.login` and
456
+
457
+ `LoginStore.shared.logout` with your own login business.
458
+
459
+ ### Is there an example configuration for the oh-package.json5 file that I can reference?
460
+
461
+ You can refer to the `oh-package.json5` example file in the GitHub TUIKit_Harmony [application](https://github.com/Tencent-RTC/TUIKit_Harmony/tree/main/application) project.
@@ -0,0 +1,79 @@
1
+ The Conference SDK is built on Tencent Cloud Chat (IM) and Tencent Real-Time Communication (TRTC). It supports configuring the IM and TRTC proxies together in intranet / firewall environments, which is suitable for scenarios such as private deployment and enterprise intranet isolation where a direct connection to Tencent Cloud services is not available.
2
+
3
+ ## Proxy architecture
4
+
5
+ |Proxy server|Proxy link|
6
+ |---------|---------|
7
+ |IM proxy|Proxies the signaling channels for IM login, message sending/receiving, etc. (WebSocket), as well as the upload and download of resources such as chat images and files.|
8
+ |TRTC WebSocket proxy (e.g. Nginx)|Proxies the signaling channels for TRTC room entry, control, etc. (WebSocket), and is responsible for room management and user state synchronization.|
9
+ |TRTC TURN Server|Relays TRTC audio and video media streams.|
10
+
11
+ > **Note:**
12
+ > The proxy servers (IM proxy, Nginx, TURN) need to be deployed by yourself. For how to set them up, see [TRTC Web SDK handling firewall restrictions](https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/zh-cn/tutorial-34-advanced-proxy.html).
13
+ >
14
+
15
+ ## API and parameters
16
+
17
+ The Conference SDK allows you to configure the intranet proxy uniformly through the `callExperimentalAPI` interface before calling `login()`:
18
+ ``` typescript
19
+ callExperimentalAPI({
20
+ api: 'setNetworkProxy',
21
+ params: {
22
+ im?: { /* IM proxy parameters */ },
23
+ rtc?: { /* TRTC proxy parameters */ },
24
+ },
25
+ });
26
+ ```
27
+
28
+ ### IM proxy parameters
29
+
30
+ |Parameter|Type|Description|
31
+ |---------|---------|---------|
32
+ |`proxyServer`|String|IM signaling WebSocket proxy address.|
33
+ |`fileUploadProxy`|String|IM file upload proxy address.|
34
+ |`fileDownloadProxy`|String|IM file download proxy address.|
35
+
36
+ ### TRTC proxy parameters
37
+
38
+ |Parameter|Type|Description|
39
+ |---------|---------|---------|
40
+ |`websocketProxy`|String|TRTC signaling WebSocket proxy address, e.g. `wss://proxy.example.com/ws/`.|
41
+ |`turnServer`|Array|List of TURN servers. Each item contains `url` / `username` / `credential`.|
42
+ |`iceTransportPolicy`|`'relay' \| 'all'`|Client-side ICE transport policy. In an intranet environment, it is recommended to set it to `'relay'` to force a connection to the TURN server.|
43
+
44
+ ## Sample code
45
+
46
+ ``` typescript
47
+ import { conference } from '@tencentcloud/roomkit-web-react';
48
+
49
+ conference.callExperimentalAPI({
50
+ api: 'setNetworkProxy',
51
+ params: {
52
+ im: {
53
+ proxyServer: 'wss://proxy.example.com:8080',
54
+ fileUploadProxy: 'https://proxy.example.com:8080',
55
+ fileDownloadProxy: 'https://proxy.example.com:8080',
56
+ },
57
+ rtc: {
58
+ websocketProxy: 'wss://proxy.example.com/ws/',
59
+ turnServer: [
60
+ { url: '14.3.3.3:3478', username: 'turn', credential: 'turn' },
61
+ ],
62
+ iceTransportPolicy: 'relay',
63
+ },
64
+ },
65
+ });
66
+
67
+ await conference.login({ sdkAppId, userId, userSig });
68
+ await conference.createAndJoinRoom({ roomId });
69
+ ```
70
+
71
+ ## FAQs
72
+
73
+ ### A user can join the conference normally on the public network, but cannot join it on the intranet?
74
+
75
+ Check whether `setNetworkProxy` was called before `login()`. If it is already configured but still fails, check the TURN port and the outbound allowlist of the proxy server.
76
+
77
+ ### A user can join the conference but cannot see the remote video or hear the remote audio?
78
+
79
+ Confirm that `turnServer` is reachable, and set `iceTransportPolicy` to `'relay'` in an intranet environment.