@tencent-rtc/mcp 1.6.8 → 1.7.1

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.
Files changed (86) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +58 -39
  3. package/knowledge/build-index.js +30 -6
  4. package/knowledge/chunker.js +82 -14
  5. package/knowledge/chunking-policy.js +100 -0
  6. package/knowledge/content-loader.js +3 -3
  7. package/knowledge/doc-url-resolver.js +43 -16
  8. package/knowledge/frontmatter-meta.js +167 -0
  9. package/knowledge/path-meta.js +28 -6
  10. package/knowledge/search/exact-lookup.js +120 -239
  11. package/knowledge/search/filter-pool.js +12 -29
  12. package/knowledge/search/framework-fallback.js +22 -0
  13. package/knowledge/search/intent-router.js +29 -0
  14. package/knowledge/search/l1-enrich.js +159 -0
  15. package/knowledge/search/query-normalizer.js +63 -3
  16. package/knowledge/search/search-core.js +410 -0
  17. package/knowledge/search/search-knowledge.js +421 -379
  18. package/knowledge/search/search-message.js +88 -0
  19. package/knowledge/search/search-pass.js +428 -0
  20. package/knowledge/search/search-types.js +1 -0
  21. package/knowledge/search/url-row-idf.js +120 -0
  22. package/knowledge/search/url-row-scorer.js +337 -0
  23. package/package.json +3 -1
  24. package/resource/_schema/feature-aliases.yaml +1 -1
  25. package/resource/index/manifest.json +1 -1
  26. package/resource/knowledge/callkit/best-practice/callkit-miniprogram/uniapp-shrink.md +60 -0
  27. package/resource/knowledge/callkit/best-practice/common/call-autoplay-blocked.md +77 -0
  28. package/resource/knowledge/callkit/best-practice/common/call-message-in-chat.md +78 -0
  29. package/resource/knowledge/callkit/best-practice/common/call-vs-calls.md +110 -0
  30. package/resource/knowledge/callkit/best-practice/common/callengine-call-flow.md +123 -0
  31. package/resource/knowledge/callkit/best-practice/common/callengine-log-level.md +67 -0
  32. package/resource/knowledge/callkit/best-practice/common/callkit-get-engine-instance.md +81 -0
  33. package/resource/knowledge/callkit/best-practice/common/callkit-get-roomid.md +78 -0
  34. package/resource/knowledge/callkit/best-practice/common/callkit-limitations.md +37 -0
  35. package/resource/knowledge/callkit/best-practice/common/callkit-user-register-and-kicked.md +98 -0
  36. package/resource/knowledge/chat/best-practice/common/avchatroom-message-loss-diagnosis.md +65 -0
  37. package/resource/knowledge/chat/best-practice/common/group-conversation-cleanup-on-system-notice.md +62 -0
  38. package/resource/knowledge/chat/best-practice/common/image-message-url-lifecycle.md +59 -0
  39. package/resource/knowledge/chat/best-practice/common/login-repeat-2025-diagnosis.md +61 -0
  40. package/resource/knowledge/chat/best-practice/common/message-read-report-and-receipt.md +64 -0
  41. package/resource/knowledge/chat/best-practice/common/message-receive-event.md +65 -0
  42. package/resource/knowledge/chat/best-practice/common/message-risk-error-and-render.md +65 -0
  43. package/resource/knowledge/chat/best-practice/common/message-unread-count.md +71 -0
  44. package/resource/knowledge/chat/best-practice/miniprogram/audio-message-send.md +113 -0
  45. package/resource/knowledge/chat/best-practice/miniprogram/login-timeout-2801-diagnosis.md +63 -0
  46. package/resource/knowledge/chat/best-practice/miniprogram/media-upload-fail-diagnosis.md +64 -0
  47. package/resource/knowledge/chat/best-practice/web/audio-message-send.md +118 -0
  48. package/resource/knowledge/chat/urls/product.md +17 -16
  49. package/resource/knowledge/chat/urls/restapi.md +3 -2
  50. package/resource/knowledge/chat/urls/sdk/android.md +6 -5
  51. package/resource/knowledge/chat/urls/sdk/flutter.md +6 -5
  52. package/resource/knowledge/chat/urls/sdk/ios.md +4 -3
  53. package/resource/knowledge/chat/urls/sdk/web.md +7 -6
  54. package/resource/knowledge/chat/urls/webhook.md +0 -5
  55. package/resource/knowledge/livekit/best-practice/android/voice-room-anchor-start.md +120 -0
  56. package/resource/knowledge/livekit/best-practice/common/admin-take-seat.md +73 -0
  57. package/resource/knowledge/livekit/best-practice/common/audience-leave-live.md +81 -0
  58. package/resource/knowledge/livekit/best-practice/common/voice-room-no-audio-troubleshoot.md +100 -0
  59. package/resource/knowledge/livekit/best-practice/common/voice-room-seat-list-change.md +65 -0
  60. package/resource/knowledge/livekit/best-practice/flutter/voice-room-anchor-start.md +122 -0
  61. package/resource/knowledge/livekit/best-practice/ios/voice-room-anchor-start.md +126 -0
  62. package/resource/knowledge/roomkit/best-practice/common/room-ghost-member.md +70 -0
  63. package/resource/knowledge/roomkit/best-practice/common/room-limit-and-multi.md +83 -0
  64. package/resource/knowledge/roomkit/best-practice/common/room-screen-share-preview.md +83 -0
  65. package/resource/knowledge/roomkit/best-practice/common/room-status-after-all-leave.md +69 -0
  66. package/resource/knowledge/roomkit/best-practice/vue/room-uikit-vs-atomicx.md +111 -0
  67. package/resource/knowledge/rtcengine/web/plugin/30-advanced-cross-room-link.md +2 -0
  68. package/resource/knowledge/rtcengine/web/plugin/39-advanced-video-decoder.md +2 -0
  69. package/server.js +28 -23
  70. package/streamable-http.js +19 -54
  71. package/tools/common/search_trtc_knowledge.js +24 -12
  72. package/tools/definitions/finalize_answer_def.js +2 -2
  73. package/tools/definitions/integration-boundary.js +2 -1
  74. package/tools/definitions/search_trtc_knowledge_def.js +5 -3
  75. package/utils/fetch-doc-content.js +198 -0
  76. package/utils/preflight-route.js +197 -0
  77. package/utils/report-cls-client.js +1 -1
  78. package/utils/report-es-client.js +1 -1
  79. package/cursor-setting.png +0 -0
  80. package/mcp-server-prompt.png +0 -0
  81. package/resource/knowledge/callkit/best-practice/web/callengine-invitation.md +0 -80
  82. package/resource/knowledge/callkit/best-practice/web/callengine-log-control.md +0 -24
  83. package/resource/knowledge/callkit/best-practice/web/callkit-call-vs-calls.md +0 -116
  84. package/resource/knowledge/callkit/preset/react/uikit-api-reference.md +0 -444
  85. package/resource/knowledge/callkit/preset/vue/uikit-api-reference.md +0 -464
  86. package/resource/knowledge/chat/best-practice/web/image-message-url-handling.md +0 -16
