@tencent-rtc/mcp 1.7.3 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +13 -13
- package/knowledge/path-meta.js +23 -1
- package/package.json +1 -1
- package/resource/index/manifest.json +1 -1
- package/resource/knowledge/callkit/best-practice/android/video-chat-dating.md +497 -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/miniprogram/call-engine.md +386 -0
- package/resource/knowledge/callkit/core-sdk/miniprogram/call-event.md +315 -0
- package/resource/knowledge/callkit/faq/uniapp-miniprogram.md +204 -0
- package/resource/knowledge/callkit/preset/harmonyos/api.md +362 -0
- package/resource/knowledge/callkit/preset/harmonyos/integration.md +318 -0
- package/resource/knowledge/callkit/preset/miniprogram/api-uniapp.md +430 -0
- package/resource/knowledge/callkit/preset/miniprogram/api.md +293 -0
- package/resource/knowledge/callkit/preset/miniprogram/integration.md +294 -0
- package/resource/knowledge/callkit/preset/miniprogram/uniapp-integration.md +224 -0
- package/resource/knowledge/callkit/preset/uni-app/api.md +339 -0
- package/resource/knowledge/callkit/preset/uni-app/integration.md +243 -0
- package/resource/knowledge/chat/preset/react/h5/integration.md +964 -0
- package/resource/knowledge/chat/preset/vue/h5/integration.md +717 -0
- package/resource/knowledge/rtcengine/web/plugin/23-advanced-support-detection.md +6 -6
- package/resource/knowledge/rtcengine/web/plugin/31-advanced-plugins-overview.md +8 -6
- package/resource/knowledge/rtcengine/web/plugin/42-advanced-realtime-transcriber.md +30 -10
- package/server.js +1 -1
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
## API Overview
|
|
2
|
+
|
|
3
|
+
### TUICallKit (with UI)
|
|
4
|
+
|
|
5
|
+
TUICallKit API is the **audio/video calling component that includes a UI interface**. Using this API is like adding a WeChat-like audio/video calling scenario to your app.
|
|
6
|
+
|
|
7
|
+
| API | Description |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| init | Initialize TUICallKit |
|
|
10
|
+
| calls | Initiate 1v1 / group call |
|
|
11
|
+
| joinInGroupCall | Join a group call |
|
|
12
|
+
| setSelfInfo | Set user nickname and avatar |
|
|
13
|
+
| enableFloatWindow | Enable/disable floating window |
|
|
14
|
+
| setLanguage | Set language |
|
|
15
|
+
| destroyed | Destroy TUICallKit |
|
|
16
|
+
|
|
17
|
+
### TUICallEngine (No UI)
|
|
18
|
+
|
|
19
|
+
TUICallEngine API is the underlying engine of the audio/video calling component **without a UI interface**, suitable for custom audio/video calling scenarios.
|
|
20
|
+
|
|
21
|
+
| API | Description |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| createInstance | Create a TUICallEngine instance (static method) |
|
|
24
|
+
| destroyInstance | Destroy a TUICallEngine instance (static method) |
|
|
25
|
+
| on | Register an event listener |
|
|
26
|
+
| off | Unregister an event listener |
|
|
27
|
+
| login | Login |
|
|
28
|
+
| logout | Logout |
|
|
29
|
+
| setSelfInfo | Set user nickname and avatar |
|
|
30
|
+
| calls | Initiate 1v1 / group call |
|
|
31
|
+
| groupCall | Initiate a group call |
|
|
32
|
+
| joinInGroupCall | Join a group call |
|
|
33
|
+
| accept | Accept a call |
|
|
34
|
+
| reject | Reject a call |
|
|
35
|
+
| hangup | Hang up a call |
|
|
36
|
+
| switchCallMediaType | Switch call media type (e.g., voice to video) |
|
|
37
|
+
| setVideoQuality | Set video quality |
|
|
38
|
+
| openCamera | Enable camera |
|
|
39
|
+
| closeCamera | Disable camera |
|
|
40
|
+
| switchCamera | Switch between front/rear camera |
|
|
41
|
+
| openMicrophone | Enable microphone |
|
|
42
|
+
| closeMicrophone | Disable microphone |
|
|
43
|
+
| setMicMute | Set microphone mute state |
|
|
44
|
+
| setVideoRenderView | Set the video rendering view |
|
|
45
|
+
| getTRTCInstance | Get the TRTC instance |
|
|
46
|
+
| getSDKVersion | Get the SDK version |
|
|
47
|
+
|
|
48
|
+
## API Details
|
|
49
|
+
|
|
50
|
+
### TUICallKit API Details
|
|
51
|
+
|
|
52
|
+
#### init
|
|
53
|
+
|
|
54
|
+
Initialize TUICallKit.
|
|
55
|
+
|
|
56
|
+
``` javascript
|
|
57
|
+
TUICallKitAPI.init(params)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Parameter details:
|
|
61
|
+
| Parameter | Type | Required | Default | Description |
|
|
62
|
+
|---------|---------|---------|---------|---------|
|
|
63
|
+
| params | Object | Yes | - | Initialization parameter object |
|
|
64
|
+
| params.sdkAppID | Number | Yes | - | SDKAppID |
|
|
65
|
+
| params.userID | String | Yes | - | User ID |
|
|
66
|
+
| params.userSig | String | Yes | - | UserSig |
|
|
67
|
+
| params.globalCallPagePath | String | Yes | - | Global call page path, used to listen for incoming calls |
|
|
68
|
+
|
|
69
|
+
#### calls
|
|
70
|
+
|
|
71
|
+
Initiate a 1v1 or group call (uni-app packaging).
|
|
72
|
+
|
|
73
|
+
``` javascript
|
|
74
|
+
TUICallKitAPI.calls(params)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Parameter details:
|
|
78
|
+
| Parameter | Type | Required | Default | Description |
|
|
79
|
+
|---------|---------|---------|---------|---------|
|
|
80
|
+
| params | Object | Yes | - | Call parameter object |
|
|
81
|
+
| params.userIDList | Array | Yes | - | List of callee userIDs. For 1v1 calls, pass one userID; for group calls, pass multiple userIDs |
|
|
82
|
+
| params.type | Number | Yes | - | Call media type: 1 for voice, 2 for video |
|
|
83
|
+
| params.groupID | String | No | - | IM group ID. When calling in a group chat, you must pass this field |
|
|
84
|
+
| params.timeout | Number | No | 30 | Timeout in seconds, 0 means no timeout |
|
|
85
|
+
| params.roomID | Number | No | - | Numeric room ID, range [1, 2147483647] |
|
|
86
|
+
| params.strRoomID | String | No | - | String room ID, length up to 64 bytes. roomID and strRoomID are mutually exclusive; if strRoomID is specified, roomID must be 0 |
|
|
87
|
+
| params.offlinePushInfo | Object | No | - | Custom offline push information |
|
|
88
|
+
| params.offlinePushInfo.title | String | No | - | Offline push title |
|
|
89
|
+
| params.offlinePushInfo.description | String | No | - | Offline push description |
|
|
90
|
+
| params.offlinePushInfo.androidOPPOChannelID | String | No | - | OPPO channel ID for offline push |
|
|
91
|
+
| params.offlinePushInfo.extension | String | No | - | Offline push extension field |
|
|
92
|
+
| params.data | String | No | - | Custom data passed to the callee. The callee receives this via the [USER_ON_CALLING event's data field](https://cloud.tencent.com/document/product/647/78759#9cc96dd6-44c9-4f7f-8e1c-dab94c3cbac6) |
|
|
93
|
+
|
|
94
|
+
#### joinInGroupCall
|
|
95
|
+
|
|
96
|
+
Join a group call.
|
|
97
|
+
|
|
98
|
+
``` javascript
|
|
99
|
+
TUICallKitAPI.joinInGroupCall(params)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Parameter details:
|
|
103
|
+
| Parameter | Type | Required | Default | Description |
|
|
104
|
+
|---------|---------|---------|---------|---------|
|
|
105
|
+
| params | Object | Yes | - | Join group call parameters |
|
|
106
|
+
| params.type | Number | Yes | - | Call media type: 1 for voice, 2 for video |
|
|
107
|
+
| params.groupID | String | Yes | - | Group call group ID |
|
|
108
|
+
| params.roomID | Number | Yes | - | Numeric room ID, range [1, 2147483647] |
|
|
109
|
+
|
|
110
|
+
#### setSelfInfo
|
|
111
|
+
|
|
112
|
+
Set user nickname and avatar.
|
|
113
|
+
|
|
114
|
+
``` javascript
|
|
115
|
+
TUICallKitAPI.setSelfInfo(params)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Parameter details:
|
|
119
|
+
| Parameter | Type | Required | Default | Description |
|
|
120
|
+
|---------|---------|---------|---------|---------|
|
|
121
|
+
| params | Object | Yes | - | User info parameters |
|
|
122
|
+
| params.nickName | String | No | - | User nickname |
|
|
123
|
+
| params.avatar | String | No | - | User avatar URL |
|
|
124
|
+
|
|
125
|
+
#### enableFloatWindow
|
|
126
|
+
|
|
127
|
+
Enable/disable the floating window feature. Supported since **v4.2.10+**, only available in video call scenarios.
|
|
128
|
+
|
|
129
|
+
``` javascript
|
|
130
|
+
TUICallKitAPI.enableFloatWindow(enable)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Parameter details:
|
|
134
|
+
| Parameter | Type | Required | Default | Description |
|
|
135
|
+
|---------|---------|---------|---------|---------|
|
|
136
|
+
| enable | Boolean | Yes | false | true to enable floating window, false to disable |
|
|
137
|
+
|
|
138
|
+
#### setLanguage
|
|
139
|
+
|
|
140
|
+
Set the language. Currently supports Chinese (zh) and English (en).
|
|
141
|
+
|
|
142
|
+
``` javascript
|
|
143
|
+
TUICallKitAPI.setLanguage(language)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Parameter details:
|
|
147
|
+
| Parameter | Type | Required | Default | Description |
|
|
148
|
+
|---------|---------|---------|---------|---------|
|
|
149
|
+
| language | String | Yes | 'zh' | Language to set: 'zh' for Chinese, 'en' for English |
|
|
150
|
+
|
|
151
|
+
#### destroyed
|
|
152
|
+
|
|
153
|
+
Destroy TUICallKit. Call this when you want to destroy the TUICallKit instance.
|
|
154
|
+
|
|
155
|
+
``` javascript
|
|
156
|
+
TUICallKitAPI.destroyed()
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### TUICallEngine API Details
|
|
160
|
+
|
|
161
|
+
#### createInstance
|
|
162
|
+
|
|
163
|
+
Create a TUICallEngine instance. This is a **static method** and is the entry point for creating TUICallEngine.
|
|
164
|
+
|
|
165
|
+
``` javascript
|
|
166
|
+
import { TUICallEngine } from '../../TUICallKit/TUICallService/index';
|
|
167
|
+
const tuiCallEngine = TUICallEngine.createInstance();
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
#### destroyInstance
|
|
171
|
+
|
|
172
|
+
Destroy the TUICallEngine instance. This is a **static method** used to release TUICallEngine resources.
|
|
173
|
+
|
|
174
|
+
``` javascript
|
|
175
|
+
TUICallEngine.destroyInstance();
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
#### on
|
|
179
|
+
|
|
180
|
+
Register an event listener. Use this to listen for TUICallEngine dispatched events.
|
|
181
|
+
|
|
182
|
+
``` javascript
|
|
183
|
+
tuiCallEngine.on(event, callback)
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
#### off
|
|
187
|
+
|
|
188
|
+
Unregister an event listener.
|
|
189
|
+
|
|
190
|
+
``` javascript
|
|
191
|
+
tuiCallEngine.off(event, callback)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
#### login
|
|
195
|
+
|
|
196
|
+
Login interface. All features can only be used normally after logging in.
|
|
197
|
+
|
|
198
|
+
``` javascript
|
|
199
|
+
tuiCallEngine.login(params)
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Parameter details:
|
|
203
|
+
| Parameter | Type | Required | Default | Description |
|
|
204
|
+
|---------|---------|---------|---------|---------|
|
|
205
|
+
| params | Object | Yes | - | Login parameters |
|
|
206
|
+
| params.SDKAppID | Number | Yes | - | SDKAppID |
|
|
207
|
+
| params.userID | String | Yes | - | User ID |
|
|
208
|
+
| params.userSig | String | Yes | - | UserSig |
|
|
209
|
+
|
|
210
|
+
#### logout
|
|
211
|
+
|
|
212
|
+
Logout interface.
|
|
213
|
+
|
|
214
|
+
``` javascript
|
|
215
|
+
tuiCallEngine.logout()
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
#### setSelfInfo
|
|
219
|
+
|
|
220
|
+
Set user nickname and avatar.
|
|
221
|
+
|
|
222
|
+
``` javascript
|
|
223
|
+
tuiCallEngine.setSelfInfo(params)
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Parameter details:
|
|
227
|
+
| Parameter | Type | Required | Default | Description |
|
|
228
|
+
|---------|---------|---------|---------|---------|
|
|
229
|
+
| params | Object | Yes | - | User info parameters |
|
|
230
|
+
| params.nickName | String | No | - | User nickname |
|
|
231
|
+
| params.avatar | String | No | - | User avatar URL |
|
|
232
|
+
|
|
233
|
+
#### calls
|
|
234
|
+
|
|
235
|
+
Initiate a call (supports both 1v1 and group calls). The `calls` API combines the original `call` and `groupCall` capabilities.
|
|
236
|
+
|
|
237
|
+
``` javascript
|
|
238
|
+
tuiCallEngine.calls(params)
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Parameter details:
|
|
242
|
+
| Parameter | Type | Required | Default | Description |
|
|
243
|
+
|---------|---------|---------|---------|---------|
|
|
244
|
+
| params | Object | Yes | - | Call parameter object |
|
|
245
|
+
| params.userIDList | Array | Yes | - | List of callee userIDs |
|
|
246
|
+
| params.type | Number | Yes | - | Call media type: 1 for voice, 2 for video |
|
|
247
|
+
| params.groupID | String | No | - | IM group ID |
|
|
248
|
+
| params.timeout | Number | No | 30 | Timeout in seconds |
|
|
249
|
+
| params.roomID | Number | No | - | Numeric room ID |
|
|
250
|
+
| params.strRoomID | String | No | - | String room ID |
|
|
251
|
+
| params.offlinePushInfo | Object | No | - | Offline push information |
|
|
252
|
+
| params.data | String | No | - | Custom data |
|
|
253
|
+
|
|
254
|
+
#### groupCall
|
|
255
|
+
|
|
256
|
+
Initiate a group call.
|
|
257
|
+
|
|
258
|
+
``` javascript
|
|
259
|
+
tuiCallEngine.groupCall(params)
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Parameter details:
|
|
263
|
+
| Parameter | Type | Required | Default | Description |
|
|
264
|
+
|---------|---------|---------|---------|---------|
|
|
265
|
+
| params | Object | Yes | - | Group call parameters |
|
|
266
|
+
| params.userIDList | Array | Yes | - | List of callee userIDs |
|
|
267
|
+
| params.type | Number | Yes | - | Call media type: 1 for voice, 2 for video |
|
|
268
|
+
| params.groupID | String | Yes | - | Group call group ID |
|
|
269
|
+
| params.timeout | Number | No | 30 | Timeout in seconds |
|
|
270
|
+
| params.roomID | Number | No | - | Numeric room ID |
|
|
271
|
+
| params.strRoomID | String | No | - | String room ID |
|
|
272
|
+
| params.offlinePushInfo | Object | No | - | Offline push information |
|
|
273
|
+
|
|
274
|
+
#### joinInGroupCall
|
|
275
|
+
|
|
276
|
+
Join a group call.
|
|
277
|
+
|
|
278
|
+
``` javascript
|
|
279
|
+
tuiCallEngine.joinInGroupCall(params)
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Parameter details:
|
|
283
|
+
| Parameter | Type | Required | Default | Description |
|
|
284
|
+
|---------|---------|---------|---------|---------|
|
|
285
|
+
| params | Object | Yes | - | Join group call parameters |
|
|
286
|
+
| params.type | Number | Yes | - | Call media type |
|
|
287
|
+
| params.groupID | String | Yes | - | Group call group ID |
|
|
288
|
+
| params.roomID | Number | Yes | - | Numeric room ID |
|
|
289
|
+
|
|
290
|
+
#### accept
|
|
291
|
+
|
|
292
|
+
Accept a call.
|
|
293
|
+
|
|
294
|
+
``` javascript
|
|
295
|
+
tuiCallEngine.accept()
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
#### reject
|
|
299
|
+
|
|
300
|
+
Reject a call.
|
|
301
|
+
|
|
302
|
+
``` javascript
|
|
303
|
+
tuiCallEngine.reject()
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
#### hangup
|
|
307
|
+
|
|
308
|
+
Hang up a call. When in a multi-party call, calling this API just causes the user to leave the call. A multi-party call is considered ended only when all users have left.
|
|
309
|
+
|
|
310
|
+
``` javascript
|
|
311
|
+
tuiCallEngine.hangup()
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
#### switchCallMediaType
|
|
315
|
+
|
|
316
|
+
Switch between voice and video call types. Only supported in 1v1 calls.
|
|
317
|
+
|
|
318
|
+
``` javascript
|
|
319
|
+
tuiCallEngine.switchCallMediaType(params)
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Parameter details:
|
|
323
|
+
| Parameter | Type | Required | Default | Description |
|
|
324
|
+
|---------|---------|---------|---------|---------|
|
|
325
|
+
| params | Object | Yes | - | Switch type parameters |
|
|
326
|
+
| params.newMediaType | Number | Yes | - | Target call media type: 1 for voice, 2 for video |
|
|
327
|
+
|
|
328
|
+
#### setVideoQuality
|
|
329
|
+
|
|
330
|
+
Set video encoding resolution.
|
|
331
|
+
|
|
332
|
+
``` javascript
|
|
333
|
+
tuiCallEngine.setVideoQuality(quality)
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Parameter details:
|
|
337
|
+
| Parameter | Type | Required | Default | Description |
|
|
338
|
+
|---------|---------|---------|---------|---------|
|
|
339
|
+
| quality | String | Yes | - | Video quality preset |
|
|
340
|
+
|
|
341
|
+
#### openCamera
|
|
342
|
+
|
|
343
|
+
Enable the camera. The video stream is rendered to the specified `<live-pusher>` component.
|
|
344
|
+
|
|
345
|
+
``` javascript
|
|
346
|
+
tuiCallEngine.openCamera()
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
#### closeCamera
|
|
350
|
+
|
|
351
|
+
Disable the camera.
|
|
352
|
+
|
|
353
|
+
``` javascript
|
|
354
|
+
tuiCallEngine.closeCamera()
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
#### switchCamera
|
|
358
|
+
|
|
359
|
+
Switch between front and rear cameras.
|
|
360
|
+
|
|
361
|
+
``` javascript
|
|
362
|
+
tuiCallEngine.switchCamera(params)
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
Parameter details:
|
|
366
|
+
| Parameter | Type | Required | Default | Description |
|
|
367
|
+
|---------|---------|---------|---------|---------|
|
|
368
|
+
| params | Object | Yes | - | Camera parameters |
|
|
369
|
+
| params.cameraId | String | Yes | - | Camera ID, 'front' for front camera, 'back' for rear camera |
|
|
370
|
+
|
|
371
|
+
#### openMicrophone
|
|
372
|
+
|
|
373
|
+
Enable the microphone.
|
|
374
|
+
|
|
375
|
+
``` javascript
|
|
376
|
+
tuiCallEngine.openMicrophone()
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
#### closeMicrophone
|
|
380
|
+
|
|
381
|
+
Disable the microphone.
|
|
382
|
+
|
|
383
|
+
``` javascript
|
|
384
|
+
tuiCallEngine.closeMicrophone()
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
#### setMicMute
|
|
388
|
+
|
|
389
|
+
Set microphone mute state.
|
|
390
|
+
|
|
391
|
+
``` javascript
|
|
392
|
+
tuiCallEngine.setMicMute(params)
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
Parameter details:
|
|
396
|
+
| Parameter | Type | Required | Default | Description |
|
|
397
|
+
|---------|---------|---------|---------|---------|
|
|
398
|
+
| params | Object | Yes | - | Mute parameters |
|
|
399
|
+
| params.isMute | Boolean | Yes | - | Whether to mute the microphone |
|
|
400
|
+
|
|
401
|
+
#### setVideoRenderView
|
|
402
|
+
|
|
403
|
+
Set the video rendering view.
|
|
404
|
+
|
|
405
|
+
``` javascript
|
|
406
|
+
tuiCallEngine.setVideoRenderView(params)
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
Parameter details:
|
|
410
|
+
| Parameter | Type | Required | Default | Description |
|
|
411
|
+
|---------|---------|---------|---------|---------|
|
|
412
|
+
| params | Object | Yes | - | Rendering view parameters |
|
|
413
|
+
| params.userID | String | Yes | - | User ID of the video to render |
|
|
414
|
+
| params.video | Object | Yes | - | Native component rendering view |
|
|
415
|
+
|
|
416
|
+
#### getTRTCInstance
|
|
417
|
+
|
|
418
|
+
Get the TRTC instance. Use this to access more TRTC features.
|
|
419
|
+
|
|
420
|
+
``` javascript
|
|
421
|
+
const trtcInstance = tuiCallEngine.getTRTCInstance()
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
#### getSDKVersion
|
|
425
|
+
|
|
426
|
+
Get the SDK version string.
|
|
427
|
+
|
|
428
|
+
``` javascript
|
|
429
|
+
const version = tuiCallEngine.getSDKVersion()
|
|
430
|
+
```
|