@tencent-rtc/mcp 1.6.7 → 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.
Files changed (248) hide show
  1. package/knowledge/build-index.js +3 -0
  2. package/knowledge/content-loader.js +3 -1
  3. package/knowledge/search/filter-pool.js +12 -4
  4. package/knowledge/search/query-normalizer.js +76 -0
  5. package/knowledge/search/search-knowledge.js +104 -5
  6. package/package.json +1 -1
  7. package/resource/_schema/feature-aliases.yaml +1 -0
  8. package/resource/_schema/query-normalization.yaml +9 -0
  9. package/resource/index/manifest.json +1 -1
  10. package/resource/integration/callkit/preset/android/integration.md +3 -14
  11. package/resource/integration/callkit/preset/flutter/integration.md +1 -12
  12. package/resource/integration/callkit/preset/ios/integration.md +2 -12
  13. package/resource/integration/callkit/preset/react/integration.md +1 -14
  14. package/resource/integration/callkit/preset/vue/integration.md +1 -14
  15. package/resource/integration/chat/preset/android/integration.md +6 -13
  16. package/resource/integration/chat/preset/flutter/integration.md +1 -8
  17. package/resource/integration/chat/preset/ios/integration.md +4 -12
  18. package/resource/integration/chat/preset/react/integration.md +6 -16
  19. package/resource/integration/chat/preset/vue/integration.md +0 -9
  20. package/resource/integration/livekit/preset/live/android/live-audience-integration.md +2 -6
  21. package/resource/integration/livekit/preset/live/android/live-host-integration.md +1 -11
  22. package/resource/integration/livekit/preset/live/android/live-list-integration.md +2 -6
  23. package/resource/integration/livekit/preset/live/android/prepare-integration.md +2 -7
  24. package/resource/integration/livekit/preset/live/ios/live-audience-integration.md +2 -7
  25. package/resource/integration/livekit/preset/live/ios/live-host-integration.md +1 -13
  26. package/resource/integration/livekit/preset/live/ios/live-list-integration.md +2 -10
  27. package/resource/integration/livekit/preset/live/ios/prepare-integration.md +3 -8
  28. package/resource/integration/livekit/preset/live/vue/live-list-integration.md +0 -4
  29. package/resource/integration/livekit/preset/live/vue/live-player-desk-integration.md +1 -5
  30. package/resource/integration/livekit/preset/live/vue/live-player-h5-integration.md +2 -7
  31. package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +2 -8
  32. package/resource/integration/roomkit/preset/vue/integration.md +0 -11
  33. package/resource/knowledge/callkit/core-sdk/android/answer-call.md +0 -7
  34. package/resource/knowledge/callkit/core-sdk/android/make-call.md +0 -8
  35. package/resource/knowledge/callkit/core-sdk/android/offline-push.md +1 -9
  36. package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +2 -8
  37. package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +2 -8
  38. package/resource/knowledge/callkit/core-sdk/flutter/offline-push.md +1 -16
  39. package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +0 -8
  40. package/resource/knowledge/callkit/core-sdk/ios/make-call.md +0 -8
  41. package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +0 -11
  42. package/resource/knowledge/callkit/core-sdk/uni-app/answer-call.md +178 -200
  43. package/resource/knowledge/callkit/core-sdk/uni-app/make-call.md +195 -217
  44. package/resource/knowledge/callkit/faq/android.md +4 -14
  45. package/resource/knowledge/callkit/faq/common.md +0 -2
  46. package/resource/knowledge/callkit/faq/error-code.md +2 -4
  47. package/resource/knowledge/callkit/faq/ios.md +1 -4
  48. package/resource/knowledge/callkit/preset/android/api.md +0 -6
  49. package/resource/knowledge/callkit/preset/ios/api.md +0 -4
  50. package/resource/knowledge/callkit/preset/react/api.md +3 -4
  51. package/resource/knowledge/callkit/preset/react/uikit-api-reference.md +3 -4
  52. package/resource/knowledge/callkit/preset/vue/api.md +3 -4
  53. package/resource/knowledge/callkit/preset/vue/uikit-api-reference.md +3 -4
  54. package/resource/knowledge/chat/preset/android/features/chat-setting.md +0 -5
  55. package/resource/knowledge/chat/preset/android/features/contact-list.md +0 -7
  56. package/resource/knowledge/chat/preset/android/features/conversation-list.md +0 -6
  57. package/resource/knowledge/chat/preset/android/features/language.md +0 -8
  58. package/resource/knowledge/chat/preset/android/features/message-input.md +0 -6
  59. package/resource/knowledge/chat/preset/android/features/message-list.md +0 -8
  60. package/resource/knowledge/chat/preset/android/features/search.md +0 -7
  61. package/resource/knowledge/chat/preset/android/features/theme.md +0 -4
  62. package/resource/knowledge/chat/preset/android-view/integration.md +0 -6
  63. package/resource/knowledge/chat/preset/flutter/features/chat-setting.md +0 -4
  64. package/resource/knowledge/chat/preset/flutter/features/contact-list.md +0 -9
  65. package/resource/knowledge/chat/preset/flutter/features/conversation-list.md +0 -7
  66. package/resource/knowledge/chat/preset/flutter/features/language.md +0 -5
  67. package/resource/knowledge/chat/preset/flutter/features/message-input.md +0 -6
  68. package/resource/knowledge/chat/preset/flutter/features/message-list.md +0 -8
  69. package/resource/knowledge/chat/preset/flutter/features/search.md +0 -5
  70. package/resource/knowledge/chat/preset/flutter/features/theme.md +0 -4
  71. package/resource/knowledge/chat/preset/ios/features/chat-setting.md +0 -5
  72. package/resource/knowledge/chat/preset/ios/features/contact-list.md +0 -5
  73. package/resource/knowledge/chat/preset/ios/features/conversation-list.md +0 -7
  74. package/resource/knowledge/chat/preset/ios/features/language.md +1 -8
  75. package/resource/knowledge/chat/preset/ios/features/message-input.md +0 -6
  76. package/resource/knowledge/chat/preset/ios/features/message-list.md +0 -8
  77. package/resource/knowledge/chat/preset/ios/features/search.md +0 -5
  78. package/resource/knowledge/chat/preset/ios/features/theme.md +0 -4
  79. package/resource/knowledge/chat/preset/ios-uikit/integration.md +0 -6
  80. package/resource/knowledge/chat/preset/react/features/contact-list.md +0 -23
  81. package/resource/knowledge/chat/preset/react/features/conversation-actions.md +2 -11
  82. package/resource/knowledge/chat/preset/react/features/conversation-list.md +4 -26
  83. package/resource/knowledge/chat/preset/react/features/conversation-preview.md +0 -6
  84. package/resource/knowledge/chat/preset/react/features/search.md +0 -1
  85. package/resource/knowledge/chat/preset/react/features/theme.md +0 -1
  86. package/resource/knowledge/chat/preset/vue/features/contact-list.md +3 -9
  87. package/resource/knowledge/chat/preset/vue/features/conversation-actions.md +0 -3
  88. package/resource/knowledge/chat/preset/vue/features/conversation-list.md +2 -13
  89. package/resource/knowledge/chat/preset/vue/features/conversation-preview.md +2 -3
  90. package/resource/knowledge/chat/preset/vue/features/conversation-search.md +1 -0
  91. package/resource/knowledge/chat/preset/vue/features/search.md +4 -3
  92. package/resource/knowledge/livekit/core-sdk/api-reference/android/AudioEffectStore.md +0 -7
  93. package/resource/knowledge/livekit/core-sdk/api-reference/android/BarrageStore.md +0 -3
  94. package/resource/knowledge/livekit/core-sdk/api-reference/android/BattleStore.md +0 -3
  95. package/resource/knowledge/livekit/core-sdk/api-reference/android/CameraView.md +0 -1
  96. package/resource/knowledge/livekit/core-sdk/api-reference/android/CoGuestStore.md +0 -5
  97. package/resource/knowledge/livekit/core-sdk/api-reference/android/CoHostStore.md +0 -3
  98. package/resource/knowledge/livekit/core-sdk/api-reference/android/DeviceStore.md +0 -2
  99. package/resource/knowledge/livekit/core-sdk/api-reference/android/GiftStore.md +0 -2
  100. package/resource/knowledge/livekit/core-sdk/api-reference/android/LikeStore.md +0 -2
  101. package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveAudienceStore.md +0 -2
  102. package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveCoreView.md +0 -1
  103. package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveSeatStore.md +0 -2
  104. package/resource/knowledge/livekit/core-sdk/api-reference/android/LoginStore.md +0 -2
  105. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/AudioEffectStore.md +0 -7
  106. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BarrageStore.md +0 -3
  107. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BaseBeautyStore.md +0 -1
  108. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BattleStore.md +0 -3
  109. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoGuestStore.md +0 -5
  110. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoHostStore.md +0 -3
  111. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/DeviceStore.md +0 -2
  112. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/GiftStore.md +0 -2
  113. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LikeStore.md +0 -2
  114. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveAudienceStore.md +0 -2
  115. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveCoreView.md +0 -1
  116. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveSeatStore.md +0 -2
  117. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LoginStore.md +1 -3
  118. package/resource/knowledge/livekit/core-sdk/api-reference/ios/AudioEffectStore.md +0 -7
  119. package/resource/knowledge/livekit/core-sdk/api-reference/ios/BarrageStore.md +0 -3
  120. package/resource/knowledge/livekit/core-sdk/api-reference/ios/BaseBeautyStore.md +0 -1
  121. package/resource/knowledge/livekit/core-sdk/api-reference/ios/BattleStore.md +0 -3
  122. package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoGuestStore.md +0 -5
  123. package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoHostStore.md +0 -3
  124. package/resource/knowledge/livekit/core-sdk/api-reference/ios/DeviceStore.md +0 -2
  125. package/resource/knowledge/livekit/core-sdk/api-reference/ios/GiftStore.md +0 -2
  126. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LikeStore.md +0 -2
  127. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveAudienceStore.md +0 -2
  128. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveCoreView.md +0 -1
  129. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveSeatStore.md +0 -2
  130. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LoginStore.md +0 -2
  131. package/resource/knowledge/livekit/core-sdk/features/android/audience-list.md +2 -2
  132. package/resource/knowledge/livekit/core-sdk/features/android/audio-effect.md +2 -3
  133. package/resource/knowledge/livekit/core-sdk/features/android/barrage.md +2 -2
  134. package/resource/knowledge/livekit/core-sdk/features/android/base-beauty.md +2 -2
  135. package/resource/knowledge/livekit/core-sdk/features/android/gift.md +2 -7
  136. package/resource/knowledge/livekit/core-sdk/features/android/live-list.md +3 -4
  137. package/resource/knowledge/livekit/core-sdk/features/flutter/audience-list.md +2 -2
  138. package/resource/knowledge/livekit/core-sdk/features/flutter/audio-effect.md +2 -4
  139. package/resource/knowledge/livekit/core-sdk/features/flutter/barrage.md +2 -2
  140. package/resource/knowledge/livekit/core-sdk/features/flutter/base-beauty.md +0 -2
  141. package/resource/knowledge/livekit/core-sdk/features/flutter/gift.md +2 -7
  142. package/resource/knowledge/livekit/core-sdk/features/flutter/live-list.md +3 -2
  143. package/resource/knowledge/livekit/core-sdk/features/ios/audience-list.md +2 -2
  144. package/resource/knowledge/livekit/core-sdk/features/ios/audio-effect.md +2 -4
  145. package/resource/knowledge/livekit/core-sdk/features/ios/barrage.md +2 -2
  146. package/resource/knowledge/livekit/core-sdk/features/ios/base-beauty.md +2 -2
  147. package/resource/knowledge/livekit/core-sdk/features/ios/gift.md +2 -7
  148. package/resource/knowledge/livekit/core-sdk/features/ios/live-list.md +3 -4
  149. package/resource/knowledge/livekit/core-sdk/live/android/co-guest-interaction.md +0 -3
  150. package/resource/knowledge/livekit/core-sdk/live/android/host-interaction.md +0 -4
  151. package/resource/knowledge/livekit/core-sdk/live/android/integration.md +1 -4
  152. package/resource/knowledge/livekit/core-sdk/live/flutter/co-guest-interaction.md +1 -3
  153. package/resource/knowledge/livekit/core-sdk/live/flutter/host-interaction.md +0 -1
  154. package/resource/knowledge/livekit/core-sdk/live/flutter/integration.md +1 -4
  155. package/resource/knowledge/livekit/core-sdk/live/ios/co-guest-interaction.md +0 -3
  156. package/resource/knowledge/livekit/core-sdk/live/ios/host-interaction.md +0 -3
  157. package/resource/knowledge/livekit/core-sdk/live/ios/integration.md +1 -4
  158. package/resource/knowledge/livekit/core-sdk/voice/android/co-guest-interaction.md +0 -2
  159. package/resource/knowledge/livekit/core-sdk/voice/android/host-interaction.md +0 -5
  160. package/resource/knowledge/livekit/core-sdk/voice/android/integration.md +1 -4
  161. package/resource/knowledge/livekit/core-sdk/voice/flutter/co-guest-interaction.md +1 -4
  162. package/resource/knowledge/livekit/core-sdk/voice/flutter/integration.md +3 -6
  163. package/resource/knowledge/livekit/core-sdk/voice/ios/co-guest-interaction.md +0 -2
  164. package/resource/knowledge/livekit/core-sdk/voice/ios/host-interaction.md +0 -4
  165. package/resource/knowledge/livekit/core-sdk/voice/ios/integration.md +1 -4
  166. package/resource/knowledge/livekit/faq/error-code.md +0 -1
  167. package/resource/knowledge/livekit/preset/live/vue/features/barrage.md +2 -3
  168. package/resource/knowledge/livekit/preset/live/vue/features/live-audience-list.md +3 -3
  169. package/resource/knowledge/livekit/preset/live/vue/features/live-view.md +3 -3
  170. package/resource/knowledge/push/api-reference/android.md +0 -1
  171. package/resource/knowledge/push/api-reference/harmonyos.md +0 -2
  172. package/resource/knowledge/push/api-reference/react-native.md +3 -5
  173. package/resource/knowledge/push/api-reference/uni-app.md +3 -5
  174. package/resource/knowledge/push/api-reference/unity.md +0 -1
  175. package/resource/knowledge/push/api-reference/unreal-engine.md +0 -1
  176. package/resource/knowledge/push/config/android.md +0 -24
  177. package/resource/knowledge/push/config/harmonyos.md +0 -1
  178. package/resource/knowledge/push/config/ios.md +0 -3
  179. package/resource/knowledge/push/config/react-native.md +0 -29
  180. package/resource/knowledge/push/config/unity.md +1 -24
  181. package/resource/knowledge/push/config/unreal-engine.md +1 -24
  182. package/resource/knowledge/push/integration/android.md +0 -14
  183. package/resource/knowledge/push/integration/flutter.md +0 -19
  184. package/resource/knowledge/push/integration/harmonyos.md +0 -2
  185. package/resource/knowledge/push/integration/ios.md +0 -3
  186. package/resource/knowledge/push/integration/react-native.md +0 -24
  187. package/resource/knowledge/push/integration/uni-app.md +1 -11
  188. package/resource/knowledge/push/integration/unity.md +0 -9
  189. package/resource/knowledge/push/integration/unreal-engine.md +1 -17
  190. package/resource/knowledge/roomkit/core-sdk/android/call-user-to-room.md +0 -4
  191. package/resource/knowledge/roomkit/core-sdk/android/room-participant-state.md +0 -4
  192. package/resource/knowledge/roomkit/core-sdk/android/room-state.md +0 -4
  193. package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +1 -5
  194. package/resource/knowledge/roomkit/core-sdk/ios/call-user-to-room.md +0 -4
  195. package/resource/knowledge/roomkit/core-sdk/ios/room-participant-state.md +0 -4
  196. package/resource/knowledge/roomkit/core-sdk/ios/room-state.md +0 -4
  197. package/resource/knowledge/roomkit/core-sdk/ios/schedule-room.md +1 -5
  198. package/resource/knowledge/roomkit/core-sdk/vue/call-user-to-room.md +1 -1
  199. package/resource/knowledge/roomkit/core-sdk/vue/device-state.md +0 -6
  200. package/resource/knowledge/roomkit/core-sdk/vue/free-beauty-panel.md +0 -9
  201. package/resource/knowledge/roomkit/core-sdk/vue/room-chat.md +0 -11
  202. package/resource/knowledge/roomkit/core-sdk/vue/room-participant-state.md +1 -5
  203. package/resource/knowledge/roomkit/core-sdk/vue/room-state.md +1 -8
  204. package/resource/knowledge/roomkit/core-sdk/vue/room-view.md +0 -3
  205. package/resource/knowledge/roomkit/core-sdk/vue/screen-share.md +0 -3
  206. package/resource/knowledge/roomkit/core-sdk/vue/virtual-background.md +0 -5
  207. package/resource/knowledge/roomkit/preset/android/integration.md +0 -4
  208. package/resource/knowledge/roomkit/preset/flutter/integration.md +1 -13
  209. package/resource/knowledge/roomkit/preset/ios/integration.md +0 -6
  210. package/resource/knowledge/roomkit/preset/react/integration.md +0 -16
  211. package/resource/knowledge/rtcengine/web/api.md +1 -8
  212. package/resource/knowledge/rtcengine/web/faq.md +3 -5
  213. package/resource/knowledge/rtcengine/web/how_to_integrated_web_sdk.md +0 -6
  214. package/resource/knowledge/rtcengine/web/plugin/20-advanced-customized-capture-rendering.md +1 -1
  215. package/resource/knowledge/rtcengine/web/plugin/21-advanced-auto-play-policy.md +1 -1
  216. package/resource/knowledge/rtcengine/web/plugin/26-advanced-publish-cdn-stream.md +1 -1
  217. package/resource/knowledge/rtcengine/web/plugin/27-advanced-small-stream.md +1 -1
  218. package/resource/knowledge/rtcengine/web/plugin/31-advanced-plugins-overview.md +1 -3
  219. package/resource/knowledge/rtcengine/web/plugin/34-advanced-proxy.md +2 -4
  220. package/resource/knowledge/rtcengine/web/plugin/36-advanced-virtual-background.md +0 -4
  221. package/resource/knowledge/rtcengine/web/plugin/39-advanced-video-decoder.md +0 -2
  222. package/resource/knowledge/trtc/android/TRTCCloud.md +8 -56
  223. package/resource/knowledge/trtc/android/TRTCCloudDef.md +6 -7
  224. package/resource/knowledge/trtc/android/TRTCCloudListener.md +1 -18
  225. package/resource/knowledge/trtc/android/TXAudioEffectManager.md +0 -14
  226. package/resource/knowledge/trtc/android/TXDeviceManager.md +0 -1
  227. package/resource/knowledge/trtc/android/TXLiteAVCode.md +1 -1
  228. package/resource/knowledge/trtc/c++/ITRTCCloud.md +7 -59
  229. package/resource/knowledge/trtc/c++/ITXAudioEffectManager.md +0 -14
  230. package/resource/knowledge/trtc/c++/ITXDeviceManager.md +0 -4
  231. package/resource/knowledge/trtc/c++/TRTCCloudCallback.md +1 -19
  232. package/resource/knowledge/trtc/c++/TRTCTypeDef.md +6 -7
  233. package/resource/knowledge/trtc/c++/TXLiteAVCode.md +1 -1
  234. package/resource/knowledge/trtc/ios/TRTCCloud.md +9 -60
  235. package/resource/knowledge/trtc/ios/TRTCCloudDef.md +6 -7
  236. package/resource/knowledge/trtc/ios/TRTCCloudDelegate.md +1 -19
  237. package/resource/knowledge/trtc/ios/TXAudioEffectManager.md +0 -13
  238. package/resource/knowledge/trtc/ios/TXDeviceManager.md +0 -4
  239. package/resource/knowledge/trtc/ios/TXLiteAVCode.md +1 -1
  240. package/server.js +1 -1
  241. package/tools/common/search_trtc_knowledge.js +2 -0
  242. package/tools/definitions/search_trtc_knowledge_def.js +1 -0
  243. package/utils/report-cls-client.js +3 -3
  244. package/utils/report-es-client.js +1 -1
  245. package/resource/knowledge/roomkit/core-sdk/flutter/call-user-to-room.md +0 -230
  246. package/resource/knowledge/roomkit/core-sdk/flutter/room-participant-state.md +0 -797
  247. package/resource/knowledge/roomkit/core-sdk/flutter/room-state.md +0 -325
  248. package/resource/knowledge/roomkit/core-sdk/flutter/schedule-room.md +0 -325
