@tencent-rtc/mcp 1.7.2 → 1.7.3
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.
- package/CHANGELOG.md +13 -0
- package/README.md +13 -5
- package/knowledge/bm25.js +20 -11
- package/knowledge/search/generic-rerank.js +123 -0
- package/knowledge/search/search-pass.js +8 -1
- package/package.json +1 -1
- package/resource/index/manifest.json +1 -1
- package/resource/knowledge/chat/best-practice/common/web-sdk-log-level.md +76 -0
- package/resource/knowledge/chat/best-practice/miniprogram/desktop-wechat-miniprogram-error.md +79 -0
- package/resource/knowledge/roomkit/best-practice/vue/screen-share-auto-stop-on-leave.md +62 -0
- package/resource/knowledge/roomkit/core-sdk/react/network-proxy.md +83 -0
- package/resource/knowledge/roomkit/core-sdk/vue/network-proxy.md +83 -0
- package/resource/knowledge/roomkit/core-sdk/vue/recording.md +245 -0
- package/resource/knowledge/roomkit/core-sdk/vue/whiteboard-annotation.md +196 -0
- package/resource/knowledge/roomkit/faq/error-code.md +103 -0
- package/resource/knowledge/roomkit/preset/harmonyos/integration.md +461 -0
- package/resource/knowledge/roomkit/preset/react/features/network-proxy.md +79 -0
- package/resource/knowledge/roomkit/preset/uniapp-app/integration.md +580 -0
- package/resource/knowledge/roomkit/preset/vue/features/ai-caption-translation.md +69 -0
- package/resource/knowledge/roomkit/preset/vue/features/ai-denoiser.md +67 -0
- package/resource/knowledge/roomkit/preset/vue/features/network-proxy.md +79 -0
- package/resource/knowledge/roomkit/preset/vue/features/recording.md +85 -0
- package/resource/knowledge/roomkit/preset/vue/features/whiteboard-annotation.md +86 -0
- package/server.js +1 -1
- package/utils/preflight-route.js +18 -6
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
|
@@ -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.
|