@tencentcloud/sdk-mcp 1.7.4 → 1.7.6
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 +20 -0
- package/README.md +57 -55
- package/knowledge/chunker.js +1 -0
- package/knowledge/path-meta.js +12 -1
- package/knowledge/search/search-core.js +22 -4
- package/knowledge/search/search-knowledge.js +1 -1
- package/package.json +1 -1
- package/resource/index/manifest.json +1 -1
- package/resource/integration/callkit/preset/android/integration.md +0 -4
- package/resource/integration/callkit/preset/flutter/integration.md +4 -8
- package/resource/integration/callkit/preset/ios/integration.md +2 -6
- package/resource/integration/callkit/preset/react/integration.md +2 -2
- package/resource/integration/callkit/preset/vue/integration.md +9 -9
- package/resource/integration/chat/preset/android/integration.md +2 -2
- package/resource/integration/chat/preset/flutter/integration.md +2 -2
- package/resource/integration/chat/preset/ios/integration.md +10 -10
- package/resource/integration/chat/preset/react/integration.md +0 -5
- package/resource/integration/chat/preset/uni-app/integration.md +0 -4
- package/resource/integration/chat/preset/vue/integration.md +0 -5
- package/resource/integration/livekit/preset/live/android/live-host-integration.md +0 -4
- package/resource/integration/livekit/preset/live/ios/live-host-integration.md +0 -4
- package/resource/integration/livekit/preset/live/ios/prepare-integration.md +3 -3
- package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +0 -4
- package/resource/integration/roomkit/preset/vue/integration.md +152 -439
- package/resource/knowledge/callkit/best-practice/android/video-chat-dating.md +8 -8
- package/resource/knowledge/callkit/core-sdk/android/answer-call.md +2 -2
- package/resource/knowledge/callkit/core-sdk/android/make-call.md +5 -5
- package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +7 -7
- package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +10 -10
- package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +9 -9
- package/resource/knowledge/callkit/core-sdk/ios/make-call.md +7 -8
- package/resource/knowledge/callkit/core-sdk/uni-app/answer-call.md +2 -2
- package/resource/knowledge/callkit/core-sdk/uni-app/make-call.md +2 -2
- package/resource/knowledge/callkit/faq/android.md +4 -4
- package/resource/knowledge/callkit/faq/common.md +4 -4
- package/resource/knowledge/callkit/preset/harmonyos/integration.md +0 -4
- package/resource/knowledge/callkit/preset/uni-app/integration.md +10 -10
- package/resource/knowledge/chat/preset/android-view/integration.md +2 -6
- package/resource/knowledge/chat/preset/ios-uikit/integration.md +43 -40
- package/resource/knowledge/chat/preset/react/h5/integration.md +0 -5
- package/resource/knowledge/chat/preset/vue/features/message-input.md +4 -4
- package/resource/knowledge/chat/preset/vue/h5/integration.md +0 -5
- package/resource/knowledge/livekit/core-sdk/features/android/audience-list.md +3 -3
- package/resource/knowledge/livekit/core-sdk/features/android/live-list.md +3 -3
- package/resource/knowledge/livekit/core-sdk/features/flutter/audience-list.md +3 -3
- package/resource/knowledge/livekit/core-sdk/features/flutter/live-list.md +3 -3
- package/resource/knowledge/livekit/core-sdk/features/ios/audience-list.md +3 -3
- package/resource/knowledge/livekit/core-sdk/features/ios/live-list.md +3 -3
- package/resource/knowledge/livekit/core-sdk/features/uni-app/audience-list.md +3 -3
- package/resource/knowledge/livekit/core-sdk/features/uni-app/live-list.md +3 -3
- package/resource/knowledge/livekit/core-sdk/live/android/host-interaction.md +2 -2
- package/resource/knowledge/livekit/core-sdk/live/flutter/host-interaction.md +2 -2
- package/resource/knowledge/livekit/core-sdk/live/flutter/integration.md +2 -2
- package/resource/knowledge/livekit/core-sdk/live/ios/host-interaction.md +2 -2
- package/resource/knowledge/livekit/core-sdk/live/uni-app/co-guest-interaction.md +12 -12
- package/resource/knowledge/livekit/core-sdk/live/uni-app/host-interaction.md +4 -4
- package/resource/knowledge/livekit/core-sdk/live/uni-app/integration.md +9 -9
- package/resource/knowledge/livekit/core-sdk/voice/android/host-interaction.md +2 -2
- package/resource/knowledge/livekit/core-sdk/voice/ios/host-interaction.md +2 -2
- package/resource/knowledge/livekit/core-sdk/voice/uni-app/integration.md +5 -5
- package/resource/knowledge/push/config/donut.md +3 -3
- package/resource/knowledge/push/config/harmonyos.md +12 -12
- package/resource/knowledge/push/config/ios.md +2 -2
- package/resource/knowledge/push/integration/android.md +91 -1112
- package/resource/knowledge/push/integration/donut.md +8 -8
- package/resource/knowledge/push/integration/ios.md +9 -35
- package/resource/knowledge/push/integration/unity.md +3 -3
- package/resource/knowledge/push/integration/unreal-engine.md +7 -7
- package/resource/knowledge/roomkit/core-sdk/android/room-state.md +3 -3
- package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +9 -9
- package/resource/knowledge/roomkit/core-sdk/flutter/room-state.md +3 -3
- package/resource/knowledge/roomkit/core-sdk/ios/room-state.md +3 -3
- package/resource/knowledge/roomkit/core-sdk/vue/recording.md +3 -3
- package/resource/knowledge/roomkit/core-sdk/vue/virtual-background.md +3 -3
- package/resource/knowledge/roomkit/preset/ios/integration.md +3 -3
- package/resource/knowledge/roomkit/preset/uniapp-app/integration.md +52 -10
- package/server.js +42 -34
- package/tools/common/get_usersig.js +1 -1
- package/tools/common/present_framework_choice.js +5 -5
- package/tools/definitions/finalize_answer_def.js +17 -16
- package/tools/definitions/get_native_call_uikit_integration_def.js +25 -16
- package/tools/definitions/get_native_callkit_core_integration_def.js +37 -26
- package/tools/definitions/get_native_chat_uikit_integration_def.js +22 -13
- package/tools/definitions/get_native_live_uikit_integration_def.js +30 -21
- package/tools/definitions/get_native_livekit_core_integration_def.js +25 -16
- package/tools/definitions/get_usersig_def.js +20 -13
- package/tools/definitions/get_web_call_uikit_integration_def.js +21 -12
- package/tools/definitions/get_web_chat_uikit_integration_def.js +22 -13
- package/tools/definitions/get_web_live_uikit_integration_def.js +21 -12
- package/tools/definitions/get_web_room_core_integration_def.js +29 -20
- package/tools/definitions/get_web_room_uikit_integration_def.js +21 -12
- package/tools/definitions/integration-boundary.js +9 -5
- package/tools/definitions/present_framework_choice_def.js +21 -21
- package/tools/definitions/search_trtc_knowledge_def.js +48 -26
- package/tools/definitions/submit_feedback_def.js +18 -14
- package/utils/preflight-route.js +203 -185
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
|
@@ -7,524 +7,224 @@
|
|
|
7
7
|
请参考 [开通服务](https://cloud.tencent.com/document/product/647/104842) 领取 TUIRoomKit 体验版或开通 TUIRoomKit 正式版,并在 [应用管理](https://console.cloud.tencent.com/trtc) 页面获取以下信息:
|
|
8
8
|
- **SDKAppID:**应用标识,腾讯云基于 `SDKAppID` 完成计费统计。
|
|
9
9
|
|
|
10
|
-
- **SDKSecretKey
|
|
10
|
+
- **SDKSecretKey:**应用密钥,仅用于本地调试时生成 UserSig,不可写入生产代码。
|
|
11
|
+
|
|
12
|
+
- **UserSig:**登录凭证。须由业务服务端签发并下发,切勿在客户端硬编码 SDKSecretKey。本地调试可用 `genTestUserSig` 生成临时签名,不可用于生产,详见 [正式运行阶段如何计算 UserSig](https://cloud.tencent.com/document/product/647/17275#formal)。
|
|
11
13
|
|
|
12
14
|
### 环境准备
|
|
13
|
-
- **Node.js
|
|
15
|
+
- **Node.js:**≥ 18.19.1 (推荐使用官方 LTS 版本)。
|
|
14
16
|
|
|
15
17
|
- **浏览器:**推荐使用最新版 Chrome,或其他支持 [WebRTC API](https://cloud.tencent.com/document/product/647/17249#.E6.94.AF.E6.8C.81.E7.9A.84.E5.B9.B3.E5.8F.B0) 的浏览器。
|
|
16
18
|
|
|
17
19
|
- **媒体设备:**建议配备摄像头、麦克风和扬声器。缺少相应设备时仍可入会,但对应音视频能力不可用。
|
|
18
20
|
|
|
19
|
-
###
|
|
20
|
-
|
|
21
|
-
若您尚未创建 Vue 3 项目,可先执行以下命令初始化;若已有 Vue 3 项目,可跳过本节。
|
|
22
|
-
``` bash
|
|
23
|
-
# 创建名为 roomkit-demo 的 Vue3 + TypeScript 项目
|
|
24
|
-
npm create vite@5 roomkit-demo -- --template vue-ts
|
|
25
|
-
# 进入项目目录
|
|
26
|
-
cd roomkit-demo
|
|
27
|
-
# 安装基础依赖
|
|
28
|
-
npm install
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## 快速接入
|
|
32
|
-
|
|
33
|
-
完成前提条件后,按以下步骤在 Vue 3 项目中快速完成 TUIRoomKit 接入,并体验会中能力。
|
|
34
|
-
|
|
35
|
-
### 步骤1:安装 SDK 依赖
|
|
36
|
-
|
|
37
|
-
在您的业务项目中安装以下依赖。
|
|
21
|
+
### 安装依赖
|
|
38
22
|
|
|
39
23
|
【npm】
|
|
40
24
|
``` bash
|
|
25
|
+
# 在已有 Vue 3 项目根目录执行;若需新建项目,可先运行 npm create vite@5 roomkit-demo -- --template vue-ts
|
|
41
26
|
npm install @tencentcloud/roomkit-web-vue3 tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/universal-api
|
|
42
27
|
```
|
|
43
28
|
|
|
44
29
|
【pnpm】
|
|
45
30
|
``` bash
|
|
31
|
+
# 在已有 Vue 3 项目根目录执行;若需新建项目,可先运行 pnpm create vite@5 roomkit-demo --template vue-ts
|
|
46
32
|
pnpm install @tencentcloud/roomkit-web-vue3 tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/universal-api
|
|
47
33
|
```
|
|
48
34
|
|
|
49
35
|
【yarn】
|
|
50
36
|
``` bash
|
|
37
|
+
# 在已有 Vue 3 项目根目录执行;若需新建项目,可先运行 yarn create vite@5 roomkit-demo --template vue-ts
|
|
51
38
|
yarn add @tencentcloud/roomkit-web-vue3 tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/universal-api
|
|
52
39
|
```
|
|
53
40
|
|
|
54
|
-
|
|
41
|
+
## 快速接入
|
|
55
42
|
|
|
56
|
-
|
|
43
|
+
### 发起会议
|
|
57
44
|
|
|
58
|
-
|
|
59
|
-
>
|
|
60
|
-
> 快速接入示例采用客户端生成 UserSig 的方式,**仅可用于本地开发调试**。正式环境请改为由业务服务端生成 UserSig,详见 [正式运行阶段如何计算 UserSig](https://cloud.tencent.com/document/product/647/17275#formal)。
|
|
61
|
-
>
|
|
45
|
+
**适用场景:**用户在客户端点击“快速会议”,需要立即创建房间并加入(如临时沟通、IM 聊天内发起会议)。
|
|
62
46
|
|
|
47
|
+
**实现方式:**由客户端生成或向业务后台申请一个唯一的房间号,随后由发起人调用 `createAndJoin` 创建并直接进入该房间。
|
|
63
48
|
``` typescript
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
<ConferenceMainView v-if="inRoom && isPC" />
|
|
67
|
-
<ConferenceMainViewH5 v-else-if="inRoom" />
|
|
68
|
-
<div v-else class="entry">
|
|
69
|
-
<TUIInput v-model="entry.userId" placeholder="请输入用户 ID" />
|
|
70
|
-
<TUIInput v-model="entry.userName" placeholder="请输入昵称, 非必填" />
|
|
71
|
-
<TUIInput v-model="entry.roomId" placeholder="请输入房间 ID, 如 room_123456" />
|
|
72
|
-
<TUIButton type="primary" :disabled="!entry.userId || !entry.roomId" @click="handleEnterRoom">进入会议</TUIButton>
|
|
73
|
-
</div>
|
|
74
|
-
</UIKitProvider>
|
|
75
|
-
</template>
|
|
76
|
-
|
|
77
|
-
<script setup lang="ts">
|
|
78
|
-
import { ref, onMounted, onUnmounted } from 'vue';
|
|
79
|
-
import { UIKitProvider, TUIInput, TUIButton, TUIToast } from '@tencentcloud/uikit-base-component-vue3';
|
|
80
|
-
import { conference, ConferenceMainView, ConferenceMainViewH5, RoomEvent, genTestUserSig } from '@tencentcloud/roomkit-web-vue3';
|
|
81
|
-
import { getPlatform } from '@tencentcloud/universal-api';
|
|
82
|
-
|
|
83
|
-
const SDKAppID = 0; // 替换为您在开通服务阶段获取的 SDKAppID
|
|
84
|
-
const SDKSecretKey = ''; // 替换为您在开通服务阶段获取的 SDKSecretKey
|
|
85
|
-
|
|
86
|
-
const isPC = getPlatform() === 'pc';
|
|
87
|
-
const inRoom = ref(false);
|
|
88
|
-
const stored = JSON.parse(sessionStorage.getItem('tuiRoom-entry') || '{}');
|
|
89
|
-
const entry = ref({ userId: stored.userId || '', userName: stored.userName || '', roomId: stored.roomId || '' });
|
|
90
|
-
|
|
91
|
-
const handleEnterRoom = async () => {
|
|
92
|
-
sessionStorage.setItem('tuiRoom-entry', JSON.stringify(entry.value));
|
|
93
|
-
if (!SDKAppID || !SDKSecretKey) {
|
|
94
|
-
TUIToast.warning({ message: '请先在代码中配置 SDKAppID 和 SDKSecretKey' });
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
try {
|
|
98
|
-
const { userSig } = genTestUserSig({ userId: entry.value.userId, sdkAppId: SDKAppID, secretKey: SDKSecretKey });
|
|
99
|
-
await conference.login({ sdkAppId: SDKAppID, userId: entry.value.userId, userSig });
|
|
100
|
-
await conference.setSelfInfo({ userName: entry.value.userName, avatarUrl: '' });
|
|
101
|
-
await conference.createAndJoinRoom({ roomId: entry.value.roomId, options: { roomName: `${entry.value.userName || entry.value.userId} 的会议` } });
|
|
102
|
-
inRoom.value = true;
|
|
103
|
-
} catch (error) {
|
|
104
|
-
console.error('进入会议失败:', error);
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
const handleLeave = () => { inRoom.value = false; };
|
|
49
|
+
<script setup>
|
|
50
|
+
import { RoomKit } from '@tencentcloud/roomkit-web-vue3';
|
|
109
51
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
52
|
+
// 房间不存在则创建并成为房主,已存在则直接加入
|
|
53
|
+
const startQuickMeeting = async () => {
|
|
54
|
+
const room = RoomKit.getShareInstance({
|
|
55
|
+
sdkAppId: 0, // 控制台获取的 SDKAppID
|
|
56
|
+
userId: 'your_user_id', // 业务侧用户唯一标识
|
|
57
|
+
userSig: 'your_user_sig', // 由业务服务端签发并下发,切勿在客户端硬编码 SDKSecretKey
|
|
58
|
+
});
|
|
114
59
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
});
|
|
60
|
+
const myRoomId = `room_${Date.now()}`; // 由业务生成,需保证全局唯一
|
|
61
|
+
await room.createAndJoin({ container: '#meeting', roomId: myRoomId });
|
|
62
|
+
};
|
|
119
63
|
</script>
|
|
120
64
|
|
|
65
|
+
<template>
|
|
66
|
+
<button @click="startQuickMeeting">发起会议</button>
|
|
67
|
+
<!-- 会议界面的挂载节点,需在进会前完成渲染,并指定明确宽高 -->
|
|
68
|
+
<div id="meeting" style="width: 1080px; height: 640px"></div>
|
|
69
|
+
</template>
|
|
121
70
|
```
|
|
122
71
|
|
|
123
|
-
###
|
|
124
|
-
|
|
125
|
-
【npm】
|
|
126
|
-
``` bash
|
|
127
|
-
npm run dev
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
【pnpm】
|
|
131
|
-
``` bash
|
|
132
|
-
pnpm run dev
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
【yarn】
|
|
136
|
-
``` bash
|
|
137
|
-
yarn run dev
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
启动成功后,在浏览器访问本地调试地址(通常为 `http://localhost:5173`),填写用户 ID 与房间号,点击 **进入会议**,即可进入 TUIRoomKit 会中界面。
|
|
141
|
-
|
|
142
|
-
**验证多人会议:**建议打开两个浏览器标签页,分别模拟不同用户进入同一房间,验证音视频互通与会中功能。操作步骤如下:
|
|
143
|
-
|
|
144
|
-
**步骤1:**打开两个浏览器标签页,分别填写用户 ID `userA`、`userB` 及相同房间号 `room_123456`,点击 **进入会议**。`userA` 先进入时将自动创建房间并成为房主;`userB` 后进入时将作为参会者加入。
|
|
145
|
-
|
|
146
|
-
**步骤2:**测试用户均进入会中界面后,可在成员列表中互相看到对方;开启摄像头、麦克风,确认能否看到彼此的画面并听到声音。
|
|
147
|
-
|
|
148
|
-
**步骤3:**您还可以体验屏幕共享、聊天、成员管理等会中能力,确认多人场景下的基础功能正常。
|
|
149
|
-
|
|
150
|
-
## 接入详解
|
|
151
|
-
|
|
152
|
-
快速接入章节以一体化示例帮助您完成首次进房体验。若需将会议能力集成至实际业务,可按会议流程分步集成。本节依次介绍 SDK 依赖安装、TUIRoomKit 组件引用、登录鉴权、创建与加入会议、离开会议、监听会议状态等核心能力的用法。
|
|
153
|
-
|
|
154
|
-
### 步骤1:安装 SDK 依赖
|
|
155
|
-
|
|
156
|
-
在您的业务项目中安装 TUIRoomKit 及配套依赖包。
|
|
157
|
-
|
|
158
|
-
【npm】
|
|
159
|
-
``` bash
|
|
160
|
-
npm install @tencentcloud/roomkit-web-vue3 tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/universal-api
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
【pnpm】
|
|
164
|
-
``` bash
|
|
165
|
-
pnpm install @tencentcloud/roomkit-web-vue3 tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/universal-api
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
【yarn】
|
|
169
|
-
``` bash
|
|
170
|
-
yarn add @tencentcloud/roomkit-web-vue3 tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/universal-api
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
### 步骤2:引用 TUIRoomKit 组件
|
|
174
|
-
|
|
175
|
-
TUIRoomKit 提供 Web 桌面端与 H5 移动端两套会中完整界面组件,均从 `@tencentcloud/roomkit-web-vue3` 导出。根据终端类型按需引用:
|
|
176
|
-
- `ConferenceMainView`:面向 Web 桌面端,提供九宫格 / 侧边栏 / 顶部栏等视频布局,内置摄像头、麦克风、屏幕共享、成员管理、聊天、邀请入会等完整会中能力。
|
|
72
|
+
### 预定会议
|
|
177
73
|
|
|
178
|
-
|
|
74
|
+
#### **场景一:客户端预订**
|
|
179
75
|
|
|
180
|
-
|
|
76
|
+
**适用场景:**适用于需要在未来特定时间召开的会议(如团队周会、线上培训等)。用户可在客户端提前设定会议标题、时间及受邀参会成员。
|
|
181
77
|
|
|
182
|
-
|
|
183
|
-
<template>
|
|
184
|
-
<UIKitProvider theme="light" language="zh-CN">
|
|
185
|
-
<ConferenceMainView v-if="isPC"></ConferenceMainView>
|
|
186
|
-
<ConferenceMainViewH5 v-else></ConferenceMainViewH5>
|
|
187
|
-
</UIKitProvider>
|
|
188
|
-
</template>
|
|
78
|
+
**实现方式:**由客户端生成或向业务后台申请一个唯一的房间号,并配合会议时间等参数调用 scheduleRoom 接口提交预定。预定成功后,会议信息将同步至参与者的会议列表中。更多客户端预订会议能力请参考 [无 UI 集成 > 预订房间](https://cloud.tencent.com/document/product/647/126931)。
|
|
189
79
|
|
|
190
|
-
|
|
191
|
-
import { ref } from 'vue';
|
|
192
|
-
import { UIKitProvider } from '@tencentcloud/uikit-base-component-vue3';
|
|
193
|
-
import { ConferenceMainView, ConferenceMainViewH5 } from '@tencentcloud/roomkit-web-vue3';
|
|
194
|
-
import { getPlatform } from '@tencentcloud/universal-api';
|
|
80
|
+
#### **场景二:服务端预订**
|
|
195
81
|
|
|
196
|
-
|
|
197
|
-
</script>
|
|
198
|
-
```
|
|
82
|
+
**适用场景:**会议排期完全由业务系统统一管理,不由客户端发起(如政务、医疗、大型企业 OA 等强管控场景)。
|
|
199
83
|
|
|
200
|
-
|
|
84
|
+
**实现方式:**由业务服务端调用 [服务端 REST API 创建房间](https://cloud.tencent.com/document/product/647/104446),在 invitees 中指定受邀成员后,这些成员在客户端同样能拉取到该会议。
|
|
201
85
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
> **注意**:
|
|
205
|
-
>
|
|
206
|
-
> UserSig 是 TUIRoomKit 登录的核心凭证。**生产环境**必须由业务服务端生成 UserSig,客户端在需要时向业务服务器请求获取,切勿在客户端硬编码 SDKSecretKey。**本地开发调试**时,可使用 `@tencentcloud/roomkit-web-vue3` 提供的 `genTestUserSig` 生成临时 UserSig,仅用于本地验证,不可用于生产环境。详见 [正式运行阶段如何计算 UserSig](https://cloud.tencent.com/document/product/647/17275#formal)。
|
|
207
|
-
>
|
|
86
|
+
### 加入会议
|
|
208
87
|
|
|
88
|
+
房间已经存在时调用 `join` 接口,参数中传入 `roomId`。
|
|
209
89
|
``` typescript
|
|
210
|
-
|
|
211
|
-
import {
|
|
212
|
-
|
|
213
|
-
const SDKAppID = 0; // 控制台获取的 SDKAppID
|
|
214
|
-
const userId = 'your_user_id'; // 业务侧用户唯一标识
|
|
215
|
-
const userSig = 'your_user_sig'; // 由业务服务端签发并下发
|
|
216
|
-
const userName = 'your_user_name';
|
|
217
|
-
|
|
218
|
-
onMounted(async () => {
|
|
219
|
-
try {
|
|
220
|
-
await conference.login({ sdkAppId: SDKAppID, userId, userSig });
|
|
221
|
-
await conference.setSelfInfo({
|
|
222
|
-
userName,
|
|
223
|
-
avatarUrl: 'https://your-avatar-url.com/image.png',
|
|
224
|
-
});
|
|
225
|
-
} catch (error) {
|
|
226
|
-
console.error('TUIRoomKit 登录失败:', error);
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
```
|
|
90
|
+
<script setup>
|
|
91
|
+
import { RoomKit } from '@tencentcloud/roomkit-web-vue3';
|
|
230
92
|
|
|
231
|
-
|
|
93
|
+
const room = RoomKit.getShareInstance({
|
|
94
|
+
sdkAppId: 0, // 控制台获取的 SDKAppID
|
|
95
|
+
userId: 'your_user_id', // 业务侧用户唯一标识
|
|
96
|
+
userSig: 'your_user_sig', // 由业务服务端签发并下发,切勿在客户端硬编码 SDKSecretKey
|
|
97
|
+
});
|
|
232
98
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
import { conference } from '@tencentcloud/roomkit-web-vue3';
|
|
99
|
+
const joinMeeting = async (sharedRoomId) => {
|
|
100
|
+
await room.join({ container: '#meeting', roomId: sharedRoomId });
|
|
101
|
+
};
|
|
102
|
+
</script>
|
|
238
103
|
|
|
239
|
-
|
|
104
|
+
<template>
|
|
105
|
+
<div id="meeting" style="width: 1080px; height: 640px"></div>
|
|
106
|
+
</template>
|
|
240
107
|
|
|
241
|
-
watch(() => loginUserInfo.value?.userId, async (userId) => {
|
|
242
|
-
if (userId) {
|
|
243
|
-
await conference.createAndJoinRoom({ roomId: '123456' });
|
|
244
|
-
}
|
|
245
|
-
}, { immediate: true });
|
|
246
108
|
```
|
|
247
109
|
|
|
248
|
-
###
|
|
110
|
+
### 离开会议
|
|
249
111
|
|
|
250
|
-
|
|
112
|
+
TUIRoomKit 已在界面上内置离开与解散房间功能,用户可直接点击 **离开房间** 或 **解散房间** 完成操作。
|
|
251
113
|
|
|
252
|
-
|
|
114
|
+
如需在业务代码中主动触发离开或解散,可调用以下接口,接口执行完成即代表退出成功,**不会触发** `exited` **事件**。
|
|
253
115
|
|
|
254
|
-
|
|
116
|
+
**场景一:主动离开房间**
|
|
255
117
|
|
|
256
|
-
|
|
118
|
+
参与者和房主均可调用 `leave()` 离开会议,调用后不影响其他成员,房间继续存在。
|
|
257
119
|
``` typescript
|
|
258
|
-
|
|
120
|
+
const room = RoomKit.getShareInstance({
|
|
121
|
+
sdkAppId: 0, // 控制台获取的 SDKAppID
|
|
122
|
+
userId: 'your_user_id', // 业务侧用户唯一标识
|
|
123
|
+
userSig: 'your_user_sig', // 由业务服务端签发并下发,切勿在客户端硬编码 SDKSecretKey
|
|
124
|
+
});
|
|
259
125
|
|
|
260
|
-
|
|
261
|
-
// 1. 客户端生成一个唯一的 roomId
|
|
262
|
-
const myRoomId = `room_${Date.now()}`;
|
|
263
|
-
|
|
264
|
-
// 2. 建房并直接加入
|
|
265
|
-
await conference.createAndJoinRoom({
|
|
266
|
-
roomId: myRoomId,
|
|
267
|
-
options: {
|
|
268
|
-
roomName: '我的快速会议',
|
|
269
|
-
},
|
|
270
|
-
});
|
|
271
|
-
};
|
|
126
|
+
await room.leave();
|
|
272
127
|
```
|
|
273
128
|
|
|
274
|
-
|
|
129
|
+
> **说明:**
|
|
130
|
+
> 房主离开房间或关闭网页,不会自动解散房间,其他参会成员可继续正常使用 TUIRoomKit 能力,系统会在会议结束时间后 6 小时、且房间内人数为 0 时自动回收房间资源
|
|
131
|
+
>
|
|
275
132
|
|
|
276
|
-
|
|
133
|
+
**场景二:主动解散房间**
|
|
277
134
|
|
|
278
|
-
|
|
135
|
+
房主调用 `end()` 后,房间内所有成员均会收到房间已解散的通知。传入 `roomId` 可解散指定房间,调用者无需身处该房间,适用于在会议列表中直接解散某一场会议。
|
|
279
136
|
``` typescript
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
try {
|
|
286
|
-
// roomId 限制:字符串类型,必传参数,建议由业务后台生成保证 roomId 唯一性。
|
|
287
|
-
const roomId = '123456';
|
|
288
|
-
|
|
289
|
-
// 注意:时间戳单位必须为 **秒** (Date.getTime() 获取的是毫秒,需除以 1000)
|
|
290
|
-
const startTime = Math.floor(new Date().getTime() / 1000) + 3600; // 1小时后开始
|
|
291
|
-
const duration = 1800; // 30分钟
|
|
292
|
-
|
|
293
|
-
const options = {
|
|
294
|
-
roomName: '产品需求评审会',
|
|
295
|
-
scheduleStartTime: startTime, // 单位:秒
|
|
296
|
-
scheduleEndTime: startTime + duration, // 单位:秒
|
|
297
|
-
scheduleAttendees: ['userA', 'userB'], // 邀请参会成员ID列表
|
|
298
|
-
password: '123', // 可选:设置入会密码
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
await scheduleRoom({ roomId, options });
|
|
302
|
-
} catch (error) {
|
|
303
|
-
console.error('预定失败', error);
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
#### 场景三:服务端创建会议
|
|
309
|
-
|
|
310
|
-
**适用场景:**政务、医疗、大型企业 OA 等强管控场景。
|
|
137
|
+
const room = RoomKit.getShareInstance({
|
|
138
|
+
sdkAppId: 0, // 控制台获取的 SDKAppID
|
|
139
|
+
userId: 'your_user_id', // 业务侧用户唯一标识
|
|
140
|
+
userSig: 'your_user_sig', // 由业务服务端签发并下发,切勿在客户端硬编码 SDKSecretKey
|
|
141
|
+
});
|
|
311
142
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
POST /v4/room_engine_http_srv/create_room
|
|
315
|
-
{
|
|
316
|
-
"roomId": "your-room-id",
|
|
317
|
-
"roomName": "会议名称",
|
|
318
|
-
"startTime": 1710000000,
|
|
319
|
-
"endTime": 1710003600,
|
|
320
|
-
"invitees": ["userId1", "userId2"]
|
|
321
|
-
}
|
|
143
|
+
// 解散当前所在的会议
|
|
144
|
+
await room.end();
|
|
322
145
|
```
|
|
323
146
|
|
|
324
|
-
###
|
|
325
|
-
|
|
326
|
-
参会成员加入房间时,请根据业务情况选择适合的加入房间的方式。
|
|
147
|
+
### 事件监听
|
|
327
148
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
**适用场景:**房间已经被发起人或服务端明确创建,参会人收到了发起人分享的房间号或者会议邀请链接。
|
|
331
|
-
|
|
332
|
-
**实现方式:**参会人输入房间号,或通过邀请链接解析出 `roomId` 后,调用 `conference.joinRoom` 加入会议。
|
|
149
|
+
房间可能因用户离开、被解散、被踢或登录态失效而结束。TUIRoomKit 会处理底层音视频资源与界面提示,**页面怎么走由业务接管**。通过 `on('exited')` 监听退出,在回调中恢复业务页面,该方法返回一个取消监听的函数。
|
|
333
150
|
``` typescript
|
|
334
|
-
import {
|
|
335
|
-
|
|
336
|
-
const joinExistingMeeting = async (sharedRoomId: string) => {
|
|
337
|
-
await conference.joinRoom({
|
|
338
|
-
roomId: sharedRoomId,
|
|
339
|
-
});
|
|
340
|
-
};
|
|
341
|
-
```
|
|
342
|
-
|
|
343
|
-
#### 场景二:从房间列表加入会议
|
|
344
|
-
|
|
345
|
-
**适用场景:**适用于已通过“客户端预约”或“服务端创建”的会议。用户可进入“会议列表”页面,查看自己预定或受邀参与的会议,并快速点击加入。
|
|
151
|
+
import { onUnmounted } from 'vue';
|
|
152
|
+
import { RoomKit, ExitReason } from '@tencentcloud/roomkit-web-vue3';
|
|
346
153
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
<ul v-if="roomList.length > 0">
|
|
353
|
-
<li v-for="room in roomList" :key="room.roomId" class="item">
|
|
354
|
-
<div class="info">
|
|
355
|
-
<b>{{ room.roomName || '未命名会议' }}</b>
|
|
356
|
-
<span>房间号: {{ room.roomId }}</span>
|
|
357
|
-
</div>
|
|
358
|
-
<button class="btn" @click="handleJoinRoom(room.roomId)">加入会议</button>
|
|
359
|
-
</li>
|
|
360
|
-
</ul>
|
|
361
|
-
<div v-else>暂无待参加的预约会议</div>
|
|
362
|
-
</div>
|
|
363
|
-
</template>
|
|
154
|
+
const room = RoomKit.getShareInstance({
|
|
155
|
+
sdkAppId: 0, // 控制台获取的 SDKAppID
|
|
156
|
+
userId: 'your_user_id',
|
|
157
|
+
userSig: 'your_user_sig', // 由业务服务端签发
|
|
158
|
+
});
|
|
364
159
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
// 1. 监听登录状态,确保鉴权就绪后再拉取会议列表
|
|
375
|
-
watch(
|
|
376
|
-
() => loginUserInfo.value?.userId,
|
|
377
|
-
async (userId) => {
|
|
378
|
-
if (userId) {
|
|
379
|
-
try {
|
|
380
|
-
roomList.value = await getScheduledRoomList() || [];
|
|
381
|
-
} catch (error) {
|
|
382
|
-
console.error('获取预约会议列表失败:', error);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
},
|
|
386
|
-
{ immediate: true }
|
|
387
|
-
);
|
|
388
|
-
|
|
389
|
-
// 2. 点击加入房间
|
|
390
|
-
const handleJoinRoom = async (roomId: string) => {
|
|
391
|
-
try {
|
|
392
|
-
await conference.joinRoom({ roomId });
|
|
393
|
-
} catch (error) {
|
|
394
|
-
console.error(`加入会议失败 (${roomId}):`, error);
|
|
160
|
+
const offExited = room.on('exited', ({ roomId, reason }) => {
|
|
161
|
+
switch(reason) {
|
|
162
|
+
case ExitReason.KickedOffline:
|
|
163
|
+
case ExitReason.UserSigExpired:
|
|
164
|
+
backToLogin(); // 业务侧的登录逻辑
|
|
165
|
+
break;
|
|
166
|
+
default:
|
|
167
|
+
// 隐藏会议容器或返回上一页
|
|
168
|
+
return;
|
|
395
169
|
}
|
|
396
|
-
};
|
|
397
|
-
</script>
|
|
170
|
+
});
|
|
398
171
|
|
|
172
|
+
onUnmounted(() => offExited()); // 组件销毁时取消监听
|
|
399
173
|
```
|
|
400
174
|
|
|
401
|
-
|
|
175
|
+
`reason` 的取值及触发时机如下。
|
|
402
176
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
await conference.createAndJoinRoom({
|
|
412
|
-
roomId: bizOrderId,
|
|
413
|
-
options: {
|
|
414
|
-
roomName: `业务沟通:${bizOrderId}`,
|
|
415
|
-
},
|
|
416
|
-
});
|
|
417
|
-
};
|
|
418
|
-
```
|
|
177
|
+
|`reason`|触发时机|
|
|
178
|
+
|---------|---------|
|
|
179
|
+
|`ExitReason.RoomLeave`|用户点击界面上的「离开会议」按钮,或在密码输入框中点击取消|
|
|
180
|
+
|`ExitReason.RoomDismiss`|会议被解散,对所有成员触发|
|
|
181
|
+
|`ExitReason.KickedOut`|被房主踢出会议|
|
|
182
|
+
|`ExitReason.RoomError`|会议界面已挂载后进房失败(如输入密码后进房失败),TUIRoomKit 会先给出错误提示。界面挂载前的失败不触发本事件:`join` 由 TUIRoomKit 弹出错误提示且 Promise resolve,`createAndJoin` 当场失败则抛出异常|
|
|
183
|
+
|`ExitReason.KickedOffline`|同一账号在其他设备登录,当前设备被强制下线|
|
|
184
|
+
|`ExitReason.UserSigExpired`|UserSig 已过期|
|
|
419
185
|
|
|
420
186
|
> **说明:**
|
|
421
|
-
> `
|
|
187
|
+
> `KickedOffline` 与 `UserSigExpired` 属于登录态失效,即使用户当前不在会议中也会触发,此时 `roomId` 为空字符串。
|
|
422
188
|
>
|
|
423
189
|
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
TUIRoomKit 已在界面上内置离开与解散房间功能,用户可直接点击 **离开房间** 或 **解散房间** 完成操作。
|
|
427
|
-
|
|
428
|
-
如需在业务代码中主动触发离开或解散,可调用以下接口。
|
|
429
|
-
|
|
430
|
-
#### 场景一:主动离开房间
|
|
190
|
+
## 界面定制
|
|
431
191
|
|
|
432
|
-
|
|
433
|
-
``` typescript
|
|
434
|
-
import { conference } from '@tencentcloud/roomkit-web-vue3';
|
|
435
|
-
|
|
436
|
-
await conference.leaveRoom();
|
|
437
|
-
```
|
|
192
|
+
在完成基础集成后,您可以根据业务需求进一步定制会议界面。以下配置均通过会议实例调用,建议在进会前调用,避免界面加载后再变化。
|
|
438
193
|
|
|
439
|
-
|
|
440
|
-
>
|
|
441
|
-
> 房主离开房间或关闭网页,不会自动解散房间,其他参会成员可继续正常使用 TUIRoomKit 能力,系统会在会议结束时间后 6 小时、且房间内人数为 0 时自动回收房间资源。
|
|
442
|
-
>
|
|
443
|
-
|
|
444
|
-
#### 场景二:主动解散房间
|
|
445
|
-
|
|
446
|
-
房主调用 `endRoom()` 后,房间内所有成员均会收到房间已解散的通知。
|
|
447
|
-
``` typescript
|
|
448
|
-
import { conference } from '@tencentcloud/roomkit-web-vue3';
|
|
449
|
-
|
|
450
|
-
await conference.endRoom();
|
|
451
|
-
```
|
|
452
|
-
|
|
453
|
-
> **注意**:
|
|
454
|
-
>
|
|
455
|
-
> `endRoom()` 必须由房主在成功进入房间后才能调用。非房主身份或在尚未进入房间的状态下调用会报错。
|
|
456
|
-
>
|
|
194
|
+
### 配置主题及语言
|
|
457
195
|
|
|
458
|
-
|
|
196
|
+
会议界面默认使用浅色主题,界面语言跟随浏览器语言。用户可在会中通过内置的主题、语言按钮自行切换;如需隐藏这两个按钮。更多自定义主题及语言。
|
|
459
197
|
|
|
460
|
-
|
|
198
|
+
### 调整工具栏按钮
|
|
461
199
|
|
|
462
|
-
|
|
200
|
+
会议界面的工具栏按钮默认全部展示。如需隐藏某些能力(如后台系统不需要主题切换、教育场景不开放屏幕共享),可调用 `setWidgetVisible`:
|
|
463
201
|
``` typescript
|
|
464
|
-
|
|
465
|
-
<ConferenceMainView></ConferenceMainView>
|
|
466
|
-
</template>
|
|
467
|
-
|
|
468
|
-
<script setup lang="ts">
|
|
469
|
-
import { ref, onMounted, onUnmounted } from 'vue';
|
|
470
|
-
import { ConferenceMainView, conference, RoomEvent } from '@tencentcloud/roomkit-web-vue3';
|
|
202
|
+
import { RoomKit, BuiltinWidget } from '@tencentcloud/roomkit-web-vue3';
|
|
471
203
|
|
|
472
|
-
const
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
conference.on(RoomEvent.ROOM_DISMISS, backToHome);
|
|
477
|
-
conference.on(RoomEvent.ROOM_LEAVE, backToHome);
|
|
478
|
-
conference.on(RoomEvent.ROOM_ERROR, backToHome);
|
|
479
|
-
conference.on(RoomEvent.KICKED_OUT, backToHome);
|
|
480
|
-
conference.on(RoomEvent.KICKED_OFFLINE, backToLogin);
|
|
481
|
-
conference.on(RoomEvent.USER_SIG_EXPIRED, backToLogin);
|
|
204
|
+
const room = RoomKit.getShareInstance({
|
|
205
|
+
sdkAppId: 0, // 控制台获取的 SDKAppID
|
|
206
|
+
userId: 'your_user_id',
|
|
207
|
+
userSig: 'your_user_sig', // 由业务服务端签发
|
|
482
208
|
});
|
|
483
209
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
conference.off(RoomEvent.ROOM_ERROR, backToHome);
|
|
488
|
-
conference.off(RoomEvent.KICKED_OUT, backToHome);
|
|
489
|
-
conference.off(RoomEvent.KICKED_OFFLINE, backToLogin);
|
|
490
|
-
conference.off(RoomEvent.USER_SIG_EXPIRED, backToLogin);
|
|
210
|
+
room.setWidgetVisible({
|
|
211
|
+
[BuiltinWidget.ScreenShareWidget]: false, // 隐藏屏幕共享
|
|
212
|
+
[BuiltinWidget.ThemeWidget]: false, // 隐藏主题切换
|
|
491
213
|
});
|
|
492
|
-
</script>
|
|
493
214
|
```
|
|
494
215
|
|
|
495
|
-
|
|
496
|
-
|---------|---------|---------|
|
|
497
|
-
|`RoomEvent.ROOM_DISMISS`|房间被解散,对所有成员触发|返回首页或会议列表|
|
|
498
|
-
|`RoomEvent.ROOM_LEAVE`|用户点击 TUIRoomKit 界面上的「离开」按钮|返回首页或会议列表|
|
|
499
|
-
|`RoomEvent.ROOM_ERROR`|进房失败或房间内发生未处理的错误|返回首页或会议列表|
|
|
500
|
-
|`RoomEvent.KICKED_OUT`|被房主踢出房间|返回首页或会议列表|
|
|
501
|
-
|`RoomEvent.KICKED_OFFLINE`|同一账号在其他设备登录,当前设备被强制下线|跳转登录页|
|
|
502
|
-
|`RoomEvent.USER_SIG_EXPIRED`|UserSig 已过期|跳转登录页|
|
|
503
|
-
|
|
504
|
-
## 下一步
|
|
505
|
-
|
|
506
|
-
在完成基础集成后,您可以根据业务需求进一步定制 UI 界面。
|
|
507
|
-
|
|
508
|
-
### 配置主题及语言
|
|
509
|
-
|
|
510
|
-
通过配置 `App.vue` 中 `UIKitProvider` 的入参,修改主题及语言的默认值。更多自定义主题及语言。
|
|
511
|
-
| <code>UIKitProvider</code> 参数 | 可选值 | 默认值 |
|
|
512
|
-
| --- | --- | --- |
|
|
513
|
-
| theme | "light" \\| "dark" | "light" |
|
|
514
|
-
| language | "zh-CN" \\| "en-US" | "en-US" |
|
|
515
|
-
|
|
216
|
+
若需要在用户操作生效前插入业务校验(如开启摄像头前确认权限、共享屏幕前提示保密要求),可使用 `onWill` 拦截:
|
|
516
217
|
``` typescript
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
import { UIKitProvider } from '@tencentcloud/uikit-base-component-vue3';
|
|
524
|
-
import { ConferenceMainView, ConferenceMainViewH5 } from '@tencentcloud/roomkit-web-vue3';
|
|
525
|
-
</script>
|
|
218
|
+
import { InterceptorAction } from '@tencentcloud/roomkit-web-vue3';
|
|
219
|
+
|
|
220
|
+
const offInterceptor = room.onWill(InterceptorAction.StartScreenShare, async (_action, proceed, abort) => {
|
|
221
|
+
const confirmed = await showYourOwnConfirmDialog();
|
|
222
|
+
confirmed ? proceed() : abort();
|
|
223
|
+
});
|
|
526
224
|
```
|
|
527
225
|
|
|
226
|
+
更多界面调整能力。
|
|
227
|
+
|
|
528
228
|
### 配置用户联系人列表
|
|
529
229
|
|
|
530
230
|
TUIRoomKit 内置的邀请参会和预定会议选人组件,底层默认依赖腾讯云 IM 的用户关系链(好友列表)。如果您希望在这些组件中展示您企业内部的组织架构或好友列表,请先通过服务端 REST API 将您的业务联系人同步至腾讯云 IM 系统中:
|
|
@@ -536,28 +236,41 @@ TUIRoomKit 内置的邀请参会和预定会议选人组件,底层默认依赖
|
|
|
536
236
|
|
|
537
237
|
TUIRoomKit 默认使用当前页面地址作为房间分享链接。
|
|
538
238
|
|
|
539
|
-
如您需要修改链接地址,可调用 `
|
|
239
|
+
如您需要修改链接地址,可调用 `setFeatureConfig` 更新分享链接。
|
|
540
240
|
``` typescript
|
|
541
|
-
import {
|
|
241
|
+
import { RoomKit } from '@tencentcloud/roomkit-web-vue3';
|
|
542
242
|
|
|
543
|
-
|
|
243
|
+
const room = RoomKit.getShareInstance({
|
|
244
|
+
sdkAppId: 0, // 控制台获取的 SDKAppID
|
|
245
|
+
userId: 'your_user_id',
|
|
246
|
+
userSig: 'your_user_sig', // 由业务服务端签发
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
// 在 createAndJoin / join 成功之后立即调用,确保 roomId 已知
|
|
544
250
|
const roomId = '123456';
|
|
545
|
-
|
|
251
|
+
room.setFeatureConfig({
|
|
546
252
|
shareLink: `https://your-domain.com/room?roomId=${roomId}`,
|
|
547
253
|
});
|
|
548
254
|
```
|
|
549
255
|
|
|
550
256
|
### 设置视频布局及挂件
|
|
551
257
|
|
|
552
|
-
TUIRoomKit 目前支持九宫格、侧边栏及顶部栏三种流布局,默认为九宫格布局,开发者可调用 `
|
|
258
|
+
TUIRoomKit 目前支持九宫格、侧边栏及顶部栏三种流布局,默认为九宫格布局,开发者可调用 `setFeatureConfig` 修改默认视频布局。
|
|
553
259
|
``` typescript
|
|
260
|
+
import { RoomKit } from '@tencentcloud/roomkit-web-vue3';
|
|
554
261
|
import { RoomLayoutTemplate } from 'tuikit-atomicx-vue3/room';
|
|
555
262
|
|
|
263
|
+
const room = RoomKit.getShareInstance({
|
|
264
|
+
sdkAppId: 0, // 控制台获取的 SDKAppID
|
|
265
|
+
userId: 'your_user_id',
|
|
266
|
+
userSig: 'your_user_sig', // 由业务服务端签发
|
|
267
|
+
});
|
|
268
|
+
|
|
556
269
|
// 方案一:修改默认视频流布局为侧边栏布局
|
|
557
|
-
|
|
270
|
+
room.setFeatureConfig({ layoutTemplate: RoomLayoutTemplate.SidebarLayout });
|
|
558
271
|
|
|
559
272
|
// 方案二:修改默认视频流布局为顶部栏布局
|
|
560
|
-
|
|
273
|
+
room.setFeatureConfig({ layoutTemplate: RoomLayoutTemplate.CinemaLayout });
|
|
561
274
|
```
|
|
562
275
|
|
|
563
276
|
TUIRoomKit 默认内置以下视频流挂件,如您需要自定义视频流挂件。
|
|
@@ -571,7 +284,7 @@ TUIRoomKit 默认内置以下视频流挂件,如您需要自定义视频流挂
|
|
|
571
284
|
为节省资源,建议在会议实际结束时,通过以下任一方式主动销毁房间:
|
|
572
285
|
- 界面操作:房主点击 TUIRoomKit 界面上的「解散房间」按钮;
|
|
573
286
|
|
|
574
|
-
- 客户端 API:调用 `
|
|
287
|
+
- 客户端 API:调用 `room.end()` 方法;
|
|
575
288
|
|
|
576
289
|
- 服务端 API:通过 REST API 进行远程销毁。
|
|
577
290
|
|
|
@@ -622,12 +335,12 @@ TUIRoomKit 已提供丰富的 UI 自定义能力,包括 主题及语言、界
|
|
|
622
335
|
```
|
|
623
336
|
2. 根据脚本提示确认是否要将 TUIRoomKit 源码拷贝到 `./src/components/RoomKit` 目录。如您需要自定义拷贝目录请输入 'y', 否则输入'n'。
|
|
624
337
|
|
|
625
|
-
3. 源码导出后,在您指定的项目路径中会新增 TUIRoomKit 源码。此时,您需要手动将
|
|
338
|
+
3. 源码导出后,在您指定的项目路径中会新增 TUIRoomKit 源码。此时,您需要手动将 `RoomKit` 的引用从 npm 包地址更改为 TUIRoomKit 源码的相对路径地址。
|
|
626
339
|
|
|
627
340
|
``` typescript
|
|
628
|
-
- import {
|
|
341
|
+
- import { RoomKit } from '@tencentcloud/roomkit-web-vue3';
|
|
629
342
|
// 替换引用路径为 TUIRoomKit 源码的真实路径
|
|
630
|
-
+ import {
|
|
343
|
+
+ import { RoomKit } from './components/RoomKit/index.ts';
|
|
631
344
|
```
|
|
632
345
|
4. 配置 ESLint 校验
|
|
633
346
|
|