@trtc/calls-uikit-vue 4.1.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.
- package/README-zh_CN.md +83 -0
- package/README.md +89 -0
- package/debug/GenerateTestUserSig-es.js +26 -0
- package/debug/lib-generate-test-usersig-es.min.js +2 -0
- package/package.json +42 -0
- package/src/Components/TUICallKit.vue +334 -0
- package/src/Components/assets/MicrophoneVolume/desktop/mic-off.svg +5 -0
- package/src/Components/assets/MicrophoneVolume/desktop/mic-on.svg +5 -0
- package/src/Components/assets/base/close.svg +1 -0
- package/src/Components/assets/base/error.svg +1 -0
- package/src/Components/assets/base/info.svg +1 -0
- package/src/Components/assets/base/loading-circle.svg +1 -0
- package/src/Components/assets/base/success.svg +1 -0
- package/src/Components/assets/base/waring.svg +1 -0
- package/src/Components/assets/button/accept.svg +1 -0
- package/src/Components/assets/button/background-blur-close.svg +1 -0
- package/src/Components/assets/button/background-blur-open.svg +1 -0
- package/src/Components/assets/button/camera-close.svg +1 -0
- package/src/Components/assets/button/camera-open.svg +1 -0
- package/src/Components/assets/button/desktop/arrow.png +0 -0
- package/src/Components/assets/button/desktop/fullScreen.svg +4 -0
- package/src/Components/assets/button/desktop/inviteUser.svg +1 -0
- package/src/Components/assets/button/desktop/minimize.svg +6 -0
- package/src/Components/assets/button/hangup.svg +1 -0
- package/src/Components/assets/button/microphone-close.svg +1 -0
- package/src/Components/assets/button/microphone-open.svg +1 -0
- package/src/Components/assets/button/mobile/down.svg +1 -0
- package/src/Components/assets/button/mobile/inviteUser.svg +1 -0
- package/src/Components/assets/button/mobile/minimize.svg +1 -0
- package/src/Components/assets/button/mobile/switch-camera.svg +1 -0
- package/src/Components/assets/button/mobile/up.svg +1 -0
- package/src/Components/assets/button/speaker-close.svg +1 -0
- package/src/Components/assets/button/speaker-open.svg +1 -0
- package/src/Components/assets/button/switch-audio.svg +1 -0
- package/src/Components/assets/common/arrows.svg +1 -0
- package/src/Components/assets/common/call.svg +1 -0
- package/src/Components/assets/common/close.svg +1 -0
- package/src/Components/assets/common/defaultAvatar.svg +1 -0
- package/src/Components/assets/common/loading-audio.svg +1 -0
- package/src/Components/assets/common/loading-video.png +0 -0
- package/src/Components/assets/common/microphone-volumn-close.svg +1 -0
- package/src/Components/assets/desktop/acceptAudio.svg +4 -0
- package/src/Components/assets/desktop/acceptVideo.svg +8 -0
- package/src/Components/assets/desktop/arrow.png +0 -0
- package/src/Components/assets/desktop/camera-false.svg +5 -0
- package/src/Components/assets/desktop/camera.svg +6 -0
- package/src/Components/assets/desktop/floatCallEnd.svg +3 -0
- package/src/Components/assets/desktop/floatFullScreen.svg +3 -0
- package/src/Components/assets/desktop/floatMicrophone.svg +4 -0
- package/src/Components/assets/desktop/floatMicrophoneClosed.svg +3 -0
- package/src/Components/assets/desktop/fullScreen.svg +4 -0
- package/src/Components/assets/desktop/hangup.svg +4 -0
- package/src/Components/assets/desktop/invite_user.svg +5 -0
- package/src/Components/assets/desktop/microphone-false.svg +8 -0
- package/src/Components/assets/desktop/microphone.svg +9 -0
- package/src/Components/assets/desktop/minimize.svg +6 -0
- package/src/Components/assets/desktop/permission/index.ts +11 -0
- package/src/Components/assets/desktop/permission/mac/permit-en.jpg +0 -0
- package/src/Components/assets/desktop/permission/mac/permit-zh.jpg +0 -0
- package/src/Components/assets/desktop/permission/win/permit-en.png +0 -0
- package/src/Components/assets/desktop/permission/win/permit-zh.png +0 -0
- package/src/Components/assets/desktop/switchScreen.svg +5 -0
- package/src/Components/assets/desktop/trans.svg +6 -0
- package/src/Components/assets/floatingWindow/desktop/floatCallEnd.svg +3 -0
- package/src/Components/assets/floatingWindow/desktop/floatFullScreen.svg +3 -0
- package/src/Components/assets/floatingWindow/desktop/floatMicrophone.svg +4 -0
- package/src/Components/assets/floatingWindow/desktop/floatMicrophoneClosed.svg +3 -0
- package/src/Components/assets/floatingWindow/mobile/camera-close.svg +1 -0
- package/src/Components/assets/floatingWindow/mobile/camera-open.svg +1 -0
- package/src/Components/assets/floatingWindow/mobile/earphone.svg +1 -0
- package/src/Components/assets/floatingWindow/mobile/microphone-close.svg +1 -0
- package/src/Components/assets/floatingWindow/mobile/microphone-open.svg +1 -0
- package/src/Components/assets/permission/desktop/index.ts +11 -0
- package/src/Components/assets/permission/desktop/mac/permit-en.jpg +0 -0
- package/src/Components/assets/permission/desktop/mac/permit-zh.jpg +0 -0
- package/src/Components/assets/permission/desktop/win/permit-en.png +0 -0
- package/src/Components/assets/permission/desktop/win/permit-zh.png +0 -0
- package/src/Components/assets/streamInfo/mobile/mic-off-h5.svg +1 -0
- package/src/Components/assets/streamInfo/mobile/mic-on-h5.svg +1 -0
- package/src/Components/assets/streamInfo/mobile/microphone-close-group.svg +1 -0
- package/src/Components/assets/streamInfo/mobile/microphone-close-single.svg +1 -0
- package/src/Components/assets/streamInfo/mobile/volumn.svg +1 -0
- package/src/Components/assets/streamInfo/networkStatus.png +0 -0
- package/src/Components/components/GroupCall/BackGround/BackGround.vue +20 -0
- package/src/Components/components/GroupCall/GroupCall.vue +129 -0
- package/src/Components/components/GroupCall/MediaContainer/MediaContainer.vue +267 -0
- package/src/Components/components/GroupCall/MediaContainer/StreamLoading/StreamLoading.vue +22 -0
- package/src/Components/components/SingleCall/MediaContainer/MediaContainer.vue +165 -0
- package/src/Components/components/SingleCall/SingleCall.vue +28 -0
- package/src/Components/components/SingleCall/hooks/useGetLargeViewName.ts +32 -0
- package/src/Components/components/base/Avatar/Avatar.ts +38 -0
- package/src/Components/components/base/Avatar/Avatar.vue +53 -0
- package/src/Components/components/base/Avatar/style/Avatar.scss +40 -0
- package/src/Components/components/base/Button/Button.ts +60 -0
- package/src/Components/components/base/Button/Button.vue +61 -0
- package/src/Components/components/base/Button/style/Button.scss +42 -0
- package/src/Components/components/base/Grid/Grid.ts +26 -0
- package/src/Components/components/base/Grid/Grid.vue +40 -0
- package/src/Components/components/base/Grid/GridItem/GridItem.vue +81 -0
- package/src/Components/components/base/Grid/GridItem/style/GridItem.scss +13 -0
- package/src/Components/components/base/Icon/Icon.ts +9 -0
- package/src/Components/components/base/Icon/Icon.vue +21 -0
- package/src/Components/components/base/Layout/Col/Col.ts +23 -0
- package/src/Components/components/base/Layout/Col/Col.vue +46 -0
- package/src/Components/components/base/Layout/Col/style/Col.scss +9 -0
- package/src/Components/components/base/Layout/Row/Row.ts +23 -0
- package/src/Components/components/base/Layout/Row/Row.vue +38 -0
- package/src/Components/components/base/Layout/Row/style/Row.scss +10 -0
- package/src/Components/components/base/Layout/constant.ts +1 -0
- package/src/Components/components/base/Loading/Circle/Circle.ts +13 -0
- package/src/Components/components/base/Loading/Circle/Circle.vue +36 -0
- package/src/Components/components/base/Loading/Circle/style/Circle.scss +26 -0
- package/src/Components/components/base/Loading/Dot/Dot.ts +13 -0
- package/src/Components/components/base/Loading/Dot/Dot.vue +44 -0
- package/src/Components/components/base/Loading/Dot/style/Dot.scss +61 -0
- package/src/Components/components/base/Loading/Loading.ts +29 -0
- package/src/Components/components/base/Loading/Loading.vue +36 -0
- package/src/Components/components/base/Loading/style/Loading.scss +18 -0
- package/src/Components/components/base/Message/Message.ts +117 -0
- package/src/Components/components/base/Message/Message.vue +60 -0
- package/src/Components/components/base/Message/style/Message.scss +49 -0
- package/src/Components/components/base/MessageGroup/MessageGroup.vue +37 -0
- package/src/Components/components/base/Overlay/Overlay.ts +46 -0
- package/src/Components/components/base/Overlay/Overlay.vue +75 -0
- package/src/Components/components/base/Overlay/style/Overlay.scss +40 -0
- package/src/Components/components/base/Popover/Popover.ts +36 -0
- package/src/Components/components/base/Popover/Popover.vue +40 -0
- package/src/Components/components/base/Popover/PopoverWeb/PopoverWeb.vue +110 -0
- package/src/Components/components/base/Popover/PopoverWx/PopoverWx.vue +15 -0
- package/src/Components/components/base/Popover/style/Popover.scss +30 -0
- package/src/Components/components/base/Popover/utils/calculatePosition.ts +50 -0
- package/src/Components/components/base/Portal/Portal.ts +14 -0
- package/src/Components/components/base/Portal/Portal.vue +22 -0
- package/src/Components/components/base/Portal/miniprogram/Portal.vue +20 -0
- package/src/Components/components/base/Portal/vue2/Portal.vue +53 -0
- package/src/Components/components/base/Portal/vue3/Portal.vue +19 -0
- package/src/Components/components/base/TKImage/TKImage.ts +34 -0
- package/src/Components/components/base/TKImage/TKImage.vue +77 -0
- package/src/Components/components/base/TKImage/style/TKImage.scss +20 -0
- package/src/Components/components/base/TKText/TKText.ts +24 -0
- package/src/Components/components/base/TKText/TKText.vue +43 -0
- package/src/Components/components/base/TKText/style/TKText.scss +19 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindow.ts +19 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindow.vue +46 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.ts +5 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.vue +62 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindowItem/style/ToggleWindowItem.scss +38 -0
- package/src/Components/components/base/ToggleWindow/constant.ts +1 -0
- package/src/Components/components/base/ToggleWindow/style/ToggleWindow.scss +7 -0
- package/src/Components/components/base/assets/message/close.svg +5 -0
- package/src/Components/components/base/assets/message/error.svg +1 -0
- package/src/Components/components/base/assets/message/info.svg +1 -0
- package/src/Components/components/base/assets/message/success.svg +1 -0
- package/src/Components/components/base/assets/message/warning.svg +1 -0
- package/src/Components/components/base/constants/index.ts +8 -0
- package/src/Components/components/base/hooks/useListenerEvent.ts +36 -0
- package/src/Components/components/base/hooks/useOnClickOutSide.ts +27 -0
- package/src/Components/components/base/styles/common.scss +43 -0
- package/src/Components/components/base/styles/var.scss +132 -0
- package/src/Components/components/base/util/checkEnv.ts +51 -0
- package/src/Components/components/base/util/checkVueVersion.ts +11 -0
- package/src/Components/components/base/util/classNames.ts +34 -0
- package/src/Components/components/base/util/filterObject.ts +11 -0
- package/src/Components/components/base/util/index.ts +10 -0
- package/src/Components/components/common/AudioStream/AudioStream.ts +29 -0
- package/src/Components/components/common/AudioStream/AudioStream.vue +65 -0
- package/src/Components/components/common/Button/Accept.vue +66 -0
- package/src/Components/components/common/Button/Camera.vue +115 -0
- package/src/Components/components/common/Button/FullScreen.vue +32 -0
- package/src/Components/components/common/Button/Hangup.vue +57 -0
- package/src/Components/components/common/Button/InviteUser.vue +52 -0
- package/src/Components/components/common/Button/Microphone.vue +109 -0
- package/src/Components/components/common/Button/Minimize.vue +39 -0
- package/src/Components/components/common/Button/Reject.vue +52 -0
- package/src/Components/components/common/Button/Speaker.vue +98 -0
- package/src/Components/components/common/Button/SwitchCamera.vue +58 -0
- package/src/Components/components/common/Button/ToggleButtonPanel.vue +44 -0
- package/src/Components/components/common/Button/VirtualBackground.vue +76 -0
- package/src/Components/components/common/Button/hooks/useConfig.ts +33 -0
- package/src/Components/components/common/Button/props/Button.ts +15 -0
- package/src/Components/components/common/Button/style/common.scss +5 -0
- package/src/Components/components/common/Button/style/desktop.scss +49 -0
- package/src/Components/components/common/Button/style/index.scss +2 -0
- package/src/Components/components/common/Button/style/mobile.scss +63 -0
- package/src/Components/components/common/ButtonPanel/ButtonPanel.vue +238 -0
- package/src/Components/components/common/ButtonPanel/config/InitConfig.ts +248 -0
- package/src/Components/components/common/ButtonPanel/config/VirtualBackgroundMobileConfig.ts +29 -0
- package/src/Components/components/common/ButtonPanel/hooks/useButtonPanelLayout.ts +63 -0
- package/src/Components/components/common/DeviceSelect/DeviceSelect.ts +11 -0
- package/src/Components/components/common/DeviceSelect/DeviceSelect.vue +158 -0
- package/src/Components/components/common/FloatWindow/FloatWindow.vue +64 -0
- package/src/Components/components/common/FloatWindow/desktop/FloatWindow.vue +106 -0
- package/src/Components/components/common/FloatWindow/mobile/FloatWindow.vue +28 -0
- package/src/Components/components/common/FloatWindow/mobile/FloatWindowGroupCall.vue +141 -0
- package/src/Components/components/common/FloatWindow/mobile/FloatWindowSingleCall.vue +109 -0
- package/src/Components/components/common/JoinGroupCard/JoinGroupCard.vue +51 -0
- package/src/Components/components/common/JoinGroupCard/desktop/JoinGroupCard.scss +80 -0
- package/src/Components/components/common/JoinGroupCard/desktop/JoinGroupCard.vue +57 -0
- package/src/Components/components/common/JoinGroupCard/mobile/JoinGroupCard.scss +60 -0
- package/src/Components/components/common/JoinGroupCard/mobile/JoinGroupCard.vue +65 -0
- package/src/Components/components/common/MicVolume/MicVolume.vue +37 -0
- package/src/Components/components/common/MicVolume/MicVolumeClosed.vue +11 -0
- package/src/Components/components/common/MicrophoneVolume/MicrophoneVolume.ts +10 -0
- package/src/Components/components/common/MicrophoneVolume/MicrophoneVolume.vue +61 -0
- package/src/Components/components/common/OverlayStream/OverlayStream.ts +102 -0
- package/src/Components/components/common/OverlayStream/OverlayStream.vue +104 -0
- package/src/Components/components/common/OverlayStream/style/OverlayStream.scss +12 -0
- package/src/Components/components/common/OverlayStream/style/mobile.scss +32 -0
- package/src/Components/components/common/OverlayStream/style/pc.scss +21 -0
- package/src/Components/components/common/PermitTip/CloseIcon.vue +3 -0
- package/src/Components/components/common/PermitTip/PermitTip.ts +33 -0
- package/src/Components/components/common/PermitTip/PermitTip.vue +62 -0
- package/src/Components/components/common/PermitTip/SystemPermitTip.vue +160 -0
- package/src/Components/components/common/Player/Player.ts +18 -0
- package/src/Components/components/common/Player/Player.vue +59 -0
- package/src/Components/components/common/Player/WeChatPlayer/WeChatPlayer.vue +101 -0
- package/src/Components/components/common/Player/WeChatPlayer/style/index.scss +38 -0
- package/src/Components/components/common/Popover/Popover.vue +85 -0
- package/src/Components/components/common/Pusher/Pusher.ts +18 -0
- package/src/Components/components/common/Pusher/Pusher.vue +78 -0
- package/src/Components/components/common/Pusher/WeChatPusher/WeChatPusher.vue +70 -0
- package/src/Components/components/common/Pusher/WeChatPusher/style/index.scss +37 -0
- package/src/Components/components/common/SelectUser/SelectUser.vue +74 -0
- package/src/Components/components/common/SelectUser/components/Dialog/TDialog.vue +94 -0
- package/src/Components/components/common/SelectUser/components/Dialog/style/color.css +43 -0
- package/src/Components/components/common/SelectUser/components/Dialog/style/dialog.css +3 -0
- package/src/Components/components/common/SelectUser/components/Dialog/style/h5.css +49 -0
- package/src/Components/components/common/SelectUser/components/Dialog/style/web.css +55 -0
- package/src/Components/components/common/SelectUser/components/Icon/TIcon.vue +44 -0
- package/src/Components/components/common/SelectUser/components/Icon/style/icon.css +6 -0
- package/src/Components/components/common/SelectUser/components/Transfer/TTransfer.vue +304 -0
- package/src/Components/components/common/SelectUser/components/Transfer/icon/back.svg +16 -0
- package/src/Components/components/common/SelectUser/components/Transfer/icon/cancel.svg +23 -0
- package/src/Components/components/common/SelectUser/components/Transfer/icon/selected.svg +27 -0
- package/src/Components/components/common/SelectUser/components/Transfer/style/color.css +64 -0
- package/src/Components/components/common/SelectUser/components/Transfer/style/h5.css +86 -0
- package/src/Components/components/common/SelectUser/components/Transfer/style/transfer.css +17 -0
- package/src/Components/components/common/SelectUser/components/Transfer/style/web.css +146 -0
- package/src/Components/components/common/SelectUser/index.ts +12 -0
- package/src/Components/components/common/Swiper/Swiper.vue +145 -0
- package/src/Components/components/common/Swiper/SwiperSlider.vue +55 -0
- package/src/Components/components/common/Swiper/index.ts +10 -0
- package/src/Components/components/common/Swiper/useSlide.ts +56 -0
- package/src/Components/components/common/Swiper/useSwiperSliders.ts +34 -0
- package/src/Components/components/common/SwiperWx/Swiper.vue +123 -0
- package/src/Components/components/common/SwiperWx/SwiperSlider.vue +87 -0
- package/src/Components/components/common/SwiperWx/index.ts +5 -0
- package/src/Components/components/common/TKStreamInfo/StreamInfo.ts +34 -0
- package/src/Components/components/common/TKStreamInfo/StreamInfoMobile.vue +82 -0
- package/src/Components/components/common/TKStreamInfo/StreamInfoPC.vue +58 -0
- package/src/Components/components/common/TKStreamInfo/TKStreamInfo.vue +43 -0
- package/src/Components/components/common/Timer/Timer.ts +14 -0
- package/src/Components/components/common/Timer/Timer.vue +24 -0
- package/src/Components/components/common/Tip/Tip.ts +5 -0
- package/src/Components/components/common/Tip/Tip.vue +67 -0
- package/src/Components/components/common/Toast/Toast.ts +84 -0
- package/src/Components/components/common/Toast/Toast.vue +133 -0
- package/src/Components/components/common/Toast/index.ts +6 -0
- package/src/Components/components/common/Toast/type.ts +16 -0
- package/src/Components/components/common/TopBar/TopBar.ts +8 -0
- package/src/Components/components/common/TopBar/TopBar.vue +116 -0
- package/src/Components/components/common/Waiting/Waiting.vue +126 -0
- package/src/Components/components/config/button/ClosedPanelUI.ts +109 -0
- package/src/Components/components/config/button/DefaultUI.ts +544 -0
- package/src/Components/components/config/button/index.ts +2 -0
- package/src/Components/context/ButtonPanelContext.ts +6 -0
- package/src/Components/context/CallInfoContext.ts +15 -0
- package/src/Components/context/CallerUserInfoContext.ts +9 -0
- package/src/Components/context/CustomUIConfigContext.ts +1 -0
- package/src/Components/context/FloatWindowContext.ts +5 -0
- package/src/Components/context/FocusItemContext.ts +1 -0
- package/src/Components/context/IsClickableContext.ts +1 -0
- package/src/Components/context/PopoverContext.ts +1 -0
- package/src/Components/context/TranslateContext.ts +1 -0
- package/src/Components/context/UserInfoContextExcludeVolume.ts +8 -0
- package/src/Components/context/index.ts +10 -0
- package/src/Components/hooks/index.ts +20 -0
- package/src/Components/hooks/useButtonPanelStatus.ts +6 -0
- package/src/Components/hooks/useCallDuration.ts +32 -0
- package/src/Components/hooks/useCallInfoContext.ts +6 -0
- package/src/Components/hooks/useCallerUserInfoContext.ts +6 -0
- package/src/Components/hooks/useCustomUI.ts +7 -0
- package/src/Components/hooks/useCustomUIButtonConfig.ts +96 -0
- package/src/Components/hooks/useDeviceList.ts +51 -0
- package/src/Components/hooks/useFloatWindowContext.ts +6 -0
- package/src/Components/hooks/useFocusContext.ts +6 -0
- package/src/Components/hooks/useGetVolumeMap.ts +59 -0
- package/src/Components/hooks/useGroupCallLayout.ts +142 -0
- package/src/Components/hooks/useIsClickableContext.ts +6 -0
- package/src/Components/hooks/useJoinGroupCall.ts +69 -0
- package/src/Components/hooks/useNetWorkStatus.ts +30 -0
- package/src/Components/hooks/usePlayer.ts +32 -0
- package/src/Components/hooks/usePopover.ts +6 -0
- package/src/Components/hooks/useTip.ts +42 -0
- package/src/Components/hooks/useTranslate.ts +7 -0
- package/src/Components/hooks/useUserInfoContextExcludeVolume.ts +6 -0
- package/src/Components/hooks/useViewBackgroundConfig.ts +12 -0
- package/src/Components/util/deepClone.ts +15 -0
- package/src/Components/util/findValues.ts +21 -0
- package/src/Components/util/index.ts +6 -0
- package/src/Components/util/isEmpty.ts +15 -0
- package/src/Components/util/isEqual.ts +40 -0
- package/src/Components/util/isObject.ts +3 -0
- package/src/Components/util/stringToPath.ts +78 -0
- package/src/Components/util/toggleScreen.ts +10 -0
- package/src/Components/util/uiConfig.ts +74 -0
- package/src/TUICallService/CallService/UIDesign.ts +174 -0
- package/src/TUICallService/CallService/bellContext.ts +88 -0
- package/src/TUICallService/CallService/chatCombine.ts +313 -0
- package/src/TUICallService/CallService/engineEventHandler.ts +404 -0
- package/src/TUICallService/CallService/index.ts +799 -0
- package/src/TUICallService/CallService/miniProgram.ts +65 -0
- package/src/TUICallService/CallService/utils.ts +281 -0
- package/src/TUICallService/TUIGlobal/tuiGlobal.ts +43 -0
- package/src/TUICallService/TUIStore/callStore.ts +93 -0
- package/src/TUICallService/TUIStore/tuiStore.ts +167 -0
- package/src/TUICallService/assets/phone_dialing.mp3 +0 -0
- package/src/TUICallService/assets/phone_ringing.mp3 +0 -0
- package/src/TUICallService/const/call.ts +157 -0
- package/src/TUICallService/const/error.ts +20 -0
- package/src/TUICallService/const/index.ts +103 -0
- package/src/TUICallService/const/log.ts +9 -0
- package/src/TUICallService/index.ts +37 -0
- package/src/TUICallService/interface/ICallService.ts +70 -0
- package/src/TUICallService/interface/ICallStore.ts +55 -0
- package/src/TUICallService/interface/ITUIGlobal.ts +36 -0
- package/src/TUICallService/interface/ITUIStore.ts +87 -0
- package/src/TUICallService/interface/index.ts +4 -0
- package/src/TUICallService/locales/en.ts +135 -0
- package/src/TUICallService/locales/index.ts +57 -0
- package/src/TUICallService/locales/ja_JP.ts +134 -0
- package/src/TUICallService/locales/zh-cn.ts +130 -0
- package/src/TUICallService/serve/callManager.ts +109 -0
- package/src/TUICallService/utils/common-utils.ts +269 -0
- package/src/TUICallService/utils/decorators/promise-retry.ts +51 -0
- package/src/TUICallService/utils/env.ts +51 -0
- package/src/TUICallService/utils/index.ts +32 -0
- package/src/TUICallService/utils/is-empty.ts +31 -0
- package/src/TUICallService/utils/retry.ts +88 -0
- package/src/TUICallService/utils/timer.ts +162 -0
- package/src/TUICallService/utils/validate/avoidRepeatedCall.ts +39 -0
- package/src/TUICallService/utils/validate/index.ts +7 -0
- package/src/adapter-vue.ts +4 -0
- package/src/index.ts +65 -0
- package/stats.html +4949 -0
- package/tuicall-uikit-vue.es.js +8568 -0
- package/tuicall-uikit-vue.umd.js +2 -0
- package/types/Components/assets/desktop/permission/index.d.ts +5 -0
- package/types/Components/assets/permission/desktop/index.d.ts +5 -0
- package/types/Components/components/SingleCall/hooks/useGetLargeViewName.d.ts +2 -0
- package/types/Components/components/base/Avatar/Avatar.d.ts +34 -0
- package/types/Components/components/base/Button/Button.d.ts +56 -0
- package/types/Components/components/base/Grid/Grid.d.ts +23 -0
- package/types/Components/components/base/Icon/Icon.d.ts +9 -0
- package/types/Components/components/base/Layout/Col/Col.d.ts +20 -0
- package/types/Components/components/base/Layout/Row/Row.d.ts +20 -0
- package/types/Components/components/base/Layout/constant.d.ts +1 -0
- package/types/Components/components/base/Loading/Circle/Circle.d.ts +13 -0
- package/types/Components/components/base/Loading/Dot/Dot.d.ts +13 -0
- package/types/Components/components/base/Loading/Loading.d.ts +26 -0
- package/types/Components/components/base/Message/Message.d.ts +50 -0
- package/types/Components/components/base/Overlay/Overlay.d.ts +45 -0
- package/types/Components/components/base/Popover/Popover.d.ts +34 -0
- package/types/Components/components/base/Popover/utils/calculatePosition.d.ts +4 -0
- package/types/Components/components/base/Portal/Portal.d.ts +14 -0
- package/types/Components/components/base/TKImage/TKImage.d.ts +33 -0
- package/types/Components/components/base/TKText/TKText.d.ts +24 -0
- package/types/Components/components/base/ToggleWindow/ToggleWindow.d.ts +18 -0
- package/types/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.d.ts +5 -0
- package/types/Components/components/base/ToggleWindow/constant.d.ts +1 -0
- package/types/Components/components/base/constants/index.d.ts +7 -0
- package/types/Components/components/base/hooks/useListenerEvent.d.ts +13 -0
- package/types/Components/components/base/hooks/useOnClickOutSide.d.ts +1 -0
- package/types/Components/components/base/util/checkEnv.d.ts +10 -0
- package/types/Components/components/base/util/checkVueVersion.d.ts +4 -0
- package/types/Components/components/base/util/classNames.d.ts +1 -0
- package/types/Components/components/base/util/filterObject.d.ts +1 -0
- package/types/Components/components/base/util/index.d.ts +5 -0
- package/types/Components/components/common/AudioStream/AudioStream.d.ts +29 -0
- package/types/Components/components/common/Button/hooks/useConfig.d.ts +2 -0
- package/types/Components/components/common/Button/props/Button.d.ts +15 -0
- package/types/Components/components/common/ButtonPanel/config/InitConfig.d.ts +89 -0
- package/types/Components/components/common/ButtonPanel/config/VirtualBackgroundMobileConfig.d.ts +66 -0
- package/types/Components/components/common/ButtonPanel/hooks/useButtonPanelLayout.d.ts +4 -0
- package/types/Components/components/common/DeviceSelect/DeviceSelect.d.ts +11 -0
- package/types/Components/components/common/MicrophoneVolume/MicrophoneVolume.d.ts +10 -0
- package/types/Components/components/common/OverlayStream/OverlayStream.d.ts +92 -0
- package/types/Components/components/common/PermitTip/PermitTip.d.ts +3 -0
- package/types/Components/components/common/Player/Player.d.ts +18 -0
- package/types/Components/components/common/Pusher/Pusher.d.ts +18 -0
- package/types/Components/components/common/SelectUser/index.d.ts +6 -0
- package/types/Components/components/common/Swiper/index.d.ts +7 -0
- package/types/Components/components/common/Swiper/useSlide.d.ts +7 -0
- package/types/Components/components/common/Swiper/useSwiperSliders.d.ts +1 -0
- package/types/Components/components/common/SwiperWx/index.d.ts +4 -0
- package/types/Components/components/common/TKStreamInfo/StreamInfo.d.ts +34 -0
- package/types/Components/components/common/Timer/Timer.d.ts +14 -0
- package/types/Components/components/common/Tip/Tip.d.ts +5 -0
- package/types/Components/components/common/Toast/Toast.d.ts +4 -0
- package/types/Components/components/common/Toast/index.d.ts +2 -0
- package/types/Components/components/common/Toast/type.d.ts +16 -0
- package/types/Components/components/common/TopBar/TopBar.d.ts +8 -0
- package/types/Components/components/config/button/ClosedPanelUI.d.ts +3380 -0
- package/types/Components/components/config/button/DefaultUI.d.ts +14751 -0
- package/types/Components/components/config/button/index.d.ts +2 -0
- package/types/Components/context/ButtonPanelContext.d.ts +4 -0
- package/types/Components/context/CallInfoContext.d.ts +13 -0
- package/types/Components/context/CallerUserInfoContext.d.ts +8 -0
- package/types/Components/context/CustomUIConfigContext.d.ts +1 -0
- package/types/Components/context/FloatWindowContext.d.ts +4 -0
- package/types/Components/context/FocusItemContext.d.ts +1 -0
- package/types/Components/context/IsClickableContext.d.ts +1 -0
- package/types/Components/context/PopoverContext.d.ts +1 -0
- package/types/Components/context/TranslateContext.d.ts +1 -0
- package/types/Components/context/UserInfoContextExcludeVolume.d.ts +6 -0
- package/types/Components/context/index.d.ts +10 -0
- package/types/Components/hooks/index.d.ts +20 -0
- package/types/Components/hooks/useButtonPanelStatus.d.ts +2 -0
- package/types/Components/hooks/useCallDuration.d.ts +3 -0
- package/types/Components/hooks/useCallInfoContext.d.ts +2 -0
- package/types/Components/hooks/useCallerUserInfoContext.d.ts +2 -0
- package/types/Components/hooks/useCustomUI.d.ts +3 -0
- package/types/Components/hooks/useCustomUIButtonConfig.d.ts +1 -0
- package/types/Components/hooks/useDeviceList.d.ts +7 -0
- package/types/Components/hooks/useFloatWindowContext.d.ts +2 -0
- package/types/Components/hooks/useFocusContext.d.ts +1 -0
- package/types/Components/hooks/useGetVolumeMap.d.ts +1 -0
- package/types/Components/hooks/useGroupCallLayout.d.ts +1 -0
- package/types/Components/hooks/useIsClickableContext.d.ts +2 -0
- package/types/Components/hooks/useJoinGroupCall.d.ts +9 -0
- package/types/Components/hooks/useNetWorkStatus.d.ts +3 -0
- package/types/Components/hooks/usePlayer.d.ts +1 -0
- package/types/Components/hooks/usePopover.d.ts +2 -0
- package/types/Components/hooks/useTip.d.ts +5 -0
- package/types/Components/hooks/useTranslate.d.ts +2 -0
- package/types/Components/hooks/useUserInfoContextExcludeVolume.d.ts +2 -0
- package/types/Components/hooks/useViewBackgroundConfig.d.ts +1 -0
- package/types/Components/util/deepClone.d.ts +1 -0
- package/types/Components/util/findValues.d.ts +1 -0
- package/types/Components/util/index.d.ts +6 -0
- package/types/Components/util/isEmpty.d.ts +1 -0
- package/types/Components/util/isEqual.d.ts +1 -0
- package/types/Components/util/isObject.d.ts +1 -0
- package/types/Components/util/stringToPath.d.ts +12 -0
- package/types/Components/util/toggleScreen.d.ts +1 -0
- package/types/Components/util/uiConfig.d.ts +3 -0
- package/types/TUICallService/CallService/UIDesign.d.ts +28 -0
- package/types/TUICallService/CallService/bellContext.d.ts +19 -0
- package/types/TUICallService/CallService/chatCombine.d.ts +50 -0
- package/types/TUICallService/CallService/engineEventHandler.d.ts +35 -0
- package/types/TUICallService/CallService/index.d.ts +98 -0
- package/types/TUICallService/CallService/miniProgram.d.ts +7 -0
- package/types/TUICallService/CallService/utils.d.ts +42 -0
- package/types/TUICallService/TUIGlobal/tuiGlobal.d.ts +21 -0
- package/types/TUICallService/TUIStore/callStore.d.ts +10 -0
- package/types/TUICallService/TUIStore/tuiStore.d.ts +57 -0
- package/types/TUICallService/const/call.d.ts +141 -0
- package/types/TUICallService/const/error.d.ts +2 -0
- package/types/TUICallService/const/index.d.ts +27 -0
- package/types/TUICallService/const/log.d.ts +7 -0
- package/types/TUICallService/index.d.ts +5 -0
- package/types/TUICallService/interface/ICallService.d.ts +69 -0
- package/types/TUICallService/interface/ICallStore.d.ts +47 -0
- package/types/TUICallService/interface/ITUIGlobal.d.ts +36 -0
- package/types/TUICallService/interface/ITUIStore.d.ts +83 -0
- package/types/TUICallService/interface/index.d.ts +4 -0
- package/types/TUICallService/locales/en.d.ts +128 -0
- package/types/TUICallService/locales/index.d.ts +10 -0
- package/types/TUICallService/locales/ja_JP.d.ts +127 -0
- package/types/TUICallService/locales/zh-cn.d.ts +123 -0
- package/types/TUICallService/serve/callManager.d.ts +11 -0
- package/types/TUICallService/utils/common-utils.d.ts +62 -0
- package/types/TUICallService/utils/decorators/promise-retry.d.ts +32 -0
- package/types/TUICallService/utils/env.d.ts +10 -0
- package/types/TUICallService/utils/index.d.ts +2 -0
- package/types/TUICallService/utils/is-empty.d.ts +2 -0
- package/types/TUICallService/utils/retry.d.ts +36 -0
- package/types/TUICallService/utils/timer.d.ts +64 -0
- package/types/TUICallService/utils/validate/avoidRepeatedCall.d.ts +10 -0
- package/types/TUICallService/utils/validate/index.d.ts +2 -0
- package/types/adapter-vue.d.ts +4 -0
- package/types/index.d.ts +11 -0
- package/types/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IUserInfo } from '../../TUICallService/interface';
|
|
2
|
+
|
|
3
|
+
export type TUserInfoExcludeVolumeContextValue = {
|
|
4
|
+
localUserInfoExcludeVolume: IUserInfo,
|
|
5
|
+
remoteUserListExcludeVolume: IUserInfo[],
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const UserInfoExcludeVolumeContextKey = 'UserInfoExcludeVolumeContextKey';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './CallInfoContext';
|
|
2
|
+
export * from './CallerUserInfoContext';
|
|
3
|
+
export * from './UserInfoContextExcludeVolume';
|
|
4
|
+
export * from './FocusItemContext';
|
|
5
|
+
export * from './ButtonPanelContext';
|
|
6
|
+
export * from './FloatWindowContext';
|
|
7
|
+
export * from './IsClickableContext';
|
|
8
|
+
export * from './PopoverContext';
|
|
9
|
+
export * from './CustomUIConfigContext';
|
|
10
|
+
export * from './TranslateContext';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './useCallerUserInfoContext';
|
|
2
|
+
export * from './useCallInfoContext';
|
|
3
|
+
export * from './useDeviceList';
|
|
4
|
+
export * from './useGetVolumeMap';
|
|
5
|
+
export * from './useTip';
|
|
6
|
+
export * from './useNetWorkStatus';
|
|
7
|
+
export * from './usePlayer';
|
|
8
|
+
export * from './useUserInfoContextExcludeVolume';
|
|
9
|
+
export * from './useCallDuration';
|
|
10
|
+
export * from './useButtonPanelStatus';
|
|
11
|
+
export * from './useFocusContext';
|
|
12
|
+
export * from './useFloatWindowContext';
|
|
13
|
+
export * from './useIsClickableContext';
|
|
14
|
+
export * from './usePopover';
|
|
15
|
+
export * from './useGroupCallLayout';
|
|
16
|
+
export * from './useCustomUIButtonConfig';
|
|
17
|
+
export * from './useCustomUI';
|
|
18
|
+
export * from './useViewBackgroundConfig';
|
|
19
|
+
export * from './useJoinGroupCall';
|
|
20
|
+
export * from './useTranslate';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { NAME, StoreName, TUIStore } from '../../TUICallService';
|
|
2
|
+
import { ref, onMounted, onUnmounted } from '../../adapter-vue';
|
|
3
|
+
|
|
4
|
+
export function useCallDuration() {
|
|
5
|
+
const callDuration = ref(TUIStore.getData(StoreName.CALL, NAME.CALL_DURATION));
|
|
6
|
+
|
|
7
|
+
const handleCallDurationChange = (value) => {
|
|
8
|
+
callDuration.value = value;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
onMounted(() => {
|
|
12
|
+
TUIStore.watch(
|
|
13
|
+
StoreName.CALL,
|
|
14
|
+
{
|
|
15
|
+
[NAME.CALL_DURATION]: handleCallDurationChange,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
notifyRangeWhenWatch: NAME.MYSELF,
|
|
19
|
+
},
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
onUnmounted(() => {
|
|
23
|
+
TUIStore.unwatch(
|
|
24
|
+
StoreName.CALL,
|
|
25
|
+
{
|
|
26
|
+
[NAME.CALL_DURATION]: handleCallDurationChange,
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return { callDuration };
|
|
32
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ICustomUIConfig } from "../../TUICallService/const";
|
|
2
|
+
import { inject, Ref } from "../../adapter-vue";
|
|
3
|
+
import { CustomUIConfigContextKey } from "../context";
|
|
4
|
+
|
|
5
|
+
export function useCustomUI() {
|
|
6
|
+
return inject<Ref<ICustomUIConfig>>(CustomUIConfigContextKey);
|
|
7
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { watch, ref, toRefs, computed } from '../../adapter-vue';
|
|
2
|
+
import { useCustomUI } from './useCustomUI';
|
|
3
|
+
import { TUIGlobal, CallStatus } from '../../TUICallService';
|
|
4
|
+
import { add, deepClone, findValues, modify } from '../util';
|
|
5
|
+
import { VirtualBackgroundMobileConfig } from '../components/common/ButtonPanel/config/VirtualBackgroundMobileConfig';
|
|
6
|
+
import { useCallInfoContext } from './useCallInfoContext';
|
|
7
|
+
import { useUserInfoExcludeVolumeContext } from './useUserInfoContextExcludeVolume';
|
|
8
|
+
import { ButtonPanelConfig } from '../components/common/ButtonPanel/config/InitConfig';
|
|
9
|
+
|
|
10
|
+
function setVirtualBackgroundConfig(config) {
|
|
11
|
+
const newConfig = deepClone(config);
|
|
12
|
+
modify(newConfig, 'mobile.singleCall.video', VirtualBackgroundMobileConfig);
|
|
13
|
+
add(newConfig, 'pc.singleCall.video.calling[0][2]', { name: 'virtualBackground', props: {} });
|
|
14
|
+
add(newConfig, 'pc.singleCall.video.accept[0][1]', { name: 'virtualBackground', props: {} });
|
|
15
|
+
add(newConfig, 'pc.singleCall.video.connected[0][3]', { name: 'virtualBackground', props: {} });
|
|
16
|
+
add(newConfig, 'pc.groupCall.video.calling[0][3]', { name: 'virtualBackground', props: {} });
|
|
17
|
+
add(newConfig, 'pc.groupCall.video.connected[0][4]', { name: 'virtualBackground', props: {} });
|
|
18
|
+
return newConfig;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function setCloseCameraConfig(config, isVideoAvailable, isShowVirtualBackgroundIcon) {
|
|
22
|
+
let newConfig = deepClone(config);
|
|
23
|
+
if(isVideoAvailable){
|
|
24
|
+
modify(newConfig, 'mobile.singleCall.video.connected[1][2].props.show', true);
|
|
25
|
+
if(isShowVirtualBackgroundIcon) {
|
|
26
|
+
setVirtualBackgroundConfig(newConfig);
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
modify(newConfig, 'mobile.singleCall.video.connected[1][2].props.show', false);
|
|
30
|
+
if(isShowVirtualBackgroundIcon) {
|
|
31
|
+
modify(newConfig, 'mobile.singleCall.video.connected[1][0].props.show', false);
|
|
32
|
+
modify(newConfig, 'pc.singleCall.video.connected[0][3].props.show', false);
|
|
33
|
+
modify(newConfig, 'pc.groupCall.video.connected[0][4].props.show', false);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return newConfig;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function useCustomUIButtonConfig() {
|
|
40
|
+
const { isShowEnableVirtualBackground, callStatus } = toRefs(useCallInfoContext());
|
|
41
|
+
const customUIConfig = useCustomUI();
|
|
42
|
+
const { localUserInfoExcludeVolume: localUserInfo } = toRefs(useUserInfoExcludeVolumeContext());
|
|
43
|
+
const isVideoAvailable = computed(() => localUserInfo?.value.isVideoAvailable || false);
|
|
44
|
+
const isShowVirtualBackgroundIcon = computed(() => isShowEnableVirtualBackground.value && !TUIGlobal.isH5);
|
|
45
|
+
const results = ref([]);
|
|
46
|
+
|
|
47
|
+
watch([customUIConfig, isShowEnableVirtualBackground, isVideoAvailable], () => {
|
|
48
|
+
let initConfig = deepClone(ButtonPanelConfig);
|
|
49
|
+
if (isShowVirtualBackgroundIcon.value) {
|
|
50
|
+
initConfig = setVirtualBackgroundConfig(ButtonPanelConfig);
|
|
51
|
+
}
|
|
52
|
+
if(callStatus.value === CallStatus.CONNECTED) {
|
|
53
|
+
initConfig = setCloseCameraConfig(initConfig, isVideoAvailable.value, isShowVirtualBackgroundIcon.value);
|
|
54
|
+
}
|
|
55
|
+
const { button: buttonsConfig } = customUIConfig.value;
|
|
56
|
+
const rs = [];
|
|
57
|
+
function condition(value) {
|
|
58
|
+
return Object.keys(buttonsConfig).includes(value);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function formatResults({ key, value }) {
|
|
62
|
+
const valueArr = value.split('.');
|
|
63
|
+
let path = valueArr.slice(0, valueArr.length - 1);
|
|
64
|
+
const rowPath = valueArr.slice(0, valueArr.length - 2);
|
|
65
|
+
const rowIndex = rowPath[rowPath.length - 1];
|
|
66
|
+
if (rowIndex === '0') {
|
|
67
|
+
for(let i = 0; i < 3; i++) {
|
|
68
|
+
let newPath = rowPath.slice();
|
|
69
|
+
newPath.push(i);
|
|
70
|
+
newPath.push('customStyle');
|
|
71
|
+
newPath.push('justifyContent');
|
|
72
|
+
newPath = newPath.join('.');
|
|
73
|
+
rs.push({ path: newPath, value: 'center' });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
path.push('props');
|
|
78
|
+
path.push('show');
|
|
79
|
+
path = path.join('.');
|
|
80
|
+
return {
|
|
81
|
+
path,
|
|
82
|
+
value: buttonsConfig?.[key]?.show,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
findValues(initConfig, condition, '', rs, formatResults);
|
|
87
|
+
rs?.forEach((item) => {
|
|
88
|
+
modify(initConfig, item.path, item.value);
|
|
89
|
+
});
|
|
90
|
+
results.value = initConfig;
|
|
91
|
+
}, {
|
|
92
|
+
immediate: true,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
return results;
|
|
96
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ref, onMounted, onUnmounted } from '../../adapter-vue';
|
|
2
|
+
import { TUIStore } from '../../TUICallService';
|
|
3
|
+
import { DeviceType, NAME, StoreName } from '../../TUICallService/const';
|
|
4
|
+
|
|
5
|
+
export function useDeviceList(deviceType: DeviceType) {
|
|
6
|
+
const deviceList = ref([]);
|
|
7
|
+
const currentDeviceId = ref('');
|
|
8
|
+
|
|
9
|
+
const handleDeviceListChange = (value) => {
|
|
10
|
+
switch (deviceType) {
|
|
11
|
+
case DeviceType.CAMERA:
|
|
12
|
+
deviceList.value = value?.cameraList || [];
|
|
13
|
+
currentDeviceId.value = value?.currentCamera?.deviceId || '';
|
|
14
|
+
break;
|
|
15
|
+
case DeviceType.MICROPHONE:
|
|
16
|
+
deviceList.value = value?.microphoneList || [];
|
|
17
|
+
currentDeviceId.value = value?.currentMicrophone?.deviceId || '';
|
|
18
|
+
break;
|
|
19
|
+
case DeviceType.SPEAKER:
|
|
20
|
+
deviceList.value = value?.speakerList || [];
|
|
21
|
+
currentDeviceId.value = value?.currentSpeaker?.deviceId || '';
|
|
22
|
+
break;
|
|
23
|
+
default:
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const updateCurrentDeviceId = (value) => {
|
|
29
|
+
currentDeviceId.value = value;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
onMounted(() => {
|
|
33
|
+
TUIStore.watch(
|
|
34
|
+
StoreName.CALL,
|
|
35
|
+
{
|
|
36
|
+
[NAME.DEVICE_LIST]: handleDeviceListChange,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
notifyRangeWhenWatch: NAME.MYSELF,
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
onUnmounted(() => {
|
|
45
|
+
TUIStore.unwatch(StoreName.CALL, {
|
|
46
|
+
[NAME.DEVICE_LIST]: handleDeviceListChange,
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
return [{ deviceList, currentDeviceId }, { updateCurrentDeviceId }] as const;
|
|
51
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ref, onMounted, onUnmounted } from '../../adapter-vue';
|
|
2
|
+
import { TUIStore, TUIGlobal } from '../../TUICallService';
|
|
3
|
+
import { NAME, StoreName } from '../../TUICallService/const';
|
|
4
|
+
import { isEqual } from '../util';
|
|
5
|
+
|
|
6
|
+
export function useGetVolumeMap() {
|
|
7
|
+
const volumeMap = ref();
|
|
8
|
+
const remoteUserInfoList = ref(TUIStore.getData(StoreName.CALL, NAME.REMOTE_USER_INFO_LIST));
|
|
9
|
+
|
|
10
|
+
const handleLocalUserInfoChange = (value) => {
|
|
11
|
+
const isAudioAvailable = TUIGlobal.isWeChat ? value.enableMic : value.isAudioAvailable;
|
|
12
|
+
if (isAudioAvailable) {
|
|
13
|
+
volumeMap.value = { ...volumeMap.value, localVideo: value.volume };
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const handleRemoteUserInfoListChange = (value) => {
|
|
17
|
+
const rs = {};
|
|
18
|
+
if (value.length !== remoteUserInfoList.value.length || !isEqual(value, remoteUserInfoList.value)) {
|
|
19
|
+
remoteUserInfoList.value = value;
|
|
20
|
+
remoteUserInfoList.value.forEach(item => {
|
|
21
|
+
const isAudioAvailable = TUIGlobal.isWeChat ? item.hasAudio : item.isAudioAvailable;
|
|
22
|
+
if (isAudioAvailable) {
|
|
23
|
+
const domId = TUIGlobal.isWeChat ? item.userID : item.domId;
|
|
24
|
+
rs[domId] = item.volume;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
volumeMap.value = { ...volumeMap.value, ...rs };
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
let watchOptions = {
|
|
33
|
+
[NAME.LOCAL_USER_INFO]: handleLocalUserInfoChange,
|
|
34
|
+
[NAME.REMOTE_USER_INFO_LIST]: handleRemoteUserInfoListChange,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
if (TUIGlobal.isUniPlatform) {
|
|
38
|
+
watchOptions = {
|
|
39
|
+
[NAME.PUSHER]: handleLocalUserInfoChange,
|
|
40
|
+
[NAME.PLAYER]: handleRemoteUserInfoListChange,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
onMounted(() => {
|
|
45
|
+
TUIStore.watch(
|
|
46
|
+
StoreName.CALL,
|
|
47
|
+
watchOptions,
|
|
48
|
+
{
|
|
49
|
+
notifyRangeWhenWatch: NAME.MYSELF,
|
|
50
|
+
},
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
onUnmounted(() => {
|
|
55
|
+
TUIStore.unwatch(StoreName.CALL, watchOptions);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return volumeMap;
|
|
59
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { watch, ref, toRefs } from '../../adapter-vue';
|
|
2
|
+
import { TUIGlobal } from '../../TUICallService';
|
|
3
|
+
import { useFloatWindowContext } from './useFloatWindowContext';
|
|
4
|
+
|
|
5
|
+
const generateDefaultLayout = (length: number, size: number) => {
|
|
6
|
+
const layout = [{
|
|
7
|
+
i: 0, x: 0, y: 0, w: size, h: size,
|
|
8
|
+
}];
|
|
9
|
+
|
|
10
|
+
for (let i = 1; i < length; i++) {
|
|
11
|
+
const isWrap = layout[i - 1].x + size === 12;
|
|
12
|
+
layout[i] = {
|
|
13
|
+
i,
|
|
14
|
+
x: layout[i - 1].x + size === 12 ? 0 : layout[i - 1].x + size,
|
|
15
|
+
y: layout[i - 1].y + (isWrap ? size : 0),
|
|
16
|
+
w: size,
|
|
17
|
+
h: size,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (length === 3) {
|
|
22
|
+
layout[length - 1].x += 3;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (length > 3 && TUIGlobal.isPC) {
|
|
26
|
+
if (length % 3 === 2) {
|
|
27
|
+
layout[length - 1].x += 2;
|
|
28
|
+
layout[length - 2].x += 2;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return layout;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export function useGroupCallLayout(focus, length) {
|
|
36
|
+
const { isFloatWindow } = toRefs(useFloatWindowContext());
|
|
37
|
+
const newLayout = ref();
|
|
38
|
+
watch([focus, length, isFloatWindow], () => {
|
|
39
|
+
if (isFloatWindow.value) {
|
|
40
|
+
const a = [];
|
|
41
|
+
for(let i = 0; i < length.value; i++) {
|
|
42
|
+
a[i] = {
|
|
43
|
+
i,
|
|
44
|
+
x: 0,
|
|
45
|
+
y: 0,
|
|
46
|
+
w: 12,
|
|
47
|
+
h: 12,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
newLayout.value = a;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const arr = Object.keys(Array.from({ length: length.value }));
|
|
55
|
+
const gridItemSize = length.value <= 4 ? 6 : 4;
|
|
56
|
+
const defaultLayout = generateDefaultLayout(length.value, gridItemSize);
|
|
57
|
+
newLayout.value = defaultLayout;
|
|
58
|
+
let colIndex;
|
|
59
|
+
let rowIndex;
|
|
60
|
+
|
|
61
|
+
if (focus.value !== null) {
|
|
62
|
+
if (arr.length < 5) {
|
|
63
|
+
const newArr = arr.concat();
|
|
64
|
+
newArr.splice(focus.value, 1);
|
|
65
|
+
newArr.unshift(focus.value);
|
|
66
|
+
} else {
|
|
67
|
+
rowIndex = focus.value % 3;
|
|
68
|
+
colIndex = Math.floor(focus.value / 3);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (arr.length < 5) {
|
|
72
|
+
const focusIndex = defaultLayout.findIndex((item) => item.i === focus.value);
|
|
73
|
+
|
|
74
|
+
if (focusIndex !== -1) {
|
|
75
|
+
const temp = defaultLayout[0];
|
|
76
|
+
defaultLayout[0] = defaultLayout[focusIndex];
|
|
77
|
+
defaultLayout[focusIndex] = temp;
|
|
78
|
+
for (let i = 0; i < defaultLayout.length; i++) {
|
|
79
|
+
const item = defaultLayout[i];
|
|
80
|
+
if (i === 0) {
|
|
81
|
+
item.w += 6;
|
|
82
|
+
item.h += 6;
|
|
83
|
+
item.x = 0;
|
|
84
|
+
item.y = 0;
|
|
85
|
+
} else {
|
|
86
|
+
item.x = (i - 1) * 4;
|
|
87
|
+
item.y = 12;
|
|
88
|
+
item.w = 4;
|
|
89
|
+
item.h = 4;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
let focusStyle;
|
|
95
|
+
if (rowIndex === 0) {
|
|
96
|
+
if (defaultLayout[focus.value + 1]) defaultLayout[focus.value + 1].x += 4;
|
|
97
|
+
if (defaultLayout[focus.value + 2]) defaultLayout[focus.value + 2].y += 4;
|
|
98
|
+
focusStyle = {
|
|
99
|
+
i: focus.value,
|
|
100
|
+
x: 0,
|
|
101
|
+
y: colIndex * 4,
|
|
102
|
+
w: 8,
|
|
103
|
+
h: 8,
|
|
104
|
+
};
|
|
105
|
+
} else if (rowIndex === 2) {
|
|
106
|
+
focusStyle = {
|
|
107
|
+
i: focus.value,
|
|
108
|
+
x: 4,
|
|
109
|
+
y: colIndex * 4,
|
|
110
|
+
w: 8,
|
|
111
|
+
h: 8,
|
|
112
|
+
};
|
|
113
|
+
defaultLayout[focus.value - 1].x = 0;
|
|
114
|
+
defaultLayout[focus.value - 1].y += 4;
|
|
115
|
+
} else if (rowIndex === 1) {
|
|
116
|
+
focusStyle = {
|
|
117
|
+
i: focus.value,
|
|
118
|
+
x: 4,
|
|
119
|
+
y: colIndex * 4,
|
|
120
|
+
w: 8,
|
|
121
|
+
h: 8,
|
|
122
|
+
};
|
|
123
|
+
if (defaultLayout[focus.value + 1]) {
|
|
124
|
+
defaultLayout[focus.value + 1].x = 0;
|
|
125
|
+
defaultLayout[focus.value + 1].y += 4;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const start = 3 - rowIndex;
|
|
129
|
+
for (let i = focus.value + start; i < defaultLayout.length; i++) {
|
|
130
|
+
const item = defaultLayout[i];
|
|
131
|
+
item.y += 4;
|
|
132
|
+
}
|
|
133
|
+
defaultLayout[focus.value] = focusStyle;
|
|
134
|
+
}
|
|
135
|
+
newLayout.value = defaultLayout;
|
|
136
|
+
}
|
|
137
|
+
}, {
|
|
138
|
+
immediate: true,
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
return newLayout;
|
|
142
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ref, onMounted, onUnmounted } from '../../adapter-vue';
|
|
2
|
+
import { TUIStore } from '../../TUICallService';
|
|
3
|
+
import { NAME, StoreName } from '../../TUICallService/const';
|
|
4
|
+
|
|
5
|
+
export function useJoinGroupCall() {
|
|
6
|
+
const roomId = ref(TUIStore.getData(StoreName.CALL, NAME.ROOM_ID));
|
|
7
|
+
const roomIdType = ref(TUIStore.getData(StoreName.CALL, NAME.ROOM_ID_TYPE));
|
|
8
|
+
const groupId = ref(TUIStore.getData(StoreName.CALL, NAME.GROUP_ID));
|
|
9
|
+
const callMediaType = ref(TUIStore.getData(StoreName.CALL, NAME.CALL_MEDIA_TYPE));
|
|
10
|
+
const groupCallMembers = ref(TUIStore.getData(StoreName.CALL, NAME.GROUP_CALL_MEMBERS));
|
|
11
|
+
const callStatus = ref(TUIStore.getData(StoreName.CALL, NAME.CALL_STATUS));
|
|
12
|
+
const callId = ref(TUIStore.getData(StoreName.CALL, NAME.CALL_ID));
|
|
13
|
+
|
|
14
|
+
const handleRoomIDChange = (value) => {
|
|
15
|
+
roomId.value = value;
|
|
16
|
+
};
|
|
17
|
+
const handleGroupIDChange = (value) => {
|
|
18
|
+
groupId.value = value;
|
|
19
|
+
};
|
|
20
|
+
const handleCallMediaTypeChange = (value) => {
|
|
21
|
+
callMediaType.value = value;
|
|
22
|
+
};
|
|
23
|
+
const handleGroupCallMembersChange = (value) => {
|
|
24
|
+
groupCallMembers.value = value;
|
|
25
|
+
};
|
|
26
|
+
const handleCallStatusChange = (value) => {
|
|
27
|
+
callStatus.value = value;
|
|
28
|
+
};
|
|
29
|
+
const handleRoomIdTypeChange = (value) => {
|
|
30
|
+
roomIdType.value = value;
|
|
31
|
+
};
|
|
32
|
+
const handleCallIDChange = (value) => {
|
|
33
|
+
callId.value = value;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const watchOptions = {
|
|
37
|
+
[NAME.ROOM_ID]: handleRoomIDChange,
|
|
38
|
+
[NAME.GROUP_ID]: handleGroupIDChange,
|
|
39
|
+
[NAME.CALL_MEDIA_TYPE]: handleCallMediaTypeChange,
|
|
40
|
+
[NAME.GROUP_CALL_MEMBERS]: handleGroupCallMembersChange,
|
|
41
|
+
[NAME.CALL_STATUS]: handleCallStatusChange,
|
|
42
|
+
[NAME.ROOM_ID_TYPE]: handleRoomIdTypeChange,
|
|
43
|
+
[NAME.CALL_ID]: handleCallIDChange,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
onMounted(() => {
|
|
47
|
+
TUIStore.watch(
|
|
48
|
+
StoreName.CALL,
|
|
49
|
+
watchOptions,
|
|
50
|
+
{
|
|
51
|
+
notifyRangeWhenWatch: NAME.MYSELF,
|
|
52
|
+
},
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
onUnmounted(() => {
|
|
57
|
+
TUIStore.unwatch(StoreName.CALL, watchOptions);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
roomId,
|
|
62
|
+
roomIdType,
|
|
63
|
+
groupId,
|
|
64
|
+
callMediaType,
|
|
65
|
+
groupCallMembers,
|
|
66
|
+
callStatus,
|
|
67
|
+
callId,
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ref, onMounted, onUnmounted } from '../../adapter-vue';
|
|
2
|
+
import { TUIStore } from '../../TUICallService';
|
|
3
|
+
import { NAME, StoreName } from '../../TUICallService/const';
|
|
4
|
+
|
|
5
|
+
export function useNetWorkStatus() {
|
|
6
|
+
const netWorkQualityList = ref(TUIStore.getData(StoreName.CALL, NAME.NETWORK_STATUS));
|
|
7
|
+
|
|
8
|
+
const handleNetWorkStatusChange = (value) => {
|
|
9
|
+
netWorkQualityList.value = value;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
onMounted(() => {
|
|
13
|
+
TUIStore.watch(
|
|
14
|
+
StoreName.CALL,
|
|
15
|
+
{
|
|
16
|
+
[NAME.NETWORK_STATUS]: handleNetWorkStatusChange,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
notifyRangeWhenWatch: NAME.MYSELF,
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
onUnmounted(() => {
|
|
24
|
+
TUIStore.unwatch(StoreName.CALL, {
|
|
25
|
+
[NAME.NETWORK_STATUS]: handleNetWorkStatusChange,
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
return { netWorkQualityList };
|
|
30
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ref, onMounted, onUnmounted } from '../../adapter-vue';
|
|
2
|
+
import { TUIStore } from '../../TUICallService';
|
|
3
|
+
import { NAME, StoreName } from '../../TUICallService/const';
|
|
4
|
+
|
|
5
|
+
export function usePlayer() {
|
|
6
|
+
const player = ref(TUIStore.getData(StoreName.CALL, NAME.PLAYER));
|
|
7
|
+
|
|
8
|
+
const handlePlayerChange = (value) => {
|
|
9
|
+
player.value = value?.map((item) => {
|
|
10
|
+
const { userID, hasVideo, hasAudio } = item;
|
|
11
|
+
|
|
12
|
+
return { userID, hasVideo, hasAudio };
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const watchOptions = {
|
|
17
|
+
[NAME.PLAYER]: handlePlayerChange,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
onMounted(() => {
|
|
21
|
+
TUIStore.watch(
|
|
22
|
+
StoreName.CALL,
|
|
23
|
+
watchOptions,
|
|
24
|
+
{ notifyRangeWhenWatch: NAME.MYSELF },
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
onUnmounted(() => {
|
|
28
|
+
TUIStore.unwatch(StoreName.CALL, watchOptions);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return player;
|
|
32
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ref, onMounted, onUnmounted } from '../../adapter-vue';
|
|
2
|
+
import { TUIStore } from '../../TUICallService';
|
|
3
|
+
import { NAME, StoreName } from '../../TUICallService/const';
|
|
4
|
+
|
|
5
|
+
export function useTip() {
|
|
6
|
+
const tip = ref('');
|
|
7
|
+
const show = ref(true);
|
|
8
|
+
const duration = ref(0);
|
|
9
|
+
|
|
10
|
+
const handleCallTipsChange = (value) => {
|
|
11
|
+
if (typeof value === 'object') {
|
|
12
|
+
|
|
13
|
+
tip.value = value.text;
|
|
14
|
+
duration.value = value.duration || 0;
|
|
15
|
+
} else {
|
|
16
|
+
tip.value = value;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
onMounted(() => {
|
|
21
|
+
TUIStore.watch(
|
|
22
|
+
StoreName.CALL,
|
|
23
|
+
{
|
|
24
|
+
[NAME.CALL_TIPS]: handleCallTipsChange,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
notifyRangeWhenWatch: NAME.MYSELF,
|
|
28
|
+
},
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
onUnmounted(() => {
|
|
33
|
+
TUIStore.unwatch(
|
|
34
|
+
StoreName.CALL,
|
|
35
|
+
{
|
|
36
|
+
[NAME.CALL_TIPS]: handleCallTipsChange,
|
|
37
|
+
},
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return { tip, show, duration };
|
|
42
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { noop } from '../../TUICallService/utils/common-utils';
|
|
2
|
+
import { inject, Ref, ref } from '../../adapter-vue';
|
|
3
|
+
import { translateContextKey } from '../context';
|
|
4
|
+
|
|
5
|
+
export function useTranslate() {
|
|
6
|
+
return inject<Ref<Function>>(translateContextKey, ref(noop));
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { inject } from '../../adapter-vue';
|
|
2
|
+
import { TUserInfoExcludeVolumeContextValue, UserInfoExcludeVolumeContextKey } from '../context';
|
|
3
|
+
|
|
4
|
+
export function useUserInfoExcludeVolumeContext() {
|
|
5
|
+
return inject<TUserInfoExcludeVolumeContextValue>(UserInfoExcludeVolumeContextKey);
|
|
6
|
+
}
|