@tencent-rtc/mcp 1.7.2 → 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 +26 -0
- package/README.md +25 -17
- package/knowledge/bm25.js +20 -11
- package/knowledge/path-meta.js +23 -1
- package/knowledge/search/generic-rerank.js +123 -0
- package/knowledge/search/search-pass.js +8 -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/best-practice/common/web-sdk-log-level.md +76 -0
- package/resource/knowledge/chat/best-practice/miniprogram/desktop-wechat-miniprogram-error.md +79 -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/roomkit/best-practice/vue/screen-share-auto-stop-on-leave.md +62 -0
- package/resource/knowledge/roomkit/core-sdk/react/network-proxy.md +83 -0
- package/resource/knowledge/roomkit/core-sdk/vue/network-proxy.md +83 -0
- package/resource/knowledge/roomkit/core-sdk/vue/recording.md +245 -0
- package/resource/knowledge/roomkit/core-sdk/vue/whiteboard-annotation.md +196 -0
- package/resource/knowledge/roomkit/faq/error-code.md +103 -0
- package/resource/knowledge/roomkit/preset/harmonyos/integration.md +461 -0
- package/resource/knowledge/roomkit/preset/react/features/network-proxy.md +79 -0
- package/resource/knowledge/roomkit/preset/uniapp-app/integration.md +580 -0
- package/resource/knowledge/roomkit/preset/vue/features/ai-caption-translation.md +69 -0
- package/resource/knowledge/roomkit/preset/vue/features/ai-denoiser.md +67 -0
- package/resource/knowledge/roomkit/preset/vue/features/network-proxy.md +79 -0
- package/resource/knowledge/roomkit/preset/vue/features/recording.md +85 -0
- package/resource/knowledge/roomkit/preset/vue/features/whiteboard-annotation.md +86 -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/preflight-route.js +18 -6
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
This guide walks you through quickly integrating the TUICallKit component using uni-app for packaging and running on the **WeChat Mini Program** platform. You can complete the following key steps in about 10 minutes and get a fully functional audio/video calling interface.
|
|
2
|
+
|
|
3
|
+
## Prerequisites
|
|
4
|
+
|
|
5
|
+
### Development Environment Requirements
|
|
6
|
+
- Before development, please read [WeChat Mini Program Development Overview](https://developers.weixin.qq.com/miniprogram/dev/framework/).
|
|
7
|
+
- Supported since **TUICallKit v4.2.6+**.
|
|
8
|
+
- WeChat App iOS minimum version: 7.0.9.
|
|
9
|
+
- WeChat App Android minimum version: 7.0.8.
|
|
10
|
+
- Mini Program base library minimum version: 2.10.0.
|
|
11
|
+
|
|
12
|
+
> **Warning:**
|
|
13
|
+
>
|
|
14
|
+
> - Since mini program test accounts do not have access to `<live-pusher>` and `<live-player>`, please use an **enterprise mini program account** to apply for the required permissions for development.
|
|
15
|
+
> - Since WeChat DevTools does not support native components (`<live-pusher>` and `<live-player>` tags), you need to run and test on a **real device**.
|
|
16
|
+
> - **WeChat Work mini programs are not supported**.
|
|
17
|
+
|
|
18
|
+
### Activate the Service
|
|
19
|
+
Before using Tencent Cloud audio/video services, you need to go to the console to activate the service for your application. For detailed steps, see [Activate Service](https://cloud.tencent.com/document/product/1640/81130). After activation, note down the `SDKAppID` and `SDKSecretKey` — you will need them in the subsequent login step.
|
|
20
|
+
|
|
21
|
+
## Mini Program Development Setup
|
|
22
|
+
|
|
23
|
+
### Step 1: Register an Enterprise Mini Program
|
|
24
|
+
|
|
25
|
+
### Step 2: Enable Real-Time Audio/Video APIs in the Mini Program Console
|
|
26
|
+
- The live push/pull stream tag usage permission is currently only available for limited categories. [See supported categories here](https://developers.weixin.qq.com/miniprogram/dev/component/live-pusher.html#%E7%94%B3%E8%AF%B7%E5%BC%80%E9%80%9A).
|
|
27
|
+
- Mini programs that meet the category requirements need to self-enable this component permission in [WeChat Official Accounts Platform](https://mp.weixin.qq.com/) > **Development** > **Development Management** > **API Settings**.
|
|
28
|
+
- Log in to the mini program console to update the privacy policy, checking **Microphone** and **Camera**.
|
|
29
|
+
|
|
30
|
+
### Step 3: Configure Domains in the Mini Program Console
|
|
31
|
+
|
|
32
|
+
In [WeChat Official Accounts Platform](https://mp.weixin.qq.com/) > **Development** > **Development Management** > **Development Settings** > **Server Domains**, configure **request valid domains** and **socket valid domains**.
|
|
33
|
+
|
|
34
|
+
- Add the following domains to **socket valid domains**:
|
|
35
|
+
|
|
36
|
+
| Domain | Description | Required |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| `wss://${SDKAppID}w4c.my-imcloud.com` | Since v3.4.6, the SDK supports dedicated domains for better service stability.<br>For example, if your SDKAppID is 1400xxxxxx, the dedicated domain is: `wss://1400xxxxxxw4c.my-imcloud.com` | Required |
|
|
39
|
+
| `wss://wss.im.qcloud.com` | Web IM service domain | Required |
|
|
40
|
+
| `wss://wss.tim.qq.com` | Web IM service domain | Required |
|
|
41
|
+
| `wss://wssv6.im.qcloud.com` | Web IM service domain | Required |
|
|
42
|
+
|
|
43
|
+
- Add the following domains to **request valid domains**:
|
|
44
|
+
|
|
45
|
+
| Domain | Description | Required |
|
|
46
|
+
|---------|---------|---------|
|
|
47
|
+
|`https://web.sdk.qcloud.com`|Web IM service domain|Required|
|
|
48
|
+
|`https://boce-cdn.my-imcloud.com`|Web IM service domain|Required|
|
|
49
|
+
|`https://api.im.qcloud.com`|Web IM service domain|Required|
|
|
50
|
+
|`https://events.im.qcloud.com`|Web IM service domain|Required|
|
|
51
|
+
|`https://webim.tim.qq.com`|Web IM service domain|Required|
|
|
52
|
+
|`https://wss.im.qcloud.com`|Web IM service domain|Required|
|
|
53
|
+
|`https://wss.tim.qq.com`|Web IM service domain|Required|
|
|
54
|
+
|
|
55
|
+
- Add the following domains to **uploadFile valid domains**:
|
|
56
|
+
|
|
57
|
+
| Domain | Description | Required |
|
|
58
|
+
| --- | --- | --- |
|
|
59
|
+
| `https://${SDKAppID}-cn.rich.my-imcloud.com` | **Since September 10, 2024, new applications are assigned dedicated COS domains by default.**<br>For example, if your SDKAppID is 1400xxxxxx, the COS dedicated domain is: `https://1400xxxxxx-cn.rich.my-imcloud.com` | Required |
|
|
60
|
+
| `https://cn.rich.my-imcloud.com` | File upload domain | Required |
|
|
61
|
+
| `https://cn.imrich.qcloud.com` | File upload domain | Required |
|
|
62
|
+
| `https://cos.ap-shanghai.myqcloud.com` | File upload domain | Required |
|
|
63
|
+
| `https://cos.ap-shanghai.tencentcos.cn` | File upload domain | Required |
|
|
64
|
+
| `https://cos.ap-guangzhou.myqcloud.com` | File upload domain | Required |
|
|
65
|
+
|
|
66
|
+
- Add the following domains to **downloadFile valid domains**:
|
|
67
|
+
|
|
68
|
+
| Domain | Description | Required |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| `https://${SDKAppID}-cn.rich.my-imcloud.com` | **Since September 10, 2024, new applications are assigned dedicated COS domains by default.**<br>For example, if your SDKAppID is 1400xxxxxx, the COS dedicated domain is: `https://1400xxxxxx-cn.rich.my-imcloud.com` | Required |
|
|
71
|
+
| `https://cn.rich.my-imcloud.com` | File download domain | Required |
|
|
72
|
+
| `https://cn.imrich.qcloud.com` | File download domain | Required |
|
|
73
|
+
| `https://cos.ap-shanghai.myqcloud.com` | File download domain | Required |
|
|
74
|
+
| `https://cos.ap-shanghai.tencentcos.cn` | File download domain | Required |
|
|
75
|
+
| `https://cos.ap-guangzhou.myqcloud.com` | File download domain | Required |
|
|
76
|
+
|
|
77
|
+
## TUICallKit Source Code Integration
|
|
78
|
+
|
|
79
|
+
### Step 1: Create a uni-app Project
|
|
80
|
+
|
|
81
|
+
In HBuilderX, create a uni-app project. Select the default template.
|
|
82
|
+
|
|
83
|
+
### Step 2: Download and Import the TUICallKit Component
|
|
84
|
+
1. Download the `TUICallKit` component.
|
|
85
|
+
|
|
86
|
+
``` bash
|
|
87
|
+
npm i @trtc/calls-uikit-wx
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
[macOS]
|
|
91
|
+
``` bash
|
|
92
|
+
mkdir -p ./TUICallKit && cp -r node_modules/@trtc/calls-uikit-wx/ ./TUICallKit
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
[Windows]
|
|
96
|
+
``` bash
|
|
97
|
+
xcopy node_modules\@trtc\calls-uikit-wx\ .\TUICallKit /i /e
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
2. Copy the `TUICallKit` folder to the root directory of your uni-app project.
|
|
101
|
+
|
|
102
|
+
### Step 3: Fill in SDKAPPID and SECRETKEY
|
|
103
|
+
|
|
104
|
+
Modify the `SDKAPPID` and `SECRETKEY` in the `TUICallKit/debug/GenerateTestUserSig-es.js` file.
|
|
105
|
+
|
|
106
|
+
### Step 4: Use the TUICallKit Component
|
|
107
|
+
1. Modify the `pages.json` file. Add the following code to register the global call monitoring page.
|
|
108
|
+
|
|
109
|
+
``` json
|
|
110
|
+
{
|
|
111
|
+
"pages": [
|
|
112
|
+
{
|
|
113
|
+
"path": "pages/index/index",
|
|
114
|
+
"style": {
|
|
115
|
+
"navigationStyle": "custom"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"path": "TUICallKit/pages/globalCall/globalCall",
|
|
120
|
+
"style": {
|
|
121
|
+
"navigationStyle": "custom"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"globalStyle": {
|
|
126
|
+
"navigationBarTextStyle": "black",
|
|
127
|
+
"navigationBarTitleText": "TUICallKit",
|
|
128
|
+
"navigationBarBackgroundColor": "#F8F8F8",
|
|
129
|
+
"backgroundColor": "#F8F8F8"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
2. Create a `wxcomponents` folder in the project root directory.
|
|
134
|
+
|
|
135
|
+
3. Copy the `TUICallKit/component` folder to `wxcomponents/TUICallKit`.
|
|
136
|
+
|
|
137
|
+
4. Modify `pages/index/index.vue`.
|
|
138
|
+
|
|
139
|
+
``` html
|
|
140
|
+
<template>
|
|
141
|
+
<view class="container">
|
|
142
|
+
<input
|
|
143
|
+
type="text"
|
|
144
|
+
maxlength="20"
|
|
145
|
+
:placeholder="isLogin ? 'Enter callee userID' : 'Enter login userID'"
|
|
146
|
+
:value="userID"
|
|
147
|
+
@input="bindInputUserID"
|
|
148
|
+
/>
|
|
149
|
+
<button @tap="isLogin ? call() : login()">
|
|
150
|
+
{{ isLogin ? 'Call' : 'Login' }}
|
|
151
|
+
</button>
|
|
152
|
+
</view>
|
|
153
|
+
</template>
|
|
154
|
+
|
|
155
|
+
<script>
|
|
156
|
+
import { TUICallKitAPI } from '../../TUICallKit/TUICallService/index';
|
|
157
|
+
import { CallManager } from '../../TUICallKit/TUICallService/serve/callManager';
|
|
158
|
+
import * as GenerateTestUserSig from '../../TUICallKit/debug/GenerateTestUserSig-es.js';
|
|
159
|
+
wx.CallManager = new CallManager();
|
|
160
|
+
|
|
161
|
+
export default {
|
|
162
|
+
data() {
|
|
163
|
+
return {
|
|
164
|
+
userID: '',
|
|
165
|
+
isLogin: false,
|
|
166
|
+
};
|
|
167
|
+
},
|
|
168
|
+
methods: {
|
|
169
|
+
bindInputUserID(e) {
|
|
170
|
+
this.userID = e.detail.value;
|
|
171
|
+
},
|
|
172
|
+
async login() {
|
|
173
|
+
const userID = this.userID;
|
|
174
|
+
if (!userID) return;
|
|
175
|
+
const { userSig, SDKAppID } = GenerateTestUserSig.genTestUserSig({
|
|
176
|
+
userID: userID,
|
|
177
|
+
});
|
|
178
|
+
await wx.CallManager.init({
|
|
179
|
+
sdkAppID: SDKAppID,
|
|
180
|
+
userID: userID,
|
|
181
|
+
userSig: userSig,
|
|
182
|
+
globalCallPagePath: 'TUICallKit/pages/globalCall/globalCall',
|
|
183
|
+
});
|
|
184
|
+
uni.showToast({ title: 'Login successful' });
|
|
185
|
+
this.isLogin = true;
|
|
186
|
+
this.userID = '';
|
|
187
|
+
},
|
|
188
|
+
async call() {
|
|
189
|
+
await TUICallKitAPI.calls({
|
|
190
|
+
userIDList: [this.userID],
|
|
191
|
+
type: 2,
|
|
192
|
+
});
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
};
|
|
196
|
+
</script>
|
|
197
|
+
```
|
|
198
|
+
5. You must use **Vue 2** for compilation. Currently, **Vue 3** is not supported.
|
|
199
|
+
|
|
200
|
+
### Step 5: Build and Run
|
|
201
|
+
1. In HBuilderX, click **Run > Run to Mini Program Simulator > WeChat DevTools**. This will automatically open WeChat DevTools.
|
|
202
|
+
|
|
203
|
+
2. In WeChat DevTools local settings, check "Do not verify valid domains, web-view (business domains), TLS version, and HTTPS certificates".
|
|
204
|
+
|
|
205
|
+
3. Click **Clear Cache > Clear All** to avoid rendering issues caused by DevTools cache.
|
|
206
|
+
|
|
207
|
+
4. Build the mini program.
|
|
208
|
+
|
|
209
|
+
5. Expected result after quick integration.
|
|
210
|
+
|
|
211
|
+
### Step 6: Make Your First Call
|
|
212
|
+
- Click Preview, scan the QR code, and use the mini program on a real device.
|
|
213
|
+
|
|
214
|
+
> **Note:**
|
|
215
|
+
>
|
|
216
|
+
> The first time you use the mini program for calls, you need to grant camera and microphone permissions.
|
|
217
|
+
>
|
|
218
|
+
|
|
219
|
+
## FAQ
|
|
220
|
+
|
|
221
|
+
### What should I do if the uni-app project imports successfully but pages are blank?
|
|
222
|
+
1. Due to WeChat DevTools caching, click **Clear Cache > Clear All** and rebuild.
|
|
223
|
+
2. Check if `wxcomponents/TUICallKit` is correctly placed and contains the component files.
|
|
224
|
+
3. Verify `pages.json` includes the `globalCall` page registration.
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
## API Overview
|
|
2
|
+
|
|
3
|
+
### TUICallKit (with UI)
|
|
4
|
+
|
|
5
|
+
TUICallKit is the **audio/video calling component with 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
|
+
| setSelfInfo | Set user nickname and avatar |
|
|
12
|
+
| setCallingBell | Set custom ringtone |
|
|
13
|
+
| enableMuteMode | Enable/disable mute mode |
|
|
14
|
+
| enableFloatWindow | Enable/disable floating window |
|
|
15
|
+
|
|
16
|
+
### TUICallEngine (No UI)
|
|
17
|
+
|
|
18
|
+
TUICallEngine is the underlying engine **without a UI interface**, suitable for custom audio/video calling scenarios.
|
|
19
|
+
|
|
20
|
+
| API | Description |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| createInstance | Create a TUICallEngine instance (static method) |
|
|
23
|
+
| destroyInstance | Destroy a TUICallEngine instance (static method) |
|
|
24
|
+
| on | Register an event listener |
|
|
25
|
+
| off | Unregister an event listener |
|
|
26
|
+
| login | Login |
|
|
27
|
+
| logout | Logout |
|
|
28
|
+
| setSelfInfo | Set user nickname and avatar |
|
|
29
|
+
| calls | Initiate 1v1 / group call |
|
|
30
|
+
| groupCall | Initiate a group call |
|
|
31
|
+
| accept | Accept a call |
|
|
32
|
+
| reject | Reject a call |
|
|
33
|
+
| hangup | Hang up a call |
|
|
34
|
+
| switchCallMediaType | Switch call media type (e.g., voice to video) |
|
|
35
|
+
| openCamera | Enable camera |
|
|
36
|
+
| closeCamera | Disable camera |
|
|
37
|
+
| switchCamera | Switch between front/rear camera |
|
|
38
|
+
| openMicrophone | Enable microphone |
|
|
39
|
+
| closeMicrophone | Disable microphone |
|
|
40
|
+
| setMicMute | Set microphone mute state |
|
|
41
|
+
| setVideoQuality | Set video encoding quality |
|
|
42
|
+
|
|
43
|
+
## API Details
|
|
44
|
+
|
|
45
|
+
### TUICallKit API Details
|
|
46
|
+
|
|
47
|
+
#### init
|
|
48
|
+
|
|
49
|
+
Initialize TUICallKit. This must be called before using any other TUICallKit features.
|
|
50
|
+
|
|
51
|
+
``` javascript
|
|
52
|
+
import TUICallKit from '../../TUICallKit/TUICallKit.vue';
|
|
53
|
+
|
|
54
|
+
// Call via ref
|
|
55
|
+
this.$refs.TUICallKit.init({
|
|
56
|
+
sdkAppID: 0, // Replace with your SDKAppID
|
|
57
|
+
userID: 'userID', // Replace with your userID
|
|
58
|
+
userSig: 'userSig' // Replace with your userSig
|
|
59
|
+
})
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Parameter details:
|
|
63
|
+
| Parameter | Type | Required | Default | Description |
|
|
64
|
+
|---------|---------|---------|---------|---------|
|
|
65
|
+
| sdkAppID | Number | Yes | - | SDKAppID |
|
|
66
|
+
| userID | String | Yes | - | User ID |
|
|
67
|
+
| userSig | String | Yes | - | UserSig |
|
|
68
|
+
|
|
69
|
+
#### calls
|
|
70
|
+
|
|
71
|
+
Initiate a 1v1 or group call. When `userIDList` contains a single user, it is a 1v1 call; when it contains multiple users, it is a group call.
|
|
72
|
+
|
|
73
|
+
``` javascript
|
|
74
|
+
this.$refs.TUICallKit.calls({
|
|
75
|
+
userIDList: ['mike'],
|
|
76
|
+
type: 2
|
|
77
|
+
})
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Parameter details:
|
|
81
|
+
| Parameter | Type | Required | Default | Description |
|
|
82
|
+
|---------|---------|---------|---------|---------|
|
|
83
|
+
| userIDList | Array | Yes | - | List of callee userIDs. For 1v1 calls, pass one userID; for group calls, pass multiple userIDs |
|
|
84
|
+
| type | Number | Yes | - | Call media type: 1 for voice, 2 for video |
|
|
85
|
+
| groupID | String | No | - | IM group ID. When calling in a group chat, this field must be passed |
|
|
86
|
+
| timeout | Number | No | 30 | Timeout in seconds, 0 means no timeout |
|
|
87
|
+
| roomID | Number | No | - | Numeric room ID, range [1, 2147483647] |
|
|
88
|
+
| 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 |
|
|
89
|
+
| offlinePushInfo | Object | No | - | Custom offline push information |
|
|
90
|
+
| offlinePushInfo.title | String | No | - | Offline push title |
|
|
91
|
+
| offlinePushInfo.description | String | No | - | Offline push description |
|
|
92
|
+
| offlinePushInfo.androidOPPOChannelID | String | No | - | OPPO channel ID for offline push |
|
|
93
|
+
| offlinePushInfo.extension | String | No | - | Offline push extension field |
|
|
94
|
+
| data | String | No | - | Custom data passed to the callee |
|
|
95
|
+
|
|
96
|
+
#### setSelfInfo
|
|
97
|
+
|
|
98
|
+
Set user nickname and avatar.
|
|
99
|
+
|
|
100
|
+
``` javascript
|
|
101
|
+
this.$refs.TUICallKit.setSelfInfo({
|
|
102
|
+
nickName: 'Tom',
|
|
103
|
+
avatar: 'https://...'
|
|
104
|
+
})
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Parameter details:
|
|
108
|
+
| Parameter | Type | Required | Default | Description |
|
|
109
|
+
|---------|---------|---------|---------|---------|
|
|
110
|
+
| nickName | String | No | - | User nickname |
|
|
111
|
+
| avatar | String | No | - | User avatar URL |
|
|
112
|
+
|
|
113
|
+
#### setCallingBell
|
|
114
|
+
|
|
115
|
+
Set a custom ringtone for incoming calls.
|
|
116
|
+
|
|
117
|
+
``` javascript
|
|
118
|
+
this.$refs.TUICallKit.setCallingBell(filePath)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Parameter details:
|
|
122
|
+
| Parameter | Type | Required | Default | Description |
|
|
123
|
+
|---------|---------|---------|---------|---------|
|
|
124
|
+
| filePath | String | Yes | - | Path to the ringtone file. Only local file paths are accepted. The setting is device-bound and persists across user switches. Pass an empty string to restore the default ringtone. |
|
|
125
|
+
|
|
126
|
+
#### enableMuteMode
|
|
127
|
+
|
|
128
|
+
Enable/disable mute mode for incoming calls.
|
|
129
|
+
|
|
130
|
+
``` javascript
|
|
131
|
+
this.$refs.TUICallKit.enableMuteMode(true)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Parameter details:
|
|
135
|
+
| Parameter | Type | Required | Default | Description |
|
|
136
|
+
|---------|---------|---------|---------|---------|
|
|
137
|
+
| enable | Boolean | Yes | false | true to enable mute mode (no ringtone on incoming calls), false to disable |
|
|
138
|
+
|
|
139
|
+
#### enableFloatWindow
|
|
140
|
+
|
|
141
|
+
Enable/disable the floating window feature.
|
|
142
|
+
|
|
143
|
+
``` javascript
|
|
144
|
+
this.$refs.TUICallKit.enableFloatWindow(true)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Parameter details:
|
|
148
|
+
| Parameter | Type | Required | Default | Description |
|
|
149
|
+
|---------|---------|---------|---------|---------|
|
|
150
|
+
| enable | Boolean | Yes | false | true to enable floating window, false to disable |
|
|
151
|
+
|
|
152
|
+
### TUICallEngine API Details
|
|
153
|
+
|
|
154
|
+
#### createInstance
|
|
155
|
+
|
|
156
|
+
Create a TUICallEngine instance.
|
|
157
|
+
|
|
158
|
+
``` javascript
|
|
159
|
+
import { TUICallEngine } from '../../TUICallKit/TUICallService/index';
|
|
160
|
+
const tuiCallEngine = TUICallEngine.createInstance();
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
#### destroyInstance
|
|
164
|
+
|
|
165
|
+
Destroy the TUICallEngine instance to release resources.
|
|
166
|
+
|
|
167
|
+
``` javascript
|
|
168
|
+
TUICallEngine.destroyInstance();
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
#### on
|
|
172
|
+
|
|
173
|
+
Register an event listener.
|
|
174
|
+
|
|
175
|
+
``` javascript
|
|
176
|
+
tuiCallEngine.on(event, callback)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
#### off
|
|
180
|
+
|
|
181
|
+
Unregister an event listener.
|
|
182
|
+
|
|
183
|
+
``` javascript
|
|
184
|
+
tuiCallEngine.off(event, callback)
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
#### login
|
|
188
|
+
|
|
189
|
+
Login. All features require login first.
|
|
190
|
+
|
|
191
|
+
``` javascript
|
|
192
|
+
tuiCallEngine.login({ SDKAppID, userID, userSig })
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Parameter details:
|
|
196
|
+
| Parameter | Type | Required | Default | Description |
|
|
197
|
+
|---------|---------|---------|---------|---------|
|
|
198
|
+
| SDKAppID | Number | Yes | - | SDKAppID |
|
|
199
|
+
| userID | String | Yes | - | User ID |
|
|
200
|
+
| userSig | String | Yes | - | UserSig |
|
|
201
|
+
|
|
202
|
+
#### logout
|
|
203
|
+
|
|
204
|
+
Logout.
|
|
205
|
+
|
|
206
|
+
``` javascript
|
|
207
|
+
tuiCallEngine.logout()
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
#### setSelfInfo
|
|
211
|
+
|
|
212
|
+
Set user nickname and avatar.
|
|
213
|
+
|
|
214
|
+
``` javascript
|
|
215
|
+
tuiCallEngine.setSelfInfo({ nickName, avatar })
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
#### calls
|
|
219
|
+
|
|
220
|
+
Initiate a call (supports both 1v1 and group calls).
|
|
221
|
+
|
|
222
|
+
``` javascript
|
|
223
|
+
tuiCallEngine.calls({
|
|
224
|
+
userIDList: ['mike'],
|
|
225
|
+
type: 2
|
|
226
|
+
})
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Parameter details:
|
|
230
|
+
| Parameter | Type | Required | Default | Description |
|
|
231
|
+
|---------|---------|---------|---------|---------|
|
|
232
|
+
| userIDList | Array | Yes | - | List of callee userIDs |
|
|
233
|
+
| type | Number | Yes | - | Call media type: 1 for voice, 2 for video |
|
|
234
|
+
| groupID | String | No | - | IM group ID |
|
|
235
|
+
| timeout | Number | No | 30 | Timeout in seconds |
|
|
236
|
+
| roomID | Number | No | - | Numeric room ID |
|
|
237
|
+
| strRoomID | String | No | - | String room ID |
|
|
238
|
+
| offlinePushInfo | Object | No | - | Offline push information |
|
|
239
|
+
| data | String | No | - | Custom data |
|
|
240
|
+
|
|
241
|
+
#### groupCall
|
|
242
|
+
|
|
243
|
+
Initiate a group call.
|
|
244
|
+
|
|
245
|
+
``` javascript
|
|
246
|
+
tuiCallEngine.groupCall({
|
|
247
|
+
userIDList: ['mike', 'tom'],
|
|
248
|
+
type: 2,
|
|
249
|
+
groupID: 'xxx'
|
|
250
|
+
})
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
#### accept
|
|
254
|
+
|
|
255
|
+
Accept a call.
|
|
256
|
+
|
|
257
|
+
``` javascript
|
|
258
|
+
tuiCallEngine.accept()
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
#### reject
|
|
262
|
+
|
|
263
|
+
Reject a call.
|
|
264
|
+
|
|
265
|
+
``` javascript
|
|
266
|
+
tuiCallEngine.reject()
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
#### hangup
|
|
270
|
+
|
|
271
|
+
Hang up a call.
|
|
272
|
+
|
|
273
|
+
``` javascript
|
|
274
|
+
tuiCallEngine.hangup()
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
#### switchCallMediaType
|
|
278
|
+
|
|
279
|
+
Switch between voice and video call types. Only supported in 1v1 calls.
|
|
280
|
+
|
|
281
|
+
``` javascript
|
|
282
|
+
tuiCallEngine.switchCallMediaType({ newMediaType: 1 })
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
#### openCamera
|
|
286
|
+
|
|
287
|
+
Enable the camera.
|
|
288
|
+
|
|
289
|
+
``` javascript
|
|
290
|
+
tuiCallEngine.openCamera()
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
#### closeCamera
|
|
294
|
+
|
|
295
|
+
Disable the camera.
|
|
296
|
+
|
|
297
|
+
``` javascript
|
|
298
|
+
tuiCallEngine.closeCamera()
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
#### switchCamera
|
|
302
|
+
|
|
303
|
+
Switch between front and rear cameras.
|
|
304
|
+
|
|
305
|
+
``` javascript
|
|
306
|
+
tuiCallEngine.switchCamera({ cameraId: 'front' })
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
#### openMicrophone
|
|
310
|
+
|
|
311
|
+
Enable the microphone.
|
|
312
|
+
|
|
313
|
+
``` javascript
|
|
314
|
+
tuiCallEngine.openMicrophone()
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
#### closeMicrophone
|
|
318
|
+
|
|
319
|
+
Disable the microphone.
|
|
320
|
+
|
|
321
|
+
``` javascript
|
|
322
|
+
tuiCallEngine.closeMicrophone()
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
#### setMicMute
|
|
326
|
+
|
|
327
|
+
Set microphone mute state.
|
|
328
|
+
|
|
329
|
+
``` javascript
|
|
330
|
+
tuiCallEngine.setMicMute({ isMute: true })
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
#### setVideoQuality
|
|
334
|
+
|
|
335
|
+
Set video encoding quality.
|
|
336
|
+
|
|
337
|
+
``` javascript
|
|
338
|
+
tuiCallEngine.setVideoQuality(quality)
|
|
339
|
+
```
|