@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.
Files changed (49) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +25 -17
  3. package/knowledge/bm25.js +20 -11
  4. package/knowledge/path-meta.js +23 -1
  5. package/knowledge/search/generic-rerank.js +123 -0
  6. package/knowledge/search/search-pass.js +8 -1
  7. package/package.json +1 -1
  8. package/resource/index/manifest.json +1 -1
  9. package/resource/knowledge/callkit/best-practice/android/video-chat-dating.md +497 -0
  10. package/resource/knowledge/callkit/best-practice/flutter/android-keep-call-alive-background.md +79 -0
  11. package/resource/knowledge/callkit/best-practice/flutter/background-incoming-call-no-notification.md +99 -0
  12. package/resource/knowledge/callkit/best-practice/flutter/ios-keep-call-alive-background.md +93 -0
  13. package/resource/knowledge/callkit/best-practice/flutter/ios-startup-crash-version-voip.md +68 -0
  14. package/resource/knowledge/callkit/core-sdk/miniprogram/call-engine.md +386 -0
  15. package/resource/knowledge/callkit/core-sdk/miniprogram/call-event.md +315 -0
  16. package/resource/knowledge/callkit/faq/uniapp-miniprogram.md +204 -0
  17. package/resource/knowledge/callkit/preset/harmonyos/api.md +362 -0
  18. package/resource/knowledge/callkit/preset/harmonyos/integration.md +318 -0
  19. package/resource/knowledge/callkit/preset/miniprogram/api-uniapp.md +430 -0
  20. package/resource/knowledge/callkit/preset/miniprogram/api.md +293 -0
  21. package/resource/knowledge/callkit/preset/miniprogram/integration.md +294 -0
  22. package/resource/knowledge/callkit/preset/miniprogram/uniapp-integration.md +224 -0
  23. package/resource/knowledge/callkit/preset/uni-app/api.md +339 -0
  24. package/resource/knowledge/callkit/preset/uni-app/integration.md +243 -0
  25. package/resource/knowledge/chat/best-practice/common/web-sdk-log-level.md +76 -0
  26. package/resource/knowledge/chat/best-practice/miniprogram/desktop-wechat-miniprogram-error.md +79 -0
  27. package/resource/knowledge/chat/preset/react/h5/integration.md +964 -0
  28. package/resource/knowledge/chat/preset/vue/h5/integration.md +717 -0
  29. package/resource/knowledge/roomkit/best-practice/vue/screen-share-auto-stop-on-leave.md +62 -0
  30. package/resource/knowledge/roomkit/core-sdk/react/network-proxy.md +83 -0
  31. package/resource/knowledge/roomkit/core-sdk/vue/network-proxy.md +83 -0
  32. package/resource/knowledge/roomkit/core-sdk/vue/recording.md +245 -0
  33. package/resource/knowledge/roomkit/core-sdk/vue/whiteboard-annotation.md +196 -0
  34. package/resource/knowledge/roomkit/faq/error-code.md +103 -0
  35. package/resource/knowledge/roomkit/preset/harmonyos/integration.md +461 -0
  36. package/resource/knowledge/roomkit/preset/react/features/network-proxy.md +79 -0
  37. package/resource/knowledge/roomkit/preset/uniapp-app/integration.md +580 -0
  38. package/resource/knowledge/roomkit/preset/vue/features/ai-caption-translation.md +69 -0
  39. package/resource/knowledge/roomkit/preset/vue/features/ai-denoiser.md +67 -0
  40. package/resource/knowledge/roomkit/preset/vue/features/network-proxy.md +79 -0
  41. package/resource/knowledge/roomkit/preset/vue/features/recording.md +85 -0
  42. package/resource/knowledge/roomkit/preset/vue/features/whiteboard-annotation.md +86 -0
  43. package/resource/knowledge/rtcengine/web/plugin/23-advanced-support-detection.md +6 -6
  44. package/resource/knowledge/rtcengine/web/plugin/31-advanced-plugins-overview.md +8 -6
  45. package/resource/knowledge/rtcengine/web/plugin/42-advanced-realtime-transcriber.md +30 -10
  46. package/server.js +1 -1
  47. package/utils/preflight-route.js +18 -6
  48. package/utils/report-cls-client.js +1 -1
  49. package/utils/report-es-client.js +1 -1
