@tencentcloud/sdk-mcp 1.4.7 → 1.6.0-beta.1

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 (556) hide show
  1. package/index.js +0 -1
  2. package/knowledge/bm25-cache.js +73 -0
  3. package/knowledge/bm25.js +147 -0
  4. package/knowledge/build-index.js +65 -0
  5. package/knowledge/chunker.js +167 -0
  6. package/knowledge/content-loader.js +44 -0
  7. package/knowledge/extractors.js +25 -0
  8. package/knowledge/path-meta.js +175 -0
  9. package/knowledge/search/exact-lookup.js +330 -0
  10. package/knowledge/search/filter-pool.js +86 -0
  11. package/knowledge/search/requires-framework.js +72 -0
  12. package/knowledge/search/search-knowledge.js +226 -0
  13. package/package.json +9 -9
  14. package/resource/_schema/feature-aliases.yaml +10 -0
  15. package/resource/_schema/goal-tags.yaml +72 -0
  16. package/resource/_schema/products.yaml +16 -0
  17. package/resource/_schema/trtc-intents.yaml +27 -0
  18. package/resource/_schema/types.yaml +44 -0
  19. package/resource/index/component-slugs.json +1 -0
  20. package/resource/index/manifest.json +1 -0
  21. package/resource/{doc → integration}/callkit/preset/android/integration.md +32 -28
  22. package/resource/{doc → integration}/callkit/preset/flutter/integration.md +109 -54
  23. package/resource/integration/callkit/preset/ios/integration.md +411 -0
  24. package/resource/integration/callkit/preset/react/integration.md +499 -0
  25. package/resource/integration/callkit/preset/vue/integration.md +768 -0
  26. package/resource/{doc/chatkit → integration/chat/preset}/android/integration.md +11 -11
  27. package/resource/{doc/chatkit → integration/chat/preset}/flutter/integration.md +59 -37
  28. package/resource/integration/chat/preset/ios/integration.md +568 -0
  29. package/resource/{doc/chatkit → integration/chat/preset}/react/integration.md +127 -95
  30. package/resource/integration/chat/preset/uni-app/integration.md +494 -0
  31. package/resource/{doc/chatkit → integration/chat/preset}/vue/integration.md +163 -143
  32. package/resource/{doc → integration}/livekit/preset/live/vue/live-list-integration.md +15 -15
  33. package/resource/{doc → integration}/livekit/preset/live/vue/live-player-desk-integration.md +25 -13
  34. package/resource/{doc → integration}/livekit/preset/live/vue/live-player-h5-integration.md +15 -9
  35. package/resource/{doc → integration}/livekit/preset/live/vue/live-pusher-integration.md +31 -26
  36. package/resource/integration/roomkit/preset/vue/integration.md +571 -0
  37. package/resource/knowledge/callkit/core-sdk/android/answer-call.md +852 -0
  38. package/resource/knowledge/callkit/core-sdk/android/make-call.md +929 -0
  39. package/resource/knowledge/callkit/core-sdk/android/offline-push.md +364 -0
  40. package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +1150 -0
  41. package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +1216 -0
  42. package/resource/knowledge/callkit/core-sdk/flutter/offline-push.md +412 -0
  43. package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +1191 -0
  44. package/resource/knowledge/callkit/core-sdk/ios/make-call.md +1292 -0
  45. package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +537 -0
  46. package/resource/knowledge/callkit/core-sdk/uni-app/answer-call.md +953 -0
  47. package/resource/knowledge/callkit/core-sdk/uni-app/make-call.md +1061 -0
  48. package/resource/knowledge/callkit/faq/android.md +168 -0
  49. package/resource/knowledge/callkit/faq/common.md +180 -0
  50. package/resource/knowledge/callkit/faq/flutter.md +52 -0
  51. package/resource/knowledge/callkit/faq/ios.md +116 -0
  52. package/resource/knowledge/callkit/faq/uniapp-app.md +89 -0
  53. package/resource/knowledge/callkit/faq/uniapp-miniprogram.md +217 -0
  54. package/resource/knowledge/callkit/faq/web.md +363 -0
  55. package/resource/knowledge/callkit/preset/android/api.md +413 -0
  56. package/resource/knowledge/callkit/preset/flutter/api.md +22 -0
  57. package/resource/knowledge/callkit/preset/ios/api.md +256 -0
  58. package/resource/knowledge/callkit/preset/web/api.md +79 -0
  59. package/resource/knowledge/chat/preset/android/features/chat-setting.md +72 -0
  60. package/resource/knowledge/chat/preset/android/features/contact-list.md +41 -0
  61. package/resource/knowledge/chat/preset/android/features/conversation-list.md +123 -0
  62. package/resource/knowledge/chat/preset/android/features/language.md +142 -0
  63. package/resource/knowledge/chat/preset/android/features/message-input.md +57 -0
  64. package/resource/knowledge/chat/preset/android/features/message-list.md +142 -0
  65. package/resource/knowledge/chat/preset/android/features/search.md +64 -0
  66. package/resource/{doc/chatkit → knowledge/chat/preset}/android/features/theme.md +21 -18
  67. package/resource/knowledge/chat/preset/android-view/integration.md +448 -0
  68. package/resource/knowledge/chat/preset/flutter/features/chat-setting.md +62 -0
  69. package/resource/knowledge/chat/preset/flutter/features/contact-list.md +40 -0
  70. package/resource/knowledge/chat/preset/flutter/features/conversation-list.md +129 -0
  71. package/resource/knowledge/chat/preset/flutter/features/language.md +104 -0
  72. package/resource/knowledge/chat/preset/flutter/features/message-input.md +54 -0
  73. package/resource/knowledge/chat/preset/flutter/features/message-list.md +163 -0
  74. package/resource/knowledge/chat/preset/flutter/features/search.md +59 -0
  75. package/resource/{doc/chatkit → knowledge/chat/preset}/flutter/features/theme.md +47 -19
  76. package/resource/knowledge/chat/preset/ios/features/chat-setting.md +92 -0
  77. package/resource/knowledge/chat/preset/ios/features/contact-list.md +119 -0
  78. package/resource/knowledge/chat/preset/ios/features/conversation-list.md +134 -0
  79. package/resource/knowledge/chat/preset/ios/features/language.md +105 -0
  80. package/resource/knowledge/chat/preset/ios/features/message-input.md +69 -0
  81. package/resource/knowledge/chat/preset/ios/features/message-list.md +164 -0
  82. package/resource/knowledge/chat/preset/ios/features/search.md +94 -0
  83. package/resource/{doc/chatkit → knowledge/chat/preset}/ios/features/theme.md +54 -51
  84. package/resource/{doc/chatkit/ios → knowledge/chat/preset/ios-uikit}/integration.md +157 -94
  85. package/resource/knowledge/chat/preset/react/features/chat-setting.md +123 -0
  86. package/resource/{doc/chatkit/react/components → knowledge/chat/preset/react/features}/contact-list.md +256 -104
  87. package/resource/knowledge/chat/preset/react/features/conversation-actions.md +217 -0
  88. package/resource/{doc/chatkit/react/components → knowledge/chat/preset/react/features}/conversation-list.md +86 -79
  89. package/resource/knowledge/chat/preset/react/features/conversation-preview.md +99 -0
  90. package/resource/knowledge/chat/preset/react/features/conversation-search.md +58 -0
  91. package/resource/{doc/chatkit/react/components → knowledge/chat/preset/react/features}/message-input.md +30 -83
  92. package/resource/{doc/chatkit/react/components → knowledge/chat/preset/react/features}/message-list.md +22 -25
  93. package/resource/knowledge/chat/preset/react/features/search.md +531 -0
  94. package/resource/knowledge/chat/preset/react/features/theme.md +16 -0
  95. package/resource/knowledge/chat/preset/vue/features/chat-header.md +331 -0
  96. package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/chat-setting.md +0 -4
  97. package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/contact-list.md +59 -53
  98. package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/conversation-actions.md +49 -43
  99. package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/conversation-list.md +61 -49
  100. package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/conversation-preview.md +43 -40
  101. package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/conversation-search.md +1 -1
  102. package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/message-input.md +128 -105
  103. package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/message-list.md +108 -195
  104. package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/search.md +74 -68
  105. package/resource/knowledge/chat/preset/vue/features/theme.md +136 -0
  106. package/resource/knowledge/chat/urls/error-code.md +16 -0
  107. package/resource/knowledge/chat/urls/product.md +61 -0
  108. package/resource/knowledge/chat/urls/restapi.md +226 -0
  109. package/resource/knowledge/chat/urls/sdk/android.md +84 -0
  110. package/resource/knowledge/chat/urls/sdk/flutter.md +73 -0
  111. package/resource/knowledge/chat/urls/sdk/ios.md +84 -0
  112. package/resource/knowledge/chat/urls/sdk/web.md +88 -0
  113. package/resource/knowledge/chat/urls/webhook.md +73 -0
  114. package/resource/{doc/livekit/core-sdk/live/android/api-reference → knowledge/livekit/core-sdk/api-reference/android}/AudioEffectStore.md +79 -76
  115. package/resource/knowledge/livekit/core-sdk/api-reference/android/BarrageStore.md +174 -0
  116. package/resource/knowledge/livekit/core-sdk/api-reference/android/BattleStore.md +329 -0
  117. package/resource/{doc/livekit/core-sdk/live/android/api-reference → knowledge/livekit/core-sdk/api-reference/android}/CameraView.md +7 -6
  118. package/resource/knowledge/livekit/core-sdk/api-reference/android/CoGuestStore.md +434 -0
  119. package/resource/knowledge/livekit/core-sdk/api-reference/android/CoHostStore.md +362 -0
  120. package/resource/knowledge/livekit/core-sdk/api-reference/android/DeviceStore.md +466 -0
  121. package/resource/knowledge/livekit/core-sdk/api-reference/android/GiftStore.md +173 -0
  122. package/resource/{doc/livekit/core-sdk/live/android/api-reference → knowledge/livekit/core-sdk/api-reference/android}/LikeStore.md +12 -10
  123. package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveAudienceStore.md +291 -0
  124. package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveCoreView.md +78 -0
  125. package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveSeatStore.md +439 -0
  126. package/resource/knowledge/livekit/core-sdk/api-reference/android/LoginStore.md +221 -0
  127. package/resource/{doc/livekit/core-sdk/live/flutter/api-reference → knowledge/livekit/core-sdk/api-reference/flutter}/AudioEffectStore.md +79 -76
  128. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BarrageStore.md +212 -0
  129. package/resource/{doc/livekit/core-sdk/live/flutter/api-reference → knowledge/livekit/core-sdk/api-reference/flutter}/BaseBeautyStore.md +43 -45
  130. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BattleStore.md +312 -0
  131. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoGuestStore.md +404 -0
  132. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoHostStore.md +334 -0
  133. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/DeviceStore.md +420 -0
  134. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/GiftStore.md +166 -0
  135. package/resource/{doc/livekit/core-sdk/live/flutter/api-reference → knowledge/livekit/core-sdk/api-reference/flutter}/LikeStore.md +12 -11
  136. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveAudienceStore.md +281 -0
  137. package/resource/{doc/livekit/core-sdk/live/flutter/api-reference → knowledge/livekit/core-sdk/api-reference/flutter}/LiveCoreView.md +49 -42
  138. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveSeatStore.md +397 -0
  139. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LoginStore.md +183 -0
  140. package/resource/{doc/livekit/core-sdk/live/ios/api-reference → knowledge/livekit/core-sdk/api-reference/ios}/AudioEffectStore.md +79 -75
  141. package/resource/knowledge/livekit/core-sdk/api-reference/ios/BarrageStore.md +192 -0
  142. package/resource/knowledge/livekit/core-sdk/api-reference/ios/BaseBeautyStore.md +146 -0
  143. package/resource/knowledge/livekit/core-sdk/api-reference/ios/BattleStore.md +309 -0
  144. package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoGuestStore.md +370 -0
  145. package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoHostStore.md +339 -0
  146. package/resource/knowledge/livekit/core-sdk/api-reference/ios/DeviceStore.md +503 -0
  147. package/resource/knowledge/livekit/core-sdk/api-reference/ios/GiftStore.md +188 -0
  148. package/resource/{doc/livekit/core-sdk/live/ios/api-reference → knowledge/livekit/core-sdk/api-reference/ios}/LikeStore.md +12 -10
  149. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveAudienceStore.md +289 -0
  150. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveCoreView.md +78 -0
  151. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveSeatStore.md +434 -0
  152. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LoginStore.md +187 -0
  153. package/resource/knowledge/livekit/core-sdk/api-reference/web/index.md +780 -0
  154. package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-audience-list.md +59 -51
  155. package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-audio-effect.md +37 -34
  156. package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-barrage.md +68 -38
  157. package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-base-beauty.md +18 -15
  158. package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-co-guest-interaction.md +17 -17
  159. package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-gift.md +86 -80
  160. package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-host-interaction.md +53 -49
  161. package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-integration.md +47 -45
  162. package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-live-list.md +26 -22
  163. package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-audience-list.md +16 -13
  164. package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-audio-effect.md +28 -24
  165. package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-barrage.md +33 -21
  166. package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-base-beauty.md +29 -25
  167. package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-co-guest-interaction.md +21 -20
  168. package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-gift.md +78 -69
  169. package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-host-interaction.md +47 -43
  170. package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-integration.md +48 -45
  171. package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-live-list.md +27 -23
  172. package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-audience-list.md +15 -12
  173. package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-audio-effect.md +39 -36
  174. package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-barrage.md +42 -29
  175. package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-base-beauty.md +19 -16
  176. package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-co-guest-interaction.md +20 -19
  177. package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-gift.md +55 -49
  178. package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-host-interaction.md +50 -46
  179. package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-integration.md +48 -46
  180. package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-live-list.md +26 -22
  181. package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-audience-list.md +59 -51
  182. package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-audio-effect.md +41 -38
  183. package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-barrage.md +67 -37
  184. package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-co-guest-interaction.md +53 -46
  185. package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-gift.md +86 -80
  186. package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-host-interaction.md +45 -40
  187. package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-integration.md +43 -42
  188. package/resource/knowledge/livekit/core-sdk/voice/android/voice-room-list.md +523 -0
  189. package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-audience-list.md +16 -13
  190. package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-audio-effect.md +54 -50
  191. package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-barrage.md +33 -21
  192. package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-co-guest-interaction.md +34 -28
  193. package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-gift.md +73 -64
  194. package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-integration.md +46 -43
  195. package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-room-list.md +165 -148
  196. package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-audience-list.md +19 -16
  197. package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-audio-effect.md +40 -37
  198. package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-barrage.md +41 -28
  199. package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-co-guest-interaction.md +54 -47
  200. package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-gift.md +52 -46
  201. package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-host-interaction.md +55 -50
  202. package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-integration.md +47 -45
  203. package/resource/knowledge/livekit/core-sdk/voice/ios/voice-room-list.md +404 -0
  204. package/resource/{doc → knowledge}/livekit/core-sdk/voice/uni-app/voice-audience-list.md +40 -57
  205. package/resource/{doc → knowledge}/livekit/core-sdk/voice/uni-app/voice-audio-effect.md +38 -49
  206. package/resource/{doc → knowledge}/livekit/core-sdk/voice/uni-app/voice-barrage.md +53 -53
  207. package/resource/{doc → knowledge}/livekit/core-sdk/voice/uni-app/voice-co-guest-interaction.md +106 -116
  208. package/resource/{doc → knowledge}/livekit/core-sdk/voice/uni-app/voice-gift.md +49 -59
  209. package/resource/{doc → knowledge}/livekit/core-sdk/voice/uni-app/voice-integration.md +52 -45
  210. package/resource/{doc → knowledge}/livekit/core-sdk/voice/uni-app/voice-room-list.md +38 -46
  211. package/resource/knowledge/livekit/preset/live/vue/features/barrage.md +915 -0
  212. package/resource/knowledge/livekit/preset/live/vue/features/live-audience-list.md +179 -0
  213. package/resource/knowledge/livekit/preset/live/vue/features/live-view.md +419 -0
  214. package/resource/knowledge/push/config/android/fcm.md +133 -0
  215. package/resource/knowledge/push/config/android/honor.md +111 -0
  216. package/resource/knowledge/push/config/android/huawei.md +106 -0
  217. package/resource/knowledge/push/config/android/meizu.md +121 -0
  218. package/resource/knowledge/push/config/android/oppo.md +108 -0
  219. package/resource/knowledge/push/config/android/vivo.md +101 -0
  220. package/resource/knowledge/push/config/android/xiaomi.md +99 -0
  221. package/resource/knowledge/push/integration/android.md +1028 -0
  222. package/resource/knowledge/push/integration/donut.md +271 -0
  223. package/resource/knowledge/push/integration/flutter.md +363 -0
  224. package/resource/knowledge/push/integration/harmonyos.md +72 -0
  225. package/resource/knowledge/push/integration/ios.md +705 -0
  226. package/resource/knowledge/push/integration/react-native.md +337 -0
  227. package/resource/knowledge/push/integration/uni-app.md +461 -0
  228. package/resource/knowledge/push/integration/unity.md +357 -0
  229. package/resource/knowledge/push/integration/unreal-engine.md +353 -0
  230. package/resource/knowledge/push/overview/prepare.md +30 -0
  231. package/resource/{doc/roomkit/android/features → knowledge/roomkit/core-sdk/android}/call-user-to-room.md +22 -20
  232. package/resource/{doc/roomkit/android/features → knowledge/roomkit/core-sdk/android}/room-participant-state.md +22 -193
  233. package/resource/{doc/roomkit/android/features → knowledge/roomkit/core-sdk/android}/room-state.md +33 -32
  234. package/resource/{doc/roomkit/android/features → knowledge/roomkit/core-sdk/android}/schedule-room.md +30 -29
  235. package/resource/knowledge/roomkit/core-sdk/flutter/call-user-to-room.md +230 -0
  236. package/resource/{doc/roomkit/flutter/features → knowledge/roomkit/core-sdk/flutter}/room-participant-state.md +22 -21
  237. package/resource/{doc/roomkit/flutter/features → knowledge/roomkit/core-sdk/flutter}/room-state.md +29 -28
  238. package/resource/{doc/roomkit/flutter/features → knowledge/roomkit/core-sdk/flutter}/schedule-room.md +17 -16
  239. package/resource/{doc/roomkit/ios/features → knowledge/roomkit/core-sdk/ios}/call-user-to-room.md +22 -20
  240. package/resource/{doc/roomkit/ios/features → knowledge/roomkit/core-sdk/ios}/room-participant-state.md +49 -218
  241. package/resource/{doc/roomkit/ios/features → knowledge/roomkit/core-sdk/ios}/room-state.md +37 -37
  242. package/resource/{doc/roomkit/ios/features → knowledge/roomkit/core-sdk/ios}/schedule-room.md +28 -28
  243. package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/call-user-to-room.md +122 -7
  244. package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/device-detection.md +318 -3
  245. package/resource/knowledge/roomkit/core-sdk/vue/device-state.md +1504 -0
  246. package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/free-beauty-panel.md +4 -3
  247. package/resource/knowledge/roomkit/core-sdk/vue/room-chat.md +709 -0
  248. package/resource/knowledge/roomkit/core-sdk/vue/room-participant-state.md +1105 -0
  249. package/resource/knowledge/roomkit/core-sdk/vue/room-state.md +635 -0
  250. package/resource/knowledge/roomkit/core-sdk/vue/room-view.md +529 -0
  251. package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/schedule-room.md +256 -13
  252. package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/screen-share.md +218 -25
  253. package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/virtual-background.md +4 -3
  254. package/resource/{doc/roomkit → knowledge/roomkit/preset}/android/integration.md +50 -64
  255. package/resource/{doc/roomkit → knowledge/roomkit/preset}/flutter/integration.md +34 -31
  256. package/resource/{doc/roomkit → knowledge/roomkit/preset}/ios/integration.md +45 -53
  257. package/resource/knowledge/roomkit/preset/react/integration.md +571 -0
  258. package/resource/{doc → knowledge}/rtcengine/web/how_to_run_web_sdk_demo.md +31 -15
  259. package/resource/{doc → knowledge}/rtcengine/web/plugin/21-advanced-auto-play-policy.md +9 -3
  260. package/resource/{doc → knowledge}/rtcengine/web/plugin/22-advanced-audio-mixer.md +1 -1
  261. package/resource/{doc → knowledge}/rtcengine/web/plugin/23-advanced-support-detection.md +1 -1
  262. package/resource/{doc → knowledge}/rtcengine/web/plugin/24-advanced-network-quality.md +6 -6
  263. package/resource/{doc → knowledge}/rtcengine/web/plugin/25-advanced-device-change.md +1 -1
  264. package/resource/{doc → knowledge}/rtcengine/web/plugin/26-advanced-publish-cdn-stream.md +4 -4
  265. package/resource/{doc → knowledge}/rtcengine/web/plugin/27-advanced-small-stream.md +4 -4
  266. package/resource/{doc → knowledge}/rtcengine/web/plugin/31-advanced-plugins-overview.md +1 -1
  267. package/resource/{doc → knowledge}/trtc/android/TRTCCloud.md +547 -495
  268. package/resource/{doc → knowledge}/trtc/android/TRTCCloudDef.md +434 -403
  269. package/resource/{doc → knowledge}/trtc/android/TRTCCloudListener.md +394 -348
  270. package/resource/{doc → knowledge}/trtc/android/TRTCStatistics.md +17 -15
  271. package/resource/{doc → knowledge}/trtc/android/TXAudioEffectManager.md +227 -197
  272. package/resource/knowledge/trtc/android/TXBeautyManager.md +415 -0
  273. package/resource/{doc → knowledge}/trtc/android/TXDeviceManager.md +70 -63
  274. package/resource/{doc → knowledge}/trtc/android/TXLiteAVCode.md +19 -17
  275. package/resource/{doc/trtc/C++ → knowledge/trtc/c++}/ITRTCCloud.md +599 -544
  276. package/resource/{doc/trtc/C++ → knowledge/trtc/c++}/ITRTCStatistics.md +17 -15
  277. package/resource/knowledge/trtc/c++/ITXAudioEffectManager.md +502 -0
  278. package/resource/knowledge/trtc/c++/ITXDeviceManager.md +403 -0
  279. package/resource/{doc/trtc/C++ → knowledge/trtc/c++}/TRTCCloudCallback.md +439 -387
  280. package/resource/{doc/trtc/C++ → knowledge/trtc/c++}/TRTCTypeDef.md +417 -387
  281. package/resource/{doc/trtc/C++ → knowledge/trtc/c++}/TXLiteAVCode.md +19 -17
  282. package/resource/{doc/trtc/iOS → knowledge/trtc/ios}/TRTCCloud.md +619 -559
  283. package/resource/{doc/trtc/iOS → knowledge/trtc/ios}/TRTCCloudDelegate.md +409 -360
  284. package/resource/{doc/trtc/iOS → knowledge/trtc/ios}/TRTCStatistics.md +17 -15
  285. package/resource/{doc/trtc/iOS → knowledge/trtc/ios}/TXAudioEffectManager.md +187 -164
  286. package/resource/knowledge/trtc/ios/TXBeautyManager.md +416 -0
  287. package/resource/knowledge/trtc/ios/TXDeviceManager.md +399 -0
  288. package/resource/{doc/trtc/iOS → knowledge/trtc/ios}/TXLiteAVCode.md +19 -17
  289. package/resource/{doc/trtc/iOS → knowledge/trtc/ios}/TXLiveSDKTypeDef.md +422 -396
  290. package/server-config.js +0 -1
  291. package/server.js +22 -12
  292. package/streamable-http.js +0 -1
  293. package/tools/call/get_native_call_uikit_integration.js +2 -4
  294. package/tools/call/get_native_callkit_core_integration.js +2 -6
  295. package/tools/call/get_web_call_uikit_integration.js +2 -4
  296. package/tools/chat/get_native_chat_uikit_integration.js +2 -4
  297. package/tools/chat/get_web_chat_uikit_integration.js +2 -4
  298. package/tools/common/get_usersig.js +0 -1
  299. package/tools/common/present_framework_choice.js +9 -4
  300. package/tools/common/record_answer.js +19 -26
  301. package/tools/common/record_feedback.js +17 -31
  302. package/tools/common/search_trtc_knowledge.js +44 -0
  303. package/tools/definitions/get_native_call_uikit_integration_def.js +2 -1
  304. package/tools/definitions/get_native_callkit_core_integration_def.js +2 -1
  305. package/tools/definitions/get_native_chat_uikit_integration_def.js +3 -2
  306. package/tools/definitions/get_native_livekit_core_integration_def.js +2 -1
  307. package/tools/definitions/get_usersig_def.js +0 -1
  308. package/tools/definitions/get_web_call_uikit_integration_def.js +2 -1
  309. package/tools/definitions/get_web_chat_uikit_integration_def.js +2 -1
  310. package/tools/definitions/get_web_live_uikit_integration_def.js +4 -3
  311. package/tools/definitions/get_web_room_core_integration_def.js +46 -0
  312. package/tools/definitions/get_web_room_uikit_integration_def.js +3 -1
  313. package/tools/definitions/integration-boundary.js +5 -0
  314. package/tools/definitions/present_framework_choice_def.js +11 -10
  315. package/tools/definitions/record_answer_def.js +6 -5
  316. package/tools/definitions/record_feedback_def.js +4 -3
  317. package/tools/definitions/search_trtc_knowledge_def.js +69 -0
  318. package/tools/index.js +5 -37
  319. package/tools/live/get_native_livekit_core_integration.js +1 -4
  320. package/tools/live/get_web_live_uikit_integration.js +2 -5
  321. package/tools/room/get_web_room_core_integration.js +47 -0
  322. package/tools/room/get_web_room_uikit_integration.js +2 -4
  323. package/utils/generate-structured-result.js +4 -11
  324. package/utils/generate-usersig.js +0 -1
  325. package/utils/get-device-identifier.js +0 -1
  326. package/utils/get-doc-content.js +14 -9
  327. package/utils/http-get.js +0 -1
  328. package/utils/http-post.js +0 -1
  329. package/utils/report-cls-client.js +22 -21
  330. package/utils/report-es-client.js +1 -2
  331. package/utils/report-runtime-error-cls-client.js +0 -1
  332. package/index.js.map +0 -1
  333. package/resource/doc/callkit/core-sdk/.gitkeep +0 -0
  334. package/resource/doc/callkit/core-sdk/android/answer-call.md +0 -942
  335. package/resource/doc/callkit/core-sdk/android/make-call.md +0 -876
  336. package/resource/doc/callkit/core-sdk/android/offline-push.md +0 -368
  337. package/resource/doc/callkit/core-sdk/flutter/answer-call.md +0 -1132
  338. package/resource/doc/callkit/core-sdk/flutter/make-call.md +0 -1206
  339. package/resource/doc/callkit/core-sdk/flutter/offline-push.md +0 -357
  340. package/resource/doc/callkit/core-sdk/ios/answer-call.md +0 -1009
  341. package/resource/doc/callkit/core-sdk/ios/make-call.md +0 -1154
  342. package/resource/doc/callkit/core-sdk/ios/offline-push.md +0 -470
  343. package/resource/doc/callkit/core-sdk/uni-app/answer-call.md +0 -1146
  344. package/resource/doc/callkit/core-sdk/uni-app/make-call.md +0 -1267
  345. package/resource/doc/callkit/faq/android-faq.md +0 -767
  346. package/resource/doc/callkit/faq/flutter-faq.md +0 -749
  347. package/resource/doc/callkit/faq/ios-faq.md +0 -759
  348. package/resource/doc/callkit/faq/web-faq.md +0 -753
  349. package/resource/doc/callkit/preset/android/api.md +0 -330
  350. package/resource/doc/callkit/preset/flutter/api.md +0 -401
  351. package/resource/doc/callkit/preset/ios/api.md +0 -282
  352. package/resource/doc/callkit/preset/ios/integration.md +0 -188
  353. package/resource/doc/callkit/preset/react/api.md +0 -600
  354. package/resource/doc/callkit/preset/react/integration.md +0 -86
  355. package/resource/doc/callkit/preset/vue/api.md +0 -600
  356. package/resource/doc/callkit/preset/vue/integration.md +0 -83
  357. package/resource/doc/chatkit/android/faq.md +0 -109
  358. package/resource/doc/chatkit/faq/android_sdk/client-api.md +0 -280
  359. package/resource/doc/chatkit/faq/common/product.md +0 -82
  360. package/resource/doc/chatkit/faq/common/server.md +0 -53
  361. package/resource/doc/chatkit/faq/common/server_error_code.md +0 -74
  362. package/resource/doc/chatkit/faq/flutter_sdk/client-api.md +0 -183
  363. package/resource/doc/chatkit/faq/flutter_sdk/faq.md +0 -54
  364. package/resource/doc/chatkit/faq/ios_sdk/client-api.md +0 -279
  365. package/resource/doc/chatkit/faq/web_sdk/error_code.md +0 -47
  366. package/resource/doc/chatkit/faq/web_sdk/faq.md +0 -292
  367. package/resource/doc/chatkit/flutter/faq.md +0 -22
  368. package/resource/doc/chatkit/ios/faq.md +0 -109
  369. package/resource/doc/chatkit/react/components/avatar.md +0 -104
  370. package/resource/doc/chatkit/react/components/chat-header.md +0 -148
  371. package/resource/doc/chatkit/react/components/chat-setting.md +0 -117
  372. package/resource/doc/chatkit/react/components/chat.md +0 -38
  373. package/resource/doc/chatkit/react/components/component-list.md +0 -35
  374. package/resource/doc/chatkit/react/components/conversation-actions.md +0 -174
  375. package/resource/doc/chatkit/react/components/conversation-preview.md +0 -116
  376. package/resource/doc/chatkit/react/components/conversation-search.md +0 -57
  377. package/resource/doc/chatkit/react/components/search.md +0 -282
  378. package/resource/doc/chatkit/react/components/tuikit.md +0 -43
  379. package/resource/doc/chatkit/react/faq.md +0 -26
  380. package/resource/doc/chatkit/vue/components/avatar.md +0 -104
  381. package/resource/doc/chatkit/vue/components/chat-header.md +0 -149
  382. package/resource/doc/chatkit/vue/components/chat.md +0 -42
  383. package/resource/doc/chatkit/vue/components/component-list.md +0 -89
  384. package/resource/doc/chatkit/vue/components/tuikit.md +0 -45
  385. package/resource/doc/chatkit/vue/components/userpicker.md +0 -256
  386. package/resource/doc/chatkit/vue/faq.md +0 -35
  387. package/resource/doc/livekit/core-sdk/live/android/api-reference/BarrageStore.md +0 -148
  388. package/resource/doc/livekit/core-sdk/live/android/api-reference/BattleStore.md +0 -316
  389. package/resource/doc/livekit/core-sdk/live/android/api-reference/CoGuestStore.md +0 -419
  390. package/resource/doc/livekit/core-sdk/live/android/api-reference/CoHostStore.md +0 -325
  391. package/resource/doc/livekit/core-sdk/live/android/api-reference/DeviceStore.md +0 -436
  392. package/resource/doc/livekit/core-sdk/live/android/api-reference/GiftStore.md +0 -165
  393. package/resource/doc/livekit/core-sdk/live/android/api-reference/LiveAudienceStore.md +0 -239
  394. package/resource/doc/livekit/core-sdk/live/android/api-reference/LiveCoreView.md +0 -74
  395. package/resource/doc/livekit/core-sdk/live/android/api-reference/LiveSeatStore.md +0 -417
  396. package/resource/doc/livekit/core-sdk/live/android/api-reference/LoginStore.md +0 -207
  397. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/BarrageStore.md +0 -158
  398. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/BattleStore.md +0 -304
  399. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/CoGuestStore.md +0 -394
  400. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/CoHostStore.md +0 -303
  401. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/DeviceStore.md +0 -410
  402. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/GiftStore.md +0 -160
  403. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/LiveAudienceStore.md +0 -231
  404. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/LiveSeatStore.md +0 -375
  405. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/LoginStore.md +0 -170
  406. package/resource/doc/livekit/core-sdk/live/ios/api-reference/BarrageStore.md +0 -165
  407. package/resource/doc/livekit/core-sdk/live/ios/api-reference/BaseBeautyStore.md +0 -143
  408. package/resource/doc/livekit/core-sdk/live/ios/api-reference/BattleStore.md +0 -298
  409. package/resource/doc/livekit/core-sdk/live/ios/api-reference/CoGuestStore.md +0 -349
  410. package/resource/doc/livekit/core-sdk/live/ios/api-reference/CoHostStore.md +0 -297
  411. package/resource/doc/livekit/core-sdk/live/ios/api-reference/DeviceStore.md +0 -471
  412. package/resource/doc/livekit/core-sdk/live/ios/api-reference/GiftStore.md +0 -179
  413. package/resource/doc/livekit/core-sdk/live/ios/api-reference/LiveAudienceStore.md +0 -238
  414. package/resource/doc/livekit/core-sdk/live/ios/api-reference/LiveCoreView.md +0 -74
  415. package/resource/doc/livekit/core-sdk/live/ios/api-reference/LiveSeatStore.md +0 -412
  416. package/resource/doc/livekit/core-sdk/live/ios/api-reference/LoginStore.md +0 -173
  417. package/resource/doc/livekit/core-sdk/voice/android/voice-room-list.md +0 -365
  418. package/resource/doc/livekit/core-sdk/voice/ios/voice-room-list.md +0 -336
  419. package/resource/doc/livekit/preset/live/vue/api-reference/index.md +0 -780
  420. package/resource/doc/livekit/preset/live/vue/components/barrage.md +0 -291
  421. package/resource/doc/livekit/preset/live/vue/components/co-guest-panel.md +0 -88
  422. package/resource/doc/livekit/preset/live/vue/components/live-audience-list.md +0 -164
  423. package/resource/doc/livekit/preset/live/vue/components/live-scene-panel.md +0 -130
  424. package/resource/doc/livekit/preset/live/vue/components/live-view.md +0 -203
  425. package/resource/doc/livekit/preset/live/vue/components/stream-mixer.md +0 -211
  426. package/resource/doc/livekit/preset/live/vue/faq.md +0 -1
  427. package/resource/doc/roomkit/faq/common/error-code.md +0 -67
  428. package/resource/doc/roomkit/flutter/features/call-user-to-room.md +0 -228
  429. package/resource/doc/roomkit/vue/faq.md +0 -1
  430. package/resource/doc/roomkit/vue/features/device-state.md +0 -460
  431. package/resource/doc/roomkit/vue/features/room-chat.md +0 -369
  432. package/resource/doc/roomkit/vue/features/room-participant-state.md +0 -385
  433. package/resource/doc/roomkit/vue/features/room-state.md +0 -280
  434. package/resource/doc/roomkit/vue/features/room-view.md +0 -241
  435. package/resource/doc/roomkit/vue/integration.md +0 -315
  436. package/resource/doc/rtcengine/faq/web_sdk/.gitkeep +0 -0
  437. package/resource/doc/trtc/C++/ITXAudioEffectManager.md +0 -472
  438. package/resource/doc/trtc/C++/ITXDeviceManager.md +0 -388
  439. package/resource/doc/trtc/android/TXBeautyManager.md +0 -403
  440. package/resource/doc/trtc/iOS/TXBeautyManager.md +0 -404
  441. package/resource/doc/trtc/iOS/TXDeviceManager.md +0 -382
  442. package/server-config.js.map +0 -1
  443. package/server.js.map +0 -1
  444. package/streamable-http.js.map +0 -1
  445. package/tools/call/get_callkit_api.js +0 -33
  446. package/tools/call/get_callkit_api.js.map +0 -1
  447. package/tools/call/get_native_call_uikit_integration.js.map +0 -1
  448. package/tools/call/get_native_callkit_core_integration.js.map +0 -1
  449. package/tools/call/get_web_call_uikit_integration.js.map +0 -1
  450. package/tools/chat/get_native_chat_uikit_feature_detail.js +0 -35
  451. package/tools/chat/get_native_chat_uikit_feature_detail.js.map +0 -1
  452. package/tools/chat/get_native_chat_uikit_integration.js.map +0 -1
  453. package/tools/chat/get_web_chat_uikit_component_detail.js +0 -35
  454. package/tools/chat/get_web_chat_uikit_component_detail.js.map +0 -1
  455. package/tools/chat/get_web_chat_uikit_integration.js.map +0 -1
  456. package/tools/common/get_faq.js +0 -266
  457. package/tools/common/get_faq.js.map +0 -1
  458. package/tools/common/get_usersig.js.map +0 -1
  459. package/tools/common/present_framework_choice.js.map +0 -1
  460. package/tools/common/record_answer.js.map +0 -1
  461. package/tools/common/record_feedback.js.map +0 -1
  462. package/tools/common/record_skill_session.js +0 -69
  463. package/tools/common/record_skill_session.js.map +0 -1
  464. package/tools/definitions/get_callkit_api_def.js +0 -28
  465. package/tools/definitions/get_callkit_api_def.js.map +0 -1
  466. package/tools/definitions/get_faq_def.js +0 -40
  467. package/tools/definitions/get_faq_def.js.map +0 -1
  468. package/tools/definitions/get_native_call_uikit_integration_def.js.map +0 -1
  469. package/tools/definitions/get_native_callkit_core_integration_def.js.map +0 -1
  470. package/tools/definitions/get_native_chat_uikit_feature_detail_def.js +0 -31
  471. package/tools/definitions/get_native_chat_uikit_feature_detail_def.js.map +0 -1
  472. package/tools/definitions/get_native_chat_uikit_integration_def.js.map +0 -1
  473. package/tools/definitions/get_native_livekit_core_features_def.js +0 -33
  474. package/tools/definitions/get_native_livekit_core_features_def.js.map +0 -1
  475. package/tools/definitions/get_native_livekit_core_integration_def.js.map +0 -1
  476. package/tools/definitions/get_native_trtc_sdk_docs_def.js +0 -32
  477. package/tools/definitions/get_native_trtc_sdk_docs_def.js.map +0 -1
  478. package/tools/definitions/get_usersig_def.js.map +0 -1
  479. package/tools/definitions/get_web_call_uikit_integration_def.js.map +0 -1
  480. package/tools/definitions/get_web_chat_uikit_component_detail_def.js +0 -31
  481. package/tools/definitions/get_web_chat_uikit_component_detail_def.js.map +0 -1
  482. package/tools/definitions/get_web_chat_uikit_integration_def.js.map +0 -1
  483. package/tools/definitions/get_web_live_uikit_integration_def.js.map +0 -1
  484. package/tools/definitions/get_web_livekit_api_def.js +0 -27
  485. package/tools/definitions/get_web_livekit_api_def.js.map +0 -1
  486. package/tools/definitions/get_web_livekit_component_detail_def.js +0 -29
  487. package/tools/definitions/get_web_livekit_component_detail_def.js.map +0 -1
  488. package/tools/definitions/get_web_room_uikit_integration_def.js.map +0 -1
  489. package/tools/definitions/get_web_roomkit_feature_detail_def.js +0 -30
  490. package/tools/definitions/get_web_roomkit_feature_detail_def.js.map +0 -1
  491. package/tools/definitions/get_web_trtc_sdk_api_def.js +0 -25
  492. package/tools/definitions/get_web_trtc_sdk_api_def.js.map +0 -1
  493. package/tools/definitions/get_web_trtc_sdk_integration_def.js +0 -25
  494. package/tools/definitions/get_web_trtc_sdk_integration_def.js.map +0 -1
  495. package/tools/definitions/get_web_trtc_sdk_plugin_def.js +0 -25
  496. package/tools/definitions/get_web_trtc_sdk_plugin_def.js.map +0 -1
  497. package/tools/definitions/present_framework_choice_def.js.map +0 -1
  498. package/tools/definitions/record_answer_def.js.map +0 -1
  499. package/tools/definitions/record_feedback_def.js.map +0 -1
  500. package/tools/definitions/record_skill_session_def.js +0 -31
  501. package/tools/definitions/record_skill_session_def.js.map +0 -1
  502. package/tools/index.js.map +0 -1
  503. package/tools/live/get_native_livekit_core_features.js +0 -68
  504. package/tools/live/get_native_livekit_core_features.js.map +0 -1
  505. package/tools/live/get_native_livekit_core_integration.js.map +0 -1
  506. package/tools/live/get_web_live_uikit_integration.js.map +0 -1
  507. package/tools/live/get_web_livekit_api.js +0 -33
  508. package/tools/live/get_web_livekit_api.js.map +0 -1
  509. package/tools/live/get_web_livekit_component_detail.js +0 -35
  510. package/tools/live/get_web_livekit_component_detail.js.map +0 -1
  511. package/tools/room/get_web_room_uikit_integration.js.map +0 -1
  512. package/tools/room/get_web_roomkit_feature_detail.js +0 -69
  513. package/tools/room/get_web_roomkit_feature_detail.js.map +0 -1
  514. package/tools/rtcengine/get_web_trtc_sdk_api.js +0 -32
  515. package/tools/rtcengine/get_web_trtc_sdk_api.js.map +0 -1
  516. package/tools/rtcengine/get_web_trtc_sdk_integration.js +0 -32
  517. package/tools/rtcengine/get_web_trtc_sdk_integration.js.map +0 -1
  518. package/tools/rtcengine/get_web_trtc_sdk_plugin.js +0 -32
  519. package/tools/rtcengine/get_web_trtc_sdk_plugin.js.map +0 -1
  520. package/tools/trtc/get_native_trtc_sdk_docs.js +0 -74
  521. package/tools/trtc/get_native_trtc_sdk_docs.js.map +0 -1
  522. package/utils/build-session-directives.js +0 -122
  523. package/utils/build-session-directives.js.map +0 -1
  524. package/utils/generate-structured-result.js.map +0 -1
  525. package/utils/generate-usersig.js.map +0 -1
  526. package/utils/get-device-identifier.js.map +0 -1
  527. package/utils/get-doc-content.js.map +0 -1
  528. package/utils/handle-framework.js +0 -9
  529. package/utils/handle-framework.js.map +0 -1
  530. package/utils/handle-state-name.js +0 -29
  531. package/utils/handle-state-name.js.map +0 -1
  532. package/utils/http-get.js.map +0 -1
  533. package/utils/http-post.js.map +0 -1
  534. package/utils/report-cls-client.js.map +0 -1
  535. package/utils/report-es-client.js.map +0 -1
  536. package/utils/report-runtime-error-cls-client.js.map +0 -1
  537. /package/resource/{doc/callkit/faq/common → knowledge/callkit/faq}/error-code.md +0 -0
  538. /package/resource/{doc/livekit/faq/common → knowledge/livekit/faq}/error-code.md +0 -0
  539. /package/resource/{doc → knowledge}/rtcengine/web/api.md +0 -0
  540. /package/resource/{doc/rtcengine/faq/web/web.md → knowledge/rtcengine/web/faq.md} +0 -0
  541. /package/resource/{doc → knowledge}/rtcengine/web/how_to_integrated_web_sdk.md +0 -0
  542. /package/resource/{doc → knowledge}/rtcengine/web/plugin/20-advanced-customized-capture-rendering.md +0 -0
  543. /package/resource/{doc → knowledge}/rtcengine/web/plugin/28-advanced-beauty.md +0 -0
  544. /package/resource/{doc → knowledge}/rtcengine/web/plugin/29-advanced-water-mark.md +0 -0
  545. /package/resource/{doc → knowledge}/rtcengine/web/plugin/30-advanced-cross-room-link.md +0 -0
  546. /package/resource/{doc → knowledge}/rtcengine/web/plugin/34-advanced-proxy.md +0 -0
  547. /package/resource/{doc → knowledge}/rtcengine/web/plugin/35-advanced-ai-denoiser.md +0 -0
  548. /package/resource/{doc → knowledge}/rtcengine/web/plugin/36-advanced-virtual-background.md +0 -0
  549. /package/resource/{doc → knowledge}/rtcengine/web/plugin/37-advanced-voice-changer.md +0 -0
  550. /package/resource/{doc → knowledge}/rtcengine/web/plugin/38-advanced-basic-beauty.md +0 -0
  551. /package/resource/{doc → knowledge}/rtcengine/web/plugin/39-advanced-video-decoder.md +0 -0
  552. /package/resource/{doc → knowledge}/rtcengine/web/plugin/40-advanced-video-mixer.md +0 -0
  553. /package/resource/{doc → knowledge}/rtcengine/web/plugin/41-advanced-small-stream-auto-switcher.md +0 -0
  554. /package/resource/{doc → knowledge}/rtcengine/web/plugin/42-advanced-realtime-transcriber.md +0 -0
  555. /package/resource/{doc → knowledge}/rtcengine/web/plugin/43-advanced-face-detection.md +0 -0
  556. /package/resource/{doc/rtcengine/faq/common → knowledge/share}/userSig.md +0 -0
