tuikit-atomicx-vue3 3.4.2 → 4.3.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/.eslintrc.cjs +1 -0
- package/dist/baseComp/Modal/Modal.js +431 -23
- package/dist/chat/index.d.ts +18 -18
- package/dist/components/AudioSetting/AudioMediaControl.js +39 -41
- package/dist/components/AudioSetting/AudioSettingTab.js +10 -10
- package/dist/components/AudioSetting/MicrophoneSelect.js +8 -8
- package/dist/components/AudioSetting/SpeakerSelect.js +9 -9
- package/dist/components/AudioSettingPanel/i18n/en-US/index.d.ts +1 -0
- package/dist/components/AudioSettingPanel/i18n/en-US/index.js +2 -1
- package/dist/components/AudioSettingPanel/i18n/zh-CN/index.d.ts +1 -0
- package/dist/components/AudioSettingPanel/i18n/zh-CN/index.js +2 -1
- package/dist/components/AudioSettingPanel/index.js +81 -73
- package/dist/components/BarrageInput/BarrageInputH5.js +9 -9
- package/dist/components/BarrageInput/EmojiPicker/EmojiPicker.js +3 -3
- package/dist/components/BarrageInput/MessageInputState.d.ts +28 -0
- package/dist/components/BarrageInput/MessageInputState.js +82 -0
- package/dist/components/BarrageInput/TextEditor/CharacterCountExtension.js +1 -1
- package/dist/components/BarrageInput/TextEditor/EditorCore.js +2 -2
- package/dist/components/BarrageInput/TextEditor/index.js +7 -7
- package/dist/components/BarrageInput/type.d.ts +17 -0
- package/dist/components/BarrageInput/type.js +4 -0
- package/dist/components/BarrageInput/utils.d.ts +30 -0
- package/dist/components/BarrageInput/utils.js +41 -0
- package/dist/components/BarrageList/BarrageList.js +80 -110
- package/dist/components/BarrageList/BarrageList.vue.d.ts +0 -29
- package/dist/components/BarrageList/BarrageListH5.js +95 -122
- package/dist/components/BarrageList/BarrageListH5.vue.d.ts +0 -29
- package/dist/components/BarrageList/BarrageListState.d.ts +58 -0
- package/dist/components/BarrageList/BarrageListState.js +106 -0
- package/dist/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.js +16 -24
- package/dist/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.vue.d.ts +5 -5
- package/dist/components/BarrageList/Message/MessageLayout/MessageLayout.js +48 -73
- package/dist/components/BarrageList/Message/MessageLayout/MessageLayout.vue.d.ts +5 -7
- package/dist/components/BarrageList/Message/TextMessage/TextMessage.js +70 -76
- package/dist/components/BarrageList/Message/TextMessage/TextMessage.vue.d.ts +6 -6
- package/dist/components/BarrageList/Message/TextMessage/emoji.d.ts +5 -0
- package/dist/components/BarrageList/Message/TextMessage/emoji.js +134 -0
- package/dist/components/BarrageList/index.d.ts +0 -36
- package/dist/components/CameraButton/index.js +18 -19
- package/dist/components/CoGuestPanel/CoGuestPanel.js +60 -60
- package/dist/components/CoHostPanel/BattlePanel.js +11 -11
- package/dist/components/CoHostPanel/CoHostPanel.js +10 -10
- package/dist/components/CoHostPanel/ConfigSettingPanel.js +49 -55
- package/dist/components/CoHostPanel/ConnectionPanel.js +132 -123
- package/dist/components/CoHostPanel/RecommendHostList.js +39 -36
- package/dist/components/CoHostPanel/constants.d.ts +3 -0
- package/dist/components/CoHostPanel/constants.js +6 -0
- package/dist/components/CoHostPanel/i18n/en-US/index.d.ts +1 -0
- package/dist/components/CoHostPanel/i18n/en-US/index.js +2 -1
- package/dist/components/CoHostPanel/i18n/zh-CN/index.d.ts +1 -0
- package/dist/components/CoHostPanel/i18n/zh-CN/index.js +3 -2
- package/dist/components/LiveAudienceList/LiveAudienceList.js +44 -45
- package/dist/components/LiveAudienceList/LiveAudienceListH5.js +7 -7
- package/dist/components/LiveAudienceList/UserActionMenu.js +57 -64
- package/dist/components/LiveList/LiveList.js +23 -23
- package/dist/components/LiveList/LiveListH5.js +38 -38
- package/dist/components/LiveScenePanel/CameraSettingDialog.js +10 -10
- package/dist/components/LiveScenePanel/MaterialItem.js +15 -15
- package/dist/components/LiveScenePanel/index.js +4 -4
- package/dist/components/LiveView/CoreViewDecorate/BattleDecorate.js +58 -58
- package/dist/components/LiveView/CoreViewDecorate/BattleUserDecorate.js +6 -6
- package/dist/components/LiveView/CoreViewDecorate/CoHostDecorate.js +5 -5
- package/dist/components/LiveView/DefaultStreamViewUI.js +44 -41
- package/dist/components/LiveView/PlayerControl/AudioControl.js +20 -20
- package/dist/components/LiveView/PlayerControl/MultiResolution.js +49 -48
- package/dist/components/LiveView/PlayerControl/MultiResolution.vue.d.ts +7 -1
- package/dist/components/LiveView/PlayerControl/PlayerControl.js +90 -86
- package/dist/components/LiveView/PlayerControl/PlayerControlState.js +127 -131
- package/dist/components/LiveView/PlayerControl/utils/domHelpers.d.ts +6 -0
- package/dist/components/LiveView/PlayerControl/utils/domHelpers.js +54 -22
- package/dist/components/LiveView/i18n/en-US/index.d.ts +2 -2
- package/dist/components/LiveView/i18n/en-US/index.js +2 -2
- package/dist/components/LiveView/i18n/zh-CN/index.d.ts +2 -2
- package/dist/components/LiveView/i18n/zh-CN/index.js +2 -2
- package/dist/components/LiveView/index.js +17 -17
- package/dist/components/MessageInput/TextEditor/EditorCore.js +2 -2
- package/dist/components/MessageList/MessageList.vue.d.ts +2 -2
- package/dist/components/MessageList/index.d.ts +18 -18
- package/dist/components/MicButton/index.js +11 -11
- package/dist/components/StreamMixer/LocalMixer/MixerControl.js +12 -12
- package/dist/components/StreamMixer/LocalMixer/index.js +66 -63
- package/dist/components/StreamView/Layout/CustomLayout.js +8 -8
- package/dist/components/StreamView/Layout/FloatLayout.js +124 -127
- package/dist/components/StreamView/Layout/GridLayout.js +5 -5
- package/dist/components/StreamView/index.js +25 -33
- package/dist/components/StreamView/manager/mediaManager.js +54 -60
- package/dist/components/VideoSetting/CameraSelect.js +8 -8
- package/dist/components/VideoSetting/VideoMediaControl.js +10 -10
- package/dist/components/VideoSetting/VideoPreview.js +9 -9
- package/dist/components/VideoSetting/VideoProfile.js +6 -6
- package/dist/components/VideoSetting/VideoSettingTab.js +40 -39
- package/dist/components/VideoSettingPanel/CameraSelect.js +8 -8
- package/dist/components/VideoSettingPanel/VideoPreview.js +1 -1
- package/dist/components/VideoSettingPanel/VideoProfile.js +18 -18
- package/dist/hooks/useRoomEngine.js +6 -6
- package/dist/{index-D2OVtqc8.js → index-BfIEeWMg.js} +191 -181
- package/dist/{index-Bm-QfV5o.js → index-DTi1fL-x.js} +460 -457
- package/dist/index.js +162 -144
- package/dist/report/MetricsKey.d.ts +16 -0
- package/dist/report/MetricsKey.js +4 -0
- package/dist/report/dataReport.d.ts +12 -0
- package/dist/report/dataReport.js +45 -0
- package/dist/report/index.d.ts +4 -0
- package/dist/report/index.js +6 -0
- package/dist/rtc/index.d.ts +5 -43
- package/dist/rtc/index.js +48 -48
- package/dist/states/BarrageState/BarrageState.d.ts +74 -0
- package/dist/states/BarrageState/BarrageState.js +80 -0
- package/dist/states/BarrageState/index.d.ts +1 -0
- package/dist/states/BarrageState/index.js +5 -0
- package/dist/states/{BattleState.d.ts → BattleState/BattleState.d.ts} +10 -11
- package/dist/states/BattleState/BattleState.js +203 -0
- package/dist/states/BattleState/index.d.ts +1 -0
- package/dist/states/BattleState/index.js +4 -0
- package/dist/states/CoGuestState.d.ts +24 -94
- package/dist/states/CoGuestState.js +297 -189
- package/dist/states/CoHostState/CoHostState.d.ts +2 -2
- package/dist/states/CoHostState/CoHostState.js +135 -131
- package/dist/states/{DeviceState.d.ts → DeviceState/DeviceState.d.ts} +25 -13
- package/dist/states/DeviceState/DeviceState.js +314 -0
- package/dist/states/DeviceState/index.d.ts +1 -0
- package/dist/states/DeviceState/index.js +4 -0
- package/dist/states/LiveAudienceState.d.ts +3 -1
- package/dist/states/LiveAudienceState.js +106 -63
- package/dist/states/{LiveState/index.d.ts → LiveListState/LiveListState.d.ts} +13 -8
- package/dist/states/LiveListState/LiveListState.js +285 -0
- package/dist/states/LiveListState/index.d.ts +1 -0
- package/dist/states/LiveListState/index.js +4 -0
- package/dist/states/LiveMonitorState/api/http.js +147 -129
- package/dist/states/LiveMonitorState/index.js +67 -62
- package/dist/states/LiveSeatState/index.d.ts +46 -11
- package/dist/states/LiveSeatState/index.js +34 -15
- package/dist/states/LiveSeatState/seatEventManager.d.ts +2 -0
- package/dist/states/LiveSeatState/seatEventManager.js +63 -42
- package/dist/states/LiveSeatState/seatManager.d.ts +34 -5
- package/dist/states/LiveSeatState/seatManager.js +131 -29
- package/dist/states/LiveSeatState/store.d.ts +5 -5
- package/dist/states/LiveSeatState/store.js +12 -10
- package/dist/states/LiveSeatState/usePlayStream/RTCStreamManager.js +1 -1
- package/dist/states/LiveSeatState/usePlayStream/RTCStreamPlayer.js +1 -1
- package/dist/states/LiveSeatState/usePlayStream/index.js +30 -28
- package/dist/states/LoginState.js +39 -34
- package/dist/states/SeatStore.js +82 -83
- package/dist/states/{VideoMixerState.d.ts → VideoMixerState/VideoMixerState.d.ts} +1 -1
- package/dist/states/VideoMixerState/VideoMixerState.js +269 -0
- package/dist/states/VideoMixerState/index.d.ts +1 -0
- package/dist/states/VideoMixerState/index.js +4 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/audience.d.ts +21 -0
- package/dist/types/audience.js +4 -1
- package/dist/types/battle.d.ts +75 -3
- package/dist/types/battle.js +5 -1
- package/dist/types/coGuest.d.ts +72 -5
- package/dist/types/coGuest.js +4 -2
- package/dist/types/device.d.ts +38 -17
- package/dist/types/device.js +10 -8
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +96 -80
- package/dist/types/live.d.ts +36 -21
- package/dist/types/live.js +6 -4
- package/dist/types/seat.d.ts +23 -4
- package/dist/types/seat.js +7 -1
- package/dist/utils/eventCenter.d.ts +88 -0
- package/dist/utils/eventCenter.js +161 -0
- package/package.json +2 -2
- package/src/components/AudioSetting/AudioMediaControl.vue +1 -3
- package/src/components/AudioSetting/AudioSettingTab.vue +1 -2
- package/src/components/AudioSetting/MicrophoneSelect.vue +1 -2
- package/src/components/AudioSetting/SpeakerSelect.vue +1 -2
- package/src/components/AudioSettingPanel/i18n/en-US/index.ts +1 -0
- package/src/components/AudioSettingPanel/i18n/zh-CN/index.ts +1 -0
- package/src/components/AudioSettingPanel/index.vue +4 -2
- package/src/components/BarrageInput/BarrageInputH5.vue +1 -1
- package/src/components/BarrageInput/EmojiPicker/EmojiPicker.vue +1 -1
- package/src/components/BarrageInput/MessageInputState.ts +160 -0
- package/src/components/BarrageInput/TextEditor/TextEditor.vue +1 -1
- package/src/components/BarrageInput/type.ts +26 -0
- package/src/components/BarrageInput/utils.ts +45 -0
- package/src/components/BarrageList/BarrageList.vue +61 -117
- package/src/components/BarrageList/BarrageListH5.vue +75 -159
- package/src/components/BarrageList/BarrageListState.ts +223 -0
- package/src/components/BarrageList/Message/MessageLayout/MessageBubble/MessageBubble.vue +8 -55
- package/src/components/BarrageList/Message/MessageLayout/MessageLayout.vue +19 -44
- package/src/components/BarrageList/Message/TextMessage/TextMessage.vue +69 -96
- package/src/components/BarrageList/Message/TextMessage/emoji.ts +132 -0
- package/src/components/CameraButton/index.vue +0 -1
- package/src/components/CoGuestPanel/CoGuestPanel.vue +16 -91
- package/src/components/CoHostPanel/BattlePanel.vue +1 -4
- package/src/components/CoHostPanel/ConfigSettingPanel.vue +2 -8
- package/src/components/CoHostPanel/ConnectionPanel.vue +37 -33
- package/src/components/CoHostPanel/RecommendHostList.vue +12 -13
- package/src/components/CoHostPanel/constants.ts +3 -0
- package/src/components/CoHostPanel/i18n/en-US/index.ts +1 -0
- package/src/components/CoHostPanel/i18n/zh-CN/index.ts +2 -1
- package/src/components/LiveAudienceList/LiveAudienceList.vue +4 -5
- package/src/components/LiveAudienceList/LiveAudienceListH5.vue +2 -2
- package/src/components/LiveAudienceList/UserActionMenu.vue +7 -48
- package/src/components/LiveList/LiveList.vue +5 -5
- package/src/components/LiveList/LiveListH5.vue +6 -6
- package/src/components/LiveScenePanel/index.vue +2 -2
- package/src/components/LiveView/CoreViewDecorate/BattleDecorate.vue +10 -15
- package/src/components/LiveView/CoreViewDecorate/BattleUserDecorate.vue +2 -2
- package/src/components/LiveView/DefaultStreamViewUI.vue +5 -3
- package/src/components/LiveView/PlayerControl/AudioControl.vue +1 -1
- package/src/components/LiveView/PlayerControl/MultiResolution.vue +9 -3
- package/src/components/LiveView/PlayerControl/PlayerControl.vue +10 -2
- package/src/components/LiveView/PlayerControl/PlayerControlState.ts +233 -259
- package/src/components/LiveView/PlayerControl/utils/domHelpers.ts +64 -0
- package/src/components/LiveView/i18n/en-US/index.ts +2 -2
- package/src/components/LiveView/i18n/zh-CN/index.ts +2 -2
- package/src/components/LiveView/index.vue +2 -2
- package/src/components/MicButton/index.vue +3 -3
- package/src/components/StreamMixer/LocalMixer/index.vue +6 -8
- package/src/components/StreamView/Layout/CustomLayout.vue +2 -2
- package/src/components/StreamView/Layout/FloatLayout.vue +88 -83
- package/src/components/StreamView/index.vue +28 -14
- package/src/components/StreamView/manager/mediaManager.ts +38 -42
- package/src/components/VideoSetting/CameraSelect.vue +1 -2
- package/src/components/VideoSetting/VideoMediaControl.vue +1 -1
- package/src/components/VideoSetting/VideoPreview.vue +1 -2
- package/src/components/VideoSetting/VideoProfile.vue +1 -1
- package/src/components/VideoSetting/VideoSettingTab.vue +9 -5
- package/src/components/VideoSettingPanel/CameraSelect.vue +1 -2
- package/src/components/VideoSettingPanel/VideoProfile.vue +7 -7
- package/src/hooks/useRoomEngine.ts +1 -1
- package/src/report/MetricsKey.ts +16 -0
- package/src/report/dataReport.ts +55 -0
- package/src/report/index.ts +7 -0
- package/src/rtc/index.ts +7 -9
- package/src/types/audience.ts +27 -1
- package/src/types/battle.ts +87 -4
- package/src/types/coGuest.ts +87 -5
- package/src/types/device.ts +41 -16
- package/src/types/index.ts +2 -2
- package/src/types/live.ts +41 -22
- package/src/types/seat.ts +28 -4
- package/src/utils/eventCenter.ts +249 -0
- package/dist/DialogPortal-CvJcEAsn.js +0 -417
- package/dist/components/BarrageList/Message/FaceMessage/FaceMessage.js +0 -23
- package/dist/components/BarrageList/Message/FaceMessage/FaceMessage.vue.d.ts +0 -30
- package/dist/components/BarrageList/Message/FaceMessage/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/FaceMessage/index.js +0 -4
- package/dist/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.js +0 -4
- package/dist/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.vue.d.ts +0 -16
- package/dist/components/BarrageList/Message/GroupTipMessage/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/GroupTipMessage/index.js +0 -25
- package/dist/components/BarrageList/Message/ImageMessage/ImageMessage.js +0 -71
- package/dist/components/BarrageList/Message/ImageMessage/ImageMessage.vue.d.ts +0 -34
- package/dist/components/BarrageList/Message/ImageMessage/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/ImageMessage/index.js +0 -4
- package/dist/components/BarrageList/Message/MergerMessage/MergerMessage.js +0 -9
- package/dist/components/BarrageList/Message/MergerMessage/MergerMessage.vue.d.ts +0 -2
- package/dist/components/BarrageList/Message/MergerMessage/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/MergerMessage/index.js +0 -4
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageMeta.js +0 -40
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageMeta.vue.d.ts +0 -54
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageStatusIcon.js +0 -26
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/MessageStatusIcon.vue.d.ts +0 -15
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/MessageLayout/MessageMeta/index.js +0 -4
- package/dist/components/BarrageList/Message/RecalledMessage/RecalledMessage.js +0 -41
- package/dist/components/BarrageList/Message/RecalledMessage/RecalledMessage.vue.d.ts +0 -35
- package/dist/components/BarrageList/Message/RecalledMessage/index.d.ts +0 -3
- package/dist/components/BarrageList/Message/RecalledMessage/index.js +0 -4
- package/dist/components/BarrageList/MessageForward/ForwardListItem.js +0 -45
- package/dist/components/BarrageList/MessageForward/ForwardListItem.vue.d.ts +0 -17
- package/dist/components/BarrageList/MessageForward/MessageForward.js +0 -203
- package/dist/components/BarrageList/MessageForward/MessageForward.vue.d.ts +0 -2
- package/dist/components/BarrageList/MessageForward/index.d.ts +0 -3
- package/dist/components/BarrageList/MessageForward/index.js +0 -4
- package/dist/components/StreamView/Layout/MixLayout.js +0 -89
- package/dist/components/StreamView/Layout/MixLayout.vue.d.ts +0 -31
- package/dist/states/BarrageListState/BarrageListState.d.ts +0 -26
- package/dist/states/BarrageListState/BarrageListState.js +0 -122
- package/dist/states/BarrageListState/index.d.ts +0 -1
- package/dist/states/BarrageListState/index.js +0 -4
- package/dist/states/BattleState.js +0 -117
- package/dist/states/DeviceState.js +0 -296
- package/dist/states/LiveState/index.js +0 -254
- package/dist/states/VideoMixerState.js +0 -260
- package/src/components/BarrageList/Message/FaceMessage/FaceMessage.vue +0 -43
- package/src/components/BarrageList/Message/FaceMessage/index.ts +0 -3
- package/src/components/BarrageList/Message/GroupTipMessage/GroupTipMessage.vue +0 -55
- package/src/components/BarrageList/Message/GroupTipMessage/index.ts +0 -3
- package/src/components/BarrageList/Message/ImageMessage/ImageMessage.vue +0 -181
- package/src/components/BarrageList/Message/ImageMessage/index.ts +0 -3
- package/src/components/BarrageList/Message/MergerMessage/MergerMessage.vue +0 -6
- package/src/components/BarrageList/Message/MergerMessage/index.ts +0 -3
- package/src/components/BarrageList/Message/MessageLayout/MessageMeta/MessageMeta.vue +0 -70
- package/src/components/BarrageList/Message/MessageLayout/MessageMeta/MessageStatusIcon.vue +0 -40
- package/src/components/BarrageList/Message/MessageLayout/MessageMeta/index.ts +0 -3
- package/src/components/BarrageList/Message/RecalledMessage/RecalledMessage.vue +0 -82
- package/src/components/BarrageList/Message/RecalledMessage/index.ts +0 -3
- package/src/components/BarrageList/MessageForward/ForwardListItem.vue +0 -67
- package/src/components/BarrageList/MessageForward/MessageForward.vue +0 -388
- package/src/components/BarrageList/MessageForward/index.ts +0 -3
- package/src/components/StreamView/Layout/MixLayout.vue +0 -144
package/dist/states/SeatStore.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import S, { TUIRoomEvents as c, TUIRequestAction as
|
|
3
|
-
import { useRoomEngine as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { LiveStatus as M } from "../types/live.js";
|
|
1
|
+
import { computed as v, ref as t, watch as A } from "vue";
|
|
2
|
+
import S, { TUIRoomEvents as c, TUIRequestAction as a } from "@tencentcloud/tuiroom-engine-js";
|
|
3
|
+
import { useRoomEngine as g } from "../hooks/useRoomEngine.js";
|
|
4
|
+
import { useLoginState as C } from "./LoginState.js";
|
|
5
|
+
import { useLiveListState as O } from "./LiveListState/LiveListState.js";
|
|
7
6
|
import { DeviceStatus as f } from "../types/device.js";
|
|
8
|
-
const {
|
|
7
|
+
const { currentLive: k } = O(), { loginUserInfo: q } = C(), h = g(), m = v(() => {
|
|
9
8
|
var e, o;
|
|
10
|
-
return ((o = (e =
|
|
11
|
-
}),
|
|
9
|
+
return ((o = (e = k.value) == null ? void 0 : e.liveOwner) == null ? void 0 : o.userId) || "";
|
|
10
|
+
}), w = v(() => {
|
|
12
11
|
var e;
|
|
13
|
-
return ((e =
|
|
14
|
-
}), R = t(/* @__PURE__ */ new Map()), n = t(/* @__PURE__ */ new Map()),
|
|
12
|
+
return ((e = q.value) == null ? void 0 : e.userId) || "";
|
|
13
|
+
}), R = t(/* @__PURE__ */ new Map()), n = t(/* @__PURE__ */ new Map()), p = t(/* @__PURE__ */ new Map()), I = t([]), L = t([]), T = t([]), u = t(/* @__PURE__ */ new Set()), l = t(/* @__PURE__ */ new Set()), U = async (e) => {
|
|
15
14
|
var i;
|
|
16
|
-
const o = await ((i =
|
|
15
|
+
const o = await ((i = h.instance) == null ? void 0 : i.getUserInfo({
|
|
17
16
|
userId: e
|
|
18
17
|
}));
|
|
19
18
|
return {
|
|
@@ -24,17 +23,14 @@ const { localLiveStatus: O, currentLive: w } = C(), { loginUserInfo: $ } = q(),
|
|
|
24
23
|
userRole: o.userRole,
|
|
25
24
|
isMessageDisabled: o.isMessageDisabled
|
|
26
25
|
};
|
|
27
|
-
},
|
|
26
|
+
}, y = (e) => ({
|
|
28
27
|
userId: e.userId,
|
|
29
28
|
userName: e.userName,
|
|
30
29
|
avatarUrl: e.avatarUrl,
|
|
31
30
|
customInfo: e.roomCustomInfo,
|
|
32
31
|
userRole: e.userRole,
|
|
33
32
|
isMessageDisabled: e.isMessageDisabled
|
|
34
|
-
}),
|
|
35
|
-
const a = m.value.has(e) || d.value.has(e);
|
|
36
|
-
return n.value.has(`${u.value}-${o}`) || R.value.has(`${e}-${o}`) ? f.AdminInviting : a ? f.On : f.Off;
|
|
37
|
-
}, N = p(() => I.value.map((e) => {
|
|
33
|
+
}), d = (e, o) => l.value.has(e) || u.value.has(e) ? f.On : f.Off, M = v(() => I.value.map((e) => {
|
|
38
34
|
const o = e.userId !== "";
|
|
39
35
|
return {
|
|
40
36
|
index: e.index,
|
|
@@ -46,14 +42,14 @@ const { localLiveStatus: O, currentLive: w } = C(), { loginUserInfo: $ } = q(),
|
|
|
46
42
|
userId: e.userId,
|
|
47
43
|
userName: e.userName,
|
|
48
44
|
avatarUrl: e.avatarUrl,
|
|
49
|
-
microphoneStatus:
|
|
50
|
-
cameraStatus:
|
|
45
|
+
microphoneStatus: d(e.userId),
|
|
46
|
+
cameraStatus: d(e.userId),
|
|
51
47
|
onSeatTimestamp: 0,
|
|
52
48
|
customInfo: {}
|
|
53
49
|
} : void 0
|
|
54
50
|
};
|
|
55
|
-
})),
|
|
56
|
-
const o =
|
|
51
|
+
})), $ = v(() => L.value.map((e) => {
|
|
52
|
+
const o = p.value.get(e.userId);
|
|
57
53
|
return {
|
|
58
54
|
index: 0,
|
|
59
55
|
// todo engine 未提供
|
|
@@ -68,112 +64,115 @@ const { localLiveStatus: O, currentLive: w } = C(), { loginUserInfo: $ } = q(),
|
|
|
68
64
|
userId: o.userId,
|
|
69
65
|
userName: o.userName,
|
|
70
66
|
avatarUrl: o.avatarUrl,
|
|
71
|
-
microphoneStatus:
|
|
72
|
-
cameraStatus:
|
|
67
|
+
microphoneStatus: d(o.userId),
|
|
68
|
+
cameraStatus: d(o.userId),
|
|
73
69
|
onSeatTimestamp: e.joinConnectionTime,
|
|
74
70
|
networkQuality: void 0,
|
|
75
71
|
customInfo: o.customInfo
|
|
76
72
|
} : void 0
|
|
77
73
|
};
|
|
78
|
-
})),
|
|
79
|
-
const { userId: o, requestAction:
|
|
80
|
-
switch (
|
|
81
|
-
case
|
|
82
|
-
case
|
|
83
|
-
n.value.set(`${
|
|
74
|
+
})), b = async ({ request: e }) => {
|
|
75
|
+
const { userId: o, requestAction: s } = e;
|
|
76
|
+
switch (p.value.set(o, await U(o)), s) {
|
|
77
|
+
case a.kRequestToOpenRemoteCamera:
|
|
78
|
+
case a.kRequestToOpenRemoteMicrophone:
|
|
79
|
+
n.value.set(`${m.value}-${s}`, e);
|
|
84
80
|
break;
|
|
85
|
-
case
|
|
86
|
-
case
|
|
87
|
-
n.value.set(`${o}-${
|
|
81
|
+
case a.kApplyToAdminToOpenLocalCamera:
|
|
82
|
+
case a.kApplyToAdminToOpenLocalMicrophone:
|
|
83
|
+
n.value.set(`${o}-${s}`, e);
|
|
88
84
|
break;
|
|
89
85
|
}
|
|
90
|
-
},
|
|
86
|
+
}, N = ({
|
|
91
87
|
requestId: e,
|
|
92
88
|
userId: o,
|
|
93
|
-
request:
|
|
89
|
+
request: s,
|
|
94
90
|
userInfo: i
|
|
95
91
|
}) => {
|
|
96
|
-
const { requestAction: r } =
|
|
92
|
+
const { requestAction: r } = s;
|
|
97
93
|
switch (r) {
|
|
98
|
-
case
|
|
99
|
-
case
|
|
100
|
-
n.value.delete(`${
|
|
94
|
+
case a.kRequestToOpenRemoteCamera:
|
|
95
|
+
case a.kRequestToOpenRemoteMicrophone:
|
|
96
|
+
n.value.delete(`${m.value}-${r}`);
|
|
101
97
|
break;
|
|
102
|
-
case
|
|
103
|
-
case
|
|
98
|
+
case a.kApplyToAdminToOpenLocalCamera:
|
|
99
|
+
case a.kApplyToAdminToOpenLocalMicrophone:
|
|
104
100
|
n.value.delete(`${o}-${r}`);
|
|
105
101
|
break;
|
|
106
102
|
}
|
|
107
|
-
},
|
|
103
|
+
}, D = ({
|
|
108
104
|
requestId: e,
|
|
109
105
|
userId: o,
|
|
110
|
-
request:
|
|
106
|
+
request: s,
|
|
111
107
|
userInfo: i
|
|
112
108
|
}) => {
|
|
113
|
-
const { requestAction: r } =
|
|
109
|
+
const { requestAction: r } = s;
|
|
114
110
|
switch (r) {
|
|
115
|
-
case
|
|
116
|
-
case
|
|
117
|
-
n.value.delete(`${
|
|
111
|
+
case a.kRequestToOpenRemoteCamera:
|
|
112
|
+
case a.kRequestToOpenRemoteMicrophone:
|
|
113
|
+
n.value.delete(`${m.value}-${r}`);
|
|
118
114
|
break;
|
|
119
|
-
case
|
|
120
|
-
case
|
|
115
|
+
case a.kApplyToAdminToOpenLocalCamera:
|
|
116
|
+
case a.kApplyToAdminToOpenLocalMicrophone:
|
|
121
117
|
n.value.delete(`${o}-${r}`);
|
|
122
118
|
break;
|
|
123
119
|
}
|
|
124
|
-
},
|
|
120
|
+
}, E = async (e) => {
|
|
125
121
|
I.value = e.seatList;
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
},
|
|
122
|
+
}, V = ({ userNetworkList: e }) => {
|
|
123
|
+
T.value = e;
|
|
124
|
+
}, x = ({
|
|
129
125
|
userId: e,
|
|
130
126
|
streamType: o,
|
|
131
|
-
hasVideo:
|
|
127
|
+
hasVideo: s,
|
|
132
128
|
reason: i
|
|
133
129
|
}) => {
|
|
134
|
-
|
|
135
|
-
},
|
|
130
|
+
s ? u.value.add(e) : u.value.delete(e);
|
|
131
|
+
}, Q = ({
|
|
136
132
|
userId: e,
|
|
137
133
|
hasAudio: o,
|
|
138
|
-
reason:
|
|
134
|
+
reason: s
|
|
139
135
|
}) => {
|
|
140
|
-
o ?
|
|
141
|
-
},
|
|
142
|
-
{ event: c.onRequestReceived, handler:
|
|
143
|
-
{ event: c.onRequestProcessed, handler:
|
|
144
|
-
{ event: c.onRequestCancelled, handler:
|
|
145
|
-
{ event: c.onSeatListChanged, handler:
|
|
146
|
-
{ event: c.onUserNetworkQualityChanged, handler:
|
|
147
|
-
{ event: c.onUserVideoStateChanged, handler:
|
|
148
|
-
{ event: c.onUserAudioStateChanged, handler:
|
|
149
|
-
],
|
|
150
|
-
|
|
151
|
-
var
|
|
152
|
-
(
|
|
136
|
+
o ? l.value.add(e) : l.value.delete(e);
|
|
137
|
+
}, H = [
|
|
138
|
+
{ event: c.onRequestReceived, handler: b },
|
|
139
|
+
{ event: c.onRequestProcessed, handler: N },
|
|
140
|
+
{ event: c.onRequestCancelled, handler: D },
|
|
141
|
+
{ event: c.onSeatListChanged, handler: E },
|
|
142
|
+
{ event: c.onUserNetworkQualityChanged, handler: V },
|
|
143
|
+
{ event: c.onUserVideoStateChanged, handler: x },
|
|
144
|
+
{ event: c.onUserAudioStateChanged, handler: Q }
|
|
145
|
+
], P = () => {
|
|
146
|
+
H.forEach(({ event: e, handler: o }) => {
|
|
147
|
+
var s;
|
|
148
|
+
(s = h.instance) == null || s.on(e, o);
|
|
153
149
|
});
|
|
154
|
-
},
|
|
155
|
-
R.value.clear(), n.value.clear(),
|
|
150
|
+
}, j = () => {
|
|
151
|
+
R.value.clear(), n.value.clear(), p.value.clear(), I.value = [], L.value = [], T.value = [], u.value.clear(), l.value.clear();
|
|
156
152
|
};
|
|
157
|
-
|
|
153
|
+
A(() => {
|
|
154
|
+
var e;
|
|
155
|
+
return (e = k.value) == null ? void 0 : e.liveId;
|
|
156
|
+
}, async (e) => {
|
|
158
157
|
var o;
|
|
159
|
-
e
|
|
158
|
+
e ? I.value = await ((o = h.instance) == null ? void 0 : o.getSeatList()) || [] : j();
|
|
160
159
|
});
|
|
161
160
|
S.once("ready", () => {
|
|
162
|
-
|
|
161
|
+
P();
|
|
163
162
|
});
|
|
164
|
-
function
|
|
163
|
+
function W() {
|
|
165
164
|
return {
|
|
166
|
-
liveOwnerUserId:
|
|
167
|
-
localUserId:
|
|
168
|
-
seatList:
|
|
169
|
-
coHostUserList:
|
|
165
|
+
liveOwnerUserId: m,
|
|
166
|
+
localUserId: w,
|
|
167
|
+
seatList: M,
|
|
168
|
+
coHostUserList: $,
|
|
170
169
|
sentDeviceRequestMap: R,
|
|
171
170
|
receivedDeviceRequestMap: n,
|
|
172
|
-
userInfoMap:
|
|
173
|
-
getUserInfo:
|
|
174
|
-
convertUserInfoToAudienceInfo:
|
|
171
|
+
userInfoMap: p,
|
|
172
|
+
getUserInfo: U,
|
|
173
|
+
convertUserInfoToAudienceInfo: y
|
|
175
174
|
};
|
|
176
175
|
}
|
|
177
176
|
export {
|
|
178
|
-
|
|
177
|
+
W as useSeatStore
|
|
179
178
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TUIVideoQuality, MediaSource } from '
|
|
1
|
+
import { TUIVideoQuality, MediaSource } from '../../types';
|
|
2
2
|
|
|
3
3
|
declare function addMediaSource(source: MediaSource): Promise<void>;
|
|
4
4
|
declare function updateMediaSource(source: MediaSource, config: Partial<MediaSource>): Promise<void>;
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { computed as v, ref as C, watch as F } from "vue";
|
|
2
|
+
import L, { TRTCVideoResolutionMode as m, TRTCVideoResolution as u, TUIRoomDeviceMangerEvents as B, TRTCMediaMixingEvent as f, TUIResolutionMode as w, TUIMediaDeviceType as j, TUIMediaDeviceState as H, TRTCMediaSourceType as c, TRTCVideoRotation as E, TRTCVideoMirrorType as I, TRTCVideoFillMode as _ } from "@tencentcloud/tuiroom-engine-js";
|
|
3
|
+
import { useRoomEngine as W } from "../../hooks/useRoomEngine.js";
|
|
4
|
+
import { objectMerge as K } from "../../utils/utils.js";
|
|
5
|
+
import { dataReport as Q } from "../../report/dataReport.js";
|
|
6
|
+
import { MetricsKey as D } from "../../report/MetricsKey.js";
|
|
7
|
+
import { useLiveListState as N } from "../LiveListState/LiveListState.js";
|
|
8
|
+
import { LiveOrientation as R } from "../../types/live.js";
|
|
9
|
+
import { TUIVideoQuality as a, TUIVideoStreamType as X } from "../../types/types.js";
|
|
10
|
+
const M = W(), { currentLive: h } = N(), S = v(() => {
|
|
11
|
+
var e, i;
|
|
12
|
+
return h.value && ((e = h.value) == null ? void 0 : e.layoutTemplate) >= 200 && ((i = h.value) == null ? void 0 : i.layoutTemplate) <= 599 ? R.Landscape : R.Portrait;
|
|
13
|
+
});
|
|
14
|
+
function $(e) {
|
|
15
|
+
return {
|
|
16
|
+
[a.kVideoQuality_1080p]: {
|
|
17
|
+
fps: 20,
|
|
18
|
+
bitrate: 3e3
|
|
19
|
+
},
|
|
20
|
+
[a.kVideoQuality_720p]: {
|
|
21
|
+
fps: 15,
|
|
22
|
+
bitrate: 1800
|
|
23
|
+
},
|
|
24
|
+
[a.kVideoQuality_540p]: {
|
|
25
|
+
fps: 15,
|
|
26
|
+
bitrate: 1200
|
|
27
|
+
},
|
|
28
|
+
[a.kVideoQuality_360p]: {
|
|
29
|
+
fps: 15,
|
|
30
|
+
bitrate: 800
|
|
31
|
+
}
|
|
32
|
+
}[e];
|
|
33
|
+
}
|
|
34
|
+
function z(e) {
|
|
35
|
+
return {
|
|
36
|
+
[a.kVideoQuality_1080p]: {
|
|
37
|
+
width: 1920,
|
|
38
|
+
height: 1080
|
|
39
|
+
},
|
|
40
|
+
[a.kVideoQuality_720p]: {
|
|
41
|
+
width: 1280,
|
|
42
|
+
height: 720
|
|
43
|
+
},
|
|
44
|
+
[a.kVideoQuality_540p]: {
|
|
45
|
+
width: 960,
|
|
46
|
+
height: 540
|
|
47
|
+
},
|
|
48
|
+
[a.kVideoQuality_360p]: {
|
|
49
|
+
width: 640,
|
|
50
|
+
height: 360
|
|
51
|
+
}
|
|
52
|
+
}[e];
|
|
53
|
+
}
|
|
54
|
+
function Z(e) {
|
|
55
|
+
return {
|
|
56
|
+
[u.TRTCVideoResolution_480_270]: { width: 480, height: 270 },
|
|
57
|
+
[u.TRTCVideoResolution_640_360]: { width: 640, height: 360 },
|
|
58
|
+
[u.TRTCVideoResolution_960_540]: { width: 960, height: 540 },
|
|
59
|
+
[u.TRTCVideoResolution_1280_720]: { width: 1280, height: 720 },
|
|
60
|
+
[u.TRTCVideoResolution_1920_1080]: { width: 1920, height: 1080 }
|
|
61
|
+
}[e] || { width: 1280, height: 720 };
|
|
62
|
+
}
|
|
63
|
+
const y = C(a.kVideoQuality_720p), q = v(() => {
|
|
64
|
+
const { width: e, height: i } = z(y.value);
|
|
65
|
+
return S.value === R.Portrait ? i : e;
|
|
66
|
+
}), G = v(() => {
|
|
67
|
+
const { width: e, height: i } = z(y.value);
|
|
68
|
+
return S.value === R.Portrait ? e : i;
|
|
69
|
+
});
|
|
70
|
+
function J(e) {
|
|
71
|
+
return {
|
|
72
|
+
[a.kVideoQuality_1080p]: u.TRTCVideoResolution_1920_1080,
|
|
73
|
+
[a.kVideoQuality_720p]: u.TRTCVideoResolution_1280_720,
|
|
74
|
+
[a.kVideoQuality_540p]: u.TRTCVideoResolution_960_540,
|
|
75
|
+
[a.kVideoQuality_360p]: u.TRTCVideoResolution_640_360
|
|
76
|
+
}[e];
|
|
77
|
+
}
|
|
78
|
+
function Y(e) {
|
|
79
|
+
return {
|
|
80
|
+
[u.TRTCVideoResolution_1920_1080]: a.kVideoQuality_1080p,
|
|
81
|
+
[u.TRTCVideoResolution_1280_720]: a.kVideoQuality_720p,
|
|
82
|
+
[u.TRTCVideoResolution_960_540]: a.kVideoQuality_540p,
|
|
83
|
+
[u.TRTCVideoResolution_640_360]: a.kVideoQuality_360p
|
|
84
|
+
}[e];
|
|
85
|
+
}
|
|
86
|
+
function ee(e) {
|
|
87
|
+
return {
|
|
88
|
+
[m.TRTCVideoResolutionModePortrait]: w.kResolutionMode_Portrait,
|
|
89
|
+
[m.TRTCVideoResolutionModeLandscape]: w.kResolutionMode_Landscape
|
|
90
|
+
}[e];
|
|
91
|
+
}
|
|
92
|
+
const T = v(() => {
|
|
93
|
+
const { fps: e, bitrate: i } = $(y.value);
|
|
94
|
+
return {
|
|
95
|
+
videoEncoderParams: {
|
|
96
|
+
videoResolution: J(y.value),
|
|
97
|
+
resMode: S.value === R.Portrait ? m.TRTCVideoResolutionModePortrait : m.TRTCVideoResolutionModeLandscape,
|
|
98
|
+
videoFps: e,
|
|
99
|
+
videoBitrate: i
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}), g = C(!1), d = C([]), V = v(() => d.value.find((e) => e.isSelected) || null);
|
|
103
|
+
let s;
|
|
104
|
+
function k(e) {
|
|
105
|
+
if (V.value) {
|
|
106
|
+
const i = d.value.find((o) => o.id === V.value.id) || null;
|
|
107
|
+
i && (i.isSelected = !1);
|
|
108
|
+
}
|
|
109
|
+
if (e) {
|
|
110
|
+
const i = d.value.find((o) => o.id === e.id) || null;
|
|
111
|
+
i && (i.isSelected = !0);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async function O() {
|
|
115
|
+
var e;
|
|
116
|
+
T.value && await ((e = M.instance) == null ? void 0 : e.updateVideoQualityEx({
|
|
117
|
+
streamType: X.kCameraStream,
|
|
118
|
+
encoderParams: {
|
|
119
|
+
videoResolution: Y(T.value.videoEncoderParams.videoResolution),
|
|
120
|
+
fps: T.value.videoEncoderParams.videoFps,
|
|
121
|
+
bitrate: T.value.videoEncoderParams.videoBitrate,
|
|
122
|
+
resolutionMode: ee(T.value.videoEncoderParams.resMode)
|
|
123
|
+
}
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
F(
|
|
127
|
+
() => T.value,
|
|
128
|
+
async () => {
|
|
129
|
+
await s && s.updatePublishParams(T.value), await O();
|
|
130
|
+
},
|
|
131
|
+
{ immediate: !0, deep: !0 }
|
|
132
|
+
);
|
|
133
|
+
let p = 1;
|
|
134
|
+
function P(e) {
|
|
135
|
+
var i, o;
|
|
136
|
+
if (e.type === c.kCamera || e.type === c.kScreen) {
|
|
137
|
+
let t, r;
|
|
138
|
+
e.type === c.kCamera ? (t = ((i = e.camera) == null ? void 0 : i.resolution) || u.TRTCVideoResolution_1280_720, r = _.TRTCVideoFillMode_Fill) : e.type === c.kScreen && (t = ((o = e.screen) == null ? void 0 : o.resolution) || u.TRTCVideoResolution_1920_1080, r = _.TRTCVideoFillMode_Fit);
|
|
139
|
+
const { width: n, height: l } = Z(t), b = Math.min(q.value / n, G.value / l), A = {
|
|
140
|
+
rect: {
|
|
141
|
+
left: 0,
|
|
142
|
+
top: 0,
|
|
143
|
+
right: n * b,
|
|
144
|
+
bottom: l * b
|
|
145
|
+
},
|
|
146
|
+
zOrder: p,
|
|
147
|
+
fillMode: r,
|
|
148
|
+
mirror: I.TRTCVideoMirrorType_Disable,
|
|
149
|
+
rotation: E.TRTCVideoRotation_0
|
|
150
|
+
};
|
|
151
|
+
return p += 1, A;
|
|
152
|
+
}
|
|
153
|
+
if (e.type === c.kText) {
|
|
154
|
+
const t = {
|
|
155
|
+
rect: {
|
|
156
|
+
left: 20,
|
|
157
|
+
top: 400,
|
|
158
|
+
right: 220,
|
|
159
|
+
bottom: 500
|
|
160
|
+
},
|
|
161
|
+
zOrder: p
|
|
162
|
+
};
|
|
163
|
+
return p += 1, t;
|
|
164
|
+
}
|
|
165
|
+
if (e.type === c.kImage || e.type === c.kVideo) {
|
|
166
|
+
const t = {
|
|
167
|
+
rect: {
|
|
168
|
+
left: 0,
|
|
169
|
+
top: 0,
|
|
170
|
+
right: 400,
|
|
171
|
+
bottom: 300
|
|
172
|
+
},
|
|
173
|
+
zOrder: p,
|
|
174
|
+
fillMode: _.TRTCVideoFillMode_Fit,
|
|
175
|
+
mirror: I.TRTCVideoMirrorType_Disable,
|
|
176
|
+
rotation: E.TRTCVideoRotation_0
|
|
177
|
+
};
|
|
178
|
+
return p += 1, t;
|
|
179
|
+
}
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
async function ie(e) {
|
|
183
|
+
var i, o, t, r;
|
|
184
|
+
if (e.type === c.kCamera) {
|
|
185
|
+
const n = D.T_METRICS_STATE_API_VIDEO_MIXER_ADD_MEDIA_CAMERA_COUNT;
|
|
186
|
+
Q.reportCount(n);
|
|
187
|
+
try {
|
|
188
|
+
(await navigator.mediaDevices.getUserMedia({ audio: !1, video: !0 })).getVideoTracks()[0].stop();
|
|
189
|
+
} catch (l) {
|
|
190
|
+
throw l;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (e.type === c.kScreen) {
|
|
194
|
+
const n = D.T_METRICS_STATE_API_VIDEO_MIXER_ADD_MEDIA_SCREEN_COUNT;
|
|
195
|
+
Q.reportCount(n);
|
|
196
|
+
}
|
|
197
|
+
e.layout ? e.layout = Object.assign({}, P(e), e.layout) : e.layout = P(e), e.type === c.kText && (e.text = {
|
|
198
|
+
content: ((i = e.text) == null ? void 0 : i.content) || "",
|
|
199
|
+
color: (o = e.text) == null ? void 0 : o.fontColor,
|
|
200
|
+
font: `${(t = e.text) == null ? void 0 : t.fontSize}px ${(r = e.text) == null ? void 0 : r.fontFamily}`
|
|
201
|
+
}), await s.addMediaSource(e), d.value.push(e), k(e);
|
|
202
|
+
}
|
|
203
|
+
async function te(e, i) {
|
|
204
|
+
const o = K(e, i);
|
|
205
|
+
await s.updateMediaSource(o), e.isSelected && k(o);
|
|
206
|
+
const t = d.value.findIndex((r) => r.id === e.id);
|
|
207
|
+
t !== -1 && (d.value[t] = o);
|
|
208
|
+
}
|
|
209
|
+
async function oe(e) {
|
|
210
|
+
await s.removeMediaSource(e), d.value = d.value.filter((i) => i.id !== e.id);
|
|
211
|
+
}
|
|
212
|
+
function ae() {
|
|
213
|
+
g.value = !0, U();
|
|
214
|
+
}
|
|
215
|
+
function ne() {
|
|
216
|
+
d.value.forEach(async (e) => {
|
|
217
|
+
await s.removeMediaSource(e);
|
|
218
|
+
}), d.value = [];
|
|
219
|
+
}
|
|
220
|
+
async function de(e) {
|
|
221
|
+
const { deviceId: i, type: o, state: t } = e;
|
|
222
|
+
o === j.kMediaDeviceTypeVideoCamera && t === H.kMediaDeviceStateAdd && d.value.filter((n) => {
|
|
223
|
+
var l;
|
|
224
|
+
return ((l = n.camera) == null ? void 0 : l.cameraId) === i;
|
|
225
|
+
}).forEach(async (n) => {
|
|
226
|
+
await s.updateMediaSource(n);
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
async function U() {
|
|
230
|
+
var i, o;
|
|
231
|
+
if (!M.instance) return;
|
|
232
|
+
((i = M.instance) == null ? void 0 : i.getMediaDeviceManager()).on(B.onDeviceChanged, de), s = (o = M.instance) == null ? void 0 : o.getTRTCCloud().getMediaMixingManager(), s.updatePublishParams(T.value), s.on(f.onSourceSelected, (t) => {
|
|
233
|
+
k(t);
|
|
234
|
+
}), s.on(f.onSourceDisconnected, (t) => {
|
|
235
|
+
t && t.id && (d.value = d.value.filter((r) => r.id !== t.id));
|
|
236
|
+
}), s.on(f.onSourceMoved, (t, r) => {
|
|
237
|
+
const n = d.value.find((l) => l.id === t.id && l.type === t.type) || null;
|
|
238
|
+
n && (n.layout.rect = r);
|
|
239
|
+
}), s.on(f.onSourceResized, (t, r) => {
|
|
240
|
+
const n = d.value.find((l) => l.id === t.id && l.type === t.type) || null;
|
|
241
|
+
n && (n.layout.rect = r);
|
|
242
|
+
}), s.on(f.onRightButtonClicked, (t) => {
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
L.once("ready", async () => {
|
|
246
|
+
g.value && await U();
|
|
247
|
+
});
|
|
248
|
+
let x = !1;
|
|
249
|
+
function re() {
|
|
250
|
+
x || (L.once("ready", async () => {
|
|
251
|
+
await O();
|
|
252
|
+
}), x = !0);
|
|
253
|
+
}
|
|
254
|
+
function ve() {
|
|
255
|
+
return re(), {
|
|
256
|
+
isVideoMixerEnabled: g,
|
|
257
|
+
publishVideoQuality: y,
|
|
258
|
+
mediaSourceList: d,
|
|
259
|
+
activeMediaSource: V,
|
|
260
|
+
enableLocalVideoMixer: ae,
|
|
261
|
+
addMediaSource: ie,
|
|
262
|
+
updateMediaSource: te,
|
|
263
|
+
removeMediaSource: oe,
|
|
264
|
+
clearMediaSource: ne
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
export {
|
|
268
|
+
ve as useVideoMixerState
|
|
269
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useVideoMixerState } from './VideoMixerState';
|