@tencentcloud/sdk-mcp 1.7.3 → 1.7.5
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 +23 -0
- package/README.md +22 -23
- package/knowledge/path-meta.js +23 -1
- package/package.json +1 -1
- package/resource/index/manifest.json +1 -1
- package/resource/integration/callkit/preset/android/integration.md +4 -0
- package/resource/integration/callkit/preset/flutter/integration.md +8 -4
- package/resource/integration/callkit/preset/ios/integration.md +16 -15
- package/resource/integration/callkit/preset/react/integration.md +2 -2
- package/resource/integration/callkit/preset/vue/integration.md +9 -12
- package/resource/integration/chat/preset/android/integration.md +5 -147
- package/resource/integration/chat/preset/flutter/integration.md +22 -130
- package/resource/integration/chat/preset/ios/integration.md +12 -279
- package/resource/integration/chat/preset/react/integration.md +27 -1
- package/resource/integration/chat/preset/uni-app/integration.md +5 -1
- package/resource/integration/chat/preset/vue/integration.md +21 -31
- package/resource/integration/livekit/preset/live/android/live-host-integration.md +4 -0
- package/resource/integration/livekit/preset/live/ios/live-host-integration.md +4 -0
- package/resource/integration/livekit/preset/live/ios/prepare-integration.md +3 -3
- package/resource/integration/livekit/preset/live/vue/live-list-integration.md +3 -4
- package/resource/integration/livekit/preset/live/vue/live-player-desk-integration.md +0 -1
- package/resource/integration/livekit/preset/live/vue/live-player-h5-integration.md +0 -1
- package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +4 -9
- package/resource/integration/roomkit/preset/vue/integration.md +152 -652
- package/resource/knowledge/callkit/best-practice/android/video-chat-dating.md +490 -0
- package/resource/knowledge/callkit/best-practice/flutter/android-keep-call-alive-background.md +79 -0
- package/resource/knowledge/callkit/best-practice/flutter/background-incoming-call-no-notification.md +99 -0
- package/resource/knowledge/callkit/best-practice/flutter/ios-keep-call-alive-background.md +93 -0
- package/resource/knowledge/callkit/best-practice/flutter/ios-startup-crash-version-voip.md +68 -0
- 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/flutter/offline-push.md +1 -1
- package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +18 -16
- package/resource/knowledge/callkit/core-sdk/ios/make-call.md +16 -14
- package/resource/knowledge/callkit/core-sdk/miniprogram/call-engine.md +19 -19
- package/resource/knowledge/callkit/core-sdk/miniprogram/call-event.md +16 -16
- package/resource/knowledge/callkit/core-sdk/uni-app/answer-call.md +2 -86
- package/resource/knowledge/callkit/core-sdk/uni-app/make-call.md +2 -104
- package/resource/knowledge/callkit/core-sdk/web/call-event.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/faq/error-code.md +62 -36
- package/resource/knowledge/callkit/faq/uniapp-miniprogram.md +1 -1
- package/resource/knowledge/callkit/preset/android/api.md +10 -10
- package/resource/knowledge/callkit/preset/harmonyos/api.md +362 -0
- package/resource/knowledge/callkit/preset/harmonyos/integration.md +322 -0
- package/resource/knowledge/callkit/preset/ios/api.md +9 -9
- package/resource/knowledge/callkit/preset/miniprogram/api-uniapp.md +293 -0
- package/resource/knowledge/callkit/preset/miniprogram/api.md +19 -19
- package/resource/knowledge/callkit/preset/miniprogram/integration.md +292 -0
- package/resource/knowledge/callkit/preset/miniprogram/uniapp-integration.md +521 -0
- package/resource/knowledge/callkit/preset/uni-app/api.md +49 -0
- package/resource/knowledge/callkit/preset/uni-app/integration.md +353 -0
- package/resource/knowledge/chat/preset/android-view/integration.md +54 -102
- package/resource/knowledge/chat/preset/ios/features/language.md +5 -5
- package/resource/knowledge/chat/preset/ios-uikit/integration.md +194 -926
- package/resource/knowledge/chat/preset/react/features/search.md +9 -214
- package/resource/knowledge/chat/preset/react/h5/integration.md +965 -0
- package/resource/knowledge/chat/preset/vue/features/chat-header.md +0 -36
- package/resource/knowledge/chat/preset/vue/features/contact-list.md +0 -34
- package/resource/knowledge/chat/preset/vue/features/conversation-list.md +0 -39
- package/resource/knowledge/chat/preset/vue/features/conversation-preview.md +0 -74
- package/resource/knowledge/chat/preset/vue/features/message-input.md +4 -4
- package/resource/knowledge/chat/preset/vue/features/search.md +9 -790
- package/resource/knowledge/chat/preset/vue/h5/integration.md +724 -0
- 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 -170
- package/resource/knowledge/livekit/core-sdk/live/android/co-guest-interaction.md +1 -1
- package/resource/knowledge/livekit/core-sdk/live/android/host-interaction.md +3 -3
- package/resource/knowledge/livekit/core-sdk/live/flutter/co-guest-interaction.md +1 -1
- package/resource/knowledge/livekit/core-sdk/live/flutter/host-interaction.md +3 -3
- package/resource/knowledge/livekit/core-sdk/live/flutter/integration.md +3 -3
- package/resource/knowledge/livekit/core-sdk/live/ios/co-guest-interaction.md +1 -1
- package/resource/knowledge/livekit/core-sdk/live/ios/host-interaction.md +3 -3
- package/resource/knowledge/livekit/core-sdk/live/ios/integration.md +2 -2
- package/resource/knowledge/livekit/core-sdk/live/uni-app/co-guest-interaction.md +13 -78
- package/resource/knowledge/livekit/core-sdk/live/uni-app/host-interaction.md +5 -70
- package/resource/knowledge/livekit/core-sdk/live/uni-app/integration.md +10 -10
- package/resource/knowledge/livekit/core-sdk/voice/android/co-guest-interaction.md +1 -1
- package/resource/knowledge/livekit/core-sdk/voice/android/host-interaction.md +4 -4
- package/resource/knowledge/livekit/core-sdk/voice/flutter/co-guest-interaction.md +1 -1
- package/resource/knowledge/livekit/core-sdk/voice/ios/co-guest-interaction.md +1 -1
- package/resource/knowledge/livekit/core-sdk/voice/ios/host-interaction.md +4 -4
- package/resource/knowledge/livekit/core-sdk/voice/uni-app/integration.md +7 -7
- package/resource/knowledge/livekit/preset/live/vue/features/barrage.md +1 -24
- package/resource/knowledge/livekit/preset/live/vue/features/live-audience-list.md +0 -3
- package/resource/knowledge/livekit/preset/live/vue/features/live-view.md +0 -5
- package/resource/knowledge/push/api-reference/harmonyos.md +9 -9
- package/resource/knowledge/push/api-reference/unity.md +10 -10
- package/resource/knowledge/push/api-reference/unreal-engine.md +11 -11
- 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 +90 -1067
- package/resource/knowledge/push/integration/donut.md +11 -11
- package/resource/knowledge/push/integration/flutter.md +38 -24
- package/resource/knowledge/push/integration/harmonyos.md +1 -11
- package/resource/knowledge/push/integration/ios.md +29 -40
- package/resource/knowledge/push/integration/react-native.md +1 -1
- package/resource/knowledge/push/integration/uni-app.md +1 -1
- package/resource/knowledge/push/integration/unity.md +4 -4
- package/resource/knowledge/push/integration/unreal-engine.md +9 -9
- package/resource/knowledge/roomkit/core-sdk/android/room-state.md +6 -6
- package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +13 -13
- package/resource/knowledge/roomkit/core-sdk/flutter/room-state.md +5 -5
- package/resource/knowledge/roomkit/core-sdk/flutter/schedule-room.md +4 -4
- package/resource/knowledge/roomkit/core-sdk/ios/room-state.md +6 -6
- package/resource/knowledge/roomkit/core-sdk/ios/schedule-room.md +4 -4
- package/resource/knowledge/roomkit/core-sdk/vue/device-detection.md +0 -9
- package/resource/knowledge/roomkit/core-sdk/vue/free-beauty-panel.md +0 -9
- package/resource/knowledge/roomkit/core-sdk/vue/recording.md +3 -3
- package/resource/knowledge/roomkit/core-sdk/vue/room-chat.md +0 -3
- package/resource/knowledge/roomkit/core-sdk/vue/room-view.md +0 -16
- package/resource/knowledge/roomkit/core-sdk/vue/schedule-room.md +0 -3
- package/resource/knowledge/roomkit/core-sdk/vue/virtual-background.md +3 -6
- package/resource/knowledge/roomkit/core-sdk/vue/whiteboard-annotation.md +0 -15
- package/resource/knowledge/roomkit/preset/android/integration.md +5 -202
- package/resource/knowledge/roomkit/preset/flutter/integration.md +17 -13
- package/resource/knowledge/roomkit/preset/harmonyos/integration.md +10 -2
- package/resource/knowledge/roomkit/preset/ios/integration.md +7 -204
- package/resource/knowledge/roomkit/preset/react/integration.md +0 -202
- package/resource/knowledge/roomkit/preset/uniapp-app/integration.md +244 -500
- package/resource/knowledge/rtcengine/web/plugin/42-advanced-realtime-transcriber.md +25 -6
- package/server.js +1 -1
- package/utils/preflight-route.js +203 -185
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
|
@@ -1,206 +1,5 @@
|
|
|
1
1
|
本文档介绍如何在 Vue 3 业务项目中集成 TUIRoomKit,快速获得开箱即用的多人音视频会议能力。
|
|
2
2
|
|
|
3
|
-
<style>
|
|
4
|
-
.vsdk-survey-card * {
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.vsdk-survey-card {
|
|
9
|
-
position: relative;
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
justify-content: space-between;
|
|
13
|
-
gap: 20px;
|
|
14
|
-
padding: 18px 22px;
|
|
15
|
-
margin: 16px 0;
|
|
16
|
-
border-radius: 14px;
|
|
17
|
-
overflow: hidden;
|
|
18
|
-
background: linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%);
|
|
19
|
-
border: 1px solid #D7E8FF;
|
|
20
|
-
box-shadow: 0 4px 16px rgba(0,110,255,.05);
|
|
21
|
-
transition: all .25s ease;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.vsdk-survey-card::before{
|
|
25
|
-
content:"";
|
|
26
|
-
position:absolute;
|
|
27
|
-
right:-60px;
|
|
28
|
-
top:-60px;
|
|
29
|
-
width:180px;
|
|
30
|
-
height:180px;
|
|
31
|
-
background:radial-gradient(circle,
|
|
32
|
-
rgba(0,110,255,.16) 0%,
|
|
33
|
-
rgba(0,110,255,.08) 45%,
|
|
34
|
-
transparent 75%);
|
|
35
|
-
pointer-events:none;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.vsdk-survey-card::after{
|
|
39
|
-
content:"";
|
|
40
|
-
position:absolute;
|
|
41
|
-
left:-40px;
|
|
42
|
-
bottom:-60px;
|
|
43
|
-
width:120px;
|
|
44
|
-
height:120px;
|
|
45
|
-
background:radial-gradient(circle,
|
|
46
|
-
rgba(76,169,255,.08),
|
|
47
|
-
transparent 70%);
|
|
48
|
-
pointer-events:none;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.vsdk-survey-card:hover{
|
|
52
|
-
border-color:#006EFF;
|
|
53
|
-
box-shadow:
|
|
54
|
-
0 10px 28px rgba(0,110,255,.10),
|
|
55
|
-
0 0 36px rgba(0,110,255,.08);
|
|
56
|
-
transform:translateY(-2px);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.vsdk-card-left{
|
|
60
|
-
display:flex;
|
|
61
|
-
align-items:center;
|
|
62
|
-
gap:14px;
|
|
63
|
-
flex:1;
|
|
64
|
-
min-width:0;
|
|
65
|
-
position:relative;
|
|
66
|
-
z-index:1;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.vsdk-ico{
|
|
70
|
-
width:46px;
|
|
71
|
-
height:46px;
|
|
72
|
-
flex:0 0 46px;
|
|
73
|
-
border-radius:12px;
|
|
74
|
-
background:linear-gradient(180deg,#EDF5FF,#DCEBFF);
|
|
75
|
-
display:flex;
|
|
76
|
-
align-items:center;
|
|
77
|
-
justify-content:center;
|
|
78
|
-
font-size:22px;
|
|
79
|
-
box-shadow:
|
|
80
|
-
inset 0 1px 0 rgba(255,255,255,.8),
|
|
81
|
-
0 6px 18px rgba(0,110,255,.12);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.vsdk-text{
|
|
85
|
-
min-width:0;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.vsdk-title{
|
|
89
|
-
display:flex;
|
|
90
|
-
align-items:center;
|
|
91
|
-
gap:8px;
|
|
92
|
-
flex-wrap:wrap;
|
|
93
|
-
font-size:18px;
|
|
94
|
-
font-weight:600;
|
|
95
|
-
color:#1F2329;
|
|
96
|
-
line-height:1.4;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.vsdk-badge{
|
|
100
|
-
padding:2px 8px;
|
|
101
|
-
border-radius:999px;
|
|
102
|
-
background:#EAF3FF;
|
|
103
|
-
color:#006EFF;
|
|
104
|
-
font-size:11px;
|
|
105
|
-
font-weight:600;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.vsdk-desc{
|
|
109
|
-
margin-top:6px;
|
|
110
|
-
font-size:13px;
|
|
111
|
-
line-height:1.7;
|
|
112
|
-
color:#4E5969;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.vsdk-card-right{
|
|
116
|
-
flex-shrink:0;
|
|
117
|
-
position:relative;
|
|
118
|
-
z-index:1;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.vsdk-cta{
|
|
122
|
-
display:inline-flex;
|
|
123
|
-
align-items:center;
|
|
124
|
-
justify-content:center;
|
|
125
|
-
min-width:112px;
|
|
126
|
-
height:40px;
|
|
127
|
-
padding:0 22px;
|
|
128
|
-
border-radius:8px;
|
|
129
|
-
background:#006EFF;
|
|
130
|
-
color:#FFFFFF;
|
|
131
|
-
text-decoration:none;
|
|
132
|
-
font-size:14px;
|
|
133
|
-
font-weight:600;
|
|
134
|
-
box-shadow:0 8px 20px rgba(0,110,255,.25);
|
|
135
|
-
transition:all .2s ease;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.vsdk-cta:hover{
|
|
139
|
-
background:#0052D9;
|
|
140
|
-
box-shadow:0 10px 24px rgba(0,110,255,.35);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
@media (max-width:768px){
|
|
144
|
-
|
|
145
|
-
.vsdk-survey-card{
|
|
146
|
-
flex-direction:column;
|
|
147
|
-
align-items:flex-start;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.vsdk-card-left{
|
|
151
|
-
width:100%;
|
|
152
|
-
align-items:flex-start;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.vsdk-title{
|
|
156
|
-
font-size:16px;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.vsdk-desc{
|
|
160
|
-
font-size:12px;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.vsdk-card-right{
|
|
164
|
-
width:100%;
|
|
165
|
-
margin-top:14px;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.vsdk-cta{
|
|
169
|
-
width:100%;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
</style>
|
|
174
|
-
|
|
175
|
-
<div class="vsdk-survey-card">
|
|
176
|
-
|
|
177
|
-
<div class="vsdk-card-left">
|
|
178
|
-
|
|
179
|
-
<div class="vsdk-ico">💡</div>
|
|
180
|
-
|
|
181
|
-
<div class="vsdk-text">
|
|
182
|
-
|
|
183
|
-
<div class="vsdk-title">
|
|
184
|
-
有接入卡点?30 秒反馈
|
|
185
|
-
<span class="vsdk-badge">全部选填</span>
|
|
186
|
-
</div>
|
|
187
|
-
|
|
188
|
-
<div class="vsdk-desc">
|
|
189
|
-
正在了解或评估视频会议 SDK?UI、功能、文档或套餐开通如有卡点,欢迎填写反馈。
|
|
190
|
-
</div>
|
|
191
|
-
|
|
192
|
-
</div>
|
|
193
|
-
|
|
194
|
-
</div>
|
|
195
|
-
|
|
196
|
-
<div class="vsdk-card-right">
|
|
197
|
-
<a class="vsdk-cta" href="https://wj.qq.com/s2/27395009/ac34/" target="_blank">
|
|
198
|
-
填写反馈
|
|
199
|
-
</a>
|
|
200
|
-
</div>
|
|
201
|
-
|
|
202
|
-
</div>
|
|
203
|
-
|
|
204
3
|
## 前提条件
|
|
205
4
|
|
|
206
5
|
### 开通服务
|
|
@@ -208,536 +7,224 @@
|
|
|
208
7
|
请参考 [开通服务](https://cloud.tencent.com/document/product/647/104842) 领取 TUIRoomKit 体验版或开通 TUIRoomKit 正式版,并在 [应用管理](https://console.cloud.tencent.com/trtc) 页面获取以下信息:
|
|
209
8
|
- **SDKAppID:**应用标识,腾讯云基于 `SDKAppID` 完成计费统计。
|
|
210
9
|
|
|
211
|
-
- **SDKSecretKey
|
|
10
|
+
- **SDKSecretKey:**应用密钥,仅用于本地调试时生成 UserSig,不可写入生产代码。
|
|
11
|
+
|
|
12
|
+
- **UserSig:**登录凭证。须由业务服务端签发并下发,切勿在客户端硬编码 SDKSecretKey。本地调试可用 `genTestUserSig` 生成临时签名,不可用于生产,详见 [正式运行阶段如何计算 UserSig](https://cloud.tencent.com/document/product/647/17275#formal)。
|
|
212
13
|
|
|
213
14
|
### 环境准备
|
|
214
|
-
- **Node.js
|
|
15
|
+
- **Node.js:**≥ 18.19.1 (推荐使用官方 LTS 版本)。
|
|
215
16
|
|
|
216
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) 的浏览器。
|
|
217
18
|
|
|
218
19
|
- **媒体设备:**建议配备摄像头、麦克风和扬声器。缺少相应设备时仍可入会,但对应音视频能力不可用。
|
|
219
20
|
|
|
220
|
-
###
|
|
221
|
-
|
|
222
|
-
若您尚未创建 Vue 3 项目,可先执行以下命令初始化;若已有 Vue 3 项目,可跳过本节。
|
|
223
|
-
``` bash
|
|
224
|
-
# 创建名为 roomkit-demo 的 Vue3 + TypeScript 项目
|
|
225
|
-
npm create vite@5 roomkit-demo -- --template vue-ts
|
|
226
|
-
# 进入项目目录
|
|
227
|
-
cd roomkit-demo
|
|
228
|
-
# 安装基础依赖
|
|
229
|
-
npm install
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
## 快速接入
|
|
233
|
-
|
|
234
|
-
完成前提条件后,按以下步骤在 Vue 3 项目中快速完成 TUIRoomKit 接入,并体验会中能力。
|
|
235
|
-
|
|
236
|
-
### 步骤1:安装 SDK 依赖
|
|
237
|
-
|
|
238
|
-
在您的业务项目中安装以下依赖。
|
|
21
|
+
### 安装依赖
|
|
239
22
|
|
|
240
23
|
【npm】
|
|
241
24
|
``` bash
|
|
25
|
+
# 在已有 Vue 3 项目根目录执行;若需新建项目,可先运行 npm create vite@5 roomkit-demo -- --template vue-ts
|
|
242
26
|
npm install @tencentcloud/roomkit-web-vue3 tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/universal-api
|
|
243
27
|
```
|
|
244
28
|
|
|
245
29
|
【pnpm】
|
|
246
30
|
``` bash
|
|
31
|
+
# 在已有 Vue 3 项目根目录执行;若需新建项目,可先运行 pnpm create vite@5 roomkit-demo --template vue-ts
|
|
247
32
|
pnpm install @tencentcloud/roomkit-web-vue3 tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/universal-api
|
|
248
33
|
```
|
|
249
34
|
|
|
250
35
|
【yarn】
|
|
251
36
|
``` bash
|
|
37
|
+
# 在已有 Vue 3 项目根目录执行;若需新建项目,可先运行 yarn create vite@5 roomkit-demo --template vue-ts
|
|
252
38
|
yarn add @tencentcloud/roomkit-web-vue3 tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/universal-api
|
|
253
39
|
```
|
|
254
40
|
|
|
255
|
-
|
|
41
|
+
## 快速接入
|
|
256
42
|
|
|
257
|
-
|
|
43
|
+
### 发起会议
|
|
258
44
|
|
|
259
|
-
|
|
260
|
-
>
|
|
261
|
-
> 快速接入示例采用客户端生成 UserSig 的方式,**仅可用于本地开发调试**。正式环境请改为由业务服务端生成 UserSig,详见 [正式运行阶段如何计算 UserSig](https://cloud.tencent.com/document/product/647/17275#formal)。
|
|
262
|
-
>
|
|
45
|
+
**适用场景:**用户在客户端点击“快速会议”,需要立即创建房间并加入(如临时沟通、IM 聊天内发起会议)。
|
|
263
46
|
|
|
47
|
+
**实现方式:**由客户端生成或向业务后台申请一个唯一的房间号,随后由发起人调用 `createAndJoin` 创建并直接进入该房间。
|
|
264
48
|
``` typescript
|
|
265
|
-
<
|
|
266
|
-
|
|
267
|
-
<ConferenceMainView v-if="inRoom && isPC" />
|
|
268
|
-
<ConferenceMainViewH5 v-else-if="inRoom" />
|
|
269
|
-
<div v-else class="entry">
|
|
270
|
-
<TUIInput v-model="entry.userId" placeholder="请输入用户 ID" />
|
|
271
|
-
<TUIInput v-model="entry.userName" placeholder="请输入昵称, 非必填" />
|
|
272
|
-
<TUIInput v-model="entry.roomId" placeholder="请输入房间 ID, 如 room_123456" />
|
|
273
|
-
<TUIButton type="primary" :disabled="!entry.userId || !entry.roomId" @click="handleEnterRoom">进入会议</TUIButton>
|
|
274
|
-
</div>
|
|
275
|
-
</UIKitProvider>
|
|
276
|
-
</template>
|
|
277
|
-
|
|
278
|
-
<script setup lang="ts">
|
|
279
|
-
import { ref, onMounted, onUnmounted } from 'vue';
|
|
280
|
-
import { UIKitProvider, TUIInput, TUIButton, TUIToast } from '@tencentcloud/uikit-base-component-vue3';
|
|
281
|
-
import { conference, ConferenceMainView, ConferenceMainViewH5, RoomEvent, genTestUserSig } from '@tencentcloud/roomkit-web-vue3';
|
|
282
|
-
import { getPlatform } from '@tencentcloud/universal-api';
|
|
283
|
-
|
|
284
|
-
const SDKAppID = 0; // 替换为您在开通服务阶段获取的 SDKAppID
|
|
285
|
-
const SDKSecretKey = ''; // 替换为您在开通服务阶段获取的 SDKSecretKey
|
|
286
|
-
|
|
287
|
-
const isPC = getPlatform() === 'pc';
|
|
288
|
-
const inRoom = ref(false);
|
|
289
|
-
const stored = JSON.parse(sessionStorage.getItem('tuiRoom-entry') || '{}');
|
|
290
|
-
const entry = ref({ userId: stored.userId || '', userName: stored.userName || '', roomId: stored.roomId || '' });
|
|
291
|
-
|
|
292
|
-
const handleEnterRoom = async () => {
|
|
293
|
-
sessionStorage.setItem('tuiRoom-entry', JSON.stringify(entry.value));
|
|
294
|
-
if (!SDKAppID || !SDKSecretKey) {
|
|
295
|
-
TUIToast.warning({ message: '请先在代码中配置 SDKAppID 和 SDKSecretKey' });
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
try {
|
|
299
|
-
const { userSig } = genTestUserSig({ userId: entry.value.userId, sdkAppId: SDKAppID, secretKey: SDKSecretKey });
|
|
300
|
-
await conference.login({ sdkAppId: SDKAppID, userId: entry.value.userId, userSig });
|
|
301
|
-
await conference.setSelfInfo({ userName: entry.value.userName, avatarUrl: '' });
|
|
302
|
-
await conference.createAndJoinRoom({ roomId: entry.value.roomId, options: { roomName: `${entry.value.userName || entry.value.userId} 的会议` } });
|
|
303
|
-
inRoom.value = true;
|
|
304
|
-
} catch (error) {
|
|
305
|
-
console.error('进入会议失败:', error);
|
|
306
|
-
}
|
|
307
|
-
};
|
|
49
|
+
<script setup>
|
|
50
|
+
import { RoomKit } from '@tencentcloud/roomkit-web-vue3';
|
|
308
51
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
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
|
+
});
|
|
315
59
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
});
|
|
60
|
+
const myRoomId = `room_${Date.now()}`; // 由业务生成,需保证全局唯一
|
|
61
|
+
await room.createAndJoin({ container: '#meeting', roomId: myRoomId });
|
|
62
|
+
};
|
|
320
63
|
</script>
|
|
321
64
|
|
|
322
|
-
<
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
### 步骤3:启动并验证
|
|
329
|
-
|
|
330
|
-
【npm】
|
|
331
|
-
``` bash
|
|
332
|
-
npm run dev
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
【pnpm】
|
|
336
|
-
``` bash
|
|
337
|
-
pnpm run dev
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
【yarn】
|
|
341
|
-
``` bash
|
|
342
|
-
yarn run dev
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
启动成功后,在浏览器访问本地调试地址(通常为 `http://localhost:5173`),填写用户 ID 与房间号,点击 **进入会议**,即可进入 TUIRoomKit 会中界面。
|
|
346
|
-
|
|
347
|
-
**验证多人会议:**建议打开两个浏览器标签页,分别模拟不同用户进入同一房间,验证音视频互通与会中功能。操作步骤如下:
|
|
348
|
-
|
|
349
|
-
**步骤1:**打开两个浏览器标签页,分别填写用户 ID `userA`、`userB` 及相同房间号 `room_123456`,点击 **进入会议**。`userA` 先进入时将自动创建房间并成为房主;`userB` 后进入时将作为参会者加入。
|
|
350
|
-
|
|
351
|
-
**步骤2:**测试用户均进入会中界面后,可在成员列表中互相看到对方;开启摄像头、麦克风,确认能否看到彼此的画面并听到声音。
|
|
352
|
-
|
|
353
|
-
**步骤3:**您还可以体验屏幕共享、聊天、成员管理等会中能力,确认多人场景下的基础功能正常。
|
|
354
|
-
|
|
355
|
-
## 接入详解
|
|
356
|
-
|
|
357
|
-
快速接入章节以一体化示例帮助您完成首次进房体验。若需将会议能力集成至实际业务,可按会议流程分步集成。本节依次介绍 SDK 依赖安装、TUIRoomKit 组件引用、登录鉴权、创建与加入会议、离开会议、监听会议状态等核心能力的用法。
|
|
358
|
-
|
|
359
|
-
### 步骤1:安装 SDK 依赖
|
|
360
|
-
|
|
361
|
-
在您的业务项目中安装 TUIRoomKit 及配套依赖包。
|
|
362
|
-
|
|
363
|
-
【npm】
|
|
364
|
-
``` bash
|
|
365
|
-
npm install @tencentcloud/roomkit-web-vue3 tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/universal-api
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
【pnpm】
|
|
369
|
-
``` bash
|
|
370
|
-
pnpm install @tencentcloud/roomkit-web-vue3 tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/universal-api
|
|
371
|
-
```
|
|
372
|
-
|
|
373
|
-
【yarn】
|
|
374
|
-
``` bash
|
|
375
|
-
yarn add @tencentcloud/roomkit-web-vue3 tuikit-atomicx-vue3 @tencentcloud/uikit-base-component-vue3 @tencentcloud/universal-api
|
|
65
|
+
<template>
|
|
66
|
+
<button @click="startQuickMeeting">发起会议</button>
|
|
67
|
+
<!-- 会议界面的挂载节点,需在进会前完成渲染,并指定明确宽高 -->
|
|
68
|
+
<div id="meeting" style="width: 1080px; height: 640px"></div>
|
|
69
|
+
</template>
|
|
376
70
|
```
|
|
377
71
|
|
|
378
|
-
###
|
|
379
|
-
|
|
380
|
-
TUIRoomKit 提供 Web 桌面端与 H5 移动端两套会中完整界面组件,均从 `@tencentcloud/roomkit-web-vue3` 导出。根据终端类型按需引用:
|
|
381
|
-
- `ConferenceMainView`:面向 Web 桌面端,提供九宫格 / 侧边栏 / 顶部栏等视频布局,内置摄像头、麦克风、屏幕共享、成员管理、聊天、邀请入会等完整会中能力。
|
|
72
|
+
### 预定会议
|
|
382
73
|
|
|
383
|
-
|
|
74
|
+
#### **场景一:客户端预订**
|
|
384
75
|
|
|
385
|
-
|
|
76
|
+
**适用场景:**适用于需要在未来特定时间召开的会议(如团队周会、线上培训等)。用户可在客户端提前设定会议标题、时间及受邀参会成员。
|
|
386
77
|
|
|
387
|
-
|
|
388
|
-
<template>
|
|
389
|
-
<UIKitProvider theme="light" language="zh-CN">
|
|
390
|
-
<ConferenceMainView v-if="isPC"></ConferenceMainView>
|
|
391
|
-
<ConferenceMainViewH5 v-else></ConferenceMainViewH5>
|
|
392
|
-
</UIKitProvider>
|
|
393
|
-
</template>
|
|
78
|
+
**实现方式:**由客户端生成或向业务后台申请一个唯一的房间号,并配合会议时间等参数调用 scheduleRoom 接口提交预定。预定成功后,会议信息将同步至参与者的会议列表中。更多客户端预订会议能力请参考 [无 UI 集成 > 预订房间](https://cloud.tencent.com/document/product/647/126931)。
|
|
394
79
|
|
|
395
|
-
|
|
396
|
-
import { ref } from 'vue';
|
|
397
|
-
import { UIKitProvider } from '@tencentcloud/uikit-base-component-vue3';
|
|
398
|
-
import { ConferenceMainView, ConferenceMainViewH5 } from '@tencentcloud/roomkit-web-vue3';
|
|
399
|
-
import { getPlatform } from '@tencentcloud/universal-api';
|
|
80
|
+
#### **场景二:服务端预订**
|
|
400
81
|
|
|
401
|
-
|
|
402
|
-
</script>
|
|
403
|
-
```
|
|
82
|
+
**适用场景:**会议排期完全由业务系统统一管理,不由客户端发起(如政务、医疗、大型企业 OA 等强管控场景)。
|
|
404
83
|
|
|
405
|
-
|
|
84
|
+
**实现方式:**由业务服务端调用 [服务端 REST API 创建房间](https://cloud.tencent.com/document/product/647/104446),在 invitees 中指定受邀成员后,这些成员在客户端同样能拉取到该会议。
|
|
406
85
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
> **注意**:
|
|
410
|
-
>
|
|
411
|
-
> UserSig 是 TUIRoomKit 登录的核心凭证。**生产环境**必须由业务服务端生成 UserSig,客户端在需要时向业务服务器请求获取,切勿在客户端硬编码 SDKSecretKey。**本地开发调试**时,可使用 `@tencentcloud/roomkit-web-vue3` 提供的 `genTestUserSig` 生成临时 UserSig,仅用于本地验证,不可用于生产环境。详见 [正式运行阶段如何计算 UserSig](https://cloud.tencent.com/document/product/647/17275#formal)。
|
|
412
|
-
>
|
|
86
|
+
### 加入会议
|
|
413
87
|
|
|
88
|
+
房间已经存在时调用 `join` 接口,参数中传入 `roomId`。
|
|
414
89
|
``` typescript
|
|
415
|
-
|
|
416
|
-
import {
|
|
417
|
-
|
|
418
|
-
const SDKAppID = 0; // 控制台获取的 SDKAppID
|
|
419
|
-
const userId = 'your_user_id'; // 业务侧用户唯一标识
|
|
420
|
-
const userSig = 'your_user_sig'; // 由业务服务端签发并下发
|
|
421
|
-
const userName = 'your_user_name';
|
|
422
|
-
|
|
423
|
-
onMounted(async () => {
|
|
424
|
-
try {
|
|
425
|
-
await conference.login({ sdkAppId: SDKAppID, userId, userSig });
|
|
426
|
-
await conference.setSelfInfo({
|
|
427
|
-
userName,
|
|
428
|
-
avatarUrl: 'https://your-avatar-url.com/image.png',
|
|
429
|
-
});
|
|
430
|
-
} catch (error) {
|
|
431
|
-
console.error('TUIRoomKit 登录失败:', error);
|
|
432
|
-
}
|
|
433
|
-
});
|
|
434
|
-
```
|
|
90
|
+
<script setup>
|
|
91
|
+
import { RoomKit } from '@tencentcloud/roomkit-web-vue3';
|
|
435
92
|
|
|
436
|
-
|
|
93
|
+
const room = RoomKit.getShareInstance({
|
|
94
|
+
sdkAppId: 0, // 控制台获取的 SDKAppID
|
|
95
|
+
userId: 'your_user_id', // 业务侧用户唯一标识
|
|
96
|
+
userSig: 'your_user_sig', // 由业务服务端签发并下发,切勿在客户端硬编码 SDKSecretKey
|
|
97
|
+
});
|
|
437
98
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
import { conference } from '@tencentcloud/roomkit-web-vue3';
|
|
99
|
+
const joinMeeting = async (sharedRoomId) => {
|
|
100
|
+
await room.join({ container: '#meeting', roomId: sharedRoomId });
|
|
101
|
+
};
|
|
102
|
+
</script>
|
|
443
103
|
|
|
444
|
-
|
|
104
|
+
<template>
|
|
105
|
+
<div id="meeting" style="width: 1080px; height: 640px"></div>
|
|
106
|
+
</template>
|
|
445
107
|
|
|
446
|
-
watch(() => loginUserInfo.value?.userId, async (userId) => {
|
|
447
|
-
if (userId) {
|
|
448
|
-
await conference.createAndJoinRoom({ roomId: '123456' });
|
|
449
|
-
}
|
|
450
|
-
}, { immediate: true });
|
|
451
108
|
```
|
|
452
109
|
|
|
453
|
-
###
|
|
110
|
+
### 离开会议
|
|
454
111
|
|
|
455
|
-
|
|
112
|
+
TUIRoomKit 已在界面上内置离开与解散房间功能,用户可直接点击 **离开房间** 或 **解散房间** 完成操作。
|
|
456
113
|
|
|
457
|
-
|
|
114
|
+
如需在业务代码中主动触发离开或解散,可调用以下接口,接口执行完成即代表退出成功,**不会触发** `exited` **事件**。
|
|
458
115
|
|
|
459
|
-
|
|
116
|
+
**场景一:主动离开房间**
|
|
460
117
|
|
|
461
|
-
|
|
118
|
+
参与者和房主均可调用 `leave()` 离开会议,调用后不影响其他成员,房间继续存在。
|
|
462
119
|
``` typescript
|
|
463
|
-
|
|
120
|
+
const room = RoomKit.getShareInstance({
|
|
121
|
+
sdkAppId: 0, // 控制台获取的 SDKAppID
|
|
122
|
+
userId: 'your_user_id', // 业务侧用户唯一标识
|
|
123
|
+
userSig: 'your_user_sig', // 由业务服务端签发并下发,切勿在客户端硬编码 SDKSecretKey
|
|
124
|
+
});
|
|
464
125
|
|
|
465
|
-
|
|
466
|
-
// 1. 客户端生成一个唯一的 roomId
|
|
467
|
-
const myRoomId = `room_${Date.now()}`;
|
|
468
|
-
|
|
469
|
-
// 2. 建房并直接加入
|
|
470
|
-
await conference.createAndJoinRoom({
|
|
471
|
-
roomId: myRoomId,
|
|
472
|
-
options: {
|
|
473
|
-
roomName: '我的快速会议',
|
|
474
|
-
},
|
|
475
|
-
});
|
|
476
|
-
};
|
|
126
|
+
await room.leave();
|
|
477
127
|
```
|
|
478
128
|
|
|
479
|
-
|
|
129
|
+
> **说明:**
|
|
130
|
+
> 房主离开房间或关闭网页,不会自动解散房间,其他参会成员可继续正常使用 TUIRoomKit 能力,系统会在会议结束时间后 6 小时、且房间内人数为 0 时自动回收房间资源
|
|
131
|
+
>
|
|
480
132
|
|
|
481
|
-
|
|
133
|
+
**场景二:主动解散房间**
|
|
482
134
|
|
|
483
|
-
|
|
135
|
+
房主调用 `end()` 后,房间内所有成员均会收到房间已解散的通知。传入 `roomId` 可解散指定房间,调用者无需身处该房间,适用于在会议列表中直接解散某一场会议。
|
|
484
136
|
``` typescript
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
try {
|
|
491
|
-
// roomId 限制:字符串类型,必传参数,建议由业务后台生成保证 roomId 唯一性。
|
|
492
|
-
const roomId = '123456';
|
|
493
|
-
|
|
494
|
-
// 注意:时间戳单位必须为 **秒** (Date.getTime() 获取的是毫秒,需除以 1000)
|
|
495
|
-
const startTime = Math.floor(new Date().getTime() / 1000) + 3600; // 1小时后开始
|
|
496
|
-
const duration = 1800; // 30分钟
|
|
497
|
-
|
|
498
|
-
const options = {
|
|
499
|
-
roomName: '产品需求评审会',
|
|
500
|
-
scheduleStartTime: startTime, // 单位:秒
|
|
501
|
-
scheduleEndTime: startTime + duration, // 单位:秒
|
|
502
|
-
scheduleAttendees: ['userA', 'userB'], // 邀请参会成员ID列表
|
|
503
|
-
password: '123', // 可选:设置入会密码
|
|
504
|
-
};
|
|
505
|
-
|
|
506
|
-
await scheduleRoom({ roomId, options });
|
|
507
|
-
} catch (error) {
|
|
508
|
-
console.error('预定失败', error);
|
|
509
|
-
}
|
|
510
|
-
};
|
|
511
|
-
```
|
|
512
|
-
|
|
513
|
-
#### 场景三:服务端创建会议
|
|
514
|
-
|
|
515
|
-
**适用场景:**政务、医疗、大型企业 OA 等强管控场景。
|
|
137
|
+
const room = RoomKit.getShareInstance({
|
|
138
|
+
sdkAppId: 0, // 控制台获取的 SDKAppID
|
|
139
|
+
userId: 'your_user_id', // 业务侧用户唯一标识
|
|
140
|
+
userSig: 'your_user_sig', // 由业务服务端签发并下发,切勿在客户端硬编码 SDKSecretKey
|
|
141
|
+
});
|
|
516
142
|
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
POST /v4/room_engine_http_srv/create_room
|
|
520
|
-
{
|
|
521
|
-
"roomId": "your-room-id",
|
|
522
|
-
"roomName": "会议名称",
|
|
523
|
-
"startTime": 1710000000,
|
|
524
|
-
"endTime": 1710003600,
|
|
525
|
-
"invitees": ["userId1", "userId2"]
|
|
526
|
-
}
|
|
143
|
+
// 解散当前所在的会议
|
|
144
|
+
await room.end();
|
|
527
145
|
```
|
|
528
146
|
|
|
529
|
-
###
|
|
530
|
-
|
|
531
|
-
参会成员加入房间时,请根据业务情况选择适合的加入房间的方式。
|
|
147
|
+
### 事件监听
|
|
532
148
|
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
**适用场景:**房间已经被发起人或服务端明确创建,参会人收到了发起人分享的房间号或者会议邀请链接。
|
|
536
|
-
|
|
537
|
-
**实现方式:**参会人输入房间号,或通过邀请链接解析出 `roomId` 后,调用 `conference.joinRoom` 加入会议。
|
|
149
|
+
房间可能因用户离开、被解散、被踢或登录态失效而结束。TUIRoomKit 会处理底层音视频资源与界面提示,**页面怎么走由业务接管**。通过 `on('exited')` 监听退出,在回调中恢复业务页面,该方法返回一个取消监听的函数。
|
|
538
150
|
``` typescript
|
|
539
|
-
import {
|
|
540
|
-
|
|
541
|
-
const joinExistingMeeting = async (sharedRoomId: string) => {
|
|
542
|
-
await conference.joinRoom({
|
|
543
|
-
roomId: sharedRoomId,
|
|
544
|
-
});
|
|
545
|
-
};
|
|
546
|
-
```
|
|
547
|
-
|
|
548
|
-
#### 场景二:从房间列表加入会议
|
|
549
|
-
|
|
550
|
-
**适用场景:**适用于已通过“客户端预约”或“服务端创建”的会议。用户可进入“会议列表”页面,查看自己预定或受邀参与的会议,并快速点击加入。
|
|
151
|
+
import { onUnmounted } from 'vue';
|
|
152
|
+
import { RoomKit, ExitReason } from '@tencentcloud/roomkit-web-vue3';
|
|
551
153
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
<ul v-if="roomList.length > 0">
|
|
558
|
-
<li v-for="room in roomList" :key="room.roomId" class="item">
|
|
559
|
-
<div class="info">
|
|
560
|
-
<b>{{ room.roomName || '未命名会议' }}</b>
|
|
561
|
-
<span>房间号: {{ room.roomId }}</span>
|
|
562
|
-
</div>
|
|
563
|
-
<button class="btn" @click="handleJoinRoom(room.roomId)">加入会议</button>
|
|
564
|
-
</li>
|
|
565
|
-
</ul>
|
|
566
|
-
<div v-else>暂无待参加的预约会议</div>
|
|
567
|
-
</div>
|
|
568
|
-
</template>
|
|
154
|
+
const room = RoomKit.getShareInstance({
|
|
155
|
+
sdkAppId: 0, // 控制台获取的 SDKAppID
|
|
156
|
+
userId: 'your_user_id',
|
|
157
|
+
userSig: 'your_user_sig', // 由业务服务端签发
|
|
158
|
+
});
|
|
569
159
|
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
// 1. 监听登录状态,确保鉴权就绪后再拉取会议列表
|
|
580
|
-
watch(
|
|
581
|
-
() => loginUserInfo.value?.userId,
|
|
582
|
-
async (userId) => {
|
|
583
|
-
if (userId) {
|
|
584
|
-
try {
|
|
585
|
-
roomList.value = await getScheduledRoomList() || [];
|
|
586
|
-
} catch (error) {
|
|
587
|
-
console.error('获取预约会议列表失败:', error);
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
},
|
|
591
|
-
{ immediate: true }
|
|
592
|
-
);
|
|
593
|
-
|
|
594
|
-
// 2. 点击加入房间
|
|
595
|
-
const handleJoinRoom = async (roomId: string) => {
|
|
596
|
-
try {
|
|
597
|
-
await conference.joinRoom({ roomId });
|
|
598
|
-
} catch (error) {
|
|
599
|
-
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;
|
|
600
169
|
}
|
|
601
|
-
};
|
|
602
|
-
</script>
|
|
170
|
+
});
|
|
603
171
|
|
|
604
|
-
|
|
605
|
-
/* 极简基础样式 */
|
|
606
|
-
ul { padding: 0; list-style: none; }
|
|
607
|
-
.item { display: flex; justify-content: space-between; padding: 10px; border-bottom: 1px solid #eee; }
|
|
608
|
-
.info { display: flex; flex-direction: column; font-size: 14px; color: #666; }
|
|
609
|
-
.info b { font-size: 16px; color: #333; }
|
|
610
|
-
.btn { background: #006eff; color: #fff; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; }
|
|
611
|
-
</style>
|
|
172
|
+
onUnmounted(() => offExited()); // 组件销毁时取消监听
|
|
612
173
|
```
|
|
613
174
|
|
|
614
|
-
|
|
175
|
+
`reason` 的取值及触发时机如下。
|
|
615
176
|
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
await conference.createAndJoinRoom({
|
|
625
|
-
roomId: bizOrderId,
|
|
626
|
-
options: {
|
|
627
|
-
roomName: `业务沟通:${bizOrderId}`,
|
|
628
|
-
},
|
|
629
|
-
});
|
|
630
|
-
};
|
|
631
|
-
```
|
|
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 已过期|
|
|
632
185
|
|
|
633
186
|
> **说明:**
|
|
634
|
-
> `
|
|
187
|
+
> `KickedOffline` 与 `UserSigExpired` 属于登录态失效,即使用户当前不在会议中也会触发,此时 `roomId` 为空字符串。
|
|
635
188
|
>
|
|
636
189
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
TUIRoomKit 已在界面上内置离开与解散房间功能,用户可直接点击 **离开房间** 或 **解散房间** 完成操作。
|
|
640
|
-
|
|
641
|
-
如需在业务代码中主动触发离开或解散,可调用以下接口。
|
|
642
|
-
|
|
643
|
-
#### 场景一:主动离开房间
|
|
190
|
+
## 界面定制
|
|
644
191
|
|
|
645
|
-
|
|
646
|
-
``` typescript
|
|
647
|
-
import { conference } from '@tencentcloud/roomkit-web-vue3';
|
|
648
|
-
|
|
649
|
-
await conference.leaveRoom();
|
|
650
|
-
```
|
|
192
|
+
在完成基础集成后,您可以根据业务需求进一步定制会议界面。以下配置均通过会议实例调用,建议在进会前调用,避免界面加载后再变化。
|
|
651
193
|
|
|
652
|
-
|
|
653
|
-
>
|
|
654
|
-
> 房主离开房间或关闭网页,不会自动解散房间,其他参会成员可继续正常使用 TUIRoomKit 能力,系统会在会议结束时间后 6 小时、且房间内人数为 0 时自动回收房间资源。
|
|
655
|
-
>
|
|
656
|
-
|
|
657
|
-
#### 场景二:主动解散房间
|
|
658
|
-
|
|
659
|
-
房主调用 `endRoom()` 后,房间内所有成员均会收到房间已解散的通知。
|
|
660
|
-
``` typescript
|
|
661
|
-
import { conference } from '@tencentcloud/roomkit-web-vue3';
|
|
662
|
-
|
|
663
|
-
await conference.endRoom();
|
|
664
|
-
```
|
|
665
|
-
|
|
666
|
-
> **注意**:
|
|
667
|
-
>
|
|
668
|
-
> `endRoom()` 必须由房主在成功进入房间后才能调用。非房主身份或在尚未进入房间的状态下调用会报错。
|
|
669
|
-
>
|
|
194
|
+
### 配置主题及语言
|
|
670
195
|
|
|
671
|
-
|
|
196
|
+
会议界面默认使用浅色主题,界面语言跟随浏览器语言。用户可在会中通过内置的主题、语言按钮自行切换;如需隐藏这两个按钮。更多自定义主题及语言。
|
|
672
197
|
|
|
673
|
-
|
|
198
|
+
### 调整工具栏按钮
|
|
674
199
|
|
|
675
|
-
|
|
200
|
+
会议界面的工具栏按钮默认全部展示。如需隐藏某些能力(如后台系统不需要主题切换、教育场景不开放屏幕共享),可调用 `setWidgetVisible`:
|
|
676
201
|
``` typescript
|
|
677
|
-
|
|
678
|
-
<ConferenceMainView></ConferenceMainView>
|
|
679
|
-
</template>
|
|
680
|
-
|
|
681
|
-
<script setup lang="ts">
|
|
682
|
-
import { ref, onMounted, onUnmounted } from 'vue';
|
|
683
|
-
import { ConferenceMainView, conference, RoomEvent } from '@tencentcloud/roomkit-web-vue3';
|
|
202
|
+
import { RoomKit, BuiltinWidget } from '@tencentcloud/roomkit-web-vue3';
|
|
684
203
|
|
|
685
|
-
const
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
conference.on(RoomEvent.ROOM_DISMISS, backToHome);
|
|
690
|
-
conference.on(RoomEvent.ROOM_LEAVE, backToHome);
|
|
691
|
-
conference.on(RoomEvent.ROOM_ERROR, backToHome);
|
|
692
|
-
conference.on(RoomEvent.KICKED_OUT, backToHome);
|
|
693
|
-
conference.on(RoomEvent.KICKED_OFFLINE, backToLogin);
|
|
694
|
-
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', // 由业务服务端签发
|
|
695
208
|
});
|
|
696
209
|
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
conference.off(RoomEvent.ROOM_ERROR, backToHome);
|
|
701
|
-
conference.off(RoomEvent.KICKED_OUT, backToHome);
|
|
702
|
-
conference.off(RoomEvent.KICKED_OFFLINE, backToLogin);
|
|
703
|
-
conference.off(RoomEvent.USER_SIG_EXPIRED, backToLogin);
|
|
210
|
+
room.setWidgetVisible({
|
|
211
|
+
[BuiltinWidget.ScreenShareWidget]: false, // 隐藏屏幕共享
|
|
212
|
+
[BuiltinWidget.ThemeWidget]: false, // 隐藏主题切换
|
|
704
213
|
});
|
|
705
|
-
</script>
|
|
706
214
|
```
|
|
707
215
|
|
|
708
|
-
|
|
709
|
-
|---------|---------|---------|
|
|
710
|
-
|`RoomEvent.ROOM_DISMISS`|房间被解散,对所有成员触发|返回首页或会议列表|
|
|
711
|
-
|`RoomEvent.ROOM_LEAVE`|用户点击 TUIRoomKit 界面上的「离开」按钮|返回首页或会议列表|
|
|
712
|
-
|`RoomEvent.ROOM_ERROR`|进房失败或房间内发生未处理的错误|返回首页或会议列表|
|
|
713
|
-
|`RoomEvent.KICKED_OUT`|被房主踢出房间|返回首页或会议列表|
|
|
714
|
-
|`RoomEvent.KICKED_OFFLINE`|同一账号在其他设备登录,当前设备被强制下线|跳转登录页|
|
|
715
|
-
|`RoomEvent.USER_SIG_EXPIRED`|UserSig 已过期|跳转登录页|
|
|
716
|
-
|
|
717
|
-
## 下一步
|
|
718
|
-
|
|
719
|
-
在完成基础集成后,您可以根据业务需求进一步定制 UI 界面。
|
|
720
|
-
|
|
721
|
-
### 配置主题及语言
|
|
722
|
-
|
|
723
|
-
通过配置 `App.vue` 中 `UIKitProvider` 的入参,修改主题及语言的默认值。更多自定义主题及语言。
|
|
724
|
-
| <code>UIKitProvider</code> 参数 | 可选值 | 默认值 |
|
|
725
|
-
| --- | --- | --- |
|
|
726
|
-
| theme | "light" \\| "dark" | "light" |
|
|
727
|
-
| language | "zh-CN" \\| "en-US" | "en-US" |
|
|
728
|
-
|
|
216
|
+
若需要在用户操作生效前插入业务校验(如开启摄像头前确认权限、共享屏幕前提示保密要求),可使用 `onWill` 拦截:
|
|
729
217
|
``` typescript
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
import { UIKitProvider } from '@tencentcloud/uikit-base-component-vue3';
|
|
737
|
-
import { ConferenceMainView, ConferenceMainViewH5 } from '@tencentcloud/roomkit-web-vue3';
|
|
738
|
-
</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
|
+
});
|
|
739
224
|
```
|
|
740
225
|
|
|
226
|
+
更多界面调整能力。
|
|
227
|
+
|
|
741
228
|
### 配置用户联系人列表
|
|
742
229
|
|
|
743
230
|
TUIRoomKit 内置的邀请参会和预定会议选人组件,底层默认依赖腾讯云 IM 的用户关系链(好友列表)。如果您希望在这些组件中展示您企业内部的组织架构或好友列表,请先通过服务端 REST API 将您的业务联系人同步至腾讯云 IM 系统中:
|
|
@@ -749,28 +236,41 @@ TUIRoomKit 内置的邀请参会和预定会议选人组件,底层默认依赖
|
|
|
749
236
|
|
|
750
237
|
TUIRoomKit 默认使用当前页面地址作为房间分享链接。
|
|
751
238
|
|
|
752
|
-
如您需要修改链接地址,可调用 `
|
|
239
|
+
如您需要修改链接地址,可调用 `setFeatureConfig` 更新分享链接。
|
|
753
240
|
``` typescript
|
|
754
|
-
import {
|
|
241
|
+
import { RoomKit } from '@tencentcloud/roomkit-web-vue3';
|
|
755
242
|
|
|
756
|
-
|
|
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 已知
|
|
757
250
|
const roomId = '123456';
|
|
758
|
-
|
|
251
|
+
room.setFeatureConfig({
|
|
759
252
|
shareLink: `https://your-domain.com/room?roomId=${roomId}`,
|
|
760
253
|
});
|
|
761
254
|
```
|
|
762
255
|
|
|
763
256
|
### 设置视频布局及挂件
|
|
764
257
|
|
|
765
|
-
TUIRoomKit 目前支持九宫格、侧边栏及顶部栏三种流布局,默认为九宫格布局,开发者可调用 `
|
|
258
|
+
TUIRoomKit 目前支持九宫格、侧边栏及顶部栏三种流布局,默认为九宫格布局,开发者可调用 `setFeatureConfig` 修改默认视频布局。
|
|
766
259
|
``` typescript
|
|
260
|
+
import { RoomKit } from '@tencentcloud/roomkit-web-vue3';
|
|
767
261
|
import { RoomLayoutTemplate } from 'tuikit-atomicx-vue3/room';
|
|
768
262
|
|
|
263
|
+
const room = RoomKit.getShareInstance({
|
|
264
|
+
sdkAppId: 0, // 控制台获取的 SDKAppID
|
|
265
|
+
userId: 'your_user_id',
|
|
266
|
+
userSig: 'your_user_sig', // 由业务服务端签发
|
|
267
|
+
});
|
|
268
|
+
|
|
769
269
|
// 方案一:修改默认视频流布局为侧边栏布局
|
|
770
|
-
|
|
270
|
+
room.setFeatureConfig({ layoutTemplate: RoomLayoutTemplate.SidebarLayout });
|
|
771
271
|
|
|
772
272
|
// 方案二:修改默认视频流布局为顶部栏布局
|
|
773
|
-
|
|
273
|
+
room.setFeatureConfig({ layoutTemplate: RoomLayoutTemplate.CinemaLayout });
|
|
774
274
|
```
|
|
775
275
|
|
|
776
276
|
TUIRoomKit 默认内置以下视频流挂件,如您需要自定义视频流挂件。
|
|
@@ -784,7 +284,7 @@ TUIRoomKit 默认内置以下视频流挂件,如您需要自定义视频流挂
|
|
|
784
284
|
为节省资源,建议在会议实际结束时,通过以下任一方式主动销毁房间:
|
|
785
285
|
- 界面操作:房主点击 TUIRoomKit 界面上的「解散房间」按钮;
|
|
786
286
|
|
|
787
|
-
- 客户端 API:调用 `
|
|
287
|
+
- 客户端 API:调用 `room.end()` 方法;
|
|
788
288
|
|
|
789
289
|
- 服务端 API:通过 REST API 进行远程销毁。
|
|
790
290
|
|
|
@@ -835,12 +335,12 @@ TUIRoomKit 已提供丰富的 UI 自定义能力,包括 主题及语言、界
|
|
|
835
335
|
```
|
|
836
336
|
2. 根据脚本提示确认是否要将 TUIRoomKit 源码拷贝到 `./src/components/RoomKit` 目录。如您需要自定义拷贝目录请输入 'y', 否则输入'n'。
|
|
837
337
|
|
|
838
|
-
3. 源码导出后,在您指定的项目路径中会新增 TUIRoomKit 源码。此时,您需要手动将
|
|
338
|
+
3. 源码导出后,在您指定的项目路径中会新增 TUIRoomKit 源码。此时,您需要手动将 `RoomKit` 的引用从 npm 包地址更改为 TUIRoomKit 源码的相对路径地址。
|
|
839
339
|
|
|
840
340
|
``` typescript
|
|
841
|
-
- import {
|
|
341
|
+
- import { RoomKit } from '@tencentcloud/roomkit-web-vue3';
|
|
842
342
|
// 替换引用路径为 TUIRoomKit 源码的真实路径
|
|
843
|
-
+ import {
|
|
343
|
+
+ import { RoomKit } from './components/RoomKit/index.ts';
|
|
844
344
|
```
|
|
845
345
|
4. 配置 ESLint 校验
|
|
846
346
|
|