@tencent-rtc/mcp 1.6.4 → 1.6.6

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 (251) hide show
  1. package/knowledge/chunker.js +83 -54
  2. package/knowledge/path-meta.js +179 -26
  3. package/knowledge/search/exact-lookup.js +168 -10
  4. package/knowledge/search/filter-pool.js +73 -19
  5. package/knowledge/search/product-scope-intent.js +2 -2
  6. package/knowledge/search/requires-framework.js +2 -2
  7. package/knowledge/search/search-knowledge.js +247 -61
  8. package/package.json +1 -1
  9. package/resource/index/manifest.json +1 -1
  10. package/resource/integration/callkit/preset/android/integration.md +2 -4
  11. package/resource/integration/callkit/preset/flutter/integration.md +4 -5
  12. package/resource/integration/callkit/preset/ios/integration.md +1 -4
  13. package/resource/integration/callkit/preset/react/integration.md +13 -20
  14. package/resource/integration/callkit/preset/vue/integration.md +14 -21
  15. package/resource/integration/chat/preset/android/integration.md +6 -9
  16. package/resource/integration/chat/preset/flutter/integration.md +9 -12
  17. package/resource/integration/chat/preset/ios/integration.md +2 -4
  18. package/resource/integration/chat/preset/react/integration.md +0 -10
  19. package/resource/integration/livekit/preset/live/android/live-audience-integration.md +129 -0
  20. package/resource/integration/livekit/preset/live/android/live-host-integration.md +219 -0
  21. package/resource/integration/livekit/preset/live/android/live-list-integration.md +261 -0
  22. package/resource/integration/livekit/preset/live/android/prepare-integration.md +254 -0
  23. package/resource/integration/livekit/preset/live/ios/live-audience-integration.md +202 -0
  24. package/resource/integration/livekit/preset/live/ios/live-host-integration.md +369 -0
  25. package/resource/integration/livekit/preset/live/ios/live-list-integration.md +229 -0
  26. package/resource/integration/livekit/preset/live/ios/prepare-integration.md +204 -0
  27. package/resource/integration/livekit/preset/live/vue/live-list-integration.md +0 -3
  28. package/resource/integration/livekit/preset/live/vue/live-player-desk-integration.md +0 -5
  29. package/resource/integration/livekit/preset/live/vue/live-player-h5-integration.md +0 -6
  30. package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +5 -10
  31. package/resource/integration/roomkit/preset/vue/integration.md +0 -4
  32. package/resource/knowledge/callkit/best-practice/web/callengine-invitation.md +80 -0
  33. package/resource/knowledge/callkit/best-practice/web/callengine-log-control.md +24 -0
  34. package/resource/knowledge/callkit/best-practice/web/callkit-call-vs-calls.md +116 -0
  35. package/resource/knowledge/callkit/core-sdk/android/answer-call.md +7 -8
  36. package/resource/knowledge/callkit/core-sdk/android/make-call.md +5 -7
  37. package/resource/knowledge/callkit/core-sdk/android/offline-push.md +3 -5
  38. package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +2 -6
  39. package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +2 -6
  40. package/resource/knowledge/callkit/core-sdk/flutter/offline-push.md +4 -9
  41. package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +1 -4
  42. package/resource/knowledge/callkit/core-sdk/ios/make-call.md +8 -11
  43. package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +17 -23
  44. package/resource/knowledge/callkit/core-sdk/web/call-engine.md +33 -0
  45. package/resource/knowledge/callkit/core-sdk/web/call-event.md +327 -0
  46. package/resource/knowledge/callkit/core-sdk/web/callengine-api-overview.md +33 -0
  47. package/resource/knowledge/callkit/faq/android.md +0 -2
  48. package/resource/knowledge/callkit/faq/error-code.md +0 -2
  49. package/resource/knowledge/callkit/faq/flutter.md +2 -2
  50. package/resource/knowledge/callkit/faq/ios.md +3 -5
  51. package/resource/knowledge/callkit/faq/web.md +2 -3
  52. package/resource/knowledge/callkit/preset/android/api.md +2 -5
  53. package/resource/knowledge/callkit/preset/ios/api.md +0 -2
  54. package/resource/knowledge/callkit/preset/react/api.md +445 -0
  55. package/resource/knowledge/callkit/preset/react/uikit-api-reference.md +445 -0
  56. package/resource/knowledge/callkit/preset/vue/api.md +465 -0
  57. package/resource/knowledge/callkit/preset/vue/uikit-api-reference.md +465 -0
  58. package/resource/knowledge/chat/best-practice/web/image-message-url-handling.md +16 -0
  59. package/resource/knowledge/chat/preset/android/features/chat-setting.md +1 -1
  60. package/resource/knowledge/chat/preset/android/features/conversation-list.md +1 -1
  61. package/resource/knowledge/chat/preset/android/features/language.md +0 -1
  62. package/resource/knowledge/chat/preset/android/features/message-input.md +1 -1
  63. package/resource/knowledge/chat/preset/android/features/message-list.md +2 -3
  64. package/resource/knowledge/chat/preset/android/features/search.md +0 -1
  65. package/resource/knowledge/chat/preset/android/features/theme.md +1 -1
  66. package/resource/knowledge/chat/preset/android-view/integration.md +3 -11
  67. package/resource/knowledge/chat/preset/flutter/features/conversation-list.md +0 -1
  68. package/resource/knowledge/chat/preset/flutter/features/message-list.md +1 -2
  69. package/resource/knowledge/chat/preset/flutter/features/search.md +5 -6
  70. package/resource/knowledge/chat/preset/flutter/features/theme.md +2 -2
  71. package/resource/knowledge/chat/preset/ios/features/chat-setting.md +1 -1
  72. package/resource/knowledge/chat/preset/ios/features/conversation-list.md +1 -2
  73. package/resource/knowledge/chat/preset/ios/features/message-list.md +1 -2
  74. package/resource/knowledge/chat/preset/ios/features/search.md +0 -1
  75. package/resource/knowledge/chat/preset/ios-uikit/integration.md +13 -15
  76. package/resource/knowledge/chat/preset/react/features/conversation-list.md +5 -5
  77. package/resource/knowledge/chat/preset/react/features/message-input.md +2 -3
  78. package/resource/knowledge/chat/preset/react/features/search.md +0 -1
  79. package/resource/knowledge/chat/preset/react/features/theme.md +0 -1
  80. package/resource/knowledge/chat/urls/sdk/android.md +3 -3
  81. package/resource/knowledge/chat/urls/sdk/flutter.md +3 -3
  82. package/resource/knowledge/chat/urls/sdk/ios.md +3 -3
  83. package/resource/knowledge/chat/urls/sdk/web.md +3 -3
  84. package/resource/knowledge/livekit/core-sdk/api-reference/android/AudioEffectStore.md +7 -14
  85. package/resource/knowledge/livekit/core-sdk/api-reference/android/BarrageStore.md +5 -8
  86. package/resource/knowledge/livekit/core-sdk/api-reference/android/BattleStore.md +15 -18
  87. package/resource/knowledge/livekit/core-sdk/api-reference/android/CameraView.md +1 -2
  88. package/resource/knowledge/livekit/core-sdk/api-reference/android/CoGuestStore.md +15 -20
  89. package/resource/knowledge/livekit/core-sdk/api-reference/android/CoHostStore.md +10 -13
  90. package/resource/knowledge/livekit/core-sdk/api-reference/android/DeviceStore.md +2 -4
  91. package/resource/knowledge/livekit/core-sdk/api-reference/android/GiftStore.md +4 -6
  92. package/resource/knowledge/livekit/core-sdk/api-reference/android/LikeStore.md +2 -4
  93. package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveAudienceStore.md +2 -4
  94. package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveCoreView.md +1 -2
  95. package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveSeatStore.md +8 -10
  96. package/resource/knowledge/livekit/core-sdk/api-reference/android/LoginStore.md +5 -7
  97. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/AudioEffectStore.md +7 -14
  98. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BarrageStore.md +6 -9
  99. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BaseBeautyStore.md +1 -2
  100. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BattleStore.md +15 -18
  101. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoGuestStore.md +15 -20
  102. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoHostStore.md +10 -13
  103. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/DeviceStore.md +2 -4
  104. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/GiftStore.md +4 -6
  105. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LikeStore.md +2 -4
  106. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveAudienceStore.md +2 -4
  107. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveCoreView.md +1 -2
  108. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveSeatStore.md +8 -10
  109. package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LoginStore.md +3 -5
  110. package/resource/knowledge/livekit/core-sdk/api-reference/ios/AudioEffectStore.md +7 -14
  111. package/resource/knowledge/livekit/core-sdk/api-reference/ios/BarrageStore.md +5 -8
  112. package/resource/knowledge/livekit/core-sdk/api-reference/ios/BaseBeautyStore.md +1 -2
  113. package/resource/knowledge/livekit/core-sdk/api-reference/ios/BattleStore.md +6 -9
  114. package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoGuestStore.md +5 -10
  115. package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoHostStore.md +3 -6
  116. package/resource/knowledge/livekit/core-sdk/api-reference/ios/DeviceStore.md +2 -4
  117. package/resource/knowledge/livekit/core-sdk/api-reference/ios/GiftStore.md +4 -6
  118. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LikeStore.md +2 -4
  119. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveAudienceStore.md +2 -4
  120. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveCoreView.md +1 -2
  121. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveSeatStore.md +4 -6
  122. package/resource/knowledge/livekit/core-sdk/api-reference/ios/LoginStore.md +3 -5
  123. package/resource/knowledge/livekit/core-sdk/api-reference/{web → vue}/index.md +24 -24
  124. package/resource/knowledge/livekit/core-sdk/{voice/android/voice-audio-effect.md → features/android/audio-effect.md} +1 -2
  125. package/resource/knowledge/livekit/core-sdk/{live/android/live-gift.md → features/android/gift.md} +2 -3
  126. package/resource/knowledge/livekit/core-sdk/{voice/android/voice-room-list.md → features/android/live-list.md} +2 -4
  127. package/resource/knowledge/livekit/core-sdk/{live/flutter/live-audio-effect.md → features/flutter/audio-effect.md} +0 -2
  128. package/resource/knowledge/livekit/core-sdk/{voice/flutter/voice-barrage.md → features/flutter/barrage.md} +2 -2
  129. package/resource/knowledge/livekit/core-sdk/{live/flutter/live-gift.md → features/flutter/gift.md} +2 -3
  130. package/resource/knowledge/livekit/core-sdk/{voice/flutter/voice-room-list.md → features/flutter/live-list.md} +1 -1
  131. package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-audience-list.md → features/ios/audience-list.md} +1 -2
  132. package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-audio-effect.md → features/ios/audio-effect.md} +1 -3
  133. package/resource/knowledge/livekit/core-sdk/{live/ios/live-base-beauty.md → features/ios/base-beauty.md} +2 -2
  134. package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-gift.md → features/ios/gift.md} +2 -3
  135. package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-room-list.md → features/ios/live-list.md} +2 -4
  136. package/resource/knowledge/livekit/core-sdk/live/android/{live-co-guest-interaction.md → co-guest-interaction.md} +0 -1
  137. package/resource/knowledge/livekit/core-sdk/live/android/{live-host-interaction.md → host-interaction.md} +5 -7
  138. package/resource/knowledge/livekit/core-sdk/live/android/{live-integration.md → integration.md} +3 -6
  139. package/resource/knowledge/livekit/core-sdk/live/flutter/{live-co-guest-interaction.md → co-guest-interaction.md} +1 -1
  140. package/resource/knowledge/livekit/core-sdk/live/flutter/{live-host-interaction.md → host-interaction.md} +0 -2
  141. package/resource/knowledge/livekit/core-sdk/live/flutter/{live-integration.md → integration.md} +1 -4
  142. package/resource/knowledge/livekit/core-sdk/live/ios/{live-co-guest-interaction.md → co-guest-interaction.md} +0 -1
  143. package/resource/knowledge/livekit/core-sdk/live/ios/{live-host-interaction.md → host-interaction.md} +2 -4
  144. package/resource/knowledge/livekit/core-sdk/live/ios/{live-integration.md → integration.md} +2 -5
  145. package/resource/knowledge/livekit/core-sdk/voice/android/{voice-host-interaction.md → host-interaction.md} +3 -5
  146. package/resource/knowledge/livekit/core-sdk/voice/android/{voice-integration.md → integration.md} +3 -6
  147. package/resource/knowledge/livekit/core-sdk/voice/flutter/{voice-co-guest-interaction.md → co-guest-interaction.md} +1 -2
  148. package/resource/knowledge/livekit/core-sdk/voice/flutter/{voice-integration.md → integration.md} +6 -9
  149. package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-co-guest-interaction.md → co-guest-interaction.md} +2 -2
  150. package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-host-interaction.md → host-interaction.md} +4 -6
  151. package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-integration.md → integration.md} +1 -4
  152. package/resource/knowledge/livekit/preset/live/vue/features/barrage.md +0 -2
  153. package/resource/knowledge/push/api-reference/android.md +123 -0
  154. package/resource/knowledge/push/api-reference/flutter.md +176 -0
  155. package/resource/knowledge/push/api-reference/harmonyos.md +138 -0
  156. package/resource/knowledge/push/api-reference/ios.md +176 -0
  157. package/resource/knowledge/push/api-reference/react-native.md +147 -0
  158. package/resource/knowledge/push/api-reference/uni-app.md +147 -0
  159. package/resource/knowledge/push/api-reference/unity.md +119 -0
  160. package/resource/knowledge/push/api-reference/unreal-engine.md +123 -0
  161. package/resource/knowledge/push/config/android.md +4 -7
  162. package/resource/knowledge/push/config/harmonyos.md +0 -3
  163. package/resource/knowledge/push/config/ios.md +12 -20
  164. package/resource/knowledge/push/config/react-native.md +18 -26
  165. package/resource/knowledge/push/config/unity.md +20 -28
  166. package/resource/knowledge/push/config/unreal-engine.md +21 -29
  167. package/resource/knowledge/push/integration/android.md +6 -8
  168. package/resource/knowledge/push/integration/flutter.md +6 -9
  169. package/resource/knowledge/push/integration/harmonyos.md +1 -0
  170. package/resource/knowledge/push/integration/ios.md +7 -9
  171. package/resource/knowledge/push/integration/react-native.md +9 -13
  172. package/resource/knowledge/push/integration/uni-app.md +7 -7
  173. package/resource/knowledge/push/integration/unity.md +10 -13
  174. package/resource/knowledge/push/integration/unreal-engine.md +6 -9
  175. package/resource/knowledge/push/overview/prepare.md +2 -2
  176. package/resource/knowledge/roomkit/core-sdk/android/call-user-to-room.md +3 -3
  177. package/resource/knowledge/roomkit/core-sdk/android/capability-matrix.md +46 -0
  178. package/resource/knowledge/roomkit/core-sdk/android/room-participant-state.md +1 -1
  179. package/resource/knowledge/roomkit/core-sdk/android/room-state.md +2 -2
  180. package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +6 -6
  181. package/resource/knowledge/roomkit/core-sdk/android/unsupported-features.md +79 -0
  182. package/resource/knowledge/roomkit/core-sdk/flutter/capability-matrix.md +46 -0
  183. package/resource/knowledge/roomkit/core-sdk/flutter/room-participant-state.md +1 -1
  184. package/resource/knowledge/roomkit/core-sdk/flutter/unsupported-features.md +79 -0
  185. package/resource/knowledge/roomkit/core-sdk/ios/capability-matrix.md +46 -0
  186. package/resource/knowledge/roomkit/core-sdk/ios/room-participant-state.md +1 -1
  187. package/resource/knowledge/roomkit/core-sdk/ios/unsupported-features.md +79 -0
  188. package/resource/knowledge/roomkit/preset/android/integration.md +5 -7
  189. package/resource/knowledge/roomkit/preset/flutter/integration.md +2 -7
  190. package/resource/knowledge/roomkit/preset/ios/integration.md +3 -9
  191. package/resource/knowledge/roomkit/preset/react/integration.md +12 -16
  192. package/resource/knowledge/trtc/android/TRTCCloud.md +154 -238
  193. package/resource/knowledge/trtc/android/TRTCCloudDef.md +133 -134
  194. package/resource/knowledge/trtc/android/TRTCCloudListener.md +86 -120
  195. package/resource/knowledge/trtc/android/TRTCStatistics.md +10 -10
  196. package/resource/knowledge/trtc/android/TXAudioEffectManager.md +10 -30
  197. package/resource/knowledge/trtc/android/TXBeautyManager.md +25 -25
  198. package/resource/knowledge/trtc/android/TXDeviceManager.md +2 -2
  199. package/resource/knowledge/trtc/android/TXLiteAVCode.md +12 -12
  200. package/resource/knowledge/trtc/c++/ITRTCCloud.md +166 -261
  201. package/resource/knowledge/trtc/c++/ITRTCStatistics.md +12 -12
  202. package/resource/knowledge/trtc/c++/ITXAudioEffectManager.md +10 -30
  203. package/resource/knowledge/trtc/c++/ITXDeviceManager.md +9 -11
  204. package/resource/knowledge/trtc/c++/TRTCCloudCallback.md +96 -130
  205. package/resource/knowledge/trtc/c++/TRTCTypeDef.md +122 -123
  206. package/resource/knowledge/trtc/c++/TXLiteAVCode.md +12 -12
  207. package/resource/knowledge/trtc/ios/TRTCCloud.md +168 -255
  208. package/resource/knowledge/trtc/ios/TRTCCloudDef.md +124 -125
  209. package/resource/knowledge/trtc/ios/TRTCCloudDelegate.md +89 -124
  210. package/resource/knowledge/trtc/ios/TRTCStatistics.md +10 -10
  211. package/resource/knowledge/trtc/ios/TXAudioEffectManager.md +9 -28
  212. package/resource/knowledge/trtc/ios/TXBeautyManager.md +25 -25
  213. package/resource/knowledge/trtc/ios/TXDeviceManager.md +9 -11
  214. package/resource/knowledge/trtc/ios/TXLiteAVCode.md +12 -12
  215. package/server.js +21 -21
  216. package/tools/common/finalize_answer.js +1 -1
  217. package/tools/common/present_framework_choice.js +2 -2
  218. package/tools/common/search_trtc_knowledge.js +3 -3
  219. package/tools/common/submit_feedback.js +1 -1
  220. package/tools/definitions/get_native_live_uikit_integration_def.js +61 -0
  221. package/tools/definitions/get_native_livekit_core_integration_def.js +3 -3
  222. package/tools/definitions/present_framework_choice_def.js +2 -2
  223. package/tools/definitions/search_trtc_knowledge_def.js +5 -5
  224. package/tools/index.js +2 -0
  225. package/tools/live/get_native_live_uikit_integration.js +69 -0
  226. package/tools/live/get_native_livekit_core_integration.js +6 -6
  227. package/utils/report-cls-client.js +1 -1
  228. package/utils/report-es-client.js +1 -1
  229. package/resource/knowledge/callkit/preset/web/api.md +0 -83
  230. package/resource/knowledge/livekit/core-sdk/live/android/live-audio-effect.md +0 -226
  231. package/resource/knowledge/livekit/core-sdk/live/android/live-live-list.md +0 -438
  232. package/resource/knowledge/livekit/core-sdk/live/flutter/live-barrage.md +0 -490
  233. package/resource/knowledge/livekit/core-sdk/live/flutter/live-live-list.md +0 -726
  234. package/resource/knowledge/livekit/core-sdk/live/ios/live-audience-list.md +0 -264
  235. package/resource/knowledge/livekit/core-sdk/live/ios/live-audio-effect.md +0 -216
  236. package/resource/knowledge/livekit/core-sdk/live/ios/live-gift.md +0 -407
  237. package/resource/knowledge/livekit/core-sdk/live/ios/live-live-list.md +0 -349
  238. package/resource/knowledge/livekit/core-sdk/voice/android/voice-audience-list.md +0 -269
  239. package/resource/knowledge/livekit/core-sdk/voice/android/voice-barrage.md +0 -456
  240. package/resource/knowledge/livekit/core-sdk/voice/android/voice-gift.md +0 -455
  241. package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audience-list.md +0 -260
  242. package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audio-effect.md +0 -598
  243. package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-gift.md +0 -424
  244. package/resource/knowledge/livekit/core-sdk/voice/ios/voice-barrage.md +0 -408
  245. /package/resource/knowledge/livekit/core-sdk/{live/android/live-audience-list.md → features/android/audience-list.md} +0 -0
  246. /package/resource/knowledge/livekit/core-sdk/{live/android/live-barrage.md → features/android/barrage.md} +0 -0
  247. /package/resource/knowledge/livekit/core-sdk/{live/android/live-base-beauty.md → features/android/base-beauty.md} +0 -0
  248. /package/resource/knowledge/livekit/core-sdk/{live/flutter/live-audience-list.md → features/flutter/audience-list.md} +0 -0
  249. /package/resource/knowledge/livekit/core-sdk/{live/flutter/live-base-beauty.md → features/flutter/base-beauty.md} +0 -0
  250. /package/resource/knowledge/livekit/core-sdk/{live/ios/live-barrage.md → features/ios/barrage.md} +0 -0
  251. /package/resource/knowledge/livekit/core-sdk/voice/android/{voice-co-guest-interaction.md → co-guest-interaction.md} +0 -0
