@tencentcloud/sdk-mcp 1.4.7 → 1.6.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +0 -1
- package/knowledge/bm25-cache.js +73 -0
- package/knowledge/bm25.js +147 -0
- package/knowledge/build-index.js +65 -0
- package/knowledge/chunker.js +167 -0
- package/knowledge/content-loader.js +44 -0
- package/knowledge/extractors.js +25 -0
- package/knowledge/path-meta.js +175 -0
- package/knowledge/search/exact-lookup.js +330 -0
- package/knowledge/search/filter-pool.js +86 -0
- package/knowledge/search/requires-framework.js +72 -0
- package/knowledge/search/search-knowledge.js +226 -0
- package/package.json +9 -9
- package/resource/_schema/feature-aliases.yaml +10 -0
- package/resource/_schema/goal-tags.yaml +72 -0
- package/resource/_schema/products.yaml +16 -0
- package/resource/_schema/trtc-intents.yaml +27 -0
- package/resource/_schema/types.yaml +44 -0
- package/resource/index/component-slugs.json +1 -0
- package/resource/index/manifest.json +1 -0
- package/resource/{doc → integration}/callkit/preset/android/integration.md +32 -28
- package/resource/{doc → integration}/callkit/preset/flutter/integration.md +109 -54
- package/resource/integration/callkit/preset/ios/integration.md +411 -0
- package/resource/integration/callkit/preset/react/integration.md +499 -0
- package/resource/integration/callkit/preset/vue/integration.md +768 -0
- package/resource/{doc/chatkit → integration/chat/preset}/android/integration.md +11 -11
- package/resource/{doc/chatkit → integration/chat/preset}/flutter/integration.md +59 -37
- package/resource/integration/chat/preset/ios/integration.md +568 -0
- package/resource/{doc/chatkit → integration/chat/preset}/react/integration.md +127 -95
- package/resource/integration/chat/preset/uni-app/integration.md +494 -0
- package/resource/{doc/chatkit → integration/chat/preset}/vue/integration.md +163 -143
- package/resource/{doc → integration}/livekit/preset/live/vue/live-list-integration.md +15 -15
- package/resource/{doc → integration}/livekit/preset/live/vue/live-player-desk-integration.md +25 -13
- package/resource/{doc → integration}/livekit/preset/live/vue/live-player-h5-integration.md +15 -9
- package/resource/{doc → integration}/livekit/preset/live/vue/live-pusher-integration.md +31 -26
- package/resource/integration/roomkit/preset/vue/integration.md +571 -0
- package/resource/knowledge/callkit/core-sdk/android/answer-call.md +852 -0
- package/resource/knowledge/callkit/core-sdk/android/make-call.md +929 -0
- package/resource/knowledge/callkit/core-sdk/android/offline-push.md +364 -0
- package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +1150 -0
- package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +1216 -0
- package/resource/knowledge/callkit/core-sdk/flutter/offline-push.md +412 -0
- package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +1191 -0
- package/resource/knowledge/callkit/core-sdk/ios/make-call.md +1292 -0
- package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +537 -0
- package/resource/knowledge/callkit/core-sdk/uni-app/answer-call.md +953 -0
- package/resource/knowledge/callkit/core-sdk/uni-app/make-call.md +1061 -0
- package/resource/knowledge/callkit/faq/android.md +168 -0
- package/resource/knowledge/callkit/faq/common.md +180 -0
- package/resource/knowledge/callkit/faq/flutter.md +52 -0
- package/resource/knowledge/callkit/faq/ios.md +116 -0
- package/resource/knowledge/callkit/faq/uniapp-app.md +89 -0
- package/resource/knowledge/callkit/faq/uniapp-miniprogram.md +217 -0
- package/resource/knowledge/callkit/faq/web.md +363 -0
- package/resource/knowledge/callkit/preset/android/api.md +413 -0
- package/resource/knowledge/callkit/preset/flutter/api.md +22 -0
- package/resource/knowledge/callkit/preset/ios/api.md +256 -0
- package/resource/knowledge/callkit/preset/web/api.md +79 -0
- package/resource/knowledge/chat/preset/android/features/chat-setting.md +72 -0
- package/resource/knowledge/chat/preset/android/features/contact-list.md +41 -0
- package/resource/knowledge/chat/preset/android/features/conversation-list.md +123 -0
- package/resource/knowledge/chat/preset/android/features/language.md +142 -0
- package/resource/knowledge/chat/preset/android/features/message-input.md +57 -0
- package/resource/knowledge/chat/preset/android/features/message-list.md +142 -0
- package/resource/knowledge/chat/preset/android/features/search.md +64 -0
- package/resource/{doc/chatkit → knowledge/chat/preset}/android/features/theme.md +21 -18
- package/resource/knowledge/chat/preset/android-view/integration.md +448 -0
- package/resource/knowledge/chat/preset/flutter/features/chat-setting.md +62 -0
- package/resource/knowledge/chat/preset/flutter/features/contact-list.md +40 -0
- package/resource/knowledge/chat/preset/flutter/features/conversation-list.md +129 -0
- package/resource/knowledge/chat/preset/flutter/features/language.md +104 -0
- package/resource/knowledge/chat/preset/flutter/features/message-input.md +54 -0
- package/resource/knowledge/chat/preset/flutter/features/message-list.md +163 -0
- package/resource/knowledge/chat/preset/flutter/features/search.md +59 -0
- package/resource/{doc/chatkit → knowledge/chat/preset}/flutter/features/theme.md +47 -19
- package/resource/knowledge/chat/preset/ios/features/chat-setting.md +92 -0
- package/resource/knowledge/chat/preset/ios/features/contact-list.md +119 -0
- package/resource/knowledge/chat/preset/ios/features/conversation-list.md +134 -0
- package/resource/knowledge/chat/preset/ios/features/language.md +105 -0
- package/resource/knowledge/chat/preset/ios/features/message-input.md +69 -0
- package/resource/knowledge/chat/preset/ios/features/message-list.md +164 -0
- package/resource/knowledge/chat/preset/ios/features/search.md +94 -0
- package/resource/{doc/chatkit → knowledge/chat/preset}/ios/features/theme.md +54 -51
- package/resource/{doc/chatkit/ios → knowledge/chat/preset/ios-uikit}/integration.md +157 -94
- package/resource/knowledge/chat/preset/react/features/chat-setting.md +123 -0
- package/resource/{doc/chatkit/react/components → knowledge/chat/preset/react/features}/contact-list.md +256 -104
- package/resource/knowledge/chat/preset/react/features/conversation-actions.md +217 -0
- package/resource/{doc/chatkit/react/components → knowledge/chat/preset/react/features}/conversation-list.md +86 -79
- package/resource/knowledge/chat/preset/react/features/conversation-preview.md +99 -0
- package/resource/knowledge/chat/preset/react/features/conversation-search.md +58 -0
- package/resource/{doc/chatkit/react/components → knowledge/chat/preset/react/features}/message-input.md +30 -83
- package/resource/{doc/chatkit/react/components → knowledge/chat/preset/react/features}/message-list.md +22 -25
- package/resource/knowledge/chat/preset/react/features/search.md +531 -0
- package/resource/knowledge/chat/preset/react/features/theme.md +16 -0
- package/resource/knowledge/chat/preset/vue/features/chat-header.md +331 -0
- package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/chat-setting.md +0 -4
- package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/contact-list.md +59 -53
- package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/conversation-actions.md +49 -43
- package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/conversation-list.md +61 -49
- package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/conversation-preview.md +43 -40
- package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/conversation-search.md +1 -1
- package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/message-input.md +128 -105
- package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/message-list.md +108 -195
- package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/search.md +74 -68
- package/resource/knowledge/chat/preset/vue/features/theme.md +136 -0
- package/resource/knowledge/chat/urls/error-code.md +16 -0
- package/resource/knowledge/chat/urls/product.md +61 -0
- package/resource/knowledge/chat/urls/restapi.md +226 -0
- package/resource/knowledge/chat/urls/sdk/android.md +84 -0
- package/resource/knowledge/chat/urls/sdk/flutter.md +73 -0
- package/resource/knowledge/chat/urls/sdk/ios.md +84 -0
- package/resource/knowledge/chat/urls/sdk/web.md +88 -0
- package/resource/knowledge/chat/urls/webhook.md +73 -0
- package/resource/{doc/livekit/core-sdk/live/android/api-reference → knowledge/livekit/core-sdk/api-reference/android}/AudioEffectStore.md +79 -76
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BarrageStore.md +174 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BattleStore.md +329 -0
- package/resource/{doc/livekit/core-sdk/live/android/api-reference → knowledge/livekit/core-sdk/api-reference/android}/CameraView.md +7 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoGuestStore.md +434 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoHostStore.md +362 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/DeviceStore.md +466 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/GiftStore.md +173 -0
- package/resource/{doc/livekit/core-sdk/live/android/api-reference → knowledge/livekit/core-sdk/api-reference/android}/LikeStore.md +12 -10
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveAudienceStore.md +291 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveCoreView.md +78 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveSeatStore.md +439 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LoginStore.md +221 -0
- package/resource/{doc/livekit/core-sdk/live/flutter/api-reference → knowledge/livekit/core-sdk/api-reference/flutter}/AudioEffectStore.md +79 -76
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BarrageStore.md +212 -0
- package/resource/{doc/livekit/core-sdk/live/flutter/api-reference → knowledge/livekit/core-sdk/api-reference/flutter}/BaseBeautyStore.md +43 -45
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BattleStore.md +312 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoGuestStore.md +404 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoHostStore.md +334 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/DeviceStore.md +420 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/GiftStore.md +166 -0
- package/resource/{doc/livekit/core-sdk/live/flutter/api-reference → knowledge/livekit/core-sdk/api-reference/flutter}/LikeStore.md +12 -11
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveAudienceStore.md +281 -0
- package/resource/{doc/livekit/core-sdk/live/flutter/api-reference → knowledge/livekit/core-sdk/api-reference/flutter}/LiveCoreView.md +49 -42
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveSeatStore.md +397 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LoginStore.md +183 -0
- package/resource/{doc/livekit/core-sdk/live/ios/api-reference → knowledge/livekit/core-sdk/api-reference/ios}/AudioEffectStore.md +79 -75
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BarrageStore.md +192 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BaseBeautyStore.md +146 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BattleStore.md +309 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoGuestStore.md +370 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoHostStore.md +339 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/DeviceStore.md +503 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/GiftStore.md +188 -0
- package/resource/{doc/livekit/core-sdk/live/ios/api-reference → knowledge/livekit/core-sdk/api-reference/ios}/LikeStore.md +12 -10
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveAudienceStore.md +289 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveCoreView.md +78 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveSeatStore.md +434 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LoginStore.md +187 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/web/index.md +780 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-audience-list.md +59 -51
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-audio-effect.md +37 -34
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-barrage.md +68 -38
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-base-beauty.md +18 -15
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-co-guest-interaction.md +17 -17
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-gift.md +86 -80
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-host-interaction.md +53 -49
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-integration.md +47 -45
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-live-list.md +26 -22
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-audience-list.md +16 -13
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-audio-effect.md +28 -24
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-barrage.md +33 -21
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-base-beauty.md +29 -25
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-co-guest-interaction.md +21 -20
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-gift.md +78 -69
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-host-interaction.md +47 -43
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-integration.md +48 -45
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-live-list.md +27 -23
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-audience-list.md +15 -12
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-audio-effect.md +39 -36
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-barrage.md +42 -29
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-base-beauty.md +19 -16
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-co-guest-interaction.md +20 -19
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-gift.md +55 -49
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-host-interaction.md +50 -46
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-integration.md +48 -46
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-live-list.md +26 -22
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-audience-list.md +59 -51
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-audio-effect.md +41 -38
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-barrage.md +67 -37
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-co-guest-interaction.md +53 -46
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-gift.md +86 -80
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-host-interaction.md +45 -40
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-integration.md +43 -42
- package/resource/knowledge/livekit/core-sdk/voice/android/voice-room-list.md +523 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-audience-list.md +16 -13
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-audio-effect.md +54 -50
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-barrage.md +33 -21
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-co-guest-interaction.md +34 -28
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-gift.md +73 -64
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-integration.md +46 -43
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-room-list.md +165 -148
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-audience-list.md +19 -16
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-audio-effect.md +40 -37
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-barrage.md +41 -28
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-co-guest-interaction.md +54 -47
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-gift.md +52 -46
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-host-interaction.md +55 -50
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-integration.md +47 -45
- package/resource/knowledge/livekit/core-sdk/voice/ios/voice-room-list.md +404 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/uni-app/voice-audience-list.md +40 -57
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/uni-app/voice-audio-effect.md +38 -49
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/uni-app/voice-barrage.md +53 -53
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/uni-app/voice-co-guest-interaction.md +106 -116
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/uni-app/voice-gift.md +49 -59
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/uni-app/voice-integration.md +52 -45
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/uni-app/voice-room-list.md +38 -46
- package/resource/knowledge/livekit/preset/live/vue/features/barrage.md +915 -0
- package/resource/knowledge/livekit/preset/live/vue/features/live-audience-list.md +179 -0
- package/resource/knowledge/livekit/preset/live/vue/features/live-view.md +419 -0
- package/resource/knowledge/push/config/android/fcm.md +133 -0
- package/resource/knowledge/push/config/android/honor.md +111 -0
- package/resource/knowledge/push/config/android/huawei.md +106 -0
- package/resource/knowledge/push/config/android/meizu.md +121 -0
- package/resource/knowledge/push/config/android/oppo.md +108 -0
- package/resource/knowledge/push/config/android/vivo.md +101 -0
- package/resource/knowledge/push/config/android/xiaomi.md +99 -0
- package/resource/knowledge/push/integration/android.md +1028 -0
- package/resource/knowledge/push/integration/donut.md +271 -0
- package/resource/knowledge/push/integration/flutter.md +363 -0
- package/resource/knowledge/push/integration/harmonyos.md +72 -0
- package/resource/knowledge/push/integration/ios.md +705 -0
- package/resource/knowledge/push/integration/react-native.md +337 -0
- package/resource/knowledge/push/integration/uni-app.md +461 -0
- package/resource/knowledge/push/integration/unity.md +357 -0
- package/resource/knowledge/push/integration/unreal-engine.md +353 -0
- package/resource/knowledge/push/overview/prepare.md +30 -0
- package/resource/{doc/roomkit/android/features → knowledge/roomkit/core-sdk/android}/call-user-to-room.md +22 -20
- package/resource/{doc/roomkit/android/features → knowledge/roomkit/core-sdk/android}/room-participant-state.md +22 -193
- package/resource/{doc/roomkit/android/features → knowledge/roomkit/core-sdk/android}/room-state.md +33 -32
- package/resource/{doc/roomkit/android/features → knowledge/roomkit/core-sdk/android}/schedule-room.md +30 -29
- package/resource/knowledge/roomkit/core-sdk/flutter/call-user-to-room.md +230 -0
- package/resource/{doc/roomkit/flutter/features → knowledge/roomkit/core-sdk/flutter}/room-participant-state.md +22 -21
- package/resource/{doc/roomkit/flutter/features → knowledge/roomkit/core-sdk/flutter}/room-state.md +29 -28
- package/resource/{doc/roomkit/flutter/features → knowledge/roomkit/core-sdk/flutter}/schedule-room.md +17 -16
- package/resource/{doc/roomkit/ios/features → knowledge/roomkit/core-sdk/ios}/call-user-to-room.md +22 -20
- package/resource/{doc/roomkit/ios/features → knowledge/roomkit/core-sdk/ios}/room-participant-state.md +49 -218
- package/resource/{doc/roomkit/ios/features → knowledge/roomkit/core-sdk/ios}/room-state.md +37 -37
- package/resource/{doc/roomkit/ios/features → knowledge/roomkit/core-sdk/ios}/schedule-room.md +28 -28
- package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/call-user-to-room.md +122 -7
- package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/device-detection.md +318 -3
- package/resource/knowledge/roomkit/core-sdk/vue/device-state.md +1504 -0
- package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/free-beauty-panel.md +4 -3
- package/resource/knowledge/roomkit/core-sdk/vue/room-chat.md +709 -0
- package/resource/knowledge/roomkit/core-sdk/vue/room-participant-state.md +1105 -0
- package/resource/knowledge/roomkit/core-sdk/vue/room-state.md +635 -0
- package/resource/knowledge/roomkit/core-sdk/vue/room-view.md +529 -0
- package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/schedule-room.md +256 -13
- package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/screen-share.md +218 -25
- package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/virtual-background.md +4 -3
- package/resource/{doc/roomkit → knowledge/roomkit/preset}/android/integration.md +50 -64
- package/resource/{doc/roomkit → knowledge/roomkit/preset}/flutter/integration.md +34 -31
- package/resource/{doc/roomkit → knowledge/roomkit/preset}/ios/integration.md +45 -53
- package/resource/knowledge/roomkit/preset/react/integration.md +571 -0
- package/resource/{doc → knowledge}/rtcengine/web/how_to_run_web_sdk_demo.md +31 -15
- package/resource/{doc → knowledge}/rtcengine/web/plugin/21-advanced-auto-play-policy.md +9 -3
- package/resource/{doc → knowledge}/rtcengine/web/plugin/22-advanced-audio-mixer.md +1 -1
- package/resource/{doc → knowledge}/rtcengine/web/plugin/23-advanced-support-detection.md +1 -1
- package/resource/{doc → knowledge}/rtcengine/web/plugin/24-advanced-network-quality.md +6 -6
- package/resource/{doc → knowledge}/rtcengine/web/plugin/25-advanced-device-change.md +1 -1
- package/resource/{doc → knowledge}/rtcengine/web/plugin/26-advanced-publish-cdn-stream.md +4 -4
- package/resource/{doc → knowledge}/rtcengine/web/plugin/27-advanced-small-stream.md +4 -4
- package/resource/{doc → knowledge}/rtcengine/web/plugin/31-advanced-plugins-overview.md +1 -1
- package/resource/{doc → knowledge}/trtc/android/TRTCCloud.md +547 -495
- package/resource/{doc → knowledge}/trtc/android/TRTCCloudDef.md +434 -403
- package/resource/{doc → knowledge}/trtc/android/TRTCCloudListener.md +394 -348
- package/resource/{doc → knowledge}/trtc/android/TRTCStatistics.md +17 -15
- package/resource/{doc → knowledge}/trtc/android/TXAudioEffectManager.md +227 -197
- package/resource/knowledge/trtc/android/TXBeautyManager.md +415 -0
- package/resource/{doc → knowledge}/trtc/android/TXDeviceManager.md +70 -63
- package/resource/{doc → knowledge}/trtc/android/TXLiteAVCode.md +19 -17
- package/resource/{doc/trtc/C++ → knowledge/trtc/c++}/ITRTCCloud.md +599 -544
- package/resource/{doc/trtc/C++ → knowledge/trtc/c++}/ITRTCStatistics.md +17 -15
- package/resource/knowledge/trtc/c++/ITXAudioEffectManager.md +502 -0
- package/resource/knowledge/trtc/c++/ITXDeviceManager.md +403 -0
- package/resource/{doc/trtc/C++ → knowledge/trtc/c++}/TRTCCloudCallback.md +439 -387
- package/resource/{doc/trtc/C++ → knowledge/trtc/c++}/TRTCTypeDef.md +417 -387
- package/resource/{doc/trtc/C++ → knowledge/trtc/c++}/TXLiteAVCode.md +19 -17
- package/resource/{doc/trtc/iOS → knowledge/trtc/ios}/TRTCCloud.md +619 -559
- package/resource/{doc/trtc/iOS → knowledge/trtc/ios}/TRTCCloudDelegate.md +409 -360
- package/resource/{doc/trtc/iOS → knowledge/trtc/ios}/TRTCStatistics.md +17 -15
- package/resource/{doc/trtc/iOS → knowledge/trtc/ios}/TXAudioEffectManager.md +187 -164
- package/resource/knowledge/trtc/ios/TXBeautyManager.md +416 -0
- package/resource/knowledge/trtc/ios/TXDeviceManager.md +399 -0
- package/resource/{doc/trtc/iOS → knowledge/trtc/ios}/TXLiteAVCode.md +19 -17
- package/resource/{doc/trtc/iOS → knowledge/trtc/ios}/TXLiveSDKTypeDef.md +422 -396
- package/server-config.js +0 -1
- package/server.js +22 -12
- package/streamable-http.js +0 -1
- package/tools/call/get_native_call_uikit_integration.js +2 -4
- package/tools/call/get_native_callkit_core_integration.js +2 -6
- package/tools/call/get_web_call_uikit_integration.js +2 -4
- package/tools/chat/get_native_chat_uikit_integration.js +2 -4
- package/tools/chat/get_web_chat_uikit_integration.js +2 -4
- package/tools/common/get_usersig.js +0 -1
- package/tools/common/present_framework_choice.js +9 -4
- package/tools/common/record_answer.js +19 -26
- package/tools/common/record_feedback.js +17 -31
- package/tools/common/search_trtc_knowledge.js +44 -0
- package/tools/definitions/get_native_call_uikit_integration_def.js +2 -1
- package/tools/definitions/get_native_callkit_core_integration_def.js +2 -1
- package/tools/definitions/get_native_chat_uikit_integration_def.js +3 -2
- package/tools/definitions/get_native_livekit_core_integration_def.js +2 -1
- package/tools/definitions/get_usersig_def.js +0 -1
- package/tools/definitions/get_web_call_uikit_integration_def.js +2 -1
- package/tools/definitions/get_web_chat_uikit_integration_def.js +2 -1
- package/tools/definitions/get_web_live_uikit_integration_def.js +4 -3
- package/tools/definitions/get_web_room_core_integration_def.js +46 -0
- package/tools/definitions/get_web_room_uikit_integration_def.js +3 -1
- package/tools/definitions/integration-boundary.js +5 -0
- package/tools/definitions/present_framework_choice_def.js +11 -10
- package/tools/definitions/record_answer_def.js +6 -5
- package/tools/definitions/record_feedback_def.js +4 -3
- package/tools/definitions/search_trtc_knowledge_def.js +69 -0
- package/tools/index.js +5 -37
- package/tools/live/get_native_livekit_core_integration.js +1 -4
- package/tools/live/get_web_live_uikit_integration.js +2 -5
- package/tools/room/get_web_room_core_integration.js +47 -0
- package/tools/room/get_web_room_uikit_integration.js +2 -4
- package/utils/generate-structured-result.js +4 -11
- package/utils/generate-usersig.js +0 -1
- package/utils/get-device-identifier.js +0 -1
- package/utils/get-doc-content.js +14 -9
- package/utils/http-get.js +0 -1
- package/utils/http-post.js +0 -1
- package/utils/report-cls-client.js +22 -21
- package/utils/report-es-client.js +1 -2
- package/utils/report-runtime-error-cls-client.js +0 -1
- package/index.js.map +0 -1
- package/resource/doc/callkit/core-sdk/.gitkeep +0 -0
- package/resource/doc/callkit/core-sdk/android/answer-call.md +0 -942
- package/resource/doc/callkit/core-sdk/android/make-call.md +0 -876
- package/resource/doc/callkit/core-sdk/android/offline-push.md +0 -368
- package/resource/doc/callkit/core-sdk/flutter/answer-call.md +0 -1132
- package/resource/doc/callkit/core-sdk/flutter/make-call.md +0 -1206
- package/resource/doc/callkit/core-sdk/flutter/offline-push.md +0 -357
- package/resource/doc/callkit/core-sdk/ios/answer-call.md +0 -1009
- package/resource/doc/callkit/core-sdk/ios/make-call.md +0 -1154
- package/resource/doc/callkit/core-sdk/ios/offline-push.md +0 -470
- package/resource/doc/callkit/core-sdk/uni-app/answer-call.md +0 -1146
- package/resource/doc/callkit/core-sdk/uni-app/make-call.md +0 -1267
- package/resource/doc/callkit/faq/android-faq.md +0 -767
- package/resource/doc/callkit/faq/flutter-faq.md +0 -749
- package/resource/doc/callkit/faq/ios-faq.md +0 -759
- package/resource/doc/callkit/faq/web-faq.md +0 -753
- package/resource/doc/callkit/preset/android/api.md +0 -330
- package/resource/doc/callkit/preset/flutter/api.md +0 -401
- package/resource/doc/callkit/preset/ios/api.md +0 -282
- package/resource/doc/callkit/preset/ios/integration.md +0 -188
- package/resource/doc/callkit/preset/react/api.md +0 -600
- package/resource/doc/callkit/preset/react/integration.md +0 -86
- package/resource/doc/callkit/preset/vue/api.md +0 -600
- package/resource/doc/callkit/preset/vue/integration.md +0 -83
- package/resource/doc/chatkit/android/faq.md +0 -109
- package/resource/doc/chatkit/faq/android_sdk/client-api.md +0 -280
- package/resource/doc/chatkit/faq/common/product.md +0 -82
- package/resource/doc/chatkit/faq/common/server.md +0 -53
- package/resource/doc/chatkit/faq/common/server_error_code.md +0 -74
- package/resource/doc/chatkit/faq/flutter_sdk/client-api.md +0 -183
- package/resource/doc/chatkit/faq/flutter_sdk/faq.md +0 -54
- package/resource/doc/chatkit/faq/ios_sdk/client-api.md +0 -279
- package/resource/doc/chatkit/faq/web_sdk/error_code.md +0 -47
- package/resource/doc/chatkit/faq/web_sdk/faq.md +0 -292
- package/resource/doc/chatkit/flutter/faq.md +0 -22
- package/resource/doc/chatkit/ios/faq.md +0 -109
- package/resource/doc/chatkit/react/components/avatar.md +0 -104
- package/resource/doc/chatkit/react/components/chat-header.md +0 -148
- package/resource/doc/chatkit/react/components/chat-setting.md +0 -117
- package/resource/doc/chatkit/react/components/chat.md +0 -38
- package/resource/doc/chatkit/react/components/component-list.md +0 -35
- package/resource/doc/chatkit/react/components/conversation-actions.md +0 -174
- package/resource/doc/chatkit/react/components/conversation-preview.md +0 -116
- package/resource/doc/chatkit/react/components/conversation-search.md +0 -57
- package/resource/doc/chatkit/react/components/search.md +0 -282
- package/resource/doc/chatkit/react/components/tuikit.md +0 -43
- package/resource/doc/chatkit/react/faq.md +0 -26
- package/resource/doc/chatkit/vue/components/avatar.md +0 -104
- package/resource/doc/chatkit/vue/components/chat-header.md +0 -149
- package/resource/doc/chatkit/vue/components/chat.md +0 -42
- package/resource/doc/chatkit/vue/components/component-list.md +0 -89
- package/resource/doc/chatkit/vue/components/tuikit.md +0 -45
- package/resource/doc/chatkit/vue/components/userpicker.md +0 -256
- package/resource/doc/chatkit/vue/faq.md +0 -35
- package/resource/doc/livekit/core-sdk/live/android/api-reference/BarrageStore.md +0 -148
- package/resource/doc/livekit/core-sdk/live/android/api-reference/BattleStore.md +0 -316
- package/resource/doc/livekit/core-sdk/live/android/api-reference/CoGuestStore.md +0 -419
- package/resource/doc/livekit/core-sdk/live/android/api-reference/CoHostStore.md +0 -325
- package/resource/doc/livekit/core-sdk/live/android/api-reference/DeviceStore.md +0 -436
- package/resource/doc/livekit/core-sdk/live/android/api-reference/GiftStore.md +0 -165
- package/resource/doc/livekit/core-sdk/live/android/api-reference/LiveAudienceStore.md +0 -239
- package/resource/doc/livekit/core-sdk/live/android/api-reference/LiveCoreView.md +0 -74
- package/resource/doc/livekit/core-sdk/live/android/api-reference/LiveSeatStore.md +0 -417
- package/resource/doc/livekit/core-sdk/live/android/api-reference/LoginStore.md +0 -207
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/BarrageStore.md +0 -158
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/BattleStore.md +0 -304
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/CoGuestStore.md +0 -394
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/CoHostStore.md +0 -303
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/DeviceStore.md +0 -410
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/GiftStore.md +0 -160
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/LiveAudienceStore.md +0 -231
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/LiveSeatStore.md +0 -375
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/LoginStore.md +0 -170
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/BarrageStore.md +0 -165
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/BaseBeautyStore.md +0 -143
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/BattleStore.md +0 -298
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/CoGuestStore.md +0 -349
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/CoHostStore.md +0 -297
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/DeviceStore.md +0 -471
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/GiftStore.md +0 -179
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/LiveAudienceStore.md +0 -238
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/LiveCoreView.md +0 -74
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/LiveSeatStore.md +0 -412
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/LoginStore.md +0 -173
- package/resource/doc/livekit/core-sdk/voice/android/voice-room-list.md +0 -365
- package/resource/doc/livekit/core-sdk/voice/ios/voice-room-list.md +0 -336
- package/resource/doc/livekit/preset/live/vue/api-reference/index.md +0 -780
- package/resource/doc/livekit/preset/live/vue/components/barrage.md +0 -291
- package/resource/doc/livekit/preset/live/vue/components/co-guest-panel.md +0 -88
- package/resource/doc/livekit/preset/live/vue/components/live-audience-list.md +0 -164
- package/resource/doc/livekit/preset/live/vue/components/live-scene-panel.md +0 -130
- package/resource/doc/livekit/preset/live/vue/components/live-view.md +0 -203
- package/resource/doc/livekit/preset/live/vue/components/stream-mixer.md +0 -211
- package/resource/doc/livekit/preset/live/vue/faq.md +0 -1
- package/resource/doc/roomkit/faq/common/error-code.md +0 -67
- package/resource/doc/roomkit/flutter/features/call-user-to-room.md +0 -228
- package/resource/doc/roomkit/vue/faq.md +0 -1
- package/resource/doc/roomkit/vue/features/device-state.md +0 -460
- package/resource/doc/roomkit/vue/features/room-chat.md +0 -369
- package/resource/doc/roomkit/vue/features/room-participant-state.md +0 -385
- package/resource/doc/roomkit/vue/features/room-state.md +0 -280
- package/resource/doc/roomkit/vue/features/room-view.md +0 -241
- package/resource/doc/roomkit/vue/integration.md +0 -315
- package/resource/doc/rtcengine/faq/web_sdk/.gitkeep +0 -0
- package/resource/doc/trtc/C++/ITXAudioEffectManager.md +0 -472
- package/resource/doc/trtc/C++/ITXDeviceManager.md +0 -388
- package/resource/doc/trtc/android/TXBeautyManager.md +0 -403
- package/resource/doc/trtc/iOS/TXBeautyManager.md +0 -404
- package/resource/doc/trtc/iOS/TXDeviceManager.md +0 -382
- package/server-config.js.map +0 -1
- package/server.js.map +0 -1
- package/streamable-http.js.map +0 -1
- package/tools/call/get_callkit_api.js +0 -33
- package/tools/call/get_callkit_api.js.map +0 -1
- package/tools/call/get_native_call_uikit_integration.js.map +0 -1
- package/tools/call/get_native_callkit_core_integration.js.map +0 -1
- package/tools/call/get_web_call_uikit_integration.js.map +0 -1
- package/tools/chat/get_native_chat_uikit_feature_detail.js +0 -35
- package/tools/chat/get_native_chat_uikit_feature_detail.js.map +0 -1
- package/tools/chat/get_native_chat_uikit_integration.js.map +0 -1
- package/tools/chat/get_web_chat_uikit_component_detail.js +0 -35
- package/tools/chat/get_web_chat_uikit_component_detail.js.map +0 -1
- package/tools/chat/get_web_chat_uikit_integration.js.map +0 -1
- package/tools/common/get_faq.js +0 -266
- package/tools/common/get_faq.js.map +0 -1
- package/tools/common/get_usersig.js.map +0 -1
- package/tools/common/present_framework_choice.js.map +0 -1
- package/tools/common/record_answer.js.map +0 -1
- package/tools/common/record_feedback.js.map +0 -1
- package/tools/common/record_skill_session.js +0 -69
- package/tools/common/record_skill_session.js.map +0 -1
- package/tools/definitions/get_callkit_api_def.js +0 -28
- package/tools/definitions/get_callkit_api_def.js.map +0 -1
- package/tools/definitions/get_faq_def.js +0 -40
- package/tools/definitions/get_faq_def.js.map +0 -1
- package/tools/definitions/get_native_call_uikit_integration_def.js.map +0 -1
- package/tools/definitions/get_native_callkit_core_integration_def.js.map +0 -1
- package/tools/definitions/get_native_chat_uikit_feature_detail_def.js +0 -31
- package/tools/definitions/get_native_chat_uikit_feature_detail_def.js.map +0 -1
- package/tools/definitions/get_native_chat_uikit_integration_def.js.map +0 -1
- package/tools/definitions/get_native_livekit_core_features_def.js +0 -33
- package/tools/definitions/get_native_livekit_core_features_def.js.map +0 -1
- package/tools/definitions/get_native_livekit_core_integration_def.js.map +0 -1
- package/tools/definitions/get_native_trtc_sdk_docs_def.js +0 -32
- package/tools/definitions/get_native_trtc_sdk_docs_def.js.map +0 -1
- package/tools/definitions/get_usersig_def.js.map +0 -1
- package/tools/definitions/get_web_call_uikit_integration_def.js.map +0 -1
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js +0 -31
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js.map +0 -1
- package/tools/definitions/get_web_chat_uikit_integration_def.js.map +0 -1
- package/tools/definitions/get_web_live_uikit_integration_def.js.map +0 -1
- package/tools/definitions/get_web_livekit_api_def.js +0 -27
- package/tools/definitions/get_web_livekit_api_def.js.map +0 -1
- package/tools/definitions/get_web_livekit_component_detail_def.js +0 -29
- package/tools/definitions/get_web_livekit_component_detail_def.js.map +0 -1
- package/tools/definitions/get_web_room_uikit_integration_def.js.map +0 -1
- package/tools/definitions/get_web_roomkit_feature_detail_def.js +0 -30
- package/tools/definitions/get_web_roomkit_feature_detail_def.js.map +0 -1
- package/tools/definitions/get_web_trtc_sdk_api_def.js +0 -25
- package/tools/definitions/get_web_trtc_sdk_api_def.js.map +0 -1
- package/tools/definitions/get_web_trtc_sdk_integration_def.js +0 -25
- package/tools/definitions/get_web_trtc_sdk_integration_def.js.map +0 -1
- package/tools/definitions/get_web_trtc_sdk_plugin_def.js +0 -25
- package/tools/definitions/get_web_trtc_sdk_plugin_def.js.map +0 -1
- package/tools/definitions/present_framework_choice_def.js.map +0 -1
- package/tools/definitions/record_answer_def.js.map +0 -1
- package/tools/definitions/record_feedback_def.js.map +0 -1
- package/tools/definitions/record_skill_session_def.js +0 -31
- package/tools/definitions/record_skill_session_def.js.map +0 -1
- package/tools/index.js.map +0 -1
- package/tools/live/get_native_livekit_core_features.js +0 -68
- package/tools/live/get_native_livekit_core_features.js.map +0 -1
- package/tools/live/get_native_livekit_core_integration.js.map +0 -1
- package/tools/live/get_web_live_uikit_integration.js.map +0 -1
- package/tools/live/get_web_livekit_api.js +0 -33
- package/tools/live/get_web_livekit_api.js.map +0 -1
- package/tools/live/get_web_livekit_component_detail.js +0 -35
- package/tools/live/get_web_livekit_component_detail.js.map +0 -1
- package/tools/room/get_web_room_uikit_integration.js.map +0 -1
- package/tools/room/get_web_roomkit_feature_detail.js +0 -69
- package/tools/room/get_web_roomkit_feature_detail.js.map +0 -1
- package/tools/rtcengine/get_web_trtc_sdk_api.js +0 -32
- package/tools/rtcengine/get_web_trtc_sdk_api.js.map +0 -1
- package/tools/rtcengine/get_web_trtc_sdk_integration.js +0 -32
- package/tools/rtcengine/get_web_trtc_sdk_integration.js.map +0 -1
- package/tools/rtcengine/get_web_trtc_sdk_plugin.js +0 -32
- package/tools/rtcengine/get_web_trtc_sdk_plugin.js.map +0 -1
- package/tools/trtc/get_native_trtc_sdk_docs.js +0 -74
- package/tools/trtc/get_native_trtc_sdk_docs.js.map +0 -1
- package/utils/build-session-directives.js +0 -122
- package/utils/build-session-directives.js.map +0 -1
- package/utils/generate-structured-result.js.map +0 -1
- package/utils/generate-usersig.js.map +0 -1
- package/utils/get-device-identifier.js.map +0 -1
- package/utils/get-doc-content.js.map +0 -1
- package/utils/handle-framework.js +0 -9
- package/utils/handle-framework.js.map +0 -1
- package/utils/handle-state-name.js +0 -29
- package/utils/handle-state-name.js.map +0 -1
- package/utils/http-get.js.map +0 -1
- package/utils/http-post.js.map +0 -1
- package/utils/report-cls-client.js.map +0 -1
- package/utils/report-es-client.js.map +0 -1
- package/utils/report-runtime-error-cls-client.js.map +0 -1
- /package/resource/{doc/callkit/faq/common → knowledge/callkit/faq}/error-code.md +0 -0
- /package/resource/{doc/livekit/faq/common → knowledge/livekit/faq}/error-code.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/api.md +0 -0
- /package/resource/{doc/rtcengine/faq/web/web.md → knowledge/rtcengine/web/faq.md} +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/how_to_integrated_web_sdk.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/20-advanced-customized-capture-rendering.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/28-advanced-beauty.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/29-advanced-water-mark.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/30-advanced-cross-room-link.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/34-advanced-proxy.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/35-advanced-ai-denoiser.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/36-advanced-virtual-background.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/37-advanced-voice-changer.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/38-advanced-basic-beauty.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/39-advanced-video-decoder.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/40-advanced-video-mixer.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/41-advanced-small-stream-auto-switcher.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/42-advanced-realtime-transcriber.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/43-advanced-face-detection.md +0 -0
- /package/resource/{doc/rtcengine/faq/common → knowledge/share}/userSig.md +0 -0
|
@@ -0,0 +1,1105 @@
|
|
|
1
|
+
本篇文档介绍如何基于 [useRoomParticipantState](https://web.sdk.qcloud.com/trtc/live/web/doc/zh/index.html#module-RoomParticipantState) 构建视频会议成员管理能力,覆盖成员列表展示、角色权限、设备会控、消息管控、设备申请与邀请、事件监听和常见问题。
|
|
2
|
+
|
|
3
|
+
## 前提条件
|
|
4
|
+
- 用户已经通过 [useLoginState](https://web.sdk.qcloud.com/trtc/live/web/doc/zh/index.html#module-LoginState) 完成登录鉴权,请参考 接入概览。
|
|
5
|
+
|
|
6
|
+
- 用户已经通过 [useRoomState](https://web.sdk.qcloud.com/trtc/live/web/doc/zh/index.html#module-RoomState) 进入房间,请参考 房间管理。
|
|
7
|
+
|
|
8
|
+
## 角色与权限体系
|
|
9
|
+
|
|
10
|
+
标准会议房间中,在线成员由 `participantList` 维护;房间管理权限由成员角色决定。
|
|
11
|
+
|
|
12
|
+
### 角色权限说明
|
|
13
|
+
|
|
14
|
+
|角色|枚举值|权限说明|常见操作|
|
|
15
|
+
|---------|---------|---------|---------|
|
|
16
|
+
|房主|`RoomParticipantRole.Owner`|房间最高权限,同一时间只有一个房主。|设置/撤销管理员、转让房主、移除成员、关闭成员设备、全体禁言、全体禁用设备。|
|
|
17
|
+
|管理员|`RoomParticipantRole.Admin`|由房主授予。管理员退房后失去管理员角色。|移除成员、关闭成员设备、禁言、处理设备申请、邀请成员开启设备。|
|
|
18
|
+
|普通成员|`RoomParticipantRole.GeneralUser`|房间内普通参会者。|查看成员列表、更新自身信息、申请开启被禁用的设备。|
|
|
19
|
+
|
|
20
|
+
### 能力矩阵
|
|
21
|
+
| <strong>能力分类</strong> | <strong>能力项</strong> | <strong>房主</strong> | <strong>管理员</strong> | <strong>普通成员</strong> |
|
|
22
|
+
| --- | --- | --- | --- | --- |
|
|
23
|
+
| 基础查看与修改 | 查看成员列表 | 支持 | 支持 | 支持 |
|
|
24
|
+
| 修改自己的名片 | 支持 | 支持 | 支持 | |
|
|
25
|
+
| 修改任意成员名片 | 支持 | 支持 | 不支持 | |
|
|
26
|
+
| 房间与角色管理 | 设置/撤销管理员 | 支持 | 不支持 | 不支持 |
|
|
27
|
+
| 转让房主 | 支持 | 不支持 | 不支持 | |
|
|
28
|
+
| 解散房间 | 支持 | 不支持 | 不支持 | |
|
|
29
|
+
| 踢出成员 | 支持 | 支持 | 不支持 | |
|
|
30
|
+
| 设备与消息管控 | 关闭成员媒体设备 | 支持 | 支持 | 不支持 |
|
|
31
|
+
| 全体禁用媒体设备 | 支持 | 支持 | 不支持 | |
|
|
32
|
+
| 单独禁止成员发消息 | 支持 | 支持 | 不支持 | |
|
|
33
|
+
| 全体禁止发消息 | 支持 | 支持 | 不支持 | |
|
|
34
|
+
| 申请开启媒体设备 | - | - | 支持 | |
|
|
35
|
+
|
|
36
|
+
> **说明:**
|
|
37
|
+
>
|
|
38
|
+
|
|
39
|
+
> 房主和管理员权限应同时在 UI 层和接口调用层做校验。UI 层可隐藏当前成员不可见的管理入口;接口调用层仍需通过 `try/catch` 处理无权限错误。
|
|
40
|
+
>
|
|
41
|
+
|
|
42
|
+
## 场景一:集成内置成员列表
|
|
43
|
+
|
|
44
|
+
如果您的业务只需要快速展示成员列表,并使用视频会议 SDK 提供的默认成员管理交互,可以直接使用 `RoomParticipantList` 组件。该方式适合快速接入标准会议,对成员列表样式定制要求较低。
|
|
45
|
+
|
|
46
|
+
### 实现思路
|
|
47
|
+
|
|
48
|
+
在会议页面中为成员列表准备一个具备明确宽高的容器,并渲染 `RoomParticipantList`。
|
|
49
|
+
|
|
50
|
+
### 示例代码
|
|
51
|
+
|
|
52
|
+
【Vue3】
|
|
53
|
+
``` typescript
|
|
54
|
+
<template>
|
|
55
|
+
<aside class="participant-panel">
|
|
56
|
+
<RoomParticipantList />
|
|
57
|
+
</aside>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script setup lang="ts">
|
|
61
|
+
import { RoomParticipantList } from 'tuikit-atomicx-vue3/room';
|
|
62
|
+
</script>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
【React】
|
|
66
|
+
``` typescript
|
|
67
|
+
import { RoomParticipantList } from 'tuikit-atomicx-react/room';
|
|
68
|
+
|
|
69
|
+
export default function ParticipantPanel() {
|
|
70
|
+
return (
|
|
71
|
+
<aside className="participant-panel">
|
|
72
|
+
<RoomParticipantList />
|
|
73
|
+
</aside>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
> **说明:**
|
|
79
|
+
>
|
|
80
|
+
> - 如果使用内置成员列表组件 `RoomParticipantList`,需要在应用根节点配置 `UIKitProvider`,请参考 接入概览 > 配置全局 UIKitProvider。
|
|
81
|
+
> - `RoomParticipantList` 会自动占满父容器的高度和宽度,请确保父容器具备明确尺寸。如果您需要完全自定义成员列表样式、操作按钮或业务信息展示,建议改用 `useRoomParticipantState` 自行渲染。
|
|
82
|
+
|
|
83
|
+
## 场景二:自定义成员列表
|
|
84
|
+
|
|
85
|
+
当业务需要展示自定义 UI、业务身份、扩展操作菜单或按角色分组时,可通过 `useRoomParticipantState` 获取成员数据并自行渲染。
|
|
86
|
+
|
|
87
|
+
### 获取成员列表
|
|
88
|
+
|
|
89
|
+
用户进入房间后,调用 `getParticipantList` 拉取成员数据。`getParticipantList` 使用分页机制,不会一次返回全量成员。接口返回的数据会自动增量更新到响应式状态 `participantList` 中,无需手动合并列表。
|
|
90
|
+
|
|
91
|
+
|**目标**|**使用接口/状态**|**处理建议**|
|
|
92
|
+
|---------|---------|---------|
|
|
93
|
+
|获取成员列表|`getParticipantList`、`participantList`|进房成功后调用 `getParticipantList`,UI 渲染 `participantList`。|
|
|
94
|
+
|分页加载|`participantListCursor`|如果 cursor 不为空,滚动到底部时传入上一次返回的 cursor。|
|
|
95
|
+
|本地用户|`localParticipant`|可用于展示“我”、判断当前用户角色。|
|
|
96
|
+
|
|
97
|
+
【Vue3】
|
|
98
|
+
``` typescript
|
|
99
|
+
<script setup lang="ts">
|
|
100
|
+
import { onMounted, watch } from 'vue';
|
|
101
|
+
import { useRoomParticipantState, useRoomState } from 'tuikit-atomicx-vue3/room';
|
|
102
|
+
|
|
103
|
+
const { currentRoom } = useRoomState();
|
|
104
|
+
const {
|
|
105
|
+
participantList,
|
|
106
|
+
participantListCursor,
|
|
107
|
+
localParticipant,
|
|
108
|
+
getParticipantList,
|
|
109
|
+
} = useRoomParticipantState();
|
|
110
|
+
|
|
111
|
+
onMounted(() => {
|
|
112
|
+
watch(
|
|
113
|
+
() => currentRoom.value?.roomId,
|
|
114
|
+
async (roomId) => {
|
|
115
|
+
if (!roomId) return;
|
|
116
|
+
try {
|
|
117
|
+
await getParticipantList({ cursor: '' });
|
|
118
|
+
} catch (error) {
|
|
119
|
+
console.error('获取成员列表失败:', error);
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{ immediate: true },
|
|
123
|
+
);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
async function loadMoreParticipants() {
|
|
127
|
+
if (!participantListCursor.value) return;
|
|
128
|
+
try {
|
|
129
|
+
await getParticipantList({ cursor: participantListCursor.value });
|
|
130
|
+
} catch (error) {
|
|
131
|
+
console.error('加载更多成员失败:', error);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
</script>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
【React】
|
|
138
|
+
``` typescript
|
|
139
|
+
import { useEffect } from 'react';
|
|
140
|
+
import { useRoomParticipantState, useRoomState } from 'tuikit-atomicx-react/room';
|
|
141
|
+
|
|
142
|
+
const { currentRoom } = useRoomState();
|
|
143
|
+
const {
|
|
144
|
+
participantList,
|
|
145
|
+
participantListCursor,
|
|
146
|
+
localParticipant,
|
|
147
|
+
getParticipantList,
|
|
148
|
+
} = useRoomParticipantState();
|
|
149
|
+
|
|
150
|
+
useEffect(() => {
|
|
151
|
+
if (!currentRoom?.roomId) return;
|
|
152
|
+
getParticipantList({ cursor: '' }).catch(error => {
|
|
153
|
+
console.error('获取成员列表失败:', error);
|
|
154
|
+
});
|
|
155
|
+
}, [currentRoom?.roomId]);
|
|
156
|
+
|
|
157
|
+
async function loadMoreParticipants() {
|
|
158
|
+
if (!participantListCursor) return;
|
|
159
|
+
try {
|
|
160
|
+
await getParticipantList({ cursor: participantListCursor });
|
|
161
|
+
} catch (error) {
|
|
162
|
+
console.error('加载更多成员失败:', error);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### 渲染成员信息
|
|
168
|
+
|
|
169
|
+
成员列表可展示身份标识、设备状态和业务扩展信息。
|
|
170
|
+
|
|
171
|
+
|**字段**|**说明**|**展示建议**|
|
|
172
|
+
|---------|---------|---------|
|
|
173
|
+
|`userId`|用户 ID|作为列表 key 和操作目标。|
|
|
174
|
+
|`userName`|用户昵称|优先展示昵称;为空时可展示 userId。|
|
|
175
|
+
|`avatarUrl`|头像地址|用于展示成员头像。|
|
|
176
|
+
|`role`|成员角色|展示房主、管理员、普通成员等角色标签。|
|
|
177
|
+
|`microphoneStatus`|麦克风状态|用于展示开麦/闭麦图标。|
|
|
178
|
+
|`cameraStatus`|摄像头状态|用于展示开摄像头/关摄像头图标。|
|
|
179
|
+
|`screenShareStatus`|屏幕分享状态|用于展示屏幕分享中标识。|
|
|
180
|
+
|`isMessageDisabled`|消息禁用状态|用于展示禁言状态。|
|
|
181
|
+
|`metaData`|业务自定义数据|用于展示职务、等级、购买状态等业务信息。|
|
|
182
|
+
|
|
183
|
+
【Vue3】
|
|
184
|
+
``` typescript
|
|
185
|
+
<template>
|
|
186
|
+
<div class="participant-list">
|
|
187
|
+
<div
|
|
188
|
+
v-for="item in participantList"
|
|
189
|
+
:key="item.userId"
|
|
190
|
+
class="participant-item"
|
|
191
|
+
>
|
|
192
|
+
|
|
193
|
+
<div class="user-info">
|
|
194
|
+
<span class="name">{{ item.userName || item.userId }}</span>
|
|
195
|
+
<span v-if="item.role !== RoomParticipantRole.GeneralUser" class="role-tag">
|
|
196
|
+
{{ item.role === RoomParticipantRole.Owner ? '房主' : '管理员' }}
|
|
197
|
+
</span>
|
|
198
|
+
</div>
|
|
199
|
+
|
|
200
|
+
<div class="status-bar">
|
|
201
|
+
<i :class="item.microphoneStatus === DeviceStatus.On ? 'icon-mic-on' : 'icon-mic-off'"></i>
|
|
202
|
+
<i :class="item.cameraStatus === DeviceStatus.On ? 'icon-cam-on' : 'icon-cam-off'"></i>
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
</template>
|
|
207
|
+
|
|
208
|
+
<script setup lang="ts">
|
|
209
|
+
import {
|
|
210
|
+
useRoomParticipantState,
|
|
211
|
+
RoomParticipantRole,
|
|
212
|
+
DeviceStatus
|
|
213
|
+
} from 'tuikit-atomicx-vue3/room';
|
|
214
|
+
|
|
215
|
+
const { participantList } = useRoomParticipantState();
|
|
216
|
+
const defaultAvatar = 'https://path-to-your-default-avatar.png';
|
|
217
|
+
</script>
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
【React】
|
|
221
|
+
``` typescript
|
|
222
|
+
import {
|
|
223
|
+
useRoomParticipantState,
|
|
224
|
+
RoomParticipantRole,
|
|
225
|
+
DeviceStatus
|
|
226
|
+
} from 'tuikit-atomicx-react/room';
|
|
227
|
+
|
|
228
|
+
const defaultAvatar = 'https://path-to-your-default-avatar.png';
|
|
229
|
+
|
|
230
|
+
export default function ParticipantList() {
|
|
231
|
+
const { participantList } = useRoomParticipantState();
|
|
232
|
+
return (
|
|
233
|
+
<div className="participant-list">
|
|
234
|
+
{participantList.map(item => (
|
|
235
|
+
<div key={item.userId} className="participant-item">
|
|
236
|
+
|
|
237
|
+
<div className="user-info">
|
|
238
|
+
<span className="name">{item.userName || item.userId}</span>
|
|
239
|
+
{item.role !== RoomParticipantRole.GeneralUser && (
|
|
240
|
+
<span className="role-tag">
|
|
241
|
+
{item.role === RoomParticipantRole.Owner ? '房主' : '管理员'}
|
|
242
|
+
</span>
|
|
243
|
+
)}
|
|
244
|
+
</div>
|
|
245
|
+
<div className="status-bar">
|
|
246
|
+
<i className={item.microphoneStatus === DeviceStatus.On ? 'icon-mic-on' : 'icon-mic-off'}></i>
|
|
247
|
+
<i className={item.cameraStatus === DeviceStatus.On ? 'icon-cam-on' : 'icon-cam-off'}></i>
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
))}
|
|
251
|
+
</div>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### 成员列表排序建议
|
|
257
|
+
|
|
258
|
+
成员列表通常需要结合会议场景进行排序。视频会议无 UI SDK 仅负责维护成员状态,最终展示顺序建议由业务层进行排序。
|
|
259
|
+
|
|
260
|
+
|**排序因素**|**说明**|
|
|
261
|
+
|---------|---------|
|
|
262
|
+
|本地用户|通常置顶,并展示“我”用于标识本地用户。|
|
|
263
|
+
|房主和管理员|优先展示,便于用户识别管理者。|
|
|
264
|
+
|屏幕共享成员|可置顶或展示“共享中”标识。|
|
|
265
|
+
|正在发言成员|可短暂前置或高亮展示麦克风 icon。|
|
|
266
|
+
|开启摄像头成员|可优先展示。|
|
|
267
|
+
|开启麦克风成员|可优先展示。|
|
|
268
|
+
|普通成员|可按昵称、入会时间或业务字段排序。|
|
|
269
|
+
|
|
270
|
+
【Vue3】
|
|
271
|
+
``` typescript
|
|
272
|
+
<script setup lang="ts">
|
|
273
|
+
import { computed } from 'vue';
|
|
274
|
+
import {
|
|
275
|
+
DeviceStatus,
|
|
276
|
+
RoomParticipantRole,
|
|
277
|
+
useRoomParticipantState,
|
|
278
|
+
} from 'tuikit-atomicx-vue3/room';
|
|
279
|
+
|
|
280
|
+
const {
|
|
281
|
+
localParticipant,
|
|
282
|
+
participantList,
|
|
283
|
+
participantWithScreen,
|
|
284
|
+
speakingUsers,
|
|
285
|
+
} = useRoomParticipantState();
|
|
286
|
+
|
|
287
|
+
const sortedParticipantList = computed(() => {
|
|
288
|
+
return [...participantList.value].sort((a, b) => {
|
|
289
|
+
const score = (participant) => {
|
|
290
|
+
if (participant.userId === localParticipant.value?.userId) return 100;
|
|
291
|
+
if (participant.role === RoomParticipantRole.Owner) return 90;
|
|
292
|
+
if (participant.role === RoomParticipantRole.Admin) return 80;
|
|
293
|
+
if (participant.userId === participantWithScreen.value?.userId) return 70;
|
|
294
|
+
if (speakingUsers.value.has(participant.userId)) return 60;
|
|
295
|
+
if (participant.cameraStatus === DeviceStatus.On) return 50;
|
|
296
|
+
if (participant.microphoneStatus === DeviceStatus.On) return 40;
|
|
297
|
+
return 0;
|
|
298
|
+
};
|
|
299
|
+
return score(b) - score(a);
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
</script>
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
【React】
|
|
306
|
+
``` typescript
|
|
307
|
+
import { useMemo } from 'react';
|
|
308
|
+
import {
|
|
309
|
+
DeviceStatus,
|
|
310
|
+
RoomParticipantRole,
|
|
311
|
+
useRoomParticipantState,
|
|
312
|
+
} from 'tuikit-atomicx-react/room';
|
|
313
|
+
|
|
314
|
+
const {
|
|
315
|
+
localParticipant,
|
|
316
|
+
participantList,
|
|
317
|
+
participantWithScreen,
|
|
318
|
+
speakingUsers,
|
|
319
|
+
} = useRoomParticipantState();
|
|
320
|
+
|
|
321
|
+
const sortedParticipantList = useMemo(() => {
|
|
322
|
+
return [...participantList].sort((a, b) => {
|
|
323
|
+
const score = (participant) => {
|
|
324
|
+
if (participant.userId === localParticipant?.userId) return 100;
|
|
325
|
+
if (participant.role === RoomParticipantRole.Owner) return 90;
|
|
326
|
+
if (participant.role === RoomParticipantRole.Admin) return 80;
|
|
327
|
+
if (participant.userId === participantWithScreen?.userId) return 70;
|
|
328
|
+
if (speakingUsers.has(participant.userId)) return 60;
|
|
329
|
+
if (participant.cameraStatus === DeviceStatus.On) return 50;
|
|
330
|
+
if (participant.microphoneStatus === DeviceStatus.On) return 40;
|
|
331
|
+
return 0;
|
|
332
|
+
};
|
|
333
|
+
return score(b) - score(a);
|
|
334
|
+
});
|
|
335
|
+
}, [participantList, localParticipant, participantWithScreen, speakingUsers]);
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
## 场景三:成员信息展示
|
|
339
|
+
|
|
340
|
+
成员列表可组合展示角色、音视频状态、发言状态和业务身份。
|
|
341
|
+
|
|
342
|
+
### 角色与设备状态
|
|
343
|
+
|
|
344
|
+
【Vue3】
|
|
345
|
+
``` typescript
|
|
346
|
+
<script setup lang="ts">
|
|
347
|
+
import {
|
|
348
|
+
DeviceStatus,
|
|
349
|
+
RoomParticipant,
|
|
350
|
+
RoomParticipantRole,
|
|
351
|
+
useRoomParticipantState,
|
|
352
|
+
} from 'tuikit-atomicx-vue3/room';
|
|
353
|
+
|
|
354
|
+
const { localParticipant } = useRoomParticipantState();
|
|
355
|
+
|
|
356
|
+
function getRoleText(role: RoomParticipantRole) {
|
|
357
|
+
if (role === RoomParticipantRole.Owner) return '房主';
|
|
358
|
+
if (role === RoomParticipantRole.Admin) return '管理员';
|
|
359
|
+
return '成员';
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
function isCameraOn(participant: RoomParticipant) {
|
|
363
|
+
return participant.cameraStatus === DeviceStatus.On;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
function isMicrophoneOn(participant: RoomParticipant) {
|
|
367
|
+
return participant.microphoneStatus === DeviceStatus.On;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
function isLocalUser(userId: string) {
|
|
371
|
+
return userId === localParticipant.value?.userId;
|
|
372
|
+
}
|
|
373
|
+
</script>
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
【React】
|
|
377
|
+
``` typescript
|
|
378
|
+
import {
|
|
379
|
+
DeviceStatus,
|
|
380
|
+
RoomParticipant,
|
|
381
|
+
RoomParticipantRole,
|
|
382
|
+
useRoomParticipantState,
|
|
383
|
+
} from 'tuikit-atomicx-react/room';
|
|
384
|
+
|
|
385
|
+
const { localParticipant } = useRoomParticipantState();
|
|
386
|
+
|
|
387
|
+
function getRoleText(role: RoomParticipantRole) {
|
|
388
|
+
if (role === RoomParticipantRole.Owner) return '房主';
|
|
389
|
+
if (role === RoomParticipantRole.Admin) return '管理员';
|
|
390
|
+
return '成员';
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
function isCameraOn(participant: RoomParticipant) {
|
|
394
|
+
return participant.cameraStatus === DeviceStatus.On;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
function isMicrophoneOn(participant: RoomParticipant) {
|
|
398
|
+
return participant.microphoneStatus === DeviceStatus.On;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
function isLocalUser(userId: string) {
|
|
402
|
+
return userId === localParticipant?.userId;
|
|
403
|
+
}
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
### 发言与音量感知
|
|
407
|
+
|
|
408
|
+
`speakingUsers` 可获取正在说话的用户及其音量大小,适合实现成员列表音量波纹、发言高亮、闭麦说话提醒等效果。
|
|
409
|
+
|
|
410
|
+
【Vue3】
|
|
411
|
+
``` typescript
|
|
412
|
+
<script setup lang="ts">
|
|
413
|
+
import { useRoomParticipantState } from 'tuikit-atomicx-vue3/room';
|
|
414
|
+
|
|
415
|
+
const { speakingUsers } = useRoomParticipantState();
|
|
416
|
+
|
|
417
|
+
function isSpeaking(userId: string) {
|
|
418
|
+
return speakingUsers.value.has(userId);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
function getVolume(userId: string) {
|
|
422
|
+
return speakingUsers.value.get(userId) || 0;
|
|
423
|
+
}
|
|
424
|
+
</script>
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
【React】
|
|
428
|
+
``` typescript
|
|
429
|
+
import { useRoomParticipantState } from 'tuikit-atomicx-react/room';
|
|
430
|
+
|
|
431
|
+
const { speakingUsers } = useRoomParticipantState();
|
|
432
|
+
|
|
433
|
+
function isSpeaking(userId: string) {
|
|
434
|
+
return speakingUsers.has(userId);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
function getVolume(userId: string) {
|
|
438
|
+
return speakingUsers.get(userId) || 0;
|
|
439
|
+
}
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### 视频与屏幕共享
|
|
443
|
+
|
|
444
|
+
可通过 `participantListWithVideo` 和 `participantWithScreen` 快速获取开启摄像头或正在屏幕共享的成员。
|
|
445
|
+
|
|
446
|
+
|**状态**|**说明**|**典型用途**|
|
|
447
|
+
|---------|---------|---------|
|
|
448
|
+
|`participantListWithVideo`|当前开启摄像头的成员列表。|视频成员筛选、视频宫格排序。|
|
|
449
|
+
|`participantWithScreen`|当前正在屏幕共享的成员。|展示“共享中”标识、屏幕共享置顶。|
|
|
450
|
+
|
|
451
|
+
【Vue3】
|
|
452
|
+
``` typescript
|
|
453
|
+
<script setup lang="ts">
|
|
454
|
+
import { useRoomParticipantState } from 'tuikit-atomicx-vue3/room';
|
|
455
|
+
|
|
456
|
+
const {
|
|
457
|
+
participantListWithVideo,
|
|
458
|
+
participantWithScreen,
|
|
459
|
+
} = useRoomParticipantState();
|
|
460
|
+
|
|
461
|
+
function isSharingScreen(userId: string) {
|
|
462
|
+
return participantWithScreen.value?.userId === userId;
|
|
463
|
+
}
|
|
464
|
+
</script>
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
【React】
|
|
468
|
+
``` typescript
|
|
469
|
+
import { useRoomParticipantState } from 'tuikit-atomicx-react/room';
|
|
470
|
+
|
|
471
|
+
const {
|
|
472
|
+
participantListWithVideo,
|
|
473
|
+
participantWithScreen,
|
|
474
|
+
} = useRoomParticipantState();
|
|
475
|
+
|
|
476
|
+
function isSharingScreen(userId: string) {
|
|
477
|
+
return participantWithScreen?.userId === userId;
|
|
478
|
+
}
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### 名片与扩展信息
|
|
482
|
+
|
|
483
|
+
业务可通过 `updateParticipantNameCard` 修改房间内展示名片,通过 `updateParticipantMetaData` 写入业务扩展信息。
|
|
484
|
+
|
|
485
|
+
|**目标**|**使用接口/状态**|**处理建议**|
|
|
486
|
+
|---------|---------|---------|
|
|
487
|
+
|修改成员名片|`updateParticipantNameCard`|房主、管理员可修改任意用户,普通用户只能修改自己。|
|
|
488
|
+
|写入业务扩展信息|`updateParticipantMetaData`|`metaData` 为键值对对象。|
|
|
489
|
+
|展示业务扩展信息|`participant.metaData`|在成员列表中读取并渲染。|
|
|
490
|
+
|
|
491
|
+
【Vue3】
|
|
492
|
+
``` typescript
|
|
493
|
+
<script setup lang="ts">
|
|
494
|
+
import { useRoomParticipantState } from 'tuikit-atomicx-vue3/room';
|
|
495
|
+
|
|
496
|
+
const {
|
|
497
|
+
updateParticipantNameCard,
|
|
498
|
+
updateParticipantMetaData,
|
|
499
|
+
} = useRoomParticipantState();
|
|
500
|
+
|
|
501
|
+
async function updateUserNameCard(userId: string) {
|
|
502
|
+
try {
|
|
503
|
+
await updateParticipantNameCard({
|
|
504
|
+
userId,
|
|
505
|
+
nameCard: '产品经理',
|
|
506
|
+
});
|
|
507
|
+
} catch (error) {
|
|
508
|
+
console.error('修改成员名片失败:', error);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
async function updateUserMetaData(userId: string) {
|
|
513
|
+
try {
|
|
514
|
+
await updateParticipantMetaData({
|
|
515
|
+
userId,
|
|
516
|
+
metaData: {
|
|
517
|
+
level: '1',
|
|
518
|
+
department: 'Product',
|
|
519
|
+
},
|
|
520
|
+
});
|
|
521
|
+
} catch (error) {
|
|
522
|
+
console.error('更新成员扩展信息失败:', error);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
</script>
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
【React】
|
|
529
|
+
``` typescript
|
|
530
|
+
import { useRoomParticipantState } from 'tuikit-atomicx-react/room';
|
|
531
|
+
|
|
532
|
+
const {
|
|
533
|
+
updateParticipantNameCard,
|
|
534
|
+
updateParticipantMetaData,
|
|
535
|
+
} = useRoomParticipantState();
|
|
536
|
+
|
|
537
|
+
async function updateUserNameCard(userId: string) {
|
|
538
|
+
try {
|
|
539
|
+
await updateParticipantNameCard({
|
|
540
|
+
userId,
|
|
541
|
+
nameCard: '产品经理',
|
|
542
|
+
});
|
|
543
|
+
} catch (error) {
|
|
544
|
+
console.error('修改成员名片失败:', error);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
async function updateUserMetaData(userId: string) {
|
|
549
|
+
try {
|
|
550
|
+
await updateParticipantMetaData({
|
|
551
|
+
userId,
|
|
552
|
+
metaData: {
|
|
553
|
+
level: '1',
|
|
554
|
+
department: 'Product',
|
|
555
|
+
},
|
|
556
|
+
});
|
|
557
|
+
} catch (error) {
|
|
558
|
+
console.error('更新成员扩展信息失败:', error);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
## 场景四:成员角色管理
|
|
564
|
+
|
|
565
|
+
仅房主有权限转让房主、设置管理员和撤销管理员。
|
|
566
|
+
|
|
567
|
+
### 角色管理
|
|
568
|
+
|
|
569
|
+
|**目标**|**使用接口/状态**|**权限要求**|
|
|
570
|
+
|---------|---------|---------|
|
|
571
|
+
|转让房主|`transferOwner`|仅房主可调用。|
|
|
572
|
+
|设置管理员|`setAdmin`|仅房主可调用。|
|
|
573
|
+
|撤销管理员|`revokeAdmin`|仅房主可调用。|
|
|
574
|
+
|判断本地权限|`localParticipant.role`|用于控制 UI 是否展示管理入口。|
|
|
575
|
+
|判断目标成员角色|`participant.role`|用于决定是否展示某个成员的管理菜单。|
|
|
576
|
+
|
|
577
|
+
### 示例代码
|
|
578
|
+
|
|
579
|
+
【Vue3】
|
|
580
|
+
``` typescript
|
|
581
|
+
import { computed } from 'vue';
|
|
582
|
+
import { RoomParticipantRole, useRoomParticipantState } from 'tuikit-atomicx-vue3/room';
|
|
583
|
+
|
|
584
|
+
const {
|
|
585
|
+
localParticipant,
|
|
586
|
+
transferOwner,
|
|
587
|
+
setAdmin,
|
|
588
|
+
revokeAdmin,
|
|
589
|
+
} = useRoomParticipantState();
|
|
590
|
+
|
|
591
|
+
const hasOwnerPermission = computed(() => localParticipant.value?.role === RoomParticipantRole.Owner);
|
|
592
|
+
|
|
593
|
+
async function setUserAsAdmin(userId: string) {
|
|
594
|
+
if (!hasOwnerPermission.value) return;
|
|
595
|
+
await setAdmin({ userId });
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
async function revokeUserAdmin(userId: string) {
|
|
599
|
+
if (!hasOwnerPermission.value) return;
|
|
600
|
+
await revokeAdmin({ userId });
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
async function transferRoomOwner(userId: string) {
|
|
604
|
+
if (!hasOwnerPermission.value) return;
|
|
605
|
+
await transferOwner({ userId });
|
|
606
|
+
}
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
【React】
|
|
610
|
+
``` typescript
|
|
611
|
+
import { useMemo } from 'react';
|
|
612
|
+
import { RoomParticipantRole, useRoomParticipantState } from 'tuikit-atomicx-react/room';
|
|
613
|
+
|
|
614
|
+
const {
|
|
615
|
+
localParticipant,
|
|
616
|
+
transferOwner,
|
|
617
|
+
setAdmin,
|
|
618
|
+
revokeAdmin,
|
|
619
|
+
} = useRoomParticipantState();
|
|
620
|
+
|
|
621
|
+
const hasOwnerPermission = useMemo(() => localParticipant?.role === RoomParticipantRole.Owner, [localParticipant?.role]);
|
|
622
|
+
|
|
623
|
+
async function setUserAsAdmin(userId: string) {
|
|
624
|
+
if (!hasOwnerPermission) return;
|
|
625
|
+
await setAdmin({ userId });
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
async function revokeUserAdmin(userId: string) {
|
|
629
|
+
if (!hasOwnerPermission) return;
|
|
630
|
+
await revokeAdmin({ userId });
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
async function transferRoomOwner(userId: string) {
|
|
634
|
+
if (!hasOwnerPermission) return;
|
|
635
|
+
await transferOwner({ userId });
|
|
636
|
+
}
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
## 场景五:会控协作
|
|
640
|
+
|
|
641
|
+
房主或管理员可维护会议秩序,包括关闭成员设备、全员禁用设备、禁用消息、处理设备申请和邀请成员开启设备。
|
|
642
|
+
|
|
643
|
+
会控操作生效后,视频会议 SDK 会自动更新对应的成员状态。业务 UI 可直接使用 `participant` 对象上的 `microphoneStatus`、`cameraStatus`、`screenShareStatus`、`isMessageDisabled` 等响应式属性,不需要依赖事件手动维护成员状态。无 UI SDK 抛出的事件监听可用于展示 toast、弹窗、系统通知等即时提示。
|
|
644
|
+
|
|
645
|
+
### 关闭指定成员媒体设备
|
|
646
|
+
|
|
647
|
+
房主或管理员可调用 `closeParticipantDevice` 强制关闭指定成员的麦克风、摄像头或屏幕分享。被关闭设备的用户会收到 `RoomParticipantEvent.onParticipantDeviceClosed` 事件,可在业务侧提示成员麦克风已被管理员关闭。
|
|
648
|
+
|
|
649
|
+
【Vue3】
|
|
650
|
+
``` typescript
|
|
651
|
+
import { DeviceType, useRoomParticipantState } from 'tuikit-atomicx-vue3/room';
|
|
652
|
+
|
|
653
|
+
const { closeParticipantDevice } = useRoomParticipantState();
|
|
654
|
+
|
|
655
|
+
async function closeUserMicrophone(userId: string) {
|
|
656
|
+
await closeParticipantDevice({
|
|
657
|
+
userId,
|
|
658
|
+
deviceType: DeviceType.Microphone,
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
async function closeUserCamera(userId: string) {
|
|
663
|
+
await closeParticipantDevice({
|
|
664
|
+
userId,
|
|
665
|
+
deviceType: DeviceType.Camera,
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
【React】
|
|
671
|
+
``` typescript
|
|
672
|
+
import { DeviceType, useRoomParticipantState } from 'tuikit-atomicx-react/room';
|
|
673
|
+
|
|
674
|
+
const { closeParticipantDevice } = useRoomParticipantState();
|
|
675
|
+
|
|
676
|
+
async function closeUserMicrophone(userId: string) {
|
|
677
|
+
await closeParticipantDevice({
|
|
678
|
+
userId,
|
|
679
|
+
deviceType: DeviceType.Microphone,
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
async function closeUserCamera(userId: string) {
|
|
684
|
+
await closeParticipantDevice({
|
|
685
|
+
userId,
|
|
686
|
+
deviceType: DeviceType.Camera,
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
### 禁用全员媒体设备
|
|
692
|
+
|
|
693
|
+
房主或管理员可以通过 `disableAllDevices` 禁用或启用全体成员的指定设备。禁用后,普通成员不能自行开启对应设备。
|
|
694
|
+
|
|
695
|
+
【Vue3】
|
|
696
|
+
``` typescript
|
|
697
|
+
import { DeviceType, useRoomParticipantState } from 'tuikit-atomicx-vue3/room';
|
|
698
|
+
|
|
699
|
+
const { disableAllDevices } = useRoomParticipantState();
|
|
700
|
+
|
|
701
|
+
async function disableAllMicrophones() {
|
|
702
|
+
await disableAllDevices({
|
|
703
|
+
deviceType: DeviceType.Microphone,
|
|
704
|
+
disable: true,
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
async function enableAllMicrophones() {
|
|
709
|
+
await disableAllDevices({
|
|
710
|
+
deviceType: DeviceType.Microphone,
|
|
711
|
+
disable: false,
|
|
712
|
+
});
|
|
713
|
+
}
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
【React】
|
|
717
|
+
``` typescript
|
|
718
|
+
import { DeviceType, useRoomParticipantState } from 'tuikit-atomicx-react/room';
|
|
719
|
+
|
|
720
|
+
const { disableAllDevices } = useRoomParticipantState();
|
|
721
|
+
|
|
722
|
+
async function disableAllMicrophones() {
|
|
723
|
+
await disableAllDevices({
|
|
724
|
+
deviceType: DeviceType.Microphone,
|
|
725
|
+
disable: true,
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
async function enableAllMicrophones() {
|
|
730
|
+
await disableAllDevices({
|
|
731
|
+
deviceType: DeviceType.Microphone,
|
|
732
|
+
disable: false,
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
```
|
|
736
|
+
|
|
737
|
+
### 禁用消息发送
|
|
738
|
+
|
|
739
|
+
成员消息权限分为“单独禁言”和“全体禁言”两类:
|
|
740
|
+
|
|
741
|
+
|**目标**|**使用接口**|**说明**|
|
|
742
|
+
|---------|---------|---------|
|
|
743
|
+
|禁用指定用户发消息|`disableUserMessage`|房主或管理员对房间内单个成员进行禁言或解禁。|
|
|
744
|
+
|全体禁言/解禁|`disableAllMessages`|房主或管理员对房间全体成员进行禁言或解禁。|
|
|
745
|
+
|
|
746
|
+
【Vue3】
|
|
747
|
+
``` typescript
|
|
748
|
+
import { useRoomParticipantState } from 'tuikit-atomicx-vue3/room';
|
|
749
|
+
|
|
750
|
+
const { disableUserMessage, disableAllMessages } = useRoomParticipantState();
|
|
751
|
+
|
|
752
|
+
async function disableUserChat(userId: string) {
|
|
753
|
+
await disableUserMessage({
|
|
754
|
+
userId,
|
|
755
|
+
disable: true,
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
async function disableRoomChat() {
|
|
760
|
+
await disableAllMessages({ disable: true });
|
|
761
|
+
}
|
|
762
|
+
```
|
|
763
|
+
|
|
764
|
+
【React】
|
|
765
|
+
``` typescript
|
|
766
|
+
import { useRoomParticipantState } from 'tuikit-atomicx-react/room';
|
|
767
|
+
|
|
768
|
+
const { disableUserMessage, disableAllMessages } = useRoomParticipantState();
|
|
769
|
+
|
|
770
|
+
async function disableUserChat(userId: string) {
|
|
771
|
+
await disableUserMessage({
|
|
772
|
+
userId,
|
|
773
|
+
disable: true,
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
async function disableRoomChat() {
|
|
778
|
+
await disableAllMessages({ disable: true });
|
|
779
|
+
}
|
|
780
|
+
```
|
|
781
|
+
|
|
782
|
+
### 普通成员申请开启设备
|
|
783
|
+
|
|
784
|
+
房主或管理员开启全员禁麦、全员禁摄像头等策略后,普通成员可向房主或管理员申请开启设备;
|
|
785
|
+
|
|
786
|
+
【Vue3】
|
|
787
|
+
``` typescript
|
|
788
|
+
import { DeviceType, useRoomParticipantState } from 'tuikit-atomicx-vue3/room';
|
|
789
|
+
|
|
790
|
+
const { requestToOpenDevice, cancelOpenDeviceRequest } = useRoomParticipantState();
|
|
791
|
+
|
|
792
|
+
async function requestToOpenMicrophone() {
|
|
793
|
+
await requestToOpenDevice({
|
|
794
|
+
device: DeviceType.Microphone,
|
|
795
|
+
timeout: 60,
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
async function cancelMicrophoneRequest() {
|
|
800
|
+
await cancelOpenDeviceRequest({
|
|
801
|
+
device: DeviceType.Microphone,
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
```
|
|
805
|
+
|
|
806
|
+
【React】
|
|
807
|
+
``` typescript
|
|
808
|
+
import { DeviceType, useRoomParticipantState } from 'tuikit-atomicx-react/room';
|
|
809
|
+
|
|
810
|
+
const { requestToOpenDevice, cancelOpenDeviceRequest } = useRoomParticipantState();
|
|
811
|
+
|
|
812
|
+
async function requestToOpenMicrophone() {
|
|
813
|
+
await requestToOpenDevice({
|
|
814
|
+
device: DeviceType.Microphone,
|
|
815
|
+
timeout: 60,
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
async function cancelMicrophoneRequest() {
|
|
820
|
+
await cancelOpenDeviceRequest({
|
|
821
|
+
device: DeviceType.Microphone,
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
```
|
|
825
|
+
|
|
826
|
+
### 房主/管理员处理设备申请
|
|
827
|
+
|
|
828
|
+
房主/管理员通过 `pendingDeviceApplications` 或 `RoomParticipantEvent.onDeviceRequestReceived` 获取待处理申请,并调用 `approveOpenDeviceRequest` 或 `rejectOpenDeviceRequest` 处理。
|
|
829
|
+
|
|
830
|
+
【Vue3】
|
|
831
|
+
``` typescript
|
|
832
|
+
<template>
|
|
833
|
+
<div class="device-application-list">
|
|
834
|
+
<div
|
|
835
|
+
v-for="application in pendingDeviceApplications"
|
|
836
|
+
:key="`${application.senderUserId}-${application.deviceType}-${application.timestamp}`"
|
|
837
|
+
class="device-application-item"
|
|
838
|
+
>
|
|
839
|
+
|
|
840
|
+
<div class="application-info">
|
|
841
|
+
<span class="name">
|
|
842
|
+
{{ application.senderNameCard || application.senderUserName || application.senderUserId }}
|
|
843
|
+
</span>
|
|
844
|
+
<span class="desc">
|
|
845
|
+
申请开启{{ getDeviceName(application.deviceType) }}
|
|
846
|
+
</span>
|
|
847
|
+
</div>
|
|
848
|
+
<button @click="approveDeviceApplication(application)">同意</button>
|
|
849
|
+
<button @click="rejectDeviceApplication(application)">拒绝</button>
|
|
850
|
+
</div>
|
|
851
|
+
</div>
|
|
852
|
+
</template>
|
|
853
|
+
|
|
854
|
+
<script setup lang="ts">
|
|
855
|
+
import { onBeforeUnmount, onMounted } from 'vue';
|
|
856
|
+
import {
|
|
857
|
+
type DeviceRequestInfo,
|
|
858
|
+
DeviceType,
|
|
859
|
+
RoomParticipantEvent,
|
|
860
|
+
useRoomParticipantState,
|
|
861
|
+
} from 'tuikit-atomicx-vue3/room';
|
|
862
|
+
|
|
863
|
+
const {
|
|
864
|
+
pendingDeviceApplications,
|
|
865
|
+
approveOpenDeviceRequest,
|
|
866
|
+
rejectOpenDeviceRequest,
|
|
867
|
+
subscribeEvent,
|
|
868
|
+
unsubscribeEvent,
|
|
869
|
+
} = useRoomParticipantState();
|
|
870
|
+
|
|
871
|
+
function getDeviceName(deviceType: DeviceType) {
|
|
872
|
+
if (deviceType === DeviceType.Microphone) return '麦克风';
|
|
873
|
+
if (deviceType === DeviceType.Camera) return '摄像头';
|
|
874
|
+
return '屏幕分享';
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
async function approveDeviceApplication(application: DeviceRequestInfo) {
|
|
878
|
+
await approveOpenDeviceRequest({
|
|
879
|
+
userId: application.senderUserId,
|
|
880
|
+
device: application.deviceType,
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
async function rejectDeviceApplication(application: DeviceRequestInfo) {
|
|
885
|
+
await rejectOpenDeviceRequest({
|
|
886
|
+
userId: application.senderUserId,
|
|
887
|
+
device: application.deviceType,
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
</script>
|
|
891
|
+
```
|
|
892
|
+
|
|
893
|
+
【React】
|
|
894
|
+
``` typescript
|
|
895
|
+
import {
|
|
896
|
+
type DeviceRequestInfo,
|
|
897
|
+
DeviceType,
|
|
898
|
+
useRoomParticipantState,
|
|
899
|
+
} from 'tuikit-atomicx-react/room';
|
|
900
|
+
|
|
901
|
+
export default function DeviceApplicationList() {
|
|
902
|
+
const {
|
|
903
|
+
pendingDeviceApplications,
|
|
904
|
+
approveOpenDeviceRequest,
|
|
905
|
+
rejectOpenDeviceRequest,
|
|
906
|
+
} = useRoomParticipantState();
|
|
907
|
+
|
|
908
|
+
function getDeviceName(deviceType: DeviceType) {
|
|
909
|
+
if (deviceType === DeviceType.Microphone) return '麦克风';
|
|
910
|
+
if (deviceType === DeviceType.Camera) return '摄像头';
|
|
911
|
+
return '屏幕分享';
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
async function approveDeviceApplication(application: DeviceRequestInfo) {
|
|
915
|
+
await approveOpenDeviceRequest({
|
|
916
|
+
userId: application.senderUserId,
|
|
917
|
+
device: application.deviceType,
|
|
918
|
+
});
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
async function rejectDeviceApplication(application: DeviceRequestInfo) {
|
|
922
|
+
await rejectOpenDeviceRequest({
|
|
923
|
+
userId: application.senderUserId,
|
|
924
|
+
device: application.deviceType,
|
|
925
|
+
});
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
return (
|
|
929
|
+
<div className="device-application-list">
|
|
930
|
+
{pendingDeviceApplications.map(application => (
|
|
931
|
+
<div
|
|
932
|
+
key={`${application.senderUserId}-${application.deviceType}-${application.timestamp}`}
|
|
933
|
+
className="device-application-item"
|
|
934
|
+
>
|
|
935
|
+
|
|
936
|
+
<div className="application-info">
|
|
937
|
+
<span className="name">
|
|
938
|
+
{application.senderNameCard || application.senderUserName || application.senderUserId}
|
|
939
|
+
</span>
|
|
940
|
+
<span className="desc">
|
|
941
|
+
申请开启{getDeviceName(application.deviceType)}
|
|
942
|
+
</span>
|
|
943
|
+
</div>
|
|
944
|
+
<button onClick={() => approveDeviceApplication(application)}>同意</button>
|
|
945
|
+
<button onClick={() => rejectDeviceApplication(application)}>拒绝</button>
|
|
946
|
+
</div>
|
|
947
|
+
))}
|
|
948
|
+
</div>
|
|
949
|
+
);
|
|
950
|
+
}
|
|
951
|
+
```
|
|
952
|
+
|
|
953
|
+
|**状态 / 事件**|**触发时机**|**处理建议**|
|
|
954
|
+
|---------|---------|---------|
|
|
955
|
+
|`pendingDeviceApplications`|当前待房主/管理员处理的设备开启申请。|用于渲染待处理申请列表。|
|
|
956
|
+
|`RoomParticipantEvent.onDeviceRequestReceived`|房主/管理员收到成员申请。|展示审批弹窗或申请入口提醒。|
|
|
957
|
+
|`RoomParticipantEvent.onDeviceRequestCancelled`|申请者取消申请。|移除待处理申请。|
|
|
958
|
+
|`RoomParticipantEvent.onDeviceRequestTimeout`|申请超时。|提示申请已失效,并刷新申请列表。|
|
|
959
|
+
|`RoomParticipantEvent.onDeviceRequestApproved`|申请被批准。|申请者可继续打开对应设备。|
|
|
960
|
+
|`RoomParticipantEvent.onDeviceRequestRejected`|申请被拒绝。|申请者展示拒绝提示。|
|
|
961
|
+
|`RoomParticipantEvent.onDeviceRequestProcessed`|申请已被其他管理员处理。|关闭本地审批入口,避免重复处理。|
|
|
962
|
+
|
|
963
|
+
### 房主/管理员邀请成员开启设备
|
|
964
|
+
|
|
965
|
+
普通成员未开启摄像头或麦克风设备时,房主或管理员可邀请普通成员开启设备;
|
|
966
|
+
|
|
967
|
+
【Vue3】
|
|
968
|
+
``` typescript
|
|
969
|
+
import { DeviceType, useRoomParticipantState } from 'tuikit-atomicx-vue3/room';
|
|
970
|
+
|
|
971
|
+
const {
|
|
972
|
+
inviteToOpenDevice,
|
|
973
|
+
cancelOpenDeviceInvitation,
|
|
974
|
+
acceptOpenDeviceInvitation,
|
|
975
|
+
declineOpenDeviceInvitation,
|
|
976
|
+
} = useRoomParticipantState();
|
|
977
|
+
|
|
978
|
+
async function inviteUserToOpenCamera(userId: string) {
|
|
979
|
+
await inviteToOpenDevice({
|
|
980
|
+
userId,
|
|
981
|
+
device: DeviceType.Camera,
|
|
982
|
+
timeout: 60,
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
```
|
|
986
|
+
|
|
987
|
+
【React】
|
|
988
|
+
``` typescript
|
|
989
|
+
import { DeviceType, useRoomParticipantState } from 'tuikit-atomicx-react/room';
|
|
990
|
+
|
|
991
|
+
const {
|
|
992
|
+
inviteToOpenDevice,
|
|
993
|
+
cancelOpenDeviceInvitation,
|
|
994
|
+
acceptOpenDeviceInvitation,
|
|
995
|
+
declineOpenDeviceInvitation,
|
|
996
|
+
} = useRoomParticipantState();
|
|
997
|
+
|
|
998
|
+
async function inviteUserToOpenCamera(userId: string) {
|
|
999
|
+
await inviteToOpenDevice({
|
|
1000
|
+
userId,
|
|
1001
|
+
device: DeviceType.Camera,
|
|
1002
|
+
timeout: 60,
|
|
1003
|
+
});
|
|
1004
|
+
}
|
|
1005
|
+
```
|
|
1006
|
+
|
|
1007
|
+
|**状态 / 事件**|**触发时机**|**处理建议**|
|
|
1008
|
+
|---------|---------|---------|
|
|
1009
|
+
|`pendingDeviceInvitations`|本地用户待处理的设备开启邀请。|用于渲染邀请弹窗或入口提醒。|
|
|
1010
|
+
|`RoomParticipantEvent.onDeviceInvitationReceived`|成员收到房主/管理员邀请。|展示接受/拒绝入口。|
|
|
1011
|
+
|`RoomParticipantEvent.onDeviceInvitationCancelled`|房主/管理员取消邀请。|关闭邀请弹窗。|
|
|
1012
|
+
|`RoomParticipantEvent.onDeviceInvitationTimeout`|邀请超时。|提示邀请已失效。|
|
|
1013
|
+
|`RoomParticipantEvent.onDeviceInvitationAccepted`|成员接受邀请。|管理员侧更新邀请状态。|
|
|
1014
|
+
|`RoomParticipantEvent.onDeviceInvitationDeclined`|成员拒绝邀请。|管理员侧展示拒绝结果。|
|
|
1015
|
+
|
|
1016
|
+
> **说明:**
|
|
1017
|
+
>
|
|
1018
|
+
|
|
1019
|
+
> 设备申请和邀请的完整设备打开流程请参考设备管理文档。成员管理文档主要说明成员之间的权限协作关系。
|
|
1020
|
+
>
|
|
1021
|
+
|
|
1022
|
+
## 场景六:事件监听处理
|
|
1023
|
+
|
|
1024
|
+
成员被踢出房间、设备被管理员关闭等场景,可通过事件监听展示 toast、弹窗等提示。成员列表和设备状态仍以 `participant` 对象上的响应式属性为准。订阅事件放在 `onMounted`,取消订阅放在 `onBeforeUnmount`,避免组件销毁后继续响应事件。
|
|
1025
|
+
|
|
1026
|
+
【Vue3】
|
|
1027
|
+
``` typescript
|
|
1028
|
+
import { onMounted, onUnmounted } from 'vue';
|
|
1029
|
+
import {
|
|
1030
|
+
RoomParticipantEvent,
|
|
1031
|
+
useRoomParticipantState,
|
|
1032
|
+
} from 'tuikit-atomicx-vue3/room';
|
|
1033
|
+
|
|
1034
|
+
const { subscribeEvent, unsubscribeEvent } = useRoomParticipantState();
|
|
1035
|
+
|
|
1036
|
+
function onKickedFromRoom({ reason, message }) {
|
|
1037
|
+
console.warn('当前用户已被移出房间:', reason, message);
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
function onParticipantDeviceClosed({ device, operator }) {
|
|
1041
|
+
console.warn('设备已被管理员关闭:', device, operator);
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
onMounted(() => {
|
|
1045
|
+
subscribeEvent(RoomParticipantEvent.onKickedFromRoom, onKickedFromRoom);
|
|
1046
|
+
subscribeEvent(RoomParticipantEvent.onParticipantDeviceClosed, onParticipantDeviceClosed);
|
|
1047
|
+
});
|
|
1048
|
+
|
|
1049
|
+
onUnmounted(() => {
|
|
1050
|
+
unsubscribeEvent(RoomParticipantEvent.onKickedFromRoom, onKickedFromRoom);
|
|
1051
|
+
unsubscribeEvent(RoomParticipantEvent.onParticipantDeviceClosed, onParticipantDeviceClosed);
|
|
1052
|
+
});
|
|
1053
|
+
```
|
|
1054
|
+
|
|
1055
|
+
【React】
|
|
1056
|
+
``` typescript
|
|
1057
|
+
import { useEffect } from 'react';
|
|
1058
|
+
import {
|
|
1059
|
+
RoomParticipantEvent,
|
|
1060
|
+
useRoomParticipantState,
|
|
1061
|
+
} from 'tuikit-atomicx-react/room';
|
|
1062
|
+
|
|
1063
|
+
const { subscribeEvent, unsubscribeEvent } = useRoomParticipantState();
|
|
1064
|
+
|
|
1065
|
+
function onKickedFromRoom({ reason, message }) {
|
|
1066
|
+
console.warn('当前用户已被移出房间:', reason, message);
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
function onParticipantDeviceClosed({ device, operator }) {
|
|
1070
|
+
console.warn('设备已被管理员关闭:', device, operator);
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
useEffect(() => {
|
|
1074
|
+
subscribeEvent(RoomParticipantEvent.onKickedFromRoom, onKickedFromRoom);
|
|
1075
|
+
subscribeEvent(RoomParticipantEvent.onParticipantDeviceClosed, onParticipantDeviceClosed);
|
|
1076
|
+
return () => {
|
|
1077
|
+
unsubscribeEvent(RoomParticipantEvent.onKickedFromRoom, onKickedFromRoom);
|
|
1078
|
+
unsubscribeEvent(RoomParticipantEvent.onParticipantDeviceClosed, onParticipantDeviceClosed);
|
|
1079
|
+
};
|
|
1080
|
+
}, []);
|
|
1081
|
+
```
|
|
1082
|
+
|
|
1083
|
+
## API 文档
|
|
1084
|
+
|
|
1085
|
+
|**State/Component**|**功能描述**|**API 文档**|
|
|
1086
|
+
|---------|---------|---------|
|
|
1087
|
+
|**useRoomParticipantState**|包含房间内用户数据,用户管理接口。|[API 文档](https://web.sdk.qcloud.com/trtc/live/web/doc/zh/index.html#module-RoomParticipantState)|
|
|
1088
|
+
|
|
1089
|
+
## 常见问题
|
|
1090
|
+
|
|
1091
|
+
### 成员列表应该如何排序?
|
|
1092
|
+
|
|
1093
|
+
建议业务层自行排序。常见做法是本地用户、房主、管理员、屏幕共享成员、正在发言成员、开启摄像头成员优先展示,其余成员按昵称、入会时间或业务字段排序。
|
|
1094
|
+
|
|
1095
|
+
### 为什么调用成员管理接口失败?
|
|
1096
|
+
|
|
1097
|
+
常见原因包括当前用户无权限、目标用户已离开房间、申请或邀请已超时。建议使用 `try/catch` 处理失败,并在失败后刷新成员列表或待处理申请列表。
|
|
1098
|
+
|
|
1099
|
+
### 成员自定义信息应该使用 `nameCard` 还是 `metaData`?
|
|
1100
|
+
|
|
1101
|
+
如果只是修改成员在房间内展示的名片,使用 `updateParticipantNameCard`。如果需要存储业务扩展字段,例如职务、等级、购买状态,使用 `updateParticipantMetaData`。
|
|
1102
|
+
|
|
1103
|
+
### 如何避免普通成员误触管理操作?
|
|
1104
|
+
|
|
1105
|
+
建议在 UI 层基于 `RoomParticipantRole.Owner` 和 `RoomParticipantRole.Admin` 判断权限,只向房主和管理员展示管理入口。同时接口调用仍需使用 `try/catch` 兜底处理无权限错误。
|