@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,75 +44,75 @@ 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
+ ## Answer an incoming 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 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. **通话页面绑定 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 example below shows how to add "Answer" and "Reject" buttons:**
117
103
 
118
- 1. **添加接听按钮:**添加"接听"按钮,将其点击事件绑定至 [accept](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#accept) 方法。
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">接听</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. **添加拒接按钮:**添加"拒接"按钮,将其点击事件分别绑定至 [reject](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#reject) 方法。
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">拒绝</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. **拨打方取消通话或您拒接时销毁界面:**无论拨打方取消呼叫,还是接收方拒接,均会触发 `onCallEnded`(通话结束)事件。建议监听此事件,以便在通话终止时及时关闭(销毁)通话界面。
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
- ### 步骤3:来电唤起通话界面
229
+ ### Step 3: Bring up the call view on incoming call
243
230
 
244
- 在您的项目中监听来电事件(`onCallReceived`),当收到来电时唤起通话页面。实现方式如下:
245
- 1. **监听来电事件:**订阅 `onCallReceived` 事件。
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'; // 替换为您在步骤1 中创建的真实路径
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
- ### 步骤4:来电播放提示
253
+ ### Step 4: Play the ringtone on incoming call
267
254
 
268
- 在您的项目中监听来电事件(`onCallReceived`),当收到来电时播放铃声。实现方式如下:
269
- 1. **监听来电事件:**订阅 `onCallReceived` 事件。
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
- // 监听通话状态变化:接通(status=2)或结束(status=0)时停止铃声
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
- ### 步骤5:来电打开媒体设备
340
+ ### Step 5: Turn on media devices on incoming call
354
341
 
355
- 收到来电时,您可以通过 `onCallReceived` 事件获取本次通话的媒体类型。为了提供更佳的用户体验,建议在唤起通话界面时,根据通话类型预先开启对应的媒体设备。实现步骤如下:
356
- 1. **监听来电事件**:订阅 `onCallReceived` 事件。
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'; // 替换为您在步骤1 中创建的真实路径
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
- 当您完成以上 6 步后,"接听一通电话"运行效果如下:
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** 提供了完善的 UI 定制能力,支持头像及音量提示等图标的自由替换。**为助力快速集成,您可以直接从 **[GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/tree/main/App)**下载。这些图标由我们的设计师专为 TUICallKit 打造,无版权风险,可放心使用。**
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
- 您可以通过设置 **CallCoreView** 组件的 `volumeLevelIcons` 属性来设置音量大小等级不同的提示图标。
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
- * 将 /static/ 相对路径转为原生层可用的本地绝对路径
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
- * 批量转换对象中所有 value 的路径为绝对路径
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
- // 音量等级图标:key 为等级名称,value 为图标本地绝对路径
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>参数</strong> | <strong>类型</strong> | <strong>是否必填</strong> | <strong>说明</strong> |
459
+ | <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
476
460
  | --- | --- | --- | --- |
477
- | 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 ) 表示对应音量等级的图标资源路径。 |
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>图标</strong> | <strong>说明</strong> |
465
+ | <strong>Icon</strong> | <strong>Description</strong> |
482
466
  | --- | --- |
483
- | | 【图标含义】音量提示图标。<br>【推荐用法】您可以将该图标等级设置为 <code>Low</code> 或 <code>Medium</code>,当用户音量大于对应等级时显示。 |
484
- | | 【图标含义】静音图标。<br>【推荐用法】您可以将该图标等级设置为 <code>Mute</code>,当该用户静音时显示。 |
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
- 您可以设置 **CallCoreView** 组件的 `networkQualityIcons` 属性设置不同网络状态的提示图标。
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
- * 将 /static/ 相对路径转为原生层可用的本地绝对路径
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
- * 批量转换对象中所有 value 的路径为绝对路径
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>参数</strong> | <strong>类型</strong> | <strong>是否必填</strong> | <strong>说明</strong> |
538
+ | <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
555
539
  | --- | --- | --- | --- |
556
- | 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 ):对应网络状态的图标资源路径。 |
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>图标</strong> | <strong>说明</strong> |
544
+ | <strong>Icon</strong> | <strong>Description</strong> |
561
545
  | --- | --- |
562
- | | 【图标含义】网络较差的提示图标。<br>【推荐用法】您可以将该图标等级设置为 <code>BAD</code>、<code>VERY_BAD</code> 或 <code>DOWN</code> ,当网络较差时显示该图标。 |
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
- 您可以设置 **CallCoreView** 的 `participantAvatars` 属性设置用户头像。建议您监听响应式数据 allParticipants(所有参与通话的成员):当获取到用户头像时设置并展示;若用户未设置头像或加载失败,则显示默认头像(占位图)。
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
- * 根据参与者列表,下载头像并构建 { userId: localPath } 映射
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>参数</strong> | <strong>类型</strong> | <strong>是否必填</strong> | <strong>说明</strong> |
677
+ | <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
694
678
  | --- | --- | --- | --- |
695
- | avatars | [String: String] | 是 | 用户头像映射表。字典结构说明如下:<br>- Key:用户的 userID。<br>- Value:该用户的头像资源绝对路径。 |
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>图标</strong> | <strong>说明</strong> |
683
+ | <strong>Icon</strong> | <strong>Description</strong> |
700
684
  | --- | --- |