@@ -1,54 +1,40 @@
1
- 本文档将帮助您使用 **AtomicXCore SDK** 的 **DeviceState**、**CallState 以及**核心组件 **CallCoreView**,快速构建一个支持通话功能的 **App**。
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
- > 推荐使用更高效的 AI 集成助手
4
- >
5
-
6
- > 我们为您提供了全新的 AI 集成方式,只需要描述您的需求,即可自动生成集成代码,大幅提升开发效率。
7
- >
8
-
9
- > 点击这里,立即体验 AI 集成
10
- >
11
-
12
- ## 准备工作
13
-
14
- ### 步骤1:开通服务
3
+ ## Prerequisites
15
4
 
16
- 请参见 开通服务,获取体验版或付费版 SDK。
5
+ ### Step 1: Activate the service
17
6
 
18
- ### 步骤2:在当前项目中导入 AtomicXCore
19
- 1. **安装组件**:打开 [AtomicXCore SDK](https://ext.dcloud.net.cn/plugin),单击**下载插件并导入 HBuilderX**,选择需要集成的项目并单击**确定**。
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
- 也可从 [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app) 下载源码,将 `App/uni_modules/tuikit-atomic-x` 目录拷贝至您项目的 `uni_modules/` 下。
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. **配置工程权限: **请在应用的 manifest.json 文件的 app-plus > distribute 节点下,确保添加了以下必要的权限:
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 平台(`Android`节点):在 `permissions` 数组中,请确保包含以下权限:
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 平台(`iOS` 节点):在 `privacyDescription` 对象中,请确保包含以下描述:
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
- 在 `UIBackgroundModes` 数组中,添加 `audio` 以支持后台音频播放。
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
- ### 步骤3:实现登录逻辑
33
+ ### Step 3: Implement the login logic
45
34
 
46
- 在您的项目中调用 LoginState 中的 [login](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#login) 方法完成登录,**这是使用 **`AtomicXCore`** 所有功能的关键前提**。
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,78 +44,78 @@ const { login } = useLoginState();
58
44
 
59
45
  const handleLogin = () => {
60
46
  login({
61
- sdkAppID: 1400000001, // 替换为您的 SDKAppID
62
- userID: "test_001", // 替换为您的 UserID
63
- userSig: "xxxxxxxxxx" // 替换为您的 UserSig
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>参数</strong> | <strong>类型</strong> | <strong>说明</strong> |
54
+ **Login parameters:**
55
+ | <strong>Parameter</strong> | <strong>Type</strong> | <strong>Description</strong> |
70
56
  | --- | --- | --- |
71
- | sdkAppID | number | 从 <a href="https://console.cloud.tencent.com/trtc">控制台</a> 获取,通常是以 <code>140</code> 或 <code>160</code> 开头的 10 位整数。 |
72
- | userID | string | 当前用户的唯一 ID,仅包含英文字母、数字、连字符和下划线。为避免多端登录冲突,<strong>请勿使用</strong><code>1</code>、<code>123</code><strong>等简单 ID</strong>。 |
73
- | userSig | string | 用于腾讯云鉴权的票据。请注意:<br>- 开发环境:您可以采用本地 <code>GenerateTestUserSig.genTestSig</code> 函数生成 userSig 或者通过 <a href="https://console.cloud.tencent.com/im/tool-usersig">UserSig 辅助工具</a> 生成临时的 UserSig。<br>- 生产环境:为了防止密钥泄露,请务必采用服务端生成 UserSig 的方式。详细信息请参考 <a href="https://cloud.tencent.com/document/product/647/17275">服务端生成 UserSig</a>。<br>更多信息请参见 <a href="https://cloud.tencent.com/document/product/647/17275">如何计算及使用 UserSig</a>。 |
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
+ ## Make your first call
76
62
 
77
- ### 步骤1:创建通话界面
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 a call is initiated. 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 or outgoing call.
81
67
 
82
- 2. **通话页面绑定 CallCoreView **: 通话视图核心组件,自动监听 **CallState** 数据并完成画面渲染,同时提供布局切换、头像与图标配置等 UI 定制化能力。
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 **为原生组件,不需要在文件中单独进行 **import**。挂载在页面上即可使用。
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
- |**设置等待接听用户的动画**|在多人通话场景下,支持传入 GIF 图像路径,为待接听状态的用户展示动画。|自定义 loading 动画|
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
- ### 步骤2:添加通话控制按钮
90
+ ### Step 2: Add call control buttons
105
91
 
106
- 您可以参考 **DeviceState**、**CallState** 提供的 API ,自定义添加您的按钮。
107
- - **DeviceState 功能说明:**麦克风(开关 / 音量)、摄像头(开关 / 切换 / 画质)、屏幕共享,设备状态实时监听。建议将对应方法绑定至按钮点击事件,并通过监听设备状态变更来实时刷新按钮的 UI 状态。
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
- - **图标资源下载:**按钮图标可以直接从 [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/tree/main/App) 下载。这些图标由我们的设计师专为 TUICallKit 打造,无版权风险,可放心使用。
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>图标:</strong> | | | | | | | | |
99
+ | <strong>Icons:</strong> | | | | | | | | |
114
100
  | --- | --- | --- | --- | --- | --- | --- | --- | --- |
115
101
 
116
- 以添加挂断、麦克风、摄像头按钮为例,实现方式如下:
102
+ The following example shows how to add a hangup button, a microphone toggle button, and a camera toggle button:
117
103
 
118
- 1. **添加挂断按钮**:创建并添加挂断按钮,在点击事件中调用 [hangup](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#hangup) 并销毁界面。
104
+ 1. **Add the hangup button**: create and add a hangup button. On tap, call [hangup](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#hangup) and destroy the view.
119
105
 
120
106
  ``` typescript
121
107
  <template>
122
108
  <view class="btn" @tap="handleHangup">
123
109
  <image class="btn-img" :style="[style]" :src="HANGUP_SRC"></image>
124
110
  <text class="btn-text" v-if="isShowText">
125
- 挂断
111
+ Hang up
126
112
  </text>
127
113
  </view>
128
114
  </template>
129
115
 
130
116
  <script setup lang="ts">
131
117
  import { computed } from "vue";
132
- import HANGUP_SRC from "../../../static/icon/hangup.png"; // 根据实际情况替换为您存放图标的路径
118
+ import HANGUP_SRC from "../../../static/icon/hangup.png"; // Replace with the actual icon path in your project
133
119
  import {
134
120
  useCallState
135
121
  } from '@/uni_modules/tuikit-atomic-x/state/CallState';
@@ -155,7 +141,7 @@ const handleLogin = () => {
155
141
 
156
142
  const handleHangup = () => {
157
143
  hangup();
158
- // 在点击事件中调用 hangup 接口并销毁页面
144
+ // Call the hangup API in the click handler and destroy the page
159
145
  };
160
146
  </script>
161
147
 
@@ -180,21 +166,21 @@ const handleLogin = () => {
180
166
  </style>
181
167
 
182
168
  ```
183
- 2. **添加麦克风开关按钮:**创建并添加麦克风开关按钮,在点击事件中调用 [openLocalMicrophone](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#openLocalMicrophone) 或 [closeLocalMicrophone](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#closeLocalMicrophone) 接口,并监听麦克风状态,实时更新按钮文本。
169
+ 2. **Add the microphone toggle button:** create and add a microphone toggle button. On tap, call [openLocalMicrophone](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#openLocalMicrophone) or [closeLocalMicrophone](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#closeLocalMicrophone), and listen to the microphone state to update the button text in real time.
184
170
 
185
171
  ``` typescript
186
172
  <template>
187
173
  <view class="btn" @tap="handleMic">
188
174
  <image class="btn-img" :src="microphoneStatus === DeviceStatus.ON "></image>
189
175
  <text class="btn-text">
190
- {{ microphoneStatus === DeviceStatus.ON ? '麦克风已开' : '麦克风已关' }}
176
+ {{ microphoneStatus === DeviceStatus.ON ? 'Microphone on' : 'Microphone off' }}
191
177
  </text>
192
178
  </view>
193
179
  </template>
194
180
 
195
181
  <script setup lang="ts">
196
- import MIC_ON_SRC from "../../../static/icon/mic-on.png"; // 根据实际情况替换为您存放图标的路径
197
- import MIC_OFF_SRC from "../../../static/icon/mic-off.png"; // 根据实际情况替换为您存放图标的路径
182
+ import MIC_ON_SRC from "../../../static/icon/mic-on.png"; // Replace with the actual icon path in your project
183
+ import MIC_OFF_SRC from "../../../static/icon/mic-off.png"; // Replace with the actual icon path in your project
198
184
  import {
199
185
  useDeviceState,
200
186
  DeviceStatus
@@ -205,7 +191,7 @@ const handleLogin = () => {
205
191
  closeLocalMicrophone,
206
192
  } = useDeviceState()
207
193
 
208
- // 点击事件调用开启或关闭麦克风
194
+ // Toggle the microphone in the click handler
209
195
  const handleMic = () => {
210
196
  if (microphoneStatus.value === DeviceStatus.ON) {
211
197
  closeLocalMicrophone();
@@ -235,21 +221,21 @@ const handleLogin = () => {
235
221
  }
236
222
  </style>
237
223
  ```
238
- 3. **添加摄像头开关按钮:**创建并添加摄像头开关按钮,在点击事件中调用 [openLocalCamera](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#openLocalCamera) 或 [closeLocalCamera](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#closeLocalCamera) 接口,并监听摄像头的状态,实时更新按钮文本。
224
+ 3. **Add the camera toggle button:** create and add a camera toggle button. On tap, call [openLocalCamera](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#openLocalCamera) or [closeLocalCamera](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#closeLocalCamera), and listen to the camera state to update the button text in real time.
239
225
 
240
226
  ``` typescript
241
227
  <template>
242
228
  <div class="btn" @tap="handleCamera">
243
229
  <image class="btn-img" :src="cameraStatus === DeviceStatus.ON "></image>
244
230
  <text class="btn-text">
245
- {{cameraStatus === DeviceStatus.ON ? '摄像头已开' : '摄像头已关'}}
231
+ {{cameraStatus === DeviceStatus.ON ? 'Camera on' : 'Camera off'}}
246
232
  </text>
247
233
  </div>
248
234
  </template>
249
235
 
250
236
  <script setup lang="ts">
251
- import CAMERA_ON_SRC from "../../../static/icon/camera-on.png"; // 根据实际情况替换为您存放图标的路径
252
- import CAMERA_OFF_SRC from "../../../static/icon/camera-off.png"; // 根据实际情况替换为您存放图标的路径
237
+ import CAMERA_ON_SRC from "../../../static/icon/camera-on.png"; // Replace with the actual icon path in your project
238
+ import CAMERA_OFF_SRC from "../../../static/icon/camera-off.png"; // Replace with the actual icon path in your project
253
239
  import {
254
240
  useDeviceState,
255
241
  DeviceStatus
@@ -261,7 +247,7 @@ const handleLogin = () => {
261
247
  isFrontCamera,
262
248
  } = useDeviceState()
263
249
 
264
- // 摄像头按钮点击事件
250
+ // Camera button click handler
265
251
  const handleCamera = () => {
266
252
  if (cameraStatus.value === DeviceStatus.ON) {
267
253
  closeLocalCamera()
@@ -292,14 +278,14 @@ const handleLogin = () => {
292
278
  </style>
293
279
  ```
294
280
 
295
- ### 步骤3:发起通话
281
+ ### Step 3: Initiate a call
296
282
 
297
- 您可以在 calls 调用成功后跳转通话界面,我们建议您根据媒体类型自动开启麦克风或摄像头获得更好的通话体验,实现方式如下:
298
- 1. **发起通话:**调用 [calls](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#calls) 发起通话。
283
+ After the `calls` API succeeds, navigate to the call view. We also recommend enabling the microphone (and camera for video calls) automatically according to the media type for a better call experience. Implement it as follows:
284
+ 1. **Initiate a call:** call [calls](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#calls) to start a call.
299
285
 
300
- 2. **开启媒体设备:**发起通话成功后开启麦克风,如果是视频通话同时开启摄像头。
286
+ 2. **Turn on media devices:** after the call is initiated successfully, turn on the microphone, and for video calls also turn on the camera.
301
287
 
302
- 3. **唤起通话页面:**发起通话成功,唤起通话页面。
288
+ 3. **Show the call view:** navigate to the call view once the call is initiated successfully.
303
289
 
304
290
  ``` typescript
305
291
  <script setup lang="ts">
@@ -311,46 +297,46 @@ const handleLogin = () => {
311
297
  const { openLocalCamera, openLocalMicrophone } = useDeviceState();
312
298
 
313
299
  const calleeUserID = ref('');
314
- const mediaType = ref(1); // 0: 语音, 1: 视频
300
+ const mediaType = ref(1); // 0: audio, 1: video
315
301
 
316
302
  const startCall = () => {
317
303
  const userID = calleeUserID.value.trim();
318
304
  if (!userID) {
319
- uni.showToast({ icon: 'none', title: '请输入对方用户ID' });
305
+ uni.showToast({ icon: 'none', title: 'Please enter the callee user ID' });
320
306
  return;
321
307
  }
322
308
 
323
- // 1. 打开本地设备
309
+ // 1. Turn on local devices
324
310
  if (mediaType.value === 1) {
325
311
  openLocalCamera({ isFront: true });
326
312
  }
327
313
  openLocalMicrophone();
328
314
 
329
- // 2. 发起通话
315
+ // 2. Initiate the call
330
316
  calls({
331
317
  participantIds: [userID],
332
318
  mediaType: mediaType.value,
333
319
  success: () => {
334
- console.log('发起通话成功');
320
+ console.log('Call initiated successfully');
335
321
  uni.navigateTo({
336
- url: '/uni_modules/tuikit-atomic-x/pages/call?layoutTemplate=Float' // 示例路径,请替换为您在步骤 1 中创建的真实通话界面路径
322
+ url: '/uni_modules/tuikit-atomic-x/pages/call?layoutTemplate=Float' // Example path; replace with the actual call page path you created in Step 1
337
323
  });
338
324
  },
339
325
  fail: (code: number, message: string) => {
340
- console.error('发起通话失败:', code, message);
341
- uni.showToast({ icon: 'none', title: `通话失败: ${message}` });
326
+ console.error('Failed to initiate call:', code, message);
327
+ uni.showToast({ icon: 'none', title: `Call failed: ${message}` });
342
328
  }
343
329
  });
344
330
  };
345
331
  </script>
346
332
  ```
347
333
 
348
- ### 步骤4:结束通话
334
+ ### Step 4: End the call
349
335
 
350
- 无论您调用 hangup 挂断还是对方主动结束通话,均会触发 `onCallEnded` 事件。 建议监听该事件,当该事件被触发(即通话结束)时,执行关闭当前界面的操作。实现方式如下:
351
- 1. **监听通话结束事件**:监听 `onCallEnded` 事件。
336
+ Whether you call `hangup` or the remote party ends the call, the `onCallEnded` event is triggered. We recommend listening to this event and closing the current view when it fires (i.e., when the call ends). Implement it as follows:
337
+ 1. **Listen to the call-ended event**: listen to `onCallEnded`.
352
338
 
353
- 2. **销毁通话页面**:`onCallEnded` 触发后,销毁通话页面。
339
+ 2. **Destroy the call view**: when `onCallEnded` fires, destroy the call view.
354
340
 
355
341
  ``` typescript
356
342
  import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
@@ -360,7 +346,8 @@ const handleLogin = () => {
360
346
  const { closeLocalCamera, closeLocalMicrophone } = useDeviceState();
361
347
 
362
348
  /**
363
- * 初始化通话服务(最小示例:仅处理通话结束事件并回退页面)建议在应用初始化时执行
349
+ * Initialize the call service (minimal example: handle only the call-ended event and pop the page).
350
+ * Call this during application startup.
364
351
  */
365
352
  export function initCallService() {
366
353
  addCallListener('onCallEnded', (event: string) => {
@@ -374,43 +361,43 @@ const handleLogin = () => {
374
361
 
375
362
  console.log('[CallService] onCallEnded, reason:', res.reason);
376
363
 
377
- // 关闭本地设备
364
+ // Close local devices
378
365
  closeLocalCamera();
379
366
  closeLocalMicrophone();
380
367
 
381
- // 页面回退
368
+ // Navigate back
382
369
  const pages = getCurrentPages();
383
370
  if (pages.length > 1) {
384
371
  uni.navigateBack({ delta: 1 });
385
372
  } else {
386
- uni.redirectTo({ url: '/pages/index/index' }); // 示例路径:请结合您的项目真实路径进行修改
373
+ uni.redirectTo({ url: '/pages/index/index' }); // Example path; adjust to your actual project path
387
374
  }
388
375
  });
389
376
  }
390
377
  ```
391
378
 
392
- **onCallEnded 事件参数详细说明**:
379
+ **`onCallEnded` event parameters:**
393
380
 
394
- | <strong>参数</strong> | <strong>类型</strong> | <strong>说明</strong> |
381
+ | <strong>Parameter</strong> | <strong>Type</strong> | <strong>Description</strong> |
395
382
  | --- | --- | --- |
396
- | callId | String | 此次通话的唯一标识。 |
397
- | mediaType | CallMediaType | 通话媒体类型,用于指定发起音频通话还是视频通话。<br>- <code>CallMediaType.Video</code>:视频通话。<br>- <code>CallMediaType.Audio</code>:语音通话。 |
398
- | reason | CallEndReason | 通话结束的原因。<br>- <code>Unknown</code>:未知原因,无法确定结束原因。<br>- <code>Hangup</code>:正常挂断,用户主动挂断通话。<br>- <code>Reject</code>:拒绝接听,被叫方拒绝来电。<br>- <code>Busy</code>:对方忙线,被叫方正在通话中。<br>- <code>Cancel</code>:通话取消,主叫方在对方接听前取消。 |
399
- | userId | String | 触发结束的用户 ID。 |
383
+ | callId | String | The unique identifier of this call. |
384
+ | mediaType | CallMediaType | The media type of the call, indicating whether it is an audio or video call.<br>- <code>CallMediaType.Video</code>: video call.<br>- <code>CallMediaType.Audio</code>: audio call. |
385
+ | reason | CallEndReason | The reason the call ended.<br>- <code>Unknown</code>: unknown reason.<br>- <code>Hangup</code>: normal hangup; the user actively hung up.<br>- <code>Reject</code>: the callee rejected the call.<br>- <code>Busy</code>: the callee is busy on another call.<br>- <code>Cancel</code>: the caller canceled the call before the callee answered. |
386
+ | userId | String | The user ID that triggered the end. |
400
387
 
401
- ### 运行效果
388
+ ### Result
402
389
 
403
- 当您完成以上 5 步后,"拨打一通电话"运行效果如下:
390
+ After the 5 steps above, the "Make a call" flow looks as follows:
404
391
 
405
- ## 定制页面
392
+ ## Customize the UI
406
393
 
407
- **CallCoreView** 提供了完善的 UI 定制能力,支持头像及音量提示等图标的自由替换。**为助力快速集成,您可以直接从 **[GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/blob/main/App/uni_modules/tuikit-atomic-x/static/icon/handsfree-on.png)**下载。这些图标由我们的设计师专为 TUICallKit 打造,无版权风险,可放心使用。**
394
+ **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/blob/main/App/uni_modules/tuikit-atomic-x/static/icon/handsfree-on.png)**. These icons are designed by our designers specifically for TUICallKit and are free from copyright issues.**
408
395
 
409
- ### 自定义音量提示的图标
396
+ ### Customize the volume indicator icon
410
397
 
411
- 您可以通过设置 **CallCoreView** 组件的 `volumeLevelIcons` 属性来设置音量大小等级不同的提示图标。
398
+ You can configure different volume-level indicator icons via the `volumeLevelIcons` property of the **CallCoreView** component.
412
399
 
413
- `volumeLevelIcons`**属性设置示例代码**:
400
+ Example code for the `volumeLevelIcons` property:
414
401
  ``` typescript
415
402
  <template>
416
403
  <view class="call-view-container">
@@ -429,7 +416,7 @@ const handleLogin = () => {
429
416
  const systemInfo = ref({});
430
417
 
431
418
  /**
432
- * 将 /static/ 相对路径转为原生层可用的本地绝对路径
419
+ * Convert a /static/ relative path to a local absolute path usable by the native layer
433
420
  */
434
421
  function toAbsolutePath(relativePath) {
435
422
  if (plus && plus.io && plus.io.convertLocalFileSystemURL) {
@@ -439,7 +426,7 @@ const handleLogin = () => {
439
426
  }
440
427
 
441
428
  /**
442
- * 批量转换对象中所有 value 的路径为绝对路径
429
+ * Convert all values of an icon map to absolute paths in a batch
443
430
  */
444
431
  function convertIconPaths(iconMap) {
445
432
  const result = {};
@@ -449,10 +436,10 @@ const handleLogin = () => {
449
436
  return result;
450
437
  }
451
438
 
452
- // 音量等级图标:key 为等级名称,value 为图标本地绝对路径
439
+ // Volume-level icons: keys are level names, values are local absolute paths of the icons
453
440
  const volumeLevelIcons = ref(convertIconPaths({
454
- "Mute": "/static/images/callview-self-mute.png", // 可以替换您项目中的实际图标路径
455
- "Low": "/static/images/callview-network.png" // 可以替换您项目中的实际图标路径
441
+ "Mute": "/static/images/callview-self-mute.png", // Replace with the actual icon path in your project
442
+ "Low": "/static/images/callview-network.png" // Replace with the actual icon path in your project
456
443
  }));
457
444
 
458
445
  onMounted(() => {
@@ -472,30 +459,27 @@ const handleLogin = () => {
472
459
  </style>
473
460
  ```
474
461
 
475
- > **说明:**
476
- >
477
-
478
- > uni-app 传递给原生层的参数只支持本地路径,因此需要将相对路径转化为本地路径。
462
+ > uni-app only supports local paths for parameters passed to the native layer, so relative paths must be converted to local paths.
479
463
  >
480
464
 
481
- - **属性参数详细说明:**
465
+ - **Property parameter details:**
482
466
 
483
- | <strong>参数</strong> | <strong>类型</strong> | <strong>是否必填</strong> | <strong>说明</strong> |
467
+ | <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
484
468
  | --- | --- | --- | --- |
485
- | icons | [String: String] | 是 | 音量等级与图标资源的映射表。结构说明如下:<br>- key ( VolumeLevel ) 表示音量等级:<br>- <code>Mute</code>:表示麦克风关闭,静音状态。<br>- <code>Low</code>:表示音量范围 (0-25]。<br>- <code>Medium</code>:表示音量范围 (25-50]。<br>- <code>High</code>:表示音量范围 (50-75]。<br>- <code>Peak</code>:表示音量范围 (75-100]。<br>- Value ( String ) 表示对应音量等级的图标资源路径。 |
469
+ | 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. |
486
470
 
487
- - **音量提示图标:**
471
+ - **Volume indicator icons:**
488
472
 
489
- | <strong>图标</strong> | <strong>说明</strong> |
473
+ | <strong>Icon</strong> | <strong>Description</strong> |
490
474
  | --- | --- |
491
- | | 【图标含义】音量提示图标。<br>【推荐用法】您可以将该图标等级设置为 <code>Low</code> 或 <code>Medium</code>,当用户音量大于对应等级时显示。 |
492
- | | 【图标含义】静音图标。<br>【推荐用法】您可以将该图标等级设置为 <code>Mute</code>,当该用户静音时显示。 |
475
+ | | [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. |
476
+ | | [Meaning] Mute icon.<br>[Recommended usage] Set this icon at the <code>Mute</code> level; it is displayed when the user is muted. |
493
477
 
494
- ### 自定义网络提示的图标
478
+ ### Customize the network indicator icon
495
479
 
496
- 您可以设置 **CallCoreView** 组件的 `networkQualityIcons` 属性设置不同网络状态的提示图标。
480
+ You can configure the network indicator icons for different network states via the `networkQualityIcons` property of the **CallCoreView** component.
497
481
 
498
- - `networkQualityIcons`** 属性设置示例代码:**
482
+ - Example code for the `networkQualityIcons` property:
499
483
 
500
484
  ``` typescript
501
485
 
@@ -516,7 +500,7 @@ const handleLogin = () => {
516
500
  const systemInfo = ref({});
517
501
 
518
502
  /**
519
- * 将 /static/ 相对路径转为原生层可用的本地绝对路径
503
+ * Convert a /static/ relative path to a local absolute path usable by the native layer
520
504
  */
521
505
  function toAbsolutePath(relativePath) {
522
506
  if (plus && plus.io && plus.io.convertLocalFileSystemURL) {
@@ -526,7 +510,7 @@ const handleLogin = () => {
526
510
  }
527
511
 
528
512
  /**
529
- * 批量转换对象中所有 value 的路径为绝对路径
513
+ * Convert all values of an icon map to absolute paths in a batch
530
514
  */
531
515
  function convertIconPaths(iconMap) {
532
516
  const result = {};
@@ -537,8 +521,8 @@ const handleLogin = () => {
537
521
  }
538
522
 
539
523
  const networkQualityIcons = ref(convertIconPaths({
540
- "BAD": "/static/images/callview-network-bad.png", // 可以替换您项目中的实际图标路径
541
- "VERY_BAD": "/static/images/callview-network-bad.png" // 可以替换您项目中的实际图标路径
524
+ "BAD": "/static/images/callview-network-bad.png", // Replace with the actual icon path in your project
525
+ "VERY_BAD": "/static/images/callview-network-bad.png" // Replace with the actual icon path in your project
542
526
  }));
543
527
 
544
528
  onMounted(() => {
@@ -557,23 +541,23 @@ const handleLogin = () => {
557
541
  }
558
542
  </style>
559
543
  ```
560
- - `networkQualityIcons`**接口参数详细说明:**
544
+ - `networkQualityIcons` parameter details:
561
545
 
562
- | <strong>参数</strong> | <strong>类型</strong> | <strong>是否必填</strong> | <strong>说明</strong> |
546
+ | <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
563
547
  | --- | --- | --- | --- |
564
- | icons | [String: String] | 是 | 网络质量与图标资源的映射表。结构说明如下:<br>- Key ( String):表示网络质量等级:<br>- <code>UNKNOWN</code>:未知网络状态。<br>- <code>EXCELLENT</code>:网络状态极佳。<br>- <code>GOOD</code>:网络状态较好。<br>- <code>POOR</code>:网络状态较差。<br>- <code>BAD</code>:网络状态差。<br>- <code>VERY_BAD</code>:网络状态极差。<br>- <code>DOWN</code>:网络断开。<br>- Value ( String ):对应网络状态的图标资源路径。 |
548
+ | 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. |
565
549
 
566
- - **网络较差的提示图标:**
550
+ - **Poor-network indicator icon:**
567
551
 
568
- | <strong>图标</strong> | <strong>说明</strong> |
552
+ | <strong>Icon</strong> | <strong>Description</strong> |
569
553
  | --- | --- |
570
- | | 【图标含义】网络较差的提示图标。<br>【推荐用法】您可以将该图标等级设置为 <code>BAD</code>、<code>VERY_BAD</code> 或 <code>DOWN</code>,当网络较差时显示该图标。 |
554
+ | | [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. |
571
555
 
572
- ### 自定义默认头像
556
+ ### Customize the default avatar
573
557
 
574
- 您可以设置 **CallCoreView** 的 `participantAvatars` 属性设置用户头像。建议您监听响应式数据 allParticipants(所有参与通话的成员):当获取到用户头像时设置并展示;若用户未设置头像或加载失败,则显示默认头像(占位图)。
558
+ 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).
575
559
 
576
- `participantAvatars`**属性设置示例代码:**
560
+ Example code for the `participantAvatars` property:
577
561
  ``` typescript
578
562
  <template>
579
563
  <view class="call-view-container">
@@ -601,7 +585,7 @@ const handleLogin = () => {
601
585
  let defaultAvatarReady = false;
602
586
 
603
587
  /**
604
- * 将相对路径转为原生层可用的本地绝对路径
588
+ * Convert a relative path to a local absolute path usable by the native layer
605
589
  */
606
590
  function toAbsolutePath(relativePath) {
607
591
  if (plus && plus.io && plus.io.convertLocalFileSystemURL) {
@@ -611,7 +595,7 @@ const handleLogin = () => {
611
595
  }
612
596
 
613
597
  /**
614
- * 下载头像并缓存,返回本地绝对路径
598
+ * Download and cache the avatar; return the local absolute path
615
599
  */
616
600
  function downloadAvatar(url) {
617
601
  if (avatarCache[url]) {
@@ -636,18 +620,18 @@ const handleLogin = () => {
636
620
  });
637
621
  }
638
622
 
639
- // 预下载默认头像
623
+ // Pre-download the default avatar
640
624
  const defaultAvatarPromise = downloadAvatar(DEFAULT_AVATAR_URL).then(localPath => {
641
625
  defaultAvatarLocalPath = localPath;
642
626
  defaultAvatarReady = true;
643
- // 默认头像就绪后,补刷一次参与者头像
627
+ // After the default avatar is ready, refresh participant avatars once
644
628
  if (allParticipants.value && allParticipants.value.length > 0) {
645
629
  updateParticipantAvatars(allParticipants.value);
646
630
  }
647
631
  });
648
632
 
649
633
  /**
650
- * 根据参与者列表,下载头像并构建 { userId: localPath } 映射
634
+ * Given the participant list, download avatars and build a { userId: localPath } map
651
635
  */
652
636
  async function updateParticipantAvatars(participants) {
653
637
  if (!participants || participants.length === 0) {
@@ -674,7 +658,7 @@ const handleLogin = () => {
674
658
  participantAvatars.value = avatarMap;
675
659
  }
676
660
 
677
- // 监听参与者变化,更新头像映射
661
+ // Watch participant changes and update the avatar map
678
662
  watch(() => allParticipants.value, async (newVal) => {
679
663
  if (!newVal) return;
680
664
  await updateParticipantAvatars(newVal);
@@ -696,23 +680,23 @@ const handleLogin = () => {
696
680
  }
697
681
  </style>
698
682
  ```
699
- - `participantAvatars`**属性参数详细说明:**
683
+ - `participantAvatars` parameter details:
700
684
 
701
- | <strong>参数</strong> | <strong>类型</strong> | <strong>是否必填</strong> | <strong>说明</strong> |
685
+ | <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
702
686
  | --- | --- | --- | --- |
703
- | avatars | [String: String] | 是 | 用户头像映射表。字典结构说明如下:<br>- Key:用户的 userID。<br>- Value:该用户的头像资源绝对路径。 |
687
+ | 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. |
704
688
 
705
- - **默认头像资源:**
689
+ - **Default avatar asset:**
706
690
 
707
- | <strong>图标</strong> | <strong>说明</strong> |
691
+ | <strong>Icon</strong> | <strong>Description</strong> |
708
692
  | --- | --- |
709
- | | 【图标含义】默认头像。<br>【推荐用法】当用户头像加载失败或无头像时,您可以给该用户设置此默认头像。 |
693
+ | | [Meaning] Default avatar.<br>[Recommended usage] When a user's avatar fails to load or is not available, set this as their default avatar. |
710
694
 
711
- ### 自定义 loading 动画
695
+ ### Customize the loading animation
712
696
 
713
- 您可以设置 **CallCoreView** 的 `waitingAnimation` 属性,为等待中用户设置等待动画获得更好的体验。
697
+ You can set the `waitingAnimation` property of **CallCoreView** to configure a waiting animation for waiting users for a better experience.
714
698
 
715
- - `waitingAnimation`** 属性设置示例代码:**
699
+ - Example code for the `waitingAnimation` property:
716
700
 
717
701
  ``` typescript
718
702
  <template>
@@ -732,7 +716,7 @@ const handleLogin = () => {
732
716
  const systemInfo = ref({});
733
717
 
734
718
  /**
735
- * 将 /static/ 相对路径转为原生层可用的本地绝对路径
719
+ * Convert a /static/ relative path to a local absolute path usable by the native layer
736
720
  */
737
721
  function toAbsolutePath(relativePath) {
738
722
  if (plus && plus.io && plus.io.convertLocalFileSystemURL) {
@@ -741,8 +725,8 @@ const handleLogin = () => {
741
725
  return relativePath;
742
726
  }
743
727
 
744
- // 等待动画 GIF:传入本地绝对路径供原生组件渲染
745
- const waitingAnimation = ref(toAbsolutePath("/static/images/callview-loading.gif")); // 可以替换您项目中的实际图标路径
728
+ // Waiting animation GIF: pass a local absolute path for the native component to render
729
+ const waitingAnimation = ref(toAbsolutePath("/static/images/callview-loading.gif")); // Replace with the actual icon path in your project
746
730
 
747
731
  onMounted(() => {
748
732
  uni.getSystemInfo({
@@ -760,23 +744,23 @@ const handleLogin = () => {
760
744
  }
761
745
  </style>
762
746
  ```
763
- - `waitingAnimation`** 接口参数详细说明:**
747
+ - `waitingAnimation` parameter details:
764
748
 
765
- |**参数**|**类型**|**是否必填**|**说明**|
749
+ |**Parameter**|**Type**|**Required**|**Description**|
766
750
  |---------|---------|---------|---------|
767
- |path|String|是|GIF 格式图像资源的绝对路径。|
751
+ |path|String|Yes|The absolute path of the GIF image resource.|
768
752
 
769
- - **等待接听的动画:**
753
+ - **Waiting-to-answer animation:**
770
754
 
771
- | <strong>图标</strong> | <strong>说明</strong> |
755
+ | <strong>Icon</strong> | <strong>Description</strong> |
772
756
  | --- | --- |
773
- | | 【图标含义】用户等待接听动画。<br>【推荐用法】群组通话时设置的动画。设置后,当用户的状态为等待接听时,显示该动画。 |
757
+ | | [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. |
774
758
 
775
- ### 添加通话计时提示
759
+ ### Add a call duration indicator
776
760
 
777
- 通话计时可通过响应式数据 activeCall 的 `duration` 字段实时获得,实时显示通话计时的实现方式如下:
761
+ 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:
778
762
 
779
- **绑定通话计时数据**:将 `activeCall.duration` 字段绑定至 UI 。该字段为响应式数据,会自动驱动 UI 实时刷新,无需手动维护定时器。
763
+ **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.
780
764
  ``` typescript
781
765
  <template>
782
766
  <view v-if="isConnected" class="call-timer">
@@ -822,12 +806,12 @@ const handleLogin = () => {
822
806
  </style>
823
807
  ```
824
808
 
825
- ## 更多功能
809
+ ## More features
826
810
 
827
- ### 自定义用户头像/昵称
811
+ ### Customize the user's avatar and nickname
828
812
 
829
- 通话开始前,您可以通过 setSelfInfo 方法,设置自己的昵称和头像。
830
- - **setSelfInfo 示例代码**:
813
+ Before a call starts, you can set your own nickname and avatar via the `setSelfInfo` method.
814
+ - Example code for `setSelfInfo`:
831
815
 
832
816
  ``` typescript
833
817
  import { useLoginState } from "@/uni_modules/tuikit-atomic-x/state/LoginState";
@@ -835,7 +819,7 @@ const handleLogin = () => {
835
819
  const { setSelfInfo } = useLoginState();
836
820
 
837
821
  /**
838
- * 设置当前登录用户的个人信息(昵称、头像等)
822
+ * Set the profile (nickname, avatar, etc.) of the currently signed-in user
839
823
  */
840
824
  export const setSelfUserInfo = (userID: string, nickname: string, avatarURL: string): void => {
841
825
  setSelfInfo({
@@ -845,29 +829,26 @@ const handleLogin = () => {
845
829
  avatarURL,
846
830
  },
847
831
  success: () => {
848
- console.log('用户信息设置成功');
832
+ console.log('User profile set successfully');
849
833
  },
850
834
  fail: (errCode: number, errMsg: string) => {
851
- console.error('用户信息设置失败:', errCode, errMsg);
835
+ console.error('Failed to set user profile:', errCode, errMsg);
852
836
  },
853
837
  });
854
838
  };
855
839
  ```
856
- - **setSelfInfo 接口参数详细说明:**
840
+ - `setSelfInfo` parameter details:
857
841
 
858
- | <strong>参数</strong> | <strong>类型</strong> | <strong>是否必填</strong> | <strong>说明</strong> |
842
+ | <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
859
843
  | --- | --- | --- | --- |
860
- | userProfile | UserProfile | 是 | 用户信息结构体:<br>- <code>userID</code>:用户的 ID。<br>- <code>avatarURL</code>:用户头像的 URL。<br>- <code>nickname</code>:用户的昵称。<br>更多字段详情可参考 UserProfile。 |
844
+ | 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. |
861
845
 
862
- ### 切换布局模式
846
+ ### Switch the layout mode
863
847
 
864
- **CallCoreView** 内置三种布局模式,您可以设置 `layoutTemplate` 属性来设置布局模式。若未主动配置,**CallCoreView** 将根据通话人数自动适配:1 V 1 场景下默认采用 `Float` 模式,多人通话场景下则自动切换为 `Grid` 模式。不同布局模式的说明如下:
865
- | <strong>Float 模式</strong> | <strong>Grid 模式</strong> | <strong>PIP 模式</strong> |
866
- | --- | --- | --- |
867
- | | | |
868
- | - <strong>布局逻辑:</strong>呼叫等待时全屏显示己方画面;接通后全屏显示对方画面,己方画面以悬浮小窗展示。<br>- <strong>交互特性:</strong>支持小窗拖拽移动,点击小窗可实现大小画面互换。 | - <strong>布局逻辑:</strong>所有成员画面呈网格状平铺排列成宫格模式布局,适用 2 人以上通话,支持点击放大画面功能。<br>- <strong>交互特性:</strong>支持点击特定成员画面放大查看。 | - <strong>布局逻辑:</strong>1 v 1 场景固定显示对方画面,多人场景:采用当前发言者(Active Speaker) 策略,自动识别并全屏展示正在说话的用户。<br>- <strong>交互特性:</strong>等待时显示自己的画面,接通后还会显示通话计时。 |
848
+ **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:
849
+ | - <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. |
869
850
 
870
- - `layoutTemplate`**属性设置示例代码:**
851
+ - Example code for the `layoutTemplate` property:
871
852
 
872
853
  ``` typescript
873
854
  <template>
@@ -888,10 +869,10 @@ const handleLogin = () => {
888
869
  const { activeCall } = useCallState();
889
870
 
890
871
  const systemInfo = ref({});
891
- // 布局模板:'Float' 单人浮窗布局,'Grid' 多人宫格布局
872
+ // Layout template: 'Float' for 1v1 floating layout, 'Grid' for multi-party grid layout
892
873
  const layoutTemplate = ref("Grid");
893
874
 
894
- // 根据通话信息自动切换布局:多人或群聊用 Grid,单人用 Float
875
+ // Automatically switch the layout based on call info: use Grid for multi-party or group chats, Float for 1v1
895
876
  watch(() => activeCall.value, (newValue) => {
896
877
  if (!newValue || !newValue.inviteeIds) {
897
878
  return;
@@ -919,15 +900,15 @@ const handleLogin = () => {
919
900
  </style>
920
901
 
921
902
  ```
922
- - `layoutTemplate`** 属性参数详细说明:**
903
+ - `layoutTemplate` parameter details:
923
904
 
924
- | <strong>参数</strong> | <strong>类型</strong> | <strong>说明</strong> |
905
+ | <strong>Parameter</strong> | <strong>Type</strong> | <strong>Description</strong> |
925
906
  | --- | --- | --- |
926
- | <code>layoutTemplate</code> | String | CallCoreView 的布局模式<br>- Float:<br>- 布局逻辑:呼叫等待时全屏显示己方画面;接通后全屏显示对方画面,己方画面以悬浮小窗展示。<br>- 交互特性:支持小窗拖拽移动,点击小窗可实现大小画面互换。<br>- Grid:<br>- 布局逻辑:所有成员画面呈网格状平铺排列成宫格模式布局,适用 2 人以上通话,支持点击放大画面功能。<br>- 交互特性:支持点击特定成员画面放大查看。<br>- PIP:<br>- 布局逻辑:1v1 场景固定显示对方画面,多人场景:采用当前发言者(Active Speaker) 策略,自动识别并全屏展示正在说话的用户。<br>- 交互特性:等待时显示自己的画面,接通后还会显示通话计时。 |
907
+ | <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. |
927
908
 
928
- ### 设置通话的默认超时时间
909
+ ### Set the default call timeout
929
910
 
930
- 您可以在发起通话 [calls](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#calls) 时,通过配置参数 CallParams 中的 `timeout` 字段来指定等待超时时间。示例代码如下:
911
+ When starting a call via [calls](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#calls), you can specify the wait timeout via the `timeout` field of the `CallParams` configuration. Example:
931
912
  ``` typescript
932
913
  <script setup>
933
914
  import { ref } from 'vue';
@@ -936,12 +917,12 @@ import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
936
917
  const { calls } = useCallState();
937
918
 
938
919
  const calleeUserID = ref('');
939
- const mediaType = ref(1); // 0: 语音, 1: 视频
920
+ const mediaType = ref(1); // 0: audio, 1: video
940
921
 
941
922
  const startCall = () => {
942
923
  const userID = calleeUserID.value.trim();
943
924
  if (!userID) {
944
- uni.showToast({ icon: 'none', title: '请输入对方用户ID' });
925
+ uni.showToast({ icon: 'none', title: 'Please enter the callee user ID' });
945
926
  return;
946
927
  }
947
928
  calls({
@@ -951,29 +932,29 @@ const startCall = () => {
951
932
  timeout: 30
952
933
  },
953
934
  success: () => {
954
- console.log('发起通话成功');
935
+ console.log('Call initiated successfully');
955
936
  uni.navigateTo({
956
- url: '/uni_modules/tuikit-atomic-x/pages/call?layoutTemplate=Float' // 示例路径,请替换为您在步骤 1 中创建的真实通话界面路径
937
+ url: '/uni_modules/tuikit-atomic-x/pages/call?layoutTemplate=Float' // Example path; replace with the actual call page path you created in Step 1
957
938
  });
958
939
  },
959
940
  fail: (code, message) => {
960
- console.error('发起通话失败:', code, message);
961
- uni.showToast({ icon: 'none', title: `通话失败: ${message}` });
941
+ console.error('Failed to initiate call:', code, message);
942
+ uni.showToast({ icon: 'none', title: `Call failed: ${message}` });
962
943
  }
963
944
  });
964
945
  };
965
946
  </script>
966
947
 
967
948
  ```
968
- | <strong>参数</strong> | <strong>类型</strong> | <strong>是否必填</strong> | <strong>说明</strong> |
949
+ | <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
969
950
  | --- | --- | --- | --- |
970
- | participantIds | Array | 是 | 目标用户的 userId 列表。 |
971
- | mediaType | CallMediaType | 是 | 通话媒体类型,用于指定发起音频通话还是视频通话。<br>- <code>CallMediaType.Video</code>:视频通话。<br>- <code>CallMediaType.Audio</code>:语音通话。 |
972
- | params | CallParams | 否 | 通话扩展参数,如:房间号、通话邀请超时时间等。<br>- <code>roomId</code> (String):房间 ID,可选参数,未指定时由服务端自动分配。<br>- <code>timeout</code> (Int):呼叫超时时间(秒)。<br>- <code>userData</code> (String):用户自定义数据。<br>- <code>chatGroupId</code> (String):Chat 群组 ID,用于群组通话场景。<br>- <code>isEphemeralCall</code> (Boolean):是否为加密通话(不产生通话记录)。 |
951
+ | participantIds | Array | Yes | The list of target userIds. |
952
+ | mediaType | CallMediaType | Yes | The media type of the call, indicating whether it is an audio or video call.<br>- <code>CallMediaType.Video</code>: video call.<br>- <code>CallMediaType.Audio</code>: audio call. |
953
+ | params | CallParams | No | Extended call parameters, such as room ID, call invitation timeout, etc.<br>- <code>roomId</code> (String): the room ID. Optional; if not specified, the server assigns one automatically.<br>- <code>timeout</code> (Int): call timeout in seconds.<br>- <code>userData</code> (String): user-defined data.<br>- <code>chatGroupId</code> (String): the Chat group ID, used for group call scenarios.<br>- <code>isEphemeralCall</code> (Boolean): whether the call is ephemeral (does not produce a call record). |
973
954
 
974
- ### 播放等待接听的提示音
955
+ ### Play the ringback tone while waiting
975
956
 
976
- 您可以监听自己的通话状态,在等待接听时播放铃声,在接听通话或通话结束时停止播放铃声。
957
+ You can listen to your own call state, play a ringtone while waiting for the callee to answer, and stop the ringtone when the call is answered or ended.
977
958
  ``` typescript
978
959
  import { watch } from 'vue';
979
960
  import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
@@ -1012,11 +993,11 @@ function stopRingtone() {
1012
993
  }
1013
994
 
1014
995
  export { playRingtone, stopRingtone };
1015
- // 建议在应用初始化的时候执行该函数
996
+ // It is recommended to call this function during application initialization
1016
997
  export function initCallService() {
1017
998
  ensureAudioContext();
1018
999
 
1019
- // 通话接通(status=2)或结束(status=0)时,停止铃声
1000
+ // Stop the ringtone when the call is connected (status=2) or ended (status=0)
1020
1001
  watch(() => selfInfo.value, (newVal) => {
1021
1002
  if (newVal?.status === 2 || newVal?.status === 0) {
1022
1003
  stopRingtone();
@@ -1025,36 +1006,33 @@ export function initCallService() {
1025
1006
  }
1026
1007
  ```
1027
1008
 
1028
- ## 下一步
1029
-
1030
- 恭喜您,已经完成了"拨打一通电话",接下来,您可参考 接听第一通电话 实现接听电话功能。
1009
+ ## Next step
1031
1010
 
1032
- ## 常见问题
1011
+ Congratulations, you have completed "Make a call". Next, you can .
1033
1012
 
1034
- ### 如何保证通话过程中屏幕常亮?
1013
+ ## FAQ
1035
1014
 
1036
- uni-app 官方提供了对应的设置接口 [uni.setScreenBrightness](https://uniapp.dcloud.net.cn/api/system/brightness.html)
1015
+ ### How can I keep the screen always on during a call?
1037
1016
 
1038
- ### 如何禁止系统侧滑返回上一个页面的行为?
1017
+ uni-app provides an official API for this: [uni.setScreenBrightness](https://uniapp.dcloud.net.cn/api/system/brightness.html).
1039
1018
 
1040
- iOS 端可以通过设置页面上的 disableSwipeBack 属性进行禁止。详情参考 [uni-app 官方文档](https://uniapp.dcloud.net.cn/collocation/pages.html)。
1019
+ ### How can I disable the system back-swipe gesture on the previous page?
1041
1020
 
1042
- Android 端可以通过 onBackPress 拦截系统侧滑和物理返回,示例代码如下:
1021
+ 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.
1043
1022
 
1044
- > **注意:**
1045
- >
1023
+ On Android, you can intercept both the back-swipe gesture and the physical back button via `onBackPress`. Example:
1046
1024
 
1047
- > 使用该方式进行系统侧滑和物理返回的拦截需要确保该页面使用的是 [自定义导航栏](https://uniapp.dcloud.net.cn/collocation/pages.html#customnav)。
1025
+ > 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).
1048
1026
  >
1049
1027
 
1050
1028
  ``` typescript
1051
1029
  <script setup>
1052
1030
  import { onBackPress } from '@dcloudio/uni-app'
1053
1031
 
1054
- // 拦截系统侧滑和物理返回键,防止通话中误退出
1032
+ // Intercept the system back-swipe and physical back button to prevent accidental exit during a call
1055
1033
  onBackPress((option) => {
1056
1034
  if (option.from === 'backbutton') {
1057
- return true; // 返回 true 阻止默认回退行为
1035
+ return true; // Return true to block the default back behavior
1058
1036
  }
1059
1037
  });
1060
1038
  </script>