@tencentcloud/sdk-mcp 0.1.0
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/README.md +20 -0
- package/index.js +16 -0
- package/index.js.map +1 -0
- package/package.json +37 -0
- package/resource/doc/tuicallkit/android/.gitkeep +0 -0
- package/resource/doc/tuicallkit/android/api_TUICallKit.md +663 -0
- package/resource/doc/tuicallkit/android/api_TUICallObserver.md +786 -0
- package/resource/doc/tuicallkit/android/how_to_integrated_android_callkit.md +302 -0
- package/resource/doc/tuicallkit/faq/faq.md +1068 -0
- package/resource/doc/tuicallkit/flutter/api_TUICallDefine.md +932 -0
- package/resource/doc/tuicallkit/flutter/api_TUICallKit.md +452 -0
- package/resource/doc/tuicallkit/flutter/api_TUICallObserver.md +926 -0
- package/resource/doc/tuicallkit/flutter/how_to_integrated_flutter_callkit.md +226 -0
- package/resource/doc/tuicallkit/flutter/how_to_run_flutter_callkit_demo.md +101 -0
- package/resource/doc/tuicallkit/iOS/api_TUICallKit.md +635 -0
- package/resource/doc/tuicallkit/iOS/api_TUICallObserver.md +779 -0
- package/resource/doc/tuicallkit/iOS/how_to_integrated_iOS_callkit.md +269 -0
- package/resource/doc/tuicallkit/iOS/how_to_run_iOS_callkit_demo.md +98 -0
- package/resource/doc/tuicallkit/react/.gitkeep +0 -0
- package/resource/doc/tuicallkit/react/api_TUICallKit.md +1909 -0
- package/resource/doc/tuicallkit/react/how_to_integrated_react_callkit.md +195 -0
- package/resource/doc/tuicallkit/react/how_to_run_react_callkit_demo.md +93 -0
- package/resource/doc/tuicallkit/vue/.gitkeep +0 -0
- package/resource/doc/tuicallkit/vue/api_TUICallKit.md +1909 -0
- package/resource/doc/tuicallkit/vue/api_TUICallObserver.md +926 -0
- package/resource/doc/tuicallkit/vue/how_to_integrated_vue_callkit.md +415 -0
- package/resource/doc/tuicallkit/vue/how_to_run_vue_callkit_demo.md +93 -0
- package/server.js +124 -0
- package/server.js.map +1 -0
- package/streamableHttp.js +74 -0
- package/streamableHttp.js.map +1 -0
|
@@ -0,0 +1,1909 @@
|
|
|
1
|
+
TUICallKit 是音视频通话组件的**含 UI 接口**,使用 TUICallKit API,您可以通过简单接口快速实现一个类微信的音视频通话场景;更详细的接入步骤,详见:[快速接入 TUICallKit](https://write.woa.com/document/130513425899630592)。
|
|
2
|
+
|
|
3
|
+
> **说明:**
|
|
4
|
+
>
|
|
5
|
+
> - 为提供更优质的音视频通信能力, TUICallKit npm 包 [@tencentcloud/call-uikit-react](https://www.npmjs.com/package/@tencentcloud/call-uikit-react)、[@tencentcloud/call-uikit-vue](https://www.npmjs.com/package/@tencentcloud/call-uikit-vue)、[@tencentcloud/call-uikit-vue2](https://www.npmjs.com/package/@tencentcloud/call-uikit-vue2)、[@tencentcloud/call-uikit-vue2.6](https://www.npmjs.com/package/@tencentcloud/call-uikit-vue2.6) 在 4.0.0 版本进行了重大升级。
|
|
6
|
+
> - v4.0.0+ 对接口进行了优化调整,废弃了部分接口,同步提供更简洁、稳定的新接口方案。
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## API 概览
|
|
10
|
+
<table>
|
|
11
|
+
<tr>
|
|
12
|
+
<td rowspan="1" colSpan="1" ><br>API</td>
|
|
13
|
+
|
|
14
|
+
<td rowspan="1" colSpan="1" >描述</td>
|
|
15
|
+
</tr>
|
|
16
|
+
|
|
17
|
+
<tr>
|
|
18
|
+
<td rowspan="1" colSpan="1" >[<TUICallKit />](https://cloud.tencent.com/document/product/647/81015#TUICallKit)</td>
|
|
19
|
+
|
|
20
|
+
<td rowspan="1" colSpan="1" >TUICallKit 通话 UI 组件。</td>
|
|
21
|
+
</tr>
|
|
22
|
+
|
|
23
|
+
<tr>
|
|
24
|
+
<td rowspan="1" colSpan="1" >[init](https://cloud.tencent.com/document/product/647/81015#init)</td>
|
|
25
|
+
|
|
26
|
+
<td rowspan="1" colSpan="1" >初始化 TUICallKit 组件实例。</td>
|
|
27
|
+
</tr>
|
|
28
|
+
|
|
29
|
+
<tr>
|
|
30
|
+
<td rowspan="1" colSpan="1" >[calls](https://cloud.tencent.com/document/product/647/81015#calls)</td>
|
|
31
|
+
|
|
32
|
+
<td rowspan="1" colSpan="1" >发起单人或多人通话。</td>
|
|
33
|
+
</tr>
|
|
34
|
+
|
|
35
|
+
<tr>
|
|
36
|
+
<td rowspan="1" colSpan="1" >[join](https://cloud.tencent.com/document/product/647/81015#join)</td>
|
|
37
|
+
|
|
38
|
+
<td rowspan="1" colSpan="1" >主动加入通话。</td>
|
|
39
|
+
</tr>
|
|
40
|
+
|
|
41
|
+
<tr>
|
|
42
|
+
<td rowspan="1" colSpan="1" >[setCallingBell](https://cloud.tencent.com/document/product/647/81015#setCallingBell)</td>
|
|
43
|
+
|
|
44
|
+
<td rowspan="1" colSpan="1" >设置自定义来电铃音。</td>
|
|
45
|
+
</tr>
|
|
46
|
+
|
|
47
|
+
<tr>
|
|
48
|
+
<td rowspan="1" colSpan="1" >[setSelfInfo](https://cloud.tencent.com/document/product/647/81015#setSelfInfo)</td>
|
|
49
|
+
|
|
50
|
+
<td rowspan="1" colSpan="1" >设置用户昵称和头像。</td>
|
|
51
|
+
</tr>
|
|
52
|
+
|
|
53
|
+
<tr>
|
|
54
|
+
<td rowspan="1" colSpan="1" >[enableMuteMode](https://cloud.tencent.com/document/product/647/81015#enableMuteMode)</td>
|
|
55
|
+
|
|
56
|
+
<td rowspan="1" colSpan="1" >开启/关闭来电铃声。</td>
|
|
57
|
+
</tr>
|
|
58
|
+
|
|
59
|
+
<tr>
|
|
60
|
+
<td rowspan="1" colSpan="1" >[enableFloatWindow](https://cloud.tencent.com/document/product/647/81015#enableFloatWindow)</td>
|
|
61
|
+
|
|
62
|
+
<td rowspan="1" colSpan="1" >开启/关闭悬浮窗功能。</td>
|
|
63
|
+
</tr>
|
|
64
|
+
|
|
65
|
+
<tr>
|
|
66
|
+
<td rowspan="1" colSpan="1" >[enableVirtualBackground](https://cloud.tencent.com/document/product/647/81015#enableVirtualBackground)</td>
|
|
67
|
+
|
|
68
|
+
<td rowspan="1" colSpan="1" >开启/关闭模糊背景的功能按钮。</td>
|
|
69
|
+
</tr>
|
|
70
|
+
|
|
71
|
+
<tr>
|
|
72
|
+
<td rowspan="1" colSpan="1" >[setLanguage](https://cloud.tencent.com/document/product/647/81015#setLanguage)</td>
|
|
73
|
+
|
|
74
|
+
<td rowspan="1" colSpan="1" >设置 TUICallKit 组件通话语言。</td>
|
|
75
|
+
</tr>
|
|
76
|
+
|
|
77
|
+
<tr>
|
|
78
|
+
<td rowspan="1" colSpan="1" >[hideFeatureButton](https://cloud.tencent.com/document/product/647/81015#hideFeatureButton)</td>
|
|
79
|
+
|
|
80
|
+
<td rowspan="1" colSpan="1" >隐藏按钮。</td>
|
|
81
|
+
</tr>
|
|
82
|
+
|
|
83
|
+
<tr>
|
|
84
|
+
<td rowspan="1" colSpan="1" >[setLocalViewBackgroundImage](https://cloud.tencent.com/document/product/647/81015#setLocalViewBackgroundImage)</td>
|
|
85
|
+
|
|
86
|
+
<td rowspan="1" colSpan="1" >设置本地用户通话界面背景图。</td>
|
|
87
|
+
</tr>
|
|
88
|
+
|
|
89
|
+
<tr>
|
|
90
|
+
<td rowspan="1" colSpan="1" >[setRemoteViewBackgroundImage](https://cloud.tencent.com/document/product/647/81015#setRemoteViewBackgroundImage)</td>
|
|
91
|
+
|
|
92
|
+
<td rowspan="1" colSpan="1" >设置远端用户通话界面背景图。</td>
|
|
93
|
+
</tr>
|
|
94
|
+
|
|
95
|
+
<tr>
|
|
96
|
+
<td rowspan="1" colSpan="1" >[setLayoutMode](https://cloud.tencent.com/document/product/647/81015#setLayoutMode)</td>
|
|
97
|
+
|
|
98
|
+
<td rowspan="1" colSpan="1" >设置通话界面布局模式。</td>
|
|
99
|
+
</tr>
|
|
100
|
+
|
|
101
|
+
<tr>
|
|
102
|
+
<td rowspan="1" colSpan="1" >[setCameraDefaultState](https://cloud.tencent.com/document/product/647/81015#setCameraDefaultState)</td>
|
|
103
|
+
|
|
104
|
+
<td rowspan="1" colSpan="1" >设置摄像头是否默认打开。</td>
|
|
105
|
+
</tr>
|
|
106
|
+
|
|
107
|
+
<tr>
|
|
108
|
+
<td rowspan="1" colSpan="1" >[destroyed](https://cloud.tencent.com/document/product/647/81015#destroyed)</td>
|
|
109
|
+
|
|
110
|
+
<td rowspan="1" colSpan="1" >销毁 TUICallKit 组件实例。</td>
|
|
111
|
+
</tr>
|
|
112
|
+
|
|
113
|
+
<tr>
|
|
114
|
+
<td rowspan="1" colSpan="1" >[getTUICallEngineInstance](https://cloud.tencent.com/document/product/647/81015#getTUICallEngineInstance)</td>
|
|
115
|
+
|
|
116
|
+
<td rowspan="1" colSpan="1" >获取 TUICallEngine 实例。</td>
|
|
117
|
+
</tr>
|
|
118
|
+
</table>
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
## <`TUICallKit />` 组件
|
|
122
|
+
|
|
123
|
+
### 属性概览
|
|
124
|
+
<table>
|
|
125
|
+
<tr>
|
|
126
|
+
<td rowspan="1" colSpan="1" >属性</td>
|
|
127
|
+
|
|
128
|
+
<td rowspan="1" colSpan="1" >描述</td>
|
|
129
|
+
|
|
130
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
131
|
+
|
|
132
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
133
|
+
|
|
134
|
+
<td rowspan="1" colSpan="1" >默认值</td>
|
|
135
|
+
|
|
136
|
+
<td rowspan="1" colSpan="1" >支持 vue</td>
|
|
137
|
+
|
|
138
|
+
<td rowspan="1" colSpan="1" >支持 react</td>
|
|
139
|
+
</tr>
|
|
140
|
+
|
|
141
|
+
<tr>
|
|
142
|
+
<td rowspan="1" colSpan="1" >allowedMinimized</td>
|
|
143
|
+
|
|
144
|
+
<td rowspan="1" colSpan="1" >是否允许悬浮窗</td>
|
|
145
|
+
|
|
146
|
+
<td rowspan="1" colSpan="1" >boolean</td>
|
|
147
|
+
|
|
148
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
149
|
+
|
|
150
|
+
<td rowspan="1" colSpan="1" >false</td>
|
|
151
|
+
|
|
152
|
+
<td rowspan="1" colSpan="1" ><br>√<br></td>
|
|
153
|
+
|
|
154
|
+
<td rowspan="1" colSpan="1" >√</td>
|
|
155
|
+
</tr>
|
|
156
|
+
|
|
157
|
+
<tr>
|
|
158
|
+
<td rowspan="1" colSpan="1" >allowedFullScreen</td>
|
|
159
|
+
|
|
160
|
+
<td rowspan="1" colSpan="1" >是否允许通话界面全屏</td>
|
|
161
|
+
|
|
162
|
+
<td rowspan="1" colSpan="1" >boolean</td>
|
|
163
|
+
|
|
164
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
165
|
+
|
|
166
|
+
<td rowspan="1" colSpan="1" >true</td>
|
|
167
|
+
|
|
168
|
+
<td rowspan="1" colSpan="1" >√</td>
|
|
169
|
+
|
|
170
|
+
<td rowspan="1" colSpan="1" >√</td>
|
|
171
|
+
</tr>
|
|
172
|
+
|
|
173
|
+
<tr>
|
|
174
|
+
<td rowspan="1" colSpan="1" >[videoDisplayMode](https://cloud.tencent.com/document/product/647/81015#videoDisplayMode)</td>
|
|
175
|
+
|
|
176
|
+
<td rowspan="1" colSpan="1" >通话界面显示模式</td>
|
|
177
|
+
|
|
178
|
+
<td rowspan="1" colSpan="1" >VideoDisplayMode</td>
|
|
179
|
+
|
|
180
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
181
|
+
|
|
182
|
+
<td rowspan="1" colSpan="1" >VideoDisplayMode.COVER</td>
|
|
183
|
+
|
|
184
|
+
<td rowspan="1" colSpan="1" >√</td>
|
|
185
|
+
|
|
186
|
+
<td rowspan="1" colSpan="1" >√</td>
|
|
187
|
+
</tr>
|
|
188
|
+
|
|
189
|
+
<tr>
|
|
190
|
+
<td rowspan="1" colSpan="1" >[videoResolution](https://cloud.tencent.com/document/product/647/81015#videoResolution)</td>
|
|
191
|
+
|
|
192
|
+
<td rowspan="1" colSpan="1" >通话分辨率</td>
|
|
193
|
+
|
|
194
|
+
<td rowspan="1" colSpan="1" >VideoResolution</td>
|
|
195
|
+
|
|
196
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
197
|
+
|
|
198
|
+
<td rowspan="1" colSpan="1" >VideoResolution.RESOLUTION_480P</td>
|
|
199
|
+
|
|
200
|
+
<td rowspan="1" colSpan="1" >√</td>
|
|
201
|
+
|
|
202
|
+
<td rowspan="1" colSpan="1" >√</td>
|
|
203
|
+
</tr>
|
|
204
|
+
|
|
205
|
+
<tr>
|
|
206
|
+
<td rowspan="1" colSpan="1" >beforeCalling</td>
|
|
207
|
+
|
|
208
|
+
<td rowspan="1" colSpan="1" >拨打电话前与收到通话邀请前会执行此函数</td>
|
|
209
|
+
|
|
210
|
+
<td rowspan="1" colSpan="1" >function(type, error)</td>
|
|
211
|
+
|
|
212
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
213
|
+
|
|
214
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
215
|
+
|
|
216
|
+
<td rowspan="1" colSpan="1" >√</td>
|
|
217
|
+
|
|
218
|
+
<td rowspan="1" colSpan="1" >√</td>
|
|
219
|
+
</tr>
|
|
220
|
+
|
|
221
|
+
<tr>
|
|
222
|
+
<td rowspan="1" colSpan="1" >afterCalling</td>
|
|
223
|
+
|
|
224
|
+
<td rowspan="1" colSpan="1" >结束通话后会执行此函数</td>
|
|
225
|
+
|
|
226
|
+
<td rowspan="1" colSpan="1" >function()</td>
|
|
227
|
+
|
|
228
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
229
|
+
|
|
230
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
231
|
+
|
|
232
|
+
<td rowspan="1" colSpan="1" >√</td>
|
|
233
|
+
|
|
234
|
+
<td rowspan="1" colSpan="1" >√</td>
|
|
235
|
+
</tr>
|
|
236
|
+
|
|
237
|
+
<tr>
|
|
238
|
+
<td rowspan="1" colSpan="1" ><br>onMinimized</td>
|
|
239
|
+
|
|
240
|
+
<td rowspan="1" colSpan="1" >组件切换最小化状态时会执行此函数,[STATUS 值说明](https://cloud.tencent.com/document/product/647/81015#STATUS)</td>
|
|
241
|
+
|
|
242
|
+
<td rowspan="1" colSpan="1" >function(oldStatus, newStatus)</td>
|
|
243
|
+
|
|
244
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
245
|
+
|
|
246
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
247
|
+
|
|
248
|
+
<td rowspan="1" colSpan="1" >√</td>
|
|
249
|
+
|
|
250
|
+
<td rowspan="1" colSpan="1" >√</td>
|
|
251
|
+
</tr>
|
|
252
|
+
|
|
253
|
+
<tr>
|
|
254
|
+
<td rowspan="1" colSpan="1" ><br>kickedOut</td>
|
|
255
|
+
|
|
256
|
+
<td rowspan="1" colSpan="1" >组件抛出的事件,当前登录用户被踢出登录时会触发该事件,通话也会自动结束</td>
|
|
257
|
+
|
|
258
|
+
<td rowspan="1" colSpan="1" >function()</td>
|
|
259
|
+
|
|
260
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
261
|
+
|
|
262
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
263
|
+
|
|
264
|
+
<td rowspan="1" colSpan="1" >√</td>
|
|
265
|
+
|
|
266
|
+
<td rowspan="1" colSpan="1" >×</td>
|
|
267
|
+
</tr>
|
|
268
|
+
|
|
269
|
+
<tr>
|
|
270
|
+
<td rowspan="1" colSpan="1" ><br>statusChanged</td>
|
|
271
|
+
|
|
272
|
+
<td rowspan="1" colSpan="1" >组件抛出的事件,当通话状态发生变化时,会触发该事件,通话状态种类详见,[STATUS 值说明](https://cloud.tencent.com/document/product/647/81015#STATUS)</td>
|
|
273
|
+
|
|
274
|
+
<td rowspan="1" colSpan="1" >function({oldStatus, newStatus})</td>
|
|
275
|
+
|
|
276
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
277
|
+
|
|
278
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
279
|
+
|
|
280
|
+
<td rowspan="1" colSpan="1" >√</td>
|
|
281
|
+
|
|
282
|
+
<td rowspan="1" colSpan="1" >×</td>
|
|
283
|
+
</tr>
|
|
284
|
+
</table>
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
### 示例代码
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
【React】
|
|
293
|
+
``` bash
|
|
294
|
+
import { TUICallKit, VideoDisplayMode, VideoResolution } from "@tencentcloud/call-uikit-react";
|
|
295
|
+
|
|
296
|
+
<TUICallKit
|
|
297
|
+
videoDisplayMode={VideoDisplayMode.CONTAIN}
|
|
298
|
+
videoResolution={VideoResolution.RESOLUTION_1080P}
|
|
299
|
+
beforeCalling={handleBeforeCalling}
|
|
300
|
+
afterCalling={handleAfterCalling}
|
|
301
|
+
/>
|
|
302
|
+
|
|
303
|
+
function handleBeforeCalling(type: string, error: any) {
|
|
304
|
+
console.log("[TUICallkit Demo] handleBeforeCalling:", type, error);
|
|
305
|
+
}
|
|
306
|
+
function handleAfterCalling() {
|
|
307
|
+
console.log("[TUICallkit Demo] handleAfterCalling");
|
|
308
|
+
}
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
【Vue3】
|
|
313
|
+
``` bash
|
|
314
|
+
<template>
|
|
315
|
+
<TUICallKit
|
|
316
|
+
:allowedMinimized="true"
|
|
317
|
+
:allowedFullScreen="true"
|
|
318
|
+
:videoDisplayMode="VideoDisplayMode.CONTAIN"
|
|
319
|
+
:videoResolution="VideoResolution.RESOLUTION_1080P"
|
|
320
|
+
:beforeCalling="beforeCalling"
|
|
321
|
+
:afterCalling="afterCalling"
|
|
322
|
+
:onMinimized="onMinimized"
|
|
323
|
+
:kickedOut="handleKickedOut"
|
|
324
|
+
:statusChanged="handleStatusChanged"
|
|
325
|
+
/>
|
|
326
|
+
</template>
|
|
327
|
+
|
|
328
|
+
<script lang="ts" setup>
|
|
329
|
+
import { TUICallKit, TUICallKitServer, VideoDisplayMode, VideoResolution, STATUS } from "@tencentcloud/call-uikit-vue";
|
|
330
|
+
|
|
331
|
+
function beforeCalling(type: string, error: any) {
|
|
332
|
+
console.log("[TUICallkit Demo] beforeCalling:", type, error);
|
|
333
|
+
}
|
|
334
|
+
function afterCalling() {
|
|
335
|
+
console.log("[TUICallkit Demo] afterCalling");
|
|
336
|
+
}
|
|
337
|
+
function onMinimized(oldStatus: string, newStatus: string) {
|
|
338
|
+
console.log("[TUICallkit Demo] onMinimized: " + oldStatus + " -> " + newStatus);
|
|
339
|
+
}
|
|
340
|
+
function kickedOut() {
|
|
341
|
+
console.log("[TUICallkit Demo] kickedOut");
|
|
342
|
+
}
|
|
343
|
+
function statusChanged(args: { oldStatus: string; newStatus: string; }) {
|
|
344
|
+
const { oldStatus, newStatus } = args;
|
|
345
|
+
if (newStatus === STATUS.CALLING_C2C_VIDEO) {
|
|
346
|
+
console.log(`[TUICallkit Demo] statusChanged: ${oldStatus} -> ${newStatus}`);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
</script>
|
|
350
|
+
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
【Vue2.7】
|
|
355
|
+
``` javascript
|
|
356
|
+
<template>
|
|
357
|
+
<TUICallKit
|
|
358
|
+
:allowedMinimized="true"
|
|
359
|
+
:allowedFullScreen="true"
|
|
360
|
+
:videoDisplayMode="VideoDisplayMode.CONTAIN"
|
|
361
|
+
:videoResolution="VideoResolution.RESOLUTION_1080P"
|
|
362
|
+
:beforeCalling="beforeCalling"
|
|
363
|
+
:afterCalling="afterCalling"
|
|
364
|
+
:onMinimized="onMinimized"
|
|
365
|
+
:kickedOut="handleKickedOut"
|
|
366
|
+
:statusChanged="handleStatusChanged"
|
|
367
|
+
/>
|
|
368
|
+
</template>
|
|
369
|
+
|
|
370
|
+
<script lang="ts" setup>
|
|
371
|
+
import { TUICallKit, TUICallKitServer, VideoDisplayMode, VideoResolution, STATUS } from "@tencentcloud/call-uikit-vue2";
|
|
372
|
+
|
|
373
|
+
function beforeCalling(type: string, error: any) {
|
|
374
|
+
console.log("[TUICallkit Demo] beforeCalling:", type, error);
|
|
375
|
+
}
|
|
376
|
+
function afterCalling() {
|
|
377
|
+
console.log("[TUICallkit Demo] afterCalling");
|
|
378
|
+
}
|
|
379
|
+
function onMinimized(oldStatus: string, newStatus: string) {
|
|
380
|
+
console.log("[TUICallkit Demo] onMinimized: " + oldStatus + " -> " + newStatus);
|
|
381
|
+
}
|
|
382
|
+
function kickedOut() {
|
|
383
|
+
console.log("[TUICallkit Demo] kickedOut");
|
|
384
|
+
}
|
|
385
|
+
function statusChanged(args: { oldStatus: string; newStatus: string; }) {
|
|
386
|
+
const { oldStatus, newStatus } = args;
|
|
387
|
+
if (newStatus === STATUS.CALLING_C2C_VIDEO) {
|
|
388
|
+
console.log(`[TUICallkit Demo] statusChanged: ${oldStatus} -> ${newStatus}`);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
</script>
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
【Vue2.6】
|
|
396
|
+
``` javascript
|
|
397
|
+
<template>
|
|
398
|
+
<TUICallKit
|
|
399
|
+
:allowedMinimized="true"
|
|
400
|
+
:allowedFullScreen="true"
|
|
401
|
+
:videoDisplayMode="VideoDisplayMode.CONTAIN"
|
|
402
|
+
:videoResolution="VideoResolution.RESOLUTION_1080P"
|
|
403
|
+
:beforeCalling="beforeCalling"
|
|
404
|
+
:afterCalling="afterCalling"
|
|
405
|
+
:onMinimized="onMinimized"
|
|
406
|
+
:kickedOut="handleKickedOut"
|
|
407
|
+
:statusChanged="handleStatusChanged"
|
|
408
|
+
/>
|
|
409
|
+
</template>
|
|
410
|
+
|
|
411
|
+
<script lang="ts" setup>
|
|
412
|
+
import { TUICallKit, TUICallKitServer, VideoDisplayMode, VideoResolution, STATUS } from "@tencentcloud/call-uikit-vue2.6";
|
|
413
|
+
|
|
414
|
+
function beforeCalling(type: string, error: any) {
|
|
415
|
+
console.log("[TUICallkit Demo] beforeCalling:", type, error);
|
|
416
|
+
}
|
|
417
|
+
function afterCalling() {
|
|
418
|
+
console.log("[TUICallkit Demo] afterCalling");
|
|
419
|
+
}
|
|
420
|
+
function onMinimized(oldStatus: string, newStatus: string) {
|
|
421
|
+
console.log("[TUICallkit Demo] onMinimized: " + oldStatus + " -> " + newStatus);
|
|
422
|
+
}
|
|
423
|
+
function kickedOut() {
|
|
424
|
+
console.log("[TUICallkit Demo] kickedOut");
|
|
425
|
+
}
|
|
426
|
+
function statusChanged(args: { oldStatus: string; newStatus: string; }) {
|
|
427
|
+
const { oldStatus, newStatus } = args;
|
|
428
|
+
if (newStatus === STATUS.CALLING_C2C_VIDEO) {
|
|
429
|
+
console.log(`[TUICallkit Demo] statusChanged: ${oldStatus} -> ${newStatus}`);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
</script>
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
## TUICallKitServer API 详情
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
【React】
|
|
441
|
+
``` javascript
|
|
442
|
+
import { TUICallKitServer } from "@tencentcloud/call-uikit-react";
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
【Vue3】
|
|
447
|
+
``` javascript
|
|
448
|
+
import { TUICallKitServer } from "@tencentcloud/call-uikit-vue";
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
【Vue2.7】
|
|
453
|
+
``` javascript
|
|
454
|
+
import { TUICallKitServer } from "@tencentcloud/call-uikit-vue2";
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
【Vue2.6】
|
|
459
|
+
``` javascript
|
|
460
|
+
import { TUICallKitServer } from "@tencentcloud/call-uikit-vue2.6";
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
### init
|
|
464
|
+
|
|
465
|
+
初始化 TUICallKit。
|
|
466
|
+
``` javascript
|
|
467
|
+
try {
|
|
468
|
+
await TUICallKitServer.init({ SDKAppID, userID, userSig });
|
|
469
|
+
// If you already have a tim instance in your project, you need to pass it in here.
|
|
470
|
+
// await TUICallKitServer.init({ tim, SDKAppID, userID, userSig});
|
|
471
|
+
console.log("[TUICallKit] init succeeds.");
|
|
472
|
+
} catch (error: any) {
|
|
473
|
+
console.error(`[TUICallKit] init failed. Reason: ${error}`);
|
|
474
|
+
}
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
参数如下表所示:
|
|
478
|
+
<table>
|
|
479
|
+
<tr>
|
|
480
|
+
<td rowspan="1" colSpan="1" >参数</td>
|
|
481
|
+
|
|
482
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
483
|
+
|
|
484
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
485
|
+
|
|
486
|
+
<td rowspan="1" colSpan="1" >含义</td>
|
|
487
|
+
</tr>
|
|
488
|
+
|
|
489
|
+
<tr>
|
|
490
|
+
<td rowspan="1" colSpan="1" >SDKAppID</td>
|
|
491
|
+
|
|
492
|
+
<td rowspan="1" colSpan="1" >Number</td>
|
|
493
|
+
|
|
494
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
495
|
+
|
|
496
|
+
<td rowspan="1" colSpan="1" >应用的 SDKAppID,您可以在实时音视频控制台中找到您的 SDKAppID。具体详见:[开通服务](https://write.woa.com/document/139743928960860160)</td>
|
|
497
|
+
</tr>
|
|
498
|
+
|
|
499
|
+
<tr>
|
|
500
|
+
<td rowspan="1" colSpan="1" >userID</td>
|
|
501
|
+
|
|
502
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
503
|
+
|
|
504
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
505
|
+
|
|
506
|
+
<td rowspan="1" colSpan="1" >即用户名,只允许包含英文字母(a-z 和 A-Z)、数字(0-9)、连词符(-)和下划线(_)。<br>**注意:**不支持同一个 userID 在两台不同的设备上同时进入同一个房间通话,否则会相互干扰。</td>
|
|
507
|
+
</tr>
|
|
508
|
+
|
|
509
|
+
<tr>
|
|
510
|
+
<td rowspan="1" colSpan="1" >userSig</td>
|
|
511
|
+
|
|
512
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
513
|
+
|
|
514
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
515
|
+
|
|
516
|
+
<td rowspan="1" colSpan="1" >使用 SecretKey 对 SDKAppID、UserID 等信息进行加密,就可以得到 userSig。<br>它是一个鉴权用的票据,用于腾讯云识别当前用户是否能够使用 TRTC 的服务,获取方式请参见 [UserSig](https://cloud.tencent.com/document/product/647/17275)</td>
|
|
517
|
+
</tr>
|
|
518
|
+
|
|
519
|
+
<tr>
|
|
520
|
+
<td rowspan="1" colSpan="1" >tim</td>
|
|
521
|
+
|
|
522
|
+
<td rowspan="1" colSpan="1" >TencentCloudChat</td>
|
|
523
|
+
|
|
524
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
525
|
+
|
|
526
|
+
<td rowspan="1" colSpan="1" >tim 是 [TencentCloudChat](https://www.npmjs.com/package/@tencentcloud/chat) SDK 的实例</td>
|
|
527
|
+
</tr>
|
|
528
|
+
</table>
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
### calls
|
|
532
|
+
|
|
533
|
+
发起单人或多人通话。
|
|
534
|
+
|
|
535
|
+
> **说明:**
|
|
536
|
+
>
|
|
537
|
+
|
|
538
|
+
> **v4.0.0+ 支持。**
|
|
539
|
+
>
|
|
540
|
+
|
|
541
|
+
``` javascript
|
|
542
|
+
try {
|
|
543
|
+
await TUICallKitServer.calls({
|
|
544
|
+
userIDList: ['jack', 'tom'],
|
|
545
|
+
type: TUICallType.VIDEO_CALL
|
|
546
|
+
});
|
|
547
|
+
} catch (error: any) {
|
|
548
|
+
console.error(`[TUICallKit] Failed to call the groupCall API. Reason:${error}`);
|
|
549
|
+
}
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
参数如下表所示:
|
|
553
|
+
<table>
|
|
554
|
+
<tr>
|
|
555
|
+
<td rowspan="1" colSpan="1" >参数</td>
|
|
556
|
+
|
|
557
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
558
|
+
|
|
559
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
560
|
+
|
|
561
|
+
<td rowspan="1" colSpan="1" >含义</td>
|
|
562
|
+
</tr>
|
|
563
|
+
|
|
564
|
+
<tr>
|
|
565
|
+
<td rowspan="1" colSpan="1" >userIDList</td>
|
|
566
|
+
|
|
567
|
+
<td rowspan="1" colSpan="1" >Array<String></td>
|
|
568
|
+
|
|
569
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
570
|
+
|
|
571
|
+
<td rowspan="1" colSpan="1" >被呼叫的用户列表</td>
|
|
572
|
+
</tr>
|
|
573
|
+
|
|
574
|
+
<tr>
|
|
575
|
+
<td rowspan="1" colSpan="1" >type</td>
|
|
576
|
+
|
|
577
|
+
<td rowspan="1" colSpan="1" >[TUICallType](https://cloud.tencent.com/document/product/647/81015#TUICallType)</td>
|
|
578
|
+
|
|
579
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
580
|
+
|
|
581
|
+
<td rowspan="1" colSpan="1" >通话的媒体类型,参数值说明参见 [TUICallType 通话类型](https://cloud.tencent.com/document/product/647/81015#TUICallType)<br>兼容旧版本:语音通话(type = 1)、视频通话(type = 2)</td>
|
|
582
|
+
</tr>
|
|
583
|
+
|
|
584
|
+
<tr>
|
|
585
|
+
<td rowspan="1" colSpan="1" >chatGroupID</td>
|
|
586
|
+
|
|
587
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
588
|
+
|
|
589
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
590
|
+
|
|
591
|
+
<td rowspan="1" colSpan="1" >与 chat 结合使用时, chat 群组的群 ID</td>
|
|
592
|
+
</tr>
|
|
593
|
+
|
|
594
|
+
<tr>
|
|
595
|
+
<td rowspan="1" colSpan="1" >roomID</td>
|
|
596
|
+
|
|
597
|
+
<td rowspan="1" colSpan="1" >Number</td>
|
|
598
|
+
|
|
599
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
600
|
+
|
|
601
|
+
<td rowspan="1" colSpan="1" >数字房间号,范围 [1, 2147483647]</td>
|
|
602
|
+
</tr>
|
|
603
|
+
|
|
604
|
+
<tr>
|
|
605
|
+
<td rowspan="1" colSpan="1" >strRoomID</td>
|
|
606
|
+
|
|
607
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
608
|
+
|
|
609
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
610
|
+
|
|
611
|
+
<td rowspan="1" colSpan="1" >字符串房间号。**v3.3.1+ 支持**<br>1. roomID 与 strRoomID 是互斥的,若您选用 strRoomID,则 roomID 需要填写为 0。若两者都填,SDK 将优先选用 roomID。<br>2. 不要混用 roomID 和 strRoomID,因为它们之间是不互通的,例如数字 123 和字符串 "123" 是两个完全不同的房间。</td>
|
|
612
|
+
</tr>
|
|
613
|
+
|
|
614
|
+
<tr>
|
|
615
|
+
<td rowspan="1" colSpan="1" >timeout</td>
|
|
616
|
+
|
|
617
|
+
<td rowspan="1" colSpan="1" >Number</td>
|
|
618
|
+
|
|
619
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
620
|
+
|
|
621
|
+
<td rowspan="1" colSpan="1" >通话超时时间,默认:30s,单位:秒。设置范围:10s ~ 600s。如果传入0,默认30s。</td>
|
|
622
|
+
</tr>
|
|
623
|
+
|
|
624
|
+
<tr>
|
|
625
|
+
<td rowspan="1" colSpan="1" >userData</td>
|
|
626
|
+
|
|
627
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
628
|
+
|
|
629
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
630
|
+
|
|
631
|
+
<td rowspan="1" colSpan="1" >发起通话时自定义扩展字段,被呼叫用户在 [ON_CALL_RECEIVED](https://write.woa.com/document/86735802757361664) 事件中有该参数</td>
|
|
632
|
+
</tr>
|
|
633
|
+
|
|
634
|
+
<tr>
|
|
635
|
+
<td rowspan="1" colSpan="1" >[offlinePushInfo](https://cloud.tencent.com/document/product/647/81015#offlinePushInfo)</td>
|
|
636
|
+
|
|
637
|
+
<td rowspan="1" colSpan="1" >Object</td>
|
|
638
|
+
|
|
639
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
640
|
+
|
|
641
|
+
<td rowspan="1" colSpan="1" >自定义离线消息推送参数</td>
|
|
642
|
+
</tr>
|
|
643
|
+
</table>
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
### join
|
|
647
|
+
|
|
648
|
+
加入群组中已有的音视频通话。
|
|
649
|
+
|
|
650
|
+
> **说明:**
|
|
651
|
+
>
|
|
652
|
+
|
|
653
|
+
> **v4.0.0+ 支持。**
|
|
654
|
+
>
|
|
655
|
+
|
|
656
|
+
``` javascript
|
|
657
|
+
try {
|
|
658
|
+
await TUICallKitServer.join({callId: xx});
|
|
659
|
+
} catch (error: any) {
|
|
660
|
+
console.error(`[TUICallKit] Failed to call the join API. Reason: ${error}`);
|
|
661
|
+
}
|
|
662
|
+
```
|
|
663
|
+
|
|
664
|
+
参数列表:
|
|
665
|
+
<table>
|
|
666
|
+
<tr>
|
|
667
|
+
<td rowspan="1" colSpan="1" >参数</td>
|
|
668
|
+
|
|
669
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
670
|
+
|
|
671
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
672
|
+
|
|
673
|
+
<td rowspan="1" colSpan="1" >含义</td>
|
|
674
|
+
</tr>
|
|
675
|
+
|
|
676
|
+
<tr>
|
|
677
|
+
<td rowspan="1" colSpan="1" >callId</td>
|
|
678
|
+
|
|
679
|
+
<td rowspan="1" colSpan="1" >string</td>
|
|
680
|
+
|
|
681
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
682
|
+
|
|
683
|
+
<td rowspan="1" colSpan="1" >此次通话的唯一 ID。</td>
|
|
684
|
+
</tr>
|
|
685
|
+
</table>
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
### setLanguage
|
|
689
|
+
|
|
690
|
+
设置语言,目前支持:中文、英文、日文。
|
|
691
|
+
``` javascript
|
|
692
|
+
TUICallKitServer.setLanguage("zh-cn"); // "en" | "zh-cn" | "ja_JP"
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
参数如下表所示:
|
|
696
|
+
<table>
|
|
697
|
+
<tr>
|
|
698
|
+
<td rowspan="1" colSpan="1" >参数</td>
|
|
699
|
+
|
|
700
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
701
|
+
|
|
702
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
703
|
+
|
|
704
|
+
<td rowspan="1" colSpan="1" >含义</td>
|
|
705
|
+
</tr>
|
|
706
|
+
|
|
707
|
+
<tr>
|
|
708
|
+
<td rowspan="1" colSpan="1" >lang</td>
|
|
709
|
+
|
|
710
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
711
|
+
|
|
712
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
713
|
+
|
|
714
|
+
<td rowspan="1" colSpan="1" >语言类型`en`、`zh-cn` 和 `ja_JP`。</td>
|
|
715
|
+
</tr>
|
|
716
|
+
</table>
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
### setSelfInfo
|
|
720
|
+
|
|
721
|
+
设置当前用户昵称和头像。
|
|
722
|
+
|
|
723
|
+
> **注意:**
|
|
724
|
+
>
|
|
725
|
+
|
|
726
|
+
> **v2.2.0+ 支持**。**通话中使用该接口修改用户信息,UI 不会立即更新,需要等到下次通话才能看到变化**。
|
|
727
|
+
>
|
|
728
|
+
|
|
729
|
+
``` javascript
|
|
730
|
+
try {
|
|
731
|
+
await TUICallKitServer.setSelfInfo({ nickName: "xxx", avatar: "http://xxx" });
|
|
732
|
+
} catch (error: any) {
|
|
733
|
+
console.error(`[TUICallKit] Failed to call the setSelfInfo API. Reason: ${error}`;
|
|
734
|
+
}
|
|
735
|
+
```
|
|
736
|
+
|
|
737
|
+
参数如下表所示:
|
|
738
|
+
<table>
|
|
739
|
+
<tr>
|
|
740
|
+
<td rowspan="1" colSpan="1" >**参数**</td>
|
|
741
|
+
|
|
742
|
+
<td rowspan="1" colSpan="1" >**类型**</td>
|
|
743
|
+
|
|
744
|
+
<td rowspan="1" colSpan="1" >**是否必填**</td>
|
|
745
|
+
|
|
746
|
+
<td rowspan="1" colSpan="1" >**含义**</td>
|
|
747
|
+
</tr>
|
|
748
|
+
|
|
749
|
+
<tr>
|
|
750
|
+
<td rowspan="1" colSpan="1" >nickName</td>
|
|
751
|
+
|
|
752
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
753
|
+
|
|
754
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
755
|
+
|
|
756
|
+
<td rowspan="1" colSpan="1" >自己的昵称</td>
|
|
757
|
+
</tr>
|
|
758
|
+
|
|
759
|
+
<tr>
|
|
760
|
+
<td rowspan="1" colSpan="1" >avatar</td>
|
|
761
|
+
|
|
762
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
763
|
+
|
|
764
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
765
|
+
|
|
766
|
+
<td rowspan="1" colSpan="1" >自己头像地址</td>
|
|
767
|
+
</tr>
|
|
768
|
+
</table>
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
### setCallingBell
|
|
772
|
+
- 自定义用户的来电铃音。
|
|
773
|
+
|
|
774
|
+
- 仅限传入本地 MP3 格式的文件地址,需要确保该文件目录是应用可以访问的。
|
|
775
|
+
|
|
776
|
+
- 使用 import 方式引入铃声文件。
|
|
777
|
+
|
|
778
|
+
- 如需恢复默认铃声,`filePath` 传空即可。
|
|
779
|
+
|
|
780
|
+
``` javascript
|
|
781
|
+
try {
|
|
782
|
+
await TUICallKitServer.setCallingBell(filePath?: string)
|
|
783
|
+
} catch (error: any) {
|
|
784
|
+
console.error(`[TUICallKit] Failed to call the setCallingBell API. Reason: ${error}`);
|
|
785
|
+
}
|
|
786
|
+
```
|
|
787
|
+
|
|
788
|
+
参数如下表所示:
|
|
789
|
+
|
|
790
|
+
<table>
|
|
791
|
+
<tr>
|
|
792
|
+
<td rowspan="1" colSpan="1" >参数</td>
|
|
793
|
+
|
|
794
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
795
|
+
|
|
796
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
797
|
+
|
|
798
|
+
<td rowspan="1" colSpan="1" >含义</td>
|
|
799
|
+
</tr>
|
|
800
|
+
|
|
801
|
+
<tr>
|
|
802
|
+
<td rowspan="1" colSpan="1" >filePath</td>
|
|
803
|
+
|
|
804
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
805
|
+
|
|
806
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
807
|
+
|
|
808
|
+
<td rowspan="1" colSpan="1" >铃声文件地址</td>
|
|
809
|
+
</tr>
|
|
810
|
+
</table>
|
|
811
|
+
|
|
812
|
+
|
|
813
|
+
### enableFloatWindow
|
|
814
|
+
|
|
815
|
+
开启/关闭悬浮窗功能。默认为 false,通话界面左上角的悬浮窗按钮隐藏,设置为 true 后显示。
|
|
816
|
+
``` javascript
|
|
817
|
+
try {
|
|
818
|
+
await TUICallKitServer.enableFloatWindow(enable: Boolean)
|
|
819
|
+
} catch (error: any) {
|
|
820
|
+
console.error(`[TUICallKit] Failed to call the enableFloatWindow API. Reason: ${error}`);
|
|
821
|
+
}
|
|
822
|
+
```
|
|
823
|
+
|
|
824
|
+
### enableMuteMode
|
|
825
|
+
|
|
826
|
+
开启/关闭来电铃声。开启后,收到通话请求时,不会播放来电铃声。
|
|
827
|
+
``` javascript
|
|
828
|
+
try {
|
|
829
|
+
await TUICallKitServer.enableMuteMode(enable: boolean)
|
|
830
|
+
} catch (error: any) {
|
|
831
|
+
console.error(`[TUICallKit] Failed to call the enableMuteMode API. Reason: ${error}`);
|
|
832
|
+
}
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
参数如下表所示:
|
|
836
|
+
<table>
|
|
837
|
+
<tr>
|
|
838
|
+
<td rowspan="1" colSpan="1" >参数</td>
|
|
839
|
+
|
|
840
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
841
|
+
|
|
842
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
843
|
+
|
|
844
|
+
<td rowspan="1" colSpan="1" >含义</td>
|
|
845
|
+
</tr>
|
|
846
|
+
|
|
847
|
+
<tr>
|
|
848
|
+
<td rowspan="1" colSpan="1" >enable</td>
|
|
849
|
+
|
|
850
|
+
<td rowspan="1" colSpan="1" >Boolean</td>
|
|
851
|
+
|
|
852
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
853
|
+
|
|
854
|
+
<td rowspan="1" colSpan="1" >开启/关闭来电铃声。默认 false。</td>
|
|
855
|
+
</tr>
|
|
856
|
+
</table>
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
### enableVirtualBackground
|
|
860
|
+
|
|
861
|
+
开启/关闭模糊背景功能。如果想设置图片背景模糊参见 [Web](https://cloud.tencent.com/document/product/647/106071)。通过调用接口,您可以在 UI 上显示模糊背景的功能按钮,点击按钮可直接启用模糊背景功能。
|
|
862
|
+
|
|
863
|
+
> **注意:**
|
|
864
|
+
>
|
|
865
|
+
|
|
866
|
+
> **v3.2.4+ 支持。**
|
|
867
|
+
>
|
|
868
|
+
|
|
869
|
+
``` javascript
|
|
870
|
+
import { TUICallKitServer } from "@tencentcloud/call-uikit-react";
|
|
871
|
+
const enable = true;
|
|
872
|
+
TUICallKitServer.enableVirtualBackground(enable);
|
|
873
|
+
```
|
|
874
|
+
|
|
875
|
+
参数列表:
|
|
876
|
+
<table>
|
|
877
|
+
<tr>
|
|
878
|
+
<td rowspan="1" colSpan="1" >参数</td>
|
|
879
|
+
|
|
880
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
881
|
+
|
|
882
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
883
|
+
|
|
884
|
+
<td rowspan="1" colSpan="1" >含义</td>
|
|
885
|
+
</tr>
|
|
886
|
+
|
|
887
|
+
<tr>
|
|
888
|
+
<td rowspan="1" colSpan="1" >enable</td>
|
|
889
|
+
|
|
890
|
+
<td rowspan="1" colSpan="1" >boolean</td>
|
|
891
|
+
|
|
892
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
893
|
+
|
|
894
|
+
<td rowspan="1" colSpan="1" >- enable = true 显示模糊背景按钮<br>- enable = false 不显示模糊背景按钮</td>
|
|
895
|
+
</tr>
|
|
896
|
+
</table>
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
### destroyed
|
|
900
|
+
|
|
901
|
+
销毁 TUICallKit 实例。
|
|
902
|
+
|
|
903
|
+
该方法不会自动退出`tim`,需要手动退出`tim.logout();`。
|
|
904
|
+
``` javascript
|
|
905
|
+
try {
|
|
906
|
+
await TUICallKitServer.destroyed();
|
|
907
|
+
} catch (error: any) {
|
|
908
|
+
alert(`[TUICallKit] Failed to call the destroyed API. Reason: ${error}`);
|
|
909
|
+
}
|
|
910
|
+
```
|
|
911
|
+
|
|
912
|
+
### hideFeatureButton
|
|
913
|
+
|
|
914
|
+
隐藏功能按钮,目前仅支持 摄像头,麦克风和切换前后置按钮。
|
|
915
|
+
|
|
916
|
+
> **注意:**
|
|
917
|
+
>
|
|
918
|
+
|
|
919
|
+
> **v3.2.9+ 支持。**
|
|
920
|
+
>
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
|
|
924
|
+
|
|
925
|
+
|
|
926
|
+
【Vue】
|
|
927
|
+
``` javascript
|
|
928
|
+
import { TUICallKitServer, FeatureButton } from "@tencentcloud/call-uikit-vue";
|
|
929
|
+
|
|
930
|
+
TUICallKitServer.hideFeatureButton(FeatureButton.Camera);
|
|
931
|
+
```
|
|
932
|
+
|
|
933
|
+
|
|
934
|
+
【React】
|
|
935
|
+
``` javascript
|
|
936
|
+
import { TUICallKitServer, FeatureButton } from "@tencentcloud/call-uikit-react";
|
|
937
|
+
|
|
938
|
+
TUICallKitServer.hideFeatureButton(FeatureButton.Camera);
|
|
939
|
+
```
|
|
940
|
+
|
|
941
|
+
参数列表:
|
|
942
|
+
<table>
|
|
943
|
+
<tr>
|
|
944
|
+
<td rowspan="1" colSpan="1" >参数</td>
|
|
945
|
+
|
|
946
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
947
|
+
|
|
948
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
949
|
+
|
|
950
|
+
<td rowspan="1" colSpan="1" >含义</td>
|
|
951
|
+
</tr>
|
|
952
|
+
|
|
953
|
+
<tr>
|
|
954
|
+
<td rowspan="1" colSpan="1" >buttonName</td>
|
|
955
|
+
|
|
956
|
+
<td rowspan="1" colSpan="1" >[FeatureButton](https://cloud.tencent.com/document/product/647/81015#FeatureButton)</td>
|
|
957
|
+
|
|
958
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
959
|
+
|
|
960
|
+
<td rowspan="1" colSpan="1" >按钮名称</td>
|
|
961
|
+
</tr>
|
|
962
|
+
</table>
|
|
963
|
+
|
|
964
|
+
|
|
965
|
+
### setLocalViewBackgroundImage
|
|
966
|
+
|
|
967
|
+
设置本地用户通话背景。
|
|
968
|
+
|
|
969
|
+
> **注意:**
|
|
970
|
+
>
|
|
971
|
+
|
|
972
|
+
> **v3.2.9+ 支持。**
|
|
973
|
+
>
|
|
974
|
+
|
|
975
|
+
``` typescript
|
|
976
|
+
TUICallKitServer.setLocalViewBackgroundImage('http://xxx.png');
|
|
977
|
+
```
|
|
978
|
+
|
|
979
|
+
参数列表:
|
|
980
|
+
<table>
|
|
981
|
+
<tr>
|
|
982
|
+
<td rowspan="1" colSpan="1" >参数</td>
|
|
983
|
+
|
|
984
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
985
|
+
|
|
986
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
987
|
+
|
|
988
|
+
<td rowspan="1" colSpan="1" >含义</td>
|
|
989
|
+
</tr>
|
|
990
|
+
|
|
991
|
+
<tr>
|
|
992
|
+
<td rowspan="1" colSpan="1" >url</td>
|
|
993
|
+
|
|
994
|
+
<td rowspan="1" colSpan="1" >string</td>
|
|
995
|
+
|
|
996
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
997
|
+
|
|
998
|
+
<td rowspan="1" colSpan="1" >图片地址(支持本地路径和网络地址)</td>
|
|
999
|
+
</tr>
|
|
1000
|
+
</table>
|
|
1001
|
+
|
|
1002
|
+
|
|
1003
|
+
### setRemoteViewBackgroundImage
|
|
1004
|
+
|
|
1005
|
+
设置远端用户通话背景。
|
|
1006
|
+
|
|
1007
|
+
> **注意:**
|
|
1008
|
+
>
|
|
1009
|
+
|
|
1010
|
+
> **v3.2.9+ 支持。**
|
|
1011
|
+
>
|
|
1012
|
+
|
|
1013
|
+
``` javascript
|
|
1014
|
+
const userId = 'xxx';
|
|
1015
|
+
const url = 'http://xxx.png';
|
|
1016
|
+
TUICallKitServer.setRemoteViewBackgroundImage(userId, url);
|
|
1017
|
+
```
|
|
1018
|
+
|
|
1019
|
+
参数列表:
|
|
1020
|
+
<table>
|
|
1021
|
+
<tr>
|
|
1022
|
+
<td rowspan="1" colSpan="1" >参数</td>
|
|
1023
|
+
|
|
1024
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
1025
|
+
|
|
1026
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
1027
|
+
|
|
1028
|
+
<td rowspan="1" colSpan="1" >含义</td>
|
|
1029
|
+
</tr>
|
|
1030
|
+
|
|
1031
|
+
<tr>
|
|
1032
|
+
<td rowspan="1" colSpan="1" >userId</td>
|
|
1033
|
+
|
|
1034
|
+
<td rowspan="1" colSpan="1" >string</td>
|
|
1035
|
+
|
|
1036
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
1037
|
+
|
|
1038
|
+
<td rowspan="1" colSpan="1" >远端用户 userId,设置为 '*' 表示对所有远端用户生效</td>
|
|
1039
|
+
</tr>
|
|
1040
|
+
|
|
1041
|
+
<tr>
|
|
1042
|
+
<td rowspan="1" colSpan="1" >url</td>
|
|
1043
|
+
|
|
1044
|
+
<td rowspan="1" colSpan="1" >string</td>
|
|
1045
|
+
|
|
1046
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
1047
|
+
|
|
1048
|
+
<td rowspan="1" colSpan="1" >图片地址(支持本地路径和网络地址)</td>
|
|
1049
|
+
</tr>
|
|
1050
|
+
</table>
|
|
1051
|
+
|
|
1052
|
+
|
|
1053
|
+
### setLayoutMode
|
|
1054
|
+
|
|
1055
|
+
设置通话界面布局模式。
|
|
1056
|
+
|
|
1057
|
+
> **注意:**
|
|
1058
|
+
>
|
|
1059
|
+
|
|
1060
|
+
> **v3.3.0+ 支持。**
|
|
1061
|
+
>
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
【Vue】
|
|
1068
|
+
``` javascript
|
|
1069
|
+
import { TUICallKitServer, LayoutMode } from "@tencentcloud/call-uikit-vue";
|
|
1070
|
+
TUICallKitServer.setLayoutMode(LayoutMode.LocalInLargeView);
|
|
1071
|
+
```
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
【React】
|
|
1075
|
+
``` javascript
|
|
1076
|
+
import { TUICallKitServer, LayoutMode } from "@tencentcloud/call-uikit-react";
|
|
1077
|
+
TUICallKitServer.setLayoutMode(LayoutMode.LocalInLargeView);
|
|
1078
|
+
```
|
|
1079
|
+
|
|
1080
|
+
参数列表:
|
|
1081
|
+
<table>
|
|
1082
|
+
<tr>
|
|
1083
|
+
<td rowspan="1" colSpan="1" >参数</td>
|
|
1084
|
+
|
|
1085
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
1086
|
+
|
|
1087
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
1088
|
+
|
|
1089
|
+
<td rowspan="1" colSpan="1" >含义</td>
|
|
1090
|
+
</tr>
|
|
1091
|
+
|
|
1092
|
+
<tr>
|
|
1093
|
+
<td rowspan="1" colSpan="1" >layoutMode</td>
|
|
1094
|
+
|
|
1095
|
+
<td rowspan="1" colSpan="1" >[LayoutMode](https://cloud.tencent.com/document/product/647/81015#LayoutMode)</td>
|
|
1096
|
+
|
|
1097
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
1098
|
+
|
|
1099
|
+
<td rowspan="1" colSpan="1" >用户流的布局模式</td>
|
|
1100
|
+
</tr>
|
|
1101
|
+
</table>
|
|
1102
|
+
|
|
1103
|
+
|
|
1104
|
+
### setCameraDefaultState
|
|
1105
|
+
|
|
1106
|
+
设置摄像头是否默认打开。
|
|
1107
|
+
|
|
1108
|
+
> **注意:**
|
|
1109
|
+
>
|
|
1110
|
+
|
|
1111
|
+
> **v3.3.0+ 支持。**
|
|
1112
|
+
>
|
|
1113
|
+
|
|
1114
|
+
``` javascript
|
|
1115
|
+
TUICallKitServer.setCameraDefaultState(true);
|
|
1116
|
+
```
|
|
1117
|
+
|
|
1118
|
+
参数列表:
|
|
1119
|
+
<table>
|
|
1120
|
+
<tr>
|
|
1121
|
+
<td rowspan="1" colSpan="1" >参数</td>
|
|
1122
|
+
|
|
1123
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
1124
|
+
|
|
1125
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
1126
|
+
|
|
1127
|
+
<td rowspan="1" colSpan="1" >含义</td>
|
|
1128
|
+
</tr>
|
|
1129
|
+
|
|
1130
|
+
<tr>
|
|
1131
|
+
<td rowspan="1" colSpan="1" >isOpen</td>
|
|
1132
|
+
|
|
1133
|
+
<td rowspan="1" colSpan="1" >boolean</td>
|
|
1134
|
+
|
|
1135
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
1136
|
+
|
|
1137
|
+
<td rowspan="1" colSpan="1" >是否开启摄像头</td>
|
|
1138
|
+
</tr>
|
|
1139
|
+
</table>
|
|
1140
|
+
|
|
1141
|
+
|
|
1142
|
+
### getTUICallEngineInstance
|
|
1143
|
+
|
|
1144
|
+
获取 TUICallEngine 实例。
|
|
1145
|
+
|
|
1146
|
+
> **注意:**
|
|
1147
|
+
>
|
|
1148
|
+
|
|
1149
|
+
> v2.4.3+ 支持。
|
|
1150
|
+
>
|
|
1151
|
+
|
|
1152
|
+
``` javascript
|
|
1153
|
+
TUICallKitServer.getTUICallEngineInstance();
|
|
1154
|
+
```
|
|
1155
|
+
|
|
1156
|
+
## TUICallKit 类型定义
|
|
1157
|
+
|
|
1158
|
+
### videoDisplayMode
|
|
1159
|
+
|
|
1160
|
+
画面显示模式 `videoDisplayMode` 属性有三个值:
|
|
1161
|
+
- `VideoDisplayMode.CONTAIN`
|
|
1162
|
+
|
|
1163
|
+
- `VideoDisplayMode.COVER`
|
|
1164
|
+
|
|
1165
|
+
- `VideoDisplayMode.FILL`,默认值是`VideoDisplayMode.COVER`。
|
|
1166
|
+
|
|
1167
|
+
<table>
|
|
1168
|
+
<tr>
|
|
1169
|
+
<td rowspan="1" colSpan="1" >属性</td>
|
|
1170
|
+
|
|
1171
|
+
<td rowspan="1" colSpan="1" >值</td>
|
|
1172
|
+
|
|
1173
|
+
<td rowspan="1" colSpan="1" >描述</td>
|
|
1174
|
+
</tr>
|
|
1175
|
+
|
|
1176
|
+
<tr>
|
|
1177
|
+
<td rowspan="3" colSpan="1" >videoDisplayMode</td>
|
|
1178
|
+
|
|
1179
|
+
<td rowspan="1" colSpan="1" >VideoDisplayMode.CONTAIN</td>
|
|
1180
|
+
|
|
1181
|
+
<td rowspan="1" colSpan="1" >- 优先保证视频内容全部显示。<br>- 视频尺寸等比缩放,直至视频窗口的一边与视窗边框对齐。<br>- 如果视频尺寸与显示视窗尺寸不一致,在保持长宽比的前提下,将视频进行缩放后填满视窗,缩放后的视频四周会有一圈黑边。</td>
|
|
1182
|
+
</tr>
|
|
1183
|
+
|
|
1184
|
+
<tr>
|
|
1185
|
+
<td rowspan="1" colSpan="1" >VideoDisplayMode.COVER</td>
|
|
1186
|
+
|
|
1187
|
+
<td rowspan="1" colSpan="1" >- 优先保证视窗被填满。<br>- 视频尺寸等比缩放,直至整个视窗被视频填满。<br>- 如果视频长宽与显示窗口不同,则视频流会按照显示视窗的比例进行周边裁剪或图像拉伸后填满视窗。</td>
|
|
1188
|
+
</tr>
|
|
1189
|
+
|
|
1190
|
+
<tr>
|
|
1191
|
+
<td rowspan="1" colSpan="1" >VideoDisplayMode.FILL</td>
|
|
1192
|
+
|
|
1193
|
+
<td rowspan="1" colSpan="1" >- 保证视窗被填满的同时保证视频内容全部显示,但是不保证视频尺寸比例不变。<br>- 视频的宽高会被拉伸至和视窗尺寸一致。</td>
|
|
1194
|
+
</tr>
|
|
1195
|
+
</table>
|
|
1196
|
+
|
|
1197
|
+
|
|
1198
|
+
### videoResolution
|
|
1199
|
+
|
|
1200
|
+
分辨率 `videoResolution` 有三个值:
|
|
1201
|
+
- `VideoResolution.RESOLUTION_480P`
|
|
1202
|
+
|
|
1203
|
+
- `VideoResolution.RESOLUTION_720P`
|
|
1204
|
+
|
|
1205
|
+
- `VideoResolution.RESOLUTION_1080P`,默认值是`VideoResolution.RESOLUTION_480P`。
|
|
1206
|
+
|
|
1207
|
+
|
|
1208
|
+
**分辨率说明:**
|
|
1209
|
+
|
|
1210
|
+
<table>
|
|
1211
|
+
<tr>
|
|
1212
|
+
<td rowspan="1" colSpan="1" >视频 Profile</td>
|
|
1213
|
+
|
|
1214
|
+
<td rowspan="1" colSpan="1" >分辨率(宽 × 高)</td>
|
|
1215
|
+
|
|
1216
|
+
<td rowspan="1" colSpan="1" >帧率(fps)</td>
|
|
1217
|
+
|
|
1218
|
+
<td rowspan="1" colSpan="1" >码率(kbps)</td>
|
|
1219
|
+
</tr>
|
|
1220
|
+
|
|
1221
|
+
<tr>
|
|
1222
|
+
<td rowspan="1" colSpan="1" >480p</td>
|
|
1223
|
+
|
|
1224
|
+
<td rowspan="1" colSpan="1" >640 × 480</td>
|
|
1225
|
+
|
|
1226
|
+
<td rowspan="1" colSpan="1" >15</td>
|
|
1227
|
+
|
|
1228
|
+
<td rowspan="1" colSpan="1" >900</td>
|
|
1229
|
+
</tr>
|
|
1230
|
+
|
|
1231
|
+
<tr>
|
|
1232
|
+
<td rowspan="1" colSpan="1" >720p</td>
|
|
1233
|
+
|
|
1234
|
+
<td rowspan="1" colSpan="1" >1280 × 720</td>
|
|
1235
|
+
|
|
1236
|
+
<td rowspan="1" colSpan="1" >15</td>
|
|
1237
|
+
|
|
1238
|
+
<td rowspan="1" colSpan="1" >1500</td>
|
|
1239
|
+
</tr>
|
|
1240
|
+
|
|
1241
|
+
<tr>
|
|
1242
|
+
<td rowspan="1" colSpan="1" >1080p</td>
|
|
1243
|
+
|
|
1244
|
+
<td rowspan="1" colSpan="1" >1920 × 1080</td>
|
|
1245
|
+
|
|
1246
|
+
<td rowspan="1" colSpan="1" >15</td>
|
|
1247
|
+
|
|
1248
|
+
<td rowspan="1" colSpan="1" >2000</td>
|
|
1249
|
+
</tr>
|
|
1250
|
+
</table>
|
|
1251
|
+
|
|
1252
|
+
|
|
1253
|
+
**常见问题:**
|
|
1254
|
+
|
|
1255
|
+
- iOS 13&14不支持编码高于 720P 的视频,建议在这两个系统版本限制最高采集 720P。参见 [iOS Safari 已知问题 case 12](https://web.sdk.qcloud.com/trtc/webrtc/doc/zh-cn/tutorial-02-info-webrtc-issues.html#h2-4)。
|
|
1256
|
+
|
|
1257
|
+
- Firefox 不支持自定义视频帧率(默认为 30fps)。
|
|
1258
|
+
|
|
1259
|
+
- 受系统性能占用,摄像头采集能力和浏览器限制等因素的影响,视频分辨率、帧率、码率的实际值不一定能够完全匹配设定值,在这种情况下,浏览器会自动调整 Profile 尽可能匹配设定值。
|
|
1260
|
+
|
|
1261
|
+
|
|
1262
|
+
### STATUS
|
|
1263
|
+
<table>
|
|
1264
|
+
<tr>
|
|
1265
|
+
<td rowspan="1" colSpan="1" >属性值</td>
|
|
1266
|
+
|
|
1267
|
+
<td rowspan="1" colSpan="1" >描述</td>
|
|
1268
|
+
</tr>
|
|
1269
|
+
|
|
1270
|
+
<tr>
|
|
1271
|
+
<td rowspan="1" colSpan="1" >STATUS.IDLE</td>
|
|
1272
|
+
|
|
1273
|
+
<td rowspan="1" colSpan="1" >闲置状态</td>
|
|
1274
|
+
</tr>
|
|
1275
|
+
|
|
1276
|
+
<tr>
|
|
1277
|
+
<td rowspan="1" colSpan="1" >STATUS.BE_INVITED</td>
|
|
1278
|
+
|
|
1279
|
+
<td rowspan="1" colSpan="1" >收到通话邀请</td>
|
|
1280
|
+
</tr>
|
|
1281
|
+
|
|
1282
|
+
<tr>
|
|
1283
|
+
<td rowspan="1" colSpan="1" >STATUS.DIALING_C2C</td>
|
|
1284
|
+
|
|
1285
|
+
<td rowspan="1" colSpan="1" >正在 1v1 呼叫</td>
|
|
1286
|
+
</tr>
|
|
1287
|
+
|
|
1288
|
+
<tr>
|
|
1289
|
+
<td rowspan="1" colSpan="1" >STATUS.DIALING_GROUP</td>
|
|
1290
|
+
|
|
1291
|
+
<td rowspan="1" colSpan="1" >正在群组呼叫</td>
|
|
1292
|
+
</tr>
|
|
1293
|
+
|
|
1294
|
+
<tr>
|
|
1295
|
+
<td rowspan="1" colSpan="1" >STATUS.CALLING_C2C_AUDIO</td>
|
|
1296
|
+
|
|
1297
|
+
<td rowspan="1" colSpan="1" >正在 1v1 语音通话</td>
|
|
1298
|
+
</tr>
|
|
1299
|
+
|
|
1300
|
+
<tr>
|
|
1301
|
+
<td rowspan="1" colSpan="1" >STATUS.CALLING_C2C_VIDEO</td>
|
|
1302
|
+
|
|
1303
|
+
<td rowspan="1" colSpan="1" >正在 1v1 视频通话</td>
|
|
1304
|
+
</tr>
|
|
1305
|
+
|
|
1306
|
+
<tr>
|
|
1307
|
+
<td rowspan="1" colSpan="1" >STATUS.CALLING_GROUP_AUDIO</td>
|
|
1308
|
+
|
|
1309
|
+
<td rowspan="1" colSpan="1" >正在群组语音通话</td>
|
|
1310
|
+
</tr>
|
|
1311
|
+
|
|
1312
|
+
<tr>
|
|
1313
|
+
<td rowspan="1" colSpan="1" >STATUS.CALLING_GROUP_VIDEO</td>
|
|
1314
|
+
|
|
1315
|
+
<td rowspan="1" colSpan="1" >正在群组视频通话</td>
|
|
1316
|
+
</tr>
|
|
1317
|
+
</table>
|
|
1318
|
+
|
|
1319
|
+
|
|
1320
|
+
### **TUICallType**
|
|
1321
|
+
<table>
|
|
1322
|
+
<tr>
|
|
1323
|
+
<td rowspan="1" colSpan="1" >TUICallType 类型</td>
|
|
1324
|
+
|
|
1325
|
+
<td rowspan="1" colSpan="1" >描述</td>
|
|
1326
|
+
</tr>
|
|
1327
|
+
|
|
1328
|
+
<tr>
|
|
1329
|
+
<td rowspan="1" colSpan="1" >TUICallType.AUDIO_CALL </td>
|
|
1330
|
+
|
|
1331
|
+
<td rowspan="1" colSpan="1" >语音通话</td>
|
|
1332
|
+
</tr>
|
|
1333
|
+
|
|
1334
|
+
<tr>
|
|
1335
|
+
<td rowspan="1" colSpan="1" >TUICallType.VIDEO_CALL </td>
|
|
1336
|
+
|
|
1337
|
+
<td rowspan="1" colSpan="1" >视频通话</td>
|
|
1338
|
+
</tr>
|
|
1339
|
+
</table>
|
|
1340
|
+
|
|
1341
|
+
|
|
1342
|
+
### **offlinePushInfo**
|
|
1343
|
+
<table>
|
|
1344
|
+
<tr>
|
|
1345
|
+
<td rowspan="1" colSpan="1" >参数</td>
|
|
1346
|
+
|
|
1347
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
1348
|
+
|
|
1349
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
1350
|
+
|
|
1351
|
+
<td rowspan="1" colSpan="1" >含义</td>
|
|
1352
|
+
</tr>
|
|
1353
|
+
|
|
1354
|
+
<tr>
|
|
1355
|
+
<td rowspan="1" colSpan="1" >offlinePushInfo.title</td>
|
|
1356
|
+
|
|
1357
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
1358
|
+
|
|
1359
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1360
|
+
|
|
1361
|
+
<td rowspan="1" colSpan="1" >离线推送标题(选填)</td>
|
|
1362
|
+
</tr>
|
|
1363
|
+
|
|
1364
|
+
<tr>
|
|
1365
|
+
<td rowspan="1" colSpan="1" >offlinePushInfo.description</td>
|
|
1366
|
+
|
|
1367
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
1368
|
+
|
|
1369
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1370
|
+
|
|
1371
|
+
<td rowspan="1" colSpan="1" >离线推送内容(选填)</td>
|
|
1372
|
+
</tr>
|
|
1373
|
+
|
|
1374
|
+
<tr>
|
|
1375
|
+
<td rowspan="1" colSpan="1" >offlinePushInfo.androidOPPOChannelID</td>
|
|
1376
|
+
|
|
1377
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
1378
|
+
|
|
1379
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1380
|
+
|
|
1381
|
+
<td rowspan="1" colSpan="1" >离线推送设置 OPPO 手机 8.0 系统及以上的渠道 ID(选填)</td>
|
|
1382
|
+
</tr>
|
|
1383
|
+
|
|
1384
|
+
<tr>
|
|
1385
|
+
<td rowspan="1" colSpan="1" >offlinePushInfo.extension</td>
|
|
1386
|
+
|
|
1387
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
1388
|
+
|
|
1389
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1390
|
+
|
|
1391
|
+
<td rowspan="1" colSpan="1" >离线推送透传内容,可以用于设置 Android [Notification 模式](https://cloud.tencent.com/document/product/647/81015#Android Notification) 和 [VoIP 模式](https://cloud.tencent.com/document/product/647/81015#Android VoIP)。**默认:**Notification 模式,会是系统的通知;VoIP 模式是需要传字段。</td>
|
|
1392
|
+
</tr>
|
|
1393
|
+
|
|
1394
|
+
<tr>
|
|
1395
|
+
<td rowspan="1" colSpan="1" >offlinePushInfo.ignoreIOSBadge</td>
|
|
1396
|
+
|
|
1397
|
+
<td rowspan="1" colSpan="1" >Boolean</td>
|
|
1398
|
+
|
|
1399
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1400
|
+
|
|
1401
|
+
<td rowspan="1" colSpan="1" >离线推送忽略 badge 计数(仅对 iOS 生效), 如果设置为 true,在 iOS 接收端,这条消息不会使 APP 的应用图标未读计数增加<br>**v3.3.0+ 支持**</td>
|
|
1402
|
+
</tr>
|
|
1403
|
+
|
|
1404
|
+
<tr>
|
|
1405
|
+
<td rowspan="1" colSpan="1" >offlinePushInfo.iOSSound</td>
|
|
1406
|
+
|
|
1407
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
1408
|
+
|
|
1409
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1410
|
+
|
|
1411
|
+
<td rowspan="1" colSpan="1" >离线推送声音设置(仅对 iOS 生效)。**v3.3.0+ 支持**</td>
|
|
1412
|
+
</tr>
|
|
1413
|
+
|
|
1414
|
+
<tr>
|
|
1415
|
+
<td rowspan="1" colSpan="1" >offlinePushInfo.androidSound</td>
|
|
1416
|
+
|
|
1417
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
1418
|
+
|
|
1419
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1420
|
+
|
|
1421
|
+
<td rowspan="1" colSpan="1" >离线推送声音设置(仅对 Android 生效)。**v3.3.0+ 支持**</td>
|
|
1422
|
+
</tr>
|
|
1423
|
+
|
|
1424
|
+
<tr>
|
|
1425
|
+
<td rowspan="1" colSpan="1" >offlinePushInfo.androidVIVOClassification</td>
|
|
1426
|
+
|
|
1427
|
+
<td rowspan="1" colSpan="1" >Number</td>
|
|
1428
|
+
|
|
1429
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1430
|
+
|
|
1431
|
+
<td rowspan="1" colSpan="1" >VIVO 推送消息分类。**v3.3.0+ 支持**</td>
|
|
1432
|
+
</tr>
|
|
1433
|
+
|
|
1434
|
+
<tr>
|
|
1435
|
+
<td rowspan="1" colSpan="1" >offlinePushInfo.androidXiaoMiChannelID</td>
|
|
1436
|
+
|
|
1437
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
1438
|
+
|
|
1439
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1440
|
+
|
|
1441
|
+
<td rowspan="1" colSpan="1" >小米手机 8.0 系统及以上的渠道 ID。**v3.3.0+ 支持**</td>
|
|
1442
|
+
</tr>
|
|
1443
|
+
|
|
1444
|
+
<tr>
|
|
1445
|
+
<td rowspan="1" colSpan="1" >offlinePushInfo.androidFCMChannelID</td>
|
|
1446
|
+
|
|
1447
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
1448
|
+
|
|
1449
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1450
|
+
|
|
1451
|
+
<td rowspan="1" colSpan="1" >FCM 通道手机 8.0 系统及以上的渠道 ID。**v3.3.0+ 支持**</td>
|
|
1452
|
+
</tr>
|
|
1453
|
+
|
|
1454
|
+
<tr>
|
|
1455
|
+
<td rowspan="1" colSpan="1" >offlinePushInfo.androidHuaWeiCategory</td>
|
|
1456
|
+
|
|
1457
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
1458
|
+
|
|
1459
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1460
|
+
|
|
1461
|
+
<td rowspan="1" colSpan="1" >华为推送消息分类。**v3.3.0+ 支持**</td>
|
|
1462
|
+
</tr>
|
|
1463
|
+
|
|
1464
|
+
<tr>
|
|
1465
|
+
<td rowspan="1" colSpan="1" >offlinePushInfo.isDisablePush</td>
|
|
1466
|
+
|
|
1467
|
+
<td rowspan="1" colSpan="1" >Boolean</td>
|
|
1468
|
+
|
|
1469
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1470
|
+
|
|
1471
|
+
<td rowspan="1" colSpan="1" >是否关闭推送(默认开启推送)。**v3.3.0+ 支持**</td>
|
|
1472
|
+
</tr>
|
|
1473
|
+
|
|
1474
|
+
<tr>
|
|
1475
|
+
<td rowspan="1" colSpan="1" >offlinePushInfo.iOSPushType</td>
|
|
1476
|
+
|
|
1477
|
+
<td rowspan="1" colSpan="1" >Number</td>
|
|
1478
|
+
|
|
1479
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1480
|
+
|
|
1481
|
+
<td rowspan="1" colSpan="1" >iOS 离线推送类型。0-普通推送;1-VoIP推送。默认:0。**v3.3.0+ 支持**</td>
|
|
1482
|
+
</tr>
|
|
1483
|
+
</table>
|
|
1484
|
+
|
|
1485
|
+
|
|
1486
|
+
#### Android Notification 模式
|
|
1487
|
+
``` javascript
|
|
1488
|
+
const extension = {
|
|
1489
|
+
timPushFeatures: {
|
|
1490
|
+
fcmPushType: 0, // 0, VoIP; 1, notification
|
|
1491
|
+
}
|
|
1492
|
+
};
|
|
1493
|
+
offlinePushInfo.extension = JSON.stringify(extension);
|
|
1494
|
+
```
|
|
1495
|
+
|
|
1496
|
+
#### Android VoIP 模式
|
|
1497
|
+
``` javascript
|
|
1498
|
+
const extension = {
|
|
1499
|
+
timPushFeatures: {
|
|
1500
|
+
fcmPushType: 0, // 0, data; 1, notification
|
|
1501
|
+
fcmNotificationType: 1, // 0, TIMPush implementation; 1, business implementation after transparent transmission
|
|
1502
|
+
}
|
|
1503
|
+
};
|
|
1504
|
+
offlinePushInfo.extension = JSON.stringify(extension);
|
|
1505
|
+
```
|
|
1506
|
+
|
|
1507
|
+
### FeatureButton
|
|
1508
|
+
<table>
|
|
1509
|
+
<tr>
|
|
1510
|
+
<td rowspan="1" colSpan="1" >FeatureButton 类型</td>
|
|
1511
|
+
|
|
1512
|
+
<td rowspan="1" colSpan="1" >描述</td>
|
|
1513
|
+
</tr>
|
|
1514
|
+
|
|
1515
|
+
<tr>
|
|
1516
|
+
<td rowspan="1" colSpan="1" >FeatureButton.Camera</td>
|
|
1517
|
+
|
|
1518
|
+
<td rowspan="1" colSpan="1" >摄像头按钮</td>
|
|
1519
|
+
</tr>
|
|
1520
|
+
|
|
1521
|
+
<tr>
|
|
1522
|
+
<td rowspan="1" colSpan="1" >FeatureButton.Microphone</td>
|
|
1523
|
+
|
|
1524
|
+
<td rowspan="1" colSpan="1" >麦克风按钮</td>
|
|
1525
|
+
</tr>
|
|
1526
|
+
|
|
1527
|
+
<tr>
|
|
1528
|
+
<td rowspan="1" colSpan="1" >FeatureButton.SwitchCamera</td>
|
|
1529
|
+
|
|
1530
|
+
<td rowspan="1" colSpan="1" >切换前后置摄像头按钮</td>
|
|
1531
|
+
</tr>
|
|
1532
|
+
|
|
1533
|
+
<tr>
|
|
1534
|
+
<td rowspan="1" colSpan="1" >FeatureButton.InviteUser</td>
|
|
1535
|
+
|
|
1536
|
+
<td rowspan="1" colSpan="1" >邀请他人按钮</td>
|
|
1537
|
+
</tr>
|
|
1538
|
+
</table>
|
|
1539
|
+
|
|
1540
|
+
|
|
1541
|
+
### LayoutMode
|
|
1542
|
+
<table>
|
|
1543
|
+
<tr>
|
|
1544
|
+
<td rowspan="1" colSpan="1" >LayoutMode 类型</td>
|
|
1545
|
+
|
|
1546
|
+
<td rowspan="1" colSpan="1" >描述</td>
|
|
1547
|
+
</tr>
|
|
1548
|
+
|
|
1549
|
+
<tr>
|
|
1550
|
+
<td rowspan="1" colSpan="1" >LayoutMode.LocalInLargeView</td>
|
|
1551
|
+
|
|
1552
|
+
<td rowspan="1" colSpan="1" >本地用户在大窗显示</td>
|
|
1553
|
+
</tr>
|
|
1554
|
+
|
|
1555
|
+
<tr>
|
|
1556
|
+
<td rowspan="1" colSpan="1" >LayoutMode.RemoteInLargeView</td>
|
|
1557
|
+
|
|
1558
|
+
<td rowspan="1" colSpan="1" >远端用户在大窗显示</td>
|
|
1559
|
+
</tr>
|
|
1560
|
+
</table>
|
|
1561
|
+
|
|
1562
|
+
|
|
1563
|
+
# 废弃接口
|
|
1564
|
+
|
|
1565
|
+
### <TUICallKitMini/>
|
|
1566
|
+
|
|
1567
|
+
`<TUICallKitMini/>`:TUICallKit UI 通话悬浮窗,当`<TUICallKit :allowedMinimized="true"/>`时,`<TUICallKitMini/>`必须被放置在页面中。
|
|
1568
|
+
|
|
1569
|
+
> **说明:**
|
|
1570
|
+
>
|
|
1571
|
+
> - `<TUICallKitMini/>`UI 通话悬浮窗,**≥ v2.3.2 废弃,不再提供该组件**。
|
|
1572
|
+
> - 由`<TUICallKit/>` UI 通话组件主体,实现悬浮窗样式,减少使用复杂度。
|
|
1573
|
+
|
|
1574
|
+
<table>
|
|
1575
|
+
<tr>
|
|
1576
|
+
<td rowspan="1" colSpan="1" >属性</td>
|
|
1577
|
+
|
|
1578
|
+
<td rowspan="1" colSpan="1" >描述</td>
|
|
1579
|
+
|
|
1580
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
1581
|
+
|
|
1582
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
1583
|
+
|
|
1584
|
+
<td rowspan="1" colSpan="1" >默认值</td>
|
|
1585
|
+
|
|
1586
|
+
<td rowspan="1" colSpan="1" >支持 vue</td>
|
|
1587
|
+
|
|
1588
|
+
<td rowspan="1" colSpan="1" >支持 react</td>
|
|
1589
|
+
</tr>
|
|
1590
|
+
|
|
1591
|
+
<tr>
|
|
1592
|
+
<td rowspan="1" colSpan="1" ><br>@kicked-out</td>
|
|
1593
|
+
|
|
1594
|
+
<td rowspan="1" colSpan="1" >**注意:**<br>**≥ v2.3.2 废弃**<br><br>组件抛出的事件,当前登录用户被踢出登录时会触发该事件,通话也会自动结束</td>
|
|
1595
|
+
|
|
1596
|
+
<td rowspan="1" colSpan="1" >function()</td>
|
|
1597
|
+
|
|
1598
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1599
|
+
|
|
1600
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
1601
|
+
|
|
1602
|
+
<td rowspan="1" colSpan="1" >√</td>
|
|
1603
|
+
|
|
1604
|
+
<td rowspan="1" colSpan="1" >×</td>
|
|
1605
|
+
</tr>
|
|
1606
|
+
|
|
1607
|
+
<tr>
|
|
1608
|
+
<td rowspan="1" colSpan="1" ><br>@status-changed</td>
|
|
1609
|
+
|
|
1610
|
+
<td rowspan="1" colSpan="1" >**注意:**<br>**≥ v2.3.2 废弃**<br><br>组件抛出的事件,当通话状态发生变化时,会触发该事件,通话状态种类详见,[STATUS 值说明](https://cloud.tencent.com/document/product/647/81015#STATUS)</td>
|
|
1611
|
+
|
|
1612
|
+
<td rowspan="1" colSpan="1" >function({oldStatus, newStatus})</td>
|
|
1613
|
+
|
|
1614
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1615
|
+
|
|
1616
|
+
<td rowspan="1" colSpan="1" >-</td>
|
|
1617
|
+
|
|
1618
|
+
<td rowspan="1" colSpan="1" >√</td>
|
|
1619
|
+
|
|
1620
|
+
<td rowspan="1" colSpan="1" >×</td>
|
|
1621
|
+
</tr>
|
|
1622
|
+
</table>
|
|
1623
|
+
|
|
1624
|
+
|
|
1625
|
+
### call
|
|
1626
|
+
|
|
1627
|
+
|
|
1628
|
+
|
|
1629
|
+
拨打 1v1 通话,**建议使用 calls 接口。**
|
|
1630
|
+
``` javascript
|
|
1631
|
+
import { TUICallKitServer, TUICallType } from '@tencentcloud/call-uikit-react';
|
|
1632
|
+
try {
|
|
1633
|
+
await TUICallKitServer.call({
|
|
1634
|
+
userID: 'mike', // username being called
|
|
1635
|
+
type: TUICallType.VIDEO_CALL,
|
|
1636
|
+
});
|
|
1637
|
+
} catch (error: any) {
|
|
1638
|
+
console.error(`[TUICallKit] Call failed. Reason: ${error}`);
|
|
1639
|
+
}
|
|
1640
|
+
```
|
|
1641
|
+
|
|
1642
|
+
参数如下表所示:
|
|
1643
|
+
<table>
|
|
1644
|
+
<tr>
|
|
1645
|
+
<td rowspan="1" colSpan="1" >参数</td>
|
|
1646
|
+
|
|
1647
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
1648
|
+
|
|
1649
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
1650
|
+
|
|
1651
|
+
<td rowspan="1" colSpan="1" >含义</td>
|
|
1652
|
+
</tr>
|
|
1653
|
+
|
|
1654
|
+
<tr>
|
|
1655
|
+
<td rowspan="1" colSpan="1" >userID</td>
|
|
1656
|
+
|
|
1657
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
1658
|
+
|
|
1659
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
1660
|
+
|
|
1661
|
+
<td rowspan="1" colSpan="1" >被呼叫用户的用户名</td>
|
|
1662
|
+
</tr>
|
|
1663
|
+
|
|
1664
|
+
<tr>
|
|
1665
|
+
<td rowspan="1" colSpan="1" >type</td>
|
|
1666
|
+
|
|
1667
|
+
<td rowspan="1" colSpan="1" >[TUICallType](https://cloud.tencent.com/document/product/647/81015#TUICallType)</td>
|
|
1668
|
+
|
|
1669
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
1670
|
+
|
|
1671
|
+
<td rowspan="1" colSpan="1" >通话的媒体类型,参数值说明参见 [TUICallType 通话类型](https://write.woa.com/document/90294110881382400)<br>兼容旧版本:语音通话(type = 1)、视频通话(type = 2)</td>
|
|
1672
|
+
</tr>
|
|
1673
|
+
|
|
1674
|
+
<tr>
|
|
1675
|
+
<td rowspan="1" colSpan="1" >roomID</td>
|
|
1676
|
+
|
|
1677
|
+
<td rowspan="1" colSpan="1" >Number</td>
|
|
1678
|
+
|
|
1679
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1680
|
+
|
|
1681
|
+
<td rowspan="1" colSpan="1" >数字房间号,范围 [1, 2147483647]</td>
|
|
1682
|
+
</tr>
|
|
1683
|
+
|
|
1684
|
+
<tr>
|
|
1685
|
+
<td rowspan="1" colSpan="1" >strRoomID</td>
|
|
1686
|
+
|
|
1687
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
1688
|
+
|
|
1689
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1690
|
+
|
|
1691
|
+
<td rowspan="1" colSpan="1" >字符串房间号。**v3.3.1+ 支持**<br>1. roomID 与 strRoomID 是互斥的,若您选用 strRoomID,则 roomID 需要填写为 0。若两者都填,SDK 将优先选用 roomID。<br>2. 不要混用 roomID 和 strRoomID,因为它们之间是不互通的,例如数字 123 和字符串 "123" 是两个完全不同的房间。</td>
|
|
1692
|
+
</tr>
|
|
1693
|
+
|
|
1694
|
+
<tr>
|
|
1695
|
+
<td rowspan="1" colSpan="1" >timeout</td>
|
|
1696
|
+
|
|
1697
|
+
<td rowspan="1" colSpan="1" >Number</td>
|
|
1698
|
+
|
|
1699
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1700
|
+
|
|
1701
|
+
<td rowspan="1" colSpan="1" >通话超时时间,默认:30s,单位:秒。timeout = 0,设置为不超时</td>
|
|
1702
|
+
</tr>
|
|
1703
|
+
|
|
1704
|
+
<tr>
|
|
1705
|
+
<td rowspan="1" colSpan="1" >userData</td>
|
|
1706
|
+
|
|
1707
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
1708
|
+
|
|
1709
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1710
|
+
|
|
1711
|
+
<td rowspan="1" colSpan="1" >发起通话时自定义扩展字段,被呼叫用户在 [ON_CALL_RECEIVED](https://write.woa.com/document/86735802757361664) 事件中有该参数</td>
|
|
1712
|
+
</tr>
|
|
1713
|
+
|
|
1714
|
+
<tr>
|
|
1715
|
+
<td rowspan="1" colSpan="1" >[offlinePushInfo](https://cloud.tencent.com/document/product/647/81015#offlinePushInfo)</td>
|
|
1716
|
+
|
|
1717
|
+
<td rowspan="1" colSpan="1" >Object</td>
|
|
1718
|
+
|
|
1719
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1720
|
+
|
|
1721
|
+
<td rowspan="1" colSpan="1" >自定义离线消息推送参数</td>
|
|
1722
|
+
</tr>
|
|
1723
|
+
</table>
|
|
1724
|
+
|
|
1725
|
+
|
|
1726
|
+
### groupCall
|
|
1727
|
+
|
|
1728
|
+
|
|
1729
|
+
|
|
1730
|
+
发起群组通话,**建议使用 calls 接口。**
|
|
1731
|
+
``` javascript
|
|
1732
|
+
try {
|
|
1733
|
+
await TUICallKitServer.groupCall({
|
|
1734
|
+
userIDList: ['jack', 'tom'],
|
|
1735
|
+
groupID: "xxx",
|
|
1736
|
+
type: TUICallType.VIDEO_CALL
|
|
1737
|
+
});
|
|
1738
|
+
} catch (error: any) {
|
|
1739
|
+
console.error(`[TUICallKit] Failed to call the groupCall API. Reason:${error}`);
|
|
1740
|
+
}
|
|
1741
|
+
```
|
|
1742
|
+
|
|
1743
|
+
参数如下表所示:
|
|
1744
|
+
<table>
|
|
1745
|
+
<tr>
|
|
1746
|
+
<td rowspan="1" colSpan="1" >参数</td>
|
|
1747
|
+
|
|
1748
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
1749
|
+
|
|
1750
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
1751
|
+
|
|
1752
|
+
<td rowspan="1" colSpan="1" >含义</td>
|
|
1753
|
+
</tr>
|
|
1754
|
+
|
|
1755
|
+
<tr>
|
|
1756
|
+
<td rowspan="1" colSpan="1" >userIDList</td>
|
|
1757
|
+
|
|
1758
|
+
<td rowspan="1" colSpan="1" >Array<String></td>
|
|
1759
|
+
|
|
1760
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
1761
|
+
|
|
1762
|
+
<td rowspan="1" colSpan="1" >被呼叫的用户列表</td>
|
|
1763
|
+
</tr>
|
|
1764
|
+
|
|
1765
|
+
<tr>
|
|
1766
|
+
<td rowspan="1" colSpan="1" >type</td>
|
|
1767
|
+
|
|
1768
|
+
<td rowspan="1" colSpan="1" >[TUICallType](https://write.woa.com/document/90294110881382400)</td>
|
|
1769
|
+
|
|
1770
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
1771
|
+
|
|
1772
|
+
<td rowspan="1" colSpan="1" >通话的媒体类型,参数值说明参见 [TUICallType 通话类型](https://write.woa.com/document/90294110881382400)<br>兼容旧版本:语音通话(type = 1)、视频通话(type = 2)</td>
|
|
1773
|
+
</tr>
|
|
1774
|
+
|
|
1775
|
+
<tr>
|
|
1776
|
+
<td rowspan="1" colSpan="1" >groupID</td>
|
|
1777
|
+
|
|
1778
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
1779
|
+
|
|
1780
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
1781
|
+
|
|
1782
|
+
<td rowspan="1" colSpan="1" >通话群组 ID,groupID 的创建可参见 [chat-createGroup API](https://web.sdk.qcloud.com/im/doc/v3/zh-cn/SDK.html#createGroup)</td>
|
|
1783
|
+
</tr>
|
|
1784
|
+
|
|
1785
|
+
<tr>
|
|
1786
|
+
<td rowspan="1" colSpan="1" >roomID</td>
|
|
1787
|
+
|
|
1788
|
+
<td rowspan="1" colSpan="1" >Number</td>
|
|
1789
|
+
|
|
1790
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1791
|
+
|
|
1792
|
+
<td rowspan="1" colSpan="1" >数字房间号,范围 [1, 2147483647]</td>
|
|
1793
|
+
</tr>
|
|
1794
|
+
|
|
1795
|
+
<tr>
|
|
1796
|
+
<td rowspan="1" colSpan="1" >strRoomID</td>
|
|
1797
|
+
|
|
1798
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
1799
|
+
|
|
1800
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1801
|
+
|
|
1802
|
+
<td rowspan="1" colSpan="1" >字符串房间号。**v3.3.1+ 支持**<br>1. roomID 与 strRoomID 是互斥的,若您选用 strRoomID,则 roomID 需要填写为 0。若两者都填,SDK 将优先选用 roomID。<br>2. 不要混用 roomID 和 strRoomID,因为它们之间是不互通的,例如数字 123 和字符串 "123" 是两个完全不同的房间。</td>
|
|
1803
|
+
</tr>
|
|
1804
|
+
|
|
1805
|
+
<tr>
|
|
1806
|
+
<td rowspan="1" colSpan="1" >timeout</td>
|
|
1807
|
+
|
|
1808
|
+
<td rowspan="1" colSpan="1" >Number</td>
|
|
1809
|
+
|
|
1810
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1811
|
+
|
|
1812
|
+
<td rowspan="1" colSpan="1" >通话超时时间,默认:30s,单位:秒。timeout = 0,设置为不超时</td>
|
|
1813
|
+
</tr>
|
|
1814
|
+
|
|
1815
|
+
<tr>
|
|
1816
|
+
<td rowspan="1" colSpan="1" >userData</td>
|
|
1817
|
+
|
|
1818
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
1819
|
+
|
|
1820
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1821
|
+
|
|
1822
|
+
<td rowspan="1" colSpan="1" >发起通话时自定义扩展字段,被呼叫用户在 [ON_CALL_RECEIVED](https://write.woa.com/document/86735802757361664) 事件中有该参数</td>
|
|
1823
|
+
</tr>
|
|
1824
|
+
|
|
1825
|
+
<tr>
|
|
1826
|
+
<td rowspan="1" colSpan="1" >[offlinePushInfo](https://cloud.tencent.com/document/product/647/81015#offlinePushInfo)</td>
|
|
1827
|
+
|
|
1828
|
+
<td rowspan="1" colSpan="1" >Object</td>
|
|
1829
|
+
|
|
1830
|
+
<td rowspan="1" colSpan="1" >否</td>
|
|
1831
|
+
|
|
1832
|
+
<td rowspan="1" colSpan="1" >自定义离线消息推送参数</td>
|
|
1833
|
+
</tr>
|
|
1834
|
+
</table>
|
|
1835
|
+
|
|
1836
|
+
|
|
1837
|
+
### joinInGroupCall
|
|
1838
|
+
|
|
1839
|
+
|
|
1840
|
+
|
|
1841
|
+
加入群组中已有的音视频通话,**建议使用 join 接口。**
|
|
1842
|
+
|
|
1843
|
+
> **注意:**
|
|
1844
|
+
>
|
|
1845
|
+
|
|
1846
|
+
> **v3.1.2+ 支持。**
|
|
1847
|
+
>
|
|
1848
|
+
|
|
1849
|
+
|
|
1850
|
+
> **说明:**
|
|
1851
|
+
>
|
|
1852
|
+
> - 加入群组中已有的音视频通话前,需要提前创建或加入IM 群组,并且群组中已有用户在通话中,如果已经创建,请忽略。
|
|
1853
|
+
> - 群组的创建详见: [IM 群组管理](https://cloud.tencent.com/document/product/269/75395#.E5.88.9B.E5.BB.BA.E7.BE.A4.E7.BB.84) ,或者您也可以直接使用 [IM TUIKit](https://cloud.tencent.com/document/product/269/68493),一站式集成聊天、通话等场景。
|
|
1854
|
+
|
|
1855
|
+
``` javascript
|
|
1856
|
+
try {
|
|
1857
|
+
const params = {
|
|
1858
|
+
type: TUICallType.VIDEO_CALL,
|
|
1859
|
+
groupID: "xxx",
|
|
1860
|
+
roomID: 0,
|
|
1861
|
+
};
|
|
1862
|
+
await TUICallKitServer.joinInGroupCall(params);
|
|
1863
|
+
} catch (error: any) {
|
|
1864
|
+
console.error(`[TUICallKit] Failed to call the enableMuteMode API. Reason: ${error}`);
|
|
1865
|
+
}
|
|
1866
|
+
```
|
|
1867
|
+
|
|
1868
|
+
参数列表:
|
|
1869
|
+
<table>
|
|
1870
|
+
<tr>
|
|
1871
|
+
<td rowspan="1" colSpan="1" >参数</td>
|
|
1872
|
+
|
|
1873
|
+
<td rowspan="1" colSpan="1" >类型</td>
|
|
1874
|
+
|
|
1875
|
+
<td rowspan="1" colSpan="1" >是否必填</td>
|
|
1876
|
+
|
|
1877
|
+
<td rowspan="1" colSpan="1" >含义</td>
|
|
1878
|
+
</tr>
|
|
1879
|
+
|
|
1880
|
+
<tr>
|
|
1881
|
+
<td rowspan="1" colSpan="1" >type</td>
|
|
1882
|
+
|
|
1883
|
+
<td rowspan="1" colSpan="1" >[TUICallType](https://cloud.tencent.com/document/product/647/81015#TUICallType)</td>
|
|
1884
|
+
|
|
1885
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
1886
|
+
|
|
1887
|
+
<td rowspan="1" colSpan="1" >通话的媒体类型,例如视频通话、语音通话</td>
|
|
1888
|
+
</tr>
|
|
1889
|
+
|
|
1890
|
+
<tr>
|
|
1891
|
+
<td rowspan="1" colSpan="1" >groupID</td>
|
|
1892
|
+
|
|
1893
|
+
<td rowspan="1" colSpan="1" >String</td>
|
|
1894
|
+
|
|
1895
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
1896
|
+
|
|
1897
|
+
<td rowspan="1" colSpan="1" >此次群组通话的群 ID</td>
|
|
1898
|
+
</tr>
|
|
1899
|
+
|
|
1900
|
+
<tr>
|
|
1901
|
+
<td rowspan="1" colSpan="1" >roomID</td>
|
|
1902
|
+
|
|
1903
|
+
<td rowspan="1" colSpan="1" >number</td>
|
|
1904
|
+
|
|
1905
|
+
<td rowspan="1" colSpan="1" >是</td>
|
|
1906
|
+
|
|
1907
|
+
<td rowspan="1" colSpan="1" >此次通话的音视频房间 ID</td>
|
|
1908
|
+
</tr>
|
|
1909
|
+
</table>
|