tuikit-atomicx-vue3-electron 0.0.2 → 5.2.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/dist/components/AudioSettingPanel/SpeakerSelect.js +34 -25
- package/dist/components/LiveScenePanel/i18n/en-US/index.d.ts +4 -0
- package/dist/components/LiveScenePanel/i18n/en-US/index.js +5 -1
- package/dist/components/LiveScenePanel/i18n/zh-CN/index.d.ts +4 -0
- package/dist/components/LiveScenePanel/i18n/zh-CN/index.js +5 -1
- package/dist/components/LiveScenePanel/index.js +135 -117
- package/dist/components/StreamMixer/LocalMixer/MixerControl.js +75 -67
- package/dist/index.js +67 -68
- package/dist/states/DeviceState/DeviceState.js +267 -237
- package/dist/states/LiveListState/LiveListState.js +22 -22
- package/dist/states/VideoMixerState/VideoMixerState.js +72 -64
- package/dist/styles/index.css +1 -1
- package/dist/subEntry/live/index.js +78 -79
- package/dist/subEntry/room/index.js +65 -66
- package/dist/types/index.js +83 -84
- package/dist/types/types.d.ts +0 -5
- package/dist/types/types.js +16 -17
- package/package.json +2 -2
- package/src/components/AudioSettingPanel/SpeakerSelect.vue +11 -2
- package/src/components/LiveScenePanel/i18n/en-US/index.ts +20 -16
- package/src/components/LiveScenePanel/i18n/zh-CN/index.ts +20 -16
- package/src/components/LiveScenePanel/index.vue +44 -18
- package/src/components/StreamMixer/LocalMixer/MixerControl.vue +10 -1
- package/src/types/types.ts +0 -21
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useUIKit as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { _ as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as h, ref as b, watch as g, onBeforeMount as y, openBlock as d, createBlock as v, unref as o, withCtx as _, createElementBlock as C, Fragment as B, renderList as U } from "vue";
|
|
2
|
+
import { useUIKit as w, TUISelect as x, TUIOption as L } from "@tencentcloud/uikit-base-component-vue3";
|
|
3
|
+
import T from "@tencentcloud/tuiroom-engine-electron";
|
|
4
|
+
import V from "../../states/DeviceState/DeviceState.js";
|
|
5
|
+
import { _ as D } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
+
const E = /* @__PURE__ */ h({
|
|
7
7
|
__name: "SpeakerSelect",
|
|
8
8
|
props: {
|
|
9
9
|
onChange: {},
|
|
@@ -11,25 +11,34 @@ const D = /* @__PURE__ */ g({
|
|
|
11
11
|
},
|
|
12
12
|
setup(c) {
|
|
13
13
|
var i;
|
|
14
|
-
const { t:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const { t: m } = w(), r = c, { speakerList: u, currentSpeaker: t, setCurrentSpeaker: f, getSpeakerList: I } = V(), l = b((i = t.value) == null ? void 0 : i.deviceId);
|
|
15
|
+
g(
|
|
16
|
+
() => {
|
|
17
|
+
var e;
|
|
18
|
+
return (e = t.value) == null ? void 0 : e.deviceId;
|
|
19
|
+
},
|
|
20
|
+
(e) => {
|
|
21
|
+
l.value !== e && (l.value = e);
|
|
22
|
+
},
|
|
23
|
+
{ immediate: !0 }
|
|
24
|
+
);
|
|
25
|
+
async function S(e) {
|
|
26
|
+
var n, a, s, p;
|
|
27
|
+
(n = r.onChange) == null || n.call(r, e);
|
|
18
28
|
try {
|
|
19
|
-
await
|
|
29
|
+
await f({ deviceId: e });
|
|
20
30
|
} catch {
|
|
21
|
-
(
|
|
31
|
+
(a = t.value) != null && a.deviceId && u.value.map((k) => k.deviceId).includes((s = t.value) == null ? void 0 : s.deviceId) && (l.value = (p = t.value) == null ? void 0 : p.deviceId);
|
|
22
32
|
}
|
|
23
33
|
}
|
|
24
34
|
return y(async () => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
await I(), n.value = (a = t.value) == null ? void 0 : a.deviceId;
|
|
35
|
+
T.once("ready", async () => {
|
|
36
|
+
await I();
|
|
28
37
|
});
|
|
29
|
-
}), (
|
|
30
|
-
modelValue:
|
|
31
|
-
"onUpdate:modelValue":
|
|
32
|
-
placeholder: o(
|
|
38
|
+
}), (e, n) => (d(), v(o(x), {
|
|
39
|
+
modelValue: l.value,
|
|
40
|
+
"onUpdate:modelValue": n[0] || (n[0] = (a) => l.value = a),
|
|
41
|
+
placeholder: o(m)("AudioSettingPanel.SelectSpeaker"),
|
|
33
42
|
class: "select",
|
|
34
43
|
disabled: c.disabled,
|
|
35
44
|
teleported: !1,
|
|
@@ -37,16 +46,16 @@ const D = /* @__PURE__ */ g({
|
|
|
37
46
|
onChange: S
|
|
38
47
|
}, {
|
|
39
48
|
default: _(() => [
|
|
40
|
-
(d(!0),
|
|
41
|
-
key:
|
|
42
|
-
label:
|
|
43
|
-
value:
|
|
49
|
+
(d(!0), C(B, null, U(o(u), (a) => (d(), v(o(L), {
|
|
50
|
+
key: a.deviceId,
|
|
51
|
+
label: a.deviceName,
|
|
52
|
+
value: a.deviceId
|
|
44
53
|
}, null, 8, ["label", "value"]))), 128))
|
|
45
54
|
]),
|
|
46
55
|
_: 1
|
|
47
56
|
}, 8, ["modelValue", "placeholder", "disabled"]));
|
|
48
57
|
}
|
|
49
|
-
}),
|
|
58
|
+
}), P = /* @__PURE__ */ D(E, [["__scopeId", "data-v-56bea6ce"]]);
|
|
50
59
|
export {
|
|
51
|
-
|
|
60
|
+
P as default
|
|
52
61
|
};
|
|
@@ -38,4 +38,8 @@ export declare const resource: {
|
|
|
38
38
|
'This camera has already been added to the materials list': string;
|
|
39
39
|
'This screen has already been added to the materials list': string;
|
|
40
40
|
'Failed to add image': string;
|
|
41
|
+
'Failed to add screen or window source': string;
|
|
42
|
+
'Failed to add camera source': string;
|
|
43
|
+
'Failed to update media source': string;
|
|
44
|
+
'Failed to update media source. The new media source ID already exited.': string;
|
|
41
45
|
};
|
|
@@ -44,7 +44,11 @@ const e = {
|
|
|
44
44
|
"Please check the current browser camera permission": "Please check the current browser camera permission",
|
|
45
45
|
"This camera has already been added to the materials list": "This camera has already been added to the materials list",
|
|
46
46
|
"This screen has already been added to the materials list": "This screen has already been added to the materials list",
|
|
47
|
-
"Failed to add image": "Failed to add image"
|
|
47
|
+
"Failed to add image": "Failed to add image",
|
|
48
|
+
"Failed to add screen or window source": "Failed to add screen or window source",
|
|
49
|
+
"Failed to add camera source": "Failed to add camera source",
|
|
50
|
+
"Failed to update media source": "Failed to update media source",
|
|
51
|
+
"Failed to update media source. The new media source ID already exited.": "Failed to update media source. The new media source ID already exited."
|
|
48
52
|
};
|
|
49
53
|
export {
|
|
50
54
|
e as resource
|
|
@@ -38,4 +38,8 @@ export declare const resource: {
|
|
|
38
38
|
'This camera has already been added to the materials list': string;
|
|
39
39
|
'This screen has already been added to the materials list': string;
|
|
40
40
|
'Failed to add image': string;
|
|
41
|
+
'Failed to add screen or window source': string;
|
|
42
|
+
'Failed to add camera source.': string;
|
|
43
|
+
'Failed to update media source': string;
|
|
44
|
+
'Failed to update media source. The new media source ID already exited.': string;
|
|
41
45
|
};
|
|
@@ -44,7 +44,11 @@ const e = {
|
|
|
44
44
|
"Please check the current browser camera permission": "请检查当前浏览器摄像头权限",
|
|
45
45
|
"This camera has already been added to the materials list": "该摄像头已在素材列表中,无需重复添加",
|
|
46
46
|
"This screen has already been added to the materials list": "该屏幕分享已在素材列表中,无需重复添加",
|
|
47
|
-
"Failed to add image": "添加图片失败"
|
|
47
|
+
"Failed to add image": "添加图片失败",
|
|
48
|
+
"Failed to add screen or window source": "添加屏幕或窗口失败",
|
|
49
|
+
"Failed to add camera source.": "添加摄像头失败",
|
|
50
|
+
"Failed to update media source": "更新媒体源失败",
|
|
51
|
+
"Failed to update media source. The new media source ID already exited.": "更新媒体源失败,新修改的媒体源 ID 已存在"
|
|
48
52
|
};
|
|
49
53
|
export {
|
|
50
54
|
e as resource
|
|
@@ -1,159 +1,177 @@
|
|
|
1
|
-
import { addI18n as
|
|
2
|
-
import { resource as
|
|
3
|
-
import { resource as
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { TRTCMediaSourceType as
|
|
6
|
-
import { useUIKit as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { _ as
|
|
11
|
-
import
|
|
1
|
+
import { addI18n as T } from "../../i18n/index.js";
|
|
2
|
+
import { resource as H } from "./i18n/en-US/index.js";
|
|
3
|
+
import { resource as K } from "./i18n/zh-CN/index.js";
|
|
4
|
+
import { defineComponent as Y, ref as l, computed as Z, openBlock as i, createElementBlock as w, normalizeClass as q, unref as L, createVNode as J, createElementVNode as Q, Fragment as X, renderList as ee, createBlock as p, createCommentVNode as k } from "vue";
|
|
5
|
+
import { TRTCMediaSourceType as g } from "@tencentcloud/tuiroom-engine-electron";
|
|
6
|
+
import { useUIKit as ae, TUIToast as n, TOAST_TYPE as s } from "@tencentcloud/uikit-base-component-vue3";
|
|
7
|
+
import te from "./CameraSettingDialog.js";
|
|
8
|
+
import re from "./LiveSceneSelect.js";
|
|
9
|
+
import oe from "./MaterialItem.js";
|
|
10
|
+
import { _ as ne } from "../../MaterialRenameDialog.vue_vue_type_script_setup_true_lang-CBgkIenq.js";
|
|
11
|
+
import se from "./ScreenShareSettingDialog.js";
|
|
12
12
|
import { useVideoMixerState as le } from "../../states/VideoMixerState/VideoMixerState.js";
|
|
13
13
|
import { _ as ie } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
|
-
const
|
|
14
|
+
const ce = { class: "materials-list" }, de = /* @__PURE__ */ Y({
|
|
15
15
|
__name: "index",
|
|
16
16
|
setup(ue) {
|
|
17
|
-
const { t:
|
|
18
|
-
addMediaSource:
|
|
19
|
-
updateMediaSource:
|
|
20
|
-
mediaSourceList:
|
|
21
|
-
} = le(),
|
|
22
|
-
(
|
|
23
|
-
)),
|
|
24
|
-
|
|
25
|
-
}, M =
|
|
26
|
-
M.value =
|
|
27
|
-
},
|
|
28
|
-
|
|
17
|
+
const { t: o } = ae(), {
|
|
18
|
+
addMediaSource: S,
|
|
19
|
+
updateMediaSource: b,
|
|
20
|
+
mediaSourceList: f
|
|
21
|
+
} = le(), h = l(null), v = l(null), U = Z(() => [...f.value].sort(
|
|
22
|
+
(a, t) => (t.zOrder || 0) - (a.zOrder || 0)
|
|
23
|
+
)), A = l(!1), d = l(!1), m = l(!1), y = l(!1), O = () => {
|
|
24
|
+
A.value = !1;
|
|
25
|
+
}, M = l(null), x = (a) => {
|
|
26
|
+
M.value = a, y.value = !0;
|
|
27
|
+
}, R = () => {
|
|
28
|
+
d.value = !1;
|
|
29
29
|
}, C = () => {
|
|
30
|
-
|
|
30
|
+
m.value = !1;
|
|
31
31
|
}, D = () => {
|
|
32
|
-
|
|
33
|
-
},
|
|
32
|
+
y.value = !1;
|
|
33
|
+
}, F = async (a) => {
|
|
34
|
+
var t;
|
|
34
35
|
try {
|
|
35
|
-
await
|
|
36
|
-
} catch (
|
|
37
|
-
console.error("addCameraMaterial error:",
|
|
38
|
-
type:
|
|
39
|
-
message:
|
|
36
|
+
await S(a), R();
|
|
37
|
+
} catch (e) {
|
|
38
|
+
console.error("addCameraMaterial error:", e), ((t = e == null ? void 0 : e.message) == null ? void 0 : t.includes("Media source already existed")) || !1 ? n({
|
|
39
|
+
type: s.WARNING,
|
|
40
|
+
message: o("This camera has already been added to the materials list")
|
|
41
|
+
}) : n({
|
|
42
|
+
type: s.WARNING,
|
|
43
|
+
message: o("Failed to add camera source.")
|
|
40
44
|
});
|
|
41
45
|
}
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
switch (
|
|
48
|
-
case
|
|
49
|
-
|
|
46
|
+
}, W = (a) => {
|
|
47
|
+
h.value = a, d.value = !0;
|
|
48
|
+
}, E = (a) => {
|
|
49
|
+
v.value = a, m.value = !0;
|
|
50
|
+
}, G = async (a) => {
|
|
51
|
+
switch (O(), a) {
|
|
52
|
+
case g.kCamera:
|
|
53
|
+
h.value = null, d.value = !0;
|
|
50
54
|
break;
|
|
51
|
-
case
|
|
52
|
-
|
|
55
|
+
case g.kScreen:
|
|
56
|
+
v.value = null, m.value = !0;
|
|
53
57
|
break;
|
|
54
|
-
case
|
|
55
|
-
|
|
58
|
+
case g.kImage:
|
|
59
|
+
j();
|
|
56
60
|
break;
|
|
57
61
|
}
|
|
58
62
|
};
|
|
59
|
-
function
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
var
|
|
63
|
-
const
|
|
64
|
-
if (!
|
|
63
|
+
function j() {
|
|
64
|
+
const a = document.createElement("input");
|
|
65
|
+
a.type = "file", a.accept = ".jpg,.jpeg,.png,.bmp", a.onchange = async (t) => {
|
|
66
|
+
var N, _;
|
|
67
|
+
const e = (_ = (N = t.target) == null ? void 0 : N.files) == null ? void 0 : _[0];
|
|
68
|
+
if (!e)
|
|
65
69
|
return;
|
|
66
|
-
const
|
|
67
|
-
if (!
|
|
70
|
+
const r = e.path;
|
|
71
|
+
if (!r) {
|
|
68
72
|
console.warn("Failed to get file path");
|
|
69
73
|
return;
|
|
70
74
|
}
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
const
|
|
75
|
+
const u = URL.createObjectURL(e), c = new Image();
|
|
76
|
+
c.src = u, c.onload = async () => {
|
|
77
|
+
const $ = c.width, P = c.height, V = {
|
|
78
|
+
sourceId: r,
|
|
79
|
+
sourceType: g.kImage,
|
|
80
|
+
name: e.name || o("Image"),
|
|
81
|
+
rect: {
|
|
82
|
+
left: 0,
|
|
83
|
+
top: 0,
|
|
84
|
+
right: $,
|
|
85
|
+
bottom: P
|
|
86
|
+
},
|
|
87
|
+
zOrder: 1
|
|
88
|
+
};
|
|
74
89
|
try {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
left: 0,
|
|
81
|
-
top: 0,
|
|
82
|
-
right: W,
|
|
83
|
-
bottom: B
|
|
84
|
-
},
|
|
85
|
-
zOrder: 1
|
|
86
|
-
};
|
|
87
|
-
await p(_);
|
|
88
|
-
} catch (_) {
|
|
89
|
-
console.error("addImageMaterial error:", _), d({
|
|
90
|
-
type: g.ERROR,
|
|
91
|
-
message: n("Failed to add image")
|
|
90
|
+
await S(V);
|
|
91
|
+
} catch (B) {
|
|
92
|
+
console.error("addImageMaterial error:", B), n({
|
|
93
|
+
type: s.ERROR,
|
|
94
|
+
message: o("Failed to add image")
|
|
92
95
|
});
|
|
93
96
|
}
|
|
94
|
-
URL.revokeObjectURL(
|
|
95
|
-
},
|
|
96
|
-
URL.revokeObjectURL(
|
|
97
|
-
type:
|
|
98
|
-
message:
|
|
97
|
+
URL.revokeObjectURL(u);
|
|
98
|
+
}, c.onerror = () => {
|
|
99
|
+
URL.revokeObjectURL(u), n({
|
|
100
|
+
type: s.ERROR,
|
|
101
|
+
message: o("Failed to load image")
|
|
99
102
|
});
|
|
100
103
|
};
|
|
101
|
-
},
|
|
104
|
+
}, a.click();
|
|
102
105
|
}
|
|
103
|
-
const
|
|
106
|
+
const z = async (a) => {
|
|
107
|
+
var t;
|
|
104
108
|
try {
|
|
105
|
-
await
|
|
106
|
-
} catch (
|
|
107
|
-
console.log("addScreenMaterial error",
|
|
108
|
-
type:
|
|
109
|
-
message:
|
|
109
|
+
await S(a), C();
|
|
110
|
+
} catch (e) {
|
|
111
|
+
console.log("addScreenMaterial error", e), ((t = e == null ? void 0 : e.message) == null ? void 0 : t.includes("Media source already existed")) || !1 ? n({
|
|
112
|
+
type: s.WARNING,
|
|
113
|
+
message: o("This screen has already been added to the materials list")
|
|
114
|
+
}) : n({
|
|
115
|
+
type: s.WARNING,
|
|
116
|
+
message: o("Failed to add screen or window source")
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}, I = async (a, t) => {
|
|
120
|
+
var e;
|
|
121
|
+
try {
|
|
122
|
+
await b(a, t), R(), C(), D();
|
|
123
|
+
} catch (r) {
|
|
124
|
+
console.log("updateMediaSource error", r), ((e = r == null ? void 0 : r.message) == null ? void 0 : e.includes("Media source already existed")) || !1 ? n({
|
|
125
|
+
type: s.WARNING,
|
|
126
|
+
message: o("Failed to update media source. The new media source ID already exited.")
|
|
127
|
+
}) : n({
|
|
128
|
+
type: s.WARNING,
|
|
129
|
+
message: o("Failed to update media source")
|
|
110
130
|
});
|
|
111
131
|
}
|
|
112
|
-
}, R = async (e, a) => {
|
|
113
|
-
await O(e, a), y(), C(), D();
|
|
114
132
|
};
|
|
115
|
-
return (
|
|
116
|
-
class:
|
|
133
|
+
return (a, t) => (i(), w("div", {
|
|
134
|
+
class: q(["live-scene-panel", { "no-material": L(f).length === 0 }])
|
|
117
135
|
}, [
|
|
118
|
-
|
|
119
|
-
displayMode:
|
|
120
|
-
onAddMaterial:
|
|
136
|
+
J(re, {
|
|
137
|
+
displayMode: L(f).length === 0 ? "panel" : "button",
|
|
138
|
+
onAddMaterial: G
|
|
121
139
|
}, null, 8, ["displayMode"]),
|
|
122
|
-
|
|
123
|
-
(
|
|
124
|
-
key:
|
|
125
|
-
material:
|
|
126
|
-
onCameraSetting: (
|
|
127
|
-
onScreenShareSetting: (
|
|
128
|
-
onRename: (
|
|
140
|
+
Q("div", ce, [
|
|
141
|
+
(i(!0), w(X, null, ee(U.value, (e) => (i(), p(oe, {
|
|
142
|
+
key: e.sourceId,
|
|
143
|
+
material: e,
|
|
144
|
+
onCameraSetting: (r) => W(e),
|
|
145
|
+
onScreenShareSetting: (r) => E(e),
|
|
146
|
+
onRename: (r) => x(e)
|
|
129
147
|
}, null, 8, ["material", "onCameraSetting", "onScreenShareSetting", "onRename"]))), 128))
|
|
130
148
|
]),
|
|
131
|
-
|
|
149
|
+
d.value ? (i(), p(te, {
|
|
132
150
|
key: 0,
|
|
133
|
-
mediaSource: f.value,
|
|
134
|
-
onClose: y,
|
|
135
|
-
onAddCameraMaterial: j,
|
|
136
|
-
onUpdateCameraMaterial: R
|
|
137
|
-
}, null, 8, ["mediaSource"])) : I("", !0),
|
|
138
|
-
c.value ? (o(), m(ne, {
|
|
139
|
-
key: 1,
|
|
140
151
|
mediaSource: h.value,
|
|
152
|
+
onClose: R,
|
|
153
|
+
onAddCameraMaterial: F,
|
|
154
|
+
onUpdateCameraMaterial: I
|
|
155
|
+
}, null, 8, ["mediaSource"])) : k("", !0),
|
|
156
|
+
m.value ? (i(), p(se, {
|
|
157
|
+
key: 1,
|
|
158
|
+
mediaSource: v.value,
|
|
141
159
|
onClose: C,
|
|
142
|
-
onAddScreenMaterial:
|
|
143
|
-
onUpdateScreenMaterial:
|
|
144
|
-
}, null, 8, ["mediaSource"])) :
|
|
145
|
-
|
|
160
|
+
onAddScreenMaterial: z,
|
|
161
|
+
onUpdateScreenMaterial: I
|
|
162
|
+
}, null, 8, ["mediaSource"])) : k("", !0),
|
|
163
|
+
y.value ? (i(), p(ne, {
|
|
146
164
|
key: 2,
|
|
147
165
|
material: M.value,
|
|
148
166
|
onClose: D,
|
|
149
|
-
onRename:
|
|
150
|
-
}, null, 8, ["material"])) :
|
|
167
|
+
onRename: t[0] || (t[0] = (e) => I(M.value, { name: e }))
|
|
168
|
+
}, null, 8, ["material"])) : k("", !0)
|
|
151
169
|
], 2));
|
|
152
170
|
}
|
|
153
|
-
}), me = /* @__PURE__ */ ie(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
const
|
|
171
|
+
}), me = /* @__PURE__ */ ie(de, [["__scopeId", "data-v-4f634084"]]);
|
|
172
|
+
T("en-US", { translation: H });
|
|
173
|
+
T("zh-CN", { translation: K });
|
|
174
|
+
const Ne = me;
|
|
157
175
|
export {
|
|
158
|
-
|
|
176
|
+
Ne as LiveScenePanel
|
|
159
177
|
};
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { TRTCVideoMirrorType as p, TRTCVideoRotation as
|
|
3
|
-
import { useUIKit as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useVideoMixerState as
|
|
10
|
-
import { _ as
|
|
11
|
-
const
|
|
1
|
+
import { defineComponent as V, computed as u, openBlock as m, createElementBlock as v, Fragment as h, renderList as z, withModifiers as I, normalizeStyle as T, normalizeClass as b, createElementVNode as f, createBlock as k, resolveDynamicComponent as S, toDisplayString as D } from "vue";
|
|
2
|
+
import { TRTCVideoMirrorType as p, TRTCVideoRotation as n } from "@tencentcloud/tuiroom-engine-electron";
|
|
3
|
+
import { useUIKit as g } from "@tencentcloud/uikit-base-component-vue3";
|
|
4
|
+
import A from "../icons/CameraMirror.js";
|
|
5
|
+
import B from "../icons/Delete.js";
|
|
6
|
+
import E from "../icons/Down.js";
|
|
7
|
+
import L from "../icons/Rotation.js";
|
|
8
|
+
import Z from "../icons/Up.js";
|
|
9
|
+
import { useVideoMixerState as U } from "../../../states/VideoMixerState/VideoMixerState.js";
|
|
10
|
+
import { _ as j } from "../../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
|
+
const F = ["onClick"], K = { class: "mixer-control-item-icon" }, N = { class: "mixer-control-item-name" }, P = /* @__PURE__ */ V({
|
|
12
12
|
__name: "MixerControl",
|
|
13
|
-
setup(
|
|
14
|
-
const { activeMediaSource: e, mediaSourceList: C, updateMediaSource:
|
|
13
|
+
setup(q) {
|
|
14
|
+
const { activeMediaSource: e, mediaSourceList: C, updateMediaSource: c, removeMediaSource: R } = U(), { t: l } = g();
|
|
15
15
|
function M(o) {
|
|
16
16
|
o.stopPropagation();
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
var o,
|
|
20
|
-
return ((o = e.value) == null ? void 0 : o.sourceId) === ((
|
|
18
|
+
const s = u(() => [...C.value].sort((o, t) => o.zOrder - t.zOrder)), x = u(() => {
|
|
19
|
+
var o, t;
|
|
20
|
+
return ((o = e.value) == null ? void 0 : o.sourceId) === ((t = s.value[0]) == null ? void 0 : t.sourceId);
|
|
21
21
|
}), y = u(() => {
|
|
22
|
-
var o,
|
|
23
|
-
return ((o = e.value) == null ? void 0 : o.sourceId) === ((
|
|
22
|
+
var o, t;
|
|
23
|
+
return ((o = e.value) == null ? void 0 : o.sourceId) === ((t = s.value[s.value.length - 1]) == null ? void 0 : t.sourceId);
|
|
24
24
|
}), _ = u(() => [
|
|
25
25
|
{
|
|
26
26
|
name: "mirror",
|
|
27
|
-
text:
|
|
28
|
-
icon:
|
|
27
|
+
text: l("Mirror"),
|
|
28
|
+
icon: A,
|
|
29
29
|
onClick: () => {
|
|
30
30
|
if (e.value) {
|
|
31
31
|
const o = e.value.mirrorType;
|
|
32
|
-
|
|
32
|
+
c(e.value, {
|
|
33
33
|
mirrorType: o === p.TRTCVideoMirrorType_Enable ? p.TRTCVideoMirrorType_Disable : p.TRTCVideoMirrorType_Enable
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -37,95 +37,103 @@ const U = ["onClick"], j = { class: "mixer-control-item-icon" }, F = { class: "m
|
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
name: "rotate",
|
|
40
|
-
text:
|
|
41
|
-
icon:
|
|
40
|
+
text: l("Rotate"),
|
|
41
|
+
icon: L,
|
|
42
42
|
onClick: () => {
|
|
43
43
|
var o;
|
|
44
44
|
if (e.value) {
|
|
45
|
-
const
|
|
46
|
-
[
|
|
47
|
-
[
|
|
48
|
-
[
|
|
49
|
-
[
|
|
50
|
-
}[
|
|
51
|
-
|
|
45
|
+
const t = ((o = e.value) == null ? void 0 : o.rotation) || n.TRTCVideoRotation0, d = {
|
|
46
|
+
[n.TRTCVideoRotation0]: n.TRTCVideoRotation90,
|
|
47
|
+
[n.TRTCVideoRotation90]: n.TRTCVideoRotation180,
|
|
48
|
+
[n.TRTCVideoRotation180]: n.TRTCVideoRotation270,
|
|
49
|
+
[n.TRTCVideoRotation270]: n.TRTCVideoRotation0
|
|
50
|
+
}[t], { top: i, left: a, right: O, bottom: w } = e.value.rect;
|
|
51
|
+
c(e.value, {
|
|
52
|
+
rotation: d,
|
|
53
|
+
rect: {
|
|
54
|
+
top: i,
|
|
55
|
+
left: a,
|
|
56
|
+
right: a + w - i,
|
|
57
|
+
bottom: i + O - a
|
|
58
|
+
}
|
|
59
|
+
});
|
|
52
60
|
}
|
|
53
61
|
}
|
|
54
62
|
},
|
|
55
63
|
{
|
|
56
64
|
name: "up",
|
|
57
|
-
text:
|
|
58
|
-
icon:
|
|
65
|
+
text: l("Move Up"),
|
|
66
|
+
icon: Z,
|
|
59
67
|
disable: y.value,
|
|
60
68
|
onClick: async () => {
|
|
61
69
|
if (e.value) {
|
|
62
|
-
const o =
|
|
63
|
-
var
|
|
64
|
-
return
|
|
65
|
-
}),
|
|
66
|
-
if (
|
|
70
|
+
const o = s.value.findIndex((i) => {
|
|
71
|
+
var a;
|
|
72
|
+
return i.sourceId === ((a = e.value) == null ? void 0 : a.sourceId);
|
|
73
|
+
}), t = s.value[o + 1], r = e.value.zOrder, d = t.zOrder;
|
|
74
|
+
if (t)
|
|
67
75
|
try {
|
|
68
|
-
await
|
|
69
|
-
} catch (
|
|
70
|
-
console.warn("Move up failed.",
|
|
76
|
+
await c(e.value, { zOrder: 999 }), await c(t, { zOrder: r }), await c(e.value, { zOrder: d });
|
|
77
|
+
} catch (i) {
|
|
78
|
+
console.warn("Move up failed.", i);
|
|
71
79
|
}
|
|
72
80
|
else
|
|
73
|
-
console.error(
|
|
81
|
+
console.error(l("Already at top"));
|
|
74
82
|
}
|
|
75
83
|
}
|
|
76
84
|
},
|
|
77
85
|
{
|
|
78
86
|
name: "down",
|
|
79
|
-
text:
|
|
80
|
-
icon:
|
|
87
|
+
text: l("Move Down"),
|
|
88
|
+
icon: E,
|
|
81
89
|
disable: x.value,
|
|
82
90
|
onClick: async () => {
|
|
83
91
|
if (e.value) {
|
|
84
|
-
const o =
|
|
85
|
-
var
|
|
86
|
-
return
|
|
87
|
-
}),
|
|
88
|
-
if (
|
|
92
|
+
const o = s.value.findIndex((i) => {
|
|
93
|
+
var a;
|
|
94
|
+
return i.sourceId === ((a = e.value) == null ? void 0 : a.sourceId);
|
|
95
|
+
}), t = s.value[o - 1], r = e.value.zOrder, d = t.zOrder;
|
|
96
|
+
if (t)
|
|
89
97
|
try {
|
|
90
|
-
await
|
|
91
|
-
} catch (
|
|
92
|
-
console.warn("Move down failed.",
|
|
98
|
+
await c(e.value, { zOrder: 0 }), await c(t, { zOrder: r }), await c(e.value, { zOrder: d });
|
|
99
|
+
} catch (i) {
|
|
100
|
+
console.warn("Move down failed.", i);
|
|
93
101
|
}
|
|
94
102
|
else
|
|
95
|
-
console.error(
|
|
103
|
+
console.error(l("Already at bottom"));
|
|
96
104
|
}
|
|
97
105
|
}
|
|
98
106
|
},
|
|
99
107
|
{
|
|
100
108
|
name: "delete",
|
|
101
|
-
text:
|
|
102
|
-
icon:
|
|
109
|
+
text: l("Delete"),
|
|
110
|
+
icon: B,
|
|
103
111
|
style: "color: red",
|
|
104
112
|
onClick: () => {
|
|
105
113
|
e.value && R(e.value);
|
|
106
114
|
}
|
|
107
115
|
}
|
|
108
116
|
]);
|
|
109
|
-
return (o,
|
|
117
|
+
return (o, t) => (m(), v("div", {
|
|
110
118
|
class: "mixer-control",
|
|
111
119
|
onMousedown: M
|
|
112
120
|
}, [
|
|
113
|
-
(m(!0), v(
|
|
114
|
-
key:
|
|
115
|
-
class:
|
|
116
|
-
style: T(
|
|
117
|
-
onClick:
|
|
121
|
+
(m(!0), v(h, null, z(_.value, (r) => (m(), v("div", {
|
|
122
|
+
key: r.name,
|
|
123
|
+
class: b(["mixer-control-item", { disable: r.disable }]),
|
|
124
|
+
style: T(r.style),
|
|
125
|
+
onClick: I(r.onClick, ["stop"])
|
|
118
126
|
}, [
|
|
119
|
-
f("div",
|
|
120
|
-
(m(),
|
|
121
|
-
style: T([{ width: "100%", height: "100%" },
|
|
127
|
+
f("div", K, [
|
|
128
|
+
(m(), k(S(r.icon), {
|
|
129
|
+
style: T([{ width: "100%", height: "100%" }, r.style])
|
|
122
130
|
}, null, 8, ["style"]))
|
|
123
131
|
]),
|
|
124
|
-
f("span",
|
|
125
|
-
], 14,
|
|
132
|
+
f("span", N, D(r.text), 1)
|
|
133
|
+
], 14, F))), 128))
|
|
126
134
|
], 32));
|
|
127
135
|
}
|
|
128
|
-
}),
|
|
136
|
+
}), te = /* @__PURE__ */ j(P, [["__scopeId", "data-v-05dd636b"]]);
|
|
129
137
|
export {
|
|
130
|
-
|
|
138
|
+
te as default
|
|
131
139
|
};
|