@@ -0,0 +1,67 @@
1
+ AI noise cancellation is powered by the AI algorithms from Tencent's Tianlai Lab. It can intelligently detect and remove noise interference mixed into the transmitted signal, thereby significantly improving voice quality, enhancing sound clarity, and improving the listening experience. Applying the AI noise cancellation feature in TUIRoomKit lets users get a clear and stable audio experience in various environments such as offices, internet cafes, shopping malls, and outdoors.
2
+
3
+ ## Online experience
4
+
5
+ You can also enter our [Real-Time Communication Experience Center](https://rtcube.cloud.tencent.com/component/experience-center/index.html#/detail) to experience the excellent sound quality delivered by the AI noise cancellation capability online.
6
+
7
+ #
8
+
9
+ ## Enabling AI noise cancellation
10
+
11
+ TUIRoomKit provides a very convenient activation process. You only need two steps to try it out:
12
+ 1. Go to the Real-Time Communication console and select the application you want to enable it for.
13
+
14
+ 2. Go to Value-added Features and turn on the AI noise cancellation switch.
15
+
16
+ Then you can enjoy the better noise cancellation of TUIRoomKit in your application!
17
+
18
+ ## Web asset configuration
19
+
20
+ TUIRoomKit automatically enables AI noise cancellation after the user joins the room, provided that you have completed the following asset configuration:
21
+ 1. Publish the `denoiser-wasm.js` file located in the `node_modules/trtc-sdk-v5/plugins/ai-denoiser` directory to a CDN or static resource server, and make sure the files are under the same public path. For details, see the [AI noise cancellation plugin documentation](https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/zh-cn/tutorial-35-advanced-ai-denoiser.html).
22
+
23
+ 2. Before joining the room, call the following interface to pass the public path above to TUIRoomKit:
24
+
25
+ 【With UI integration】
26
+
27
+ 【Vue3】
28
+ ``` typescript
29
+ import { conference } from '@tencentcloud/roomkit-web-vue3';
30
+
31
+ conference.callExperimentalAPI({
32
+ api: 'setRtcAssetsPath',
33
+ params: { assetsPath: 'XXXXX/assets/' }, // Directory path where the denoiser-wasm.js file is located
34
+ });
35
+ ```
36
+
37
+ 【React】
38
+ ``` typescript
39
+ import { conference } from '@tencentcloud/roomkit-web-react';
40
+
41
+ conference.callExperimentalAPI({
42
+ api: 'setRtcAssetsPath',
43
+ params: { assetsPath: 'XXXXX/assets/' }, // Directory path where the denoiser-wasm.js file is located
44
+ });
45
+ ```
46
+
47
+ 【Without UI integration】
48
+
49
+ 【Vue3】
50
+ ``` typescript
51
+ import { callExperimentalAPI } from 'tuikit-atomicx-vue3';
52
+
53
+ callExperimentalAPI({
54
+ api: 'setRtcAssetsPath',
55
+ params: { assetsPath: 'XXXXX/assets/' }, // Directory path where the denoiser-wasm.js file is located
56
+ });
57
+ ```
58
+
59
+ 【React】
60
+ ``` typescript
61
+ import { callExperimentalAPI } from 'tuikit-atomicx-react';
62
+
63
+ callExperimentalAPI({
64
+ api: 'setRtcAssetsPath',
65
+ params: { assetsPath: 'XXXXX/assets/' }, // Directory path where the denoiser-wasm.js file is located
66
+ });
67
+ ```
@@ -0,0 +1,79 @@
1
+ The Conference SDK is built on Tencent Cloud Chat (IM) and Tencent Real-Time Communication (TRTC). It supports configuring the IM and TRTC proxies together in intranet / firewall environments, which is suitable for scenarios such as private deployment and enterprise intranet isolation where a direct connection to Tencent Cloud services is not available.
2
+
3
+ ## Proxy architecture
4
+
5
+ |Proxy server|Proxy link|
6
+ |---------|---------|
7
+ |IM proxy|Proxies the signaling channels for IM login, message sending/receiving, etc. (WebSocket), as well as the upload and download of resources such as chat images and files.|
8
+ |TRTC WebSocket proxy (e.g. Nginx)|Proxies the signaling channels for TRTC room entry, control, etc. (WebSocket), and is responsible for room management and user state synchronization.|
9
+ |TRTC TURN Server|Relays TRTC audio and video media streams.|
10
+
11
+ > **Note:**
12
+ > The proxy servers (IM proxy, Nginx, TURN) need to be deployed by yourself. For how to set them up, see [TRTC Web SDK handling firewall restrictions](https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/zh-cn/tutorial-34-advanced-proxy.html).
13
+ >
14
+
15
+ ## API and parameters
16
+
17
+ The Conference SDK allows you to configure the intranet proxy uniformly through the `callExperimentalAPI` interface before calling `login()`:
18
+ ``` typescript
19
+ callExperimentalAPI({
20
+ api: 'setNetworkProxy',
21
+ params: {
22
+ im?: { /* IM proxy parameters */ },
23
+ rtc?: { /* TRTC proxy parameters */ },
24
+ },
25
+ });
26
+ ```
27
+
28
+ ### IM proxy parameters
29
+
30
+ |Parameter|Type|Description|
31
+ |---------|---------|---------|
32
+ |`proxyServer`|String|IM signaling WebSocket proxy address.|
33
+ |`fileUploadProxy`|String|IM file upload proxy address.|
34
+ |`fileDownloadProxy`|String|IM file download proxy address.|
35
+
36
+ ### TRTC proxy parameters
37
+
38
+ |Parameter|Type|Description|
39
+ |---------|---------|---------|
40
+ |`websocketProxy`|String|TRTC signaling WebSocket proxy address, e.g. `wss://proxy.example.com/ws/`.|
41
+ |`turnServer`|Array|List of TURN servers. Each item contains `url` / `username` / `credential`.|
42
+ |`iceTransportPolicy`|`'relay' \| 'all'`|Client-side ICE transport policy. In an intranet environment, it is recommended to set it to `'relay'` to force a connection to the TURN server.|
43
+
44
+ ## Sample code
45
+
46
+ ``` typescript
47
+ import { conference } from '@tencentcloud/roomkit-web-vue3';
48
+
49
+ conference.callExperimentalAPI({
50
+ api: 'setNetworkProxy',
51
+ params: {
52
+ im: {
53
+ proxyServer: 'wss://proxy.example.com:8080',
54
+ fileUploadProxy: 'https://proxy.example.com:8080',
55
+ fileDownloadProxy: 'https://proxy.example.com:8080',
56
+ },
57
+ rtc: {
58
+ websocketProxy: 'wss://proxy.example.com/ws/',
59
+ turnServer: [
60
+ { url: '14.3.3.3:3478', username: 'turn', credential: 'turn' },
61
+ ],
62
+ iceTransportPolicy: 'relay',
63
+ },
64
+ },
65
+ });
66
+
67
+ await conference.login({ sdkAppId, userId, userSig });
68
+ await conference.createAndJoinRoom({ roomId });
69
+ ```
70
+
71
+ ## FAQs
72
+
73
+ ### A user can join the conference normally on the public network, but cannot join it on the intranet?
74
+
75
+ Check whether `setNetworkProxy` was called before `login()`. If it is already configured but still fails, check the TURN port and the outbound allowlist of the proxy server.
76
+
77
+ ### A user can join the conference but cannot see the remote video or hear the remote audio?
78
+
79
+ Confirm that `turnServer` is reachable, and set `iceTransportPolicy` to `'relay'` in an intranet environment.
@@ -0,0 +1,85 @@
1
+ This document introduces the cloud recording feature of the Conference SDK. **The Conference SDK integrates mixed-stream room recording by default.** The room owner or administrator can start recording with one click through the client interface and the with-UI integration component, **without the customer building a backend** to call the TRTC cloud API. If the default recording capability does not meet your business needs, refer to Differences from TRTC cloud recording in this document, and refer to [TRTC cloud recording](https://cloud.tencent.com/document/product/647/76497) to integrate it yourself.
2
+
3
+ > **Note:**
4
+ > The Conference SDK cloud recording is implemented based on the [TRTC cloud recording](https://cloud.tencent.com/document/product/647/76497) capability, with typical mixed-stream recording parameters preset for meeting scenarios, helping you complete recording configuration more simply and quickly.
5
+ >
6
+
7
+ ## Prerequisites
8
+
9
+ Before using Conference SDK cloud recording, confirm that you have completed the following steps:
10
+ - You have purchased a Conference SDK package that includes cloud recording capability and obtained the SDKAppID information.
11
+
12
+ - Enable the recording file storage service: Recording files can be stored in [Cloud VOD (VOD)](https://console.cloud.tencent.com/vod) or [Cloud Object Storage (COS)](https://console.cloud.tencent.com/cos). Complete the activation in the corresponding console and record the storage information.
13
+
14
+ - [Submit a ticket](https://console.cloud.tencent.com/workorder/category), select the **Real-Time Communication** product, and state that you need to configure cloud recording storage information (VOD or COS) for the Conference SDK.
15
+
16
+ ## Feature description
17
+
18
+ The Conference SDK provides a **managed cloud recording** solution: The server is responsible for authentication and recording task management, and the customer only needs to configure the recording file storage address. Then, during a meeting, the room owner or administrator can start recording with one click through the client.
19
+
20
+ ## Recording effect
21
+
22
+ The Conference SDK uses **mixed-stream recording** mode by default, mixing the audio and video streams published in the room into one complete recording file. The recording content includes:
23
+ - **Audio**: The voices of all participants in the room.
24
+
25
+ - **Video**: All views with the camera turned on or screen sharing.
26
+
27
+ The recording layout **switches automatically** with the in-meeting state, and the recording task is **not restarted** during the switch:
28
+
29
+ |In-meeting state|Mixed-stream layout|Maximum number of views|
30
+ |---------|---------|---------|
31
+ |No screen sharing / whiteboard|[Grid layout](https://cloud.tencent.com/document/product/647/76497#nine)|Up to **25** video views|
32
+ |With screen sharing / whiteboard|[Screen sharing layout](https://cloud.tencent.com/document/product/647/76497#share) (sharing as the main view)|Up to **1** screen sharing / whiteboard + **16** video views|
33
+ |Audio only|-|—|
34
+
35
+ ## Obtaining files after the meeting
36
+
37
+ After recording ends, the files are stored in the VOD or COS you configured. You can obtain the recording files in the following ways:
38
+ - Go to [Real-Time Communication Console > Application Management](https://console.cloud.tencent.com/trtc/app), and view the recording files stored in Cloud VOD (VOD) under **Recording Management > Recording File Management**.
39
+
40
+ - If stored in Cloud Object Storage (COS), go to the [Cloud Object Storage (COS) console](https://console.cloud.tencent.com/cos) to view them.
41
+
42
+ - For details on finding, receiving, deleting, and playing back files, refer to [Recording file management](https://cloud.tencent.com/document/product/647/76497#file).
43
+
44
+ ## Differences from TRTC cloud recording
45
+
46
+ Both Conference SDK room recording and TRTC cloud recording are based on the underlying TRTC cloud recording service. The SDK has preset mixed-stream recording parameters for meeting scenarios. If you need capabilities such as **specifying subscribed hosts, customizing the mixed-stream layout, or controlling recording start/stop from the server**, you can use TRTC cloud recording to integrate it yourself. The main differences are as follows:
47
+
48
+ |Comparison item|**Conference SDK room recording**|**TRTC cloud recording**|
49
+ |---------|---------|---------|
50
+ |Recording scope|Applicable to rooms created through the Conference SDK under the current SDKAppID.|Applicable to all TRTC rooms under the current SDKAppID (including rooms created directly by other SDKs or the TRTC SDK).|
51
+ |Start method|During a meeting, the room owner or administrator starts and stops recording with one click through the client interface / with-UI component.|Enable global auto-recording in the console, or have a self-built backend call the REST API (e.g. `CreateCloudRecording`) to control recording.|
52
+ |Recording files|By default, **mixed-stream recording** produces one mixed file; the layout switches automatically based on whether there is screen sharing / whiteboard in the meeting (grid layout up to 25 streams, screen sharing layout 1+16 streams).|Global auto-recording is **single-stream** (one file per host); the REST API method can choose single-stream or mixed-stream, and supports custom layouts and subscription lists.|
53
+ |Integration cost|Just submit a ticket to configure the storage address, **no self-built backend required**.|You need to configure a recording template in the TRTC console yourself, or integrate the REST API and callbacks.|
54
+
55
+ > **Note:**
56
+ > - The two solutions can be used at the same time, but this may produce multiple recording files and additional [costs](https://cloud.tencent.com/document/product/647/75047).
57
+ > - If you already use Conference SDK room recording, it is not recommended to also enable TRTC **global auto-recording**, to avoid recording the same room repeatedly.
58
+ > - For configuration and integration details, see [Implementing cloud recording and playback](https://cloud.tencent.com/document/product/647/76497).
59
+
60
+ ## FAQs
61
+
62
+ ### **Can multiple recording solutions be used at the same time?**
63
+
64
+ Multiple recording solutions do not conflict, and you can use multiple recording solutions at the same time, but this will produce multiple recording files and [costs](https://cloud.tencent.com/document/product/647/75047).
65
+
66
+ ### How do I view the recording duration details?
67
+
68
+ You can view some recording duration details in [Real-Time Communication Console > Cloud Recording](https://console.cloud.tencent.com/trtc/cloudrecord):
69
+
70
+ ### How do I manage recording files?
71
+
72
+ The current [recording file management](https://cloud.tencent.com/document/product/647/76497#file) mainly offers the following operations:
73
+
74
+ [Find recording files](https://cloud.tencent.com/document/product/647/76497#find_file), [Receive recording files](https://cloud.tencent.com/document/product/647/76497#receive_file), [Delete recording files](https://cloud.tencent.com/document/product/647/76497#delete_file), [Play back recording files](https://cloud.tencent.com/document/product/647/76497#record_file).
75
+
76
+ ### How do I customize the recording file name?
77
+
78
+ Renaming recording files is not currently supported. Only [API recording](https://cloud.tencent.com/document/product/647/76497#API_record) supports customizing a file name prefix: When storing to Cloud VOD using [API recording](https://cloud.tencent.com/document/product/647/76497#API_record), you can customize the file name prefix through the UserDefineRecordId parameter in [TencentVod](https://cloud.tencent.com/document/api/647/44055#TencentVod). The prefix and the auto-generated recording file name are separated by `_UserDefine_u_`.
79
+
80
+ ### More documentation
81
+ - [Implementing cloud recording and playback](https://cloud.tencent.com/document/product/647/76497)
82
+
83
+ - [Cloud recording server event callbacks](https://cloud.tencent.com/document/product/647/81113)
84
+
85
+ - [Cloud recording billing description](https://cloud.tencent.com/document/product/647/75047)
@@ -0,0 +1,86 @@
1
+ TUIRoomKit has built-in whiteboard and screen sharing annotation. After completing the TUIRoomKit integration, users can use the following in a meeting without writing any extra code:
2
+ - **Whiteboard**: Opens a blank canvas for writing, explaining, and brainstorming.
3
+
4
+ - **Screen sharing annotation**: Circle key points, add arrows, or mark issues on the screen being shared.
5
+
6
+ ## Online experience
7
+
8
+ Visit [TUIRoomKit online experience](https://rtcube.cloud.tencent.com/component/experience-center/index.html#/detail) and enter a meeting scenario to experience the whiteboard and screen sharing annotation.
9
+
10
+ ## Getting started
11
+
12
+ First, refer to [Quick Integration](https://cloud.tencent.com/document/product/647/81962) to integrate `@tencentcloud/roomkit-web-vue3`, and upgrade to version `6.1.0` or later.
13
+
14
+ ### Using the whiteboard
15
+ 1. Enter a **multi-person meeting**.
16
+
17
+ 2. Click **Screen Share** in the bottom toolbar.
18
+
19
+ 3. Select **Whiteboard** from the expanded menu.
20
+
21
+ 4. The whiteboard is immediately shared with other members in the room. The initiator can use tools such as the pen, laser pointer, shapes, arrows, eraser, undo, redo, clear, and save snapshot.
22
+
23
+ Whiteboard in a meeting
24
+
25
+ ### Using screen sharing annotation
26
+ 1. Start screen sharing.
27
+
28
+ 2. Click the **Annotate** button on the shared screen.
29
+
30
+ 3. Use the pen, shapes, or arrows to mark key points on the shared content.
31
+
32
+ 4. After ending screen sharing, the annotation is automatically closed.
33
+
34
+ Annotating on the screen sharing view
35
+
36
+ ## Permission control
37
+
38
+ The whiteboard uses the same permissions as screen sharing:
39
+ - **The room owner and administrators** can prohibit or allow ordinary members from sharing their screen through meeting controls.
40
+
41
+ - **Ordinary members** who are prohibited from sharing their screen cannot start screen sharing, nor can they start the whiteboard.
42
+
43
+ - **Screen sharing annotation** is available only to the current screen sharer. Other members can view the shared view and the annotation content, but cannot draw on that view.
44
+
45
+ If a member cannot see the whiteboard entry, first confirm whether their screen sharing permission has been disabled.
46
+
47
+ ## Disabling the whiteboard and annotation
48
+
49
+ If your application does not need the whiteboard and annotation, you can hide the feature entries:
50
+ ``` typescript
51
+ import {
52
+ BuiltinWidget,
53
+ conference,
54
+ } from '@tencentcloud/roomkit-web-vue3';
55
+
56
+ conference.setWidgetVisible({
57
+ [BuiltinWidget.WhiteboardWidget]: false,
58
+ [BuiltinWidget.AnnotationWidget]: false,
59
+ });
60
+ ```
61
+
62
+ ## Scope of use
63
+ - Supports the latest stable versions of Chrome and Edge on Windows and macOS desktops.
64
+
65
+ - Does not yet support mobile browsers and webinar (Webinar) rooms.
66
+
67
+ - Currently, the initiator draws while other members watch in real time; simultaneous drawing by multiple people is not yet supported.
68
+
69
+ - The whiteboard and regular screen sharing cannot be enabled at the same time. When you need annotation, start screen sharing first, and then start annotation on the shared view.
70
+
71
+ ## FAQs
72
+
73
+ ### Why is there no whiteboard entry in the meeting?
74
+
75
+ Please confirm:
76
+ 1. `@tencentcloud/roomkit-web-vue3` has been upgraded to version **6.1.0** or later.
77
+
78
+ 2. The current room is a multi-person meeting, not a webinar (Webinar) room.
79
+
80
+ 3. The current user has screen sharing permission.
81
+
82
+ 4. You are using desktop Chrome or Edge that supports screen sharing.
83
+
84
+ ### Do I need to close it manually before exiting the meeting?
85
+
86
+ No. When you exit the room, the component automatically stops the whiteboard and releases related resources; screen sharing annotation is also automatically stopped when the sharing ends.
@@ -23,7 +23,7 @@ TRTC.isSupported().then(checkResult => {
23
23
 
24
24
  ### Option 1: Use Device Detector Plugin (including default UI)
25
25
 
26
- The device detector plugin is used to test the user's media device(camera, microphone, speaker) and network which is recommended to be used before the user enters the room.
26
+ The device detector plugin is used to test the user's media device(camera, microphone, speaker) and network which is recommended to be used before the user enters the room.
27
27
 
28
28
  > - Support TRTC Web SDK version >= v5.8.0
29
29
  > - The plugin includes a default UI. If the UI does not meet your product design requirements, you can refer to Option 2 for a custom UI implementation.
@@ -38,7 +38,7 @@ const trtc = TRTC.create({ plugins: [DeviceDetector] });
38
38
  const result = await trtc.startPlugin('DeviceDetector');
39
39
 
40
40
  // 2. Test Media Device & Network Quality
41
- const options = {
41
+ const options = {
42
42
  networkDetect: { sdkAppId, userId, userSig }
43
43
  }
44
44
  const resultWithNetwork = await trtc.startPlugin('DeviceDetector', options);
@@ -70,11 +70,11 @@ Enable the mirror checkbox during camera detection
70
70
 
71
71
  | Name | Type | Attributes | Description |
72
72
  | --------------- | ------ | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
73
- | sdkAppId | string | required | Your sdkAppId |
73
+ | sdkAppId | number | required | Your sdkAppId |
74
74
  | userId | string | required | The userId for testing uplink network quality. It should be different from downlinkUserId. |
75
75
  | userSig | string | required | The [UserSig](https://trtc.io/document/35166) of the userId. |
76
- | downlinkUserId | string | required | The userId for testing downlink network quality. It should be different from userId. Fill in downlinkUserId and downlinkUserSig will perform a downlink network test. |
77
- | downlinkUserSig | string | required | The [UserSig](https://trtc.io/document/35166) of the downlinkUserId. |
76
+ | downlinkUserId | string | optional | The userId for testing downlink network quality. It should be different from userId. Fill in downlinkUserId and downlinkUserSig will perform a downlink network test. |
77
+ | downlinkUserSig | string | optional | The [UserSig](https://trtc.io/document/35166) of the downlinkUserId. |
78
78
  | roomId | number | optional | Optional. The default value is 8080. The value must be an integer of [1, 4294967294] |
79
79
 
80
80
  ##### trtc.stopPlugin('DeviceDetector')
@@ -125,7 +125,7 @@ The device connection checks if the user's device has a camera, microphone, and
125
125
 
126
126
  ```javascript
127
127
  import TRTC from 'trtc-sdk-v5';
128
-
128
+
129
129
  const cameraList = await TRTC.getCameraList();
130
130
  const micList = await TRTC.getMicrophoneList();
131
131
  const hasCameraDevice = cameraList.some(camera => camera.deviceId !== '');
@@ -28,6 +28,7 @@ TRTC Web SDK v5 provides a plugin system that supports on-demand loading of vari
28
28
  | **AIDenoiser** | AI noise reduction with support for far-field cancellation mode | - | Exclusive Edition | Required | {@tutorial 35-advanced-ai-denoiser} |
29
29
  | **VoiceChanger** | Voice effects with 11 voice types (child, loli, uncle, etc.) | ≥ 5.10.0 | Premium Edition | - | {@tutorial 37-advanced-voice-changer} |
30
30
  | **RealtimeTranscriber** | Real-time speech transcription and translation, converting audio to text with multi-language translation | ≥ 5.15.0 | None | - | {@tutorial 42-advanced-realtime-transcriber} |
31
+ | **Chorus** | KTV chorus with lead/backup singer roles, lyrics sync
31
32
 
32
33
  ### Streaming & Mixing
33
34
 
@@ -42,6 +43,7 @@ TRTC Web SDK v5 provides a plugin system that supports on-demand loading of vari
42
43
  |---------|---------|---------|---------|---------|---------|
43
44
  | **DeviceDetector** | Device detection for camera, microphone, speaker, and network with default UI | ≥ 5.8.0 | None | - | {@tutorial 23-advanced-support-detection} |
44
45
  | **Debug** | Debug mode with full log upload/export and audio/video dump | ≥ 5.8.0 | None | - | {@tutorial 18-basic-debug} |
46
+ | **TRTCVideoDecoder** | Video decoder fallback to software decoding on failure | ≥ 5.9
45
47
  | **SmallStreamAutoSwitcher** | Automatic dual-stream switching for smooth streaming in poor network | ≥ 5.11.0 | None | - | {@tutorial 41-advanced-small-stream-auto-switcher} |
46
48
  <!-- | **CustomEncryption** | Custom encryption for end-to-end audio/video encryption with built-in or custom algorithms | - | Contact us | - | - | -->
47
49
 
@@ -61,7 +63,7 @@ import TRTC from 'trtc-sdk-v5';
61
63
  import { VirtualBackground } from 'trtc-sdk-v5/plugins/video-effect/virtual-background';
62
64
  import { AIDenoiser } from 'trtc-sdk-v5/plugins/ai-denoiser';
63
65
 
64
- const trtc = TRTC.create({
66
+ const trtc = TRTC.create({
65
67
  plugins: [VirtualBackground, AIDenoiser],
66
68
  assetsPath: 'https://your-cdn/assets' // If plugins require static assets
67
69
  });
@@ -89,7 +91,7 @@ Use `trtc.updatePlugin(pluginName, options)` to dynamically update plugin parame
89
91
  ```javascript
90
92
  await trtc.updatePlugin('VirtualBackground', {
91
93
  type: 'image',
92
- imageUrl: 'https://example.com/background.jpg'
94
+ src: 'https://example.com/background.jpg'
93
95
  });
94
96
  ```
95
97
 
@@ -164,8 +166,8 @@ await trtc.updatePlugin('VideoMixer', {
164
166
  });
165
167
 
166
168
  // Publish mixed track
167
- await trtc.startLocalVideo({
168
- option: {
169
+ await trtc.startLocalVideo({
170
+ option: {
169
171
  videoTrack: track,
170
172
  profile: { width: 1920, height: 1080, bitrate: 2000 }
171
173
  }
@@ -185,7 +187,7 @@ TRTCVideoDecoder automatically starts fallback logic on decode failure after reg
185
187
  ```javascript
186
188
  import TRTCVideoDecoder from 'trtc-sdk-v5/plugins/video-decoder';
187
189
 
188
- const trtc = TRTC.create({
190
+ const trtc = TRTC.create({
189
191
  plugins: [TRTCVideoDecoder],
190
192
  assetsPath: 'https://your-cdn/assets'
191
193
  });
@@ -309,7 +311,7 @@ cp -r node_modules/trtc-sdk-v5/assets ./public/assets
309
311
  Pass the asset path when creating TRTC instance:
310
312
 
311
313
  ```javascript
312
- const trtc = TRTC.create({
314
+ const trtc = TRTC.create({
313
315
  plugins: [VirtualBackground, AIDenoiser],
314
316
  assetsPath: 'https://your-cdn.com/assets'
315
317
  });
@@ -90,7 +90,7 @@ const robotId = await trtc.startPlugin('RealtimeTranscriber', {
90
90
  trtc.on(TRTC.EVENT.REALTIME_TRANSCRIBER_MESSAGE, (data) => {
91
91
  console.log(`👤 ${data.speakerUserId}:`);
92
92
  console.log(` Original: ${data.sourceText}`);
93
-
93
+
94
94
  if (data.translationTexts) {
95
95
  Object.entries(data.translationTexts).forEach(([lang, text]) => {
96
96
  console.log(` ${lang.toUpperCase()}: ${text}`);
@@ -119,7 +119,7 @@ Starts a real-time transcription task.
119
119
 
120
120
  | Name | Type | Required | Description |
121
121
  |------|------|----------|-------------|
122
- | sourceLanguage | `string` | Required | Source language code, currently supports only `'zh'` and `'en'` |
122
+ | sourceLanguage | `string` | Required | Source language code. Specifies the language of the source audio. Use a standard language code (for example, `'zh'`). For the list of supported languages, see [Supported Languages](#supported-languages) |
123
123
  | translationLanguages | `string` \| `string[]` | Optional | Target translation language(s), supports single language or array, e.g., `'en'` or `['en', 'ja']` |
124
124
  | userIdsToTranscribe | `string` \| `string[]` | Optional | User ID(s) to transcribe, defaults to `'all'` for all users, can also specify single or multiple user IDs |
125
125
  | transcriberRobotId | `string` | Optional | Custom transcriber robot ID, auto-generated if not provided |
@@ -183,6 +183,30 @@ trtc.on(TRTC.EVENT.REALTIME_TRANSCRIBER_STATE_CHANGED, (event) => {
183
183
  });
184
184
  ```
185
185
 
186
+ #### Backend Resource Limitation Notification
187
+
188
+ When the backend AI service (ASR/translation) resources are limited, the SDK proactively notifies through the `TRTC.EVENT.ERROR` event (the backend sends this notification at most once per minute, and stops sending it once resources recover). In this case:
189
+
190
+ - `error.code` is always `5400` (SERVER_ERROR, indicating the server failed to process the request)
191
+ - `error.extraCode` is the downgrade event code, see the table below
192
+ - `error.data` carries `{ roomId, transcriberRobotId, taskId, resourceType }` to identify the affected transcription task
193
+
194
+ You should degrade or disable the relevant AI capabilities in time to avoid affecting your online business.
195
+
196
+ | Event Code (extraCode) | Description | Suggested Action |
197
+ |------------|-------------|------------------|
198
+
199
+ ```javascript
200
+ trtc.on(TRTC.EVENT.ERROR, (error) => {
201
+ if (error.code === 5400 && error.extraCode === 5001) {
202
+ // e.g. error.message: 'The ASR/Translate concurrent usage has exceeded the limit. ...'
203
+ // error.data: { roomId, transcriberRobotId, taskId, resourceType }
204
+ console.warn(`Transcription service resources are limited, robotId: ${error.data.transcriberRobotId}, ${error.message}`);
205
+ // Degrade or disable the relevant AI capabilities as needed
206
+ }
207
+ });
208
+ ```
209
+
186
210
  ### TRTC.EVENT.REALTIME_TRANSCRIBER_MESSAGE
187
211
 
188
212
  Transcription message event, triggered when new transcription results are available.
@@ -204,10 +228,10 @@ Transcription message event, triggered when new transcription results are availa
204
228
  ```javascript
205
229
  trtc.on(TRTC.EVENT.REALTIME_TRANSCRIBER_MESSAGE, (event) => {
206
230
  const { speakerUserId, sourceText, translationTexts, isCompleted } = event;
207
-
231
+
208
232
  // Display real-time transcription result
209
233
  console.log(`[${isCompleted ? 'Completed' : 'In Progress'}] ${speakerUserId}: ${sourceText}`);
210
-
234
+
211
235
  // Display translation results
212
236
  if (translationTexts) {
213
237
  translationTexts.forEach(({ language, text }) => {
@@ -228,10 +252,6 @@ trtc.off(TRTC.EVENT.REALTIME_TRANSCRIBER_MESSAGE, handler);
228
252
  |----------|------|
229
253
  | Chinese | `zh` |
230
254
  | English | `en` |
231
-
232
- <!--
233
- | Traditional Chinese | `zh-tw` |
234
- | Chinese Dialects | `zh-dialect` |
235
255
  | Cantonese | `zh-yue` |
236
256
  | Vietnamese | `vi` |
237
257
  | Japanese | `ja` |
@@ -252,7 +272,7 @@ trtc.off(TRTC.EVENT.REALTIME_TRANSCRIBER_MESSAGE, handler);
252
272
  | Swedish | `sv` |
253
273
  | Danish | `da` |
254
274
  | Norwegian | `no` |
255
- -->
275
+ | For more languages
256
276
 
257
277
  ### Translation Target Languages
258
278
 
@@ -301,7 +321,7 @@ const subtitleMap = new Map();
301
321
 
302
322
  trtc.on(TRTC.EVENT.REALTIME_TRANSCRIBER_MESSAGE, (event) => {
303
323
  subtitleMap.set(event.segmentId, event);
304
-
324
+
305
325
  if (event.isCompleted) {
306
326
  // Speech segment completed, can be archived
307
327
  archiveSubtitle(subtitleMap.get(event.segmentId));
package/server.js CHANGED
@@ -41,7 +41,7 @@ User-visible output rules (MUST):
41
41
  export function createServer() {
42
42
  const server = new McpServer({
43
43
  name: "Tencent RTC MCP Server",
44
- version: "1.7.2",
44
+ version: "1.7.4",
45
45
  }, {
46
46
  instructions: SERVER_INSTRUCTIONS,
47
47
  });
@@ -10,6 +10,10 @@ const PRODUCT_SIGNALS = {
10
10
  // 平台词(纯运行形态,不含任何产品词)
11
11
  const PLATFORM_NATIVE_SIGNAL = /\b(android|ios|flutter|c\+\+|native)\b|安卓\s*(sdk|端|原生)|iOS\s*(SDK|端|原生)|原生\s*(sdk|端)?|native\s+(?:sdk|client|app)|mobile\s+(?:sdk|native)/i;
12
12
  const PLATFORM_WEB_SIGNAL = /\b(web|h5|html5|browser|webview)\b|浏览器|网页|Web端|H5端|网页端|web\s+(?:app|client|page)|in-?browser|mobile\s+browser|安卓\s*(浏览器|网页|H5|Web|webview)|iOS\s*(浏览器|网页|H5|Web|webview)|Android\s*(?:浏览器|网页|H5|Web|webview|browser|web)|iPad\s*(?:浏览器|网页|H5|Web|browser|web)|\b(Safari|Chrome|Edge|UC|QQ浏览器|QQ\s+Browser)\b/i;
13
+ // 小程序信号:小程序 / 微信小程序 / miniprogram / mini program / AppService(小程序逻辑层专有名词)。
14
+ // 命中即锁定 miniprogram,并像 web 一样压制 native 单字与 native 兜底,
15
+ // 避免「PC 微信小程序…没有原生 WebSocket」这类描述里的「原生」被 PLATFORM_NATIVE_SIGNAL 误命中后兜底成 android。
16
+ const PLATFORM_MINIPROGRAM_SIGNAL = /小程序|微信小程序|\bmini[-\s]?program\b|\bminiprogram\b|\bAppService\b/i;
13
17
  // 平台+产品复合词(运行形态 + 产品线路标识)
14
18
  const WEB_PRODUCT_PAIR_SIGNAL = /\bweb\s+(trtc|sdk|im|chat|roomkit)\b|\b(trtc|sdk|im|chat|roomkit)\s+web\b|trtc[-\s]?sdk|trtc\.js/i;
15
19
  // API 词(客户端调用形态)
@@ -42,12 +46,19 @@ function collectPromptSignals(prompt) {
42
46
  if (TRTC_SIGNAL.test(prompt))
43
47
  products.add('trtc');
44
48
  // 平台 tokens:web signal 锁定 → 压制 native 单字(安卓/iOS 仅归 hostEnv);
49
+ // miniprogram signal 锁定 → 同样压制 native 单字与 native 兜底(小程序逻辑层"没有原生 X"不应被判成 native)。
45
50
  // 真复合词(unreal/unity/harmonyos/react-native/flutter/c++)不受影响。
46
51
  const platforms = [];
47
52
  const webLocked = PLATFORM_WEB_SIGNAL.test(prompt) || WEB_PRODUCT_PAIR_SIGNAL.test(prompt);
48
53
  if (webLocked) {
49
54
  platforms.push('web');
50
55
  }
56
+ // 小程序信号优先级高于 native 单字/兜底:命中即锁定 miniprogram。
57
+ // web + 小程序可同时成立(如"小程序 web-view"),各自入 platforms 由 search core 做多平台归并。
58
+ const mpLocked = PLATFORM_MINIPROGRAM_SIGNAL.test(prompt);
59
+ if (mpLocked) {
60
+ platforms.push('miniprogram');
61
+ }
51
62
  const nativeSpecificHits = [];
52
63
  if (/\b(?:unreal|UE[45]?|unreal-engine)\b/i.test(prompt))
53
64
  nativeSpecificHits.push('unreal-engine');
@@ -61,17 +72,18 @@ function collectPromptSignals(prompt) {
61
72
  nativeSpecificHits.push('flutter');
62
73
  if (/\b(?:c\+\+)\b/i.test(prompt))
63
74
  nativeSpecificHits.push('c++');
64
- // 安卓/iOS 单字只在非 web-locked 时进 platforms(web-locked 时仅归 hostEnv)
65
- if (!webLocked && /\b(?:ios|iphone|ipad|苹果)\b/i.test(prompt))
75
+ // 安卓/iOS 单字只在非 web-locked 且非 miniprogram-locked 时进 platforms(否则仅归 hostEnv)
76
+ if (!webLocked && !mpLocked && /\b(?:ios|iphone|ipad|苹果)\b/i.test(prompt))
66
77
  nativeSpecificHits.push('ios');
67
- if (!webLocked && /\b(?:android|安卓)\b/i.test(prompt))
78
+ if (!webLocked && !mpLocked && /\b(?:android|安卓)\b/i.test(prompt))
68
79
  nativeSpecificHits.push('android');
69
- // 真复合词(如 unity/unreal/flutter/harmonyos/react-native/c++)无条件 push;单字在 webLocked 时被压制
80
+ // 真复合词(如 unity/unreal/flutter/harmonyos/react-native/c++)无条件 push;单字在 web/miniprogram 锁定时被压制
70
81
  if (nativeSpecificHits.length > 0) {
71
82
  platforms.push(...nativeSpecificHits);
72
83
  }
73
- else if (!webLocked && PLATFORM_NATIVE_SIGNAL.test(prompt)) {
74
- // 仅 "native" 词,未指定细分 → 默认 android(webLocked 时不触发 fallback,避免被 \b(android|ios|...) 反向命中把 web 路径覆盖成 native)
84
+ else if (!webLocked && !mpLocked && PLATFORM_NATIVE_SIGNAL.test(prompt)) {
85
+ // 仅 "native" 词,未指定细分 → 默认 android(web/miniprogram 锁定时不触发 fallback,
86
+ // 避免被 \b(android|ios|...) 或"原生"反向命中把 web/小程序 路径覆盖成 native)
75
87
  platforms.push('android');
76
88
  }
77
89
  // Host env:仅用于标记,不进 platforms 归一化
@@ -28,7 +28,7 @@ function sendCLSReport(reportData) {
28
28
  const time = Date.now();
29
29
  const data = {
30
30
  platform: 'mcp',
31
- verison: '1.7.2',
31
+ verison: '1.7.4',
32
32
  sdkappid: `${SDKAppID}`,
33
33
  method: method,
34
34
  userid: queryID || userID,
@@ -7,7 +7,7 @@ function reportESClient(reportData) {
7
7
  report: [
8
8
  {
9
9
  platform: 'mcp',
10
- version: '1.7.2',
10
+ version: '1.7.4',
11
11
  sdkappid: `${SDKAppID}`,
12
12
  method: method,
13
13
  userID: `${userID}`,