@tencentcloud/sdk-mcp 1.3.9 → 1.4.0

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 (510) hide show
  1. package/index.js +1 -1
  2. package/index.js.map +1 -1
  3. package/package.json +2 -2
  4. package/resource/doc/{tuicallkit/android/faq.md → callkit/faq/android-faq.md} +75 -308
  5. package/resource/doc/{tuicallkit/faq/common/error_code.md → callkit/faq/common/error-code.md} +2 -2
  6. package/resource/doc/{tuicallkit/flutter/faq.md → callkit/faq/flutter-faq.md} +83 -315
  7. package/resource/doc/{tuicallkit/iOS/faq.md → callkit/faq/ios-faq.md} +76 -313
  8. package/resource/doc/{tuicallkit/vue/faq.md → callkit/faq/web-faq.md} +78 -311
  9. package/resource/doc/callkit/preset/android/api.md +330 -0
  10. package/resource/doc/{tuicallkit → callkit/preset}/android/integration.md +63 -420
  11. package/resource/doc/callkit/preset/flutter/api.md +401 -0
  12. package/resource/doc/{tuicallkit → callkit/preset}/flutter/integration.md +53 -273
  13. package/resource/doc/callkit/preset/ios/api.md +282 -0
  14. package/resource/doc/{tuicallkit/iOS → callkit/preset/ios}/integration.md +39 -120
  15. package/resource/doc/callkit/preset/react/api.md +600 -0
  16. package/resource/doc/{tuicallkit → callkit/preset}/react/integration.md +6 -6
  17. package/resource/doc/callkit/preset/vue/api.md +600 -0
  18. package/resource/doc/{tuicallkit → callkit/preset}/vue/integration.md +5 -5
  19. package/resource/doc/{chatuikit → chatkit}/android/faq.md +29 -37
  20. package/resource/doc/{chatuikit → chatkit}/android/features/theme.md +22 -166
  21. package/resource/doc/{chatuikit → chatkit}/android/integration.md +30 -126
  22. package/resource/doc/chatkit/faq/android_sdk/client-api.md +280 -0
  23. package/resource/doc/{chatuikit → chatkit}/faq/common/product.md +4 -17
  24. package/resource/doc/{chatuikit → chatkit}/faq/common/server.md +1 -2
  25. package/resource/doc/chatkit/faq/flutter_sdk/client-api.md +183 -0
  26. package/resource/doc/{chatuikit → chatkit}/faq/flutter_sdk/faq.md +3 -3
  27. package/resource/doc/chatkit/faq/ios_sdk/client-api.md +279 -0
  28. package/resource/doc/{chatuikit → chatkit}/faq/web_sdk/error_code.md +1 -1
  29. package/resource/doc/{chatuikit → chatkit}/faq/web_sdk/faq.md +4 -4
  30. package/resource/doc/{chatuikit → chatkit}/flutter/features/theme.md +22 -166
  31. package/resource/doc/{chatuikit → chatkit}/flutter/integration.md +20 -95
  32. package/resource/doc/{chatuikit/iOS → chatkit/ios}/faq.md +29 -37
  33. package/resource/doc/{chatuikit/iOS → chatkit/ios}/features/theme.md +27 -176
  34. package/resource/doc/{chatuikit/iOS → chatkit/ios}/integration.md +78 -280
  35. package/resource/doc/{chatuikit/vue → chatkit/react}/components/avatar.md +0 -1
  36. package/resource/doc/{chatuikit → chatkit}/react/components/chat-header.md +7 -12
  37. package/resource/doc/{chatuikit → chatkit}/react/components/chat-setting.md +10 -17
  38. package/resource/doc/{chatuikit → chatkit}/react/components/chat.md +1 -1
  39. package/resource/doc/{chatuikit → chatkit}/react/components/component-list.md +0 -1
  40. package/resource/doc/{chatuikit → chatkit}/react/components/contact-list.md +122 -703
  41. package/resource/doc/chatkit/react/components/conversation-actions.md +174 -0
  42. package/resource/doc/chatkit/react/components/conversation-list.md +333 -0
  43. package/resource/doc/chatkit/react/components/conversation-preview.md +116 -0
  44. package/resource/doc/chatkit/react/components/conversation-search.md +57 -0
  45. package/resource/doc/{chatuikit → chatkit}/react/components/message-input.md +36 -186
  46. package/resource/doc/{chatuikit → chatkit}/react/components/message-list.md +21 -113
  47. package/resource/doc/chatkit/react/components/search.md +282 -0
  48. package/resource/doc/{chatuikit → chatkit}/react/components/tuikit.md +5 -26
  49. package/resource/doc/{chatuikit → chatkit}/react/integration.md +37 -104
  50. package/resource/doc/{chatuikit/react → chatkit/vue}/components/avatar.md +0 -1
  51. package/resource/doc/{chatuikit → chatkit}/vue/components/chat-header.md +7 -13
  52. package/resource/doc/{chatuikit → chatkit}/vue/components/chat-setting.md +13 -18
  53. package/resource/doc/{chatuikit → chatkit}/vue/components/chat.md +1 -2
  54. package/resource/doc/{chatuikit → chatkit}/vue/components/component-list.md +0 -1
  55. package/resource/doc/chatkit/vue/components/contact-list.md +271 -0
  56. package/resource/doc/chatkit/vue/components/conversation-actions.md +228 -0
  57. package/resource/doc/{chatuikit → chatkit}/vue/components/conversation-list.md +42 -316
  58. package/resource/doc/chatkit/vue/components/conversation-preview.md +213 -0
  59. package/resource/doc/chatkit/vue/components/conversation-search.md +50 -0
  60. package/resource/doc/{chatuikit → chatkit}/vue/components/message-input.md +1 -23
  61. package/resource/doc/{chatuikit → chatkit}/vue/components/message-list.md +23 -134
  62. package/resource/doc/{chatuikit → chatkit}/vue/components/search.md +73 -640
  63. package/resource/doc/chatkit/vue/components/tuikit.md +45 -0
  64. package/resource/doc/{chatuikit → chatkit}/vue/components/userpicker.md +4 -4
  65. package/resource/doc/{chatuikit → chatkit}/vue/faq.md +1 -1
  66. package/resource/doc/{chatuikit → chatkit}/vue/integration.md +53 -121
  67. package/resource/doc/livekit/core-sdk/live/android/api-reference/AudioEffectStore.md +283 -0
  68. package/resource/doc/livekit/core-sdk/live/android/api-reference/BarrageStore.md +148 -0
  69. package/resource/doc/livekit/core-sdk/live/android/api-reference/BattleStore.md +316 -0
  70. package/resource/doc/livekit/core-sdk/live/android/api-reference/CameraView.md +57 -0
  71. package/resource/doc/livekit/core-sdk/live/android/api-reference/CoGuestStore.md +419 -0
  72. package/resource/doc/livekit/core-sdk/live/android/api-reference/CoHostStore.md +325 -0
  73. package/resource/doc/livekit/core-sdk/live/android/api-reference/DeviceStore.md +436 -0
  74. package/resource/doc/livekit/core-sdk/live/android/api-reference/GiftStore.md +165 -0
  75. package/resource/doc/livekit/core-sdk/live/android/api-reference/LikeStore.md +49 -0
  76. package/resource/doc/livekit/core-sdk/live/android/api-reference/LiveAudienceStore.md +239 -0
  77. package/resource/doc/livekit/core-sdk/live/android/api-reference/LiveCoreView.md +74 -0
  78. package/resource/doc/livekit/core-sdk/live/android/api-reference/LiveSeatStore.md +417 -0
  79. package/resource/doc/livekit/core-sdk/live/android/api-reference/LoginStore.md +207 -0
  80. package/resource/doc/livekit/{live → core-sdk/live}/android/live-audience-list.md +17 -88
  81. package/resource/doc/livekit/{live → core-sdk/live}/android/live-audio-effect.md +34 -192
  82. package/resource/doc/livekit/{live → core-sdk/live}/android/live-barrage.md +26 -139
  83. package/resource/doc/livekit/{live → core-sdk/live}/android/live-base-beauty.md +16 -99
  84. package/resource/doc/livekit/{live → core-sdk/live}/android/live-co-guest-interaction.md +54 -161
  85. package/resource/doc/livekit/{live → core-sdk/live}/android/live-gift.md +75 -455
  86. package/resource/doc/livekit/{live → core-sdk/live}/android/live-host-interaction.md +91 -338
  87. package/resource/doc/livekit/{live → core-sdk/live}/android/live-integration.md +108 -492
  88. package/resource/doc/livekit/{live → core-sdk/live}/android/live-live-list.md +27 -165
  89. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/AudioEffectStore.md +279 -0
  90. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/BarrageStore.md +158 -0
  91. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/BaseBeautyStore.md +155 -0
  92. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/BattleStore.md +304 -0
  93. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/CoGuestStore.md +394 -0
  94. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/CoHostStore.md +303 -0
  95. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/DeviceStore.md +410 -0
  96. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/GiftStore.md +160 -0
  97. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/LikeStore.md +51 -0
  98. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/LiveAudienceStore.md +231 -0
  99. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/LiveCoreView.md +143 -0
  100. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/LiveSeatStore.md +375 -0
  101. package/resource/doc/livekit/core-sdk/live/flutter/api-reference/LoginStore.md +170 -0
  102. package/resource/doc/livekit/{live → core-sdk/live}/flutter/live-audience-list.md +13 -91
  103. package/resource/doc/livekit/{live → core-sdk/live}/flutter/live-audio-effect.md +34 -177
  104. package/resource/doc/livekit/{live → core-sdk/live}/flutter/live-barrage.md +18 -102
  105. package/resource/doc/livekit/{live → core-sdk/live}/flutter/live-base-beauty.md +24 -164
  106. package/resource/doc/livekit/{live → core-sdk/live}/flutter/live-co-guest-interaction.md +56 -161
  107. package/resource/doc/livekit/{live → core-sdk/live}/flutter/live-gift.md +66 -460
  108. package/resource/doc/livekit/{live → core-sdk/live}/flutter/live-host-interaction.md +117 -364
  109. package/resource/doc/livekit/{live → core-sdk/live}/flutter/live-integration.md +160 -543
  110. package/resource/doc/livekit/{live → core-sdk/live}/flutter/live-live-list.md +22 -161
  111. package/resource/doc/livekit/core-sdk/live/ios/api-reference/AudioEffectStore.md +287 -0
  112. package/resource/doc/livekit/core-sdk/live/ios/api-reference/BarrageStore.md +165 -0
  113. package/resource/doc/livekit/core-sdk/live/ios/api-reference/BaseBeautyStore.md +143 -0
  114. package/resource/doc/livekit/core-sdk/live/ios/api-reference/BattleStore.md +298 -0
  115. package/resource/doc/livekit/core-sdk/live/ios/api-reference/CoGuestStore.md +349 -0
  116. package/resource/doc/livekit/core-sdk/live/ios/api-reference/CoHostStore.md +297 -0
  117. package/resource/doc/livekit/core-sdk/live/ios/api-reference/DeviceStore.md +471 -0
  118. package/resource/doc/livekit/core-sdk/live/ios/api-reference/GiftStore.md +179 -0
  119. package/resource/doc/livekit/core-sdk/live/ios/api-reference/LikeStore.md +49 -0
  120. package/resource/doc/livekit/core-sdk/live/ios/api-reference/LiveAudienceStore.md +238 -0
  121. package/resource/doc/livekit/core-sdk/live/ios/api-reference/LiveCoreView.md +74 -0
  122. package/resource/doc/livekit/core-sdk/live/ios/api-reference/LiveSeatStore.md +412 -0
  123. package/resource/doc/livekit/core-sdk/live/ios/api-reference/LoginStore.md +173 -0
  124. package/resource/doc/livekit/{live → core-sdk/live}/ios/live-audience-list.md +23 -96
  125. package/resource/doc/livekit/{live → core-sdk/live}/ios/live-audio-effect.md +33 -195
  126. package/resource/doc/livekit/{live → core-sdk/live}/ios/live-barrage.md +35 -150
  127. package/resource/doc/livekit/{live → core-sdk/live}/ios/live-base-beauty.md +20 -105
  128. package/resource/doc/livekit/{live → core-sdk/live}/ios/live-co-guest-interaction.md +35 -140
  129. package/resource/doc/livekit/{live → core-sdk/live}/ios/live-gift.md +77 -457
  130. package/resource/doc/livekit/{live → core-sdk/live}/ios/live-host-interaction.md +70 -317
  131. package/resource/doc/livekit/{live → core-sdk/live}/ios/live-integration.md +90 -473
  132. package/resource/doc/livekit/{live → core-sdk/live}/ios/live-live-list.md +28 -163
  133. package/resource/doc/livekit/{voice → core-sdk/voice}/android/voice-audience-list.md +17 -88
  134. package/resource/doc/livekit/{voice → core-sdk/voice}/android/voice-audio-effect.md +34 -192
  135. package/resource/doc/livekit/{voice → core-sdk/voice}/android/voice-barrage.md +26 -139
  136. package/resource/doc/livekit/{voice → core-sdk/voice}/android/voice-co-guest-interaction.md +53 -262
  137. package/resource/doc/livekit/{voice → core-sdk/voice}/android/voice-gift.md +75 -455
  138. package/resource/doc/livekit/{voice → core-sdk/voice}/android/voice-host-interaction.md +60 -272
  139. package/resource/doc/livekit/{voice → core-sdk/voice}/android/voice-integration.md +63 -440
  140. package/resource/doc/livekit/{voice → core-sdk/voice}/android/voice-room-list.md +23 -151
  141. package/resource/doc/livekit/{voice → core-sdk/voice}/flutter/voice-audience-list.md +13 -91
  142. package/resource/doc/livekit/{voice → core-sdk/voice}/flutter/voice-audio-effect.md +34 -177
  143. package/resource/doc/livekit/{voice → core-sdk/voice}/flutter/voice-barrage.md +18 -102
  144. package/resource/doc/livekit/{voice → core-sdk/voice}/flutter/voice-co-guest-interaction.md +44 -201
  145. package/resource/doc/livekit/{voice → core-sdk/voice}/flutter/voice-gift.md +66 -460
  146. package/resource/doc/livekit/{voice → core-sdk/voice}/flutter/voice-integration.md +57 -419
  147. package/resource/doc/livekit/{voice → core-sdk/voice}/flutter/voice-room-list.md +24 -157
  148. package/resource/doc/livekit/{voice → core-sdk/voice}/ios/voice-audience-list.md +23 -96
  149. package/resource/doc/livekit/{voice → core-sdk/voice}/ios/voice-audio-effect.md +33 -195
  150. package/resource/doc/livekit/{voice → core-sdk/voice}/ios/voice-barrage.md +35 -150
  151. package/resource/doc/livekit/{voice → core-sdk/voice}/ios/voice-co-guest-interaction.md +45 -254
  152. package/resource/doc/livekit/{voice → core-sdk/voice}/ios/voice-gift.md +77 -457
  153. package/resource/doc/livekit/{voice → core-sdk/voice}/ios/voice-host-interaction.md +52 -261
  154. package/resource/doc/livekit/core-sdk/voice/ios/voice-integration.md +478 -0
  155. package/resource/doc/livekit/{voice → core-sdk/voice}/ios/voice-room-list.md +36 -167
  156. package/resource/doc/livekit/{voice → core-sdk/voice}/uni-app/voice-audience-list.md +15 -45
  157. package/resource/doc/livekit/{voice → core-sdk/voice}/uni-app/voice-audio-effect.md +23 -137
  158. package/resource/doc/livekit/{voice → core-sdk/voice}/uni-app/voice-barrage.md +25 -131
  159. package/resource/doc/livekit/{voice → core-sdk/voice}/uni-app/voice-co-guest-interaction.md +70 -366
  160. package/resource/doc/livekit/{voice → core-sdk/voice}/uni-app/voice-gift.md +70 -424
  161. package/resource/doc/livekit/core-sdk/voice/uni-app/voice-integration.md +323 -0
  162. package/resource/doc/livekit/{voice → core-sdk/voice}/uni-app/voice-room-list.md +24 -116
  163. package/resource/doc/livekit/faq/common/{error_code.md → error-code.md} +2 -3
  164. package/resource/doc/livekit/preset/live/vue/api-reference/index.md +780 -0
  165. package/resource/doc/livekit/preset/live/vue/components/barrage.md +291 -0
  166. package/resource/doc/livekit/{live → preset/live}/vue/components/co-guest-panel.md +9 -48
  167. package/resource/doc/livekit/{live → preset/live}/vue/components/live-audience-list.md +27 -145
  168. package/resource/doc/livekit/{live → preset/live}/vue/components/live-scene-panel.md +13 -76
  169. package/resource/doc/livekit/{live → preset/live}/vue/components/live-view.md +33 -224
  170. package/resource/doc/livekit/preset/live/vue/components/stream-mixer.md +211 -0
  171. package/resource/doc/livekit/preset/live/vue/faq.md +1 -0
  172. package/resource/doc/livekit/preset/live/vue/live-list-integration.md +244 -0
  173. package/resource/doc/livekit/preset/live/vue/live-player-desk-integration.md +301 -0
  174. package/resource/doc/livekit/preset/live/vue/live-player-h5-integration.md +307 -0
  175. package/resource/doc/livekit/preset/live/vue/live-pusher-integration.md +754 -0
  176. package/resource/doc/roomkit/android/features/call-user-to-room.md +234 -0
  177. package/resource/doc/roomkit/android/features/room-participant-state.md +850 -0
  178. package/resource/doc/roomkit/android/features/room-state.md +358 -0
  179. package/resource/doc/roomkit/android/features/schedule-room.md +336 -0
  180. package/resource/doc/roomkit/android/integration.md +433 -0
  181. package/resource/doc/roomkit/{common/error_code.md → faq/common/error-code.md} +1 -1
  182. package/resource/doc/roomkit/flutter/features/call-user-to-room.md +228 -0
  183. package/resource/doc/roomkit/flutter/features/room-participant-state.md +796 -0
  184. package/resource/doc/roomkit/flutter/features/room-state.md +324 -0
  185. package/resource/doc/roomkit/flutter/features/schedule-room.md +324 -0
  186. package/resource/doc/roomkit/flutter/integration.md +405 -0
  187. package/resource/doc/roomkit/ios/features/call-user-to-room.md +226 -0
  188. package/resource/doc/roomkit/ios/features/room-participant-state.md +821 -0
  189. package/resource/doc/roomkit/ios/features/room-state.md +320 -0
  190. package/resource/doc/roomkit/ios/features/schedule-room.md +318 -0
  191. package/resource/doc/roomkit/ios/integration.md +384 -0
  192. package/resource/doc/roomkit/vue/faq.md +1 -0
  193. package/resource/doc/roomkit/vue/features/call-user-to-room.md +17 -53
  194. package/resource/doc/roomkit/vue/features/device-detection.md +30 -48
  195. package/resource/doc/roomkit/vue/features/device-state.md +24 -44
  196. package/resource/doc/roomkit/vue/features/free-beauty-panel.md +13 -36
  197. package/resource/doc/roomkit/vue/features/room-chat.md +31 -89
  198. package/resource/doc/roomkit/vue/features/room-participant-state.md +28 -50
  199. package/resource/doc/roomkit/vue/features/room-state.md +25 -36
  200. package/resource/doc/roomkit/vue/features/room-view.md +30 -127
  201. package/resource/doc/roomkit/vue/features/schedule-room.md +9 -40
  202. package/resource/doc/roomkit/vue/features/screen-share.md +22 -90
  203. package/resource/doc/roomkit/vue/features/virtual-background.md +13 -34
  204. package/resource/doc/roomkit/vue/integration.md +21 -80
  205. package/resource/doc/rtcengine/faq/common/userSig.md +17 -141
  206. package/resource/doc/rtcengine/faq/web/web.md +15 -22
  207. package/resource/doc/rtcengine/web/api.md +17 -21
  208. package/resource/doc/rtcengine/web/how_to_integrated_web_sdk.md +4 -10
  209. package/resource/doc/rtcengine/web/how_to_run_web_sdk_demo.md +4 -8
  210. package/resource/doc/rtcengine/web/plugin/20-advanced-customized-capture-rendering.md +3 -3
  211. package/resource/doc/rtcengine/web/plugin/21-advanced-auto-play-policy.md +2 -3
  212. package/resource/doc/rtcengine/web/plugin/22-advanced-audio-mixer.md +6 -6
  213. package/resource/doc/rtcengine/web/plugin/23-advanced-support-detection.md +2 -2
  214. package/resource/doc/rtcengine/web/plugin/24-advanced-network-quality.md +2 -4
  215. package/resource/doc/rtcengine/web/plugin/25-advanced-device-change.md +1 -2
  216. package/resource/doc/rtcengine/web/plugin/26-advanced-publish-cdn-stream.md +2 -6
  217. package/resource/doc/rtcengine/web/plugin/27-advanced-small-stream.md +13 -14
  218. package/resource/doc/rtcengine/web/plugin/28-advanced-beauty.md +10 -90
  219. package/resource/doc/rtcengine/web/plugin/31-advanced-plugins-overview.md +5 -8
  220. package/resource/doc/rtcengine/web/plugin/34-advanced-proxy.md +31 -35
  221. package/resource/doc/rtcengine/web/plugin/35-advanced-ai-denoiser.md +0 -2
  222. package/resource/doc/rtcengine/web/plugin/36-advanced-virtual-background.md +7 -49
  223. package/resource/doc/rtcengine/web/plugin/37-advanced-voice-changer.md +1 -1
  224. package/resource/doc/rtcengine/web/plugin/39-advanced-video-decoder.md +0 -3
  225. package/resource/doc/rtcengine/web/plugin/40-advanced-video-mixer.md +20 -20
  226. package/resource/doc/rtcengine/web/plugin/41-advanced-small-stream-auto-switcher.md +1 -1
  227. package/resource/doc/rtcengine/web/plugin/42-advanced-realtime-transcriber.md +4 -4
  228. package/resource/doc/rtcengine/web/plugin/43-advanced-face-detection.md +3 -3
  229. package/resource/doc/trtc/C++/ITRTCCloud.md +718 -2847
  230. package/resource/doc/trtc/C++/ITRTCStatistics.md +53 -308
  231. package/resource/doc/trtc/C++/ITXAudioEffectManager.md +207 -1041
  232. package/resource/doc/trtc/C++/ITXDeviceManager.md +127 -768
  233. package/resource/doc/trtc/C++/TRTCCloudCallback.md +634 -2259
  234. package/resource/doc/trtc/C++/TRTCTypeDef.md +726 -3465
  235. package/resource/doc/trtc/C++/TXLiteAVCode.md +117 -916
  236. package/resource/doc/trtc/android/TRTCCloud.md +638 -2612
  237. package/resource/doc/trtc/android/TRTCCloudDef.md +769 -3697
  238. package/resource/doc/trtc/android/TRTCCloudListener.md +609 -2070
  239. package/resource/doc/trtc/android/TRTCStatistics.md +48 -278
  240. package/resource/doc/trtc/android/TXAudioEffectManager.md +207 -1049
  241. package/resource/doc/trtc/android/TXBeautyManager.md +127 -704
  242. package/resource/doc/trtc/android/TXDeviceManager.md +51 -318
  243. package/resource/doc/trtc/android/TXLiteAVCode.md +115 -900
  244. package/resource/doc/trtc/iOS/TRTCCloud.md +726 -2930
  245. package/resource/doc/trtc/iOS/TRTCCloudDelegate.md +580 -2099
  246. package/resource/doc/trtc/iOS/TRTCStatistics.md +48 -278
  247. package/resource/doc/trtc/iOS/TXAudioEffectManager.md +179 -896
  248. package/resource/doc/trtc/iOS/TXBeautyManager.md +128 -710
  249. package/resource/doc/trtc/iOS/TXDeviceManager.md +129 -772
  250. package/resource/doc/trtc/iOS/TXLiteAVCode.md +117 -915
  251. package/resource/doc/trtc/iOS/TXLiveSDKTypeDef.md +747 -3559
  252. package/server.js +1 -5
  253. package/server.js.map +1 -1
  254. package/tools/call/get_callkit_api.js +32 -0
  255. package/tools/call/get_callkit_api.js.map +1 -0
  256. package/tools/call/get_native_call_uikit_integration.js +34 -0
  257. package/tools/call/get_native_call_uikit_integration.js.map +1 -0
  258. package/tools/call/{get-web-call-integration.js → get_web_call_uikit_integration.js} +13 -8
  259. package/tools/call/get_web_call_uikit_integration.js.map +1 -0
  260. package/tools/chat/get_native_chat_uikit_feature_detail.js +34 -0
  261. package/tools/chat/get_native_chat_uikit_feature_detail.js.map +1 -0
  262. package/tools/chat/get_native_chat_uikit_integration.js +45 -0
  263. package/tools/chat/get_native_chat_uikit_integration.js.map +1 -0
  264. package/tools/chat/get_web_chat_uikit_component_detail.js +34 -0
  265. package/tools/chat/get_web_chat_uikit_component_detail.js.map +1 -0
  266. package/tools/chat/get_web_chat_uikit_integration.js +45 -0
  267. package/tools/chat/get_web_chat_uikit_integration.js.map +1 -0
  268. package/tools/common/get_faq.js +265 -0
  269. package/tools/common/get_faq.js.map +1 -0
  270. package/tools/common/{get-usersig.js → get_usersig.js} +6 -3
  271. package/tools/common/get_usersig.js.map +1 -0
  272. package/tools/common/present_framework_choice.js +63 -0
  273. package/tools/common/present_framework_choice.js.map +1 -0
  274. package/tools/definitions/get_callkit_api_def.js +28 -0
  275. package/tools/definitions/get_callkit_api_def.js.map +1 -0
  276. package/tools/definitions/get_faq_def.js +18 -19
  277. package/tools/definitions/get_faq_def.js.map +1 -1
  278. package/tools/definitions/get_native_call_uikit_integration_def.js +15 -34
  279. package/tools/definitions/get_native_call_uikit_integration_def.js.map +1 -1
  280. package/tools/definitions/get_native_chat_uikit_feature_detail_def.js +31 -0
  281. package/tools/definitions/get_native_chat_uikit_feature_detail_def.js.map +1 -0
  282. package/tools/definitions/get_native_chat_uikit_integration_def.js +16 -41
  283. package/tools/definitions/get_native_chat_uikit_integration_def.js.map +1 -1
  284. package/tools/definitions/get_native_livekit_core_features_def.js +33 -0
  285. package/tools/definitions/get_native_livekit_core_features_def.js.map +1 -0
  286. package/tools/definitions/get_native_livekit_core_integration_def.js +33 -0
  287. package/tools/definitions/get_native_livekit_core_integration_def.js.map +1 -0
  288. package/tools/definitions/get_native_trtc_sdk_docs_def.js +32 -0
  289. package/tools/definitions/get_native_trtc_sdk_docs_def.js.map +1 -0
  290. package/tools/definitions/get_usersig_def.js +17 -24
  291. package/tools/definitions/get_usersig_def.js.map +1 -1
  292. package/tools/definitions/get_web_call_uikit_integration_def.js +15 -7
  293. package/tools/definitions/get_web_call_uikit_integration_def.js.map +1 -1
  294. package/tools/definitions/get_web_chat_uikit_component_detail_def.js +17 -49
  295. package/tools/definitions/get_web_chat_uikit_component_detail_def.js.map +1 -1
  296. package/tools/definitions/get_web_chat_uikit_integration_def.js +16 -19
  297. package/tools/definitions/get_web_chat_uikit_integration_def.js.map +1 -1
  298. package/tools/definitions/get_web_live_uikit_integration_def.js +13 -18
  299. package/tools/definitions/get_web_live_uikit_integration_def.js.map +1 -1
  300. package/tools/definitions/get_web_livekit_api_def.js +27 -0
  301. package/tools/definitions/get_web_livekit_api_def.js.map +1 -0
  302. package/tools/definitions/get_web_livekit_component_detail_def.js +29 -0
  303. package/tools/definitions/get_web_livekit_component_detail_def.js.map +1 -0
  304. package/tools/definitions/get_web_room_uikit_integration_def.js +13 -46
  305. package/tools/definitions/get_web_room_uikit_integration_def.js.map +1 -1
  306. package/tools/definitions/get_web_roomkit_feature_detail_def.js +30 -0
  307. package/tools/definitions/get_web_roomkit_feature_detail_def.js.map +1 -0
  308. package/tools/definitions/get_web_trtc_sdk_api_def.js +25 -0
  309. package/tools/definitions/get_web_trtc_sdk_api_def.js.map +1 -0
  310. package/tools/definitions/get_web_trtc_sdk_integration_def.js +25 -0
  311. package/tools/definitions/get_web_trtc_sdk_integration_def.js.map +1 -0
  312. package/tools/definitions/get_web_trtc_sdk_plugin_def.js +25 -0
  313. package/tools/definitions/get_web_trtc_sdk_plugin_def.js.map +1 -0
  314. package/tools/definitions/present_framework_choice_def.js +23 -12
  315. package/tools/definitions/present_framework_choice_def.js.map +1 -1
  316. package/tools/index.js +47 -61
  317. package/tools/index.js.map +1 -1
  318. package/tools/live/get_native_livekit_core_features.js +65 -0
  319. package/tools/live/get_native_livekit_core_features.js.map +1 -0
  320. package/tools/live/get_native_livekit_core_integration.js +59 -0
  321. package/tools/live/get_native_livekit_core_integration.js.map +1 -0
  322. package/tools/live/get_web_live_uikit_integration.js +48 -0
  323. package/tools/live/get_web_live_uikit_integration.js.map +1 -0
  324. package/tools/live/get_web_livekit_api.js +32 -0
  325. package/tools/live/get_web_livekit_api.js.map +1 -0
  326. package/tools/live/get_web_livekit_component_detail.js +34 -0
  327. package/tools/live/get_web_livekit_component_detail.js.map +1 -0
  328. package/tools/room/{get-web-room-integration.js → get_web_room_uikit_integration.js} +13 -14
  329. package/tools/room/get_web_room_uikit_integration.js.map +1 -0
  330. package/tools/room/{get-web-room-feature-detail.js → get_web_roomkit_feature_detail.js} +30 -31
  331. package/tools/room/get_web_roomkit_feature_detail.js.map +1 -0
  332. package/tools/rtcengine/get_web_trtc_sdk_api.js +31 -0
  333. package/tools/rtcengine/get_web_trtc_sdk_api.js.map +1 -0
  334. package/tools/rtcengine/get_web_trtc_sdk_integration.js +31 -0
  335. package/tools/rtcengine/get_web_trtc_sdk_integration.js.map +1 -0
  336. package/tools/rtcengine/get_web_trtc_sdk_plugin.js +31 -0
  337. package/tools/rtcengine/get_web_trtc_sdk_plugin.js.map +1 -0
  338. package/tools/trtc/get_native_trtc_sdk_docs.js +73 -0
  339. package/tools/trtc/get_native_trtc_sdk_docs.js.map +1 -0
  340. package/utils/generate-structured-result.js +61 -17
  341. package/utils/generate-structured-result.js.map +1 -1
  342. package/utils/report-cls-client.js +12 -1
  343. package/utils/report-cls-client.js.map +1 -1
  344. package/utils/report-es-client.js +1 -1
  345. package/resource/doc/chatuikit/android/workflow.md +0 -713
  346. package/resource/doc/chatuikit/faq/android_sdk/client-api.md +0 -1376
  347. package/resource/doc/chatuikit/faq/flutter_sdk/client-api.md +0 -860
  348. package/resource/doc/chatuikit/faq/ios_sdk/client-api.md +0 -1371
  349. package/resource/doc/chatuikit/flutter/workflow.md +0 -816
  350. package/resource/doc/chatuikit/iOS/workflow.md +0 -0
  351. package/resource/doc/chatuikit/react/components/conversation-list.md +0 -765
  352. package/resource/doc/chatuikit/react/components/search.md +0 -885
  353. package/resource/doc/chatuikit/react/create-group.md +0 -22
  354. package/resource/doc/chatuikit/react/init.md +0 -25
  355. package/resource/doc/chatuikit/react/workflow.md +0 -254
  356. package/resource/doc/chatuikit/uniapp-app/faq.md +0 -0
  357. package/resource/doc/chatuikit/uniapp-app/integration.md +0 -619
  358. package/resource/doc/chatuikit/uniapp-app/workflow.md +0 -576
  359. package/resource/doc/chatuikit/vue/components/contact-list.md +0 -679
  360. package/resource/doc/chatuikit/vue/components/tuikit.md +0 -110
  361. package/resource/doc/chatuikit/vue/create-group.md +0 -26
  362. package/resource/doc/chatuikit/vue/init.md +0 -35
  363. package/resource/doc/chatuikit/vue/workflow.md +0 -395
  364. package/resource/doc/livekit/live/android/workflow.md +0 -322
  365. package/resource/doc/livekit/live/flutter/workflow.md +0 -353
  366. package/resource/doc/livekit/live/ios/workflow.md +0 -352
  367. package/resource/doc/livekit/live/vue/components/barrage.md +0 -615
  368. package/resource/doc/livekit/live/vue/components/stream-mixer.md +0 -442
  369. package/resource/doc/livekit/live/vue/faq.md +0 -0
  370. package/resource/doc/livekit/live/vue/live-list-integration.md +0 -195
  371. package/resource/doc/livekit/live/vue/live-player-desk-integration.md +0 -293
  372. package/resource/doc/livekit/live/vue/live-player-h5-integration.md +0 -381
  373. package/resource/doc/livekit/live/vue/live-pusher-integration.md +0 -598
  374. package/resource/doc/livekit/live/vue/states/live-state.md +0 -2656
  375. package/resource/doc/livekit/live/vue/workflow.md +0 -219
  376. package/resource/doc/livekit/voice/android/workflow.md +0 -333
  377. package/resource/doc/livekit/voice/flutter/workflow.md +0 -359
  378. package/resource/doc/livekit/voice/ios/voice-integration.md +0 -853
  379. package/resource/doc/livekit/voice/ios/workflow.md +0 -358
  380. package/resource/doc/livekit/voice/uni-app/voice-integration.md +0 -613
  381. package/resource/doc/livekit/voice/uni-app/workflow.md +0 -369
  382. package/resource/doc/native_live/android/V2TXLiveCode_api_android.md +0 -334
  383. package/resource/doc/native_live/android/V2TXLiveDef_api_android.md +0 -434
  384. package/resource/doc/native_live/android/V2TXLivePlayerObserver_api_android.md +0 -685
  385. package/resource/doc/native_live/android/V2TXLivePlayer_api_android.md +0 -712
  386. package/resource/doc/native_live/android/V2TXLivePremier_api_android.md +0 -284
  387. package/resource/doc/native_live/android/V2TXLivePusherObserver_api_android.md +0 -849
  388. package/resource/doc/native_live/android/V2TXLivePusher_api_android.md +0 -1046
  389. package/resource/doc/native_live/flutter/V2TXLiveCode_api_flutter.md +0 -460
  390. package/resource/doc/native_live/flutter/V2TXLiveDef_api_flutter.md +0 -558
  391. package/resource/doc/native_live/flutter/V2TXLivePlayerObserver_api_flutter.md +0 -879
  392. package/resource/doc/native_live/flutter/V2TXLivePlayer_api_flutter.md +0 -668
  393. package/resource/doc/native_live/flutter/V2TXLivePremier_api_flutter.md +0 -456
  394. package/resource/doc/native_live/flutter/V2TXLivePusherObserver_api_flutter.md +0 -332
  395. package/resource/doc/native_live/flutter/V2TXLivePusher_api_flutter.md +0 -748
  396. package/resource/doc/native_live/iOS/V2TXLiveCode_api_iOS.md +0 -328
  397. package/resource/doc/native_live/iOS/V2TXLiveDef_api_iOS.md +0 -505
  398. package/resource/doc/native_live/iOS/V2TXLivePlayerObserver_api_iOS.md +0 -507
  399. package/resource/doc/native_live/iOS/V2TXLivePlayer_api_iOS.md +0 -676
  400. package/resource/doc/native_live/iOS/V2TXLivePremier_api_iOS.md +0 -284
  401. package/resource/doc/native_live/iOS/V2TXLivePusherObserver_api_iOS.md +0 -820
  402. package/resource/doc/native_live/iOS/V2TXLivePusher_api_iOS.md +0 -1065
  403. package/resource/doc/roomkit/vue/features/workflow.md +0 -553
  404. package/resource/doc/roomkit/vue/workflow.md +0 -733
  405. package/resource/doc/tuicallkit/android/workflow.md +0 -432
  406. package/resource/doc/tuicallkit/faq/android_sdk/call-observer-api.md +0 -786
  407. package/resource/doc/tuicallkit/faq/android_sdk/callkit-api.md +0 -663
  408. package/resource/doc/tuicallkit/faq/flutter_sdk/call-define-api.md +0 -932
  409. package/resource/doc/tuicallkit/faq/flutter_sdk/call-observer-api.md +0 -926
  410. package/resource/doc/tuicallkit/faq/flutter_sdk/callkit-api.md +0 -452
  411. package/resource/doc/tuicallkit/faq/ios_sdk/call-observer-api.md +0 -779
  412. package/resource/doc/tuicallkit/faq/ios_sdk/callkit-api.md +0 -635
  413. package/resource/doc/tuicallkit/flutter/workflow.md +0 -331
  414. package/resource/doc/tuicallkit/react/api.md +0 -1512
  415. package/resource/doc/tuicallkit/react/faq.md +0 -986
  416. package/resource/doc/tuicallkit/vue/api.md +0 -1512
  417. package/tools/call/get-native-call-integration.js +0 -43
  418. package/tools/call/get-native-call-integration.js.map +0 -1
  419. package/tools/call/get-web-call-api.js +0 -27
  420. package/tools/call/get-web-call-api.js.map +0 -1
  421. package/tools/call/get-web-call-integration.js.map +0 -1
  422. package/tools/chat/get-native-chat-feature-detail.js +0 -30
  423. package/tools/chat/get-native-chat-feature-detail.js.map +0 -1
  424. package/tools/chat/get-native-chat-integration.js +0 -45
  425. package/tools/chat/get-native-chat-integration.js.map +0 -1
  426. package/tools/chat/get-web-chat-component-detail.js +0 -31
  427. package/tools/chat/get-web-chat-component-detail.js.map +0 -1
  428. package/tools/chat/get-web-chat-integration.js +0 -45
  429. package/tools/chat/get-web-chat-integration.js.map +0 -1
  430. package/tools/chat/get-web-chat-uikit-init.js +0 -28
  431. package/tools/chat/get-web-chat-uikit-init.js.map +0 -1
  432. package/tools/chat/get-web-create-group-doc.js +0 -28
  433. package/tools/chat/get-web-create-group-doc.js.map +0 -1
  434. package/tools/common/get-faq.js +0 -91
  435. package/tools/common/get-faq.js.map +0 -1
  436. package/tools/common/get-usersig.js.map +0 -1
  437. package/tools/common/present-framework-choice.js +0 -16
  438. package/tools/common/present-framework-choice.js.map +0 -1
  439. package/tools/common/present-scenario-choice.js +0 -16
  440. package/tools/common/present-scenario-choice.js.map +0 -1
  441. package/tools/common/record-prompt.js +0 -55
  442. package/tools/common/record-prompt.js.map +0 -1
  443. package/tools/common/record-result.js +0 -60
  444. package/tools/common/record-result.js.map +0 -1
  445. package/tools/definitions/get_native_chat_feature_detail_def.js +0 -32
  446. package/tools/definitions/get_native_chat_feature_detail_def.js.map +0 -1
  447. package/tools/definitions/get_native_live_api_def.js +0 -22
  448. package/tools/definitions/get_native_live_api_def.js.map +0 -1
  449. package/tools/definitions/get_native_live_uikit_extra_features_def.js +0 -109
  450. package/tools/definitions/get_native_live_uikit_extra_features_def.js.map +0 -1
  451. package/tools/definitions/get_native_live_uikit_integration_def.js +0 -75
  452. package/tools/definitions/get_native_live_uikit_integration_def.js.map +0 -1
  453. package/tools/definitions/get_native_live_uikit_interaction_def.js +0 -63
  454. package/tools/definitions/get_native_live_uikit_interaction_def.js.map +0 -1
  455. package/tools/definitions/get_trtc_native_api_def.js +0 -17
  456. package/tools/definitions/get_trtc_native_api_def.js.map +0 -1
  457. package/tools/definitions/get_web_call_uikit_api_def.js +0 -23
  458. package/tools/definitions/get_web_call_uikit_api_def.js.map +0 -1
  459. package/tools/definitions/get_web_chat_uikit_init_def.js +0 -23
  460. package/tools/definitions/get_web_chat_uikit_init_def.js.map +0 -1
  461. package/tools/definitions/get_web_create_group_doc_def.js +0 -18
  462. package/tools/definitions/get_web_create_group_doc_def.js.map +0 -1
  463. package/tools/definitions/get_web_live_state_detail_def.js +0 -19
  464. package/tools/definitions/get_web_live_state_detail_def.js.map +0 -1
  465. package/tools/definitions/get_web_live_uikit_component_detail_def.js +0 -27
  466. package/tools/definitions/get_web_live_uikit_component_detail_def.js.map +0 -1
  467. package/tools/definitions/get_web_room_feature_detail_def.js +0 -92
  468. package/tools/definitions/get_web_room_feature_detail_def.js.map +0 -1
  469. package/tools/definitions/present_scenario_choice_def.js +0 -53
  470. package/tools/definitions/present_scenario_choice_def.js.map +0 -1
  471. package/tools/definitions/record_prompt_def.js +0 -58
  472. package/tools/definitions/record_prompt_def.js.map +0 -1
  473. package/tools/definitions/record_result_def.js +0 -46
  474. package/tools/definitions/record_result_def.js.map +0 -1
  475. package/tools/live/get-native-live-uikit-integration.js +0 -177
  476. package/tools/live/get-native-live-uikit-integration.js.map +0 -1
  477. package/tools/live/get-web-live-component-detail.js +0 -31
  478. package/tools/live/get-web-live-component-detail.js.map +0 -1
  479. package/tools/live/get-web-live-state-detail.js +0 -31
  480. package/tools/live/get-web-live-state-detail.js.map +0 -1
  481. package/tools/live/get-web-live-uikit-integration.js +0 -52
  482. package/tools/live/get-web-live-uikit-integration.js.map +0 -1
  483. package/tools/live/get_native_live_uikit_extra_features.js +0 -105
  484. package/tools/live/get_native_live_uikit_extra_features.js.map +0 -1
  485. package/tools/live/get_native_live_uikit_interaction.js +0 -194
  486. package/tools/live/get_native_live_uikit_interaction.js.map +0 -1
  487. package/tools/native_live/get-native-live-api.js +0 -31
  488. package/tools/native_live/get-native-live-api.js.map +0 -1
  489. package/tools/room/get-web-room-feature-detail.js.map +0 -1
  490. package/tools/room/get-web-room-integration.js.map +0 -1
  491. package/tools/rtcengine/get-rtcengine-web-sdk-integration.js +0 -28
  492. package/tools/rtcengine/get-rtcengine-web-sdk-integration.js.map +0 -1
  493. package/tools/rtcengine/get-trtc-sdk-faq.js +0 -32
  494. package/tools/rtcengine/get-trtc-sdk-faq.js.map +0 -1
  495. package/tools/rtcengine/get-trtc-web-sdk-api.js +0 -28
  496. package/tools/rtcengine/get-trtc-web-sdk-api.js.map +0 -1
  497. package/tools/rtcengine/get-trtc-web-sdk-faq.js +0 -30
  498. package/tools/rtcengine/get-trtc-web-sdk-faq.js.map +0 -1
  499. package/tools/rtcengine/get-trtc-web-sdk-integration.js +0 -29
  500. package/tools/rtcengine/get-trtc-web-sdk-integration.js.map +0 -1
  501. package/tools/rtcengine/get-trtc-web-sdk-plugin.js +0 -45
  502. package/tools/rtcengine/get-trtc-web-sdk-plugin.js.map +0 -1
  503. package/tools/trtc/get-trtc-native-api.js +0 -31
  504. package/tools/trtc/get-trtc-native-api.js.map +0 -1
  505. package/utils/handle-component-name.js +0 -33
  506. package/utils/handle-component-name.js.map +0 -1
  507. /package/resource/doc/{rtcengine/web → callkit/core-sdk}/.gitkeep +0 -0
  508. /package/resource/doc/{chatuikit → chatkit}/faq/common/server_error_code.md +0 -0
  509. /package/resource/doc/{chatuikit → chatkit}/flutter/faq.md +0 -0
  510. /package/resource/doc/{chatuikit → chatkit}/react/faq.md +0 -0
