@tencent-rtc/mcp 1.6.6 → 1.6.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.
- package/knowledge/build-index.js +3 -0
- package/knowledge/content-loader.js +3 -1
- package/knowledge/search/filter-pool.js +12 -4
- package/knowledge/search/query-normalizer.js +76 -0
- package/knowledge/search/search-knowledge.js +104 -5
- package/package.json +1 -1
- package/resource/_schema/feature-aliases.yaml +1 -0
- package/resource/_schema/query-normalization.yaml +9 -0
- package/resource/index/manifest.json +1 -1
- package/resource/integration/callkit/preset/android/integration.md +3 -14
- package/resource/integration/callkit/preset/flutter/integration.md +1 -12
- package/resource/integration/callkit/preset/ios/integration.md +2 -12
- package/resource/integration/callkit/preset/react/integration.md +1 -14
- package/resource/integration/callkit/preset/vue/integration.md +1 -14
- package/resource/integration/chat/preset/android/integration.md +6 -13
- package/resource/integration/chat/preset/flutter/integration.md +1 -8
- package/resource/integration/chat/preset/ios/integration.md +4 -12
- package/resource/integration/chat/preset/react/integration.md +6 -16
- package/resource/integration/chat/preset/vue/integration.md +0 -9
- package/resource/integration/livekit/preset/live/android/live-audience-integration.md +2 -6
- package/resource/integration/livekit/preset/live/android/live-host-integration.md +1 -11
- package/resource/integration/livekit/preset/live/android/live-list-integration.md +2 -6
- package/resource/integration/livekit/preset/live/android/prepare-integration.md +2 -7
- package/resource/integration/livekit/preset/live/ios/live-audience-integration.md +2 -7
- package/resource/integration/livekit/preset/live/ios/live-host-integration.md +1 -13
- package/resource/integration/livekit/preset/live/ios/live-list-integration.md +2 -10
- package/resource/integration/livekit/preset/live/ios/prepare-integration.md +3 -8
- package/resource/integration/livekit/preset/live/vue/live-list-integration.md +0 -4
- package/resource/integration/livekit/preset/live/vue/live-player-desk-integration.md +1 -5
- package/resource/integration/livekit/preset/live/vue/live-player-h5-integration.md +2 -7
- package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +2 -8
- package/resource/integration/roomkit/preset/vue/integration.md +0 -11
- package/resource/knowledge/callkit/core-sdk/android/answer-call.md +0 -7
- package/resource/knowledge/callkit/core-sdk/android/make-call.md +0 -8
- package/resource/knowledge/callkit/core-sdk/android/offline-push.md +1 -9
- package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +2 -8
- package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +2 -8
- package/resource/knowledge/callkit/core-sdk/flutter/offline-push.md +1 -16
- package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +0 -8
- package/resource/knowledge/callkit/core-sdk/ios/make-call.md +0 -8
- package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +0 -11
- package/resource/knowledge/callkit/core-sdk/uni-app/answer-call.md +178 -200
- package/resource/knowledge/callkit/core-sdk/uni-app/make-call.md +195 -217
- package/resource/knowledge/callkit/faq/android.md +4 -14
- package/resource/knowledge/callkit/faq/common.md +0 -2
- package/resource/knowledge/callkit/faq/error-code.md +2 -4
- package/resource/knowledge/callkit/faq/ios.md +1 -4
- package/resource/knowledge/callkit/preset/android/api.md +0 -6
- package/resource/knowledge/callkit/preset/ios/api.md +0 -4
- package/resource/knowledge/callkit/preset/react/api.md +3 -4
- package/resource/knowledge/callkit/preset/react/uikit-api-reference.md +3 -4
- package/resource/knowledge/callkit/preset/vue/api.md +3 -4
- package/resource/knowledge/callkit/preset/vue/uikit-api-reference.md +3 -4
- package/resource/knowledge/chat/preset/android/features/chat-setting.md +0 -5
- package/resource/knowledge/chat/preset/android/features/contact-list.md +0 -7
- package/resource/knowledge/chat/preset/android/features/conversation-list.md +0 -6
- package/resource/knowledge/chat/preset/android/features/language.md +0 -8
- package/resource/knowledge/chat/preset/android/features/message-input.md +0 -6
- package/resource/knowledge/chat/preset/android/features/message-list.md +0 -8
- package/resource/knowledge/chat/preset/android/features/search.md +0 -7
- package/resource/knowledge/chat/preset/android/features/theme.md +0 -4
- package/resource/knowledge/chat/preset/android-view/integration.md +0 -6
- package/resource/knowledge/chat/preset/flutter/features/chat-setting.md +0 -4
- package/resource/knowledge/chat/preset/flutter/features/contact-list.md +0 -9
- package/resource/knowledge/chat/preset/flutter/features/conversation-list.md +0 -7
- package/resource/knowledge/chat/preset/flutter/features/language.md +0 -5
- package/resource/knowledge/chat/preset/flutter/features/message-input.md +0 -6
- package/resource/knowledge/chat/preset/flutter/features/message-list.md +0 -8
- package/resource/knowledge/chat/preset/flutter/features/search.md +0 -5
- package/resource/knowledge/chat/preset/flutter/features/theme.md +0 -4
- package/resource/knowledge/chat/preset/ios/features/chat-setting.md +0 -5
- package/resource/knowledge/chat/preset/ios/features/contact-list.md +0 -5
- package/resource/knowledge/chat/preset/ios/features/conversation-list.md +0 -7
- package/resource/knowledge/chat/preset/ios/features/language.md +1 -8
- package/resource/knowledge/chat/preset/ios/features/message-input.md +0 -6
- package/resource/knowledge/chat/preset/ios/features/message-list.md +0 -8
- package/resource/knowledge/chat/preset/ios/features/search.md +0 -5
- package/resource/knowledge/chat/preset/ios/features/theme.md +0 -4
- package/resource/knowledge/chat/preset/ios-uikit/integration.md +0 -6
- package/resource/knowledge/chat/preset/react/features/contact-list.md +0 -23
- package/resource/knowledge/chat/preset/react/features/conversation-actions.md +2 -11
- package/resource/knowledge/chat/preset/react/features/conversation-list.md +4 -26
- package/resource/knowledge/chat/preset/react/features/conversation-preview.md +0 -6
- package/resource/knowledge/chat/preset/react/features/search.md +0 -1
- package/resource/knowledge/chat/preset/react/features/theme.md +0 -1
- package/resource/knowledge/chat/preset/vue/features/contact-list.md +3 -9
- package/resource/knowledge/chat/preset/vue/features/conversation-actions.md +0 -3
- package/resource/knowledge/chat/preset/vue/features/conversation-list.md +2 -13
- package/resource/knowledge/chat/preset/vue/features/conversation-preview.md +2 -3
- package/resource/knowledge/chat/preset/vue/features/conversation-search.md +1 -0
- package/resource/knowledge/chat/preset/vue/features/search.md +4 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/android/AudioEffectStore.md +0 -7
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BarrageStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BattleStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CameraView.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoGuestStore.md +0 -5
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoHostStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/android/DeviceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/GiftStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LikeStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveAudienceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveCoreView.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveSeatStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LoginStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/AudioEffectStore.md +0 -7
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BarrageStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BaseBeautyStore.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BattleStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoGuestStore.md +0 -5
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoHostStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/DeviceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/GiftStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LikeStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveAudienceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveCoreView.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveSeatStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LoginStore.md +1 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/AudioEffectStore.md +0 -7
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BarrageStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BaseBeautyStore.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BattleStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoGuestStore.md +0 -5
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoHostStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/DeviceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/GiftStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LikeStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveAudienceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveCoreView.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveSeatStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LoginStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/features/android/audience-list.md +2 -2
- package/resource/knowledge/livekit/core-sdk/features/android/audio-effect.md +2 -3
- package/resource/knowledge/livekit/core-sdk/features/android/barrage.md +2 -2
- package/resource/knowledge/livekit/core-sdk/features/android/base-beauty.md +2 -2
- package/resource/knowledge/livekit/core-sdk/features/android/gift.md +2 -7
- package/resource/knowledge/livekit/core-sdk/features/android/live-list.md +3 -4
- package/resource/knowledge/livekit/core-sdk/features/flutter/audience-list.md +2 -2
- package/resource/knowledge/livekit/core-sdk/features/flutter/audio-effect.md +2 -4
- package/resource/knowledge/livekit/core-sdk/features/flutter/barrage.md +2 -2
- package/resource/knowledge/livekit/core-sdk/features/flutter/base-beauty.md +0 -2
- package/resource/knowledge/livekit/core-sdk/features/flutter/gift.md +2 -7
- package/resource/knowledge/livekit/core-sdk/features/flutter/live-list.md +3 -2
- package/resource/knowledge/livekit/core-sdk/features/ios/audience-list.md +2 -2
- package/resource/knowledge/livekit/core-sdk/features/ios/audio-effect.md +2 -4
- package/resource/knowledge/livekit/core-sdk/features/ios/barrage.md +2 -2
- package/resource/knowledge/livekit/core-sdk/features/ios/base-beauty.md +2 -2
- package/resource/knowledge/livekit/core-sdk/features/ios/gift.md +2 -7
- package/resource/knowledge/livekit/core-sdk/features/ios/live-list.md +3 -4
- package/resource/knowledge/livekit/core-sdk/live/android/co-guest-interaction.md +0 -3
- package/resource/knowledge/livekit/core-sdk/live/android/host-interaction.md +0 -4
- package/resource/knowledge/livekit/core-sdk/live/android/integration.md +1 -4
- package/resource/knowledge/livekit/core-sdk/live/flutter/co-guest-interaction.md +1 -3
- package/resource/knowledge/livekit/core-sdk/live/flutter/host-interaction.md +0 -1
- package/resource/knowledge/livekit/core-sdk/live/flutter/integration.md +1 -4
- package/resource/knowledge/livekit/core-sdk/live/ios/co-guest-interaction.md +0 -3
- package/resource/knowledge/livekit/core-sdk/live/ios/host-interaction.md +0 -3
- package/resource/knowledge/livekit/core-sdk/live/ios/integration.md +1 -4
- package/resource/knowledge/livekit/core-sdk/voice/android/co-guest-interaction.md +0 -2
- package/resource/knowledge/livekit/core-sdk/voice/android/host-interaction.md +0 -5
- package/resource/knowledge/livekit/core-sdk/voice/android/integration.md +1 -4
- package/resource/knowledge/livekit/core-sdk/voice/flutter/co-guest-interaction.md +1 -4
- package/resource/knowledge/livekit/core-sdk/voice/flutter/integration.md +3 -6
- package/resource/knowledge/livekit/core-sdk/voice/ios/co-guest-interaction.md +0 -2
- package/resource/knowledge/livekit/core-sdk/voice/ios/host-interaction.md +0 -4
- package/resource/knowledge/livekit/core-sdk/voice/ios/integration.md +1 -4
- package/resource/knowledge/livekit/faq/error-code.md +0 -1
- package/resource/knowledge/livekit/preset/live/vue/features/barrage.md +2 -3
- package/resource/knowledge/livekit/preset/live/vue/features/live-audience-list.md +3 -3
- package/resource/knowledge/livekit/preset/live/vue/features/live-view.md +3 -3
- package/resource/knowledge/push/api-reference/android.md +0 -1
- package/resource/knowledge/push/api-reference/harmonyos.md +0 -2
- package/resource/knowledge/push/api-reference/react-native.md +3 -5
- package/resource/knowledge/push/api-reference/uni-app.md +3 -5
- package/resource/knowledge/push/api-reference/unity.md +0 -1
- package/resource/knowledge/push/api-reference/unreal-engine.md +0 -1
- package/resource/knowledge/push/config/android.md +0 -24
- package/resource/knowledge/push/config/harmonyos.md +0 -1
- package/resource/knowledge/push/config/ios.md +0 -3
- package/resource/knowledge/push/config/react-native.md +0 -29
- package/resource/knowledge/push/config/unity.md +1 -24
- package/resource/knowledge/push/config/unreal-engine.md +1 -24
- package/resource/knowledge/push/integration/android.md +0 -14
- package/resource/knowledge/push/integration/flutter.md +0 -19
- package/resource/knowledge/push/integration/harmonyos.md +0 -2
- package/resource/knowledge/push/integration/ios.md +0 -3
- package/resource/knowledge/push/integration/react-native.md +0 -24
- package/resource/knowledge/push/integration/uni-app.md +1 -11
- package/resource/knowledge/push/integration/unity.md +0 -9
- package/resource/knowledge/push/integration/unreal-engine.md +1 -17
- package/resource/knowledge/roomkit/core-sdk/android/call-user-to-room.md +0 -4
- package/resource/knowledge/roomkit/core-sdk/android/room-participant-state.md +0 -4
- package/resource/knowledge/roomkit/core-sdk/android/room-state.md +0 -4
- package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +1 -5
- package/resource/knowledge/roomkit/core-sdk/ios/call-user-to-room.md +0 -4
- package/resource/knowledge/roomkit/core-sdk/ios/room-participant-state.md +0 -4
- package/resource/knowledge/roomkit/core-sdk/ios/room-state.md +0 -4
- package/resource/knowledge/roomkit/core-sdk/ios/schedule-room.md +1 -5
- package/resource/knowledge/roomkit/core-sdk/vue/call-user-to-room.md +1 -1
- package/resource/knowledge/roomkit/core-sdk/vue/device-state.md +0 -6
- package/resource/knowledge/roomkit/core-sdk/vue/free-beauty-panel.md +0 -9
- package/resource/knowledge/roomkit/core-sdk/vue/room-chat.md +0 -11
- package/resource/knowledge/roomkit/core-sdk/vue/room-participant-state.md +1 -5
- package/resource/knowledge/roomkit/core-sdk/vue/room-state.md +1 -8
- package/resource/knowledge/roomkit/core-sdk/vue/room-view.md +0 -3
- package/resource/knowledge/roomkit/core-sdk/vue/screen-share.md +0 -3
- package/resource/knowledge/roomkit/core-sdk/vue/virtual-background.md +0 -5
- package/resource/knowledge/roomkit/preset/android/integration.md +0 -4
- package/resource/knowledge/roomkit/preset/flutter/integration.md +1 -13
- package/resource/knowledge/roomkit/preset/ios/integration.md +0 -6
- package/resource/knowledge/roomkit/preset/react/integration.md +0 -16
- package/resource/knowledge/rtcengine/web/api.md +1 -8
- package/resource/knowledge/rtcengine/web/faq.md +3 -5
- package/resource/knowledge/rtcengine/web/how_to_integrated_web_sdk.md +0 -6
- package/resource/knowledge/rtcengine/web/plugin/20-advanced-customized-capture-rendering.md +1 -1
- package/resource/knowledge/rtcengine/web/plugin/21-advanced-auto-play-policy.md +1 -1
- package/resource/knowledge/rtcengine/web/plugin/26-advanced-publish-cdn-stream.md +1 -1
- package/resource/knowledge/rtcengine/web/plugin/27-advanced-small-stream.md +1 -1
- package/resource/knowledge/rtcengine/web/plugin/31-advanced-plugins-overview.md +1 -3
- package/resource/knowledge/rtcengine/web/plugin/34-advanced-proxy.md +2 -4
- package/resource/knowledge/rtcengine/web/plugin/36-advanced-virtual-background.md +0 -4
- package/resource/knowledge/rtcengine/web/plugin/39-advanced-video-decoder.md +0 -2
- package/resource/knowledge/trtc/android/TRTCCloud.md +8 -56
- package/resource/knowledge/trtc/android/TRTCCloudDef.md +6 -7
- package/resource/knowledge/trtc/android/TRTCCloudListener.md +1 -18
- package/resource/knowledge/trtc/android/TXAudioEffectManager.md +0 -14
- package/resource/knowledge/trtc/android/TXDeviceManager.md +0 -1
- package/resource/knowledge/trtc/android/TXLiteAVCode.md +1 -1
- package/resource/knowledge/trtc/c++/ITRTCCloud.md +7 -59
- package/resource/knowledge/trtc/c++/ITXAudioEffectManager.md +0 -14
- package/resource/knowledge/trtc/c++/ITXDeviceManager.md +0 -4
- package/resource/knowledge/trtc/c++/TRTCCloudCallback.md +1 -19
- package/resource/knowledge/trtc/c++/TRTCTypeDef.md +6 -7
- package/resource/knowledge/trtc/c++/TXLiteAVCode.md +1 -1
- package/resource/knowledge/trtc/ios/TRTCCloud.md +9 -60
- package/resource/knowledge/trtc/ios/TRTCCloudDef.md +6 -7
- package/resource/knowledge/trtc/ios/TRTCCloudDelegate.md +1 -19
- package/resource/knowledge/trtc/ios/TXAudioEffectManager.md +0 -13
- package/resource/knowledge/trtc/ios/TXDeviceManager.md +0 -4
- package/resource/knowledge/trtc/ios/TXLiteAVCode.md +1 -1
- package/server.js +1 -1
- package/tools/common/search_trtc_knowledge.js +2 -0
- package/tools/definitions/search_trtc_knowledge_def.js +1 -0
- package/utils/report-cls-client.js +3 -3
- package/utils/report-es-client.js +1 -1
- package/resource/knowledge/roomkit/core-sdk/flutter/call-user-to-room.md +0 -230
- package/resource/knowledge/roomkit/core-sdk/flutter/room-participant-state.md +0 -797
- package/resource/knowledge/roomkit/core-sdk/flutter/room-state.md +0 -325
- package/resource/knowledge/roomkit/core-sdk/flutter/schedule-room.md +0 -325
|
@@ -1,54 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
This document helps you quickly build an **app** with calling capabilities using the **AtomicXCore SDK** components **DeviceState**, **CallState**, and the core view component **CallCoreView**.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
>
|
|
5
|
-
|
|
6
|
-
> 我们为您提供了全新的 AI 集成方式,只需要描述您的需求,即可自动生成集成代码,大幅提升开发效率。
|
|
7
|
-
>
|
|
8
|
-
|
|
9
|
-
> 点击这里,立即体验 AI 集成
|
|
10
|
-
>
|
|
11
|
-
|
|
12
|
-
## 准备工作
|
|
13
|
-
|
|
14
|
-
### 步骤1:开通服务
|
|
3
|
+
## Prerequisites
|
|
15
4
|
|
|
16
|
-
|
|
5
|
+
### Step 1: Activate the service
|
|
17
6
|
|
|
18
|
-
###
|
|
19
|
-
1.
|
|
7
|
+
### Step 2: Import AtomicXCore into your project
|
|
8
|
+
1. **Install the component**: open the [AtomicXCore SDK](https://ext.dcloud.net.cn/plugin) page, click **Download plugin and import into HBuilderX**, select the target project, and click **Confirm**.
|
|
20
9
|
|
|
21
|
-
|
|
10
|
+
You can also download the source code from [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app) and copy the `App/uni_modules/tuikit-atomic-x` directory into your project's `uni_modules/` folder.
|
|
22
11
|
|
|
23
|
-
2.
|
|
12
|
+
2. **Configure project permissions:** in your application's `manifest.json` file, under the `app-plus > distribute` node, make sure the following required permissions are added:
|
|
24
13
|
|
|
25
|
-
- Android
|
|
14
|
+
- Android platform (`Android` node): make sure the following permissions are included in the `permissions` array:
|
|
26
15
|
|
|
27
16
|
``` json
|
|
28
17
|
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />",
|
|
29
18
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>"
|
|
30
19
|
```
|
|
31
|
-
- iOS
|
|
20
|
+
- iOS platform (`iOS` node): make sure the following descriptions are included in the `privacyDescription` object:
|
|
32
21
|
|
|
33
22
|
``` json
|
|
34
|
-
"NSCameraUsageDescription" : "
|
|
35
|
-
"NSMicrophoneUsageDescription" : "
|
|
23
|
+
"NSCameraUsageDescription" : "The app needs access to your camera for calls",
|
|
24
|
+
"NSMicrophoneUsageDescription" : "The app needs access to your microphone for calls"
|
|
36
25
|
```
|
|
37
26
|
|
|
38
|
-
|
|
27
|
+
Add `audio` to the `UIBackgroundModes` array to support background audio playback.
|
|
39
28
|
|
|
40
29
|
``` json
|
|
41
30
|
"UIBackgroundModes" : [ "audio" ]
|
|
42
31
|
```
|
|
43
32
|
|
|
44
|
-
###
|
|
33
|
+
### Step 3: Implement the login logic
|
|
45
34
|
|
|
46
|
-
|
|
35
|
+
Call the [login](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#login) method on LoginState in your project to sign in. **This is a mandatory prerequisite for using any feature of** `AtomicXCore`.
|
|
47
36
|
|
|
48
|
-
>
|
|
49
|
-
>
|
|
50
|
-
|
|
51
|
-
> 推荐在您 App 自身的用户账户登录成功后,再调用 LoginState 中的 login 方法,以确保登录业务逻辑的清晰和一致。
|
|
37
|
+
> We recommend calling the `login` method on `LoginState` only after your app's own user account has signed in successfully, so that the login business logic stays clean and consistent.
|
|
52
38
|
>
|
|
53
39
|
|
|
54
40
|
``` typescript
|
|
@@ -58,75 +44,75 @@ const { login } = useLoginState();
|
|
|
58
44
|
|
|
59
45
|
const handleLogin = () => {
|
|
60
46
|
login({
|
|
61
|
-
sdkAppID: 1400000001, //
|
|
62
|
-
userID: "test_001", //
|
|
63
|
-
userSig: "xxxxxxxxxx" //
|
|
47
|
+
sdkAppID: 1400000001, // Replace with your SDKAppID
|
|
48
|
+
userID: "test_001", // Replace with your UserID
|
|
49
|
+
userSig: "xxxxxxxxxx" // Replace with your UserSig
|
|
64
50
|
})
|
|
65
51
|
}
|
|
66
52
|
```
|
|
67
53
|
|
|
68
|
-
|
|
69
|
-
| <strong
|
|
54
|
+
**Login parameters:**
|
|
55
|
+
| <strong>Parameter</strong> | <strong>Type</strong> | <strong>Description</strong> |
|
|
70
56
|
| --- | --- | --- |
|
|
71
|
-
| sdkAppID | number |
|
|
72
|
-
| userID | string |
|
|
73
|
-
| userSig | string |
|
|
57
|
+
| sdkAppID | number | Obtained from the <a href="https://console.cloud.tencent.com/trtc">Console</a>. It is typically a 10-digit integer starting with <code>140</code> or <code>160</code>. |
|
|
58
|
+
| userID | string | The unique ID of the current user. Only letters, digits, hyphens, and underscores are allowed. To avoid multi-endpoint login conflicts, <strong>do not use</strong> simple IDs such as <code>1</code> or <code>123</code>. |
|
|
59
|
+
| userSig | string | The ticket used for Tencent Cloud authentication. Please note:<br>- Development environment: you can use the local <code>GenerateTestUserSig.genTestSig</code> function to generate a userSig, or generate a temporary UserSig with the <a href="https://console.cloud.tencent.com/im/tool-usersig">UserSig helper tool</a>.<br>- Production environment: to prevent key leakage, always generate the UserSig on the server side. See <a href="https://cloud.tencent.com/document/product/647/17275">Server-side UserSig generation</a> for details.<br>For more information, see <a href="https://cloud.tencent.com/document/product/647/17275">How to compute and use UserSig</a>. |
|
|
74
60
|
|
|
75
|
-
##
|
|
61
|
+
## Answer an incoming call
|
|
76
62
|
|
|
77
|
-
###
|
|
63
|
+
### Step 1: Create the call view
|
|
78
64
|
|
|
79
|
-
|
|
80
|
-
1.
|
|
65
|
+
You need to create a call page that is brought to the foreground when an incoming call arrives. Do the following:
|
|
66
|
+
1. **Create a call page**: create a new page to act as the host page for the call, responsible for the navigation logic triggered by an incoming call.
|
|
81
67
|
|
|
82
|
-
2.
|
|
68
|
+
2. **Bind CallCoreView to the call page**: `CallCoreView` is the core view component of the call UI. It automatically listens to **CallState** and renders the video/audio views, and provides UI customization capabilities such as layout switching and avatar/icon configuration.
|
|
83
69
|
|
|
84
70
|
``` html
|
|
85
71
|
<call-core-view style="height: 50px; width: 50px;"></call-core-view>
|
|
86
72
|
```
|
|
87
73
|
|
|
88
|
-
>
|
|
74
|
+
> **Note:**
|
|
89
75
|
>
|
|
90
76
|
|
|
91
|
-
> **CallCoreView
|
|
77
|
+
> **CallCoreView** is a native component and does not need to be **imported** separately in the file. Simply mount it on the page to use it.
|
|
92
78
|
>
|
|
93
79
|
|
|
94
|
-
**CallCoreView
|
|
80
|
+
**CallCoreView features:**
|
|
95
81
|
|
|
96
|
-
|
|
82
|
+
|**Feature**|**Description**|**Reference**|
|
|
97
83
|
|---------|---------|---------|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
84
|
+
|**Set the layout mode**|Freely switch between layout modes. If not set, the layout is auto-selected based on the number of participants.|Switch the layout mode|
|
|
85
|
+
|**Set the avatar**|Customize the avatar for a specific user by passing in the avatar resource path.|Customize the default avatar|
|
|
86
|
+
|**Set the volume indicator icon**|Configure personalized volume indicator icons for different volume levels.|Customize the volume indicator icon|
|
|
87
|
+
|**Set the network indicator icon**|Configure the corresponding network indicator icon based on real-time network quality.|Customize the network indicator icon|
|
|
88
|
+
|**Set the waiting animation for callees**|In multi-party call scenarios, pass in a GIF image path to show an animation for users in the "waiting to answer" state.|Customize the loading animation|
|
|
103
89
|
|
|
104
|
-
###
|
|
90
|
+
### Step 2: Add call control buttons
|
|
105
91
|
|
|
106
|
-
|
|
107
|
-
- **DeviceState
|
|
92
|
+
You can add your own buttons based on the APIs provided by **DeviceState** and **CallState**.
|
|
93
|
+
- **DeviceState features:** microphone (on/off, volume), camera (on/off, switch, quality), screen sharing, and real-time device state listening. It is recommended to bind these methods to your button click events, and refresh the button UI in real time by listening to device state changes.
|
|
108
94
|
|
|
109
|
-
- **CallState
|
|
95
|
+
- **CallState features:** core call control capabilities such as answering, hanging up, and rejecting calls. It is recommended to bind these methods to your button click events, and listen to call state changes to keep the button state in sync with the current call phase.
|
|
110
96
|
|
|
111
|
-
-
|
|
97
|
+
- **Icon assets download:** you can download button icons directly from [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/tree/main/App). These icons are designed by our designers specifically for TUICallKit and are free from copyright issues.
|
|
112
98
|
|
|
113
|
-
| <strong
|
|
99
|
+
| <strong>Icons:</strong> | | | | | | | | |
|
|
114
100
|
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
115
101
|
|
|
116
|
-
|
|
102
|
+
**The example below shows how to add "Answer" and "Reject" buttons:**
|
|
117
103
|
|
|
118
|
-
1.
|
|
104
|
+
1. **Add the Answer button:** add an "Answer" button and bind its tap event to the [accept](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#accept) method.
|
|
119
105
|
|
|
120
106
|
``` typescript
|
|
121
107
|
<template>
|
|
122
108
|
<view class="btn" @tap="handleAccept">
|
|
123
109
|
<image class="btn-img" :src="ACCEPT_SRC"></image>
|
|
124
|
-
<text class="btn-text"
|
|
110
|
+
<text class="btn-text">Answer</text>
|
|
125
111
|
</view>
|
|
126
112
|
</template>
|
|
127
113
|
|
|
128
114
|
<script setup lang="ts">
|
|
129
|
-
import ACCEPT_SRC from "../../../static/icon/accept.png"; //
|
|
115
|
+
import ACCEPT_SRC from "../../../static/icon/accept.png"; // Replace with the actual icon path in your project
|
|
130
116
|
import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
131
117
|
|
|
132
118
|
const { accept } = useCallState();
|
|
@@ -158,18 +144,18 @@ const handleLogin = () => {
|
|
|
158
144
|
</style>
|
|
159
145
|
|
|
160
146
|
```
|
|
161
|
-
2.
|
|
147
|
+
2. **Add the Reject button:** add a "Reject" button and bind its tap event to the [reject](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#reject) method.
|
|
162
148
|
|
|
163
149
|
``` typescript
|
|
164
150
|
<template>
|
|
165
151
|
<view class="btn" @tap="handleReject">
|
|
166
152
|
<image class="btn-img" :src="REJECT_SRC"></image>
|
|
167
|
-
<text class="btn-text"
|
|
153
|
+
<text class="btn-text">Reject</text>
|
|
168
154
|
</view>
|
|
169
155
|
</template>
|
|
170
156
|
|
|
171
157
|
<script setup lang="ts">
|
|
172
|
-
import REJECT_SRC from "../../../static/icon/hangup.png"; //
|
|
158
|
+
import REJECT_SRC from "../../../static/icon/hangup.png"; // Replace with the actual icon path in your project
|
|
173
159
|
import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
174
160
|
|
|
175
161
|
const { reject } = useCallState();
|
|
@@ -199,7 +185,7 @@ const handleLogin = () => {
|
|
|
199
185
|
}
|
|
200
186
|
</style>
|
|
201
187
|
```
|
|
202
|
-
3.
|
|
188
|
+
3. **Destroy the view when the caller cancels or you reject the call:** whether the caller cancels the call or the callee rejects it, the `onCallEnded` (call ended) event is triggered. We recommend listening to this event so you can close (destroy) the call view promptly when the call ends.
|
|
203
189
|
|
|
204
190
|
``` typescript
|
|
205
191
|
import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
@@ -209,7 +195,8 @@ const handleLogin = () => {
|
|
|
209
195
|
const { closeLocalCamera, closeLocalMicrophone } = useDeviceState();
|
|
210
196
|
|
|
211
197
|
/**
|
|
212
|
-
*
|
|
198
|
+
* Initialize the call service (minimal example: handle only the call-ended event and pop the page).
|
|
199
|
+
* Call this during application startup.
|
|
213
200
|
*/
|
|
214
201
|
export function initCallService() {
|
|
215
202
|
addCallListener('onCallEnded', (event: string) => {
|
|
@@ -223,37 +210,37 @@ const handleLogin = () => {
|
|
|
223
210
|
|
|
224
211
|
console.log('[CallService] onCallEnded, reason:', res.reason);
|
|
225
212
|
|
|
226
|
-
//
|
|
213
|
+
// Close local devices
|
|
227
214
|
closeLocalCamera();
|
|
228
215
|
closeLocalMicrophone();
|
|
229
216
|
|
|
230
|
-
//
|
|
217
|
+
// Navigate back
|
|
231
218
|
const pages = getCurrentPages();
|
|
232
219
|
if (pages.length > 1) {
|
|
233
220
|
uni.navigateBack({ delta: 1 });
|
|
234
221
|
} else {
|
|
235
|
-
uni.redirectTo({ url: '/pages/index/index' }); //
|
|
222
|
+
uni.redirectTo({ url: '/pages/index/index' }); // Example path; adjust to your actual project path
|
|
236
223
|
}
|
|
237
224
|
});
|
|
238
225
|
}
|
|
239
226
|
|
|
240
227
|
```
|
|
241
228
|
|
|
242
|
-
###
|
|
229
|
+
### Step 3: Bring up the call view on incoming call
|
|
243
230
|
|
|
244
|
-
|
|
245
|
-
1.
|
|
231
|
+
Listen to the incoming-call event (`onCallReceived`) in your project and navigate to the call page when a call arrives. Implement it as follows:
|
|
232
|
+
1. **Listen to the incoming-call event:** subscribe to `onCallReceived`.
|
|
246
233
|
|
|
247
|
-
2.
|
|
234
|
+
2. **Bring up the call view:** navigate to the call page when a call arrives.
|
|
248
235
|
|
|
249
236
|
``` typescript
|
|
250
237
|
import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
251
238
|
|
|
252
239
|
const { addCallListener } = useCallState();
|
|
253
240
|
|
|
254
|
-
//
|
|
255
|
-
const CALL_PAGE = '/uni_modules/tuikit-atomic-x/pages/call'; //
|
|
256
|
-
//
|
|
241
|
+
// Call page route
|
|
242
|
+
const CALL_PAGE = '/uni_modules/tuikit-atomic-x/pages/call'; // Replace with the actual path you created in Step 1
|
|
243
|
+
// It is recommended to call this method during application initialization
|
|
257
244
|
export function initCallService() {
|
|
258
245
|
addCallListener('onCallReceived', (event: string) => {
|
|
259
246
|
uni.navigateTo({
|
|
@@ -263,12 +250,12 @@ const handleLogin = () => {
|
|
|
263
250
|
}
|
|
264
251
|
```
|
|
265
252
|
|
|
266
|
-
###
|
|
253
|
+
### Step 4: Play the ringtone on incoming call
|
|
267
254
|
|
|
268
|
-
|
|
269
|
-
1.
|
|
255
|
+
Listen to the incoming-call event (`onCallReceived`) in your project and play a ringtone when a call arrives. Implement it as follows:
|
|
256
|
+
1. **Listen to the incoming-call event:** subscribe to `onCallReceived`.
|
|
270
257
|
|
|
271
|
-
2.
|
|
258
|
+
2. **Play the ringtone:** play a ringtone when the incoming call arrives.
|
|
272
259
|
|
|
273
260
|
``` typescript
|
|
274
261
|
import { watch } from 'vue';
|
|
@@ -277,7 +264,7 @@ const handleLogin = () => {
|
|
|
277
264
|
const { addCallListener, selfInfo } = useCallState();
|
|
278
265
|
|
|
279
266
|
/**
|
|
280
|
-
*
|
|
267
|
+
* Create or get the audio playback instance (reused as a singleton)
|
|
281
268
|
*/
|
|
282
269
|
function ensureAudioContext() {
|
|
283
270
|
if (!uni.$innerAudioContext) {
|
|
@@ -291,8 +278,8 @@ const handleLogin = () => {
|
|
|
291
278
|
}
|
|
292
279
|
|
|
293
280
|
/**
|
|
294
|
-
*
|
|
295
|
-
* @param src -
|
|
281
|
+
* Play the ringtone
|
|
282
|
+
* @param src - path to the ringtone file
|
|
296
283
|
*/
|
|
297
284
|
function playRingtone(src: string) {
|
|
298
285
|
const ctx = ensureAudioContext();
|
|
@@ -312,7 +299,7 @@ const handleLogin = () => {
|
|
|
312
299
|
}
|
|
313
300
|
|
|
314
301
|
/**
|
|
315
|
-
*
|
|
302
|
+
* Stop the ringtone
|
|
316
303
|
*/
|
|
317
304
|
function stopRingtone() {
|
|
318
305
|
if (uni.$innerAudioContext) {
|
|
@@ -327,35 +314,35 @@ const handleLogin = () => {
|
|
|
327
314
|
|
|
328
315
|
export { playRingtone, stopRingtone };
|
|
329
316
|
|
|
330
|
-
//
|
|
317
|
+
// Call this method during application startup
|
|
331
318
|
export function initCallService() {
|
|
332
319
|
ensureAudioContext();
|
|
333
320
|
|
|
334
|
-
//
|
|
321
|
+
// Watch for call state changes: stop the ringtone when connected (status=2) or ended (status=0)
|
|
335
322
|
watch(() => selfInfo.value, (newVal) => {
|
|
336
323
|
if (newVal?.status === 2 || newVal?.status === 0) {
|
|
337
324
|
stopRingtone();
|
|
338
325
|
}
|
|
339
326
|
}, { immediate: true, deep: true });
|
|
340
327
|
|
|
341
|
-
//
|
|
328
|
+
// Play the ringtone when a call is received
|
|
342
329
|
addCallListener('onCallReceived', () => {
|
|
343
330
|
playRingtone('/static/audio/ring.mp3');
|
|
344
331
|
});
|
|
345
332
|
|
|
346
|
-
//
|
|
333
|
+
// Stop the ringtone when the call ends
|
|
347
334
|
addCallListener('onCallEnded', () => {
|
|
348
335
|
stopRingtone();
|
|
349
336
|
});
|
|
350
337
|
}
|
|
351
338
|
```
|
|
352
339
|
|
|
353
|
-
###
|
|
340
|
+
### Step 5: Turn on media devices on incoming call
|
|
354
341
|
|
|
355
|
-
|
|
356
|
-
1.
|
|
342
|
+
When an incoming call arrives, you can obtain the media type of the call from the `onCallReceived` event. For a better user experience, we recommend turning on the corresponding media devices in advance when bringing up the call view. Steps:
|
|
343
|
+
1. **Listen to the incoming-call event:** subscribe to `onCallReceived`.
|
|
357
344
|
|
|
358
|
-
2.
|
|
345
|
+
2. **Turn on devices based on the media type:** for audio calls, only turn on the microphone; for video calls, turn on both the microphone and the camera.
|
|
359
346
|
|
|
360
347
|
``` typescript
|
|
361
348
|
import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
@@ -364,9 +351,9 @@ const handleLogin = () => {
|
|
|
364
351
|
const { addCallListener } = useCallState();
|
|
365
352
|
const { openLocalCamera, openLocalMicrophone } = useDeviceState();
|
|
366
353
|
|
|
367
|
-
//
|
|
368
|
-
const CALL_PAGE = '/uni_modules/tuikit-atomic-x/pages/call'; //
|
|
369
|
-
//
|
|
354
|
+
// Call page route
|
|
355
|
+
const CALL_PAGE = '/uni_modules/tuikit-atomic-x/pages/call'; // Replace with the actual path you created in Step 1
|
|
356
|
+
// Call this method during application startup
|
|
370
357
|
export function initCallService() {
|
|
371
358
|
addCallListener('onCallReceived', (event: string) => {
|
|
372
359
|
let res: any;
|
|
@@ -376,13 +363,13 @@ const handleLogin = () => {
|
|
|
376
363
|
console.error('[CallService] onCallReceived parse error:', error);
|
|
377
364
|
return;
|
|
378
365
|
}
|
|
379
|
-
//
|
|
366
|
+
// Turn on the camera for video calls
|
|
380
367
|
if (res.mediaType === 1) {
|
|
381
368
|
openLocalCamera({ isFront: true });
|
|
382
369
|
}
|
|
383
|
-
//
|
|
370
|
+
// Turn on the microphone
|
|
384
371
|
openLocalMicrophone();
|
|
385
|
-
//
|
|
372
|
+
// Navigate to the call page
|
|
386
373
|
uni.navigateTo({
|
|
387
374
|
url: CALL_PAGE
|
|
388
375
|
});
|
|
@@ -390,19 +377,19 @@ const handleLogin = () => {
|
|
|
390
377
|
}
|
|
391
378
|
```
|
|
392
379
|
|
|
393
|
-
###
|
|
380
|
+
### Result
|
|
394
381
|
|
|
395
|
-
|
|
382
|
+
After the 6 steps above, the "Answer a call" flow looks as follows:
|
|
396
383
|
|
|
397
|
-
##
|
|
384
|
+
## Customize the UI
|
|
398
385
|
|
|
399
|
-
**CallCoreView**
|
|
386
|
+
**CallCoreView** offers comprehensive UI customization, allowing you to freely replace icons such as avatars and volume indicators. **To speed up integration, you can download the assets directly from **[GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/tree/main/App)**. These icons are designed by our designers specifically for TUICallKit and are free from copyright issues.**
|
|
400
387
|
|
|
401
|
-
###
|
|
388
|
+
### Customize the volume indicator icon
|
|
402
389
|
|
|
403
|
-
|
|
390
|
+
You can configure different volume-level indicator icons via the `volumeLevelIcons` property of the **CallCoreView** component.
|
|
404
391
|
|
|
405
|
-
`volumeLevelIcons
|
|
392
|
+
Example code for the `volumeLevelIcons` property:
|
|
406
393
|
``` typescript
|
|
407
394
|
<template>
|
|
408
395
|
<view class="call-view-container">
|
|
@@ -421,7 +408,7 @@ const handleLogin = () => {
|
|
|
421
408
|
const systemInfo = ref({});
|
|
422
409
|
|
|
423
410
|
/**
|
|
424
|
-
*
|
|
411
|
+
* Convert a /static/ relative path to a local absolute path usable by the native layer
|
|
425
412
|
*/
|
|
426
413
|
function toAbsolutePath(relativePath) {
|
|
427
414
|
if (plus && plus.io && plus.io.convertLocalFileSystemURL) {
|
|
@@ -431,7 +418,7 @@ const handleLogin = () => {
|
|
|
431
418
|
}
|
|
432
419
|
|
|
433
420
|
/**
|
|
434
|
-
*
|
|
421
|
+
* Convert all values of an icon map to absolute paths in a batch
|
|
435
422
|
*/
|
|
436
423
|
function convertIconPaths(iconMap) {
|
|
437
424
|
const result = {};
|
|
@@ -441,10 +428,10 @@ const handleLogin = () => {
|
|
|
441
428
|
return result;
|
|
442
429
|
}
|
|
443
430
|
|
|
444
|
-
//
|
|
431
|
+
// Volume-level icons: keys are level names, values are local absolute paths of the icons
|
|
445
432
|
const volumeLevelIcons = ref(convertIconPaths({
|
|
446
|
-
"Mute": "/static/images/callview-self-mute.png", //
|
|
447
|
-
"Low": "/static/images/callview-network.png" //
|
|
433
|
+
"Mute": "/static/images/callview-self-mute.png", // Replace with the actual icon path in your project
|
|
434
|
+
"Low": "/static/images/callview-network.png" // Replace with the actual icon path in your project
|
|
448
435
|
}));
|
|
449
436
|
|
|
450
437
|
onMounted(() => {
|
|
@@ -464,30 +451,27 @@ const handleLogin = () => {
|
|
|
464
451
|
</style>
|
|
465
452
|
```
|
|
466
453
|
|
|
467
|
-
>
|
|
468
|
-
>
|
|
469
|
-
|
|
470
|
-
> uni-app 传递给原生层的参数只支持本地路径,因此需要将相对路径转化为本地路径
|
|
454
|
+
> uni-app only supports local paths for parameters passed to the native layer, so relative paths must be converted to local paths.
|
|
471
455
|
>
|
|
472
456
|
|
|
473
|
-
-
|
|
457
|
+
- **Property parameter details:**
|
|
474
458
|
|
|
475
|
-
| <strong
|
|
459
|
+
| <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
|
|
476
460
|
| --- | --- | --- | --- |
|
|
477
|
-
| icons | [String: String] |
|
|
461
|
+
| icons | [String: String] | Yes | The mapping between volume levels and icon resources. Structure:<br>- key (VolumeLevel) indicates the volume level:<br>- <code>Mute</code>: microphone is off (muted).<br>- <code>Low</code>: volume range (0-25].<br>- <code>Medium</code>: volume range (25-50].<br>- <code>High</code>: volume range (50-75].<br>- <code>Peak</code>: volume range (75-100].<br>- Value (String) is the icon resource path for the corresponding volume level. |
|
|
478
462
|
|
|
479
|
-
-
|
|
463
|
+
- **Volume indicator icons:**
|
|
480
464
|
|
|
481
|
-
| <strong
|
|
465
|
+
| <strong>Icon</strong> | <strong>Description</strong> |
|
|
482
466
|
| --- | --- |
|
|
483
|
-
| |
|
|
484
|
-
| |
|
|
467
|
+
| | [Meaning] Volume indicator icon.<br>[Recommended usage] Set this icon at the <code>Low</code> or <code>Medium</code> level; it is displayed when the user's volume is above the corresponding level. |
|
|
468
|
+
| | [Meaning] Mute icon.<br>[Recommended usage] Set this icon at the <code>Mute</code> level; it is displayed when the user is muted. |
|
|
485
469
|
|
|
486
|
-
###
|
|
470
|
+
### Customize the network indicator icon
|
|
487
471
|
|
|
488
|
-
|
|
472
|
+
You can configure the network indicator icons for different network states via the `networkQualityIcons` property of the **CallCoreView** component.
|
|
489
473
|
|
|
490
|
-
- `networkQualityIcons
|
|
474
|
+
- Example code for the `networkQualityIcons` property:
|
|
491
475
|
|
|
492
476
|
``` typescript
|
|
493
477
|
|
|
@@ -508,7 +492,7 @@ const handleLogin = () => {
|
|
|
508
492
|
const systemInfo = ref({});
|
|
509
493
|
|
|
510
494
|
/**
|
|
511
|
-
*
|
|
495
|
+
* Convert a /static/ relative path to a local absolute path usable by the native layer
|
|
512
496
|
*/
|
|
513
497
|
function toAbsolutePath(relativePath) {
|
|
514
498
|
if (plus && plus.io && plus.io.convertLocalFileSystemURL) {
|
|
@@ -518,7 +502,7 @@ const handleLogin = () => {
|
|
|
518
502
|
}
|
|
519
503
|
|
|
520
504
|
/**
|
|
521
|
-
*
|
|
505
|
+
* Convert all values of an icon map to absolute paths in a batch
|
|
522
506
|
*/
|
|
523
507
|
function convertIconPaths(iconMap) {
|
|
524
508
|
const result = {};
|
|
@@ -529,8 +513,8 @@ const handleLogin = () => {
|
|
|
529
513
|
}
|
|
530
514
|
|
|
531
515
|
const networkQualityIcons = ref(convertIconPaths({
|
|
532
|
-
"BAD": "/static/images/callview-network-bad.png", //
|
|
533
|
-
"VERY_BAD": "/static/images/callview-network-bad.png" //
|
|
516
|
+
"BAD": "/static/images/callview-network-bad.png", // Replace with the actual icon path in your project
|
|
517
|
+
"VERY_BAD": "/static/images/callview-network-bad.png" // Replace with the actual icon path in your project
|
|
534
518
|
}));
|
|
535
519
|
|
|
536
520
|
onMounted(() => {
|
|
@@ -549,23 +533,23 @@ const handleLogin = () => {
|
|
|
549
533
|
}
|
|
550
534
|
</style>
|
|
551
535
|
```
|
|
552
|
-
- `networkQualityIcons
|
|
536
|
+
- `networkQualityIcons` parameter details:
|
|
553
537
|
|
|
554
|
-
| <strong
|
|
538
|
+
| <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
|
|
555
539
|
| --- | --- | --- | --- |
|
|
556
|
-
| icons | [String: String] |
|
|
540
|
+
| icons | [String: String] | Yes | The mapping between network quality and icon resources. Structure:<br>- Key (String): the network quality level:<br>- <code>UNKNOWN</code>: unknown network state.<br>- <code>EXCELLENT</code>: excellent network.<br>- <code>GOOD</code>: good network.<br>- <code>POOR</code>: poor network.<br>- <code>BAD</code>: bad network.<br>- <code>VERY_BAD</code>: very bad network.<br>- <code>DOWN</code>: network disconnected.<br>- Value (String): the icon resource path for the corresponding network state. |
|
|
557
541
|
|
|
558
|
-
-
|
|
542
|
+
- **Poor-network indicator icon:**
|
|
559
543
|
|
|
560
|
-
| <strong
|
|
544
|
+
| <strong>Icon</strong> | <strong>Description</strong> |
|
|
561
545
|
| --- | --- |
|
|
562
|
-
| |
|
|
546
|
+
| | [Meaning] Poor-network indicator icon.<br>[Recommended usage] Set this icon at the <code>BAD</code>, <code>VERY_BAD</code>, or <code>DOWN</code> level; it is displayed when the network is poor. |
|
|
563
547
|
|
|
564
|
-
###
|
|
548
|
+
### Customize the default avatar
|
|
565
549
|
|
|
566
|
-
|
|
550
|
+
You can set the `participantAvatars` property of **CallCoreView** to configure user avatars. We recommend listening to the reactive `allParticipants` (all call participants): when a user's avatar is available, set and display it; if the user has no avatar or loading fails, fall back to a default avatar (placeholder).
|
|
567
551
|
|
|
568
|
-
`participantAvatars
|
|
552
|
+
Example code for the `participantAvatars` property:
|
|
569
553
|
``` typescript
|
|
570
554
|
<template>
|
|
571
555
|
<view class="call-view-container">
|
|
@@ -593,7 +577,7 @@ const handleLogin = () => {
|
|
|
593
577
|
let defaultAvatarReady = false;
|
|
594
578
|
|
|
595
579
|
/**
|
|
596
|
-
*
|
|
580
|
+
* Convert a relative path to a local absolute path usable by the native layer
|
|
597
581
|
*/
|
|
598
582
|
function toAbsolutePath(relativePath) {
|
|
599
583
|
if (plus && plus.io && plus.io.convertLocalFileSystemURL) {
|
|
@@ -603,7 +587,7 @@ const handleLogin = () => {
|
|
|
603
587
|
}
|
|
604
588
|
|
|
605
589
|
/**
|
|
606
|
-
*
|
|
590
|
+
* Download and cache the avatar; return the local absolute path
|
|
607
591
|
*/
|
|
608
592
|
function downloadAvatar(url) {
|
|
609
593
|
if (avatarCache[url]) {
|
|
@@ -628,18 +612,18 @@ const handleLogin = () => {
|
|
|
628
612
|
});
|
|
629
613
|
}
|
|
630
614
|
|
|
631
|
-
//
|
|
615
|
+
// Pre-download the default avatar
|
|
632
616
|
const defaultAvatarPromise = downloadAvatar(DEFAULT_AVATAR_URL).then(localPath => {
|
|
633
617
|
defaultAvatarLocalPath = localPath;
|
|
634
618
|
defaultAvatarReady = true;
|
|
635
|
-
//
|
|
619
|
+
// After the default avatar is ready, refresh participant avatars once
|
|
636
620
|
if (allParticipants.value && allParticipants.value.length > 0) {
|
|
637
621
|
updateParticipantAvatars(allParticipants.value);
|
|
638
622
|
}
|
|
639
623
|
});
|
|
640
624
|
|
|
641
625
|
/**
|
|
642
|
-
*
|
|
626
|
+
* Given the participant list, download avatars and build a { userId: localPath } map
|
|
643
627
|
*/
|
|
644
628
|
async function updateParticipantAvatars(participants) {
|
|
645
629
|
if (!participants || participants.length === 0) {
|
|
@@ -666,7 +650,7 @@ const handleLogin = () => {
|
|
|
666
650
|
participantAvatars.value = avatarMap;
|
|
667
651
|
}
|
|
668
652
|
|
|
669
|
-
//
|
|
653
|
+
// Watch participant changes and update the avatar map
|
|
670
654
|
watch(() => allParticipants.value, async (newVal) => {
|
|
671
655
|
if (!newVal) return;
|
|
672
656
|
await updateParticipantAvatars(newVal);
|
|
@@ -688,23 +672,23 @@ const handleLogin = () => {
|
|
|
688
672
|
}
|
|
689
673
|
</style>
|
|
690
674
|
```
|
|
691
|
-
- `participantAvatars
|
|
675
|
+
- `participantAvatars` parameter details:
|
|
692
676
|
|
|
693
|
-
| <strong
|
|
677
|
+
| <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
|
|
694
678
|
| --- | --- | --- | --- |
|
|
695
|
-
| avatars | [String: String] |
|
|
679
|
+
| avatars | [String: String] | Yes | The user avatar map. Structure:<br>- Key: the user's userID.<br>- Value: the absolute path of the user's avatar resource. |
|
|
696
680
|
|
|
697
|
-
-
|
|
681
|
+
- **Default avatar asset:**
|
|
698
682
|
|
|
699
|
-
| <strong
|
|
683
|
+
| <strong>Icon</strong> | <strong>Description</strong> |
|
|
700
684
|
| --- | --- |
|
|
701
|
-
| |
|
|
685
|
+
| | [Meaning] Default avatar.<br>[Recommended usage] When a user's avatar fails to load or is not available, set this as their default avatar. |
|
|
702
686
|
|
|
703
|
-
###
|
|
687
|
+
### Customize the loading animation
|
|
704
688
|
|
|
705
|
-
|
|
689
|
+
You can set the `waitingAnimation` property of **CallCoreView** to configure a waiting animation for waiting users for a better experience.
|
|
706
690
|
|
|
707
|
-
- `waitingAnimation
|
|
691
|
+
- Example code for the `waitingAnimation` property:
|
|
708
692
|
|
|
709
693
|
``` typescript
|
|
710
694
|
<template>
|
|
@@ -724,7 +708,7 @@ const handleLogin = () => {
|
|
|
724
708
|
const systemInfo = ref({});
|
|
725
709
|
|
|
726
710
|
/**
|
|
727
|
-
*
|
|
711
|
+
* Convert a /static/ relative path to a local absolute path usable by the native layer
|
|
728
712
|
*/
|
|
729
713
|
function toAbsolutePath(relativePath) {
|
|
730
714
|
if (plus && plus.io && plus.io.convertLocalFileSystemURL) {
|
|
@@ -733,8 +717,8 @@ const handleLogin = () => {
|
|
|
733
717
|
return relativePath;
|
|
734
718
|
}
|
|
735
719
|
|
|
736
|
-
//
|
|
737
|
-
const waitingAnimation = ref(toAbsolutePath("/static/images/callview-loading.gif")); //
|
|
720
|
+
// Waiting animation GIF: pass a local absolute path for the native component to render
|
|
721
|
+
const waitingAnimation = ref(toAbsolutePath("/static/images/callview-loading.gif")); // Replace with the actual icon path in your project
|
|
738
722
|
|
|
739
723
|
onMounted(() => {
|
|
740
724
|
uni.getSystemInfo({
|
|
@@ -752,23 +736,23 @@ const handleLogin = () => {
|
|
|
752
736
|
}
|
|
753
737
|
</style>
|
|
754
738
|
```
|
|
755
|
-
- `waitingAnimation
|
|
739
|
+
- `waitingAnimation` parameter details:
|
|
756
740
|
|
|
757
|
-
|
|
741
|
+
|**Parameter**|**Type**|**Required**|**Description**|
|
|
758
742
|
|---------|---------|---------|---------|
|
|
759
|
-
|path|String
|
|
743
|
+
|path|String|Yes|The absolute path of the GIF image resource.|
|
|
760
744
|
|
|
761
|
-
-
|
|
745
|
+
- **Waiting-to-answer animation:**
|
|
762
746
|
|
|
763
|
-
| <strong
|
|
747
|
+
| <strong>Icon</strong> | <strong>Description</strong> |
|
|
764
748
|
| --- | --- |
|
|
765
|
-
| |
|
|
749
|
+
| | [Meaning] Waiting-to-answer animation for a user.<br>[Recommended usage] Animation used in group calls. Once configured, this animation is displayed when the user is in the "waiting to answer" state. |
|
|
766
750
|
|
|
767
|
-
###
|
|
751
|
+
### Add a call duration indicator
|
|
768
752
|
|
|
769
|
-
|
|
753
|
+
The call duration is available in real time via the `duration` field on the reactive `activeCall` data. To show the call duration in real time:
|
|
770
754
|
|
|
771
|
-
|
|
755
|
+
**Bind the call duration data**: bind the `activeCall.duration` field to the UI. This field is reactive and drives the UI to update automatically, so you do not need to maintain a timer manually.
|
|
772
756
|
``` typescript
|
|
773
757
|
<template>
|
|
774
758
|
<view v-if="isConnected" class="call-timer">
|
|
@@ -814,12 +798,12 @@ const handleLogin = () => {
|
|
|
814
798
|
</style>
|
|
815
799
|
```
|
|
816
800
|
|
|
817
|
-
##
|
|
801
|
+
## More features
|
|
818
802
|
|
|
819
|
-
###
|
|
803
|
+
### Customize the user's avatar and nickname
|
|
820
804
|
|
|
821
|
-
|
|
822
|
-
-
|
|
805
|
+
Before a call starts, you can set your own nickname and avatar via the [setSelfInfo](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#setSelfInfo) method.
|
|
806
|
+
- Example code for `setSelfInfo`:
|
|
823
807
|
|
|
824
808
|
``` typescript
|
|
825
809
|
import { useLoginState } from "@/uni_modules/tuikit-atomic-x/state/LoginState";
|
|
@@ -827,7 +811,7 @@ const handleLogin = () => {
|
|
|
827
811
|
const { setSelfInfo } = useLoginState();
|
|
828
812
|
|
|
829
813
|
/**
|
|
830
|
-
*
|
|
814
|
+
* Set the profile (nickname, avatar, etc.) of the currently signed-in user
|
|
831
815
|
*/
|
|
832
816
|
export const setSelfUserInfo = (userID: string, nickname: string, avatarURL: string): void => {
|
|
833
817
|
setSelfInfo({
|
|
@@ -837,29 +821,26 @@ const handleLogin = () => {
|
|
|
837
821
|
avatarURL,
|
|
838
822
|
},
|
|
839
823
|
success: () => {
|
|
840
|
-
console.log('
|
|
824
|
+
console.log('User profile set successfully');
|
|
841
825
|
},
|
|
842
826
|
fail: (errCode: number, errMsg: string) => {
|
|
843
|
-
console.error('
|
|
827
|
+
console.error('Failed to set user profile:', errCode, errMsg);
|
|
844
828
|
},
|
|
845
829
|
});
|
|
846
830
|
};
|
|
847
831
|
```
|
|
848
|
-
-
|
|
832
|
+
- `setSelfInfo` parameter details:
|
|
849
833
|
|
|
850
|
-
| <strong
|
|
834
|
+
| <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
|
|
851
835
|
| --- | --- | --- | --- |
|
|
852
|
-
| userProfile | UserProfile |
|
|
836
|
+
| userProfile | UserProfile | Yes | The user profile struct:<br>- <code>userID</code>: the user's ID.<br>- <code>avatarURL</code>: the URL of the user's avatar.<br>- <code>nickname</code>: the user's nickname.<br>For more fields, see UserProfile. |
|
|
853
837
|
|
|
854
|
-
###
|
|
838
|
+
### Switch the layout mode
|
|
855
839
|
|
|
856
|
-
**CallCoreView**
|
|
857
|
-
| <strong>
|
|
858
|
-
| --- | --- | --- |
|
|
859
|
-
| | | |
|
|
860
|
-
| - <strong>布局逻辑:</strong>呼叫等待时全屏显示己方画面;接通后全屏显示对方画面,己方画面以悬浮小窗展示。<br>- <strong>交互特性:</strong>支持小窗拖拽移动,点击小窗可实现大小画面互换。 | - <strong>布局逻辑:</strong>所有成员画面呈网格状平铺排列成宫格模式布局,适用 2 人以上通话,支持点击放大画面功能。<br>- <strong>交互特性:</strong>支持点击特定成员画面放大查看。 | - <strong>布局逻辑:</strong>1 v 1 场景固定显示对方画面,多人场景:采用当前发言者(Active Speaker) 策略,自动识别并全屏展示正在说话的用户。<br>- <strong>交互特性:</strong>等待时显示自己的画面,接通后还会显示通话计时。 |
|
|
840
|
+
**CallCoreView** provides three built-in layout modes. You can set the `layoutTemplate` property to choose the layout. If not set, **CallCoreView** auto-selects the layout based on the number of participants: `Float` is the default for 1-vs-1 scenarios, and it automatically switches to `Grid` for multi-party calls. The layout modes are described below:
|
|
841
|
+
| - <strong>Layout logic:</strong> during outgoing ringing, the local view is shown full-screen; after the call is connected, the remote view is shown full-screen and the local view becomes a floating small window.<br>- <strong>Interaction:</strong> supports dragging the small window; tap the small window to swap the main and small views. | - <strong>Layout logic:</strong> all participants' views are tiled in a grid layout. Suitable for calls with 2 or more participants; tap a specific view to enlarge it.<br>- <strong>Interaction:</strong> tap a specific participant's view to enlarge it. | - <strong>Layout logic:</strong> in 1-vs-1 scenarios, the remote view is always shown. In multi-party scenarios, the Active Speaker strategy is used to automatically detect and show the current speaker in full screen.<br>- <strong>Interaction:</strong> the local view is shown while waiting; after the call is connected, the call duration is also displayed. |
|
|
861
842
|
|
|
862
|
-
- `layoutTemplate
|
|
843
|
+
- Example code for the `layoutTemplate` property:
|
|
863
844
|
|
|
864
845
|
``` typescript
|
|
865
846
|
<template>
|
|
@@ -880,10 +861,10 @@ const handleLogin = () => {
|
|
|
880
861
|
const { activeCall } = useCallState();
|
|
881
862
|
|
|
882
863
|
const systemInfo = ref({});
|
|
883
|
-
//
|
|
864
|
+
// Layout template: 'Float' for 1v1 floating layout, 'Grid' for multi-party grid layout
|
|
884
865
|
const layoutTemplate = ref("Grid");
|
|
885
866
|
|
|
886
|
-
//
|
|
867
|
+
// Automatically switch the layout based on call info: use Grid for multi-party or group chats, Float for 1v1
|
|
887
868
|
watch(() => activeCall.value, (newValue) => {
|
|
888
869
|
if (!newValue || !newValue.inviteeIds) {
|
|
889
870
|
return;
|
|
@@ -911,42 +892,39 @@ const handleLogin = () => {
|
|
|
911
892
|
</style>
|
|
912
893
|
|
|
913
894
|
```
|
|
914
|
-
- `layoutTemplate
|
|
895
|
+
- `layoutTemplate` parameter details:
|
|
915
896
|
|
|
916
|
-
| <strong
|
|
897
|
+
| <strong>Parameter</strong> | <strong>Type</strong> | <strong>Description</strong> |
|
|
917
898
|
| --- | --- | --- |
|
|
918
|
-
| <code>layoutTemplate</code> | String | CallCoreView
|
|
919
|
-
|
|
920
|
-
## 下一步
|
|
899
|
+
| <code>layoutTemplate</code> | String | Layout mode of CallCoreView.<br>- Float:<br>- Layout logic: during outgoing ringing, the local view is shown full-screen; after the call is connected, the remote view is shown full-screen and the local view becomes a floating small window.<br>- Interaction: supports dragging the small window; tap the small window to swap the main and small views.<br>- Grid:<br>- Layout logic: all participants' views are tiled in a grid layout. Suitable for calls with 2 or more participants; tap a specific view to enlarge it.<br>- Interaction: tap a specific participant's view to enlarge it.<br>- PIP:<br>- Layout logic: in 1v1 scenarios, the remote view is always shown. In multi-party scenarios, the Active Speaker strategy is used to automatically detect and show the current speaker in full screen.<br>- Interaction: the local view is shown while waiting; after the call is connected, the call duration is also displayed. |
|
|
921
900
|
|
|
922
|
-
|
|
901
|
+
## Next step
|
|
923
902
|
|
|
924
|
-
|
|
903
|
+
Congratulations, you have completed "Answer a call". Next, you can .
|
|
925
904
|
|
|
926
|
-
|
|
905
|
+
## FAQ
|
|
927
906
|
|
|
928
|
-
|
|
907
|
+
### How can I keep the screen always on during a call?
|
|
929
908
|
|
|
930
|
-
|
|
909
|
+
uni-app provides an official API for this: [uni.setScreenBrightness](https://uniapp.dcloud.net.cn/api/system/brightness.html).
|
|
931
910
|
|
|
932
|
-
|
|
911
|
+
### How can I disable the system back-swipe gesture on the previous page?
|
|
933
912
|
|
|
934
|
-
|
|
913
|
+
On iOS, you can disable it by setting the `disableSwipeBack` property on the page. See the [official uni-app documentation](https://uniapp.dcloud.net.cn/collocation/pages.html) for details.
|
|
935
914
|
|
|
936
|
-
|
|
937
|
-
>
|
|
915
|
+
On Android, you can intercept both the back-swipe gesture and the physical back button via `onBackPress`. Example:
|
|
938
916
|
|
|
939
|
-
>
|
|
917
|
+
> When using this approach to intercept the system back-swipe and physical back button, make sure the page uses a [custom navigation bar](https://uniapp.dcloud.net.cn/collocation/pages.html#customnav).
|
|
940
918
|
>
|
|
941
919
|
|
|
942
920
|
``` typescript
|
|
943
921
|
<script setup>
|
|
944
922
|
import { onBackPress } from '@dcloudio/uni-app'
|
|
945
923
|
|
|
946
|
-
//
|
|
924
|
+
// Intercept the system back-swipe and physical back button to prevent accidental exit during a call
|
|
947
925
|
onBackPress((option) => {
|
|
948
926
|
if (option.from === 'backbutton') {
|
|
949
|
-
return true; //
|
|
927
|
+
return true; // Return true to block the default back behavior
|
|
950
928
|
}
|
|
951
929
|
});
|
|
952
930
|
</script>
|