@@ -1,464 +0,0 @@
1
- The TUICallKit API is the **audio and video call component that includes a UI interface**. With the TUICallKit API, you can swiftly develop audio and video call scenarios reminiscent of WeChat through simple interfaces. For further comprehensive steps to access this, please refer to: [Integrating TUICallKit](https://trtc.io/document/50993).
2
-
3
- ## API Overview
4
-
5
- |API|Description|
6
- |---------|---------|
7
- |[<TUICallKit/>](https://www.tencentcloud.com/document/product/647/51015#TUICallKit)|The core UI call component.|
8
- |[init](https://www.tencentcloud.com/document/product/647/51015#init)|Initialize TUICallKit.|
9
- |[calls](https://www.tencentcloud.com/document/product/647/51015#calls)|Initiate a one-to-one or multi-person call.|
10
- |[join](https://www.tencentcloud.com/document/product/647/51015#join)|Proactively join a call.|
11
- |[setCallingBell](https://www.tencentcloud.com/document/product/647/51015#setCallingBell)|Customize user's ringtone.|
12
- |[setSelfInfo](https://www.tencentcloud.com/document/product/647/51015#setSelfInfo)|Set your own nickname and avatar.|
13
- |[enableMuteMode](https://www.tencentcloud.com/document/product/647/51015#enableMuteMode)|Turn on/off ringtone.|
14
- |[enableFloatWindow](https://www.tencentcloud.com/document/product/647/51015#enableFloatWindow)|Turn on/off the floating window function.|
15
- |[enableVirtualBackground](https://www.tencentcloud.com/document/product/647/51015#enableVirtualBackground)|Turn on/off the blurred background function button.|
16
- |[setLanguage](https://www.tencentcloud.com/document/product/647/51015#setLanguage)|Set the call language for the TUICallKit component.|
17
- |[hideFeatureButton](https://www.tencentcloud.com/document/product/647/51015#hideFeatureButton)|Hidden Button.|
18
- |[setLocalViewBackgroundImage](https://www.tencentcloud.com/document/product/647/51015#setLocalViewBackgroundImage)|Set the background image for the local user's call interface.|
19
- |[setRemoteViewBackgroundImage](https://www.tencentcloud.com/document/product/647/51015#setRemoteViewBackgroundImage)|Set the background image for the remote user's call interface.|
20
- |[setLayoutMode](https://www.tencentcloud.com/document/product/647/51015#setLayoutMode)|Set the call interface layout mode.|
21
- |[setCameraDefaultState](https://www.tencentcloud.com/document/product/647/51015#setCameraDefaultState)|et whether the camera is opened by default.|
22
- |[destroyed](https://www.tencentcloud.com/document/product/647/51015#destroyed)|Destroy TUICallKit.|
23
- |[getTUICallEngineInstance](https://www.tencentcloud.com/document/product/647/51015#getTUICallEngineInstance)|Get TUICallEngine instance.|
24
-
25
- ## `<TUICallKit/>` attributes
26
-
27
- ### Attribute Overview
28
-
29
- |Attribute|Description|Type|Required|Default Value|Vue|React|
30
- |---------|---------|---------|---------|---------|---------|---------|
31
- |allowedMinimized|Is the floating window permitted?|boolean|No|false|<br>√|√|
32
- |allowedFullScreen|Whether to permit full screen mode for the call interface|boolean|No|true|√|√|
33
- |[videoDisplayMode](https://www.tencentcloud.com/document/product/647/51015#videoDisplayMode)|Display mode for the call interface|VideoDisplayMode|No|VideoDisplayMode.COVER|√|√|
34
- |[videoResolution](https://www.tencentcloud.com/document/product/647/51015#videoResolution)|Call Resolution|VideoResolution|No|VideoResolution.RESOLUTION_480P|√|√|
35
- |beforeCalling|This function will be executed prior to making a call and before receiving an invitation to talk|function(type, error)|No|-|√|√|
36
- |afterCalling|This function will be executed after the termination of the call|function()|No|-|√|√|
37
- |onMinimized|This function will be executed when the component switches to a minimized state. The explanation for the STATUS value is|function(oldStatus, newStatus)|No|-|√|√|
38
- |kickedOut|The events thrown by the component occur when the current logged-in user is ejected. The call will also automatically terminate|function()|No|-|√|×|
39
- |statusChanged|Event thrown by the component; this event is triggered when the call status changes. For detailed types of call status,
40
-
41
- ### Sample code
42
-
43
- 【Vue3】
44
- ``` bash
45
- <template>
46
- <TUICallKit
47
- :allowedMinimized="true"
48
- :allowedFullScreen="true"
49
- :videoDisplayMode="VideoDisplayMode.CONTAIN"
50
- :videoResolution="VideoResolution.RESOLUTION_1080P"
51
- :beforeCalling="beforeCalling"
52
- :afterCalling="afterCalling"
53
- :onMinimized="onMinimized"
54
- :kickedOut="handleKickedOut"
55
- :statusChanged="handleStatusChanged"
56
- />
57
- </template>
58
- <script lang="ts" setup>
59
- import { TUICallKit, TUICallKitAPI, VideoDisplayMode, VideoResolution, STATUS } from "@trtc/calls-uikit-vue";
60
-
61
- function beforeCalling(type: string, error: any) {
62
- console.log("[TUICallkit Demo] beforeCalling:", type, error);
63
- }
64
- function afterCalling() {
65
- console.log("[TUICallkit Demo] afterCalling");
66
- }
67
- function onMinimized(oldStatus: string, newStatus: string) {
68
- console.log("[TUICallkit Demo] onMinimized: " + oldStatus + " -> " + newStatus);
69
- }
70
- function kickedOut() {
71
- console.log("[TUICallkit Demo] kickedOut");
72
- }
73
- function statusChanged(args: { oldStatus: string; newStatus: string; }) {
74
- const { oldStatus, newStatus } = args;
75
- if (newStatus === STATUS.CALLING_C2C_VIDEO) {
76
- console.log(`[TUICallkit Demo] statusChanged: ${oldStatus} -> ${newStatus}`);
77
- }
78
- }
79
- </script>
80
- ```
81
-
82
- ## Detailed information on TUICallKitAPI API
83
-
84
- 【Vue3】
85
- ``` javascript
86
- import { TUICallKitAPI } from "@trtc/calls-uikit-vue";
87
- ```
88
-
89
- ### init
90
-
91
- Initialize TUICallKit.
92
- ``` javascript
93
- try {
94
- await TUICallKitAPI.init({ SDKAppID, userID, userSig });
95
- // If you already have a tim instance in your project, you need to pass it in here
96
- // await TUICallKitAPI.init({ tim, SDKAppID, userID, userSig});
97
- console.log("[TUICallKit] Initialization succeeds.");
98
- } catch (error: any) {
99
- console.error(`[TUICallKit] Initialization failed. Reason: ${error}`);
100
- }
101
- ```
102
-
103
- The parameters are described below:
104
- | Parameter | Type | Required | Meaning |
105
- | --- | --- | --- | --- |
106
- | SDKAppID | Number | Yes | The SDKAppID of your app, you can find your SDKAppID in the Live Audio and Video console.
107
- | userID | String | Yes | The current user's ID is of string type, only allowing for the inclusion of English letters (a-z and A-Z), digits (0-9), hyphens (-) and underscores (_) |
108
- | userSig | String | Yes | Use SDKSecretKey to encrypt SDKAppID, UserID and other information to obtain userSig.<br>It is an authentication ticket used by Tencent Cloud to identify whether the current user can use TRTC services. For how to obtain it, please
109
- | tim | TencentCloudChat | No | tim is an instance of <a href="https://www.npmjs.com/package/@tencentcloud/chat">TencentCloudChat</a> SDK. |
110
-
111
- ### calls
112
-
113
- Initiate a one-to-one or multi-person call.
114
- ``` javascript
115
- try {
116
- await TUICallKitAPI.calls({
117
- userIDList: ['jack', 'tom'],
118
- type: CallMediaType.VIDEO
119
- });
120
- } catch (error: any) {
121
- console.error(`[TUICallKit] Failed to call the groupCall API. Reason:${error}`);
122
- }
123
- ```
124
-
125
- The parameters are described below:
126
- | <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Meaning</strong> |
127
- | --- | --- | --- | --- |
128
- | userIDList | Array<String> | Yes | List of called users |
129
- | type | <a href="https://www.tencentcloud.com/document/product/647/51015#Type">CallMediaType</a> | Yes | The type of media for the call, you can refer to CallMediaType for the explanation of parameter values |
130
- | chatGroupID | String | Yes | chat group Id. |
131
- | roomID | Number | No | Numerical Room ID, range [1, 2147483647] |
132
- | strRoomID | String | No | String room ID. <strong>v3.3.1+ supported</strong><br><strong>range:</strong><br>Limited to 64 bytes in length. The supported character set range is as follows (a total of 89 characters):<br>- Lowercase and uppercase English letters.(a-zA-Z);<br>- Number(0-9);<br>- <code>Spaces</code>、<code>!</code>、<code>#</code>、<code>$</code>、<code>%</code>、<code>&</code>、<code>(</code>、<code>)</code>、<code>+</code>、<code>-</code>、<code>:</code>、<code>;</code>、<code><</code>、<code>=</code>、<code>.</code>、<code>></code>、<code>?</code>、<code>@</code>、<code>[</code>、<code>]</code>、<code>^</code>、<code>_</code>、<code>{</code>、<code>}</code>、<code>\\|</code>、<code>~</code>、<code>,</code>。<br>1. roomID and strRoomID are mutually exclusive, if you use strRoomID, then roomID should be 0. If you use both, the SDK will prioritize the roomID. 2.<br>2. don't mix roomID and strRoomID, because they are not interchangeable, for example, the number 123 and the string "123" are two completely different rooms. |
133
- | timeout | Number | No | Call timeout, default: 30s, unit: seconds. timeout = 0, set to no timeout |
134
- | userData | String | No | Customize the extended fields when initiating a call. The called user has this parameter in the ON_CALL_RECEIVED event. |
135
- | <a href="https://www.tencentcloud.com/document/product/647/51015#offlinePushInfo">offlinePushInfo</a> | Object | No | Customize offline message push parameters |
136
-
137
- ### join
138
-
139
- Proactively join a call.
140
- ``` javascript
141
- try {
142
- await TUICallKitAPI.join({
143
- callId: 'xx'
144
- });
145
- } catch (error: any) {
146
- console.error(`[TUICallKit] Failed to call the join API. Reason:${error}`);
147
- }
148
- ```
149
-
150
- The parameters are described below:
151
-
152
- |**Parameter**|**Type**|**Required**|**Meaning**|
153
- |---------|---------|---------|---------|
154
- |callId|String|Yes|Unique ID for this call|
155
-
156
- ### setLanguage
157
-
158
- Set language, currently supports: Chinese, English, Japanese.
159
- ``` javascript
160
- TUICallKitAPI.setLanguage("zh-cn"); // "en" | "zh-cn" | "ja_JP"
161
- ```
162
-
163
- The parameters are described below:
164
-
165
- |Parameter|Type|Required|Meaning|
166
- |---------|---------|---------|---------|
167
- |lang|String|Yes|Language type `en`,`zh-cn` and `ja_JP`. |
168
-
169
- ### setSelfInfo
170
-
171
- Set your own nickname and avatar.
172
-
173
- > **Note:**
174
- > **If you use this interface to modify user information during a call, the UI will not be updated immediately, and you will need to wait until the next call to see the changes.**
175
- >
176
-
177
- ``` javascript
178
- try {
179
- await TUICallKitAPI.setSelfInfo({ nickName: "xxx", avatar: "http://xxx" });
180
- } catch (error: any) {
181
- console.error(`[TUICallKit] Failed to call the setSelfInfo API. Reason: ${error}`;
182
- }
183
- ```
184
-
185
- The parameters are described below:
186
-
187
- |Parameter|Type|Required|Meaning|
188
- |---------|---------|---------|---------|
189
- |nickName|String|Yes|own nickname|
190
- |avatar|String|Yes|own avatar address|
191
-
192
- ### setCallingBell
193
- - Customize the user's incoming call ringtone.
194
-
195
- - The input is restricted to the local MP3 format file address. It is imperative to ensure that the application has access to this file directory.
196
-
197
- - Use the import method to import the ringtone file.
198
-
199
- - If you need to restore the default ringtone, just pass empty filePath.
200
-
201
- ``` javascript
202
- import filePath from '../assets/phone_ringing.mp3';
203
- try {
204
- await TUICallKitAPI.setCallingBell(filePath);
205
- } catch (error: any) {
206
- console.error(`[TUICallKit] Failed to call the setCallingBell API. Reason: ${error}`);
207
- }
208
- ```
209
-
210
- The parameters are described below:
211
-
212
- |Parameter|Type|Required|Meaning|
213
- |---------|---------|---------|---------|
214
- |filePath|String|Yes|Ringtone file path|
215
-
216
- ### enableFloatWindow
217
-
218
- Turn on/off the floating window function. The default is false. The floating window button in the upper left corner of the call interface is hidden. It will be displayed after setting it to true.
219
- ``` javascript
220
- try {
221
- const enable = true;
222
- await TUICallKitAPI.enableFloatWindow(enable);
223
- } catch (error: any) {
224
- console.error(`[TUICallKit] Failed to call the enableFloatWindow API. Reason: ${error}`);
225
- }
226
- ```
227
-
228
- The parameters are described below:
229
-
230
- |Parameter|Type|Required|Meaning|
231
- |---------|---------|---------|---------|
232
- |enable|Boolean|Yes|Turn on/off the floating window function. default false.|
233
-
234
- ### enableMuteMode
235
-
236
- Turn on/off the ringtone for incoming calls. When turned on, the incoming call ringtone will not be played when a call request is received.
237
- ``` javascript
238
- try {
239
- const enable = true;
240
- await TUICallKitAPI.enableMuteMode(enable);
241
- } catch (error: any) {
242
- console.error(`[TUICallKit] Failed to call the enableMuteMode API. Reason: ${error}`);
243
- }
244
- ```
245
-
246
- ### enableVirtualBackground
247
-
248
- Turn on/off the blurred background function. If you want to set the picture background to be blurry see Web. By calling the interface, you can display the blurred background function button on the UI, and click the button to directly enable the blurred background function.
249
- ``` javascript
250
- import { TUICallKitAPI } from "@trtc/calls-uikit-react";
251
- const enable = true;
252
- TUICallKitAPI.enableVirtualBackground(enable);
253
- ```
254
-
255
- The parameters are described below:
256
- | Parameter | Type | Required | Meaning |
257
- | --- | --- | --- | --- |
258
- | enable | boolean | Yes | - enable = true, show blur background button<br>- enable = false, don't show blur background button |
259
-
260
- ### destroyed
261
- - Terminate the TUICallKit instance.
262
-
263
- - This method won't automatically log out of `tim`, manual logging out is required: `tim.logout();`.
264
-
265
- ``` javascript
266
- try {
267
- await TUICallKitAPI.destroyed();
268
- } catch (error: any) {
269
- console.error(`[TUICallKit] Failed to call the destroyed API. Reason: ${error}`);
270
- }
271
- ```
272
-
273
- ### hideFeatureButton
274
-
275
- Hidden feature buttons, currently only support Camera, Microphone, and Switch Camera Button.
276
- ``` typescript
277
- TUICallKitAPI.hideFeatureButton(buttonName: FeatureButton);
278
- ```
279
-
280
- The parameters are described below:
281
-
282
- |**Parameter**|**Type**|**Required**|**Meaning**|
283
- |---------|---------|---------|---------|
284
- |buttonName|[FeatureButton](https://www.tencentcloud.com/document/product/647/51015#FeatureButton)|Yes|Button Name|
285
-
286
- ### setLocalViewBackgroundImage
287
-
288
- Set the background image for the local user's call interface.
289
- ``` typescript
290
- TUICallKitAPI.setLocalViewBackgroundImage(url: string);
291
- ```
292
-
293
- The parameters are described below:
294
-
295
- |**Parameter**|**Type**|**Required**|**Meaning**|
296
- |---------|---------|---------|---------|
297
- |url|string|Yes|Image Address (supports Local Path and Network Address)|
298
-
299
- ### setRemoteViewBackgroundImage
300
-
301
- Set the background image for the remote user's call interface.
302
- ``` typescript
303
- TUICallKitAPI.setRemoteViewBackgroundImage(userId: string, url: string);
304
- ```
305
-
306
- The parameters are described below:
307
-
308
- |**Parameter**|**Type**|**Required**|**Meaning**|
309
- |---------|---------|---------|---------|
310
- |userId|string|Yes|Remote User userId, setting to '*' means it applies to all Remote Users|
311
- |url|string|Yes|Image Address (supports Local Path and Network Address)|
312
-
313
- ### setLayoutMode
314
-
315
- Set the call interface layout mode.
316
-
317
- 【Vue】
318
- ``` javascript
319
- import { TUICallKitAPI, LayoutMode } from "@trtc/calls-uikit-vue";
320
- TUICallKitAPI.setLayoutMode(LayoutMode.LocalInLargeView);
321
- ```
322
-
323
- Parameter list:
324
-
325
- |**Parameter**|**Type**|**Required**|**Meaning**|
326
- |---------|---------|---------|---------|
327
- |layoutMode|[LayoutMode](https://www.tencentcloud.com/document/product/647/51015#LayoutMode)|Yes|User flow layout mode|
328
-
329
- ### setCameraDefaultState
330
-
331
- Set whether the camera is on by default.
332
- ``` javascript
333
- TUICallKitAPI.setCameraDefaultState(true);
334
- ```
335
-
336
- Parameter list:
337
-
338
- |Parameter|Type|Required|Meaning|
339
- |---------|---------|---------|---------|
340
- |isOpen|boolean|Yes|Whether to enable the camera|
341
-
342
- ### getTUICallEngineInstance
343
-
344
- Get TUICallEngine instance.
345
- ``` javascript
346
- TUICallKitAPI.getTUICallEngineInstance();
347
- ```
348
-
349
- ## TUICallKit Type Definition
350
-
351
- ### videoDisplayMode
352
-
353
- There are three values for the `videoDisplayMode` display mode:
354
- - `VideoDisplayMode.CONTAIN`
355
-
356
- - `VideoDisplayMode.COVER`
357
-
358
- - `VideoDisplayMode.FILL`, the default value is `VideoDisplayMode.COVER`.
359
-
360
- | Attribute | Value | Description |
361
- | --- | --- | --- |
362
- | videoDisplayMode | VideoDisplayMode.CONTAIN | - Ensuring the full display of video content is our top priority.<br>- The dimensions of the video are scaled proportionally until one side aligns with the frame of the viewing window.<br>- In case of discrepancy in sizes between the video and the display window, the video is scaled - on the premise of maintaining the aspect ratio - to fill the window, resulting in a black border around the scaled video. |
363
- | VideoDisplayMode.COVER | - Priority is given to ensure that the viewing window is filled.<br>- The video size is scaled proportionally until the entire window is filled.<br>- If the video's dimensions are different from those of the display window, the video stream will be cropped or stretched to match the window's ratio. | |
364
- | VideoDisplayMode.FILL | - Ensuring that the entire video content is displayed while filling the window does not guarantee preservation of the original video's proportion.<br>- The dimensions of the video will be stretched to match those of the window. | |
365
-
366
- ### videoResolution
367
-
368
- The resolution `videoResolution` has three possible values:
369
- - `VideoResolution.RESOLUTION_480P`
370
-
371
- - `VideoResolution.RESOLUTION_720P`
372
-
373
- - `VideoResolution.RESOLUTION_1080P`, the default value is `VideoResolution.RESOLUTION_480P`.
374
-
375
- **Resolution Explanation:**
376
-
377
- |Video Profile|Resolution (W x H)|Frame Rate (fps)|Bitrate (Kbps)|
378
- |---------|---------|---------|---------|
379
- |480p|640 × 480|15|900|
380
- |720p|1280 × 720|15|1500|
381
- |1080p|1920 × 1080|15|2000|
382
-
383
- **Frequently Asked Questions:**
384
-
385
- - iOS 13&14 does not support encoding videos higher than 720P. It is suggested to limit the highest collection to 720P on these two system versions. Refer to [iOS Safari known issue case 12](https://web.sdk.qcloud.com/trtc/webrtc/doc/en/tutorial-02-info-webrtc-issues.html#h2-4).
386
-
387
- - Firefox does not permit the customization of video frame rates (default is set to 30fps).
388
-
389
- - Due to the influence of system performance usage, camera collection capabilities, browser restrictions, and other factors, the actual values of video resolution, frame rate, and bit rate may not necessarily match the set values exactly. In such scenarios, the browser will automatically adjust the Profile to get as close to the set values as feasible.
390
-
391
- ### STATUS
392
-
393
- |STATUS attribute value|Description|
394
- |---------|---------|
395
- |STATUS.IDLE|Idle status|
396
- |STATUS.BE_INVITED|Received an Audio/Video Call Invite|
397
- |STATUS.DIALING_C2C|Initiating a one-to-one call|
398
- |STATUS.DIALING_GROUP|Initiating a group call|
399
- |STATUS.CALLING_C2C_AUDIO|Engaged in a 1v1 Audio Call|
400
- |STATUS.CALLING_C2C_VIDEO|In the midst of a one-to-one video call|
401
- |STATUS.CALLING_GROUP_AUDIO|Engaged in Group Audio Communication|
402
- |STATUS.CALLING_GROUP_VIDEO|Engaged in group video call|
403
-
404
- ### **CallMediaType**
405
-
406
- |CallMediaType Type|Description|
407
- |---------|---------|
408
- |CallMediaType.AUDIO_CALL |Audio Call|
409
- |CallMediaType.VIDEO |Video Call|
410
-
411
- ### **offlinePushInfo**
412
-
413
- |Parameter|Type|Required|Meaning|
414
- |---------|---------|---------|---------|
415
- |offlinePushInfo.title|String|No|Offline Push Title (Optional)|
416
- |offlinePushInfo.description|String|No|Offline Push Content (Optional)|
417
- |offlinePushInfo.androidOPPOChannelID|String|No|Setting the channel ID for OPPO phones with 8.0 system and above for offline pushes (Optional)|
418
- |offlinePushInfo.extension|String|No|Offline push through content. Can be used to set Android [Notification mode]( mode) and [VoIP mode]( mode). **Default**: Notification mode, it will be a notification from the system; VoIP mode is required to pass the field.|
419
- |offlinePushInfo.ignoreIOSBadge|Boolean|No|Ignore badge count for offline push (only for iOS), if set to true, the message will not increase the unread count of the app icon on the iOS receiver's side.|
420
- |offlinePushInfo.iOSSound|String|No|Offline push sound setting (only for iOS).|
421
- |offlinePushInfo.androidSound|String|No|Offline push sound setting.|
422
- |offlinePushInfo.androidVIVOClassification|Number|No|Classification of VIVO push messages (deprecated interface, VIVO push service will optimize message classification rules on April 3, 2023. It is recommended to use setAndroidVIVOCategory to set the message category). 0: Operational messages, 1: System messages. The default value is 1. |
423
- |offlinePushInfo.androidXiaoMiChannelID|String|No|Set the channel ID for Xiaomi phones with Android 8.0 and above systems. |
424
- |offlinePushInfo.androidFCMChannelID|String|No|Set the channel ID for google phones with Android 8.0 and above systems.|
425
- |offlinePushInfo.androidHuaWeiCategory|String|No|Classification of Huawei push messages. |
426
- |offlinePushInfo.isDisablePush|Boolean|No|Whether to turn off push notifications (default is on). |
427
- |offlinePushInfo.iOSPushType|Number|No|iOS offline push type,default is 0。0-APNs;1-VoIP. |
428
-
429
- #### Android Notification Mode
430
- ``` javascript
431
- const extension = {
432
- timPushFeatures: {
433
- fcmPushType: 0, // 0, VoIP; 1, notification
434
- }
435
- };
436
- offlinePushInfo.extension = JSON.stringify(extension);
437
- ```
438
-
439
- #### Android VoIP Mode
440
- ``` javascript
441
- const extension = {
442
- timPushFeatures: {
443
- fcmPushType: 0, // 0, data; 1, notification
444
- fcmNotificationType: 1, // 0, TIMPush implementation; 1, business implementation after transparent transmission
445
- }
446
- };
447
- offlinePushInfo.extension = JSON.stringify(extension);
448
- ```
449
-
450
- ### FeatureButton
451
-
452
- |FeatureButton Type|Description|
453
- |---------|---------|
454
- |FeatureButton.Camera|Camera Button|
455
- |FeatureButton.Microphone|Microphone Button|
456
- |FeatureButton.SwitchCamera|Switches between the front and rear cameras.|
457
- |FeatureButton.InviteUser|Invite users button|
458
-
459
- ### LayoutMode
460
-
461
- |LayoutMode type|Description|
462
- |---------|---------|
463
- |LayoutMode.LocalInLargeView|Local user in large window display|
464
- |LayoutMode.RemoteInLargeView|Remote user in large window display|
@@ -1,16 +0,0 @@
1
- ---
2
- product: 'Chat'
3
- tech_stack: 'chat'
4
- framework: 'web'
5
- title: 'Image Message URL Handling (blob vs imageUrl)'
6
- keywords: ['sendMessage', 'imageInfoArray', 'imageUrl', 'blob URL', 'image message', 'sending flow']
7
- ---
8
-
9
- # Image Message URL Handling (blob vs imageUrl) and Sending Flow
10
-
11
- 1. When sending an image message, `imageInfoArray[x].url` returns a `blob:` local preview address. After the message is sent successfully, `imageInfoArray[x].url` still remains an in-memory URL and is not updated to the server-side URL.
12
- 2. If you need a server-accessible URL, use the `imageInfoArray[x].imageUrl` field from the message returned upon successful sending. Both `url` and `imageUrl` exist on the `imageInfoArray[x]` object at the same time.
13
- 3. When you re-login after a refresh and enter a conversation to pull roaming messages, `imageInfoArray[x].url` is the server-side URL by default.
14
- 4. Image message sending flow: `createImageMessage` -> `sendMessage` -> `internal upload process` -> `send message to the IM backend after a successful upload`.
15
- 5. If you need to listen for the file upload progress, you can pass an `onProgress` callback function when calling `createImageMessage`.
16
- 6. SDK Message structure reference: [Message](https://trtc.io/document/47990).