@@ -0,0 +1,929 @@
1
+ 本文档将帮助您使用 **AtomicXCore SDK** 的 **DeviceStore**、**CallStore** 以及核心组件 **CallCoreView**,快速完成拨打电话功能。
2
+
3
+ > 推荐使用更高效的 AI 集成助手
4
+ >
5
+
6
+ > 我们为您提供了全新的 AI 集成方式,只需要描述您的需求,即可自动生成集成代码,大幅提升开发效率。
7
+ >
8
+
9
+ > 点击这里,立即体验 AI 集成
10
+ >
11
+
12
+ ## 核心功能
13
+
14
+ **AtomicXCore **中用于搭建多人音视频通话场景所需要使用到的核心模块包含以下三个:
15
+
16
+ |**模块**|**功能描述**|
17
+ |---------|---------|
18
+ |[CallCoreView](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.view/-call-core-view/index.html)|通话视图核心组件。自动监听 CallStore 数据并完成画面渲染,同时提供布局切换、头像与图标配置等 UI 定制化能力。|
19
+ |[CallStore](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.call/-call-store/index.html)|通话生命周期管理:拨打电话、接通电话、拒接电话、挂断电话。实时获取参与通话人员音视频状态,通话计时、通话记录等数据。|
20
+ |[DeviceStore](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.device/-device-store/index.html)|音视频设备控制:麦克风(开关 / 音量)、摄像头(开关 / 切换 / 画质)、屏幕共享,设备状态实时监听。|
21
+
22
+ ## 准备工作
23
+
24
+ ### 步骤1:开通服务
25
+
26
+ 请参见 开通服务,获取体验版或付费版 SDK。
27
+
28
+ ### 步骤2:集成 SDK
29
+ 1. 请在您的 **build.gradle** 文件中添加 api `"io.trtc.uikit:atomicx-core:latest.release"` 和 api `"com.tencent.imsdk:imsdk-plus:8.7.7201"` 依赖,然后执行 **Gradle Sync**。
30
+
31
+ ``` java
32
+ dependencies {
33
+ api "io.trtc.uikit:atomicx-core:latest.release"
34
+ api "com.tencent.imsdk:imsdk-plus:8.7.7201"
35
+ // 其他依赖...
36
+ }
37
+ ```
38
+ 2. 由于 SDK 内部使用了 Java 反射特性,需要将部分类加入不混淆名单。请在 `app` 目录下的 `proguard-rules.pro` 文件末尾添加如下代码。添加完后,点击右上角的 **Sync Now**,同步代码。
39
+
40
+ ``` xml
41
+ -keep class com.tencent.** { *; }
42
+ ```
43
+ 3. 在 app 目录下找到 **AndroidManifest.xml** 文件,在 application 节点中添加 **tools:replace="android:allowBackup"**,覆盖组件内的设置,使用自己的设置。
44
+
45
+ ``` java
46
+ <application
47
+ android:name=".BaseApplication"
48
+ android:allowBackup="false"
49
+ android:icon="@drawable/app_ic_launcher"
50
+ android:label="@string/app_name"
51
+ android:largeHeap="true"
52
+ android:theme="@style/AppTheme"
53
+ tools:replace="android:allowBackup">
54
+ ```
55
+
56
+ ### 步骤3:初始化与登录流程
57
+
58
+ 启动通话服务需依次完成以下三步:
59
+ 1. **实例化 CallStore**:`CallStore.shared` 初始化通话数据层。
60
+
61
+ 2. **用户登录:**调用 `LoginStore.shared.login()` 完成用户登录。
62
+
63
+ 3. **初始化通话引擎:**登录成功后调用 `TUICallEngine.createInstance(context).init()` 初始化通话信令引擎。
64
+
65
+ 流程图与示例代码如下:
66
+
67
+ ``` java
68
+ class MainActivity : ComponentActivity() {
69
+ override fun onCreate(savedInstanceState: Bundle?) {
70
+ super.onCreate(savedInstanceState)
71
+ // CallStore 初始化
72
+ CallStore.shared
73
+ val sdkAppId = 1400000001 // 替换为您的 SDKAppID
74
+ val userId = "test_001" // 替换为您的 UserID
75
+ val userSig = "xxxxxxxxxxx" // 替换为您的 UserSig
76
+ LoginStore.shared.login(
77
+ this,
78
+ sdkAppId,
79
+ userId,
80
+ userSig,
81
+ object : CompletionHandler {
82
+ override fun onSuccess() {
83
+ // 完成 TUICallEngine 的初始化
84
+ TUICallEngine.createInstance(this@MainActivity).init(sdkAppId, userId, userSig, null)
85
+ // 登录成功处理
86
+ Log.d("Login", "login success");
87
+ }
88
+
89
+ override fun onFailure(code: Int, desc: String) {
90
+ // 登录失败处理
91
+ Log.e("Login", "login failed, code: $code, error: $desc");
92
+ }
93
+ }
94
+ )
95
+ }
96
+ }
97
+ ```
98
+ | <strong>参数</strong> | <strong>类型</strong> | <strong>说明</strong> |
99
+ | --- | --- | --- |
100
+ | userId | String | 当前用户的唯一 ID,仅包含英文字母、数字、连字符和下划线。为避免多端登录冲突,请勿使用 1、123 等简单 ID。 |
101
+ | sdkAppId | int | 从 <a href="https://console.cloud.tencent.com/trtc">控制台</a> 获取,通常是以 140 或 160 开头的 10 位整数。 |
102
+ | userSig | String | 用于腾讯云鉴权的票据。请注意:<br>- 开发环境:您可以采用本地 <a href="https://github.com/Tencent-RTC/TUIKit_Android/blob/main/call/tuicallkit-kt/src/main/java/com/tencent/qcloud/tuikit/tuicallkit/debug/GenerateTestUserSig.kt">GenerateTestUserSig.genTestUserSig</a> 函数生成 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>。 |
103
+
104
+ ## 实现步骤
105
+
106
+ **发起通话前,请确保完成登录**,这是服务可用的必要前提。以下将分 5 步为您讲解如何"拨打一通电话"。
107
+
108
+ ### 步骤1:创建通话界面
109
+
110
+ 您需要创建一个通话页面,当发起通话唤起通话页面,实现方式如下:
111
+ 1. **创建通话页面**:您可以新建一个 Activity 作为通话宿主页面,用于响应来电时的跳转逻辑。
112
+
113
+ 2. **通话页面绑定 **[**CallCoreView**](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.view/-call-core-view/index.html) : 通话视图核心组件,自动监听 **CallStore** 数据并完成画面渲染,同时提供布局切换、头像与图标配置等 UI 定制化能力。
114
+
115
+ ``` java
116
+ class CallActivity : AppCompatActivity() {
117
+ private var callCoreView: CallCoreView? = null
118
+
119
+ // 1.创建通话页面容器
120
+ override fun onCreate(savedInstanceState: Bundle?) {
121
+ super.onCreate(savedInstanceState)
122
+ // 2.通话页面绑定 CallCoreView
123
+ callCoreView = CallCoreView(this)
124
+ setContentView(callCoreView)
125
+ }
126
+ }
127
+ ```
128
+
129
+ **CallCoreView 视图组件功能说明:**
130
+
131
+ | <strong>功能</strong> | <strong>说明</strong> | <strong>参考文档</strong> |
132
+ | --- | --- | --- |
133
+ | <strong>设置布局模式</strong> | 支持自由切换布局模式。若未设置,将根据通话人数自动适配布局。 | 切换布局模式 |
134
+ | <strong>设置头像</strong> | 支持通过传入头像资源路径,为特定用户自定义头像。 | 自定义默认头像 |
135
+ | <strong>设置音量提示图标</strong> | 支持根据不同音量等级,配置个性化的音量指示图标。 | 自定义音量提示的图标 |
136
+ | <strong>设置网络提示图标</strong> | 支持根据实时网络质量,配置对应的网络状态提示图标。 | 自定义网络提示的图标 |
137
+ | <strong>设置等待接听用户的动画</strong> | 在多人通话场景下,支持传入 GIF 图像路径,为待接听状态的用户展示动画。 | 自定义 loading 动画 |
138
+
139
+ ### 步骤2:添加通话控制按钮
140
+
141
+ 您可以参考 [DeviceStore](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.device/-device-store/index.html) 、[CallStore](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.call/-call-store/index.html) 提供的 API ,自定义添加您的按钮。
142
+ - **DeviceStore 功能说明:**麦克风(开关 / 音量)、摄像头(开关 / 切换 / 画质)、屏幕共享,设备状态实时监听。建议将对应方法绑定至按钮点击事件,并通过监听设备状态变更来实时刷新按钮的 UI 状态。
143
+
144
+ - **CallStore 功能说明:**接听、挂断、拒接等核心通话控制能力。建议将对应方法绑定至按钮点击事件,并监听通话状态的变化,以确保按钮显示与当前通话阶段保持同步。
145
+
146
+ - **图标资源下载:**按钮图标可以直接从 [Github](https://github.com/Tencent-RTC/TUIKit_Android/tree/main/call/tuicallkit-kt/src/main/res) 下载。这些图标由我们的设计师专为 TUICallKit 打造,无版权风险,可放心使用。
147
+
148
+ | <strong>图标:</strong> | | | | | | | | |
149
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- |
150
+
151
+ - **以添加挂断、麦克风、摄像头按钮为例,实现方式如下:**
152
+
153
+ 1. **创建底部栏容器**:在通话页面底部创建一个容器,用于添加挂断、麦克风、摄像头按钮。
154
+
155
+ ``` java
156
+ import io.trtc.tuikit.atomicxcore.api.call.CallStore
157
+ import io.trtc.tuikit.atomicxcore.api.view.CallCoreView
158
+ import io.trtc.tuikit.atomicxcore.api.device.DeviceStore
159
+
160
+ class CallActivity : AppCompatActivity() {
161
+ private var buttonContainer: Button? = null
162
+
163
+ override fun onCreate(savedInstanceState: Bundle?) {
164
+ super.onCreate(savedInstanceState)
165
+ // 其他初始化代码
166
+ // 创建底部栏容器
167
+ createButtonContainer()
168
+ setContentView(buttonContainer)
169
+ }
170
+
171
+ private fun createButtonContainer() {
172
+ buttonContainer = LinearLayout(this).apply {
173
+ orientation = LinearLayout.HORIZONTAL
174
+ gravity = Gravity.CENTER
175
+ layoutParams = FrameLayout.LayoutParams(
176
+ FrameLayout.LayoutParams.MATCH_PARENT,
177
+ FrameLayout.LayoutParams.WRAP_CONTENT
178
+ ).apply {
179
+ gravity = Gravity.BOTTOM
180
+ bottomMargin = dpToPx(80)
181
+ }
182
+ }
183
+ }
184
+ }
185
+ ```
186
+ 2. **添加挂断按钮:**在底部工具栏容器中添加挂断按钮,在点击事件中调用 [hangup](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.call/-call-store/hangup.html) 接口并销毁页面。
187
+
188
+ ``` java
189
+ import io.trtc.tuikit.atomicxcore.api.call.CallStore
190
+ import io.trtc.tuikit.atomicxcore.api.view.CallCoreView
191
+ import io.trtc.tuikit.atomicxcore.api.device.DeviceStore
192
+
193
+ class CallActivity : AppCompatActivity() {
194
+ private var buttonContainer: Button? = null
195
+ private var buttonHangup: Button? = null
196
+
197
+ override fun onCreate(savedInstanceState: Bundle?) {
198
+ super.onCreate(savedInstanceState)
199
+ // 其他初始化代码
200
+
201
+ // 1.在底部工具栏容器中添加挂断按钮
202
+ addHangupButton()
203
+ setContentView(buttonContainer)
204
+ }
205
+
206
+ private fun addHangupButton() {
207
+ buttonHangup = Button(this).apply {
208
+ text = "挂断"
209
+ layoutParams = LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1f).apply {
210
+ marginEnd = dpToPx(8)
211
+ }
212
+ setOnClickListener {
213
+ // 2.在点击事件中调用 hangup 接口并销毁页面
214
+ CallStore.shared.hangup(null)
215
+ finish()
216
+ }
217
+ }
218
+ buttonContainer?.addView(buttonHangup)
219
+ }
220
+ }
221
+ ```
222
+ 3. **添加麦克风开关按钮:**在底部工具栏容器中添加麦克风开关按钮,并在点击事件中调用 [openLocalMicrophone](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.device/-device-store/open-local-microphone.html) 或 [closeLocalMicrophone](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.device/-device-store/close-local-microphone.html) 接口。
223
+
224
+ ``` java
225
+ import io.trtc.tuikit.atomicxcore.api.call.CallStore
226
+ import io.trtc.tuikit.atomicxcore.api.view.CallCoreView
227
+ import io.trtc.tuikit.atomicxcore.api.device.DeviceStore
228
+
229
+ class CallActivity : AppCompatActivity() {
230
+ private var buttonContainer: Button? = null
231
+ private var buttonMicrophone: Button? = null
232
+
233
+ override fun onCreate(savedInstanceState: Bundle?) {
234
+ super.onCreate(savedInstanceState)
235
+ // 其他初始化代码
236
+ // 1.在底部工具栏容器中添加麦克风开关
237
+ addMicrophoneButton()
238
+ setContentView(buttonContainer)
239
+ }
240
+
241
+ private fun addMicrophoneButton() {
242
+ buttonMicrophone = Button(this).apply {
243
+ layoutParams = LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1f).apply {
244
+ setMargins(16, 0, 16, 0)
245
+ }
246
+ setOnClickListener {
247
+ // 2.点击事件调用开启或关闭麦克风
248
+ val isMicrophoneOpen = DeviceStore.shared().deviceState.microphoneStatus.value == DeviceStatus.ON
249
+ if (isMicrophoneOpen) {
250
+ DeviceStore.shared().closeLocalMicrophone()
251
+ } else {
252
+ DeviceStore.shared().openLocalMicrophone(null)
253
+ }
254
+ }
255
+ }
256
+ val isMicrophoneOpen = DeviceStore.shared().deviceState.microphoneStatus.value == DeviceStatus.ON
257
+ buttonMicrophone?.text = if (isMicrophoneOpen) "关麦克风" else "开麦克风"
258
+ buttonContainer?.addView(buttonMicrophone)
259
+ }
260
+ }
261
+ ```
262
+ 4. **添加摄像头开关按钮:**在底部工具栏容器中添加摄像头开关按钮,并在点击事件中调用 [openLocalCamera](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.device/-device-store/open-local-camera.html) 或 [closeLocalCamera](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.device/-device-store/close-local-camera.html) 接口。
263
+
264
+ 【Android】
265
+ ``` java
266
+ import io.trtc.tuikit.atomicxcore.api.call.CallStore
267
+ import io.trtc.tuikit.atomicxcore.api.view.CallCoreView
268
+ import io.trtc.tuikit.atomicxcore.api.device.DeviceStore
269
+
270
+ class CallActivity : AppCompatActivity() {
271
+ private var buttonContainer: Button? = null
272
+ private var buttonCamera: Button? = null
273
+
274
+ override fun onCreate(savedInstanceState: Bundle?) {
275
+ super.onCreate(savedInstanceState)
276
+ // 其他初始化代码
277
+ // 1.在底部工具栏容器中添加摄像头开关按钮
278
+ addCameraButton()
279
+ setContentView(buttonContainer)
280
+ }
281
+
282
+ private fun addCameraButton() {
283
+ buttonCamera = Button(this).apply {
284
+ layoutParams = LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1f).apply {
285
+ setMargins(16, 0, 16, 0)
286
+ }
287
+ setOnClickListener {
288
+ // 2.点击事件调用开启或关闭摄像头
289
+ val isCameraOpen = DeviceStore.shared().deviceState.cameraStatus.value == DeviceStatus.ON
290
+ if (isCameraOpen) {
291
+ DeviceStore.shared().closeLocalCamera()
292
+ } else {
293
+ val isFrontCamera = DeviceStore.shared().deviceState.isFrontCamera.value
294
+ DeviceStore.shared().openLocalCamera(isFrontCamera, null)
295
+ }
296
+ }
297
+ }
298
+ val isCameraOpen = DeviceStore.shared().deviceState.cameraStatus.value == DeviceStatus.ON
299
+ buttonCamera?.text = if (isCameraOpen) "关摄像头" else "开摄像头"
300
+ buttonContainer?.addView(buttonCamera)
301
+ }
302
+ }
303
+ ```
304
+
305
+ 5. **实时更新媒体设备按钮文本:**监听麦克风和摄像头的状态,实时更新按钮文本。
306
+
307
+ ``` java
308
+ import io.trtc.tuikit.atomicxcore.api.call.*
309
+ import io.trtc.tuikit.atomicxcore.api.device.DeviceStore
310
+ import kotlinx.coroutines.*
311
+
312
+ class CallActivity : AppCompatActivity() {
313
+ private var buttonCamera: Button? = null
314
+ private var buttonMicrophone: Button? = null
315
+
316
+ override fun onCreate(savedInstanceState: Bundle?) {
317
+ super.onCreate(savedInstanceState)
318
+ // 其他初始化代码
319
+ // 1.监听麦克风和摄像头的状态
320
+ observeDeviceState()
321
+ }
322
+
323
+ private fun observeDeviceState() {
324
+ deviceStateJob = CoroutineScope(Dispatchers.Main).launch {
325
+ supervisorScope {
326
+ launch {
327
+ DeviceStore.shared().deviceState.cameraStatus.collect { status ->
328
+ // 2.更新摄像头按钮文本
329
+ buttonCamera?.text = if (status == DeviceStatus.ON) "关闭摄像头" else "开启摄像头"
330
+ }
331
+ }
332
+ launch {
333
+ DeviceStore.shared().deviceState.microphoneStatus.collect { status ->
334
+ // 2.更新麦克风按钮文本
335
+ buttonMicrophone?.text = if (status == DeviceStatus.ON) "关闭麦克风" else "开启麦克风"
336
+ }
337
+ }
338
+ }
339
+ }
340
+ }
341
+ }
342
+ ```
343
+
344
+ ### 步骤3:申请麦克风/摄像头权限
345
+
346
+ 建议在发起通话前,先行检测音视频权限。若权限缺失,请引导用户动态申请。实现方法如下:
347
+ 1. **声明权限**:首先,在 `AndroidManifest.xml` 文件中声明应用需要的摄像头和麦克风权限。
348
+
349
+ ``` xml
350
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
351
+ <!-- 麦克风权限 -->
352
+ <uses-permission android:name="android.permission.RECORD_AUDIO" />
353
+ <!-- 摄像头权限 -->
354
+ <uses-permission android:name="android.permission.CAMERA" />
355
+
356
+ <application>
357
+ <!-- ... -->
358
+ <activity
359
+ android:name=".CallActivity"
360
+ android:exported="false"
361
+ android:screenOrientation="portrait" />
362
+ </application>
363
+ </manifest>
364
+ ```
365
+ 2. **动态申请权限:**我们推荐您在发起通话时,根据通话媒体类型动态申请音视频权限。以下是权限处理的示例代码:
366
+
367
+ ``` java
368
+ // 动态申请权限
369
+ private fun requestAllCallPermissions() {
370
+ val allPermissions = arrayOf(
371
+ Manifest.permission.CAMERA,
372
+ Manifest.permission.RECORD_AUDIO
373
+ )
374
+
375
+ if (!checkPermissions(allPermissions)) {
376
+ ActivityCompat.requestPermissions(this, allPermissions, PERMISSION_REQUEST_CODE)
377
+ }
378
+ }
379
+
380
+ // 处理权限申请结果
381
+ override fun onRequestPermissionsResult(
382
+ requestCode: Int,
383
+ permissions: Array<out String>,
384
+ grantResults: IntArray
385
+ ) {
386
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults)
387
+
388
+ if (requestCode == PERMISSION_REQUEST_CODE) {
389
+ // 检查是否所有权限都已授予
390
+ var allGranted = true
391
+ for (result in grantResults) {
392
+ if (result != PackageManager.PERMISSION_GRANTED) {
393
+ allGranted = false
394
+ break
395
+ }
396
+ }
397
+ if (allGranted) {
398
+ // 权限申请成功
399
+ } else {
400
+ // 部分权限被拒绝
401
+ }
402
+ }
403
+ }
404
+ ```
405
+
406
+ ### 步骤4:发起通话
407
+
408
+ 您可以在 [calls](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.call/-call-store/calls.html) 调用成功后跳转通话界面,我们建议您根据媒体类型自动开启麦克风或摄像头获得更好的通话体验,实现方式如下:
409
+ 1. **发起通话:**调用 `calls` 发起通话。
410
+
411
+ 2. **开启媒体设备:**发起通话成功后开启麦克风,如果是视频通话同时开启摄像头。
412
+
413
+ 3. **唤起通话页面:**发起通话成功,唤起通话页面。
414
+
415
+ ``` java
416
+ import io.trtc.tuikit.atomicxcore.api.CompletionHandler
417
+ import io.trtc.tuikit.atomicxcore.api.call.CallMediaType
418
+ import io.trtc.tuikit.atomicxcore.api.call.CallStore
419
+
420
+ class MainActivity : ComponentActivity() {
421
+
422
+ // 1.发起通话
423
+ private fun startCall(userIdList: List<String>, mediaType: CallMediaType) {
424
+ CallStore.shared.calls(userIdList, mediaType, null, object : CompletionHandler {
425
+ override fun onFailure(code: Int, desc: String) {
426
+ }
427
+
428
+ override fun onSuccess() {
429
+ // 2.开启媒体设备
430
+ openDeviceForMediaType(mediaType)
431
+ // 3.唤起通话页面
432
+ val intent = Intent(this@MainActivity, CallActivity::class.java)
433
+ startActivity(intent)
434
+ }
435
+ })
436
+ }
437
+
438
+ private fun openDeviceForMediaType(mediaType: CallMediaType?) {
439
+ if (mediaType == null) {
440
+ return
441
+ }
442
+ DeviceStore.shared().openLocalMicrophone(null)
443
+ if (mediaType == CallMediaType.Video) {
444
+ val isFrontCamera = DeviceStore.shared().deviceState.isFrontCamera.value
445
+ DeviceStore.shared().openLocalCamera(isFrontCamera, null)
446
+ }
447
+ }
448
+ }
449
+ ```
450
+
451
+ **calls 接口参数详细说明:**
452
+
453
+ | <strong>参数</strong> | <strong>类型</strong> | <strong>是否必填</strong> | <strong>说明</strong> |
454
+ | --- | --- | --- | --- |
455
+ | userIdList | List<String> | 是 | 目标用户的 <code>userId</code> 列表。 |
456
+ | mediaType | <a href="https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.call/-call-media-type/index.html">CallMediaType</a> | 是 | 通话媒体类型,用于指定发起音频通话还是视频通话。<br>- <code>CallMediaType.Video</code> : 视频通话。<br>- <code>CallMediaType.Audio</code> : 语音通话。 |
457
+ | params | <a href="https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.call/-call-params/index.html">CallParams</a> | 否 | 通话扩展参数,如:房间号、通话邀请超时时间等。<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) : 是否为加密通话(不产生通话记录)。 |
458
+
459
+ ### 步骤5: 结束通话
460
+
461
+ 无论您调用 [hangup](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.call/-call-store/hangup.html) 挂断还是对方主动结束通话,均会触发 [onCallEnded](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.call/-call-listener/on-call-ended.html) 事件。 建议监听该事件,当该事件被触发(即通话结束)时,执行关闭当前界面的操作。实现方式如下:
462
+ 1. **监听通话结束事件**:监听 `onCallEnded` 事件。
463
+
464
+ 2. **销毁通话页面**:`onCallEnded` 触发后,销毁通话页面。
465
+
466
+ ``` java
467
+ import io.trtc.tuikit.atomicxcore.api.call.CallEndReason
468
+ import io.trtc.tuikit.atomicxcore.api.call.CallListener
469
+ import io.trtc.tuikit.atomicxcore.api.call.CallMediaType
470
+ import io.trtc.tuikit.atomicxcore.api.call.CallStore
471
+
472
+ class CallActivity : AppCompatActivity() {
473
+
474
+ private var callListener: CallListener? = null
475
+
476
+ override fun onCreate(savedInstanceState: Bundle?) {
477
+ super.onCreate(savedInstanceState)
478
+ // ... 其他初始化代码
479
+
480
+ // 1.监听通话结束事件
481
+ addListener()
482
+ }
483
+
484
+ private fun addListener() {
485
+ callListener = object : CallListener() {
486
+ override fun onCallEnded(callId: String, mediaType: CallMediaType, reason: CallEndReason, userId: String) {
487
+ // 2.销毁通话页面
488
+ finish()
489
+ }
490
+ }
491
+ callListener?.let { CallStore.shared.addListener(it) }
492
+ }
493
+ }
494
+ ```
495
+
496
+ **onCallEnded 事件参数详细说明**:
497
+
498
+ | <strong>参数</strong> | <strong>类型</strong> | <strong>说明</strong> |
499
+ | --- | --- | --- |
500
+ | callId | String | 此次通话的唯一标识。 |
501
+ | mediaType | <a href="https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.call/-call-media-type/index.html">CallMediaType</a> | 通话媒体类型,用于指定发起音频通话还是视频通话。<br>- <code>CallMediaType.Video</code> : 视频通话。<br>- <code>CallMediaType.Audio</code> : 语音通话。 |
502
+ | reason | <a href="https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.call/-call-end-reason/index.html">CallEndReason</a> | 通话结束的原因。<br>- <code>Unknown</code> : 未知原因,无法确定结束原因。<br>- <code>Hangup</code> : 正常挂断,用户主动挂断通话。<br>- <code>Reject</code> : 拒绝接听,被叫方拒绝来电。<br>- <code>NoResponse</code> : 无响应,被叫方未在超时时间内接听。<br>- <code>Offline</code> : 对方离线,被叫方不在线。<br>- <code>LineBusy</code> : 对方忙线,被叫方正在通话中。<br>- <code>Canceled</code> : 通话取消,主叫方在对方接听前取消。<br>- <code>OtherDeviceAccepted</code> : 其他设备已接听,通话已在另一登录设备上接听。<br>- <code>OtherDeviceReject</code> : 其他设备已拒绝,通话已在另一登录设备上拒绝。<br>- <code>EndByServer</code> : 服务器结束,通话被服务器终止。 |
503
+ | userId | String | 触发结束的用户 ID 。 |
504
+
505
+ ### 运行效果
506
+
507
+ 当您完成以上 5 步后,"拨打一通电话"运行效果如下:
508
+
509
+ ## 定制页面
510
+
511
+ **CallCoreView** 提供了完善的 UI 定制能力,支持头像及音量提示等图标的自由替换。**为助力快速集成,您可以直接从 **[**Github**](https://github.com/Tencent-RTC/TUIKit_Android/tree/main/call/tuicallkit-kt/src/main/res)** 下载。这些图标由我们的设计师专为 TUICallKit 打造,无版权风险,可放心使用。**
512
+
513
+ ### 自定义音量提示的图标
514
+
515
+ 您可以调用 **CallCoreView** 组件的 [setVolumeLevelIcons](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.view/-call-core-view/set-volume-level-icons.html) 设置音量大小等级不同的提示图标。
516
+
517
+ - **setVolumeLevelIcons****示例代码:**
518
+
519
+ ``` java
520
+ private fun setIconResourcePath() {
521
+ val volumeLevelIcons = mapOf(VolumeLevel.Mute to "对应图标资源的路径")
522
+ val callCoreView = CallCoreView(context)
523
+ callCoreView.setVolumeLevelIcons(volumeLevelIcons)
524
+ }
525
+ ```
526
+ - **setVolumeLevelIcons 接口参数详细说明:**
527
+
528
+ | <strong>参数</strong> | <strong>类型</strong> | <strong>是否必填</strong> | <strong>说明</strong> |
529
+ | --- | --- | --- | --- |
530
+ | icons | Map<<a href="https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.view/-volume-level/index.html">VolumeLevel</a>, String> | 是 | 音量等级与图标资源的映射表。<br>key ( VolumeLevel ) 表示音量等级:<br>- <code>VolumeLevel.Mute</code> :表示麦克风关闭,静音状态。<br>- <code>VolumeLevel.Low</code> :表示音量范围 (0-25]<br>- <code>VolumeLevel.Medium</code> : 表示音量范围 (25-50]<br>- <code>VolumeLevel.High</code> : 表示音量范围在 (50-75]<br>- <code>VolumeLevel.Peak</code> : 表示音量范围在 (75-100]。<br>Value ( String ) 表示对应音量等级的图标资源路径。 |
531
+
532
+ - **音量提示图标:**
533
+
534
+ | <strong>图标</strong> | <strong>说明</strong> |
535
+ | --- | --- |
536
+ | | 【图标含义】音量提示图标。<br>【推荐用法】您可以将该图标等级设置为 <code>VolumeLevel.Low</code> 或 <code>VolumeLevel.Medium</code> ,当用户音量大于对应等级时显示。 |
537
+ | | 【图标含义】静音图标。<br>【推荐用法】您可以将该图标等级设置为 <code>VolumeLevel.Mute</code> ,当该用户静音时显示。 |
538
+
539
+ ### 自定义网络提示的图标
540
+
541
+ 您可以调用 **CallCoreView** 组件的 [setNetworkQualityIcons](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.view/-call-core-view/set-network-quality-icons.html) 设置不同网络状态的提示图标。
542
+
543
+ - **setNetworkQualityIcons 示例代码:**
544
+
545
+ ``` java
546
+ private fun setNetworkQualityIcons() {
547
+ val volumeLevelIcons = mapOf(NetworkQuality.BAD to "对应图标的路径")
548
+ val callCoreView = CallCoreView(context)
549
+ callCoreView.setNetworkQualityIcons(volumeLevelIcons)
550
+ }
551
+ ```
552
+ - **setNetworkQualityIcons****接口参数详细说明:**
553
+
554
+ | <strong>参数</strong> | <strong>类型</strong> | <strong>是否必填</strong> | <strong>说明</strong> |
555
+ | --- | --- | --- | --- |
556
+ | icons | Map<<a href="https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.device/-network-quality/index.html">NetworkQuality</a>, String> | 是 | 网络质量与图标资源的映射表。<br>Key ( NetworkQuality ) : 表示网络质量等级。<br>- <code>NetworkQuality.UNKNOWN</code> :未知网络状态。<br>- <code>NetworkQuality.EXCELLENT</code>:网络状态极佳。<br>- <code>NetworkQuality.GOOD</code> : 网络状态较好。<br>- <code>NetworkQuality.POOR</code> : 网络状态较差。<br>- <code>NetworkQuality.BAD</code> : 网络状态差。<br>- <code>NetworkQuality.VERY_BAD</code> :网络状态极差。<br>- <code>NetworkQuality.DOWN</code> :网络断开。<br>Value ( String ) : 对应网络状态的图标资源路径。 |
557
+
558
+ - **网络较差的提示图标:**
559
+
560
+ | <strong>图标</strong> | <strong>说明</strong> |
561
+ | --- | --- |
562
+ | | 【图标含义】网络较差的提示图标。<br>【推荐用法】您可以将该图标等级设置为 <code>NetworkQuality.BAD</code>、<code>NetworkQuality.VERY_BAD</code> 或 <code>NetworkQuality.DOWN</code> ,当网络较差时显示该图标。 |
563
+
564
+ ### 自定义默认头像
565
+
566
+ 您可以调用 **CallCoreView** 的 [setParticipantAvatars](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.view/-call-core-view/set-participant-avatars.html) 接口设置用户头像。建议您监听响应式数据 [allParticipants](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.call/-call-state/all-participants.html)(所有参与通话的成员):当获取到用户头像时设置并展示;若用户未设置头像或加载失败,则显示默认头像(占位图)。
567
+ - **setParticipantAvatars****示例代码:**
568
+
569
+ ``` java
570
+ private fun setParticipantAvatars() {
571
+ val avatars: MutableMap<String, String> = mutableMapOf()
572
+ val userId = "" // 用户 ID
573
+ val avatarPath = "" // 用户默认头像资源的路径
574
+ avatars[userId] = avatarPath
575
+ val callCoreView = CallCoreView(context)
576
+ callCoreView.setParticipantAvatars(avatars)
577
+ }
578
+ ```
579
+ - **setParticipantAvatars****接口参数详细说明:**
580
+
581
+ | <strong>参数</strong> | <strong>类型</strong> | 是否必填 | <strong>说明</strong> |
582
+ | --- | --- | --- | --- |
583
+ | icons | Map<String, String> | 是 | 用户头像映射表。<br>- Key : 用户的 userID 。<br>- Value : 该用户的头像资源绝对路径。 |
584
+
585
+ - **默认头像资源:**
586
+
587
+ | <strong>图标</strong> | <strong>说明</strong> |
588
+ | --- | --- |
589
+ | | 【图标含义】默认头像<br>【推荐用法】当用户头像加载失败或无头像时,您可以给该用户设置此默认头像。 |
590
+
591
+ ### 自定义 loading 动画
592
+
593
+ 您可以调用 **CallCoreView** 的 [setWaitingAnimation](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.view/-call-core-view/set-waiting-animation.html) 接口,为等待中用户设置等待动画获得更好的体验。
594
+
595
+ - **setWaitingAnimation 示例代码:**
596
+
597
+ ``` java
598
+ private fun setWaitingAnimation() {
599
+ val waitingAnimationPath = "" // 等待动画 GIF 图像资源的路径
600
+ val callCoreView = CallCoreView(context)
601
+ callCoreView.setWaitingAnimation(waitingAnimationPath)
602
+ }
603
+ ```
604
+ - **setWaitingAnimation 接口参数详细说明:**
605
+
606
+ |**参数**|**类型**|**是否必填**|**说明**|
607
+ |---------|---------|---------|---------|
608
+ |path| String|是|GIF 格式图像资源的绝对路径。|
609
+
610
+ - **等待接听的动画:**
611
+
612
+ | <strong>图标</strong> | <strong>说明</strong> |
613
+ | --- | --- |
614
+ | | 【图标含义】用户等待接听动画。<br>【推荐用法】群组通话时设置的动画。设置后,当用户的状态为等待接听时,显示该动画。 |
615
+
616
+ ### 添加通话计时提示
617
+
618
+ 通话计时可通过响应式数据 [activeCall](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.call/-call-state/active-call.html) 的 `duration` 字段实时获得,实时显示通话计时的实现方式如下:
619
+ 1. **数据层订阅:**订阅 `CallStore.observerState.activeCall` , 建立当前活跃通话的响应式监听。
620
+
621
+ 2. **绑定通话计时数据**:将 `activeCall.duration` 字段绑定至 UI 控件。该字段为响应式数据,会自动驱动 UI 实时刷新,无需手动维护定时器。
622
+
623
+ ``` java
624
+ import android.content.Context
625
+ import androidx.appcompat.widget.AppCompatTextView
626
+ import androidx.core.content.ContextCompat
627
+ import com.tencent.qcloud.tuicore.util.DateTimeUtil
628
+ import io.trtc.tuikit.atomicxcore.api.call.CallStore
629
+ import io.trtc.tuikit.atomicxcore.api.call.CallParticipantStatus
630
+ import kotlinx.coroutines.CoroutineScope
631
+ import kotlinx.coroutines.Dispatchers
632
+ import kotlinx.coroutines.Job
633
+ import kotlinx.coroutines.launch
634
+
635
+ class TimerView(context: Context) : AppCompatTextView(context) {
636
+ private var subscribeStateJob: Job? = null
637
+
638
+ override fun onAttachedToWindow() {
639
+ super.onAttachedToWindow()
640
+ // 1.数据层订阅 activeCall
641
+ registerActiveCallObserver()
642
+ }
643
+
644
+ private fun registerActiveCallObserver() {
645
+ subscribeStateJob = CoroutineScope(Dispatchers.Main).launch {
646
+ CallStore.shared.observerState.activeCall.collect { activeCall ->
647
+ // 2.绑定通话计时数据,更新通话计时
648
+ updateDurationView(activeCall)
649
+ }
650
+ }
651
+ }
652
+
653
+ private fun updateDurationView(activeCall: CallInfo) {
654
+ val currentDuration = activeCall.duration
655
+ text = DateTimeUtil.formatSecondsTo00(currentDuration.toInt())
656
+ }
657
+
658
+ override fun onDetachedFromWindow() {
659
+ super.onDetachedFromWindow()
660
+ subscribeStateJob?.cancel()
661
+ }
662
+ }
663
+ ```
664
+
665
+ > **说明:**
666
+ >
667
+
668
+ > 若您想了解更多通话状态响应式数据,详细可参考:[CallState](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.call/-call-state/index.html) 。
669
+ >
670
+
671
+ ## 更多功能
672
+
673
+ ### 设置头像和昵称
674
+
675
+ 通话开始前,您可以通过 [setSelfInfo](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.login/-login-store/set-self-info.html) 方法,设置自己的昵称和头像。
676
+ - **setSelfInfo 示例代码:**
677
+
678
+ ``` java
679
+ val user = UserProfile()
680
+ user.userID = "" // 您的 userId
681
+ user.avatarURL = "" // 头像的 url
682
+ user.nickname = "" // 需要设置的昵称
683
+ LoginStore.shared.setSelfInfo(user, object : CompletionHandler {
684
+ override fun onSuccess() {
685
+ // 设置成功回调
686
+ }
687
+
688
+ override fun onFailure(code: Int, desc: String) {
689
+ // 设置失败回调
690
+ }
691
+ })
692
+ ```
693
+ - **setSelfInfo 接口参数详细说明:**
694
+
695
+ | <strong>参数</strong> | <strong>类型</strong> | <strong>是否必填</strong> | <strong>说明</strong> |
696
+ | --- | --- | --- | --- |
697
+ | userProfile | <a href="https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.login/-user-profile/index.html">UserProfile</a> | 是 | 用户信息结构体。<br>- <code>userID</code> (String):用户的 ID 。<br>- <code>avatarURL</code> (String) : 用户头像的 URL。<br>- <code>nickname </code>(String) :用户的昵称。<br>更多字段详情可参考 <a href="https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.login/-user-profile/index.html">UserProfile</a> 。 |
698
+ | completion | CompletionHandler | 否 | 操作完成回调,用于返回接通电话的结果。 |
699
+
700
+ ### 切换布局模式
701
+
702
+ 您可以通过 [setLayoutTemplate](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.view/-call-core-view/set-layout-template.html) 接口灵活切换布局模式。若未主动配置,**CallCoreView** 将根据通话人数自动适配:1 V 1 场景下默认采用 `Float` 模式,多人通话场景下则自动切换为 `Grid` 模式。不同布局模式的说明如下:
703
+ | <strong>Float 模式</strong> | <strong>Grid 模式</strong> | <strong>PIP 模式</strong> |
704
+ | --- | --- | --- |
705
+ | | | |
706
+ | - <strong>布局逻辑:</strong>呼叫等待时全屏显示己方画面;接通后全屏显示对方画面,己方画面以悬浮小窗展示。<br>- <strong>交互特性:</strong>支持小窗拖拽移动,点击小窗可实现大小画面互换。 | - <strong>布局逻辑:</strong>所有成员画面呈网格状平铺排列成宫格模式布局,适用 2 人以上通话,支持点击放大画面功能。<br>- <strong>交互特性:</strong>支持点击特定成员画面放大查看。 | - <strong>布局逻辑:</strong>1v1 场景固定显示对方画面,多人场景:采用当前发言者(Active Speaker) 策略,自动识别并全屏展示正在说话的用户。<br>- <strong>交互特性:</strong>等待时显示自己的画面,接通后还会显示通话计时。 |
707
+
708
+ - **setLayoutTemplate****示例代码:**
709
+
710
+ ``` java
711
+ private fun setLayoutTemplate() {
712
+ val callCoreView = CallCoreView(context)
713
+ val template = CallLayoutTemplate.Grid
714
+ // 设置布局模式
715
+ callCoreView.setLayoutTemplate(template)
716
+ setContentView(callCoreView)
717
+ }
718
+ ```
719
+ - **setLayoutTemplate 接口参数详细说明:**
720
+
721
+ | <strong>参数</strong> | <strong>类型</strong> | <strong>是否必填</strong> | <strong>说明</strong> |
722
+ | --- | --- | --- | --- |
723
+ | template | <a href="https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.view/-call-layout-template/index.html">CallLayoutTemplate</a> | 是 | CallCoreView 的布局模式。<br>- <code>CallLayoutTemplate.Float</code> :<br>- 布局逻辑:呼叫等待时全屏显示己方画面;接通后全屏显示对方画面,己方画面以悬浮小窗展示。<br>- 交互特性:支持小窗拖拽移动,点击小窗可实现大小画面互换。<br>- <code>CallLayoutTemplate.Grid</code> :<br>- 布局逻辑:所有成员画面呈网格状平铺排列成宫格模式布局,适用 2 人以上通话,支持点击放大画面功能。<br>- 交互特性:支持点击特定成员画面放大查看。<br>- <code>CallLayoutTemplate.Pip</code> :<br>- 布局逻辑:1v1 场景固定显示对方画面,多人场景:采用当前发言者(Active Speaker) 策略,自动识别并全屏展示正在说话的用户。<br>- 交互特性:等待时显示自己的画面,接通后还会显示通话计时。 |
724
+
725
+ ### 设置通话的默认超时时间
726
+
727
+ 您可以在发起通话 [calls](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.call/-call-store/calls.html) 时,通过配置参数 [CallParams](https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.call/-call-params/index.html) 中的 `timeout` 字段来指定等待超时时间。示例代码如下:
728
+ ``` java
729
+ val callParams = CallParams()
730
+ callParams.timeout = 30 // 设置通话超时
731
+ CallStore.shared.calls(userIdList, CallMediaType.Video, callParams, null)
732
+ ```
733
+
734
+ **calls 接口参数详细说明:**
735
+ | <strong>参数</strong> | <strong>类型</strong> | <strong>是否必填</strong> | <strong>说明</strong> |
736
+ | --- | --- | --- | --- |
737
+ | userIdList | List<String> | 是 | 目标用户的 userId 列表。 |
738
+ | mediaType | <a href="https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.call/-call-media-type/index.html">CallMediaType</a> | 是 | 通话媒体类型,用于指定发起音频通话还是视频通话。<br>- <code>CallMediaType.Video</code> : 视频通话。<br>- <code>CallMediaType.Audio</code> : 语音通话。 |
739
+ | params | <a href="https://liteav.sdk.cloudcachetci.com/doc/product/tuikit/atomic-x/android/zh/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.call/-call-params/index.html">CallParams</a> | 否 | 通话扩展参数,如:房间号、通话邀请超时时间等。<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) : 是否为加密通话(不产生通话记录)。 |
740
+
741
+ ### 实现画中画功能
742
+
743
+ 画中画功能需 Android 8.0 (API 26) 及以上版本支持。建议您在进入画中画模式时,将 **CallCoreView** 切换为 `Pip` 布局获得更好的体验。
744
+ - **开始进入画中画**:调用系统方法 `enterPictureInPictureMode` 启动画中画模式。
745
+
746
+ ``` java
747
+ private fun enterPictureInPictureModeWithBuild() {
748
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && hasPipModePermission()) {
749
+ val pictureInPictureParams: PictureInPictureParams.Builder = PictureInPictureParams.Builder()
750
+ val floatViewWidth = resources.getDimensionPixelSize(R.dimen.callkit_video_small_view_width)
751
+ val floatViewHeight = resources.getDimensionPixelSize(R.dimen.callkit_video_small_view_height)
752
+ val aspectRatio = Rational(floatViewWidth, floatViewHeight)
753
+ pictureInPictureParams.setAspectRatio(aspectRatio).build()
754
+ this.enterPictureInPictureMode(pictureInPictureParams.build())
755
+ }
756
+ }
757
+ ```
758
+ - **进入画中画成功**:在 `onPictureInPictureModeChanged` 回调中,若检测到进入画中画模式,请将 **CallCoreView** 的布局设置为 **Pip** 模式:
759
+
760
+ ``` java
761
+ val callCoreView = CallCoreView(context)
762
+
763
+ override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean) {
764
+ super.onPictureInPictureModeChanged(isInPictureInPictureMode)
765
+ if (isInPictureInPictureMode) {
766
+ callCoreView.setLayoutTemplate(CallLayoutTemplate.Pip)
767
+ }
768
+ }
769
+ ```
770
+ - **从画中画返回到通话界面**:当从画中画返回应用(恢复全屏)时,会触发 `onResume` 回调。您可以在该回调中,根据当前通话的人数重新设置布局。若当前为 1 v 1 通话:设置为 `Float`,多人通话:设置为 `Grid`。
771
+
772
+ ``` java
773
+ val callCoreView = CallCoreView(context)
774
+
775
+ override fun onResume() {
776
+ super.onResume()
777
+ val allParticipants = CallStore.shared.observerState.allParticipants.value
778
+ if (allParticipants.size > 2) {
779
+ callCoreView?.setLayoutTemplate(CallLayoutTemplate.Grid)
780
+ } else {
781
+ callCoreView?.setLayoutTemplate(CallLayoutTemplate.Float)
782
+ }
783
+ }
784
+ ```
785
+
786
+ ### 设置通话过程中屏幕常亮
787
+
788
+ 通话过程中保持屏幕常亮是通话应用的基本需求。Android 提供了 `WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON` 标志来实现此功能,这是最简单且推荐的方式。
789
+ ``` java
790
+ class CallActivity : AppCompatActivity() {
791
+ override fun onCreate(savedInstanceState: Bundle?) {
792
+ super.onCreate(savedInstanceState)
793
+
794
+ window.addFlags(
795
+ WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED or // 锁屏时显示
796
+ WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD or // 解锁屏幕
797
+ WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON or // 保持屏幕常亮
798
+ WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON // 点亮屏幕
799
+ )
800
+
801
+ setContentView(R.layout.activity_call)
802
+ }
803
+ }
804
+ ```
805
+
806
+ ### 播放等待接听的提示音
807
+
808
+ 您可以监听自己的通话状态,在等待接听时播放铃声,在接听通话或通话结束停止播放铃声。
809
+ ``` java
810
+ MainScope().launch {
811
+ CallStore.shared.observerState.selfInfo.collect { selfInfo ->
812
+ if (selfInfo.status == CallParticipantStatus.Accept || selfInfo.status == CallParticipantStatus.None) {
813
+ // 停止播放铃声
814
+ return@collect
815
+ }
816
+ if (selfInfo.status == CallParticipantStatus.Waiting) {
817
+ // 播放铃声
818
+ }
819
+ }
820
+ ```
821
+
822
+ ### 开启后台采集音频/视频
823
+ 1. **配置权限与服务(AndroidManifest.xml):** 从 Android 9.0 (API 28) 开始需要声明前台服务权限;Android 14 (API 34) 强制要求声明具体的服务类型(麦克风和摄像头)。
824
+
825
+ ``` java
826
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
827
+
828
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
829
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
830
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
831
+
832
+ <application>
833
+ <service
834
+ android:name=".CallForegroundService"
835
+ android:enabled="true"
836
+ android:exported="false"
837
+ android:foregroundServiceType="camera|microphone" />
838
+ </application>
839
+ </manifest>
840
+ ```
841
+ 2. **创建前台服务类(CallForegroundService):**
842
+
843
+ ``` java
844
+ import android.app.Notification
845
+ import android.app.NotificationChannel
846
+ import android.app.NotificationManager
847
+ import android.app.Service
848
+ import android.content.Context
849
+ import android.content.Intent
850
+ import android.os.Build
851
+ import android.os.IBinder
852
+ import androidx.core.app.NotificationCompat
853
+
854
+ class CallForegroundService : Service() {
855
+ companion object {
856
+ private const val NOTIFICATION_ID = 1001
857
+ private const val CHANNEL_ID = "call_foreground_channel"
858
+
859
+ fun start(context: Context) {
860
+ val intent = Intent(context, CallForegroundService::class.java)
861
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
862
+ context.startForegroundService(intent)
863
+ } else {
864
+ context.startService(intent)
865
+ }
866
+ }
867
+
868
+ fun stop(context: Context) {
869
+ val intent = Intent(context, CallForegroundService::class.java)
870
+ context.stopService(intent)
871
+ }
872
+ }
873
+
874
+ override fun onCreate() {
875
+ super.onCreate()
876
+ createNotificationChannel()
877
+ // 启动前台通知,确保后台采集权限
878
+ startForeground(NOTIFICATION_ID, createNotification())
879
+ }
880
+
881
+ override fun onBind(intent: Intent?): IBinder? = null
882
+
883
+ private fun createNotification(): Notification {
884
+ return NotificationCompat.Builder(this, CHANNEL_ID)
885
+ .setContentTitle("正在通话中")
886
+ .setContentText("应用正在后台运行以保持通话")
887
+ .setSmallIcon(android.R.drawable.ic_menu_call) // 请替换为您的应用图标
888
+ .setPriority(NotificationCompat.PRIORITY_HIGH)
889
+ .build()
890
+ }
891
+
892
+ private fun createNotificationChannel() {
893
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
894
+ val channel = NotificationChannel(
895
+ CHANNEL_ID,
896
+ "通话保活服务",
897
+ NotificationManager.IMPORTANCE_HIGH
898
+ )
899
+ val manager = getSystemService(NotificationManager::class.java)
900
+ manager.createNotificationChannel(channel)
901
+ }
902
+ }
903
+ }
904
+ ```
905
+
906
+ ## 下一步
907
+
908
+ 恭喜您,已经完成了"拨打一通电话",接下来,您可以实现**接听第一通电话**功能,可参考下表:
909
+ | <strong>功能</strong> | <strong>描述</strong> | <strong>集成指引</strong> |
910
+ | --- | --- | --- |
911
+ | <strong>接听第一通电话</strong> | 引导您快速完成接听流程集成。涵盖通话界面唤起、接听及拒接等核心控制功能。 | 接听第一通电话 |
912
+
913
+ ## 常见问题
914
+
915
+ ### 进入画中画模式后,应用内跳转其他界面后画面异常?
916
+ - **原因:**Android 的画中画模式是基于任务栈(Task Stack)运作的。默认情况下,应用内所有 Activity 共享同一个任务栈。因此,若在画中画期间启动新的 Activity,该页面会被压入当前栈中,导致其错误地显示在画中画的小窗口内,引发 UI 异常。
917
+
918
+ - **解决方法:**在 `AndroidManifest.xml` 声明通话界面的 Activity 为一个独立的任务栈。
919
+
920
+ ``` xml
921
+ <activity
922
+ android:name=".view.CallActivity" <!-- 您的通话界面 -->
923
+ android:launchMode="singleTask"
924
+ android:taskAffinity="${applicationId}.call" />
925
+ ```
926
+
927
+ ### 在通话邀请超时时间内,被邀请者如果离线再上线,能否收到来电事件?
928
+
929
+ 单人通话时,如果在超时时间内上线,会触发来电邀请;群组通话,如果在超时时间内上线,会拉起未处理的20条群消息,如果存在通话邀请,则触发来电邀请事件。