701
- | | 【图标含义】默认头像。<br>【推荐用法】当用户头像加载失败或无头像时,您可以给该用户设置此默认头像。 |
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
- ### 自定义 loading 动画
687
+ ### Customize the loading animation
704
688
 
705
- 您可以设置 **CallCoreView** 的 `waitingAnimation` 属性,为等待中用户设置等待动画获得更好的体验。
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
- * 将 /static/ 相对路径转为原生层可用的本地绝对路径
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
- // 等待动画 GIF:传入本地绝对路径供原生组件渲染
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|是|GIF 格式图像资源的绝对路径。|
743
+ |path|String|Yes|The absolute path of the GIF image resource.|
760
744
 
761
- - **等待接听的动画:**
745
+ - **Waiting-to-answer animation:**
762
746
 
763
- | <strong>图标</strong> | <strong>说明</strong> |
747
+ | <strong>Icon</strong> | <strong>Description</strong> |
764
748
  | --- | --- |
765
- | | 【图标含义】用户等待接听动画。<br>【推荐用法】群组通话时设置的动画。设置后,当用户的状态为等待接听时,显示该动画。 |
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
- 通话计时可通过响应式数据 activeCall 的 `duration` 字段实时获得,实时显示通话计时的实现方式如下:
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
- **绑定通话计时数据**:将 `activeCall.duration` 字段绑定至 UI 。该字段为响应式数据,会自动驱动 UI 实时刷新,无需手动维护定时器。
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
- 通话开始前,您可以通过 [setSelfInfo](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#setSelfInfo) 方法,设置自己的昵称和头像。
822
- - **setSelfInfo 示例代码**:
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('用户信息设置失败:', errCode, errMsg);
827
+ console.error('Failed to set user profile:', errCode, errMsg);
844
828
  },
845
829
  });
846
830
  };
847
831
  ```
848
- - **setSelfInfo 接口参数详细说明:**
832
+ - `setSelfInfo` parameter details:
849
833
 
850
- | <strong>参数</strong> | <strong>类型</strong> | <strong>是否必填</strong> | <strong>说明</strong> |
834
+ | <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
851
835
  | --- | --- | --- | --- |
852
- | userProfile | UserProfile | 是 | 用户信息结构体:<br>- <code>userID</code>:用户的 ID<br>- <code>avatarURL</code>:用户头像的 URL<br>- <code>nickname</code>:用户的昵称<br>更多字段详情可参考 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** 内置三种布局模式,您可以设置 `layoutTemplate` 属性来设置布局模式。若未主动配置,**CallCoreView** 将根据通话人数自动适配:1 V 1 场景下默认采用 `Float` 模式,多人通话场景下则自动切换为 `Grid` 模式。不同布局模式的说明如下:
857
- | <strong>Float 模式</strong> | <strong>Grid 模式</strong> | <strong>PIP 模式</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
- // 布局模板:'Float' 单人浮窗布局,'Grid' 多人宫格布局
864
+ // Layout template: 'Float' for 1v1 floating layout, 'Grid' for multi-party grid layout
884
865
  const layoutTemplate = ref("Grid");
885
866
 
886
- // 根据通话信息自动切换布局:多人或群聊用 Grid,单人用 Float
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>参数</strong> | <strong>类型</strong> | <strong>说明</strong> |
897
+ | <strong>Parameter</strong> | <strong>Type</strong> | <strong>Description</strong> |
917
898
  | --- | --- | --- |
918
- | <code>layoutTemplate</code> | String | CallCoreView 的布局模式<br>- Float:<br>- 布局逻辑:呼叫等待时全屏显示己方画面;接通后全屏显示对方画面,己方画面以悬浮小窗展示。<br>- 交互特性:支持小窗拖拽移动,点击小窗可实现大小画面互换。<br>- Grid:<br>- 布局逻辑:所有成员画面呈网格状平铺排列成宫格模式布局,适用 2 人以上通话,支持点击放大画面功能。<br>- 交互特性:支持点击特定成员画面放大查看。<br>- PIP:<br>- 布局逻辑:1v1 场景固定显示对方画面,多人场景:采用当前发言者(Active Speaker) 策略,自动识别并全屏展示正在说话的用户。<br>- 交互特性:等待时显示自己的画面,接通后还会显示通话计时。 |
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
- uni-app 官方提供了对应的设置接口 [uni.setScreenBrightness](https://uniapp.dcloud.net.cn/api/system/brightness.html)。
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
- iOS 端可以通过设置页面上的 disableSwipeBack 属性进行禁止。详情参考 [uni-app 官方文档](https://uniapp.dcloud.net.cn/collocation/pages.html)。
911
+ ### How can I disable the system back-swipe gesture on the previous page?
933
912
 
934
- Android 端可以通过 onBackPress 拦截系统侧滑和物理返回,示例代码如下:
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
- > 使用该方式进行系统侧滑和物理返回的拦截需要确保该页面使用的是 [自定义导航栏](https://uniapp.dcloud.net.cn/collocation/pages.html#customnav)。
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; // 返回 true 阻止默认回退行为
927
+ return true; // Return true to block the default back behavior
950
928
  }
951
929
  });
952
930
  </script>