@tencent-rtc/mcp 1.3.1 → 1.3.2

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 (42) hide show
  1. package/index.js +4 -0
  2. package/index.js.map +1 -1
  3. package/package.json +1 -1
  4. package/resource/doc/chatuikit/faq/web_sdk/faq.md +125 -0
  5. package/resource/doc/chatuikit/flutter/faq.md +17 -114
  6. package/resource/doc/chatuikit/flutter/integrate_tuikit_Flutter.md +86 -722
  7. package/resource/doc/roomkit/vue/features/call-user-to-room.md +256 -0
  8. package/resource/doc/roomkit/vue/features/device-detection.md +388 -0
  9. package/resource/doc/roomkit/vue/features/device-state.md +480 -0
  10. package/resource/doc/roomkit/vue/features/free-beauty-panel.md +238 -0
  11. package/resource/doc/roomkit/vue/features/room-chat.md +427 -0
  12. package/resource/doc/roomkit/vue/features/room-participant-state.md +407 -0
  13. package/resource/doc/roomkit/vue/features/room-state.md +291 -0
  14. package/resource/doc/roomkit/vue/features/room-view.md +338 -0
  15. package/resource/doc/roomkit/vue/features/schedule-room.md +349 -0
  16. package/resource/doc/roomkit/vue/features/screen-share.md +333 -0
  17. package/resource/doc/roomkit/vue/features/virtual-background.md +287 -0
  18. package/resource/doc/roomkit/vue/features/workflow.md +553 -0
  19. package/resource/doc/roomkit/vue/integration.md +479 -0
  20. package/resource/doc/roomkit/vue/workflow.md +487 -0
  21. package/resource/doc/tuicallkit/react/api.md +21 -0
  22. package/resource/doc/tuicallkit/vue/api.md +21 -0
  23. package/tools/definitions/get_web_room_feature_detail_def.js +95 -0
  24. package/tools/definitions/get_web_room_feature_detail_def.js.map +1 -0
  25. package/tools/definitions/get_web_room_uikit_integration_def.js +44 -0
  26. package/tools/definitions/get_web_room_uikit_integration_def.js.map +1 -0
  27. package/tools/index.js +4 -2
  28. package/tools/index.js.map +1 -1
  29. package/tools/room/get-web-room-feature-detail.js +68 -0
  30. package/tools/room/get-web-room-feature-detail.js.map +1 -0
  31. package/tools/room/get-web-room-integration.js +43 -0
  32. package/tools/room/get-web-room-integration.js.map +1 -0
  33. package/utils/report-cls-client.js +1 -1
  34. package/utils/report-es-client.js +1 -1
  35. package/resource/doc/chatuikit/flutter/integrate_only_tuichat_Flutter.md +0 -333
  36. package/resource/doc/chatuikit/flutter/quick_start_Flutter.md +0 -217
  37. package/resource/doc/roomkit/vue/states/device-state.md +0 -369
  38. package/resource/doc/roomkit/vue/states/login-state.md +0 -59
  39. package/resource/doc/roomkit/vue/states/room-list-state.md +0 -355
  40. package/resource/doc/roomkit/vue/states/room-participant-state.md +0 -388
  41. package/tools/room/get-web-room-state-detail.js +0 -31
  42. package/tools/room/get-web-room-state-detail.js.map +0 -1
