@tencent-rtc/mcp 1.3.0 → 1.3.2
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/index.js +4 -0
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/resource/doc/chatuikit/faq/web_sdk/faq.md +125 -0
- package/resource/doc/chatuikit/flutter/faq.md +17 -114
- package/resource/doc/chatuikit/flutter/integrate_tuikit_Flutter.md +86 -722
- package/resource/doc/chatuikit/react/integration.md +430 -49
- package/resource/doc/chatuikit/react/workflow.md +258 -0
- package/resource/doc/chatuikit/vue/integration.md +355 -144
- package/resource/doc/chatuikit/vue/workflow.md +395 -0
- package/resource/doc/roomkit/vue/features/call-user-to-room.md +256 -0
- package/resource/doc/roomkit/vue/features/device-detection.md +388 -0
- package/resource/doc/roomkit/vue/features/device-state.md +480 -0
- package/resource/doc/roomkit/vue/features/free-beauty-panel.md +238 -0
- package/resource/doc/roomkit/vue/features/room-chat.md +427 -0
- package/resource/doc/roomkit/vue/features/room-participant-state.md +407 -0
- package/resource/doc/roomkit/vue/features/room-state.md +291 -0
- package/resource/doc/roomkit/vue/features/room-view.md +338 -0
- package/resource/doc/roomkit/vue/features/schedule-room.md +349 -0
- package/resource/doc/roomkit/vue/features/screen-share.md +333 -0
- package/resource/doc/roomkit/vue/features/virtual-background.md +287 -0
- package/resource/doc/roomkit/vue/features/workflow.md +553 -0
- package/resource/doc/roomkit/vue/integration.md +479 -0
- package/resource/doc/roomkit/vue/workflow.md +487 -0
- package/resource/doc/tuicallkit/react/api.md +21 -0
- package/resource/doc/tuicallkit/vue/api.md +21 -0
- package/tools/chat/get-web-chat-integration.js +31 -14
- package/tools/chat/get-web-chat-integration.js.map +1 -1
- package/tools/definitions/get_web_chat_uikit_integration_def.js +19 -12
- package/tools/definitions/get_web_chat_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_web_room_feature_detail_def.js +95 -0
- package/tools/definitions/get_web_room_feature_detail_def.js.map +1 -0
- package/tools/definitions/get_web_room_uikit_integration_def.js +44 -0
- package/tools/definitions/get_web_room_uikit_integration_def.js.map +1 -0
- package/tools/index.js +4 -4
- package/tools/index.js.map +1 -1
- package/tools/live/get-web-live-uikit-integration.js +1 -1
- package/tools/room/get-web-room-feature-detail.js +68 -0
- package/tools/room/get-web-room-feature-detail.js.map +1 -0
- package/tools/room/get-web-room-integration.js +43 -0
- package/tools/room/get-web-room-integration.js.map +1 -0
- package/utils/generate-structured-result.js +2 -2
- package/utils/generate-structured-result.js.map +1 -1
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
- package/resource/doc/chatuikit/flutter/integrate_only_tuichat_Flutter.md +0 -333
- package/resource/doc/chatuikit/flutter/quick_start_Flutter.md +0 -217
- package/resource/doc/chatuikit/react/chat_window_integration.md +0 -94
- package/resource/doc/chatuikit/vue/chat_window_integration.md +0 -156
- package/resource/doc/roomkit/vue/states/device-state.md +0 -369
- package/resource/doc/roomkit/vue/states/login-state.md +0 -59
- package/resource/doc/roomkit/vue/states/room-list-state.md +0 -355
- package/resource/doc/roomkit/vue/states/room-participant-state.md +0 -388
- package/tools/chat/get-web-chat-window-integration.js +0 -28
- package/tools/chat/get-web-chat-window-integration.js.map +0 -1
- package/tools/definitions/get_web_chat_window_integration_def.js +0 -26
- package/tools/definitions/get_web_chat_window_integration_def.js.map +0 -1
- package/tools/room/get-web-room-state-detail.js +0 -31
- package/tools/room/get-web-room-state-detail.js.map +0 -1
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
The AI model must comply with the following **hard restrictions**:
|
|
2
|
-
* **Strictly required document procedure integration:** You must perform the integration according to the document procedure and description. In step 1.1, `npm run dev` or `pnpm run dev` is not required. Upon completion, start the project as per step 1.4.
|
|
3
|
-
* **Strictly use the example code in the documentation:** You must strictly use the example code in the document to fill the file when creating a file. For the style tag, non-use of the scoped property is recommended.
|
|
4
|
-
* **Open Default Conversation:** The `C2Cadministrator` conversation must be opened using `setActiveConversation`.
|
|
5
|
-
* **Retrieve userSig using a tool:** The TUIKit code must be downloaded and integrated according to the documentation before automatically generating a test userID and calling the `get_usersig` tool to retrieve the userSig. The userID does not need to be appended with a timestamp to avoid errors in dynamic calculation.
|
|
6
|
-
* **Account Information Filling:** After obtaining the userSig, the SDKAppID, userID, and userSig will be automatically filled into the code.
|
|
7
|
-
* **Prohibit Creating User Information Configuration Files:** The `config` directory or file for filling in SDKAppID, userID, and userSig must not be automatically created.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# chat-uikit-vue3 Integration
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
User's integration needs have two types. You must rationally analyze which type the need belongs to.
|
|
14
|
-
1. Integrate chat window: Refers to integrating only Chat, ChatHeader, MessageList, and MessageInput components.
|
|
15
|
-
2. Integrate call feature: On the basis of integrated chat only, integrate call feature. You must read section 2.1 "Best Practice - Integrate Call Feature" for details.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
1. Seamless integration of chat window
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
### 1.1 step1:create vue3 project
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if you don't have a vue3 project, you can use vite create a vue3 project. otherwise, you can skip this step.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
requirement: vue3: ^3.0.0, nodejs: ^22.0.0.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if it is a new project, guide the user to use vite to create a vue3 project manually, and then continue with step 1.2. if it is an existing project, skip this step and continue with step 1.2.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
pnpm create vite@latest
|
|
37
|
-
# skip some settings
|
|
38
|
-
cd ${your-vue-project-name}
|
|
39
|
-
pnpm install
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
### 1.2 step2: install chat-uikit-vue3
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
use npm or pnpm to install @tencentcloud/chat-uikit-vue3@latest @tencentcloud/call-uikit-vue@latest
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
### 1.3 step3: add main content to your project
|
|
50
|
-
```vue
|
|
51
|
-
<template>
|
|
52
|
-
<UIKitProvider>
|
|
53
|
-
<Chat style="flex: 1;">
|
|
54
|
-
<ChatHeader />
|
|
55
|
-
<MessageList />
|
|
56
|
-
<MessageInput />
|
|
57
|
-
</Chat>
|
|
58
|
-
</UIKitProvider>
|
|
59
|
-
</template>
|
|
60
|
-
<script setup lang="ts">
|
|
61
|
-
import { useLoginState, useConversationListState } from '@tencentcloud/chat-uikit-vue3';
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const userID = ''; // TODO: Replace with your userID
|
|
65
|
-
const SDKAppID = 0; // TODO: Replace with your SDKAppID (Notice: SDKAppID is of type number)
|
|
66
|
-
const userSig = ''; // TODO: Replace with your userSig
|
|
67
|
-
const conversationID = ref('C2Cadministrator'); // define by yourself
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const { login } = useLoginState();
|
|
71
|
-
const { setActiveConversation } = useConversationListState();
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
login({
|
|
75
|
-
sdkAppId : SDKAppID,
|
|
76
|
-
userId: userID,
|
|
77
|
-
userSig: userSig,
|
|
78
|
-
})
|
|
79
|
-
.then(() => {
|
|
80
|
-
setActiveConversation(conversationID.value);
|
|
81
|
-
})
|
|
82
|
-
.catch(() => {});
|
|
83
|
-
</script>
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
### 1.4 step4: start your project
|
|
88
|
-
```bash
|
|
89
|
-
pnpm run dev
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
Best Practices
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
The following components can be retrieved via MCP Tools get_component_detail ${componenetname.tolowercase()}.
|
|
97
|
-
The following states can be retrieved via MCP Tools get_state_detail ${statename.tolowercase()}.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
Focus
|
|
101
|
-
1. If necessary, integrate the ChatSetting component, please read the ChatHeaderRight slot description in ChatHeader.
|
|
102
|
-
2. Since integrated chat only does not use ConversationList, you need to obtain activeConversation via useConversationListState of ConversationListState, then call setActiveConversation to set activeConversation.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
### 2.1 Best Practice - Seamless Integration of Call Feature
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
Integrate call feature: On the basis of integrated chat only, add code for call feature.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
Introduce TUICallKit.
|
|
112
|
-
```vue
|
|
113
|
-
<script setup lang="ts">
|
|
114
|
-
import { TUICallKit } from '@tencentcloud/call-uikit-vue';
|
|
115
|
-
</script>
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
Add TUICallKit at the appropriate position:
|
|
120
|
-
```vue
|
|
121
|
-
<Teleport to="body">
|
|
122
|
-
<TUICallKit style="position: fixed; z-index: 1000;"/>
|
|
123
|
-
</Teleport>
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
Focus
|
|
128
|
-
1. Add a call button to the ChatHeaderRight slot in the ChatHeader Component.
|
|
129
|
-
2. Click the call button to call the following method:
|
|
130
|
-
2.1 Read the ConversationListState document and use activeConversation to judge whether it is a single chat or group chat.
|
|
131
|
-
2.2 If it is a one-to-one chat, use `import { TUICallKitServer, TUICallType } from '@tencentcloud/call-uikit-vue';` to introduce the TUICallKitService service. Initiate call via the `calls` method of TUICallKitService.
|
|
132
|
-
```ts
|
|
133
|
-
try {
|
|
134
|
-
await TUICallKitServer.calls({
|
|
135
|
-
userIDList: [activeConversation.value.userProfile.userID],
|
|
136
|
-
type: TUICallType.VIDEO_CALL, // or TUICallType.AUDIO_CALL
|
|
137
|
-
});
|
|
138
|
-
} catch (error: any) {
|
|
139
|
-
console.error(`[TUICallKit] Failed to call the groupCall API. Reason:${error}`);
|
|
140
|
-
}
|
|
141
|
-
```
|
|
142
|
-
2.3 If it is a group chat, read the UserPicker component document. It is advisable to combine with the Dialog component and pop up the UserPicker component.
|
|
143
|
-
Read the GroupSettingState document, combine GroupSettingState's `getGroupMemberList` and `allMembers` to get the group member list.
|
|
144
|
-
```ts
|
|
145
|
-
try {
|
|
146
|
-
await TUICallKitServer.calls({
|
|
147
|
-
userIDList: selectedItems.map((item: any) => item.key),
|
|
148
|
-
type: TUICallType.VIDEO_CALL, // or TUICallType.AUDIO_CALL
|
|
149
|
-
});
|
|
150
|
-
} catch (error: any) {
|
|
151
|
-
console.error(`[TUICallKit] Failed to call the groupCall API. Reason:${error}`);
|
|
152
|
-
}
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
Recommendation: Combine the `reachEnd` event of UserPicker with paged pull to get group members, and use traffic throttling to control the call frequency of `getGroupMemberList`.
|
|
@@ -1,369 +0,0 @@
|
|
|
1
|
-
# Device State Documentation
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
## Install dependency
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
You can choose any method below for dependency installation:
|
|
8
|
-
[npm]
|
|
9
|
-
``` bash
|
|
10
|
-
npm install tuikit-atomicx-vue3@latest --save
|
|
11
|
-
```
|
|
12
|
-
[pnpm]
|
|
13
|
-
``` bash
|
|
14
|
-
pnpm add tuikit-atomicx-vue3@latest
|
|
15
|
-
```
|
|
16
|
-
[yarn]
|
|
17
|
-
``` bash
|
|
18
|
-
yarn add tuikit-atomicx-vue3@latest
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## Enums
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
### DeviceError
|
|
26
|
-
Device error enumeration
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
```typescript
|
|
30
|
-
export enum DeviceError {
|
|
31
|
-
NoError = 0, // No error
|
|
32
|
-
NoDeviceDetected = 1, // No device detected
|
|
33
|
-
NoSystemPermission = 2, // No system permission
|
|
34
|
-
NotSupportCapture = 3, // Capture not supported
|
|
35
|
-
OccupiedError = 4, // Device occupied
|
|
36
|
-
UnknownError = 5, // Unknown error
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
### AudioRoute
|
|
42
|
-
Audio route enumeration
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
```typescript
|
|
46
|
-
export enum AudioRoute {
|
|
47
|
-
Speakerphone = 0, // Speaker
|
|
48
|
-
Earpiece = 1, // Earpiece
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
### MirrorType
|
|
54
|
-
Image Type Enumeration
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
```typescript
|
|
58
|
-
export enum MirrorType {
|
|
59
|
-
Auto = 0, // Automatic
|
|
60
|
-
Enable = 1, // Enable
|
|
61
|
-
Disable = 2, // Disable
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
### DeviceType
|
|
67
|
-
Device Type enumeration
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
```typescript
|
|
71
|
-
export enum DeviceType {
|
|
72
|
-
Microphone = 'Microphone', // Microphone
|
|
73
|
-
Camera = 'Camera', // Camera
|
|
74
|
-
ScreenShare = 'ScreenShare', // Screen sharing
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
### VideoQuality
|
|
80
|
-
Video quality enumeration
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
```typescript
|
|
84
|
-
export enum VideoQuality {
|
|
85
|
-
Quality360P = 1, // 360P resolution
|
|
86
|
-
Quality540P = 2, // 540P resolution
|
|
87
|
-
Quality720P = 3, // 720P resolution
|
|
88
|
-
Quality1080P = 4, // 1080P resolution
|
|
89
|
-
}
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
### DevicePermission
|
|
94
|
-
Device permission enumeration
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
```typescript
|
|
98
|
-
export enum DevicePermission {
|
|
99
|
-
PublishAudio = 'PublishAudio', // Publish audio permission
|
|
100
|
-
PublishVideo = 'PublishVideo', // Publish video permission
|
|
101
|
-
ScreenShare = 'ScreenShare', // Screen sharing permission
|
|
102
|
-
}
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
### MediaSettingDisplayMode
|
|
107
|
-
Media settings display mode enumerate
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
```typescript
|
|
111
|
-
export enum MediaSettingDisplayMode {
|
|
112
|
-
Icon = 'Icon', // Icon mode only
|
|
113
|
-
IconWithPanel = 'IconWithPanel', // Icon with panel mode
|
|
114
|
-
Panel = 'Panel', // Panel mode only
|
|
115
|
-
}
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
### DeviceStatus
|
|
120
|
-
Device status enumeration
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
```typescript
|
|
124
|
-
export enum DeviceStatus {
|
|
125
|
-
Off = 0, // Off
|
|
126
|
-
On = 1, // On
|
|
127
|
-
}
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
### NetworkQuality
|
|
132
|
-
Network quality enumeration
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
```typescript
|
|
136
|
-
export enum NetworkQuality {
|
|
137
|
-
Unknown = 0, // Unknown
|
|
138
|
-
Excellent = 1, // Excellent
|
|
139
|
-
Good = 2, // Good
|
|
140
|
-
Poor = 3, // Poor
|
|
141
|
-
Bad = 4, // Bad
|
|
142
|
-
VeryBad = 5, // Poor
|
|
143
|
-
Down = 6, // Disconnected
|
|
144
|
-
}
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
## Interfaces
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
### VideoSettingProps
|
|
152
|
-
Video settings property API
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
```typescript
|
|
156
|
-
export interface VideoSettingProps {
|
|
157
|
-
displayMode: MediaSettingDisplayMode; // Display mode (required)
|
|
158
|
-
supportSwitchCamera?: boolean; // Whether switching camera is supported (optional)
|
|
159
|
-
supportSwitchResolution?: boolean; // Whether switching resolution is supported (optional)
|
|
160
|
-
supportVideoPreview?: boolean; // Whether video preview is supported (optional)
|
|
161
|
-
supportSwitchMirror?: boolean; // Whether switching mirror is supported (optional)
|
|
162
|
-
}
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
Attribute description
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
-**displayMode**: Set the display mode to determine the UI presentation form
|
|
170
|
-
- **supportSwitchCamera**: Whether to allow user access to switch between front and rear cameras
|
|
171
|
-
- **supportSwitchResolution**: Whether to allow user access to switch video resolution
|
|
172
|
-
- **supportVideoPreview**: Whether to display video preview
|
|
173
|
-
- **supportSwitchMirror**: Whether to allow user access to toggle the video mirror effect
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
### AudioSettingProps
|
|
177
|
-
Audio settings property API
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
```typescript
|
|
181
|
-
export interface AudioSettingProps {
|
|
182
|
-
displayMode: MediaSettingDisplayMode; // Display mode (required)
|
|
183
|
-
supportSwitchMicrophone?: boolean; // Whether switching microphone is supported (optional)
|
|
184
|
-
supportSwitchSpeaker?: boolean; // Whether switching speaker is supported (optional)
|
|
185
|
-
supportAudioLevel?: boolean; // Whether audio level display is supported (optional)
|
|
186
|
-
}
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
Attribute description
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
-**displayMode**: Set the display mode to determine the UI presentation form
|
|
194
|
-
- **supportSwitchMicrophone**: Whether to allow user access to switch microphone device
|
|
195
|
-
- **supportSwitchSpeaker**: Whether to allow user access to switch speaker device
|
|
196
|
-
- **supportAudioLevel**: Whether to display the audio level indicator
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
### NetworkInfo
|
|
200
|
-
Network information API
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
```typescript
|
|
204
|
-
export interface NetworkInfo {
|
|
205
|
-
quality: NetworkQuality; // Network quality level
|
|
206
|
-
upLoss: number; // Upstream packet loss rate (percentage)
|
|
207
|
-
downLoss: number; // Downstream packet loss rate (percentage)
|
|
208
|
-
delay: number; // Network delay (ms)
|
|
209
|
-
}
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
Attribute description
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
-**quality**: Network quality level, for quick network condition judgment
|
|
217
|
-
- **upLoss**: Uplink packet loss rate, typically ranging from 0-100
|
|
218
|
-
- **downLoss**: Downlink packet loss rate, typically ranging from 0-100
|
|
219
|
-
- **delay**: Network round-trip delay time (milliseconds)
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
## Example
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
Video Settings Configuration Example
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
```typescript
|
|
229
|
-
const videoSettings: VideoSettingProps = {
|
|
230
|
-
displayMode: MediaSettingDisplayMode.IconWithPanel,
|
|
231
|
-
supportSwitchCamera: true,
|
|
232
|
-
supportSwitchResolution: true,
|
|
233
|
-
supportVideoPreview: true,
|
|
234
|
-
supportSwitchMirror: false
|
|
235
|
-
};
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
Audio Settings Configuration Example
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
```typescript
|
|
243
|
-
const audioSettings: AudioSettingProps = {
|
|
244
|
-
displayMode: MediaSettingDisplayMode.Panel,
|
|
245
|
-
supportSwitchMicrophone: true,
|
|
246
|
-
supportSwitchSpeaker: true,
|
|
247
|
-
supportAudioLevel: true
|
|
248
|
-
};
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
Network information usage example
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
```typescript
|
|
256
|
-
const networkInfo: NetworkInfo = {
|
|
257
|
-
quality: NetworkQuality.Good,
|
|
258
|
-
upLoss: 2.5,
|
|
259
|
-
downLoss: 1.8,
|
|
260
|
-
delay: 45
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
// Display notification based on network quality
|
|
265
|
-
function getNetworkStatusText(info: NetworkInfo): string {
|
|
266
|
-
switch (info.quality) {
|
|
267
|
-
case NetworkQuality.Excellent:
|
|
268
|
-
return "Network condition is excellent";
|
|
269
|
-
case NetworkQuality.Good:
|
|
270
|
-
return "Network condition is good";
|
|
271
|
-
case NetworkQuality.Poor:
|
|
272
|
-
return "Network condition is poor";
|
|
273
|
-
default:
|
|
274
|
-
return "Network condition is unknown";
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
## Must-Knows
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
1. **Device permission**: Ensure you obtain appropriate system permission before using the camera and microphone.
|
|
284
|
-
2. **Error handling**: It is recommended to provide corresponding user notifications based on the `DeviceError` enumeration value.
|
|
285
|
-
3. **Network monitoring**: Perform periodic checks on `NetworkInfo` to optimize user experience.
|
|
286
|
-
4. **Device compatibility**: Video quality and features may vary by device.
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
## API and event usage example
|
|
290
|
-
```typescript
|
|
291
|
-
import { useDeviceState } from 'tuikit-atomicx-vue3';
|
|
292
|
-
const {
|
|
293
|
-
Microphone data
|
|
294
|
-
microphoneStatus,
|
|
295
|
-
microphoneList,
|
|
296
|
-
currentMicrophone,
|
|
297
|
-
microphoneLastError,
|
|
298
|
-
isMicrophoneTesting,
|
|
299
|
-
currentMicVolume,
|
|
300
|
-
captureVolume,
|
|
301
|
-
testingMicVolume,
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
camera data
|
|
305
|
-
cameraStatus,
|
|
306
|
-
cameraList,
|
|
307
|
-
currentCamera,
|
|
308
|
-
cameraLastError,
|
|
309
|
-
isCameraTesting,
|
|
310
|
-
isCameraTestLoading,
|
|
311
|
-
isFrontCamera,
|
|
312
|
-
localMirrorType,
|
|
313
|
-
localVideoQuality,
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
speaker data
|
|
317
|
-
speakerList,
|
|
318
|
-
currentSpeaker,
|
|
319
|
-
outputVolume,
|
|
320
|
-
currentAudioRoute,
|
|
321
|
-
isSpeakerTesting,
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
screen sharing data
|
|
325
|
-
screenStatus,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
Local network data
|
|
329
|
-
networkInfo,
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
// Microphone operation
|
|
333
|
-
openLocalMicrophone,
|
|
334
|
-
closeLocalMicrophone,
|
|
335
|
-
muteLocalAudio,
|
|
336
|
-
unmuteLocalAudio,
|
|
337
|
-
getMicrophoneList,
|
|
338
|
-
setCurrentMicrophone,
|
|
339
|
-
startMicrophoneTest,
|
|
340
|
-
stopMicrophoneTest,
|
|
341
|
-
setCaptureVolume,
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
// Speaker operation
|
|
345
|
-
getSpeakerList,
|
|
346
|
-
setCurrentSpeaker,
|
|
347
|
-
setAudioRoute,
|
|
348
|
-
startSpeakerTest,
|
|
349
|
-
stopSpeakerTest,
|
|
350
|
-
setOutputVolume,
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
camera operation
|
|
354
|
-
openLocalCamera,
|
|
355
|
-
closeLocalCamera,
|
|
356
|
-
getCameraList,
|
|
357
|
-
setCurrentCamera,
|
|
358
|
-
switchCamera,
|
|
359
|
-
switchMirror,
|
|
360
|
-
updateVideoQuality,
|
|
361
|
-
startCameraDeviceTest,
|
|
362
|
-
stopCameraDeviceTest,
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
Screen Sharing
|
|
366
|
-
startScreenShare,
|
|
367
|
-
stopScreenShare,
|
|
368
|
-
} = useDeviceState();
|
|
369
|
-
```
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# Room LoginState Documentation
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Room component login API document.
|
|
5
|
-
|
|
6
|
-
## Install dependency
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
you can choose any method below for dependency installation:
|
|
10
|
-
[npm]
|
|
11
|
-
``` bash
|
|
12
|
-
npm install tuikit-atomicx-vue3@latest --save
|
|
13
|
-
```
|
|
14
|
-
[pnpm]
|
|
15
|
-
``` bash
|
|
16
|
-
pnpm add tuikit-atomicx-vue3@latest
|
|
17
|
-
```
|
|
18
|
-
[yarn]
|
|
19
|
-
``` bash
|
|
20
|
-
yarn add tuikit-atomicx-vue3@latest
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
## API usage example
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```typescript
|
|
28
|
-
import { useLoginState } from 'tuikit-atomicx-vue3';
|
|
29
|
-
const {
|
|
30
|
-
loginUserInfo,
|
|
31
|
-
login,
|
|
32
|
-
logout,
|
|
33
|
-
setSelfInfo,
|
|
34
|
-
} = useLoginState();
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// Log in.
|
|
38
|
-
login({
|
|
39
|
-
userId: 'xxx';
|
|
40
|
-
userSig: 'xxx';
|
|
41
|
-
sdkAppId: 0;
|
|
42
|
-
}).then(() => {
|
|
43
|
-
// Get logged-in user info after successful login
|
|
44
|
-
const { userId, userName, avatarUrl, customInfo } = loginUserInfo;
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// Log out
|
|
49
|
-
logout();
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
// Set user information
|
|
53
|
-
setSelfInfo({
|
|
54
|
-
userName: 'xxx',
|
|
55
|
-
avatarUrl: 'xxx',
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
```
|