@tencent-rtc/mcp 1.7.2 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +13 -5
- package/knowledge/bm25.js +20 -11
- 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/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/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/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,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Web Chat SDK Disabling/Adjusting Local Browser Log Output (setLogLevel)
|
|
3
|
+
product: chat
|
|
4
|
+
frameworks: [web, miniprogram]
|
|
5
|
+
scope: platform_common
|
|
6
|
+
tags: [setLogLevel, log, log level, disable log, local log, browser log, console log, release, production, create, initialization log]
|
|
7
|
+
version_range: ">=3.0.0"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Web Chat SDK Disabling/Adjusting Local Browser Log Output (setLogLevel)
|
|
11
|
+
|
|
12
|
+
## 1. Key Conclusions
|
|
13
|
+
|
|
14
|
+
- Use `chat.setLogLevel(level)` to control the SDK's local log output level. Setting `level` to `4` disables all SDK log printing.
|
|
15
|
+
- `setLogLevel` must be called **after** the `chat` instance is created via `create`.
|
|
16
|
+
- `setLogLevel` only affects logs produced **after** the call succeeds; initialization logs printed before the call cannot be suppressed. This is expected behavior by design.
|
|
17
|
+
- For production, it is recommended to set the level to `1` (release) so that only critical information is printed, rather than setting it to `4` to disable all logs, in order to retain the diagnostic clues needed for troubleshooting.
|
|
18
|
+
|
|
19
|
+
## 2. Field/Capability Reference
|
|
20
|
+
|
|
21
|
+
| Field/Capability | Purpose | Notes |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `chat.setLogLevel(level)` | Sets the local log level | Must be called after the instance is created via `create` |
|
|
24
|
+
| `level = 0` | Normal level | Verbose output; recommended during integration and debugging |
|
|
25
|
+
| `level = 1` | Release level | Prints only critical information; recommended for production |
|
|
26
|
+
| `level = 2` | Warning level | Prints only warning- and error-level logs |
|
|
27
|
+
| `level = 3` | Error level | Prints only error-level logs |
|
|
28
|
+
| `level = 4` | No-log level | Prints no logs (fully disabled) |
|
|
29
|
+
|
|
30
|
+
## 3. Mechanism/Sequence
|
|
31
|
+
|
|
32
|
+
`create` creates the `chat` instance -> the SDK prints initialization logs (these logs are not controlled by `setLogLevel`) -> call `chat.setLogLevel(level)` -> from the moment the call succeeds, log output is filtered according to the configured level.
|
|
33
|
+
|
|
34
|
+
## 4. Standard Usage
|
|
35
|
+
|
|
36
|
+
1. Call `create` to create the `chat` instance.
|
|
37
|
+
2. Immediately call `chat.setLogLevel(level)` with the target level (pass `4` to disable all logs; pass `1` to keep critical information in production).
|
|
38
|
+
3. To use different levels across environments, set the corresponding `level` after initialization based on your environment variables.
|
|
39
|
+
|
|
40
|
+
``` javascript
|
|
41
|
+
// Set the log level immediately after creating the instance
|
|
42
|
+
const chat = TencentCloudChat.create({ SDKAppID });
|
|
43
|
+
|
|
44
|
+
// Disable all local SDK logs
|
|
45
|
+
chat.setLogLevel(4);
|
|
46
|
+
|
|
47
|
+
// Or: keep only critical information in production
|
|
48
|
+
// chat.setLogLevel(1);
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 5. Result Verification
|
|
52
|
+
|
|
53
|
+
- After setting `level = 4`, no SDK logs appear in the browser console for output produced after the `setLogLevel` call succeeds.
|
|
54
|
+
- After setting `level = 1`, only critical information is printed; warning and normal logs are filtered out.
|
|
55
|
+
- Initialization logs between `create` and `setLogLevel` still appear. This is expected behavior.
|
|
56
|
+
|
|
57
|
+
## 6. Common Pitfalls
|
|
58
|
+
|
|
59
|
+
- Pitfall 1: Expecting `setLogLevel(4)` to also clear initialization logs (logs printed before the call cannot be suppressed).
|
|
60
|
+
- Pitfall 2: Calling `setLogLevel` before `create` (it only takes effect when called after the instance is created).
|
|
61
|
+
- Pitfall 3: Setting `4` directly in production to disable all logs, leaving no logs to investigate online issues (use `1` to retain critical information).
|
|
62
|
+
|
|
63
|
+
## 7. Problem Definition (Retrieval Aid, Minimal)
|
|
64
|
+
|
|
65
|
+
How to disable or adjust local (console) browser log output for the Web/Mini Program Chat SDK.
|
|
66
|
+
|
|
67
|
+
## 8. Synonymous Phrasing Coverage (Retrieval Recall, Minimal)
|
|
68
|
+
|
|
69
|
+
- How do I disable local browser logs in the web IM SDK?
|
|
70
|
+
- What does each `chat.setLogLevel` level mean?
|
|
71
|
+
- How should I set the IM SDK log level in production?
|
|
72
|
+
- Why are initialization logs still printed after I called setLogLevel?
|
|
73
|
+
|
|
74
|
+
## 9. References (Optional)
|
|
75
|
+
|
|
76
|
+
- Web Chat SDK setLogLevel API reference: `https://web.sdk.qcloud.com/im/doc/v3/en/SDK.html#setLogLevel`
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: IM SDK Errors When Running in Desktop WeChat Mini Program (tencent_cloud_im_csig_flutter_for_web_25F_cy is undefined / WebSocket is not a constructor) and the Upgrade Fix
|
|
3
|
+
product: chat
|
|
4
|
+
frameworks: [miniprogram]
|
|
5
|
+
scope: platform_specific
|
|
6
|
+
tags: [desktop WeChat, mac WeChat 4.x, windows WeChat 3.9.x, uniapp mini program, WeChat native mini program, WebSocket is not a constructor, tencent_cloud_im_csig, cannot read properties of undefined, tim-wx-sdk, "@tencentcloud/chat", "@tencentcloud/lite-chat", v2, v3, v4, version upgrade, compatibility]
|
|
7
|
+
version_range: ">=3.5.7"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# IM SDK Errors When Running in Desktop WeChat Mini Program (csig undefined / WebSocket is not a constructor) and the Upgrade Fix
|
|
11
|
+
|
|
12
|
+
## 1. Key Conclusions
|
|
13
|
+
|
|
14
|
+
- The root cause is that the underlying API attributes of desktop WeChat (mac 4.x / windows 3.9.x) mini programs have changed, causing the IM SDK to misidentify its runtime environment.
|
|
15
|
+
- The two errors are different symptoms of the same root cause: a WeChat mini program packaged with uniapp reports `cannot read properties of undefined (reading 'tencent_cloud_im_csig_flutter_for_web_25F_cy')`; a WeChat native mini program reports `TypeError: WebSocket is not a constructor`.
|
|
16
|
+
- This issue has been handled for compatibility in both IM SDK v3 (`3.5.7`) and v4 (`4.2.4`). Upgrading to the latest release of the corresponding major version fixes it.
|
|
17
|
+
- v2/v3/v4 interfaces are backward compatible and allow smooth migration, but v3 and v4 each contain breaking changes. Assess that there is no risk to your business before upgrading.
|
|
18
|
+
|
|
19
|
+
## 2. Field/Capability Reference
|
|
20
|
+
|
|
21
|
+
| Field/Capability | Purpose | Notes |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `tim-wx-sdk` | v2 package name | Legacy version; upgrading to the latest v4 is recommended |
|
|
24
|
+
| `@tencentcloud/chat` | v3 package name | Issue fixed (`>=3.5.7`); v3 no longer receives new features |
|
|
25
|
+
| `@tencentcloud/lite-chat` | v4 package name | Issue fixed (`>=4.2.4`); recommended version |
|
|
26
|
+
| Missing `tencent_cloud_im_csig...` attribute | uniapp mini program error signal | Undefined due to changed underlying API attributes in desktop WeChat |
|
|
27
|
+
| `WebSocket is not a constructor` | Native mini program error signal | Desktop WeChat runtime misidentified; constructor unavailable |
|
|
28
|
+
|
|
29
|
+
## 3. Mechanism/Sequence
|
|
30
|
+
|
|
31
|
+
Desktop WeChat is upgraded (mac 4.x / windows 3.9.x) -> the underlying mini program API attributes change -> the IM SDK misidentifies its runtime environment -> a uniapp-packaged mini program hits undefined when reading the `tencent_cloud_im_csig...` attribute (reporting `cannot read properties of undefined`) or a native mini program fails to construct `WebSocket` (reporting `WebSocket is not a constructor`) -> after upgrading to v3 (`>=3.5.7`) or v4 (`>=4.2.4`) with compatibility handling, the SDK correctly identifies the desktop WeChat runtime and the error disappears.
|
|
32
|
+
|
|
33
|
+
## 4. Standard Usage
|
|
34
|
+
|
|
35
|
+
1. Confirm your current IM SDK version and package name: v2 (`tim-wx-sdk`) / v3 (`@tencentcloud/chat`) / v4 (`@tencentcloud/lite-chat`).
|
|
36
|
+
2. Choose the upgrade target based on your current version:
|
|
37
|
+
- Currently v4 (`@tencentcloud/lite-chat`): upgrade to the latest v4 release.
|
|
38
|
+
- Currently v3 (`@tencentcloud/chat`): upgrade to the latest v3 release (v3 no longer receives new features), or upgrade to the latest v4 release.
|
|
39
|
+
- Currently v2 (`tim-wx-sdk`): upgrade to the latest v4 release.
|
|
40
|
+
3. Before upgrading, read the corresponding migration guide and assess the impact of breaking changes on your business:
|
|
41
|
+
- v3 breaking changes: `https://web.sdk.qcloud.com/im/doc/v3/en/tutorial-07-breakingchanges.html`
|
|
42
|
+
- v2 to v3 guide: `https://web.sdk.qcloud.com/im/doc/v3/en/tutorial-05-integration.html`
|
|
43
|
+
- v4 breaking changes: `https://web.sdk.qcloud.com/im/doc/v3/en/tutorial-04-comparison-v4.html`
|
|
44
|
+
- v3 to v4 guide: `https://web.sdk.qcloud.com/im/doc/v3/en/tutorial-03-integration-v4.html`
|
|
45
|
+
4. Complete the upgrade and verify via regression: rerun the uniapp mini program and the WeChat native mini program on desktop WeChat (mac 4.x / windows 3.9.x) and confirm the errors no longer occur.
|
|
46
|
+
|
|
47
|
+
## 5. Result Verification
|
|
48
|
+
|
|
49
|
+
- After upgrading to v3 (`>=3.5.7`) or v4 (`>=4.2.4`), the uniapp mini program on desktop WeChat no longer reports `cannot read properties of undefined (reading 'tencent_cloud_im_csig...')`.
|
|
50
|
+
- The WeChat native mini program no longer reports `TypeError: WebSocket is not a constructor`.
|
|
51
|
+
- The IM SDK initializes and establishes a connection normally in the desktop WeChat runtime.
|
|
52
|
+
|
|
53
|
+
## 6. Common Pitfalls
|
|
54
|
+
|
|
55
|
+
- Pitfall 1: Assuming it is a uniapp packaging configuration or business code bug (it is actually an SDK environment-identification issue caused by changed underlying desktop WeChat API attributes).
|
|
56
|
+
- Pitfall 2: Considering it resolved after verifying only on mobile WeChat (the issue only appears on desktop WeChat mac 4.x / windows 3.9.x).
|
|
57
|
+
- Pitfall 3: Upgrading across versions without reading breaking changes (v3 and v4 each have breaking changes; assess business impact first).
|
|
58
|
+
- Pitfall 4: Confusing package names (v3 is `@tencentcloud/chat`, v4 is `@tencentcloud/lite-chat`, v2 is `tim-wx-sdk`).
|
|
59
|
+
|
|
60
|
+
## 7. Problem Definition (Retrieval Aid, Minimal)
|
|
61
|
+
|
|
62
|
+
When running the IM SDK in a uniapp-packaged WeChat mini program or a WeChat native mini program on desktop WeChat (mac 4.x / windows 3.9.x), it reports the csig attribute as undefined or `WebSocket is not a constructor`.
|
|
63
|
+
|
|
64
|
+
## 8. Synonymous Phrasing Coverage (Retrieval Recall, Minimal)
|
|
65
|
+
|
|
66
|
+
- What should I do when the desktop WeChat mini program IM SDK reports WebSocket is not a constructor?
|
|
67
|
+
- Why does a uniapp mini program report tencent_cloud_im_csig undefined on mac/windows WeChat?
|
|
68
|
+
- IM initialization fails when running a mini program on Windows 3.9 / Mac 4.x WeChat?
|
|
69
|
+
- Which version should the IM SDK be upgraded to in order to fix desktop WeChat compatibility?
|
|
70
|
+
- How to resolve the missing native WebSocket constructor in the AppService logic layer of the PC WeChat mini program?
|
|
71
|
+
- On PC, tim-im app-service.js reports WebSocket is not a constructor?
|
|
72
|
+
- The mini program logic layer has no native WebSocket constructor / the WebSocket constructor is unavailable?
|
|
73
|
+
|
|
74
|
+
## 9. References (Optional)
|
|
75
|
+
|
|
76
|
+
- v3 breaking changes: `https://web.sdk.qcloud.com/im/doc/v3/en/tutorial-07-breakingchanges.html`
|
|
77
|
+
- v2 to v3 guide: `https://web.sdk.qcloud.com/im/doc/v3/en/tutorial-05-integration.html`
|
|
78
|
+
- v4 breaking changes: `https://web.sdk.qcloud.com/im/doc/v3/en/tutorial-04-comparison-v4.html`
|
|
79
|
+
- v3 to v4 guide: `https://web.sdk.qcloud.com/im/doc/v3/en/tutorial-03-integration-v4.html`
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Whether Screen Sharing Stops Automatically When Leaving the Room/Ending the Meeting in TUIRoomKit Vue3
|
|
3
|
+
product: room
|
|
4
|
+
frameworks: [vue, web]
|
|
5
|
+
scope: platform_specific
|
|
6
|
+
tags: [TUIRoomKit, screen share, stopScreenShare, startScreenShare, leaveRoom, endRoom, leave room, end meeting, close browser, useDeviceState, useRoomState, screenStatus, vue3, Atomicx]
|
|
7
|
+
version_range: ">=2.0.0"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Whether Screen Sharing Stops Automatically When Leaving the Room/Ending the Meeting in TUIRoomKit Vue3
|
|
11
|
+
|
|
12
|
+
## 1. Key Conclusions
|
|
13
|
+
|
|
14
|
+
- Leaving the room (`leaveRoom`), ending the meeting (`endRoom`), and exit actions such as closing the browser or closing the web page all automatically end the current screen share. The business side does not need to manually call `stopScreenShare` again.
|
|
15
|
+
- Screen sharing is part of the room session: leaving the room releases the user's sharing channel, and screen sharing stops accordingly.
|
|
16
|
+
- No extra cleanup code is needed to "stop screen sharing when leaving the room." You only need to explicitly call `stopScreenShare` when **actively stopping** screen sharing during the meeting (without leaving the room).
|
|
17
|
+
- This behavior is consistent between UI-less integration (`tuikit-atomicx-vue3`) and integration with UI (`@tencentcloud/roomkit-web-vue3`).
|
|
18
|
+
|
|
19
|
+
## 2. Field/Capability Reference
|
|
20
|
+
|
|
21
|
+
| Field/Capability | Purpose | Notes |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `startScreenShare` | Starts screen sharing | Provided by `useDeviceState()`; once started, the share is visible to other room members |
|
|
24
|
+
| `stopScreenShare` | Stops screen sharing | Only needs to be called explicitly when **actively stopping during the meeting without leaving the room** |
|
|
25
|
+
| `screenStatus` | Screen share status | Provided by `useDeviceState()`; `DeviceStatus.On` indicates sharing is active |
|
|
26
|
+
| `leaveRoom` | Leave the room | A member exits the room; the member's screen share ends automatically |
|
|
27
|
+
| `endRoom` | End the meeting | The host dismisses the room; screen sharing ends automatically |
|
|
28
|
+
| Close browser/web page | Abnormal/normal exit | Disconnects the room session; screen sharing ends accordingly |
|
|
29
|
+
|
|
30
|
+
## 3. Mechanism/Sequence
|
|
31
|
+
|
|
32
|
+
The user starts screen sharing during the meeting (`startScreenShare`, `screenStatus = On`) -> an exit action is triggered (`leaveRoom` / `endRoom` / closing the browser or web page) -> the room session disconnects and the user's sharing channel is released -> screen sharing stops automatically, and other room members no longer see the shared content.
|
|
33
|
+
|
|
34
|
+
## 4. Standard Usage
|
|
35
|
+
|
|
36
|
+
1. Start screen sharing during the meeting: call `startScreenShare` from `useDeviceState()`.
|
|
37
|
+
2. To stop sharing **without leaving the room**: explicitly call `stopScreenShare`.
|
|
38
|
+
3. When the user leaves the room: just call `leaveRoom` (or the host calls `endRoom`); screen sharing ends automatically, and there is no need to call `stopScreenShare` first.
|
|
39
|
+
4. Exit scenarios such as closing the browser / closing the web page: no extra handling is needed; screen sharing ends automatically as the room session disconnects.
|
|
40
|
+
|
|
41
|
+
## 5. Result Verification
|
|
42
|
+
|
|
43
|
+
- After calling `leaveRoom` / `endRoom`, the user's screen share stops and the shared content disappears for other room members.
|
|
44
|
+
- After closing the browser or web page, other room members no longer receive the user's screen-sharing stream.
|
|
45
|
+
- When staying in the room and calling only `stopScreenShare`, screen sharing stops while the user remains in the room.
|
|
46
|
+
|
|
47
|
+
## 6. Common Pitfalls
|
|
48
|
+
|
|
49
|
+
- Pitfall 1: Assuming you must manually call `stopScreenShare` before leaving, otherwise the screen share lingers (leaving the room ends the share automatically).
|
|
50
|
+
- Pitfall 2: Assuming screen sharing continues after closing the browser/web page (the share ends once the room session disconnects).
|
|
51
|
+
- Pitfall 3: Conflating the responsibilities of `leaveRoom`/`endRoom` with `stopScreenShare` (the former leaves the room and cleans up automatically; the latter only stops sharing without leaving the room).
|
|
52
|
+
|
|
53
|
+
## 7. Problem Definition (Retrieval Aid, Minimal)
|
|
54
|
+
|
|
55
|
+
In TUIRoomKit Vue3, whether screen sharing stops automatically when the user calls `leaveRoom`/`endRoom` or closes the browser/web page.
|
|
56
|
+
|
|
57
|
+
## 8. Synonymous Phrasing Coverage (Retrieval Recall, Minimal)
|
|
58
|
+
|
|
59
|
+
- Does `leaveRoom` / `endRoom` automatically `stopScreenShare`?
|
|
60
|
+
- Does screen sharing continue after leaving the room?
|
|
61
|
+
- Does screen sharing end automatically after closing the browser/web page?
|
|
62
|
+
- Do I need to manually stop screen sharing before leaving the room?
|
|
@@ -0,0 +1,83 @@
|
|
|
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 { callExperimentalAPI } from 'tuikit-atomicx-react';
|
|
48
|
+
import { useLoginState, useRoomState } from 'tuikit-atomicx-react/room';
|
|
49
|
+
|
|
50
|
+
callExperimentalAPI({
|
|
51
|
+
api: 'setNetworkProxy',
|
|
52
|
+
params: {
|
|
53
|
+
im: {
|
|
54
|
+
proxyServer: 'wss://proxy.example.com:8080',
|
|
55
|
+
fileUploadProxy: 'https://proxy.example.com:8080',
|
|
56
|
+
fileDownloadProxy: 'https://proxy.example.com:8080',
|
|
57
|
+
},
|
|
58
|
+
rtc: {
|
|
59
|
+
websocketProxy: 'wss://proxy.example.com/ws/',
|
|
60
|
+
turnServer: [
|
|
61
|
+
{ url: '14.3.3.3:3478', username: 'turn', credential: 'turn' },
|
|
62
|
+
],
|
|
63
|
+
iceTransportPolicy: 'relay',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const { login } = useLoginState();
|
|
69
|
+
await login({ sdkAppId, userId, userSig });
|
|
70
|
+
|
|
71
|
+
const { createAndJoinRoom } = useRoomState();
|
|
72
|
+
await createAndJoinRoom({ roomId });
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## FAQs
|
|
76
|
+
|
|
77
|
+
### A user can join the conference normally on the public network, but cannot join it on the intranet?
|
|
78
|
+
|
|
79
|
+
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.
|
|
80
|
+
|
|
81
|
+
### A user can join the conference but cannot see the remote video or hear the remote audio?
|
|
82
|
+
|
|
83
|
+
Confirm that `turnServer` is reachable, and set `iceTransportPolicy` to `'relay'` in an intranet environment.
|
|
@@ -0,0 +1,83 @@
|
|
|
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 { callExperimentalAPI } from 'tuikit-atomicx-vue3';
|
|
48
|
+
import { useLoginState, useRoomState } from 'tuikit-atomicx-vue3/room';
|
|
49
|
+
|
|
50
|
+
callExperimentalAPI({
|
|
51
|
+
api: 'setNetworkProxy',
|
|
52
|
+
params: {
|
|
53
|
+
im: {
|
|
54
|
+
proxyServer: 'wss://proxy.example.com:8080',
|
|
55
|
+
fileUploadProxy: 'https://proxy.example.com:8080',
|
|
56
|
+
fileDownloadProxy: 'https://proxy.example.com:8080',
|
|
57
|
+
},
|
|
58
|
+
rtc: {
|
|
59
|
+
websocketProxy: 'wss://proxy.example.com/ws/',
|
|
60
|
+
turnServer: [
|
|
61
|
+
{ url: '14.3.3.3:3478', username: 'turn', credential: 'turn' },
|
|
62
|
+
],
|
|
63
|
+
iceTransportPolicy: 'relay',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const { login } = useLoginState();
|
|
69
|
+
await login({ sdkAppId, userId, userSig });
|
|
70
|
+
|
|
71
|
+
const { createAndJoinRoom } = useRoomState();
|
|
72
|
+
await createAndJoinRoom({ roomId });
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## FAQs
|
|
76
|
+
|
|
77
|
+
### A user can join the conference normally on the public network, but cannot join it on the intranet?
|
|
78
|
+
|
|
79
|
+
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.
|
|
80
|
+
|
|
81
|
+
### A user can join the conference but cannot see the remote video or hear the remote audio?
|
|
82
|
+
|
|
83
|
+
Confirm that `turnServer` is reachable, and set `iceTransportPolicy` to `'relay'` in an intranet environment.
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
This document guides developers in implementing cloud recording in the no-UI integration solution for standard meetings. You can control the start and stop of recording through `startRecording()` / `stopRecording()` provided by `useRoomState()`, and monitor recording state changes in real time through `currentRoom.recordingInfo` and `RoomEvent`.
|
|
2
|
+
|
|
3
|
+
> **Version note:**
|
|
4
|
+
>
|
|
5
|
+
> The cloud recording interfaces (`startRecording` / `stopRecording`) are supported since **tuikit-atomicx-vue3 6.4.0** and **tuikit-atomicx-react 6.2.0**. Make sure the version you use meets the requirement.
|
|
6
|
+
>
|
|
7
|
+
|
|
8
|
+
## Prerequisites
|
|
9
|
+
- The user has completed login authentication through `useLoginState`.
|
|
10
|
+
|
|
11
|
+
- The user has entered a standard meeting room through `useRoomState`.
|
|
12
|
+
|
|
13
|
+
- Cloud recording package activation and storage configuration have been completed:
|
|
14
|
+
|
|
15
|
+
- Purchase a Conference SDK package that includes cloud recording capability.
|
|
16
|
+
|
|
17
|
+
- 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.
|
|
18
|
+
|
|
19
|
+
- [Submit a ticket](https://console.cloud.tencent.com/workorder/category), select the **Real-Time Communication** product, and apply to configure the cloud recording storage information for your SDKAppID.
|
|
20
|
+
|
|
21
|
+
## Recording effect
|
|
22
|
+
|
|
23
|
+
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 layout **switches automatically** with the in-meeting state, and the recording task is not restarted during the switch:
|
|
24
|
+
|
|
25
|
+
|**In-meeting state**|**Mixed-stream layout**|**Maximum number of views**|
|
|
26
|
+
|---------|---------|---------|
|
|
27
|
+
|No screen sharing / whiteboard|Grid layout|Up to **25** video views|
|
|
28
|
+
|With screen sharing / whiteboard|Screen sharing layout (sharing as the main view)|Up to **1** screen sharing + **16** video views|
|
|
29
|
+
|Audio only|-|—|
|
|
30
|
+
|
|
31
|
+
## Interface description
|
|
32
|
+
|
|
33
|
+
Conference SDK no-UI integration provides recording control and state subscription capabilities through `useRoomState()`. The recording task is fully managed by the server, and the client is only responsible for starting and stopping it.
|
|
34
|
+
|
|
35
|
+
|**Type**|**Name**|**Description**|
|
|
36
|
+
|---------|---------|---------|
|
|
37
|
+
|Method|`startRecording(): Promise<void>`|Starts cloud recording. Only the **room owner or administrator** can call it, and it must be called after successfully entering the room.|
|
|
38
|
+
|Method|`stopRecording(): Promise<void>`|Stops cloud recording. Only the **room owner or administrator** can call it.|
|
|
39
|
+
|State|`currentRoom.recordingInfo`|The recording information of the current room, including the `status` field (`RecordingStatus.Recording` indicates recording in progress).|
|
|
40
|
+
|Event|`RoomEvent.onRecordingStarted`|Triggered when the recording task starts successfully. The callback parameter is `{ roomInfo, operator }`.|
|
|
41
|
+
|Event|`RoomEvent.onRecordingStopped`|Triggered when the recording task stops. The callback parameter is `{ roomInfo, operator, reason }`. `reason` can distinguish between active stop and abnormal interruption.|
|
|
42
|
+
|
|
43
|
+
## Step 1: Start cloud recording
|
|
44
|
+
|
|
45
|
+
### Permission requirements
|
|
46
|
+
|
|
47
|
+
Only the **room owner or administrator** can call `startRecording()`; other roles calling it will throw a permission error. Only one recording task can exist in the same room at a time, and repeated calls will also return an error.
|
|
48
|
+
|
|
49
|
+
### Sample code
|
|
50
|
+
|
|
51
|
+
【Vue3】
|
|
52
|
+
``` typescript
|
|
53
|
+
import { useRoomState } from 'tuikit-atomicx-vue3/room';
|
|
54
|
+
|
|
55
|
+
const { startRecording } = useRoomState();
|
|
56
|
+
|
|
57
|
+
await startRecording();
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
【React】
|
|
61
|
+
``` typescript
|
|
62
|
+
import { useRoomState } from 'tuikit-atomicx-react/room';
|
|
63
|
+
|
|
64
|
+
const { startRecording } = useRoomState();
|
|
65
|
+
|
|
66
|
+
await startRecording();
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Error handling
|
|
70
|
+
|
|
71
|
+
`startRecording()` throws an error when it fails. Common error cases are as follows:
|
|
72
|
+
|
|
73
|
+
|**Error code**|**Meaning**|**Suggested handling**|
|
|
74
|
+
|---------|---------|---------|
|
|
75
|
+
|`100001`|Backend system error.|Retry later; if it persists, submit a ticket for investigation.|
|
|
76
|
+
|`100004`|The room does not exist.|Confirm that you have successfully entered the room through `createAndJoinRoom()` or `joinRoom()` before calling the recording interface.|
|
|
77
|
+
|`100006`|No permission; must be the room owner or administrator.|Check the current user role; only the room owner or administrator can start recording.|
|
|
78
|
+
|`101072`|The recording configuration does not exist or is not enabled.|Confirm that you have completed the console package activation, ticket configuration, and value-added feature switch. .|
|
|
79
|
+
|
|
80
|
+
【Vue3】
|
|
81
|
+
``` typescript
|
|
82
|
+
import { useRoomState } from 'tuikit-atomicx-vue3/room';
|
|
83
|
+
|
|
84
|
+
const { startRecording } = useRoomState();
|
|
85
|
+
|
|
86
|
+
try {
|
|
87
|
+
await startRecording();
|
|
88
|
+
} catch (error: any) {
|
|
89
|
+
switch (error?.code) {
|
|
90
|
+
case 100001:
|
|
91
|
+
console.error('Backend system error, please retry later.');
|
|
92
|
+
break;
|
|
93
|
+
case 100004:
|
|
94
|
+
console.error('The room does not exist, please confirm you have entered the room before starting recording.');
|
|
95
|
+
break;
|
|
96
|
+
case 100006:
|
|
97
|
+
console.error('Insufficient permission, only the room owner or administrator can start recording.');
|
|
98
|
+
break;
|
|
99
|
+
case 101072:
|
|
100
|
+
console.error('The recording configuration does not exist or is not enabled, please check the console activation configuration.');
|
|
101
|
+
break;
|
|
102
|
+
default:
|
|
103
|
+
console.error('Failed to start recording:', error);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
【React】
|
|
109
|
+
``` typescript
|
|
110
|
+
import { useRoomState } from 'tuikit-atomicx-react/room';
|
|
111
|
+
|
|
112
|
+
const { startRecording } = useRoomState();
|
|
113
|
+
|
|
114
|
+
try {
|
|
115
|
+
await startRecording();
|
|
116
|
+
} catch (error: any) {
|
|
117
|
+
switch (error?.code) {
|
|
118
|
+
case 100001:
|
|
119
|
+
console.error('Backend system error, please retry later.');
|
|
120
|
+
break;
|
|
121
|
+
case 100002:
|
|
122
|
+
console.error('Parameter error, please check the passed parameters.');
|
|
123
|
+
break;
|
|
124
|
+
case 100004:
|
|
125
|
+
console.error('The room does not exist, please confirm you have entered the room before starting recording.');
|
|
126
|
+
break;
|
|
127
|
+
case 100006:
|
|
128
|
+
console.error('Insufficient permission, only the room owner or administrator can start recording.');
|
|
129
|
+
break;
|
|
130
|
+
case 101072:
|
|
131
|
+
console.error('The recording configuration does not exist or is not enabled, please check the console activation configuration.');
|
|
132
|
+
break;
|
|
133
|
+
default:
|
|
134
|
+
console.error('Failed to start recording:', error);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Step 2: Stop cloud recording
|
|
140
|
+
|
|
141
|
+
### Preconditions
|
|
142
|
+
|
|
143
|
+
There is a recording task in progress (`RecordingStatus.Recording`) in the current room.
|
|
144
|
+
|
|
145
|
+
### Permission requirements
|
|
146
|
+
|
|
147
|
+
Only the **room owner or administrator** can call `stopRecording()`.
|
|
148
|
+
|
|
149
|
+
### Sample code
|
|
150
|
+
|
|
151
|
+
【Vue3】
|
|
152
|
+
``` typescript
|
|
153
|
+
import { useRoomState } from 'tuikit-atomicx-vue3/room';
|
|
154
|
+
|
|
155
|
+
const { stopRecording } = useRoomState();
|
|
156
|
+
|
|
157
|
+
try {
|
|
158
|
+
await stopRecording();
|
|
159
|
+
} catch (error: any) {
|
|
160
|
+
console.error('Failed to stop recording:', error);
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
【React】
|
|
165
|
+
``` typescript
|
|
166
|
+
import { useRoomState } from 'tuikit-atomicx-react/room';
|
|
167
|
+
|
|
168
|
+
const { stopRecording } = useRoomState();
|
|
169
|
+
|
|
170
|
+
try {
|
|
171
|
+
await stopRecording();
|
|
172
|
+
} catch (error: any) {
|
|
173
|
+
console.error('Failed to stop recording:', error);
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Step 3: Monitor recording state changes
|
|
178
|
+
|
|
179
|
+
### Preconditions
|
|
180
|
+
- You have successfully entered the room.
|
|
181
|
+
|
|
182
|
+
- It is recommended to subscribe to events **immediately** after entering the room to avoid missing recording notifications initiated by other ends (such as a mobile room owner).
|
|
183
|
+
|
|
184
|
+
### Sample code
|
|
185
|
+
|
|
186
|
+
【Vue3】
|
|
187
|
+
``` typescript
|
|
188
|
+
import { useRoomState, RecordingStatus, RecordingStopReason, RoomEvent } from 'tuikit-atomicx-vue3/room';
|
|
189
|
+
|
|
190
|
+
const { currentRoom, subscribeEvent } = useRoomState();
|
|
191
|
+
|
|
192
|
+
// Actively query the current recording state
|
|
193
|
+
const isRecording = currentRoom.value?.recordingInfo?.status === RecordingStatus.Recording;
|
|
194
|
+
|
|
195
|
+
// Listen for recording start
|
|
196
|
+
subscribeEvent(RoomEvent.onRecordingStarted, ({ operator }) => {
|
|
197
|
+
console.log('Recording started, operator:', operator.userId);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
// Listen for recording stop
|
|
201
|
+
subscribeEvent(RoomEvent.onRecordingStopped, ({ operator, reason }) => {
|
|
202
|
+
if (reason === RecordingStopReason.StoppedByUser) {
|
|
203
|
+
console.log('Recording stopped, operator:', operator.userId);
|
|
204
|
+
} else if (reason === RecordingStopReason.RecorderLeftRoom) {
|
|
205
|
+
console.warn('Recording interrupted abnormally, the recording robot has left the room. Restart recording if needed.');
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
【React】
|
|
211
|
+
``` typescript
|
|
212
|
+
import { useRoomState, RecordingStatus, RecordingStopReason, RoomEvent } from 'tuikit-atomicx-react/room';
|
|
213
|
+
|
|
214
|
+
const { currentRoom, subscribeEvent } = useRoomState();
|
|
215
|
+
|
|
216
|
+
// Actively query the current recording state
|
|
217
|
+
const isRecording = currentRoom?.recordingInfo?.status === RecordingStatus.Recording;
|
|
218
|
+
|
|
219
|
+
// Listen for recording start
|
|
220
|
+
subscribeEvent(RoomEvent.onRecordingStarted, ({ operator }) => {
|
|
221
|
+
console.log('Recording started, operator:', operator.userId);
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
// Listen for recording stop
|
|
225
|
+
subscribeEvent(RoomEvent.onRecordingStopped, ({ operator, reason }) => {
|
|
226
|
+
if (reason === RecordingStopReason.StoppedByUser) {
|
|
227
|
+
console.log('Recording stopped, operator:', operator.userId);
|
|
228
|
+
} else if (reason === RecordingStopReason.RecorderLeftRoom) {
|
|
229
|
+
console.warn('Recording interrupted abnormally, the recording robot has left the room. Restart recording if needed.');
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Error cases
|
|
235
|
+
|
|
236
|
+
The `reason` field of the `onRecordingStopped` event identifies the reason the recording stopped:
|
|
237
|
+
|
|
238
|
+
|**Enum value**|**Value**|**Description**|
|
|
239
|
+
|---------|---------|---------|
|
|
240
|
+
|`RecordingStopReason.StoppedByUser`|`0`|The room owner or administrator actively called `stopRecording()` for a normal stop.|
|
|
241
|
+
|`RecordingStopReason.RecorderLeftRoom`|`1`|The recording robot left the room abnormally and the recording was interrupted. It is recommended to prompt the user and decide whether to restart recording based on business needs.|
|
|
242
|
+
|
|
243
|
+
> **Note:**
|
|
244
|
+
> - The cloud recording feature requires completing package purchase, storage service activation, and ticket configuration in advance. Confirm that you have completed all steps in the **Prerequisites** of this document.
|
|
245
|
+
> - Recording files are stored in the Cloud VOD (VOD) or Cloud Object Storage (COS) you configured. Go to the corresponding console to view and manage them.
|