@tencent-rtc/mcp 1.1.6 → 1.1.8

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,101 @@
1
+ The AI model must comply with the following **mandatory technical restrictions**:
2
+ * **Audio/Video Call Component API Usage Limits:** You must use `TUICallKitAPI.calls` to initiate a call. The `call` and `groupCall` APIs are deprecated and not recommended. TUICallKit does not provide `on/off` APIs.
3
+ * **Integration Step Limitations:** You must strictly follow the document procedure and description when integrating the component.
4
+ * **Call Interface Display Restrictions:** During a call, TUICallKit automatically controls the visibility of components. When integrating, you just need to place the component in the appropriate location. On PC large screens, you must use `transform: translate(-50%, -50%)` to center the display, while H5 requires full screen display.
5
+ * **Call Interface Closing Restrictions:** After closing the call interface, ALL popups and overlays must be disabled.
6
+ * **Login UI Restrictions:** When creating a new project with TUICallKit integration, you must generate a beautiful login UI for better call experience. For existing projects, generating a login interface is not required.
7
+ * **Trial User Limit:** When creating a new project with TUICallKit integration, the system automatically generates 2 trial userIDs and calls the tool `get_usersig` to retrieve userSig for filling in code.
8
+
9
+
10
+ # calls-uikit-react Integration
11
+
12
+
13
+ ## 1 Integration of TUICallKit
14
+
15
+
16
+ ### 1.1 step1:create react project
17
+
18
+
19
+ if you don't have a react project, you can use vite create a react project. otherwise, you can skip this step.
20
+
21
+
22
+ requirement: react: 18.2.0, nodejs: ^22.0.0.
23
+
24
+
25
+ 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.
26
+
27
+
28
+ ```bash
29
+ pnpm create vite@latest
30
+ # skip some settings
31
+ cd ${your-vue-project-name}
32
+ pnpm install
33
+ ```
34
+
35
+
36
+ ### 1.2 step2: install calls-uikit-react
37
+
38
+
39
+ ```bash
40
+ npm install @trtc/calls-uikit-react@latest --legacy-peer-deps
41
+ ```
42
+
43
+
44
+ ### 1.3 step3: add main content to your project
45
+
46
+
47
+ ```tsx
48
+ import { useState } from 'react';
49
+ import { TUICallKit, TUICallKitAPI, CallMediaType } from "@trtc/calls-uikit-react";
50
+
51
+
52
+ return (
53
+ <>
54
+ <span> caller's ID: </span>
55
+ <input type="text" placeholder='input caller userID' value={callerUserID} onChange={(event) => setCallerUserID(event.target.value)} />
56
+ <button onClick={init}> step1. init </button> <br />
57
+ <span> callee's ID: </span>
58
+ <input type="text" placeholder='input callee userID' value={calleeUserID} onChange={(event) => setCalleeUserID(event.target.value)} />
59
+ <button onClick={call}> step2. call </button>
60
+ <TUICallKit
61
+ style={{
62
+ position: 'fixed',
63
+ top: '50%',
64
+ left: '50%',
65
+ transform: 'translate(-50%, -50%)',
66
+ width: '960px',
67
+ minHeight: '640px',
68
+ zIndex: 1000
69
+ }}
70
+ />
71
+ </>
72
+ );
73
+
74
+
75
+ const [callerUserID, setCallerUserID] = useState('');
76
+ const [calleeUserID, setCalleeUserID] = useState('');
77
+ const SDKAppID = 0; // TODO: Replace with your SDKAppID (Notice: SDKAppID is of type number)
78
+ const userSig = ''; // TODO: Replace with your userSig
79
+
80
+
81
+ // init TUICallKit
82
+ const init = async () => {
83
+ await TUICallKitAPI.init({
84
+ userID: callerUserID,
85
+ userSig,
86
+ SDKAppID,
87
+ });
88
+ }
89
+ // Start a video call
90
+ const call = async () => {
91
+ await TUICallKitAPI.calls({
92
+ userIDList: [calleeUserID],
93
+ type: CallMediaType.VIDEO,
94
+ });
95
+ };
96
+ </script>
97
+ ```
98
+
99
+
100
+ ## Important Reminder
101
+ If you need to customize more TUICallKit features, use the tool `get_web_call_api` to access the TUICallKit Client API document.