@tencentcloud/sdk-mcp 1.1.6 → 1.1.7

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.
@@ -0,0 +1,86 @@
1
+ AI 模型必须遵守以下**强制性技术限制**:
2
+ * **音视频通话组件 API 使用限制:** 必须使用 `TUICallKitAPI.calls` API 发起通话, `call` 和 `groupCall` 接口已废弃,不推荐使用,TUICallKit 不提供 `on/off` API。
3
+ * **集成步骤限制:** 在集成组件时必须严格按照文档步骤和说明进行。
4
+ * **通话界面显示限制:** 通话时 TUICallKit 组件会自动控制组件显隐,集成时只需要把组件放在适当的位置即可,PC 大屏中通话时必须使用`transform: translate(-50%, -50%)`控制居中显示, H5 必须全屏显示。
5
+ * **通话界面关闭限制:** 通话界面关闭后所有弹窗和蒙层必须关闭。
6
+ * **登录界面限制:** 创建新项目集成 TUICallKit 时,必须生成一个美观的登录界面 UI,方便进行通话体验,在已有项目中集成时不需要生成登录界面。
7
+ * **体验用户限制:** 创建新项目集成 TUICallKit 时,自动生成 2 个体验 userID,并调用工具 `get_usersig` 获取 userSig 填充在代码中。
8
+
9
+ # calls-uikit-react Integration
10
+
11
+ ## 1 集成 TUICallKit
12
+
13
+ ### 1.1 step1:create react project
14
+
15
+ if you don't have a react project, you can use vite create a react project. otherwise, you can skip this step.
16
+
17
+ requirement: react: 18.2.0, nodejs: ^22.0.0.
18
+
19
+ if it is a new project, guide the user to use vite to create a react project manually, and then continue with step 1.2. if it is an existing project, skip this step and continue with step 1.2.
20
+
21
+ ```bash
22
+ pnpm create vite@latest
23
+ # skip some settings
24
+ cd ${your-vue-project-name}
25
+ pnpm install
26
+ ```
27
+
28
+ ### 1.2 step2: install calls-uikit-react
29
+
30
+ ```bash
31
+ npm install @trtc/calls-uikit-react@latest --legacy-peer-deps
32
+ ```
33
+
34
+ ### 1.3 step3: add main content to your project
35
+
36
+ ```tsx
37
+ import { useState } from 'react';
38
+ import { TUICallKit, TUICallKitAPI, CallMediaType } from "@trtc/calls-uikit-react";
39
+
40
+ return (
41
+ <>
42
+ <span> caller's ID: </span>
43
+ <input type="text" placeholder='input caller userID' value={callerUserID} onChange={(event) => setCallerUserID(event.target.value)} />
44
+ <button onClick={init}> step1. init </button> <br />
45
+ <span> callee's ID: </span>
46
+ <input type="text" placeholder='input callee userID' value={calleeUserID} onChange={(event) => setCalleeUserID(event.target.value)} />
47
+ <button onClick={call}> step2. call </button>
48
+ <TUICallKit
49
+ style={{
50
+ position: 'fixed',
51
+ top: '50%',
52
+ left: '50%',
53
+ transform: 'translate(-50%, -50%)',
54
+ width: '960px',
55
+ minHeight: '640px',
56
+ zIndex: 1000
57
+ }}
58
+ />
59
+ </>
60
+ );
61
+
62
+ const [callerUserID, setCallerUserID] = useState('');
63
+ const [calleeUserID, setCalleeUserID] = useState('');
64
+ const SDKAppID = 0; // TODO: Replace with your SDKAppID (Notice: SDKAppID is of type number)
65
+ const userSig = ''; // TODO: Replace with your userSig
66
+
67
+ // init TUICallKit
68
+ const init = async () => {
69
+ await TUICallKitAPI.init({
70
+ userID: callerUserID,
71
+ userSig,
72
+ SDKAppID,
73
+ });
74
+ }
75
+ // Start a video call
76
+ const call = async () => {
77
+ await TUICallKitAPI.calls({
78
+ userIDList: [calleeUserID],
79
+ type: CallMediaType.VIDEO,
80
+ });
81
+ };
82
+ </script>
83
+ ```
84
+
85
+ ## 重要提醒
86
+ 如果需要自定义实现 TUICallKit 的更多能力,请使用工具 `get_web_call_api` 获取 TUICallKit 客户端 API 文档。