@@ -0,0 +1,479 @@
1
+ TUIRoomKit is an audio/video conference UI application launched by Tencent Cloud. This upgrade introduces a brand new Atomicx component integration solution, allowing developers to flexibly combine these atomized components to build personalized conference interfaces.
2
+
3
+ This document will help you integrate TUIRoomKit (Atomicx version) into your existing Vue 3 project, and introduce how to customize the styles, layout, and features of TUIRoomKit.
4
+
5
+ > **Note:**
6
+ >
7
+
8
+ > TUIRoomKit (Atomicx version) currently only supports PC-side Vue3 projects. If your business needs to support Vue2.x framework or H5 platform, please refer to [Legacy TUIRoomKit Quick Integration](https://write.woa.com/document/196568527013543936).
9
+ >
10
+
11
+
12
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027337918/30581b7bd73111f0ab505254001c06ec.png)
13
+
14
+
15
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027337918/31045da2d73111f097cb5254005ef0f7.png)
16
+
17
+
18
+ ## Prerequisites
19
+
20
+ ### Activate Service
21
+
22
+ Please refer to [Activate Service](https://cloud.tencent.com/document/product/647/104842) to get the TUIRoomKit trial version, and obtain the following information on the [Application Management](https://console.cloud.tencent.com/trtc) page:
23
+ - **SDKAppID**: Application identifier, Tencent Cloud completes billing statistics based on `SDKAppID`.
24
+
25
+ - **SDKSecretKey**: Application secret key, used for secret key information in initialization configuration files.
26
+
27
+
28
+ ### Environment Preparation
29
+ - **Node.js**: ≥ 18.19.1 (recommended to use official LTS version).
30
+
31
+ - **Vue**: ≥ 3.4.21.
32
+
33
+ - **Modern Browsers**: Modern browsers that support [WebRTC APIs](https://cloud.tencent.com/document/product/647/17249#.E6.94.AF.E6.8C.81.E7.9A.84.E5.B9.B3.E5.8F.B0).
34
+
35
+ - **Devices**: Camera, microphone, speakers.
36
+
37
+
38
+ ## Source Code Integration
39
+
40
+ ### Step 1: Install Project Dependencies
41
+
42
+ Install the following dependencies in your business project.
43
+
44
+
45
+
46
+
47
+ 【npm】
48
+ ``` bash
49
+ npm install tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/tuiroom-engine-js vue-router
50
+ ```
51
+
52
+
53
+ 【pnpm】
54
+ ``` bash
55
+ pnpm install tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/tuiroom-engine-js vue-router
56
+ ```
57
+
58
+
59
+ 【yarn】
60
+ ``` bash
61
+ yarn add tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/tuiroom-engine-js vue-router
62
+ ```
63
+
64
+ ### Step 2: Configure Development Environment
65
+
66
+ If your project does not yet support TypeScript and SCSS, please install the corresponding environment dependencies first. If already installed, you can skip this step.
67
+
68
+
69
+
70
+
71
+ 【npm】
72
+ ``` bash
73
+ npm install typescript sass -S -D
74
+ ```
75
+
76
+
77
+ 【pnpm】
78
+ ``` bash
79
+ pnpm install typescript sass -S -D
80
+ ```
81
+
82
+
83
+ 【yarn】
84
+ ``` bash
85
+ yarn add typescript sass -S -D
86
+ ```
87
+
88
+ ### Step 3: Copy Core Source Code Files
89
+
90
+ Clone the TUIRoomKit GitHub repository and enter the PC-side Vue3 sample directory.
91
+ ``` bash
92
+ git clone https://github.com/Tencent-RTC/TUIRoomKit.git --depth=1
93
+ cd TUIRoomKit/Web/example/atomicx-vite-vue3-ts
94
+ ```
95
+
96
+ Copy the core source code files under the `TUIRoomKit/Web/example/atomicx-vite-vue3-ts/src` path to your business project.
97
+
98
+ > **Note:**
99
+ >
100
+
101
+ > When copying source code files, please ensure merging with existing folders in your project, avoid directly overwriting existing folders with the same names.
102
+ >
103
+
104
+ <table>
105
+ <tr>
106
+ <td rowspan="1" colSpan="1" >Source Path (Sample Project)</td>
107
+
108
+ <td rowspan="1" colSpan="1" >Target Path (Your Project)</td>
109
+
110
+ <td rowspan="1" colSpan="1" >Description</td>
111
+ </tr>
112
+
113
+ <tr>
114
+ <td rowspan="1" colSpan="1" >src/assets/</td>
115
+
116
+ <td rowspan="1" colSpan="1" >src/assets/</td>
117
+
118
+ <td rowspan="1" colSpan="1" >Contains static resources such as background images and icons.</td>
119
+ </tr>
120
+
121
+ <tr>
122
+ <td rowspan="1" colSpan="1" >src/components/</td>
123
+
124
+ <td rowspan="1" colSpan="1" >src/components/</td>
125
+
126
+ <td rowspan="1" colSpan="1" >Contains all TUIRoomKit atomic UI components</td>
127
+ </tr>
128
+
129
+ <tr>
130
+ <td rowspan="1" colSpan="1" >src/hooks/</td>
131
+
132
+ <td rowspan="1" colSpan="1" >src/hooks/</td>
133
+
134
+ <td rowspan="1" colSpan="1" >Contains TUIRoomKit business logic processing</td>
135
+ </tr>
136
+
137
+ <tr>
138
+ <td rowspan="1" colSpan="1" >src/i18n/</td>
139
+
140
+ <td rowspan="1" colSpan="1" >src/i18n/</td>
141
+
142
+ <td rowspan="1" colSpan="1" >Contains multi-language configuration files</td>
143
+ </tr>
144
+
145
+ <tr>
146
+ <td rowspan="1" colSpan="1" >src/utils/</td>
147
+
148
+ <td rowspan="1" colSpan="1" >src/utils/</td>
149
+
150
+ <td rowspan="1" colSpan="1" >Contains common utility functions</td>
151
+ </tr>
152
+
153
+ <tr>
154
+ <td rowspan="1" colSpan="1" >src/config/</td>
155
+
156
+ <td rowspan="1" colSpan="1" >src/config/</td>
157
+
158
+ <td rowspan="1" colSpan="1" >Contains `basic-info-config.js` and other application configuration information (focus on this file for first-time integration)</td>
159
+ </tr>
160
+
161
+ <tr>
162
+ <td rowspan="1" colSpan="1" >src/views/home.vue</td>
163
+
164
+ <td rowspan="1" colSpan="1" >src/views/home.vue</td>
165
+
166
+ <td rowspan="1" colSpan="1" >This page contains device detection and room creation/join entry features</td>
167
+ </tr>
168
+
169
+ <tr>
170
+ <td rowspan="1" colSpan="1" >src/views/room.vue</td>
171
+
172
+ <td rowspan="1" colSpan="1" >src/views/room.vue</td>
173
+
174
+ <td rowspan="1" colSpan="1" >This page is the core meeting interface of TUIRoomKit, integrating complete header, video layout, control bar and sidebar panels</td>
175
+ </tr>
176
+ </table>
177
+
178
+
179
+ ### Step 4: Configure Page Routes
180
+
181
+ Please configure your Vue Router to map home.vue to the homepage and room.vue to the meeting room page.
182
+
183
+ > **Note:**
184
+ >
185
+ > - If your business project already has a `src/router/index.ts` file, please merge the following content into the existing code.
186
+ > - If routes have not been configured yet, please create a new `src/router/index.ts` file and add the following configuration.
187
+
188
+ ``` typescript
189
+ // src/router/index.ts example configuration
190
+ import { createRouter, createWebHistory } from 'vue-router';
191
+ import Home from '../views/home.vue';
192
+ import Room from '../views/room.vue';
193
+
194
+ const router = createRouter({
195
+ history: createWebHistory(),
196
+ routes: [
197
+ {
198
+ path: '/',
199
+ redirect: '/home',
200
+ },
201
+ {
202
+ path: '/home',
203
+ name: 'Home',
204
+ component: Home,
205
+ },
206
+ {
207
+ path: '/room',
208
+ name: 'Room',
209
+ component: Room,
210
+ },
211
+ ],
212
+ });
213
+
214
+ export default router;
215
+ ```
216
+
217
+ ### Step 5: Configure App.vue File
218
+
219
+ You need to merge the following content into the App.vue file in your project to configure global UI styles and user login logic:
220
+ - Configure global `UIKitProvider`: Import the `UIKitProvider` component and set default theme and language;
221
+
222
+ - Import page routes: Render <router-view />;
223
+
224
+ - User login: Execute login and setSelfInfo in the `onMounted` hook;
225
+
226
+ ``` typescript
227
+ <template>
228
+ <!-- Step 1: Configure global UIKitProvider -->
229
+ <UIKitProvider theme="light" language="zh-CN">
230
+ <!-- Step 2: Import page routes -->
231
+ <router-view />
232
+ </UIKitProvider>
233
+ </template>
234
+
235
+ <!-- Note: Add lang="ts" to enable TypeScript support -->
236
+ <script setup lang="ts">
237
+ import { UIKitProvider } from '@tencentcloud/uikit-base-component-vue3';
238
+ import { onMounted } from 'vue';
239
+ import { SDKAPPID, genTestUserSig } from './config/basic-info-config';
240
+ import { RoomEvent, useLoginState, useRoomModal } from 'tuikit-atomicx-vue3/room';
241
+
242
+ // step 3: User login
243
+ const { login, setSelfInfo } = useLoginState();
244
+ const { handleErrorWithModal } = useRoomModal();
245
+ const userId = `user_${Math.ceil(Math.random(0,1)*999)}`;
246
+ const userName = userId;
247
+ const userSig = genTestUserSig(userId);
248
+ onMounted(async () => {
249
+ try {
250
+ await login({
251
+ userId,
252
+ userSig,
253
+ sdkAppId: SDKAPPID,
254
+ });
255
+ await setSelfInfo({
256
+ userName,
257
+ avatarUrl: '',
258
+ });
259
+ } catch (error: any) {
260
+ console.error('Login failed:', error);
261
+ handleErrorWithModal(error);
262
+ }
263
+ });
264
+ </script>
265
+
266
+ <!-- Step 4: Configure global styles (these styles are used to override default styles of new projects built with scaffolding, can be configured as needed) -->
267
+ <style>
268
+ html, body {
269
+ padding: 0 !important;
270
+ margin: 0 !important;
271
+ }
272
+
273
+ #app {
274
+ width: 100% !important;
275
+ height: 100% !important;
276
+ padding: 0 !important;
277
+ margin: 0 !important;
278
+ max-width: 100% !important;
279
+ max-height: 100% !important;
280
+ text-align: left !important;
281
+ overflow: hidden;
282
+ }
283
+ </style>
284
+ ```
285
+
286
+ ### Step 6: Configure src/main.ts File
287
+
288
+ Merge the route and multi-language configuration into the entry file src/main.ts in your project:
289
+
290
+ > **Note:**
291
+ >
292
+
293
+ > If the entry file in your project is a js file, please change the file extension to src/main.ts.
294
+ >
295
+
296
+ ``` typescript
297
+ // Step 1: Configure page routes
298
+ import router from './router/index';
299
+ const app = createApp(App);
300
+ // --- New code below ----
301
+ app.use(router);
302
+ // --- New code above ----
303
+ app.mount('#app');
304
+
305
+ // Step 2: Configure multi-language resources
306
+ import { i18next } from '@tencentcloud/uikit-base-component-vue3';
307
+ import { enResource, zhResource } from './i18n';
308
+ export const addI18n = (lng: string, resource: any, deep = true, overwrite = false) => {
309
+ i18next.addResourceBundle(lng, 'translation', resource.translation, deep, overwrite);
310
+ };
311
+ addI18n('en-US', { translation: enResource }, true, true);
312
+ addI18n('zh-CN', { translation: zhResource }, true, true);
313
+ ```
314
+
315
+ ## Start Project
316
+
317
+ ### Configure Application Information
318
+
319
+ Find the `src/config/basic-info-config.js` configuration file in your project directory, and fill in the `SDKAppID` and `SDKSecretKey` you obtained from the Tencent Cloud Console into the corresponding variables.
320
+
321
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027337918/2fc2dd3dd73111f091e252540044a08e.png)
322
+
323
+
324
+ > **Warning:**
325
+ >
326
+ > - In the Demo example in this document, authentication is performed by configuring `SDKSecretKey` in client-side code, but `SDKSecretKey` can be easily decompiled and reverse engineered. Once the key is leaked, attackers can steal your Tencent Cloud traffic. Therefore, **this method is only suitable for local Demo testing and function debugging**.
327
+ > - **In formal production environments**, it is recommended to generate UserSig on your server side. When UserSig is needed, have your App request dynamic UserSig from the business server for authentication. For details, see [How to Calculate UserSig in Formal Operation Phase?](https://cloud.tencent.com/document/product/647/17275#formal)
328
+
329
+
330
+ ### Start Development Server
331
+
332
+
333
+
334
+
335
+ 【npm】
336
+ ``` bash
337
+ npm run dev
338
+ ```
339
+
340
+
341
+ 【pnpm】
342
+ ``` bash
343
+ pnpm run dev
344
+ ```
345
+
346
+
347
+ 【yarn】
348
+ ``` bash
349
+ yarn run dev
350
+ ```
351
+
352
+ After successful startup, please open the debug address (usually http://localhost:5173) in your browser to access the application. You will see the meeting interface as shown below:
353
+
354
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027337918/312e7796d73111f091e252540044a08e.png)
355
+
356
+
357
+ ## UI Customization
358
+
359
+ ### Theme and Language
360
+
361
+ Modify the default values for theme and language by configuring the parameters of `UIKitProvider` in App.vue.
362
+ <table>
363
+ <tr>
364
+ <td rowspan="1" colSpan="1" >UIKitProvider Parameter</td>
365
+
366
+ <td rowspan="1" colSpan="1" >Available Values</td>
367
+
368
+ <td rowspan="1" colSpan="1" >Default Value</td>
369
+ </tr>
370
+
371
+ <tr>
372
+ <td rowspan="1" colSpan="1" >theme</td>
373
+
374
+ <td rowspan="1" colSpan="1" >"light" \| "dark"</td>
375
+
376
+ <td rowspan="1" colSpan="1" >"light"</td>
377
+ </tr>
378
+
379
+ <tr>
380
+ <td rowspan="1" colSpan="1" >language</td>
381
+
382
+ <td rowspan="1" colSpan="1" >"zh-CN" \| "en-US"</td>
383
+
384
+ <td rowspan="1" colSpan="1" >"en-US"</td>
385
+ </tr>
386
+ </table>
387
+
388
+ ``` typescript
389
+ <UIKitProvider theme="light" language="zh-CN">
390
+ <router-view />
391
+ </UIKitProvider>
392
+
393
+ <script setup lang="ts">
394
+ import { UIKitProvider } from '@tencentcloud/uikit-base-component-vue3';
395
+ ```
396
+
397
+ ### Room Stream Layout
398
+
399
+ TUIRoomKit currently supports three stream layouts: grid, sidebar, and top bar. The default is grid layout.
400
+ ``` typescript
401
+ // src/views/room.vue
402
+ // Change default video stream layout to sidebar layout
403
+ const participantViewLayout = ref(RoomLayoutTemplate.SidebarLayout);
404
+ function handleLayoutUpdate(layout: RoomLayoutTemplate) {
405
+ participantViewLayout.value = layout;
406
+ }
407
+
408
+ // Change default video stream layout to top bar layout
409
+ const participantViewLayout = ref(RoomLayoutTemplate.CinemaLayout);
410
+ function handleLayoutUpdate(layout: RoomLayoutTemplate) {
411
+ participantViewLayout.value = layout;
412
+ }
413
+ ```
414
+
415
+ ### Custom Video Stream Widget
416
+
417
+ The default TUIRoomKit video stream widget is shown in the image. If you need to customize the video stream widget, please modify the `src/components/RoomLayoutView/ParticipantViewUI/ParticipantViewUI.vue` component.
418
+
419
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027337918/2fab38f2d73111f0929b525400bf7822.png)
420
+
421
+
422
+ ### Configure User Contact List
423
+
424
+ The TUIRoomKit scheduled meeting user selection list and in-meeting call user selection list default to displaying the user relationship chain list. To batch import user relationship chain, refer to the following steps:
425
+
426
+ Step 1: Use the [Account Management > Import Multiple Accounts](https://cloud.tencent.com/document/product/269/4919) REST API interface to batch import user accounts;
427
+
428
+ Step 2: Use the [Friend Management > Import Friends](https://cloud.tencent.com/document/product/269/8301) REST API interface to batch import user relationship chain;
429
+
430
+ ![](https://write-document-release-1258344699.cos.ap-guangzhou.tencentcos.cn/100027337918/32637a07d73111f0ab505254001c06ec.png)
431
+
432
+
433
+ ## FAQ
434
+
435
+ #### **TUIRoomKit works normally during local development, but cannot properly capture user's camera or microphone devices after deployment to online environment?**
436
+ - **Cause Analysis:** For security and privacy protection, browsers have strict restrictions on capturing audio/video devices (microphone, camera). Capture operations are only allowed in secure environments. Secure environment protocols include: https://, localhost, file://, etc. The HTTP protocol is considered insecure, and browsers will prohibit access to media devices by default.
437
+
438
+ - **Solution:** If everything works normally in local (localhost) testing, but capture fails after deployment, please immediately check whether your webpage is deployed on the HTTP protocol. You must use the HTTPS protocol to deploy your webpage and ensure you have a valid security certificate.
439
+
440
+ - **Related Resources:** For more details about URL domain and protocol restrictions, please see [URL Domain and Protocol Restrictions](https://cloud.tencent.com/document/product/647/17249#URL-.E5.9F.9F.E5.90.8D.E5.8D.8F.E8.AE.AE.E9.99.90.E5.88.B6).
441
+
442
+
443
+ #### **Does TUIRoomKit support integration using iframe?**
444
+
445
+ Yes. When integrating TUIRoomKit using iframe, you need to configure the allow attribute in the iframe tag to grant necessary browser permissions (microphone, camera, screen sharing, fullscreen, etc.), example as follows:
446
+ ``` typescript
447
+ // Enable microphone, camera, screen sharing, fullscreen permissions
448
+ <iframe allow="microphone; camera; display-capture; display; fullscreen;">
449
+ ```
450
+
451
+ #### Does TUIRoomKit support setting intranet proxy?
452
+
453
+ Yes. Please refer to the following guide to set intranet proxy parameters. For more intranet proxy information, please refer to [Dealing with Firewall Restrictions](https://web.sdk.qcloud.com/trtc/webrtc/doc/zh-cn/tutorial-34-advanced-proxy.html).
454
+ ``` typescript
455
+ // Please set intranet proxy parameters before entering the room
456
+ import TUIRoomEngine from '@tencentcloud/tuiroom-engine-js';
457
+ import { useRoomEngine } from 'tuikit-atomicx-vue3/room';
458
+ const { roomEngine } = useRoomEngine();
459
+
460
+ TUIRoomEngine.once('ready', () => {
461
+ const trtcCloud = roomEngine.instance?.getTRTCCloud();
462
+ trtcCloud.callExperimentalAPI(JSON.stringify({
463
+ api: 'setNetworkProxy',
464
+ params: {
465
+ websocketProxy: "wss://proxy.example.com/ws/",
466
+ turnServer: [{
467
+ url: '14.3.3.3:3478',
468
+ username: 'turn',
469
+ credential: 'turn',
470
+ }],
471
+ iceTransportPolicy: 'relay',
472
+ },
473
+ }));
474
+ });
475
+ ```
476
+
477
+ ## Contact Us
478
+
479
+ If you have any questions or suggestions during the integration or usage process, please feel free to [contact us](https://cloud.tencent.com/document/product/269/59590) to submit feedback.