@@ -0,0 +1,821 @@
1
+ `RoomParticipantStore` 是 `AtomicXCore` 中专用于房间参与者管理的模块。该模块为多人房间场景提供了核心能力,支持构建完整的成员管理体系。
2
+
3
+ ## 房间模式说明
4
+
5
+ 在开始使用成员管理功能之前,需要了解 `AtomicXCore` 中房间模块支持的两种房间模式,不同模式下的成员管理功能有所区别:
6
+ | **标准房间模式(Standard Room)** | **网络研讨会房间模式(Webinar Room)** |
7
+ | --- | --- |
8
+ | - **适用场景:**小型会议、团队协作、朋友聊天等。<br>- **成员特点:**所有成员都是参与者,可以自由开启/关闭音视频设备。<br>- **管理特点:**扁平化管理,房主可设置管理员进行协助管理。 | - **适用场景**:网络研讨会、在线培训等。<br>- **成员特点**:<br>- **嘉宾(Participants)**:可以开启音视频设备,参与互动。<br>- **观众(Audience)**:只能观看,无法开启音视频设备。<br>- **管理特点**:分层管理,支持观众与嘉宾身份转换。 |
9
+
10
+ ## 核心功能
11
+ - **获取参与者列表**:获取并展示当前房间内所有参与者信息(网络研讨会房间模式下,获取到的是嘉宾列表,嘉宾可以开启麦克风与其他嘉宾互动)。
12
+
13
+ - **获取观众列表:**网络研讨会房间模式下,获取观众列表信息。
14
+
15
+ - **搜索房间内成员:**搜索所在房间内的指定用户。
16
+
17
+ - **将观众提升为嘉宾:**网络研讨会房间模式下,可以将观众提升为嘉宾,提升为嘉宾的用户可以开启麦克风与其他房间内的嘉宾互动。
18
+
19
+ - **将嘉宾降级为观众:**网络研讨会房间模式下,可以将嘉宾降级为观众, 降级为观众的用户无法与房间内的嘉宾进行语音互动。
20
+
21
+ - **转移房主身份**:房主可以将房主身份转移给房间内任意一名参与者。
22
+
23
+ - **设置/撤销管理员**:房主可以设置参与者为管理员,同时也可撤销房间内的管理员。
24
+
25
+ - **将参与者移出房间**:房主或者管理员可以将房间内任意一名参与者移出房间。
26
+
27
+ - **更新参与者信息**:房间内所有人都可以更新自己的参与者信息。
28
+
29
+ - **音视频设备管理**:支持申请/邀请打开摄像头、麦克风,关闭远端摄像头、麦克风,以及房主和管理员设置全体静音,全体禁用摄像头功能。
30
+
31
+ ## 功能对比
32
+ | **功能** | **标准房间模式** | **网络研讨会房间模式** |
33
+ | --- | --- | --- |
34
+ | 获取参与者列表 | 获取所有房间成员 | 获取嘉宾列表 |
35
+ | 获取观众列表 | 不适用 | 获取观众列表 |
36
+ | 搜索房间内成员 | 支持 | 支持 |
37
+ | 将观众提升为嘉宾 | 不适用 | 支持 |
38
+ | 将嘉宾降级为观众 | 不适用 | 支持 |
39
+ | 转移房主身份 | 支持 | 支持 |
40
+ | 设置/撤销管理员 | 支持 | 支持 |
41
+ | 移出房间 | 支持 | 支持 |
42
+ | 更新参与者信息 | 支持 | 支持 |
43
+ | 音视频设备管理 | 支持 | 支持 |
44
+
45
+ ## 核心概念
46
+
47
+ 在开始集成之前,需要通过下表了解一下`RoomParticipantStore`相关的几个核心概念:
48
+ | **核心概念** | **类型** | **核心职责与描述** |
49
+ | --- | --- | --- |
50
+ | [RoomParticipant](https://tencent-rtc.github.io/TUIKit_iOS/documentation/atomicxcore/roomparticipant) | `struct` | 代表参与者的核心数据模型,封装了参与者的完整信息和状态管理能力。<br>**标准房间模式:**代表房间内的所有成员。<br>**网络研讨会房间模式:**代表嘉宾,可以开启/关闭麦克风。<br>核心功能包括:参与者基本信息管理(用户 ID 、用户名称、用户头像、房间内角色身份)、参与者设备状态管理(麦克风状态,摄像头状态,屏幕分享状态,消息状态)。 |
51
+ | [RoomParticipantState](https://tencent-rtc.github.io/TUIKit_iOS/documentation/atomicxcore/roomparticipantstate) | `struct` | 代表参与者状态管理的核心数据结构,负责维护房间内与参与者相关的状态信息。<br>核心属性:<br>- `participantList`**标准房间模式**存储所有房间成员,**网络研讨会房间模式**存储嘉宾列表。<br>- `participantListCursor`**标准房间模式**代表房间内所有成员列表的分页游标,**网络研讨会房间模式**代表房间内嘉宾列表的分页游标。<br>- `localParticipant`则代表自身所在房间内的参与者信息。 |
52
+ | [RoomParticipantEvent](https://tencent-rtc.github.io/TUIKit_iOS/documentation/atomicxcore/roomparticipantevent) | `enum` | 代表房间内和参与者相关的实时事件。主要事件分为三大类:参与者进退房事件、 参与者身份改变事件,参与者设备控制事件。 |
53
+ | [RoomParticipantStore](https://tencent-rtc.github.io/TUIKit_iOS/documentation/atomicxcore/roomparticipantstore) | `class` | 这是参与者控制相关的核心类。功能包含:控制房间内参与者音视频状态、执行参与者管理操作,并通过订阅其 `participantEventPublisher` 来接收实时事件。 |
54
+
55
+ ## 实现步骤
56
+
57
+ ### 步骤1:组件集成
58
+
59
+ 请参考 接入概览 集成 **AtomicXCore SDK**,并已完成 实现登录逻辑 部分的接入。
60
+
61
+ ### 步骤2:获取参与者列表
62
+
63
+ 在加入房间后,调用RoomParticipantStore的getParticipantList接口获取房间内参与者列表。
64
+ - **标准房间模式:**获取房间内所有成员列表。
65
+
66
+ - **网络研讨会房间模式:**获取房间内嘉宾列表。
67
+
68
+ ``` swift
69
+ import Foundation
70
+ import AtomicXCore
71
+
72
+ func getParticipantList() {
73
+ // 1. 业务逻辑说明
74
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
75
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
76
+
77
+ // 2. 首次获取参与者列表(从头开始)
78
+ // 支持分页加载,可以通过 cursor 参数实现增量获取
79
+ let initialCursor: String? = nil // nil 表示从第一页开始获取
80
+
81
+ participantStore.getParticipantList(cursor: initialCursor) { result in
82
+ switch result {
83
+ case .success(let participantInfo):
84
+ print("成功获取参与者列表,数量: \(participantInfo.0.count)")
85
+ case .failure(let error):
86
+ print("获取参与者列表失败 [错误码: \(error.code)]: \(error.message)")
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ ### 步骤3:获取观众列表
93
+
94
+ 网络研讨会房间模式下,可以通过调用`RoomParticipantStore`的`getAudienceList`接口获取房间内的观众列表。
95
+ ``` swift
96
+ import Foundation
97
+ import AtomicXCore
98
+
99
+ func getAudienceList() {
100
+ // 前提:需要先完成进房操作, 并且进房时 roomType 设置为 webinar 类型。
101
+ // 1. 业务逻辑说明
102
+ // 通过进房的roomID创建RoomParticipantStore实例
103
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
104
+
105
+ // 2. 首次获取观众列表(从头开始)
106
+ // 支持分页加载,可以通过 cursor 参数实现增量获取
107
+ let initialCursor: String? = nil // nil 表示从第一页开始获取
108
+
109
+ participantStore.getAudienceList(cursor: initialCursor) { result in
110
+ switch result {
111
+ case .success(let audienceInfo):
112
+ print("获取观众列表成功,观众数量: \(audienceInfo.0.count)")
113
+ case .failure(let error):
114
+ print("获取观众列表失败 [错误码: \(error.code)]: \(error.message)")
115
+ }
116
+ }
117
+ }
118
+ ```
119
+
120
+ ### 步骤4:搜索房间内成员
121
+
122
+ 进入房间成功后,可以通过调用`RoomParticipantStore`的`searchUsers`接口搜索房间内的成员。
123
+ ``` swift
124
+ import Foundation
125
+ import AtomicXCore
126
+
127
+ func searchUsers() {
128
+ // 前提:需要先完成进房操作。
129
+ // 1. 业务逻辑说明
130
+ // 通过进房的roomID创建RoomParticipantStore实例
131
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
132
+
133
+ // 2. 通过用户名称为关键字搜索房间内成员
134
+ let keyword = "userName"
135
+
136
+ participantStore.searchUsers(keyword: keyword) { result in
137
+ switch result {
138
+ case .success(let usersInfo):
139
+ print("搜索房间成员成功,成员数量: \(usersInfo.0.count)")
140
+ case .failure(let error):
141
+ print("搜索房间成员失败 [错误码: \(error.code)]: \(error.message)")
142
+ }
143
+ }
144
+ }
145
+ ```
146
+
147
+ ### 步骤5:将**观众提升为嘉宾**
148
+
149
+ 网络研讨会房间模式下,作为房主或管理员,调用`RoomParticipantStore`的`promoteAudienceToParticipant`接口可以将房间内的观众提升为嘉宾。
150
+ ``` swift
151
+ import Foundation
152
+ import AtomicXCore
153
+
154
+ func promoteAudienceToParticipant(userID: String) {
155
+ // 前提:需要先完成进房操作。
156
+ // 1. 业务逻辑说明
157
+ // 通过进房的 roomID 创建 RoomParticipantStore 实例
158
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
159
+
160
+ // 2. 调用 RoomParticipantStore 提升观众为参与者接口
161
+ // 注意:只有房主或管理员才有权限执行此操作。
162
+ participantStore.promoteAudienceToParticipant(userID: userID) { result in
163
+ switch result {
164
+ case .success():
165
+ print("提升为参与者成功")
166
+ case .failure(let error):
167
+ print("提升为参与者失败 [错误码: \(error.code)]: \(error.message)")
168
+ }
169
+ }
170
+ }
171
+ ```
172
+
173
+ 作为房间内成员订阅`RoomParticipantStore`的`participantEventPublisher`中的`onAudiencePromotedToParticipant`事件,被动接收观众提升为参与者的变化通知。
174
+ ``` swift
175
+ import Foundation
176
+ import AtomicXCore
177
+ import Combine
178
+
179
+ private var cancellableSet = Set<AnyCancellable>()
180
+
181
+ private func subscribeParticipantEvent() {
182
+ // 1. 业务逻辑说明
183
+ // 前提:需要先完成进房操作,通过进房的 roomID 创建 RoomParticipantStore 实例
184
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
185
+
186
+ // 2. 订阅参与者事件
187
+ // participantEventPublisher 会推送所有参与者相关的事件
188
+ participantStore.participantEventPublisher
189
+ .receive(on: DispatchQueue.main) // 确保在主线程处理 UI 逻辑
190
+ .sink { event in
191
+ switch event {
192
+ case .onAudiencePromotedToParticipant(userInfo: let userInfo):
193
+ print("观众被提升为参与者,userInfo: \(userInfo)")
194
+ default: break
195
+ }
196
+ }
197
+ .store(in: &cancellableSet)
198
+ }
199
+ ```
200
+
201
+ ### 步骤6:将**嘉宾降级为观众**
202
+
203
+ 网络研讨会房间模式下,作为房主或管理员,调用`RoomParticipantStore`的`demoteParticipantToAudience`接口可以将房间内的嘉宾降级为观众。
204
+ ``` swift
205
+ import Foundation
206
+ import AtomicXCore
207
+
208
+ func demoteParticipantToAudience(userID: String) {
209
+ // 前提:需要先完成进房操作。
210
+ // 1. 业务逻辑说明
211
+ // 通过进房的 roomID 创建 RoomParticipantStore 实例
212
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
213
+
214
+ // 2. 调用 RoomParticipantStore 降级参与者为观众接口
215
+ // 注意:只有房主或管理员才有权限执行此操作。
216
+ participantStore.demoteParticipantToAudience(userID: userID) { result in
217
+ switch result {
218
+ case .success():
219
+ print("降级为观众成功")
220
+ case .failure(let error):
221
+ print("降级为观众失败 [错误码: \(error.code)]: \(error.message)")
222
+ }
223
+ }
224
+ }
225
+ ```
226
+
227
+ 作为房间内成员订阅`RoomParticipantStore`的`participantEventPublisher`中的`onParticipantDemotedToAudience`事件,被动接收参与者降级为观众的变化通知。
228
+ ``` swift
229
+ import Foundation
230
+ import AtomicXCore
231
+ import Combine
232
+
233
+ private var cancellableSet = Set<AnyCancellable>()
234
+
235
+ private func subscribeParticipantEvent() {
236
+ // 1. 业务逻辑说明
237
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
238
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
239
+
240
+ // 1. 订阅参与者事件
241
+ // participantEventPublisher 会推送所有参与者相关的事件
242
+ participantStore.participantEventPublisher
243
+ .receive(on: DispatchQueue.main) // 确保在主线程处理 UI 逻辑
244
+ .sink { event in
245
+ switch event {
246
+ case .onParticipantDemotedToAudience(userInfo: let userInfo):
247
+ print("参与者被降级为观众,userInfo: \(userInfo)")
248
+ default: break
249
+ }
250
+ }
251
+ .store(in: &cancellableSet)
252
+ }
253
+ ```
254
+
255
+ ### 步骤7:转移房主身份
256
+
257
+ 作为房主调用`RoomParticipantStore`的`transferOwner`接口可以将房主身份直接转移给房间内任意一位参与者,转移后原房主身份将变为普通参与者,一个房间内有且仅有一名房主。
258
+ ``` swift
259
+ import Foundation
260
+ import AtomicXCore
261
+
262
+ func transferOwner(to userID: String) {
263
+ // 1. 业务逻辑说明
264
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
265
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
266
+
267
+ // 2. 调用 RoomParticipantStore 转移房主接口
268
+ // 注意:只有当前房主才有权限执行此操作,转移后原房主将变为普通用户
269
+ participantStore.transferOwner(userID: userID) { result in
270
+ switch result {
271
+ case .success():
272
+ print("房主权限转移成功,新房主: \(userID)")
273
+ case .failure(let error):
274
+ print("转移房主权限失败 [错误码: \(error.code)]: \(error.message)")
275
+ }
276
+ }
277
+ }
278
+ ```
279
+
280
+ 作为参与者订阅`RoomParticipantStore`的`participantEventPublisher`中的`onOwnerChanged`事件,被动接收房主变化通知。
281
+ ``` swift
282
+ import Foundation
283
+ import AtomicXCore
284
+ import Combine
285
+
286
+ private var cancellableSet = Set<AnyCancellable>()
287
+
288
+ private func subscribeParticipantEvent() {
289
+ // 1. 业务逻辑说明
290
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
291
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
292
+
293
+ // 1. 订阅参与者事件
294
+ // participantEventPublisher 会推送所有参与者相关的事件
295
+ participantStore.participantEventPublisher
296
+ .receive(on: DispatchQueue.main) // 确保在主线程处理 UI 逻辑
297
+ .sink { event in
298
+ switch event {
299
+ case .onOwnerChanged(let newOwner, let oldOwner):
300
+ print("房主变更通知,newOwner: \(newOwner), oldOwner: \(oldOwner)")
301
+ default: break
302
+ }
303
+ }
304
+ .store(in: &cancellableSet)
305
+ }
306
+ ```
307
+
308
+ ### 步骤8:设置/撤销管理员
309
+
310
+ 作为房主调用`RoomParticipantStore`的`setAdmin`接口,指定房间内任意一位参与者成为管理员,也可以将管理员身份撤销。
311
+ ``` swift
312
+ import Foundation
313
+ import AtomicXCore
314
+
315
+ // 业务逻辑说明
316
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
317
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
318
+
319
+ /// 设置用户为管理员
320
+ func setUserAsAdmin(userID: String) {
321
+ participantStore.setAdmin(userID: userID) { result in
322
+ switch result {
323
+ case .success:
324
+ print("成功设置用户 \(userID) 为管理员")
325
+ case .failure(let error):
326
+ print("设置管理员失败 [错误码: \(error.code)]: \(error.message)")
327
+ }
328
+ }
329
+ }
330
+
331
+ /// 撤销用户的管理员权限
332
+ func revokeUserAdmin(userID: String) {
333
+ participantStore.revokeAdmin(userID: userID) { result in
334
+ switch result {
335
+ case .success:
336
+ print("成功撤销用户 \(userID) 的管理员权限")
337
+ case .failure(let error):
338
+ print("撤销管理员失败 [错误码: \(error.code)]: \(error.message)")
339
+ }
340
+ }
341
+ }
342
+ ```
343
+
344
+ 作为参与者订阅`RoomParticipantStore`的`participantEventPublisher`中的`onAdminSet`和`onAdminRevoked`事件,被动接收参与者身份变化通知。
345
+ ``` swift
346
+ import Foundation
347
+ import AtomicXCore
348
+
349
+ // 业务逻辑说明
350
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
351
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
352
+ private var cancellableSet = Set<AnyCancellable>()
353
+
354
+ /// 订阅参与者相关事件
355
+ private func subscribeParticipantEvents() {
356
+ participantStore.participantEventPublisher
357
+ .receive(on: DispatchQueue.main) // 确保在主线程处理UI相关逻辑
358
+ .sink { event in
359
+ switch event {
360
+ case .onAdminSet(let userInfo):
361
+ print("设置管理员事件通知,userInfo: \(userInfo)")
362
+ case .onAdminRevoked(let userInfo):
363
+ print("撤销管理员事件通知,userInfo: \(userInfo)")
364
+ default: break
365
+ }
366
+ }
367
+ .store(in: &cancellableSet)
368
+ }
369
+ ```
370
+
371
+ ### 步骤9:**将参与者移出房间**
372
+
373
+ 作为房主和管理员调用`RoomParticipantStore`的`kickUser`可以将房间内参与者移出房间。
374
+ ``` swift
375
+ import Foundation
376
+ import AtomicXCore
377
+
378
+ // 业务逻辑说明
379
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
380
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
381
+
382
+ func kickUser(userID: String) {
383
+ // 1. 业务逻辑说明
384
+ // kickUser 接口用于将指定用户移出房间
385
+ // 注意:只有房主或管理员才有权限执行此操作
386
+ // 被移出的用户将立即离开房间,并收到相应的通知
387
+
388
+ // 2. 调用 RoomParticipantStore 移出用户接口
389
+ participantStore.kickUser(userID: userID) { result in
390
+ switch result {
391
+ case .success():
392
+ print("用户移出成功,被移出用户: \(userID)")
393
+ case .failure(let error):
394
+ print("移出用户失败 [错误码: \(error.code)]: \(error.message)")
395
+ }
396
+ }
397
+ }
398
+ ```
399
+
400
+ 作为参与者订阅`RoomParticipantStore`的`participantEventPublisher`中的`onKickedFromRoom`事件,被动接收参与者被移出房间通知。
401
+ ``` swift
402
+ import Foundation
403
+ import AtomicXCore
404
+ import Combine
405
+
406
+ // 业务逻辑说明
407
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
408
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
409
+ private var cancellableSet = Set<AnyCancellable>()
410
+
411
+ /// 订阅参与者相关事件
412
+ private func subscribeParticipantEvent() {
413
+ participantStore.participantEventPublisher
414
+ .receive(on: DispatchQueue.main) // 确保在主线程处理UI相关逻辑
415
+ .sink { event in
416
+ switch event {
417
+ case .onKickedFromRoom(let reason, let message):
418
+ print("已被移出房间,被移出原因:\(reason), 额外信息:\(message)")
419
+ default:
420
+ break
421
+ }
422
+ }
423
+ .store(in: &cancellableSet)
424
+ }
425
+ ```
426
+
427
+ ### 步骤10:更新参与者信息
428
+
429
+ 在加入房间后,调用`RoomParticipantStore`的`updateParticipantNameCard`、`updateParticipantMetaData`更新您在房间里的参与者信息,包含:参与者名片信息,参与者自定义信息。
430
+ ``` swift
431
+ import Foundation
432
+ import AtomicXCore
433
+
434
+ // 业务逻辑说明
435
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
436
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
437
+
438
+ func updateParticipantNameCard(userID: String, nameCard: String) {
439
+ // 1. 业务逻辑说明
440
+ // updateParticipantNameCard 接口用于更新指定参与者的名片信息
441
+ // 名片通常用于显示用户的自定义昵称或标识
442
+ // 注意:通常只有管理员或用户本人才能修改名片
443
+
444
+ // 2. 调用 RoomParticipantStore 更新名片接口
445
+ participantStore.updateParticipantNameCard(userID: userID, nameCard: nameCard) { result in
446
+ switch result {
447
+ case .success():
448
+ print("名片更新成功,用户: \(userID), 新名片: \(nameCard)")
449
+ case .failure(let error):
450
+ print("名片更新失败 [错误码: \(error.code)]: \(error.message)")
451
+ }
452
+ }
453
+ }
454
+
455
+ func updateParticipantMetaData(userID: String, metaData: [String: String]) {
456
+ // 1. 业务逻辑说明
457
+ // updateParticipantMetaData 接口用于更新指定参与者的自定义信息
458
+ // 存储自定义的业务数据,如用户标签、扩展属性等
459
+ // 注意:自定义信息的键值对数量和大小有限制,键长度不能超过 50 字节,值长度不超过 200 字节
460
+
461
+ // 2. 调用 RoomParticipantStore 更新自定义信息接口
462
+ participantStore.updateParticipantMetaData(userID: userID, metaData: metaData) { result in
463
+ switch result {
464
+ case .success():
465
+ print("自定义信息数据更新成功,用户: \(userID), 键数量: \(metaData.count)")
466
+ case .failure(let error):
467
+ print("自定义信息更新失败 [错误码: \(error.code)]: \(error.message)")
468
+ }
469
+ }
470
+ }
471
+ ```
472
+
473
+ ### 步骤11:邀请参与者打开其设备
474
+
475
+ 作为房主和管理员调用`RoomParticipantStore`的`inviteToOpenDevice`接口,邀请房间内参与者打开摄像头、麦克风。
476
+ ``` swift
477
+ import Foundation
478
+ import AtomicXCore
479
+
480
+ // 业务逻辑说明
481
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
482
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
483
+
484
+ func inviteUserToOpenDevice(userID: String, device: DeviceType, timeout: Int = 30) {
485
+ // 1. 业务逻辑说明
486
+ // inviteToOpenDevice 接口用于邀请指定用户开启某个设备
487
+ // 通常用于管理员邀请参与者开启麦克风、摄像头或屏幕共享
488
+ // 被邀请的用户会收到邀请通知,可以选择接受或拒绝
489
+
490
+ // 2. 调用 RoomParticipantStore 邀请开启设备接口
491
+ participantStore.inviteToOpenDevice(userID: userID, device: device, timeout: timeout) { result in
492
+ switch result {
493
+ case .success():
494
+ print("设备邀请发送成功,用户: \(userID), 设备: \(device)")
495
+
496
+ case .failure(let error):
497
+ print("设备邀请发送失败 [错误码: \(error.code)]: \(error.message)")
498
+ }
499
+ }
500
+ }
501
+ ```
502
+
503
+ 作为参与者:
504
+ - 订阅`RoomParticipantStore`的`participantEventPublisher`中的`onDeviceInvitationReceived`事件,被动接收邀请打开设备通知。
505
+
506
+ - 接收到邀请打开设备通知后调用`RoomParticipantStore`的`acceptOpenDeviceInvitation`或者`declineOpenDeviceInvitation`接口接受或拒绝邀请。
507
+
508
+ ``` swift
509
+ import Foundation
510
+ import AtomicXCore
511
+ import Combine
512
+
513
+ // 业务逻辑说明
514
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
515
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
516
+ private var cancellableSet = Set<AnyCancellable>()
517
+
518
+ /// 订阅参与者相关事件
519
+ private func subscribeDeviceInvitationEvent() {
520
+ participantStore.participantEventPublisher
521
+ .receive(on: DispatchQueue.main) // 确保在主线程处理UI相关逻辑
522
+ .sink { event in
523
+ switch event {
524
+ case .onDeviceInvitationReceived(let invitation):
525
+ print("收到设备邀请 - 设备: \(invitation.device), 发送者: \(invitation.senderUserName)")
526
+ // 处理接受、拒绝设备邀请
527
+ default: break
528
+ }
529
+ }
530
+ .store(in: &cancellableSet)
531
+ }
532
+
533
+ func acceptOpenDeviceInvitation(userID: String, device: DeviceType) {
534
+ // 处理接受邀请
535
+ participantStore.acceptOpenDeviceInvitation(userID: userID, device: device) { result in
536
+ switch result {
537
+ case .success():
538
+ print("接受设备邀请成功 - 设备: \(device)")
539
+ case .failure(let error):
540
+ print("接受设备邀请失败 [错误码: \(error.code)]: \(error.message)")
541
+ }
542
+ }
543
+ }
544
+
545
+ func declineOpenDeviceInvitation(userID: String, device: DeviceType) {
546
+ // 处理拒绝邀请
547
+ participantStore.declineOpenDeviceInvitation(userID: userID, device: device) { result in
548
+ switch result {
549
+ case .success():
550
+ print("拒绝设备邀请成功 - 设备: \(device)")
551
+ case .failure(let error):
552
+ print("拒绝设备邀请失败 [错误码: \(error.code)]: \(error.message)")
553
+ }
554
+ }
555
+ }
556
+ ```
557
+
558
+ ### 步骤12:关闭远端参与者设备
559
+
560
+ 作为房主和管理员调用`RoomParticipantStore`的`closeParticipantDevice`可以主动关闭远端参与者的摄像头、麦克风。
561
+ ``` swift
562
+ import Foundation
563
+ import AtomicXCore
564
+
565
+ // 业务逻辑说明
566
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
567
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
568
+
569
+ func closeParticipantDevice(userID: String, device: DeviceType) {
570
+ // 1. 业务逻辑说明
571
+ // closeParticipantDevice 接口用于房主或管理员关闭指定参与者的某个设备
572
+ // 被关闭的用户会收到设备被关闭通知
573
+
574
+ // 2. 调用 RoomParticipantStore 关闭参与者设备接口
575
+ participantStore.closeParticipantDevice(userID: userID, device: device) { result in
576
+ switch result {
577
+ case .success():
578
+ print("关闭参与者设备成功 - 用户: \(userID), 设备: \(device)")
579
+ case .failure(let error):
580
+ print("关闭参与者设备失败: [错误码: \(error.code)]: \(error.message)")
581
+ }
582
+ }
583
+ }
584
+ ```
585
+
586
+ 作为参与者订阅`RoomParticipantStore`的`participantEventPublisher`中的`onParticipantDeviceClosed`事件,被动接收设备被关闭通知,并在UI上做出提示。
587
+ ``` swift
588
+ import Foundation
589
+ import AtomicXCore
590
+ import Combine
591
+
592
+ // 业务逻辑说明
593
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
594
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
595
+ private var cancellableSet = Set<AnyCancellable>()
596
+
597
+ /// 订阅参与者相关事件
598
+ private func subscribeDeviceClosedEvent() {
599
+ participantStore.participantEventPublisher
600
+ .receive(on: DispatchQueue.main) // 确保在主线程处理UI相关逻辑
601
+ .sink { event in
602
+ switch event {
603
+ case .onParticipantDeviceClosed(let device, let operatorUser):
604
+ print("设备被关闭 - 设备: \(device), 操作者: \(operatorUser.userName)")
605
+
606
+ default:
607
+ break
608
+ }
609
+ }
610
+ .store(in: &cancellableSet)
611
+ }
612
+ ```
613
+
614
+ ### 步骤13:参与者申请打开自己的设备
615
+
616
+ 作为参与者调用`RoomParticipantStore`的`requestToOpenDevice`接口,可以在房间被房主或管理员设置全体静音,全体禁用摄像头的场景下,主动申请打开摄像头、麦克风。
617
+ ``` swift
618
+ import Foundation
619
+ import AtomicXCore
620
+
621
+ // 业务逻辑说明
622
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
623
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
624
+
625
+ func requestToOpenDevice(device: DeviceType, timeout: Int = 30) {
626
+ // 1. 业务逻辑说明
627
+ // requestToOpenDevice 接口用于请求开启某个设备
628
+ // 通常用于参与者申请开启麦克风、摄像头或屏幕共享
629
+ // 房主和管理员会收到申请通知,可以选择同意或拒绝
630
+
631
+ // 2. 调用 RoomParticipantStore 请求开启设备接口
632
+ participantStore.requestToOpenDevice(device: device, timeout: timeout) { result in
633
+ switch result {
634
+ case .success():
635
+ print("设备开启请求发送成功 - 设备: \(device)")
636
+ case .failure(let error):
637
+ print("设备开启请求发送失败 [错误码: \(error.code)]: \(error.message)")
638
+ }
639
+ }
640
+ }
641
+ ```
642
+
643
+ 作为房主和管理员:
644
+ - 订阅`RoomParticipantStore`的`participantEventPublisher`中的`onDeviceRequestReceived`事件,被动接收申请打开设备通知。
645
+
646
+ - 接收到申请打开设备通知后,调用`RoomParticipantStore`的`approveOpenDeviceRequest`或者`rejectOpenDeviceRequest`接口,批准或者拒绝申请。
647
+
648
+ ``` swift
649
+ import Foundation
650
+ import AtomicXCore
651
+ import Combine
652
+
653
+ // 业务逻辑说明
654
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
655
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
656
+ private var cancellableSet = Set<AnyCancellable>()
657
+
658
+ /// 订阅参与者相关事件
659
+ private func subscribeDeviceRequestEvent() {
660
+ participantStore.participantEventPublisher
661
+ .receive(on: DispatchQueue.main) // 确保在主线程处理UI相关逻辑
662
+ .sink { event in
663
+ switch event {
664
+ case .onDeviceRequestReceived(let request):
665
+ print("收到设备请求 - 用户: \(request.senderUserName), 设备: \(request.device)")
666
+ // 批准、拒绝开启设备请求操作
667
+ default:
668
+ break
669
+ }
670
+ }
671
+ .store(in: &cancellableSet)
672
+ }
673
+
674
+ func approveOpenDeviceRequest(device: DeviceType, userID: String) {
675
+ // 批准开启请求
676
+ participantStore.approveOpenDeviceRequest(device: device, userID: userID) { result in
677
+ switch result {
678
+ case .success():
679
+ print("批准设备请求成功 - 用户: \(userID), 设备: \(device)")
680
+ case .failure(let error):
681
+ print("批准设备请求失败: \(error.message)")
682
+ }
683
+ }
684
+ }
685
+
686
+ func rejectOpenDeviceRequest(device: DeviceType, userID: String) {
687
+ // 拒绝开启请求
688
+ participantStore.rejectOpenDeviceRequest(device: device, userID: userID) { result in
689
+ switch result {
690
+ case .success():
691
+ print("拒绝设备请求成功 - 用户: \(userID), 设备: \(device)")
692
+ case .failure(let error):
693
+ print("拒绝设备请求失败: [错误码: \(error.code)]: \(error.message)")
694
+ }
695
+ }
696
+ }
697
+ ```
698
+
699
+ ### 步骤14:全体禁用麦克风及摄像头
700
+
701
+ 作为房主和管理员调用`RoomParticipantStore`的`disableAllDevices`接口设置全员静音与全员禁用摄像头。开启后,房间内参与者的音视频开启权限将被限制,无法自主打开麦克风或摄像头设备。
702
+ ``` swift
703
+ import Foundation
704
+ import AtomicXCore
705
+
706
+ // 业务逻辑说明
707
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
708
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
709
+
710
+ func disableAllDevices(device: DeviceType, disable: Bool) {
711
+ // 1. 业务逻辑说明
712
+ // disableAllDevices 接口用于房主或管理员设置房间禁用、解禁房间内全体成员麦克风,摄像头
713
+ // 设置后房间内参与者会收到禁用、解禁通知
714
+
715
+ // 2. 调用 RoomParticipantStore 禁用、解禁全体设备接口
716
+ participantStore.disableAllDevices(device: device, disable: disable) { result in
717
+ switch result {
718
+ case .success():
719
+ let action = disable ? "禁用" : "启用"
720
+ print("\(action)所有\(device)成功")
721
+
722
+ case .failure(let error):
723
+ let action = disable ? "禁用" : "启用"
724
+ print("\(action)所有\(device)失败 [错误码: \(error.code)]: \(error.message)")
725
+ }
726
+ }
727
+ }
728
+ ```
729
+
730
+ 作为参与者订阅 `RoomParticipantStore`的`participantEventPublisher`中的`onAllDevicesDisabled`事件,可以监听全员静音或禁用摄像头指令,并在 UI 界面同步受控状态。受限状态下,摄像头与麦克风的主动开启功能将被锁定,参与者需发起开启申请,待房主或管理员核准授权后方可使用。
731
+ ``` swift
732
+ import Foundation
733
+ import AtomicXCore
734
+ import Combine
735
+
736
+ // 业务逻辑说明
737
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
738
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
739
+ private var cancellableSet = Set<AnyCancellable>()
740
+
741
+ /// 设置全局设备事件监听
742
+ private func subscribeAllDevicesDisabledEvent() {
743
+ participantStore.participantEventPublisher
744
+ .receive(on: DispatchQueue.main) // 确保在主线程处理UI相关逻辑
745
+ .sink { event in
746
+ switch event {
747
+ case .onAllDevicesDisabled(let device, let disable, let operatorUser):
748
+ let action = disable ? "禁用" : "启用"
749
+ print("所有\(device)被\(action) - 操作者: \(operatorUser.userName)")
750
+ default:
751
+ break
752
+ }
753
+ }
754
+ .store(in: &cancellableSet)
755
+ }
756
+ ```
757
+
758
+ ### 步骤15:监听参与者事件
759
+
760
+ 订阅`RoomParticipantEvent`参与者相关的被动事件。以订阅参与者加入房间、离开房间为例,示例代码如下:
761
+ ``` swift
762
+ import Foundation
763
+ import AtomicXCore
764
+ import Combine
765
+
766
+ // 业务逻辑说明
767
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
768
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
769
+ private var cancellableSet = Set<AnyCancellable>()
770
+
771
+ /// 设置参与者事件监听
772
+ private func subscribeParticipantEvent() {
773
+ participantStore.participantEventPublisher
774
+ .receive(on: DispatchQueue.main) // 确保在主线程处理UI相关逻辑
775
+ .sink { event in
776
+ switch event {
777
+ case .onParticipantJoined(let participant):
778
+ print("参与者加入房间 - 用户: \(participant.userName), ID: \(participant.userID)")
779
+ case .onParticipantLeft(let participant):
780
+ print("参与者离开房间 - 用户: \(participant.userName), ID: \(participant.userID)")
781
+
782
+ default:
783
+ break
784
+ }
785
+ }
786
+ .store(in: &cancellableSet)
787
+ }
788
+ ```
789
+
790
+ 订阅 `RoomParticipantState` 与参与者相关的属性状态变化。以订阅房间内正在说话的用户为例,示例代码如下:
791
+ ``` swift
792
+ import Foundation
793
+ import AtomicXCore
794
+ import Combine
795
+
796
+ // 业务逻辑说明
797
+ // 前提:需要先完成进房操作,通过进房的roomID创建RoomParticipantStore实例
798
+ let participantStore = RoomParticipantStore.create(roomID: "your_room_id")
799
+ private var cancellableSet = Set<AnyCancellable>()
800
+
801
+ /// 设置参与者状态监听
802
+ private func subscribeParticipantState() {
803
+ participantStore.state
804
+ .subscribe(StatePublisherSelector(keyPath: \.speakingUsers))
805
+ .map { $0 }
806
+ .removeDuplicates { oldValue, newValue in
807
+ // 比较两个字典是否相同,避免重复处理
808
+ return oldValue == newValue
809
+ }
810
+ .receive(on: DispatchQueue.main)
811
+ .sink { speakingUsers in
812
+ print("说话用户状态变更 - 当前说话用户数: \(speakingUsers.count)")
813
+ }
814
+ .store(in: &cancellableSet)
815
+ }
816
+ ```
817
+
818
+ ## API 文档
819
+ | **Store/Component** | **功能描述** | **API文档** |
820
+ | --- | --- | --- |
821
+ | **RoomParticipantStore** | 房间内参与者管理:设置管理员 / 转移房主 / 获取参与者列表 / 移出房间 / 参与者设备控制(例如关闭、邀请打开摄像头、麦克风等)/ 申请打开设备(例如申请打开摄像头、麦克风等)。 | [API 文档](https://tencent-rtc.github.io/TUIKit_iOS/documentation/atomicxcore/roomparticipantstore) |