@@ -1,456 +0,0 @@
1
- This document provides a comprehensive guide for iOS developers to quickly integrate a feature-rich, high-performance live chat overlay (barrage/danmaku) system into your live streaming application using the `BarrageStore` module from the **AtomicXCore** framework.
2
-
3
- ## Core Features
4
-
5
- `BarrageStore` delivers a complete barrage solution for your live streaming app. Core features include:
6
- - Receiving and displaying barrage messages in the live room.
7
-
8
- - Sending text barrage messages to interact with viewers.
9
-
10
- - Sending custom business barrage messages to support complex scenarios such as gifts and likes.
11
-
12
- - Inserting system tips into the local message list (for example, "Welcome XX to the live room").
13
-
14
- ## Core Concepts
15
-
16
- |**Core Concept**|**Type**|**Core Responsibility & Description**|
17
- |---------|---------|---------|
18
- |[Barrage](https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.barrage/-barrage/index.html)|data class|Represents a single barrage message. Contains sender info (sender), message content (textContent or data), and message type (messageType).|
19
- |[BarrageState](https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.barrage/-barrage-state/index.html)|data class|Represents the current state of the barrage module. The main property, messageList, is a StateFlow containing all barrage messages for the current live room, ordered chronologically. This serves as the UI data source.|
20
- |[BarrageStore](https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.barrage/-barrage-store/index.html)|abstract class|The main manager for barrage features. Use it to send messages (sendTextMessage, sendCustomMessage) and subscribe to barrage message updates via its state property.|
21
-
22
- ## Implementation
23
-
24
- ### Step 1: Component Integration
25
- - **Video Live Streaming**: Please refer to Quick Start to integrate AtomicXCore.
26
-
27
- - **Voice Chat Room**: Please refer to Quick Start to integrate AtomicXCore.
28
-
29
- ### Step 2: Initialize and Listen to Barrages
30
-
31
- Create a `BarrageStore` instance bound to the current live room's `liveId`, and subscribe to receive the latest barrage message list in real time.
32
- ``` kotlin
33
- import kotlinx.coroutines.*
34
- import kotlinx.coroutines.flow.*
35
- import io.trtc.tuikit.atomicxcore.api.barrage.Barrage
36
- import io.trtc.tuikit.atomicxcore.api.barrage.BarrageStore
37
-
38
- class BarrageManager(
39
- private val liveId: String
40
- ) {
41
- private val barrageStore: BarrageStore = BarrageStore.create(liveId)
42
- private val scope = CoroutineScope(Dispatchers.Main)
43
-
44
- // Expose the [full] message list as a Flow for the UI layer to subscribe to
45
- private val _messagesFlow = MutableStateFlow<List<Barrage>>(emptyList())
46
- val messagesFlow: StateFlow<List<Barrage>> = _messagesFlow.asStateFlow()
47
-
48
- init {
49
- // Start listening for barrage messages immediately after initialization
50
- subscribeToBarrageUpdates()
51
- }
52
-
53
- private fun subscribeToBarrageUpdates() {
54
- scope.launch {
55
- barrageStore.barrageState.messageList
56
- .collect { messageList ->
57
- // When messageList updates, pass the new list to the UI layer via Flow
58
- // Note: This is the [complete list], including all historical messages
59
- _messagesFlow.value = messageList
60
- }
61
- }
62
- }
63
- }
64
- ```
65
-
66
- ### Step 3: Send Text Barrages
67
-
68
- Use `sendTextMessage` to broadcast a plain text message to all users in the live room.
69
- ``` kotlin
70
- import io.trtc.tuikit.atomicxcore.api.CompletionHandler
71
- import io.trtc.tuikit.atomicxcore.api.barrage.BarrageStore
72
-
73
- class BarrageManager(
74
- private val liveId: String
75
- ) {
76
- private val barrageStore: BarrageStore = BarrageStore.create(liveId)
77
-
78
- // Send a text barrage
79
- fun sendTextMessage(text: String) {
80
- // We recommend adding a non-empty check to avoid sending invalid messages
81
- if (text.isEmpty()) {
82
- return
83
- }
84
-
85
- // Call the core API to send the message
86
- barrageStore.sendTextMessage(
87
- text,
88
- mapOf(
89
- "custom key" to "custom value",
90
- ),
91
- object : CompletionHandler {
92
- override fun onSuccess() {
93
- println("Text barrage '$text' sent successfully")
94
- }
95
-
96
- override fun onFailure(code: Int, desc: String) {
97
- println("Failed to send text barrage: $desc")
98
- }
99
- }
100
- )
101
- }
102
- }
103
- ```
104
-
105
- #### API Parameters
106
-
107
- |**Parameter**|**Type**|**Description**|
108
- |---------|---------|---------|
109
- |`text`|`String?`|The text content to send.|
110
- |`extensionInfo`|`Map<String, String>?`|Additional data for business customization.|
111
- |`completion`|`CompletionHandler?`|Callback invoked after sending, indicating success or failure.|
112
-
113
- ### Step 4: Send Custom Barrage
114
-
115
- Send messages with custom business logic, such as gifts, likes, or gamification commands. The content format of this message is defined by the business layer. The receiver must parse and handle it based on the `businessId` and `data`.
116
- ``` kotlin
117
- class BarrageManager(
118
- private val liveId: String
119
- ) {
120
- // Send a custom barrage, for example, to send a gift
121
- fun sendGiftMessage(giftId: String, giftCount: Int) {
122
- // 1. Define a business-recognizable ID
123
- val businessId = "live_gift"
124
-
125
- // 2. Encode business data as a JSON string
126
- val giftData = mapOf(
127
- "gift_id" to giftId,
128
- "gift_count" to giftCount
129
- )
130
-
131
- val jsonString = try {
132
- // Use Gson or another JSON library for serialization
133
- // Here we assume Gson is used
134
- Gson().toJson(giftData)
135
- } catch (e: Exception) {
136
- return
137
- }
138
-
139
- // 3. Call the core API to send the custom message
140
- barrageStore.sendCustomMessage(
141
- businessId,
142
- jsonString,
143
- object : CompletionHandler {
144
- override fun onSuccess() {
145
- println("Gift message (custom barrage) sent successfully")
146
- }
147
-
148
- override fun onFailure(code: Int, desc: String) {
149
- println("Failed to send gift message: $desc")
150
- }
151
- }
152
- )
153
- }
154
- }
155
- ```
156
-
157
- #### API Parameters
158
-
159
- |**Parameter**|**Type**|**Description**|
160
- |---------|---------|---------|
161
- |businessId|String|Unique business identifier (e.g., "live_gift"). Used by receivers to distinguish custom messages.|
162
- |data|String|Business data, typically a JSON string.|
163
- |completion|CompletionHandler?|Callback after sending.|
164
-
165
- ### Step 5: Insert Local Tip Messages
166
-
167
- Insert a local message into the current user's message list. This message is not sent to other users and is ideal for displaying system prompts, warnings, or operation tips.
168
- ``` kotlin
169
- class BarrageManager(
170
- private val liveId: String
171
- ) {
172
- // Insert a welcome tip into the local message list
173
- fun showWelcomeMessage(user: LiveUserInfo) {
174
- // 1. Create a Barrage message
175
- val welcomeTip = Barrage(
176
- liveID = liveId,
177
- messageType = BarrageType.TEXT, // You can reuse the text type for display
178
- textContent = "Welcome ${user.userName} to the live room!",
179
- sender = LiveUserInfo() // sender can be left empty or set to a system user identifier
180
- )
181
-
182
- // 2. Call the API to append it to the local list
183
- barrageStore.appendLocalTip(welcomeTip)
184
- }
185
- }
186
- ```
187
-
188
- #### API Parameters
189
-
190
- |**Parameter**|**Type**|**Description**|
191
- |---------|---------|---------|
192
- |message|Barrage|The message object to insert locally. The SDK appends this to messageList in BarrageState.|
193
-
194
- ### Step 6: Manage User Speaking Permissions (Mute and Unmute)
195
-
196
- As a host or administrator, you can control user messaging permissions to maintain a healthy community environment.
197
-
198
- #### Mute/Unmute a Single User
199
-
200
- Use the `disableSendMessage` method in `LiveAudienceStore` to mute or unmute a user. This state persists even if the user rejoins the live room.
201
- ``` kotlin
202
- import io.trtc.tuikit.atomicxcore.api.*
203
- import io.trtc.tuikit.atomicxcore.api.live.LiveAudienceStore
204
-
205
- // 1. Get the LiveAudienceStore instance bound to the current live room
206
- val audienceStore = LiveAudienceStore.create(liveId)
207
-
208
- // 2. Define the user ID to operate on and the mute status
209
- val userIdToMute = "user_id_to_be_muted"
210
- val shouldDisable = true // true to mute, false to unmute
211
-
212
- // 3. Call the interface to perform the operation
213
- audienceStore.disableSendMessage(
214
- userIdToMute,
215
- shouldDisable,
216
- object : CompletionHandler {
217
- override fun onSuccess() {
218
- println("${if (shouldDisable) "Muted" else "Unmuted"} user $userIdToMute successfully")
219
- }
220
-
221
- override fun onFailure(code: Int, desc: String) {
222
- println("Operation failed: $desc")
223
- }
224
- }
225
- )
226
- ```
227
-
228
- #### Enable/Disable Global Mute
229
-
230
- To mute all users in the live room (usually excluding the host), update the live room information via `LiveListStore`.
231
- ``` kotlin
232
- import io.trtc.tuikit.atomicxcore.api.CompletionHandler
233
- import io.trtc.tuikit.atomicxcore.api.live.LiveInfo
234
- import io.trtc.tuikit.atomicxcore.api.live.LiveListStore
235
-
236
- // 1. Get the LiveListStore singleton
237
- val liveListStore = LiveListStore.shared()
238
-
239
- // 2. Get the current live room info and modify the global mute status
240
- val currentLiveInfo = liveListStore.liveState.currentLive.value.copy(
241
- isMessageDisable = true // true to enable global mute, false to disable
242
- )
243
-
244
- // 3. Call the update interface and specify the modification flag
245
- liveListStore.updateLiveInfo(
246
- currentLiveInfo,
247
- listOf(LiveInfo.ModifyFlag.IS_MESSAGE_DISABLE),
248
- object : CompletionHandler {
249
- override fun onSuccess() {
250
- println("Global mute status updated successfully")
251
- }
252
-
253
- override fun onFailure(code: Int, desc: String) {
254
- println("Operation failed: $desc")
255
- }
256
- }
257
- )
258
- ```
259
-
260
- ## Advanced Features: Performance Optimization in High-Concurrency Scenarios
261
-
262
- After implementing barrage features with `BarrageStore`, use the following strategies to ensure smooth and stable user experiences in high-concurrency live streaming scenarios. This section provides optimization strategies and code samples for three core business scenarios.
263
-
264
- ### Scenario 1: Handling "Barrage Storms" in Popular Live Rooms
265
-
266
- #### Scenario Description
267
-
268
- During popular events, a large number of viewers may flood into the live room, with barrages updating at dozens of messages per second.
269
-
270
- #### Technical Challenge
271
-
272
- The SDK returns the complete barrage list at a high frequency. If you call `adapter.notifyDataSetChanged()` on every update, the main thread may be blocked by intensive UI layout and rendering, causing UI lag.
273
-
274
- #### Optimization: Batch Processing & Debouncing
275
-
276
- Do not respond to every data update. Instead, set a time threshold (e.g., 300 ms). Only refresh the UI if the time since the last update exceeds this threshold. This reduces dozens of `notifyDataSetChanged()`calls per second to just 3–4, greatly improving smoothness.
277
-
278
- #### Code Example
279
-
280
- Create a `BarrageUIManager` class with a buffer and timer for batch updating data to the `RecyclerView`.
281
- ``` kotlin
282
- import android.os.Handler
283
- import androidx.recyclerview.widget.RecyclerView
284
- import io.trtc.tuikit.atomicxcore.api.barrage.Barrage
285
-
286
- private const val UPDATE_DURATION_MS = 300L
287
-
288
- class BarrageUIManager() {
289
- private var timestampOnLastUpdate = 0L
290
-
291
- private var dataSource: ArrayList<Barrage> = ArrayList()
292
- private val updateViewTask = Runnable { notifyDataSetChanged() }
293
- private val handler = Handler()
294
- private val adapter = BarrageAdapter(dataSource)
295
-
296
- // This method is called frequently from outside, passing in the latest full list
297
- fun update(newList: List<Barrage>) {
298
- handler.removeCallbacks(updateViewTask)
299
- dataSource.clear()
300
- dataSource.addAll(newList)
301
- // If the refresh interval is less than 0.3 seconds, do not refresh
302
- if (System.currentTimeMillis() - timestampOnLastUpdate < UPDATE_DURATION_MS) {
303
- handler.postDelayed(updateViewTask, UPDATE_DURATION_MS)
304
- return
305
- }
306
- }
307
-
308
- private fun notifyDataSetChanged() {
309
- adapter.notifyDataSetChanged()
310
- timestampOnLastUpdate = System.currentTimeMillis()
311
- }
312
- }
313
-
314
- class BarrageAdapter(dataSource: ArrayList<Barrage>): RecyclerView.Adapter<RecyclerView.ViewHolder>() {
315
- // Implement adapter capabilities here
316
- }
317
- ```
318
-
319
- ### Scenario 2: Ensuring Memory Stability for Long-Duration Live Streams
320
-
321
- #### Scenario Description
322
-
323
- Your app may need to support hours-long or even all-day continuous live streaming, such as game streaming or slow live streams. The app must remain stable and avoid crashes due to long-term operation.
324
-
325
- #### Technical Challenge
326
-
327
- The SDK returns a full `messageList` that grows indefinitely during long live streams. Even if the UI layer throttles updates, a large array in the data layer will continue consuming memory and may eventually cause the app to crash.
328
-
329
- #### Optimization: Circular Buffer with Fixed Capacity
330
-
331
- Ensure your data source holds only a limited number of messages. Regardless of the size of the full list returned by the SDK, only retain the latest portion for display.
332
-
333
- #### Code Example
334
-
335
- After receiving the full list from the SDK, take only the latest 500 messages (or another number you define) to update the UI.
336
- ``` kotlin
337
- class BarrageUIManager(
338
- private val recyclerView: RecyclerView
339
- ) {
340
- private val capacity: Int = 500 // Only retain the latest 500 messages
341
- // ... (other code as above) ...
342
-
343
- private fun refreshUIIfNeeded() {
344
- val fullList = this.latestMessageList ?: return
345
- val adapter = recyclerView.adapter ?: return
346
- this.latestMessageList = null
347
-
348
- // Only take the latest N messages
349
- val cappedList = fullList.takeLast(capacity)
350
-
351
- dataSource.clear()
352
- dataSource.addAll(cappedList)
353
- adapter.notifyDataSetChanged()
354
- }
355
- }
356
- ```
357
-
358
- ### Scenario 3: Rendering Complex Barrage Styles with User Levels and Badges
359
-
360
- #### Scenario Description
361
-
362
- To enhance the live streaming atmosphere and highlight paying users, barrage messages may include rich visual elements such as usernames, user level icons, fan badges, and message content.
363
-
364
- #### Technical Challenge
365
-
366
- Rendering views with multiple images and texts, custom fonts, or complex layouts is more time-consuming than rendering plain text. High-frequency rendering of these complex views in a list increases the main thread's workload, causing lag during list scrolling.
367
-
368
- #### Optimization: Asynchronous Drawing
369
-
370
- Move the view rendering process off the main thread and onto a background thread. The main thread should only handle the final display of the already rendered bitmap, significantly reducing its computational load.
371
-
372
- #### Code Example
373
-
374
- In your custom `RecyclerView.ViewHolder`, use `AsyncLayoutInflater` or a preloading mechanism to perform rendering tasks on a background thread whenever possible.
375
- ``` kotlin
376
- import android.view.LayoutInflater
377
- import androidx.asynclayoutinflater.view.AsyncLayoutInflater
378
- import androidx.recyclerview.widget.RecyclerView
379
-
380
- // In your custom Barrage ViewHolder
381
- class BarrageViewHolder(
382
- itemView: View
383
- ) : RecyclerView.ViewHolder(itemView) {
384
-
385
- // ... (Declarations for TextView, ImageView, etc.)
386
-
387
- companion object {
388
- fun create(parent: ViewGroup): BarrageViewHolder {
389
- // Use async layout inflater to reduce main thread blocking
390
- val inflater = AsyncLayoutInflater(parent.context)
391
- val view = LayoutInflater.from(parent.context)
392
- .inflate(R.layout.item_barrage, parent, false)
393
- return BarrageViewHolder(view)
394
- }
395
- }
396
-
397
- fun bind(viewModel: BarrageViewModel) {
398
- // Set your TextView text, ImageView images, etc. here
399
- // With async layout inflation, final rendering is done on a background thread whenever possible
400
- }
401
-
402
- // Advanced performance optimization: fully manual drawing
403
- // For finer control, use Canvas to manually draw text and images
404
- // Generate the Bitmap on a background thread, then draw it in the main thread's onDraw method for fully asynchronous rendering
405
- }
406
- ```
407
-
408
- ## API Documentation
409
-
410
- For detailed information on all public interfaces, properties, methods of [BarrageStore](https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.barrage/-barrage-store/index.html) and its related classes, refer to the official API documentation included with the [AtomicXCore](https://tencent-rtc.github.io/TUIKit_Android/index.html) framework.
411
-
412
- ## FAQs
413
-
414
- ### In addition to basic text barrages, we also want to implement richer styles such as "colored barrages" and "gift barrages." How can we achieve this?
415
-
416
- You can implement these features using custom messages with `sendCustomMessage`.
417
-
418
- **Implementation Steps**
419
- 1. **Define the Data Structure**: Collaborate with your client and server teams to define the JSON structure for custom messages. For example, a colored barrage can be defined as:
420
-
421
- ``` json
422
- { "type": "colored_text", "text": "This is a colored bullet comment!", "color": "#FF5733" }
423
- ```
424
- 2. **Sender**: When sending, serialize this JSON structure to a string and send it via the `data` parameter of `sendCustomMessage`. The businessID can be set to a unique identifier for your use case, such as `barrage_style_v1`.
425
-
426
- 3. **Receiver**: Upon receiving a barrage message, check whether its messageType is `BarrageType.CUSTOM` and whether the `businessID` matches. If so, parse the data string (usually as JSON), and render your custom UI style based on the parsed data (such as `color`, `text`).
427
-
428
- ### If I call BarrageStore.create(liveID = "some_id") in different classes or files, will this create multiple instances and cause confusion?
429
-
430
- No. The internal mechanism of **AtomicXCore** ensures that as long as you pass in the same `liveID`, you always get the same `BarrageStore` instance for that live room. You do not need to manage singletons manually.
431
-
432
- ### Why can't I see the message I sent after calling sendTextMessage in the message list?
433
-
434
- **Troubleshooting steps:**
435
- 1. **Check the completion callback**: The `sendTextMessage` method provides a completion callback. Check whether the callback indicates success or failure. If it fails, the error message will indicate the problem (such as "You have been muted," "Network error," etc.).
436
-
437
- 2. **Confirm subscription timing**: Make sure you subscribe to `barrageStore.barrageState.messageList` after the live session for the corresponding `liveID` has started. If you start listening before joining the live room, you may miss some messages.
438
-
439
- 3. **Check liveID**: Ensure that the liveID used when creating the BarrageStore instance, joining the live room, and sending messages is exactly the same, including case sensitivity.
440
-
441
- 4. **Network issues**: Ensure the device's network connection is normal. Message sending depends on network connectivity.
442
-
443
- ### How can new viewers see historical barrage messages sent before they joined the live room?
444
-
445
- `AtomicXCore` supports retrieving historical chat messages, but you need to enable this feature in the **server console**. Once configured, the SDK handles everything automatically—no additional client code is required.
446
-
447
- #### **Step 1: Configure in the Live Console**
448
- 1. Log in to [**Console > Live > Configuration**](https://console.trtc.io/live/configuration), and select your target application at the top of the page.
449
-
450
- 2. On the Live Configuration page, select **View Past Messages**, and set Previous Messages Viewable to specify the number of messages (up to a maximum of 50) that new viewers can see.
451
-
452
- #### **Step 2: Automatic Retrieval on the Client Side**
453
-
454
- After completing the above configuration, **no changes are needed** in your client code.
455
-
456
- When a new user joins the live room, `AtomicXCore` automatically retrieves the configured number of historical chat messages in the background. These messages are delivered to the UI layer through the `BarrageState` subscription channel, just like real-time messages. Your application will receive and display these historical chat messages in the same way as live messages.