@nice2dev/ui-video 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1013 -921
- package/dist/ui-video.css +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as t, jsx as e, Fragment as
|
|
2
|
-
import { NiceAppShell as
|
|
3
|
-
import { NiceIcon as
|
|
4
|
-
import { useState as
|
|
1
|
+
import { jsxs as t, jsx as e, Fragment as oe } from "react/jsx-runtime";
|
|
2
|
+
import { NiceAppShell as pe } from "@nice2dev/ui";
|
|
3
|
+
import { useNiceTranslation as me, NiceIcon as m, NiceTutorialButton as _e, resolveTutorial as ge, createId as $ } from "@nice2dev/ui-core";
|
|
4
|
+
import { useState as g, useRef as M, useEffect as le, useCallback as ue } from "react";
|
|
5
5
|
const fe = {
|
|
6
6
|
id: $(),
|
|
7
7
|
name: "Untitled Project",
|
|
@@ -45,7 +45,7 @@ const fe = {
|
|
|
45
45
|
{ type: "chromaKey", name: "Chroma Key", icon: "layers" },
|
|
46
46
|
{ type: "crop", name: "Crop", icon: "crop" },
|
|
47
47
|
{ type: "zoom", name: "Zoom", icon: "search" }
|
|
48
|
-
],
|
|
48
|
+
], ye = [
|
|
49
49
|
{ type: "fade", name: "Fade" },
|
|
50
50
|
{ type: "dissolve", name: "Dissolve" },
|
|
51
51
|
{ type: "wipe", name: "Wipe" },
|
|
@@ -62,72 +62,72 @@ const fe = {
|
|
|
62
62
|
placement: "auto"
|
|
63
63
|
}
|
|
64
64
|
], ze = ({
|
|
65
|
-
project:
|
|
66
|
-
onProjectChange:
|
|
67
|
-
onExport:
|
|
68
|
-
onAssetUpload:
|
|
69
|
-
className:
|
|
70
|
-
tutorial:
|
|
65
|
+
project: E,
|
|
66
|
+
onProjectChange: R,
|
|
67
|
+
onExport: F,
|
|
68
|
+
onAssetUpload: L,
|
|
69
|
+
className: O = "",
|
|
70
|
+
tutorial: I
|
|
71
71
|
}) => {
|
|
72
|
-
const [
|
|
72
|
+
const { t: b } = me(), [r, s] = g(E || fe), [A, y] = g(
|
|
73
73
|
"timeline"
|
|
74
|
-
), [H,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
|
|
74
|
+
), [H, v] = g(null), [k, N] = g(null), [D, w] = g(0), [B, K] = g(!1), [C, G] = g(1), [W, z] = g(!0), [T, U] = g(null), ie = M(null), te = M(null), x = M(null);
|
|
75
|
+
le(() => {
|
|
76
|
+
E && s(E);
|
|
77
|
+
}, [E]), le(() => () => {
|
|
78
|
+
x.current && clearInterval(x.current);
|
|
79
79
|
}, []);
|
|
80
|
-
const
|
|
81
|
-
(
|
|
82
|
-
const
|
|
83
|
-
s(
|
|
80
|
+
const f = ue(
|
|
81
|
+
(a) => {
|
|
82
|
+
const o = { ...r, ...a };
|
|
83
|
+
s(o), R == null || R(o);
|
|
84
84
|
},
|
|
85
|
-
[
|
|
86
|
-
),
|
|
87
|
-
const
|
|
88
|
-
for (const
|
|
89
|
-
const
|
|
90
|
-
let
|
|
91
|
-
|
|
85
|
+
[r, R]
|
|
86
|
+
), _ = async (a) => {
|
|
87
|
+
const o = [];
|
|
88
|
+
for (const n of Array.from(a)) {
|
|
89
|
+
const d = n.type.startsWith("video/") ? "video" : n.type.startsWith("audio/") ? "audio" : "image";
|
|
90
|
+
let u;
|
|
91
|
+
L ? u = await L(n) : u = {
|
|
92
92
|
id: $(),
|
|
93
|
-
type:
|
|
94
|
-
name:
|
|
95
|
-
url: URL.createObjectURL(
|
|
96
|
-
size:
|
|
97
|
-
},
|
|
93
|
+
type: d,
|
|
94
|
+
name: n.name,
|
|
95
|
+
url: URL.createObjectURL(n),
|
|
96
|
+
size: n.size
|
|
97
|
+
}, o.push(u);
|
|
98
98
|
}
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
const
|
|
99
|
+
f({ assets: [...r.assets, ...o] });
|
|
100
|
+
}, V = (a) => {
|
|
101
|
+
const o = {
|
|
102
102
|
id: $(),
|
|
103
|
-
type:
|
|
104
|
-
name: `${
|
|
103
|
+
type: a,
|
|
104
|
+
name: `${a.charAt(0).toUpperCase() + a.slice(1)} ${r.tracks.filter((n) => n.type === a).length + 1}`,
|
|
105
105
|
items: [],
|
|
106
106
|
muted: !1,
|
|
107
107
|
locked: !1,
|
|
108
108
|
visible: !0
|
|
109
109
|
};
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
tracks:
|
|
110
|
+
f({ tracks: [...r.tracks, o] });
|
|
111
|
+
}, Y = (a) => {
|
|
112
|
+
f({ tracks: r.tracks.filter((o) => o.id !== a) }), H === a && v(null);
|
|
113
|
+
}, q = (a) => {
|
|
114
|
+
f({
|
|
115
|
+
tracks: r.tracks.map((o) => o.id === a ? { ...o, muted: !o.muted } : o)
|
|
116
116
|
});
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
tracks:
|
|
117
|
+
}, X = (a) => {
|
|
118
|
+
f({
|
|
119
|
+
tracks: r.tracks.map((o) => o.id === a ? { ...o, locked: !o.locked } : o)
|
|
120
120
|
});
|
|
121
|
-
},
|
|
122
|
-
const
|
|
123
|
-
if (!
|
|
121
|
+
}, S = (a, o) => {
|
|
122
|
+
const n = r.tracks.find((p) => p.id === a);
|
|
123
|
+
if (!n || n.locked)
|
|
124
124
|
return;
|
|
125
|
-
const
|
|
125
|
+
const d = n.items[n.items.length - 1], u = d ? d.startTime + d.duration : 0, h = {
|
|
126
126
|
id: $(),
|
|
127
|
-
assetId:
|
|
128
|
-
type:
|
|
129
|
-
startTime:
|
|
130
|
-
duration:
|
|
127
|
+
assetId: o.id,
|
|
128
|
+
type: o.type,
|
|
129
|
+
startTime: u,
|
|
130
|
+
duration: o.duration || 5,
|
|
131
131
|
offset: 0,
|
|
132
132
|
properties: {
|
|
133
133
|
x: 0,
|
|
@@ -139,47 +139,47 @@ const fe = {
|
|
|
139
139
|
effects: [],
|
|
140
140
|
transitions: []
|
|
141
141
|
};
|
|
142
|
-
|
|
143
|
-
tracks:
|
|
144
|
-
(
|
|
142
|
+
f({
|
|
143
|
+
tracks: r.tracks.map(
|
|
144
|
+
(p) => p.id === a ? { ...p, items: [...p.items, h] } : p
|
|
145
145
|
)
|
|
146
146
|
});
|
|
147
|
-
},
|
|
148
|
-
const
|
|
147
|
+
}, Z = (a, o, n) => {
|
|
148
|
+
const d = {
|
|
149
149
|
id: $(),
|
|
150
|
-
type:
|
|
151
|
-
name:
|
|
152
|
-
parameters:
|
|
150
|
+
type: n,
|
|
151
|
+
name: n.charAt(0).toUpperCase() + n.slice(1),
|
|
152
|
+
parameters: ne(n)
|
|
153
153
|
};
|
|
154
|
-
|
|
155
|
-
tracks:
|
|
156
|
-
(
|
|
157
|
-
...
|
|
158
|
-
items:
|
|
159
|
-
(
|
|
154
|
+
f({
|
|
155
|
+
tracks: r.tracks.map(
|
|
156
|
+
(u) => u.id === a ? {
|
|
157
|
+
...u,
|
|
158
|
+
items: u.items.map(
|
|
159
|
+
(h) => h.id === o ? { ...h, effects: [...h.effects, d] } : h
|
|
160
160
|
)
|
|
161
|
-
} :
|
|
161
|
+
} : u
|
|
162
162
|
)
|
|
163
163
|
});
|
|
164
|
-
},
|
|
165
|
-
const
|
|
164
|
+
}, P = (a, o, n, d) => {
|
|
165
|
+
const u = {
|
|
166
166
|
id: $(),
|
|
167
|
-
type:
|
|
167
|
+
type: n,
|
|
168
168
|
duration: 0.5,
|
|
169
|
-
position:
|
|
169
|
+
position: d
|
|
170
170
|
};
|
|
171
|
-
|
|
172
|
-
tracks:
|
|
173
|
-
(
|
|
174
|
-
...
|
|
175
|
-
items:
|
|
176
|
-
(
|
|
171
|
+
f({
|
|
172
|
+
tracks: r.tracks.map(
|
|
173
|
+
(h) => h.id === a ? {
|
|
174
|
+
...h,
|
|
175
|
+
items: h.items.map(
|
|
176
|
+
(p) => p.id === o ? { ...p, transitions: [...p.transitions, u] } : p
|
|
177
177
|
)
|
|
178
|
-
} :
|
|
178
|
+
} : h
|
|
179
179
|
)
|
|
180
180
|
});
|
|
181
|
-
},
|
|
182
|
-
switch (
|
|
181
|
+
}, ne = (a) => {
|
|
182
|
+
switch (a) {
|
|
183
183
|
case "blur":
|
|
184
184
|
return { radius: 5 };
|
|
185
185
|
case "brightness":
|
|
@@ -201,104 +201,104 @@ const fe = {
|
|
|
201
201
|
default:
|
|
202
202
|
return {};
|
|
203
203
|
}
|
|
204
|
-
},
|
|
205
|
-
|
|
206
|
-
w((
|
|
207
|
-
const
|
|
208
|
-
...
|
|
204
|
+
}, ae = () => {
|
|
205
|
+
B ? (x.current && clearInterval(x.current), K(!1)) : (x.current = setInterval(() => {
|
|
206
|
+
w((a) => {
|
|
207
|
+
const o = Math.max(
|
|
208
|
+
...r.tracks.flatMap((n) => n.items.map((d) => d.startTime + d.duration)),
|
|
209
209
|
0
|
|
210
210
|
);
|
|
211
|
-
return
|
|
211
|
+
return a >= o ? (clearInterval(x.current), K(!1), 0) : a + 1 / r.frameRate;
|
|
212
212
|
});
|
|
213
|
-
}, 1e3 /
|
|
214
|
-
},
|
|
215
|
-
w(Math.max(0,
|
|
216
|
-
},
|
|
217
|
-
if (
|
|
218
|
-
|
|
213
|
+
}, 1e3 / r.frameRate), K(!0));
|
|
214
|
+
}, J = (a) => {
|
|
215
|
+
w(Math.max(0, a));
|
|
216
|
+
}, Q = async () => {
|
|
217
|
+
if (F) {
|
|
218
|
+
U(0);
|
|
219
219
|
try {
|
|
220
|
-
const
|
|
221
|
-
|
|
220
|
+
const a = setInterval(() => {
|
|
221
|
+
U((o) => o !== null && o < 90 ? o + Math.random() * 10 : o);
|
|
222
222
|
}, 500);
|
|
223
|
-
await
|
|
224
|
-
} catch (
|
|
225
|
-
|
|
223
|
+
await F(r, r.settings.video.codec), clearInterval(a), U(100), setTimeout(() => U(null), 2e3);
|
|
224
|
+
} catch (a) {
|
|
225
|
+
U(null), console.error("Export failed:", a);
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
|
-
},
|
|
229
|
-
const
|
|
230
|
-
return `${
|
|
231
|
-
},
|
|
232
|
-
for (const
|
|
233
|
-
const
|
|
234
|
-
if (
|
|
235
|
-
return { track:
|
|
228
|
+
}, ee = (a) => {
|
|
229
|
+
const o = Math.floor(a / 60), n = Math.floor(a % 60), d = Math.floor(a % 1 * r.frameRate);
|
|
230
|
+
return `${o.toString().padStart(2, "0")}:${n.toString().padStart(2, "0")}:${d.toString().padStart(2, "0")}`;
|
|
231
|
+
}, j = () => {
|
|
232
|
+
for (const a of r.tracks) {
|
|
233
|
+
const o = a.items.find((n) => n.id === k);
|
|
234
|
+
if (o)
|
|
235
|
+
return { track: a, item: o };
|
|
236
236
|
}
|
|
237
237
|
return null;
|
|
238
|
-
},
|
|
239
|
-
/* @__PURE__ */ t("div", { className: "
|
|
238
|
+
}, se = /* @__PURE__ */ t("header", { className: "nice-video-studio__header", children: [
|
|
239
|
+
/* @__PURE__ */ t("div", { className: "nice-video-studio__header-project-info", children: [
|
|
240
240
|
/* @__PURE__ */ e(
|
|
241
241
|
"input",
|
|
242
242
|
{
|
|
243
243
|
type: "text",
|
|
244
|
-
value:
|
|
245
|
-
onChange: (
|
|
246
|
-
className: "
|
|
244
|
+
value: r.name,
|
|
245
|
+
onChange: (a) => f({ name: a.target.value }),
|
|
246
|
+
className: "nice-video-studio__project-name-input"
|
|
247
247
|
}
|
|
248
248
|
),
|
|
249
|
-
/* @__PURE__ */ t("span", { className: "
|
|
250
|
-
|
|
249
|
+
/* @__PURE__ */ t("span", { className: "nice-video-studio__project-settings", children: [
|
|
250
|
+
r.resolution.width,
|
|
251
251
|
"x",
|
|
252
|
-
|
|
252
|
+
r.resolution.height,
|
|
253
253
|
" • ",
|
|
254
|
-
|
|
254
|
+
r.frameRate,
|
|
255
255
|
"fps"
|
|
256
256
|
] })
|
|
257
257
|
] }),
|
|
258
|
-
/* @__PURE__ */ e("div", { className: "
|
|
258
|
+
/* @__PURE__ */ e("div", { className: "nice-video-studio__header-tabs", children: ["timeline", "effects", "transitions", "export"].map((a) => /* @__PURE__ */ e(
|
|
259
259
|
"button",
|
|
260
260
|
{
|
|
261
|
-
className: `
|
|
262
|
-
onClick: () =>
|
|
263
|
-
children:
|
|
261
|
+
className: `nice-video-studio__tab-button ${A === a ? "nice-video-studio__tab-button--active" : ""}`,
|
|
262
|
+
onClick: () => y(a),
|
|
263
|
+
children: a.charAt(0).toUpperCase() + a.slice(1)
|
|
264
264
|
},
|
|
265
|
-
|
|
265
|
+
a
|
|
266
266
|
)) }),
|
|
267
|
-
/* @__PURE__ */ e("div", { className: "
|
|
267
|
+
/* @__PURE__ */ e("div", { className: "nice-video-studio__header-actions", children: /* @__PURE__ */ e(
|
|
268
268
|
"button",
|
|
269
269
|
{
|
|
270
|
-
className: "
|
|
271
|
-
onClick:
|
|
272
|
-
disabled:
|
|
273
|
-
children:
|
|
270
|
+
className: "nice-video-studio__action-button nice-video-studio__action-button--primary",
|
|
271
|
+
onClick: Q,
|
|
272
|
+
disabled: T !== null,
|
|
273
|
+
children: T !== null ? `Exporting ${Math.round(T)}%` : "Export"
|
|
274
274
|
}
|
|
275
275
|
) })
|
|
276
|
-
] }),
|
|
277
|
-
const
|
|
278
|
-
if (!
|
|
276
|
+
] }), re = k && A !== "export" ? (() => {
|
|
277
|
+
const a = j();
|
|
278
|
+
if (!a)
|
|
279
279
|
return null;
|
|
280
|
-
const { track:
|
|
281
|
-
return /* @__PURE__ */ t("div", { className: "
|
|
282
|
-
/* @__PURE__ */ e("h4", { children: "Item Properties" }),
|
|
283
|
-
/* @__PURE__ */ t("div", { className: "
|
|
280
|
+
const { track: o, item: n } = a;
|
|
281
|
+
return /* @__PURE__ */ t("div", { className: "nice-video-studio__item-inspector", children: [
|
|
282
|
+
/* @__PURE__ */ e("h4", { children: b("videoEditor.itemProperties", "Item Properties") }),
|
|
283
|
+
/* @__PURE__ */ t("div", { className: "nice-video-studio__inspector-section", children: [
|
|
284
284
|
/* @__PURE__ */ t("label", { children: [
|
|
285
|
-
"Start Time",
|
|
285
|
+
b("videoEditor.startTime", "Start Time"),
|
|
286
286
|
/* @__PURE__ */ e(
|
|
287
287
|
"input",
|
|
288
288
|
{
|
|
289
289
|
type: "number",
|
|
290
290
|
step: "0.1",
|
|
291
|
-
value:
|
|
292
|
-
onChange: (
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
tracks:
|
|
296
|
-
(
|
|
297
|
-
...
|
|
298
|
-
items:
|
|
299
|
-
(
|
|
291
|
+
value: n.startTime,
|
|
292
|
+
onChange: (d) => {
|
|
293
|
+
const u = parseFloat(d.target.value);
|
|
294
|
+
f({
|
|
295
|
+
tracks: r.tracks.map(
|
|
296
|
+
(h) => h.id === o.id ? {
|
|
297
|
+
...h,
|
|
298
|
+
items: h.items.map(
|
|
299
|
+
(p) => p.id === n.id ? { ...p, startTime: u } : p
|
|
300
300
|
)
|
|
301
|
-
} :
|
|
301
|
+
} : h
|
|
302
302
|
)
|
|
303
303
|
});
|
|
304
304
|
}
|
|
@@ -306,23 +306,23 @@ const fe = {
|
|
|
306
306
|
)
|
|
307
307
|
] }),
|
|
308
308
|
/* @__PURE__ */ t("label", { children: [
|
|
309
|
-
"Duration",
|
|
309
|
+
b("videoEditor.duration", "Duration"),
|
|
310
310
|
/* @__PURE__ */ e(
|
|
311
311
|
"input",
|
|
312
312
|
{
|
|
313
313
|
type: "number",
|
|
314
314
|
step: "0.1",
|
|
315
|
-
value:
|
|
316
|
-
onChange: (
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
tracks:
|
|
320
|
-
(
|
|
321
|
-
...
|
|
322
|
-
items:
|
|
323
|
-
(
|
|
315
|
+
value: n.duration,
|
|
316
|
+
onChange: (d) => {
|
|
317
|
+
const u = parseFloat(d.target.value);
|
|
318
|
+
f({
|
|
319
|
+
tracks: r.tracks.map(
|
|
320
|
+
(h) => h.id === o.id ? {
|
|
321
|
+
...h,
|
|
322
|
+
items: h.items.map(
|
|
323
|
+
(p) => p.id === n.id ? { ...p, duration: u } : p
|
|
324
324
|
)
|
|
325
|
-
} :
|
|
325
|
+
} : h
|
|
326
326
|
)
|
|
327
327
|
});
|
|
328
328
|
}
|
|
@@ -330,7 +330,7 @@ const fe = {
|
|
|
330
330
|
)
|
|
331
331
|
] }),
|
|
332
332
|
/* @__PURE__ */ t("label", { children: [
|
|
333
|
-
"Opacity",
|
|
333
|
+
b("videoEditor.opacity", "Opacity"),
|
|
334
334
|
/* @__PURE__ */ e(
|
|
335
335
|
"input",
|
|
336
336
|
{
|
|
@@ -338,20 +338,20 @@ const fe = {
|
|
|
338
338
|
min: "0",
|
|
339
339
|
max: "1",
|
|
340
340
|
step: "0.1",
|
|
341
|
-
value:
|
|
342
|
-
onChange: (
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
tracks:
|
|
346
|
-
(
|
|
347
|
-
...
|
|
348
|
-
items:
|
|
349
|
-
(
|
|
350
|
-
...
|
|
351
|
-
properties: { ...
|
|
352
|
-
} :
|
|
341
|
+
value: n.properties.opacity ?? 1,
|
|
342
|
+
onChange: (d) => {
|
|
343
|
+
const u = parseFloat(d.target.value);
|
|
344
|
+
f({
|
|
345
|
+
tracks: r.tracks.map(
|
|
346
|
+
(h) => h.id === o.id ? {
|
|
347
|
+
...h,
|
|
348
|
+
items: h.items.map(
|
|
349
|
+
(p) => p.id === n.id ? {
|
|
350
|
+
...p,
|
|
351
|
+
properties: { ...p.properties, opacity: u }
|
|
352
|
+
} : p
|
|
353
353
|
)
|
|
354
|
-
} :
|
|
354
|
+
} : h
|
|
355
355
|
)
|
|
356
356
|
});
|
|
357
357
|
}
|
|
@@ -361,240 +361,261 @@ const fe = {
|
|
|
361
361
|
] }),
|
|
362
362
|
/* @__PURE__ */ t("h4", { children: [
|
|
363
363
|
"Effects (",
|
|
364
|
-
|
|
364
|
+
n.effects.length,
|
|
365
365
|
")"
|
|
366
366
|
] }),
|
|
367
|
-
/* @__PURE__ */ e("div", { className: "
|
|
367
|
+
/* @__PURE__ */ e("div", { className: "nice-video-studio__effects-list", children: n.effects.map((d) => /* @__PURE__ */ e("div", { className: "nice-video-studio__effect-badge", children: d.name }, d.id)) })
|
|
368
368
|
] });
|
|
369
|
-
})() : null,
|
|
370
|
-
/* @__PURE__ */ t("div", { className: "
|
|
371
|
-
/* @__PURE__ */ e("h3", { children: "Assets" }),
|
|
369
|
+
})() : null, i = W ? /* @__PURE__ */ t("aside", { className: "nice-video-studio__asset-library", children: [
|
|
370
|
+
/* @__PURE__ */ t("div", { className: "nice-video-studio__asset-library-header", children: [
|
|
371
|
+
/* @__PURE__ */ e("h3", { children: b("videoEditor.assets", "Assets") }),
|
|
372
372
|
/* @__PURE__ */ e(
|
|
373
373
|
"button",
|
|
374
374
|
{
|
|
375
|
-
"aria-label": "Close",
|
|
376
|
-
className: "
|
|
377
|
-
onClick: () =>
|
|
378
|
-
children: /* @__PURE__ */ e(
|
|
375
|
+
"aria-label": b("videoEditor.close", "Close"),
|
|
376
|
+
className: "nice-video-studio__close-button",
|
|
377
|
+
onClick: () => z(!1),
|
|
378
|
+
children: /* @__PURE__ */ e(m, { name: "close", size: 16 })
|
|
379
379
|
}
|
|
380
380
|
)
|
|
381
381
|
] }),
|
|
382
|
-
/* @__PURE__ */ e("div", { className: "
|
|
382
|
+
/* @__PURE__ */ e("div", { className: "nice-video-studio__asset-library-upload", children: /* @__PURE__ */ t("label", { className: "nice-video-studio__upload-zone", children: [
|
|
383
383
|
/* @__PURE__ */ e(
|
|
384
384
|
"input",
|
|
385
385
|
{
|
|
386
386
|
type: "file",
|
|
387
387
|
multiple: !0,
|
|
388
388
|
accept: "video/*,audio/*,image/*",
|
|
389
|
-
onChange: (
|
|
389
|
+
onChange: (a) => a.target.files && _(a.target.files),
|
|
390
390
|
hidden: !0
|
|
391
391
|
}
|
|
392
392
|
),
|
|
393
|
-
/* @__PURE__ */ e("span", { className: "
|
|
394
|
-
/* @__PURE__ */ e("span", { children: "Drop files or click to upload" })
|
|
393
|
+
/* @__PURE__ */ e("span", { className: "nice-video-studio__upload-icon", children: "+" }),
|
|
394
|
+
/* @__PURE__ */ e("span", { children: b("videoEditor.dropFilesOrClickTo", "Drop files or click to upload") })
|
|
395
395
|
] }) }),
|
|
396
|
-
/* @__PURE__ */ e("div", { className: "
|
|
396
|
+
/* @__PURE__ */ e("div", { className: "nice-video-studio__asset-library-list", children: r.assets.map((a) => /* @__PURE__ */ t(
|
|
397
397
|
"div",
|
|
398
398
|
{
|
|
399
|
-
className: "
|
|
399
|
+
className: "nice-video-studio__asset-item",
|
|
400
400
|
draggable: !0,
|
|
401
|
-
onDragStart: (
|
|
401
|
+
onDragStart: (o) => o.dataTransfer.setData("assetId", a.id),
|
|
402
402
|
children: [
|
|
403
|
-
/* @__PURE__ */ e("div", { className: "
|
|
404
|
-
|
|
403
|
+
/* @__PURE__ */ e("div", { className: "nice-video-studio__asset-thumbnail", children: a.thumbnail ? /* @__PURE__ */ e("img", { src: a.thumbnail, alt: a.name }) : /* @__PURE__ */ e("span", { className: "nice-video-studio__asset-type-icon", children: /* @__PURE__ */ e(
|
|
404
|
+
m,
|
|
405
405
|
{
|
|
406
|
-
name:
|
|
406
|
+
name: a.type === "video" ? "video" : a.type === "audio" ? "music" : "image",
|
|
407
407
|
size: 24
|
|
408
408
|
}
|
|
409
409
|
) }) }),
|
|
410
|
-
/* @__PURE__ */ t("div", { className: "
|
|
411
|
-
/* @__PURE__ */ e("span", { className: "
|
|
412
|
-
/* @__PURE__ */ t("span", { className: "
|
|
413
|
-
(
|
|
410
|
+
/* @__PURE__ */ t("div", { className: "nice-video-studio__asset-info", children: [
|
|
411
|
+
/* @__PURE__ */ e("span", { className: "nice-video-studio__asset-name", children: a.name }),
|
|
412
|
+
/* @__PURE__ */ t("span", { className: "nice-video-studio__asset-meta", children: [
|
|
413
|
+
(a.size / 1024 / 1024).toFixed(1),
|
|
414
414
|
"MB"
|
|
415
415
|
] })
|
|
416
416
|
] })
|
|
417
417
|
]
|
|
418
418
|
},
|
|
419
|
-
|
|
419
|
+
a.id
|
|
420
420
|
)) })
|
|
421
|
-
] }) : void 0,
|
|
421
|
+
] }) : void 0, c = /* @__PURE__ */ e("div", { className: "nice-video-studio__preview-area", children: /* @__PURE__ */ t("div", { className: "nice-video-studio__preview-container", children: [
|
|
422
422
|
/* @__PURE__ */ t(
|
|
423
423
|
"div",
|
|
424
424
|
{
|
|
425
|
-
className: "
|
|
426
|
-
style: { aspectRatio: `${
|
|
425
|
+
className: "nice-video-studio__preview-canvas",
|
|
426
|
+
style: { aspectRatio: `${r.resolution.width}/${r.resolution.height}` },
|
|
427
427
|
children: [
|
|
428
|
-
/* @__PURE__ */ e("video", { ref:
|
|
429
|
-
/* @__PURE__ */ e("div", { className: "
|
|
428
|
+
/* @__PURE__ */ e("video", { ref: te, className: "nice-video-studio__preview-video" }),
|
|
429
|
+
/* @__PURE__ */ e("div", { className: "nice-video-studio__preview-overlay", children: !W && /* @__PURE__ */ e(
|
|
430
430
|
"button",
|
|
431
431
|
{
|
|
432
|
-
className: "
|
|
433
|
-
onClick: () =>
|
|
434
|
-
"aria-label": "Show asset library",
|
|
435
|
-
children: /* @__PURE__ */ e(
|
|
432
|
+
className: "nice-video-studio__toggle-library-button",
|
|
433
|
+
onClick: () => z(!0),
|
|
434
|
+
"aria-label": b("videoEditor.showAssetLibrary", "Show asset library"),
|
|
435
|
+
children: /* @__PURE__ */ e(m, { name: "folder", size: 16 })
|
|
436
436
|
}
|
|
437
437
|
) })
|
|
438
438
|
]
|
|
439
439
|
}
|
|
440
440
|
),
|
|
441
|
-
/* @__PURE__ */ t("div", { className: "
|
|
442
|
-
/* @__PURE__ */ e(
|
|
441
|
+
/* @__PURE__ */ t("div", { className: "nice-video-studio__playback-controls", children: [
|
|
442
|
+
/* @__PURE__ */ e(
|
|
443
|
+
"button",
|
|
444
|
+
{
|
|
445
|
+
onClick: () => J(0),
|
|
446
|
+
"aria-label": b("videoEditor.goToStart", "Go to start"),
|
|
447
|
+
children: /* @__PURE__ */ e(m, { name: "skip-back", size: 16 })
|
|
448
|
+
}
|
|
449
|
+
),
|
|
443
450
|
/* @__PURE__ */ e(
|
|
444
451
|
"button",
|
|
445
452
|
{
|
|
446
|
-
onClick: () =>
|
|
447
|
-
"aria-label": "Previous frame",
|
|
448
|
-
children: /* @__PURE__ */ e(
|
|
453
|
+
onClick: () => J(D - 1 / r.frameRate),
|
|
454
|
+
"aria-label": b("videoEditor.previousFrame", "Previous frame"),
|
|
455
|
+
children: /* @__PURE__ */ e(m, { name: "chevron-left", size: 16 })
|
|
449
456
|
}
|
|
450
457
|
),
|
|
451
458
|
/* @__PURE__ */ e(
|
|
452
459
|
"button",
|
|
453
460
|
{
|
|
454
|
-
onClick:
|
|
455
|
-
className: "
|
|
456
|
-
"aria-label":
|
|
457
|
-
children: /* @__PURE__ */ e(
|
|
461
|
+
onClick: ae,
|
|
462
|
+
className: "nice-video-studio__play-button",
|
|
463
|
+
"aria-label": B ? "Pause" : "Play",
|
|
464
|
+
children: /* @__PURE__ */ e(m, { name: B ? "pause" : "play", size: 18 })
|
|
458
465
|
}
|
|
459
466
|
),
|
|
460
467
|
/* @__PURE__ */ e(
|
|
461
468
|
"button",
|
|
462
469
|
{
|
|
463
|
-
onClick: () =>
|
|
464
|
-
"aria-label": "Next frame",
|
|
465
|
-
children: /* @__PURE__ */ e(
|
|
470
|
+
onClick: () => J(D + 1 / r.frameRate),
|
|
471
|
+
"aria-label": b("videoEditor.nextFrame", "Next frame"),
|
|
472
|
+
children: /* @__PURE__ */ e(m, { name: "chevron-right", size: 16 })
|
|
466
473
|
}
|
|
467
474
|
),
|
|
468
|
-
/* @__PURE__ */ e("span", { className: "
|
|
475
|
+
/* @__PURE__ */ e("span", { className: "nice-video-studio__time-display", children: ee(D) })
|
|
469
476
|
] })
|
|
470
|
-
] }) }),
|
|
471
|
-
A === "timeline" && /* @__PURE__ */ t("div", { className: "
|
|
472
|
-
/* @__PURE__ */ t("div", { className: "
|
|
473
|
-
/* @__PURE__ */ t("div", { className: "
|
|
474
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
475
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
476
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
477
|
+
] }) }), l = /* @__PURE__ */ t("div", { className: "nice-video-studio__panel", children: [
|
|
478
|
+
A === "timeline" && /* @__PURE__ */ t("div", { className: "nice-video-studio__timeline-panel", children: [
|
|
479
|
+
/* @__PURE__ */ t("div", { className: "nice-video-studio__timeline-toolbar", children: [
|
|
480
|
+
/* @__PURE__ */ t("div", { className: "nice-video-studio__track-buttons", children: [
|
|
481
|
+
/* @__PURE__ */ e("button", { onClick: () => V("video"), children: "+ Video Track" }),
|
|
482
|
+
/* @__PURE__ */ e("button", { onClick: () => V("audio"), children: "+ Audio Track" }),
|
|
483
|
+
/* @__PURE__ */ e("button", { onClick: () => V("text"), children: "+ Text Track" })
|
|
477
484
|
] }),
|
|
478
|
-
/* @__PURE__ */ t("div", { className: "
|
|
479
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
485
|
+
/* @__PURE__ */ t("div", { className: "nice-video-studio__zoom-controls", children: [
|
|
486
|
+
/* @__PURE__ */ e("button", { onClick: () => G(Math.max(0.25, C - 0.25)), children: "-" }),
|
|
480
487
|
/* @__PURE__ */ t("span", { children: [
|
|
481
488
|
Math.round(C * 100),
|
|
482
489
|
"%"
|
|
483
490
|
] }),
|
|
484
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
491
|
+
/* @__PURE__ */ e("button", { onClick: () => G(Math.min(4, C + 0.25)), children: "+" })
|
|
485
492
|
] })
|
|
486
493
|
] }),
|
|
487
|
-
/* @__PURE__ */ t("div", { className: "
|
|
488
|
-
/* @__PURE__ */ e("div", { className: "
|
|
489
|
-
|
|
490
|
-
|
|
494
|
+
/* @__PURE__ */ t("div", { className: "nice-video-studio__timeline-container", ref: ie, children: [
|
|
495
|
+
/* @__PURE__ */ e("div", { className: "nice-video-studio__timeline-ruler", children: Array.from({ length: Math.ceil(30 / C) }).map((a, o) => /* @__PURE__ */ e(
|
|
496
|
+
"div",
|
|
497
|
+
{
|
|
498
|
+
className: "nice-video-studio__ruler-mark",
|
|
499
|
+
style: { left: `${o * 50 * C}px` },
|
|
500
|
+
children: ee(o)
|
|
501
|
+
},
|
|
502
|
+
o
|
|
503
|
+
)) }),
|
|
504
|
+
/* @__PURE__ */ e(
|
|
505
|
+
"div",
|
|
506
|
+
{
|
|
507
|
+
className: "nice-video-studio__timeline-playhead",
|
|
508
|
+
style: { left: `${D * 50 * C}px` }
|
|
509
|
+
}
|
|
510
|
+
),
|
|
511
|
+
/* @__PURE__ */ e("div", { className: "nice-video-studio__timeline-tracks", children: r.tracks.map((a) => /* @__PURE__ */ t(
|
|
491
512
|
"div",
|
|
492
513
|
{
|
|
493
|
-
className: `
|
|
494
|
-
onClick: () =>
|
|
495
|
-
onDrop: (
|
|
496
|
-
|
|
497
|
-
const
|
|
498
|
-
|
|
514
|
+
className: `nice-video-studio__timeline-track ${H === a.id ? "nice-video-studio__timeline-track--selected" : ""} ${a.locked ? "nice-video-studio__timeline-track--locked" : ""}`,
|
|
515
|
+
onClick: () => v(a.id),
|
|
516
|
+
onDrop: (o) => {
|
|
517
|
+
o.preventDefault();
|
|
518
|
+
const n = o.dataTransfer.getData("assetId"), d = r.assets.find((u) => u.id === n);
|
|
519
|
+
d && S(a.id, d);
|
|
499
520
|
},
|
|
500
|
-
onDragOver: (
|
|
521
|
+
onDragOver: (o) => o.preventDefault(),
|
|
501
522
|
children: [
|
|
502
|
-
/* @__PURE__ */ t("div", { className: "
|
|
503
|
-
/* @__PURE__ */ e("span", { className: "
|
|
504
|
-
/* @__PURE__ */ t("div", { className: "
|
|
523
|
+
/* @__PURE__ */ t("div", { className: "nice-video-studio__track-header", children: [
|
|
524
|
+
/* @__PURE__ */ e("span", { className: "nice-video-studio__track-name", children: a.name }),
|
|
525
|
+
/* @__PURE__ */ t("div", { className: "nice-video-studio__track-controls", children: [
|
|
505
526
|
/* @__PURE__ */ e(
|
|
506
527
|
"button",
|
|
507
528
|
{
|
|
508
|
-
className:
|
|
509
|
-
onClick: (
|
|
510
|
-
|
|
529
|
+
className: `nice-video-studio__track-toggle ${a.muted ? "nice-video-studio__track-toggle--active" : ""}`,
|
|
530
|
+
onClick: (o) => {
|
|
531
|
+
o.stopPropagation(), q(a.id);
|
|
511
532
|
},
|
|
512
|
-
children: /* @__PURE__ */ e(
|
|
533
|
+
children: /* @__PURE__ */ e(m, { name: a.muted ? "volume-off" : "volume", size: 14 })
|
|
513
534
|
}
|
|
514
535
|
),
|
|
515
536
|
/* @__PURE__ */ e(
|
|
516
537
|
"button",
|
|
517
538
|
{
|
|
518
|
-
className:
|
|
519
|
-
onClick: (
|
|
520
|
-
|
|
539
|
+
className: `nice-video-studio__track-toggle ${a.locked ? "nice-video-studio__track-toggle--active" : ""}`,
|
|
540
|
+
onClick: (o) => {
|
|
541
|
+
o.stopPropagation(), X(a.id);
|
|
521
542
|
},
|
|
522
|
-
children: /* @__PURE__ */ e(
|
|
543
|
+
children: /* @__PURE__ */ e(m, { name: a.locked ? "lock" : "unlock", size: 14 })
|
|
523
544
|
}
|
|
524
545
|
),
|
|
525
546
|
/* @__PURE__ */ e(
|
|
526
547
|
"button",
|
|
527
548
|
{
|
|
528
|
-
onClick: (
|
|
529
|
-
|
|
549
|
+
onClick: (o) => {
|
|
550
|
+
o.stopPropagation(), Y(a.id);
|
|
530
551
|
},
|
|
531
|
-
"aria-label": "Remove track",
|
|
532
|
-
children: /* @__PURE__ */ e(
|
|
552
|
+
"aria-label": b("videoEditor.removeTrack", "Remove track"),
|
|
553
|
+
children: /* @__PURE__ */ e(m, { name: "trash", size: 14 })
|
|
533
554
|
}
|
|
534
555
|
)
|
|
535
556
|
] })
|
|
536
557
|
] }),
|
|
537
|
-
/* @__PURE__ */ e("div", { className: "
|
|
538
|
-
const
|
|
558
|
+
/* @__PURE__ */ e("div", { className: "nice-video-studio__track-items", children: a.items.map((o) => {
|
|
559
|
+
const n = r.assets.find((d) => d.id === o.assetId);
|
|
539
560
|
return /* @__PURE__ */ t(
|
|
540
561
|
"div",
|
|
541
562
|
{
|
|
542
|
-
className: `
|
|
563
|
+
className: `nice-video-studio__track-item nice-video-studio__track-item--${o.type} ${k === o.id ? "nice-video-studio__track-item--selected" : ""}`,
|
|
543
564
|
style: {
|
|
544
|
-
left: `${
|
|
545
|
-
width: `${
|
|
565
|
+
left: `${o.startTime * 50 * C}px`,
|
|
566
|
+
width: `${o.duration * 50 * C}px`
|
|
546
567
|
},
|
|
547
|
-
onClick: (
|
|
548
|
-
|
|
568
|
+
onClick: (d) => {
|
|
569
|
+
d.stopPropagation(), N(o.id);
|
|
549
570
|
},
|
|
550
571
|
children: [
|
|
551
|
-
/* @__PURE__ */ e("span", { className: "
|
|
552
|
-
|
|
553
|
-
|
|
572
|
+
/* @__PURE__ */ e("span", { className: "nice-video-studio__item-name", children: (n == null ? void 0 : n.name) || "Untitled" }),
|
|
573
|
+
o.transitions.length > 0 && /* @__PURE__ */ e("span", { className: "nice-video-studio__item-transitions", children: /* @__PURE__ */ e(m, { name: "wand", size: 12 }) }),
|
|
574
|
+
o.effects.length > 0 && /* @__PURE__ */ e("span", { className: "nice-video-studio__item-effects", children: /* @__PURE__ */ e(m, { name: "palette", size: 12 }) })
|
|
554
575
|
]
|
|
555
576
|
},
|
|
556
|
-
|
|
577
|
+
o.id
|
|
557
578
|
);
|
|
558
579
|
}) })
|
|
559
580
|
]
|
|
560
581
|
},
|
|
561
|
-
|
|
582
|
+
a.id
|
|
562
583
|
)) })
|
|
563
584
|
] })
|
|
564
585
|
] }),
|
|
565
|
-
A === "effects" && /* @__PURE__ */ t("div", { className: "
|
|
566
|
-
/* @__PURE__ */ e("h3", { children: "Video Effects" }),
|
|
567
|
-
/* @__PURE__ */ e("p", { className: "
|
|
568
|
-
/* @__PURE__ */ e("div", { className: "
|
|
586
|
+
A === "effects" && /* @__PURE__ */ t("div", { className: "nice-video-studio__effects-panel", children: [
|
|
587
|
+
/* @__PURE__ */ e("h3", { children: b("videoEditor.videoEffects", "Video Effects") }),
|
|
588
|
+
/* @__PURE__ */ e("p", { className: "nice-video-studio__panel-hint", children: b("videoEditor.selectAClipToApply", "Select a clip to apply effects") }),
|
|
589
|
+
/* @__PURE__ */ e("div", { className: "nice-video-studio__effects-grid", children: be.map((a) => /* @__PURE__ */ t(
|
|
569
590
|
"button",
|
|
570
591
|
{
|
|
571
|
-
className: "
|
|
592
|
+
className: "nice-video-studio__effect-preset",
|
|
572
593
|
disabled: !k,
|
|
573
594
|
onClick: () => {
|
|
574
|
-
const
|
|
575
|
-
|
|
595
|
+
const o = j();
|
|
596
|
+
o && Z(o.track.id, o.item.id, a.type);
|
|
576
597
|
},
|
|
577
598
|
children: [
|
|
578
|
-
/* @__PURE__ */ e("span", { className: "
|
|
579
|
-
/* @__PURE__ */ e("span", { className: "
|
|
599
|
+
/* @__PURE__ */ e("span", { className: "nice-video-studio__effect-icon", children: /* @__PURE__ */ e(m, { name: a.icon, size: 16 }) }),
|
|
600
|
+
/* @__PURE__ */ e("span", { className: "nice-video-studio__effect-name", children: a.name })
|
|
580
601
|
]
|
|
581
602
|
},
|
|
582
|
-
|
|
603
|
+
a.type
|
|
583
604
|
)) })
|
|
584
605
|
] }),
|
|
585
|
-
A === "transitions" && /* @__PURE__ */ t("div", { className: "
|
|
586
|
-
/* @__PURE__ */ e("h3", { children: "Transitions" }),
|
|
587
|
-
/* @__PURE__ */ e("p", { className: "
|
|
588
|
-
/* @__PURE__ */ e("div", { className: "
|
|
589
|
-
/* @__PURE__ */ e("span", { className: "
|
|
590
|
-
/* @__PURE__ */ t("div", { className: "
|
|
606
|
+
A === "transitions" && /* @__PURE__ */ t("div", { className: "nice-video-studio__transitions-panel", children: [
|
|
607
|
+
/* @__PURE__ */ e("h3", { children: b("videoEditor.transitions", "Transitions") }),
|
|
608
|
+
/* @__PURE__ */ e("p", { className: "nice-video-studio__panel-hint", children: b("videoEditor.selectAClipAndAdd", "Select a clip and add transitions between clips") }),
|
|
609
|
+
/* @__PURE__ */ e("div", { className: "nice-video-studio__transitions-grid", children: ye.map((a) => /* @__PURE__ */ t("div", { className: "nice-video-studio__transition-preset", children: [
|
|
610
|
+
/* @__PURE__ */ e("span", { className: "nice-video-studio__transition-name", children: a.name }),
|
|
611
|
+
/* @__PURE__ */ t("div", { className: "nice-video-studio__transition-buttons", children: [
|
|
591
612
|
/* @__PURE__ */ e(
|
|
592
613
|
"button",
|
|
593
614
|
{
|
|
594
615
|
disabled: !k,
|
|
595
616
|
onClick: () => {
|
|
596
|
-
const
|
|
597
|
-
|
|
617
|
+
const o = j();
|
|
618
|
+
o && P(o.track.id, o.item.id, a.type, "start");
|
|
598
619
|
},
|
|
599
620
|
children: "In"
|
|
600
621
|
}
|
|
@@ -604,27 +625,27 @@ const fe = {
|
|
|
604
625
|
{
|
|
605
626
|
disabled: !k,
|
|
606
627
|
onClick: () => {
|
|
607
|
-
const
|
|
608
|
-
|
|
628
|
+
const o = j();
|
|
629
|
+
o && P(o.track.id, o.item.id, a.type, "end");
|
|
609
630
|
},
|
|
610
631
|
children: "Out"
|
|
611
632
|
}
|
|
612
633
|
)
|
|
613
634
|
] })
|
|
614
|
-
] },
|
|
635
|
+
] }, a.type)) })
|
|
615
636
|
] }),
|
|
616
|
-
A === "export" && /* @__PURE__ */ t("div", { className: "
|
|
617
|
-
/* @__PURE__ */ e("h3", { children: "Export Settings" }),
|
|
618
|
-
/* @__PURE__ */ t("div", { className: "
|
|
619
|
-
/* @__PURE__ */ t("div", { className: "
|
|
620
|
-
/* @__PURE__ */ e("label", { children: "Resolution" }),
|
|
637
|
+
A === "export" && /* @__PURE__ */ t("div", { className: "nice-video-studio__export-panel", children: [
|
|
638
|
+
/* @__PURE__ */ e("h3", { children: b("videoEditor.exportSettings", "Export Settings") }),
|
|
639
|
+
/* @__PURE__ */ t("div", { className: "nice-video-studio__export-settings", children: [
|
|
640
|
+
/* @__PURE__ */ t("div", { className: "nice-video-studio__setting-group", children: [
|
|
641
|
+
/* @__PURE__ */ e("label", { children: b("videoEditor.resolution", "Resolution") }),
|
|
621
642
|
/* @__PURE__ */ t(
|
|
622
643
|
"select",
|
|
623
644
|
{
|
|
624
|
-
value: `${
|
|
625
|
-
onChange: (
|
|
626
|
-
const [
|
|
627
|
-
|
|
645
|
+
value: `${r.resolution.width}x${r.resolution.height}`,
|
|
646
|
+
onChange: (a) => {
|
|
647
|
+
const [o, n] = a.target.value.split("x").map(Number);
|
|
648
|
+
f({ resolution: { width: o, height: n } });
|
|
628
649
|
},
|
|
629
650
|
children: [
|
|
630
651
|
/* @__PURE__ */ e("option", { value: "1920x1080", children: "1080p (1920x1080)" }),
|
|
@@ -635,13 +656,13 @@ const fe = {
|
|
|
635
656
|
}
|
|
636
657
|
)
|
|
637
658
|
] }),
|
|
638
|
-
/* @__PURE__ */ t("div", { className: "
|
|
639
|
-
/* @__PURE__ */ e("label", { children: "Frame Rate" }),
|
|
659
|
+
/* @__PURE__ */ t("div", { className: "nice-video-studio__setting-group", children: [
|
|
660
|
+
/* @__PURE__ */ e("label", { children: b("videoEditor.frameRate", "Frame Rate") }),
|
|
640
661
|
/* @__PURE__ */ t(
|
|
641
662
|
"select",
|
|
642
663
|
{
|
|
643
|
-
value:
|
|
644
|
-
onChange: (
|
|
664
|
+
value: r.frameRate,
|
|
665
|
+
onChange: (a) => f({ frameRate: parseInt(a.target.value) }),
|
|
645
666
|
children: [
|
|
646
667
|
/* @__PURE__ */ e("option", { value: "24", children: "24 fps" }),
|
|
647
668
|
/* @__PURE__ */ e("option", { value: "30", children: "30 fps" }),
|
|
@@ -651,18 +672,18 @@ const fe = {
|
|
|
651
672
|
}
|
|
652
673
|
)
|
|
653
674
|
] }),
|
|
654
|
-
/* @__PURE__ */ t("div", { className: "
|
|
655
|
-
/* @__PURE__ */ e("label", { children: "Video Codec" }),
|
|
675
|
+
/* @__PURE__ */ t("div", { className: "nice-video-studio__setting-group", children: [
|
|
676
|
+
/* @__PURE__ */ e("label", { children: b("videoEditor.videoCodec", "Video Codec") }),
|
|
656
677
|
/* @__PURE__ */ t(
|
|
657
678
|
"select",
|
|
658
679
|
{
|
|
659
|
-
value:
|
|
660
|
-
onChange: (
|
|
680
|
+
value: r.settings.video.codec,
|
|
681
|
+
onChange: (a) => f({
|
|
661
682
|
settings: {
|
|
662
|
-
...
|
|
683
|
+
...r.settings,
|
|
663
684
|
video: {
|
|
664
|
-
...
|
|
665
|
-
codec:
|
|
685
|
+
...r.settings.video,
|
|
686
|
+
codec: a.target.value
|
|
666
687
|
}
|
|
667
688
|
}
|
|
668
689
|
}),
|
|
@@ -675,19 +696,19 @@ const fe = {
|
|
|
675
696
|
}
|
|
676
697
|
)
|
|
677
698
|
] }),
|
|
678
|
-
/* @__PURE__ */ t("div", { className: "
|
|
699
|
+
/* @__PURE__ */ t("div", { className: "nice-video-studio__setting-group", children: [
|
|
679
700
|
/* @__PURE__ */ e("label", { children: "Video Bitrate (Mbps)" }),
|
|
680
701
|
/* @__PURE__ */ e(
|
|
681
702
|
"input",
|
|
682
703
|
{
|
|
683
704
|
type: "number",
|
|
684
|
-
value:
|
|
685
|
-
onChange: (
|
|
705
|
+
value: r.settings.video.bitrate / 1e3,
|
|
706
|
+
onChange: (a) => f({
|
|
686
707
|
settings: {
|
|
687
|
-
...
|
|
708
|
+
...r.settings,
|
|
688
709
|
video: {
|
|
689
|
-
...
|
|
690
|
-
bitrate: parseFloat(
|
|
710
|
+
...r.settings.video,
|
|
711
|
+
bitrate: parseFloat(a.target.value) * 1e3
|
|
691
712
|
}
|
|
692
713
|
}
|
|
693
714
|
}),
|
|
@@ -700,33 +721,39 @@ const fe = {
|
|
|
700
721
|
/* @__PURE__ */ e(
|
|
701
722
|
"button",
|
|
702
723
|
{
|
|
703
|
-
className: "
|
|
704
|
-
onClick:
|
|
705
|
-
disabled:
|
|
706
|
-
children:
|
|
724
|
+
className: "nice-video-studio__export-button",
|
|
725
|
+
onClick: Q,
|
|
726
|
+
disabled: T !== null,
|
|
727
|
+
children: T !== null ? `Exporting... ${Math.round(T)}%` : "Export Video"
|
|
707
728
|
}
|
|
708
729
|
),
|
|
709
|
-
|
|
730
|
+
T !== null && /* @__PURE__ */ e("div", { className: "nice-video-studio__export-progress", children: /* @__PURE__ */ e(
|
|
731
|
+
"div",
|
|
732
|
+
{
|
|
733
|
+
className: "nice-video-studio__export-progress-bar",
|
|
734
|
+
style: { width: `${T}%` }
|
|
735
|
+
}
|
|
736
|
+
) })
|
|
710
737
|
] })
|
|
711
738
|
] });
|
|
712
739
|
return /* @__PURE__ */ t(
|
|
713
|
-
|
|
740
|
+
pe,
|
|
714
741
|
{
|
|
715
742
|
flush: !0,
|
|
716
|
-
className: `nice-video-editor ${
|
|
743
|
+
className: `nice-video-editor nice-video-studio ${O}`,
|
|
717
744
|
height: "100%",
|
|
718
745
|
style: { position: "relative", minHeight: 600 },
|
|
719
|
-
toolbar:
|
|
720
|
-
sidebar:
|
|
721
|
-
rightSidebar:
|
|
722
|
-
bottomPanel:
|
|
746
|
+
toolbar: se,
|
|
747
|
+
sidebar: i,
|
|
748
|
+
rightSidebar: re ?? void 0,
|
|
749
|
+
bottomPanel: l,
|
|
723
750
|
children: [
|
|
724
|
-
/* @__PURE__ */ e("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 30 }, children: /* @__PURE__ */ e(
|
|
725
|
-
|
|
751
|
+
/* @__PURE__ */ e("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 30 }, children: /* @__PURE__ */ e(_e, { steps: ge(I, Ne) }) }),
|
|
752
|
+
c
|
|
726
753
|
]
|
|
727
754
|
}
|
|
728
755
|
);
|
|
729
|
-
},
|
|
756
|
+
}, ke = {
|
|
730
757
|
video: {
|
|
731
758
|
source: "screen",
|
|
732
759
|
showCursor: !0,
|
|
@@ -743,43 +770,43 @@ const fe = {
|
|
|
743
770
|
format: "webm",
|
|
744
771
|
quality: "high"
|
|
745
772
|
}
|
|
746
|
-
},
|
|
747
|
-
options:
|
|
748
|
-
onRecordingStart:
|
|
749
|
-
onRecordingStop:
|
|
750
|
-
onRecordingPause:
|
|
751
|
-
onRecordingResume:
|
|
752
|
-
onError:
|
|
753
|
-
className:
|
|
773
|
+
}, Te = ({
|
|
774
|
+
options: E,
|
|
775
|
+
onRecordingStart: R,
|
|
776
|
+
onRecordingStop: F,
|
|
777
|
+
onRecordingPause: L,
|
|
778
|
+
onRecordingResume: O,
|
|
779
|
+
onError: I,
|
|
780
|
+
className: b = ""
|
|
754
781
|
}) => {
|
|
755
|
-
var
|
|
756
|
-
const [s, A] =
|
|
757
|
-
...
|
|
758
|
-
...
|
|
759
|
-
}), [
|
|
782
|
+
var a, o;
|
|
783
|
+
const { t: r } = me(), [s, A] = g({
|
|
784
|
+
...ke,
|
|
785
|
+
...E
|
|
786
|
+
}), [y, H] = g(null), [v, k] = g("idle"), [N, D] = g([]), [w, B] = g(null), [K, C] = g(null), [G, W] = g(!1), [z, T] = g(!1), [U, ie] = g(
|
|
760
787
|
"pen"
|
|
761
|
-
), [
|
|
762
|
-
|
|
763
|
-
w && w.getTracks().forEach((
|
|
788
|
+
), [te, x] = g("var(--nice-danger, #ff0000)"), f = M(null), _ = M([]), V = M(null), Y = M(null), q = M(null), X = M(0);
|
|
789
|
+
le(() => () => {
|
|
790
|
+
w && w.getTracks().forEach((n) => n.stop()), q.current && clearInterval(q.current);
|
|
764
791
|
}, [w]);
|
|
765
|
-
const
|
|
766
|
-
A((
|
|
767
|
-
...
|
|
768
|
-
...
|
|
769
|
-
video: { ...
|
|
770
|
-
audio: { ...
|
|
771
|
-
output: { ...
|
|
792
|
+
const S = (n) => {
|
|
793
|
+
A((d) => ({
|
|
794
|
+
...d,
|
|
795
|
+
...n,
|
|
796
|
+
video: { ...d.video, ...n.video },
|
|
797
|
+
audio: { ...d.audio, ...n.audio },
|
|
798
|
+
output: { ...d.output, ...n.output }
|
|
772
799
|
}));
|
|
773
|
-
},
|
|
800
|
+
}, Z = async () => {
|
|
774
801
|
try {
|
|
775
802
|
k("preparing");
|
|
776
|
-
const
|
|
803
|
+
const n = {
|
|
777
804
|
video: {
|
|
778
805
|
cursor: s.video.showCursor ? "always" : "never",
|
|
779
806
|
frameRate: s.video.frameRate
|
|
780
807
|
},
|
|
781
808
|
audio: s.audio.source === "system" || s.audio.source === "both"
|
|
782
|
-
},
|
|
809
|
+
}, d = await navigator.mediaDevices.getDisplayMedia(n);
|
|
783
810
|
if (s.audio.enabled && (s.audio.source === "microphone" || s.audio.source === "both"))
|
|
784
811
|
try {
|
|
785
812
|
(await navigator.mediaDevices.getUserMedia({
|
|
@@ -787,34 +814,34 @@ const fe = {
|
|
|
787
814
|
echoCancellation: s.audio.echoCancellation,
|
|
788
815
|
noiseSuppression: s.audio.noiseSuppression
|
|
789
816
|
}
|
|
790
|
-
})).getAudioTracks().forEach((
|
|
791
|
-
} catch (
|
|
792
|
-
console.warn("Could not access microphone:",
|
|
817
|
+
})).getAudioTracks().forEach((h) => d.addTrack(h));
|
|
818
|
+
} catch (u) {
|
|
819
|
+
console.warn("Could not access microphone:", u);
|
|
793
820
|
}
|
|
794
|
-
|
|
795
|
-
} catch (
|
|
796
|
-
k("error"),
|
|
821
|
+
B(d), V.current && (V.current.srcObject = d, V.current.play()), k("idle");
|
|
822
|
+
} catch (n) {
|
|
823
|
+
k("error"), I == null || I(n instanceof Error ? n : new Error("Failed to start preview"));
|
|
797
824
|
}
|
|
798
|
-
},
|
|
799
|
-
w || await
|
|
800
|
-
for (let
|
|
801
|
-
C(
|
|
825
|
+
}, P = async () => {
|
|
826
|
+
w || await Z();
|
|
827
|
+
for (let n = 3; n > 0; n--)
|
|
828
|
+
C(n), await new Promise((d) => setTimeout(d, 1e3));
|
|
802
829
|
C(null);
|
|
803
830
|
try {
|
|
804
|
-
const
|
|
805
|
-
if (!
|
|
831
|
+
const n = w || await ne();
|
|
832
|
+
if (!n)
|
|
806
833
|
throw new Error("No stream available");
|
|
807
|
-
const
|
|
808
|
-
mimeType:
|
|
809
|
-
videoBitsPerSecond:
|
|
834
|
+
const d = se(s.output.format), u = new MediaRecorder(n, {
|
|
835
|
+
mimeType: d,
|
|
836
|
+
videoBitsPerSecond: re(s.output.quality)
|
|
810
837
|
});
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
},
|
|
814
|
-
const
|
|
815
|
-
|
|
816
|
-
},
|
|
817
|
-
const
|
|
838
|
+
_.current = [], u.ondataavailable = (p) => {
|
|
839
|
+
p.data.size > 0 && _.current.push(p.data);
|
|
840
|
+
}, u.onstop = () => {
|
|
841
|
+
const p = new Blob(_.current, { type: d });
|
|
842
|
+
y && (F == null || F({ ...y, status: "stopped" }, p));
|
|
843
|
+
}, f.current = u, u.start(1e3), X.current = Date.now();
|
|
844
|
+
const h = {
|
|
818
845
|
id: $(),
|
|
819
846
|
status: "recording",
|
|
820
847
|
startTime: /* @__PURE__ */ new Date(),
|
|
@@ -823,41 +850,41 @@ const fe = {
|
|
|
823
850
|
options: s,
|
|
824
851
|
chunks: []
|
|
825
852
|
};
|
|
826
|
-
H(
|
|
853
|
+
H(h), k("recording"), R == null || R(h), q.current = setInterval(() => {
|
|
827
854
|
H(
|
|
828
|
-
(
|
|
829
|
-
...
|
|
830
|
-
duration: (Date.now() -
|
|
831
|
-
size:
|
|
855
|
+
(p) => p ? {
|
|
856
|
+
...p,
|
|
857
|
+
duration: (Date.now() - X.current) / 1e3,
|
|
858
|
+
size: _.current.reduce((ve, he) => ve + he.size, 0)
|
|
832
859
|
} : null
|
|
833
860
|
);
|
|
834
861
|
}, 100);
|
|
835
|
-
} catch (
|
|
836
|
-
k("error"),
|
|
862
|
+
} catch (n) {
|
|
863
|
+
k("error"), I == null || I(n instanceof Error ? n : new Error("Failed to start recording"));
|
|
837
864
|
}
|
|
838
|
-
},
|
|
839
|
-
|
|
840
|
-
}, Z = () => {
|
|
841
|
-
g.current && h === "paused" && (g.current.resume(), k("recording"), V == null || V());
|
|
865
|
+
}, ne = async () => (await Z(), w), ae = () => {
|
|
866
|
+
f.current && v === "recording" && (f.current.pause(), k("paused"), L == null || L());
|
|
842
867
|
}, J = () => {
|
|
843
|
-
|
|
844
|
-
},
|
|
845
|
-
(
|
|
846
|
-
|
|
868
|
+
f.current && v === "paused" && (f.current.resume(), k("recording"), O == null || O());
|
|
869
|
+
}, Q = () => {
|
|
870
|
+
q.current && clearInterval(q.current), f.current && (v === "recording" || v === "paused") && (f.current.stop(), k("stopped")), w && (w.getTracks().forEach((n) => n.stop()), B(null));
|
|
871
|
+
}, ee = ue(
|
|
872
|
+
(n) => {
|
|
873
|
+
if (v !== "recording")
|
|
847
874
|
return;
|
|
848
|
-
const
|
|
875
|
+
const d = {
|
|
849
876
|
id: $(),
|
|
850
|
-
time: (
|
|
851
|
-
label:
|
|
852
|
-
color:
|
|
877
|
+
time: (y == null ? void 0 : y.duration) || 0,
|
|
878
|
+
label: n || `Marker ${N.length + 1}`,
|
|
879
|
+
color: i()
|
|
853
880
|
};
|
|
854
|
-
D((
|
|
881
|
+
D((u) => [...u, d]);
|
|
855
882
|
},
|
|
856
|
-
[
|
|
857
|
-
),
|
|
858
|
-
D((
|
|
859
|
-
},
|
|
860
|
-
switch (
|
|
883
|
+
[v, y == null ? void 0 : y.duration, N.length]
|
|
884
|
+
), j = (n) => {
|
|
885
|
+
D((d) => d.filter((u) => u.id !== n));
|
|
886
|
+
}, se = (n) => {
|
|
887
|
+
switch (n) {
|
|
861
888
|
case "mp4":
|
|
862
889
|
return "video/mp4";
|
|
863
890
|
case "mkv":
|
|
@@ -865,8 +892,8 @@ const fe = {
|
|
|
865
892
|
default:
|
|
866
893
|
return "video/webm;codecs=vp9";
|
|
867
894
|
}
|
|
868
|
-
},
|
|
869
|
-
switch (
|
|
895
|
+
}, re = (n) => {
|
|
896
|
+
switch (n) {
|
|
870
897
|
case "low":
|
|
871
898
|
return 25e5;
|
|
872
899
|
case "medium":
|
|
@@ -876,130 +903,174 @@ const fe = {
|
|
|
876
903
|
default:
|
|
877
904
|
return 8e6;
|
|
878
905
|
}
|
|
879
|
-
},
|
|
880
|
-
const
|
|
906
|
+
}, i = () => {
|
|
907
|
+
const n = [
|
|
881
908
|
"var(--nice-danger, #ff4444)",
|
|
909
|
+
// audit-allow: literal-color +5 — annotation pens drawn into the recording
|
|
882
910
|
"#44ff44",
|
|
883
911
|
"#4444ff",
|
|
884
912
|
"#ffff44",
|
|
885
913
|
"#ff44ff",
|
|
886
914
|
"#44ffff"
|
|
887
915
|
];
|
|
888
|
-
return
|
|
889
|
-
},
|
|
890
|
-
const
|
|
891
|
-
return
|
|
892
|
-
},
|
|
893
|
-
return /* @__PURE__ */ t("div", { className: `nice-screen-recorder ${
|
|
894
|
-
/* @__PURE__ */ t("div", { className: "recorder__preview", children: [
|
|
895
|
-
|
|
896
|
-
/* @__PURE__ */ e(
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
916
|
+
return n[Math.floor(Math.random() * n.length)];
|
|
917
|
+
}, c = (n) => {
|
|
918
|
+
const d = Math.floor(n / 3600), u = Math.floor(n % 3600 / 60), h = Math.floor(n % 60), p = Math.floor(n % 1 * 100);
|
|
919
|
+
return d > 0 ? `${d}:${u.toString().padStart(2, "0")}:${h.toString().padStart(2, "0")}` : `${u.toString().padStart(2, "0")}:${h.toString().padStart(2, "0")}.${p.toString().padStart(2, "0")}`;
|
|
920
|
+
}, l = (n) => n < 1024 ? `${n} B` : n < 1024 * 1024 ? `${(n / 1024).toFixed(1)} KB` : `${(n / 1024 / 1024).toFixed(1)} MB`;
|
|
921
|
+
return /* @__PURE__ */ t("div", { className: `nice-screen-recorder ${b}`, children: [
|
|
922
|
+
/* @__PURE__ */ t("div", { className: "nice-screen-recorder__preview", children: [
|
|
923
|
+
K !== null && /* @__PURE__ */ e("div", { className: "nice-screen-recorder__countdown-overlay", children: /* @__PURE__ */ e("span", { className: "nice-screen-recorder__countdown-number", children: K }) }),
|
|
924
|
+
/* @__PURE__ */ e(
|
|
925
|
+
"video",
|
|
926
|
+
{
|
|
927
|
+
ref: V,
|
|
928
|
+
className: "nice-screen-recorder__preview-video",
|
|
929
|
+
muted: !0,
|
|
930
|
+
playsInline: !0
|
|
931
|
+
}
|
|
932
|
+
),
|
|
933
|
+
z && /* @__PURE__ */ e("canvas", { ref: Y, className: "nice-screen-recorder__annotation-canvas" }),
|
|
934
|
+
!w && v === "idle" && /* @__PURE__ */ e("div", { className: "nice-screen-recorder__preview-placeholder", children: /* @__PURE__ */ t("button", { className: "nice-screen-recorder__start-preview-button", onClick: Z, children: [
|
|
935
|
+
/* @__PURE__ */ e("span", { className: "nice-screen-recorder__icon", children: /* @__PURE__ */ e(m, { name: "monitor", size: 18 }) }),
|
|
936
|
+
/* @__PURE__ */ e("span", { children: r("screenRecorder.selectScreenToRecord", "Select Screen to Record") })
|
|
901
937
|
] }) }),
|
|
902
|
-
|
|
903
|
-
/* @__PURE__ */ e("span", { className: "
|
|
938
|
+
v === "recording" && /* @__PURE__ */ t("div", { className: "nice-screen-recorder__recording-indicator", children: [
|
|
939
|
+
/* @__PURE__ */ e("span", { className: "nice-screen-recorder__recording-dot" }),
|
|
904
940
|
/* @__PURE__ */ e("span", { children: "REC" })
|
|
905
941
|
] })
|
|
906
942
|
] }),
|
|
907
|
-
/* @__PURE__ */ t("div", { className: "recorder__controls", children: [
|
|
908
|
-
/* @__PURE__ */ t("div", { className: "
|
|
909
|
-
|
|
943
|
+
/* @__PURE__ */ t("div", { className: "nice-screen-recorder__controls", children: [
|
|
944
|
+
/* @__PURE__ */ t("div", { className: "nice-screen-recorder__controls-main", children: [
|
|
945
|
+
v === "idle" && /* @__PURE__ */ t(
|
|
910
946
|
"button",
|
|
911
947
|
{
|
|
912
|
-
className: "
|
|
913
|
-
onClick:
|
|
914
|
-
disabled: !!
|
|
948
|
+
className: "nice-screen-recorder__control-button nice-screen-recorder__control-button--record",
|
|
949
|
+
onClick: P,
|
|
950
|
+
disabled: !!K,
|
|
915
951
|
children: [
|
|
916
|
-
/* @__PURE__ */ e("span", { className: "
|
|
917
|
-
/* @__PURE__ */ e("span", { children: "Start Recording" })
|
|
952
|
+
/* @__PURE__ */ e("span", { className: "nice-screen-recorder__icon", children: /* @__PURE__ */ e(m, { name: "circle", size: 18 }) }),
|
|
953
|
+
/* @__PURE__ */ e("span", { children: r("screenRecorder.startRecording", "Start Recording") })
|
|
918
954
|
]
|
|
919
955
|
}
|
|
920
956
|
),
|
|
921
|
-
|
|
922
|
-
/* @__PURE__ */ t(
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
957
|
+
v === "recording" && /* @__PURE__ */ t(oe, { children: [
|
|
958
|
+
/* @__PURE__ */ t(
|
|
959
|
+
"button",
|
|
960
|
+
{
|
|
961
|
+
className: "nice-screen-recorder__control-button nice-screen-recorder__control-button--pause",
|
|
962
|
+
onClick: ae,
|
|
963
|
+
children: [
|
|
964
|
+
/* @__PURE__ */ e("span", { className: "nice-screen-recorder__icon", children: /* @__PURE__ */ e(m, { name: "pause", size: 18 }) }),
|
|
965
|
+
/* @__PURE__ */ e("span", { children: r("screenRecorder.pause", "Pause") })
|
|
966
|
+
]
|
|
967
|
+
}
|
|
968
|
+
),
|
|
969
|
+
/* @__PURE__ */ t(
|
|
970
|
+
"button",
|
|
971
|
+
{
|
|
972
|
+
className: "nice-screen-recorder__control-button nice-screen-recorder__control-button--stop",
|
|
973
|
+
onClick: Q,
|
|
974
|
+
children: [
|
|
975
|
+
/* @__PURE__ */ e("span", { className: "nice-screen-recorder__icon", children: /* @__PURE__ */ e(m, { name: "stop", size: 18 }) }),
|
|
976
|
+
/* @__PURE__ */ e("span", { children: r("screenRecorder.stop", "Stop") })
|
|
977
|
+
]
|
|
978
|
+
}
|
|
979
|
+
)
|
|
930
980
|
] }),
|
|
931
|
-
|
|
932
|
-
/* @__PURE__ */ t(
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
981
|
+
v === "paused" && /* @__PURE__ */ t(oe, { children: [
|
|
982
|
+
/* @__PURE__ */ t(
|
|
983
|
+
"button",
|
|
984
|
+
{
|
|
985
|
+
className: "nice-screen-recorder__control-button nice-screen-recorder__control-button--resume",
|
|
986
|
+
onClick: J,
|
|
987
|
+
children: [
|
|
988
|
+
/* @__PURE__ */ e("span", { className: "nice-screen-recorder__icon", children: /* @__PURE__ */ e(m, { name: "play", size: 18 }) }),
|
|
989
|
+
/* @__PURE__ */ e("span", { children: r("screenRecorder.resume", "Resume") })
|
|
990
|
+
]
|
|
991
|
+
}
|
|
992
|
+
),
|
|
993
|
+
/* @__PURE__ */ t(
|
|
994
|
+
"button",
|
|
995
|
+
{
|
|
996
|
+
className: "nice-screen-recorder__control-button nice-screen-recorder__control-button--stop",
|
|
997
|
+
onClick: Q,
|
|
998
|
+
children: [
|
|
999
|
+
/* @__PURE__ */ e("span", { className: "nice-screen-recorder__icon", children: /* @__PURE__ */ e(m, { name: "stop", size: 18 }) }),
|
|
1000
|
+
/* @__PURE__ */ e("span", { children: r("screenRecorder.stop", "Stop") })
|
|
1001
|
+
]
|
|
1002
|
+
}
|
|
1003
|
+
)
|
|
940
1004
|
] }),
|
|
941
|
-
|
|
1005
|
+
v === "stopped" && /* @__PURE__ */ t(
|
|
942
1006
|
"button",
|
|
943
1007
|
{
|
|
944
|
-
className: "
|
|
1008
|
+
className: "nice-screen-recorder__control-button nice-screen-recorder__control-button--new",
|
|
945
1009
|
onClick: () => {
|
|
946
1010
|
k("idle"), H(null), D([]);
|
|
947
1011
|
},
|
|
948
1012
|
children: [
|
|
949
|
-
/* @__PURE__ */ e("span", { className: "
|
|
950
|
-
/* @__PURE__ */ e("span", { children: "New Recording" })
|
|
1013
|
+
/* @__PURE__ */ e("span", { className: "nice-screen-recorder__icon", children: /* @__PURE__ */ e(m, { name: "refresh", size: 18 }) }),
|
|
1014
|
+
/* @__PURE__ */ e("span", { children: r("screenRecorder.newRecording", "New Recording") })
|
|
951
1015
|
]
|
|
952
1016
|
}
|
|
953
1017
|
)
|
|
954
1018
|
] }),
|
|
955
|
-
/* @__PURE__ */ t("div", { className: "
|
|
956
|
-
(
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
1019
|
+
/* @__PURE__ */ t("div", { className: "nice-screen-recorder__controls-secondary", children: [
|
|
1020
|
+
(v === "recording" || v === "paused") && /* @__PURE__ */ t(
|
|
1021
|
+
"button",
|
|
1022
|
+
{
|
|
1023
|
+
className: "nice-screen-recorder__control-button nice-screen-recorder__control-button--marker",
|
|
1024
|
+
onClick: () => ee(),
|
|
1025
|
+
children: [
|
|
1026
|
+
/* @__PURE__ */ e("span", { className: "nice-screen-recorder__icon", children: /* @__PURE__ */ e(m, { name: "tag", size: 18 }) }),
|
|
1027
|
+
/* @__PURE__ */ e("span", { children: r("screenRecorder.addMarker", "Add Marker") })
|
|
1028
|
+
]
|
|
1029
|
+
}
|
|
1030
|
+
),
|
|
960
1031
|
/* @__PURE__ */ t(
|
|
961
1032
|
"button",
|
|
962
1033
|
{
|
|
963
|
-
className: `
|
|
964
|
-
onClick: () =>
|
|
965
|
-
disabled:
|
|
1034
|
+
className: `nice-screen-recorder__control-button ${z ? "nice-screen-recorder__control-button--active" : ""}`,
|
|
1035
|
+
onClick: () => T(!z),
|
|
1036
|
+
disabled: v !== "recording",
|
|
966
1037
|
children: [
|
|
967
|
-
/* @__PURE__ */ e("span", { className: "
|
|
968
|
-
/* @__PURE__ */ e("span", { children: "Annotate" })
|
|
1038
|
+
/* @__PURE__ */ e("span", { className: "nice-screen-recorder__icon", children: /* @__PURE__ */ e(m, { name: "pen", size: 18 }) }),
|
|
1039
|
+
/* @__PURE__ */ e("span", { children: r("screenRecorder.annotate", "Annotate") })
|
|
969
1040
|
]
|
|
970
1041
|
}
|
|
971
1042
|
),
|
|
972
1043
|
/* @__PURE__ */ e(
|
|
973
1044
|
"button",
|
|
974
1045
|
{
|
|
975
|
-
className: "
|
|
976
|
-
onClick: () =>
|
|
977
|
-
disabled:
|
|
978
|
-
"aria-label": "Settings",
|
|
979
|
-
children: /* @__PURE__ */ e("span", { className: "
|
|
1046
|
+
className: "nice-screen-recorder__control-button nice-screen-recorder__control-button--settings",
|
|
1047
|
+
onClick: () => W(!G),
|
|
1048
|
+
disabled: v === "recording",
|
|
1049
|
+
"aria-label": r("screenRecorder.settings", "Settings"),
|
|
1050
|
+
children: /* @__PURE__ */ e("span", { className: "nice-screen-recorder__icon", children: /* @__PURE__ */ e(m, { name: "settings", size: 18 }) })
|
|
980
1051
|
}
|
|
981
1052
|
)
|
|
982
1053
|
] })
|
|
983
1054
|
] }),
|
|
984
|
-
/* @__PURE__ */ t("div", { className: "recorder__status", children: [
|
|
985
|
-
/* @__PURE__ */ t("div", { className: "
|
|
986
|
-
/* @__PURE__ */ t("span", { className: "
|
|
1055
|
+
/* @__PURE__ */ t("div", { className: "nice-screen-recorder__status", children: [
|
|
1056
|
+
/* @__PURE__ */ t("div", { className: "nice-screen-recorder__status-info", children: [
|
|
1057
|
+
/* @__PURE__ */ t("span", { className: "nice-screen-recorder__status-item", children: [
|
|
987
1058
|
/* @__PURE__ */ e("strong", { children: "Duration:" }),
|
|
988
1059
|
" ",
|
|
989
|
-
|
|
1060
|
+
c((y == null ? void 0 : y.duration) || 0)
|
|
990
1061
|
] }),
|
|
991
|
-
/* @__PURE__ */ t("span", { className: "
|
|
1062
|
+
/* @__PURE__ */ t("span", { className: "nice-screen-recorder__status-item", children: [
|
|
992
1063
|
/* @__PURE__ */ e("strong", { children: "Size:" }),
|
|
993
1064
|
" ",
|
|
994
|
-
|
|
1065
|
+
l((y == null ? void 0 : y.size) || 0)
|
|
995
1066
|
] }),
|
|
996
|
-
/* @__PURE__ */ t("span", { className: "
|
|
1067
|
+
/* @__PURE__ */ t("span", { className: "nice-screen-recorder__status-item", children: [
|
|
997
1068
|
/* @__PURE__ */ e("strong", { children: "Markers:" }),
|
|
998
1069
|
" ",
|
|
999
|
-
|
|
1070
|
+
N.length
|
|
1000
1071
|
] })
|
|
1001
1072
|
] }),
|
|
1002
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1073
|
+
/* @__PURE__ */ t("div", { className: "nice-screen-recorder__status-quality", children: [
|
|
1003
1074
|
s.video.resolution && /* @__PURE__ */ t("span", { children: [
|
|
1004
1075
|
s.video.resolution.width,
|
|
1005
1076
|
"x",
|
|
@@ -1009,125 +1080,131 @@ const fe = {
|
|
|
1009
1080
|
s.video.frameRate,
|
|
1010
1081
|
"fps"
|
|
1011
1082
|
] }),
|
|
1012
|
-
/* @__PURE__ */ e(
|
|
1083
|
+
/* @__PURE__ */ e(
|
|
1084
|
+
"span",
|
|
1085
|
+
{
|
|
1086
|
+
className: `nice-screen-recorder__audio-status nice-screen-recorder__audio-status--${s.audio.enabled ? "on" : "off"}`,
|
|
1087
|
+
children: /* @__PURE__ */ e(m, { name: s.audio.enabled ? "volume" : "volume-off", size: 14 })
|
|
1088
|
+
}
|
|
1089
|
+
)
|
|
1013
1090
|
] })
|
|
1014
1091
|
] }),
|
|
1015
|
-
|
|
1016
|
-
/* @__PURE__ */ e("div", { className: "
|
|
1092
|
+
z && v === "recording" && /* @__PURE__ */ t("div", { className: "nice-screen-recorder__annotation-tools", children: [
|
|
1093
|
+
/* @__PURE__ */ e("div", { className: "nice-screen-recorder__tool-group", children: ["pen", "arrow", "rectangle", "text"].map((n) => /* @__PURE__ */ e(
|
|
1017
1094
|
"button",
|
|
1018
1095
|
{
|
|
1019
|
-
className: `
|
|
1020
|
-
onClick: () =>
|
|
1021
|
-
"aria-label":
|
|
1096
|
+
className: `nice-screen-recorder__tool-button ${U === n ? "nice-screen-recorder__tool-button--active" : ""}`,
|
|
1097
|
+
onClick: () => ie(n),
|
|
1098
|
+
"aria-label": n,
|
|
1022
1099
|
children: /* @__PURE__ */ e(
|
|
1023
|
-
|
|
1100
|
+
m,
|
|
1024
1101
|
{
|
|
1025
|
-
name:
|
|
1102
|
+
name: n === "pen" ? "pen" : n === "arrow" ? "arrow-right" : n === "rectangle" ? "square" : "type",
|
|
1026
1103
|
size: 16
|
|
1027
1104
|
}
|
|
1028
1105
|
)
|
|
1029
1106
|
},
|
|
1030
|
-
|
|
1107
|
+
n
|
|
1031
1108
|
)) }),
|
|
1032
|
-
/* @__PURE__ */ e("div", { className: "
|
|
1109
|
+
/* @__PURE__ */ e("div", { className: "nice-screen-recorder__color-group", children: [
|
|
1033
1110
|
"var(--nice-danger, #ff0000)",
|
|
1034
1111
|
"var(--nice-success, #00ff00)",
|
|
1035
1112
|
"var(--nice-primary, #0000ff)",
|
|
1036
1113
|
"var(--nice-warning, #ffff00)",
|
|
1037
1114
|
"var(--nice-bg, #fff)",
|
|
1038
1115
|
"var(--nice-text, #000000)"
|
|
1039
|
-
].map((
|
|
1116
|
+
].map((n) => /* @__PURE__ */ e(
|
|
1040
1117
|
"button",
|
|
1041
1118
|
{
|
|
1042
|
-
className: `
|
|
1043
|
-
style: { backgroundColor:
|
|
1044
|
-
onClick: () =>
|
|
1119
|
+
className: `nice-screen-recorder__color-button ${te === n ? "nice-screen-recorder__color-button--active" : ""}`,
|
|
1120
|
+
style: { backgroundColor: n },
|
|
1121
|
+
onClick: () => x(n)
|
|
1045
1122
|
},
|
|
1046
|
-
|
|
1123
|
+
n
|
|
1047
1124
|
)) })
|
|
1048
1125
|
] }),
|
|
1049
|
-
|
|
1050
|
-
/* @__PURE__ */ e("h4", { children: "Markers" }),
|
|
1051
|
-
/* @__PURE__ */ e("div", { className: "
|
|
1126
|
+
N.length > 0 && /* @__PURE__ */ t("div", { className: "nice-screen-recorder__markers", children: [
|
|
1127
|
+
/* @__PURE__ */ e("h4", { children: r("screenRecorder.markers", "Markers") }),
|
|
1128
|
+
/* @__PURE__ */ e("div", { className: "nice-screen-recorder__markers-list", children: N.map((n) => /* @__PURE__ */ t(
|
|
1052
1129
|
"div",
|
|
1053
1130
|
{
|
|
1054
|
-
className: "
|
|
1055
|
-
style: { borderLeftColor:
|
|
1131
|
+
className: "nice-screen-recorder__marker-item",
|
|
1132
|
+
style: { borderLeftColor: n.color },
|
|
1056
1133
|
children: [
|
|
1057
|
-
/* @__PURE__ */ e("span", { className: "
|
|
1134
|
+
/* @__PURE__ */ e("span", { className: "nice-screen-recorder__marker-time", children: c(n.time) }),
|
|
1058
1135
|
/* @__PURE__ */ e(
|
|
1059
1136
|
"input",
|
|
1060
1137
|
{
|
|
1061
1138
|
type: "text",
|
|
1062
|
-
value:
|
|
1063
|
-
onChange: (
|
|
1139
|
+
value: n.label,
|
|
1140
|
+
onChange: (d) => {
|
|
1064
1141
|
D(
|
|
1065
|
-
(
|
|
1142
|
+
(u) => u.map((h) => h.id === n.id ? { ...h, label: d.target.value } : h)
|
|
1066
1143
|
);
|
|
1067
1144
|
},
|
|
1068
|
-
className: "
|
|
1145
|
+
className: "nice-screen-recorder__marker-label"
|
|
1069
1146
|
}
|
|
1070
1147
|
),
|
|
1071
1148
|
/* @__PURE__ */ e(
|
|
1072
1149
|
"button",
|
|
1073
1150
|
{
|
|
1074
|
-
"aria-label": "Close",
|
|
1075
|
-
className: "
|
|
1076
|
-
onClick: () =>
|
|
1077
|
-
children: /* @__PURE__ */ e(
|
|
1151
|
+
"aria-label": r("screenRecorder.close", "Close"),
|
|
1152
|
+
className: "nice-screen-recorder__marker-remove",
|
|
1153
|
+
onClick: () => j(n.id),
|
|
1154
|
+
children: /* @__PURE__ */ e(m, { name: "close", size: 16 })
|
|
1078
1155
|
}
|
|
1079
1156
|
)
|
|
1080
1157
|
]
|
|
1081
1158
|
},
|
|
1082
|
-
|
|
1159
|
+
n.id
|
|
1083
1160
|
)) })
|
|
1084
1161
|
] }),
|
|
1085
|
-
|
|
1086
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1087
|
-
/* @__PURE__ */ e("h3", { children: "Recording Settings" }),
|
|
1162
|
+
G && /* @__PURE__ */ t("div", { className: "nice-screen-recorder__settings", children: [
|
|
1163
|
+
/* @__PURE__ */ t("div", { className: "nice-screen-recorder__settings-header", children: [
|
|
1164
|
+
/* @__PURE__ */ e("h3", { children: r("screenRecorder.recordingSettings", "Recording Settings") }),
|
|
1088
1165
|
/* @__PURE__ */ e(
|
|
1089
1166
|
"button",
|
|
1090
1167
|
{
|
|
1091
|
-
"aria-label": "Close",
|
|
1092
|
-
className: "
|
|
1093
|
-
onClick: () =>
|
|
1094
|
-
children: /* @__PURE__ */ e(
|
|
1168
|
+
"aria-label": r("screenRecorder.close", "Close"),
|
|
1169
|
+
className: "nice-screen-recorder__close-button",
|
|
1170
|
+
onClick: () => W(!1),
|
|
1171
|
+
children: /* @__PURE__ */ e(m, { name: "close", size: 16 })
|
|
1095
1172
|
}
|
|
1096
1173
|
)
|
|
1097
1174
|
] }),
|
|
1098
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1099
|
-
/* @__PURE__ */ e("h4", { children: "Video" }),
|
|
1175
|
+
/* @__PURE__ */ t("div", { className: "nice-screen-recorder__settings-section", children: [
|
|
1176
|
+
/* @__PURE__ */ e("h4", { children: r("screenRecorder.video", "Video") }),
|
|
1100
1177
|
/* @__PURE__ */ t("label", { children: [
|
|
1101
|
-
"Source",
|
|
1178
|
+
r("screenRecorder.source", "Source"),
|
|
1102
1179
|
/* @__PURE__ */ t(
|
|
1103
1180
|
"select",
|
|
1104
1181
|
{
|
|
1105
1182
|
value: s.video.source,
|
|
1106
|
-
onChange: (
|
|
1183
|
+
onChange: (n) => S({
|
|
1107
1184
|
video: {
|
|
1108
1185
|
...s.video,
|
|
1109
|
-
source:
|
|
1186
|
+
source: n.target.value
|
|
1110
1187
|
}
|
|
1111
1188
|
}),
|
|
1112
1189
|
children: [
|
|
1113
|
-
/* @__PURE__ */ e("option", { value: "screen", children: "Entire Screen" }),
|
|
1114
|
-
/* @__PURE__ */ e("option", { value: "window", children: "Application Window" }),
|
|
1115
|
-
/* @__PURE__ */ e("option", { value: "tab", children: "Browser Tab" }),
|
|
1116
|
-
/* @__PURE__ */ e("option", { value: "camera", children: "Camera" })
|
|
1190
|
+
/* @__PURE__ */ e("option", { value: "screen", children: r("screenRecorder.entireScreen", "Entire Screen") }),
|
|
1191
|
+
/* @__PURE__ */ e("option", { value: "window", children: r("screenRecorder.applicationWindow", "Application Window") }),
|
|
1192
|
+
/* @__PURE__ */ e("option", { value: "tab", children: r("screenRecorder.browserTab", "Browser Tab") }),
|
|
1193
|
+
/* @__PURE__ */ e("option", { value: "camera", children: r("screenRecorder.camera", "Camera") })
|
|
1117
1194
|
]
|
|
1118
1195
|
}
|
|
1119
1196
|
)
|
|
1120
1197
|
] }),
|
|
1121
1198
|
/* @__PURE__ */ t("label", { children: [
|
|
1122
|
-
"Resolution",
|
|
1199
|
+
r("screenRecorder.resolution", "Resolution"),
|
|
1123
1200
|
/* @__PURE__ */ t(
|
|
1124
1201
|
"select",
|
|
1125
1202
|
{
|
|
1126
|
-
value: `${(
|
|
1127
|
-
onChange: (
|
|
1128
|
-
const [
|
|
1129
|
-
|
|
1130
|
-
video: { ...s.video, resolution: { width:
|
|
1203
|
+
value: `${(a = s.video.resolution) == null ? void 0 : a.width}x${(o = s.video.resolution) == null ? void 0 : o.height}`,
|
|
1204
|
+
onChange: (n) => {
|
|
1205
|
+
const [d, u] = n.target.value.split("x").map(Number);
|
|
1206
|
+
S({
|
|
1207
|
+
video: { ...s.video, resolution: { width: d, height: u } }
|
|
1131
1208
|
});
|
|
1132
1209
|
},
|
|
1133
1210
|
children: [
|
|
@@ -1140,13 +1217,13 @@ const fe = {
|
|
|
1140
1217
|
)
|
|
1141
1218
|
] }),
|
|
1142
1219
|
/* @__PURE__ */ t("label", { children: [
|
|
1143
|
-
"Frame Rate",
|
|
1220
|
+
r("screenRecorder.frameRate", "Frame Rate"),
|
|
1144
1221
|
/* @__PURE__ */ t(
|
|
1145
1222
|
"select",
|
|
1146
1223
|
{
|
|
1147
1224
|
value: s.video.frameRate,
|
|
1148
|
-
onChange: (
|
|
1149
|
-
video: { ...s.video, frameRate: parseInt(
|
|
1225
|
+
onChange: (n) => S({
|
|
1226
|
+
video: { ...s.video, frameRate: parseInt(n.target.value) }
|
|
1150
1227
|
}),
|
|
1151
1228
|
children: [
|
|
1152
1229
|
/* @__PURE__ */ e("option", { value: "15", children: "15 fps" }),
|
|
@@ -1157,94 +1234,94 @@ const fe = {
|
|
|
1157
1234
|
}
|
|
1158
1235
|
)
|
|
1159
1236
|
] }),
|
|
1160
|
-
/* @__PURE__ */ t("label", { className: "
|
|
1237
|
+
/* @__PURE__ */ t("label", { className: "nice-screen-recorder__checkbox-label", children: [
|
|
1161
1238
|
/* @__PURE__ */ e(
|
|
1162
1239
|
"input",
|
|
1163
1240
|
{
|
|
1164
1241
|
type: "checkbox",
|
|
1165
1242
|
checked: s.video.showCursor,
|
|
1166
|
-
onChange: (
|
|
1167
|
-
video: { ...s.video, showCursor:
|
|
1243
|
+
onChange: (n) => S({
|
|
1244
|
+
video: { ...s.video, showCursor: n.target.checked }
|
|
1168
1245
|
})
|
|
1169
1246
|
}
|
|
1170
1247
|
),
|
|
1171
|
-
"Show Cursor"
|
|
1248
|
+
r("screenRecorder.showCursor", "Show Cursor")
|
|
1172
1249
|
] })
|
|
1173
1250
|
] }),
|
|
1174
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1175
|
-
/* @__PURE__ */ e("h4", { children: "Audio" }),
|
|
1176
|
-
/* @__PURE__ */ t("label", { className: "
|
|
1251
|
+
/* @__PURE__ */ t("div", { className: "nice-screen-recorder__settings-section", children: [
|
|
1252
|
+
/* @__PURE__ */ e("h4", { children: r("screenRecorder.audio", "Audio") }),
|
|
1253
|
+
/* @__PURE__ */ t("label", { className: "nice-screen-recorder__checkbox-label", children: [
|
|
1177
1254
|
/* @__PURE__ */ e(
|
|
1178
1255
|
"input",
|
|
1179
1256
|
{
|
|
1180
1257
|
type: "checkbox",
|
|
1181
1258
|
checked: s.audio.enabled,
|
|
1182
|
-
onChange: (
|
|
1183
|
-
audio: { ...s.audio, enabled:
|
|
1259
|
+
onChange: (n) => S({
|
|
1260
|
+
audio: { ...s.audio, enabled: n.target.checked }
|
|
1184
1261
|
})
|
|
1185
1262
|
}
|
|
1186
1263
|
),
|
|
1187
|
-
"Enable Audio"
|
|
1264
|
+
r("screenRecorder.enableAudio", "Enable Audio")
|
|
1188
1265
|
] }),
|
|
1189
|
-
s.audio.enabled && /* @__PURE__ */ t(
|
|
1266
|
+
s.audio.enabled && /* @__PURE__ */ t(oe, { children: [
|
|
1190
1267
|
/* @__PURE__ */ t("label", { children: [
|
|
1191
|
-
"Source",
|
|
1268
|
+
r("screenRecorder.source", "Source"),
|
|
1192
1269
|
/* @__PURE__ */ t(
|
|
1193
1270
|
"select",
|
|
1194
1271
|
{
|
|
1195
1272
|
value: s.audio.source,
|
|
1196
|
-
onChange: (
|
|
1273
|
+
onChange: (n) => S({
|
|
1197
1274
|
audio: {
|
|
1198
1275
|
...s.audio,
|
|
1199
|
-
source:
|
|
1276
|
+
source: n.target.value
|
|
1200
1277
|
}
|
|
1201
1278
|
}),
|
|
1202
1279
|
children: [
|
|
1203
|
-
/* @__PURE__ */ e("option", { value: "system", children: "System Audio" }),
|
|
1204
|
-
/* @__PURE__ */ e("option", { value: "microphone", children: "Microphone" }),
|
|
1205
|
-
/* @__PURE__ */ e("option", { value: "both", children: "Both" })
|
|
1280
|
+
/* @__PURE__ */ e("option", { value: "system", children: r("screenRecorder.systemAudio", "System Audio") }),
|
|
1281
|
+
/* @__PURE__ */ e("option", { value: "microphone", children: r("screenRecorder.microphone", "Microphone") }),
|
|
1282
|
+
/* @__PURE__ */ e("option", { value: "both", children: r("screenRecorder.both", "Both") })
|
|
1206
1283
|
]
|
|
1207
1284
|
}
|
|
1208
1285
|
)
|
|
1209
1286
|
] }),
|
|
1210
|
-
/* @__PURE__ */ t("label", { className: "
|
|
1287
|
+
/* @__PURE__ */ t("label", { className: "nice-screen-recorder__checkbox-label", children: [
|
|
1211
1288
|
/* @__PURE__ */ e(
|
|
1212
1289
|
"input",
|
|
1213
1290
|
{
|
|
1214
1291
|
type: "checkbox",
|
|
1215
1292
|
checked: s.audio.echoCancellation,
|
|
1216
|
-
onChange: (
|
|
1217
|
-
audio: { ...s.audio, echoCancellation:
|
|
1293
|
+
onChange: (n) => S({
|
|
1294
|
+
audio: { ...s.audio, echoCancellation: n.target.checked }
|
|
1218
1295
|
})
|
|
1219
1296
|
}
|
|
1220
1297
|
),
|
|
1221
|
-
"Echo Cancellation"
|
|
1298
|
+
r("screenRecorder.echoCancellation", "Echo Cancellation")
|
|
1222
1299
|
] }),
|
|
1223
|
-
/* @__PURE__ */ t("label", { className: "
|
|
1300
|
+
/* @__PURE__ */ t("label", { className: "nice-screen-recorder__checkbox-label", children: [
|
|
1224
1301
|
/* @__PURE__ */ e(
|
|
1225
1302
|
"input",
|
|
1226
1303
|
{
|
|
1227
1304
|
type: "checkbox",
|
|
1228
1305
|
checked: s.audio.noiseSuppression,
|
|
1229
|
-
onChange: (
|
|
1230
|
-
audio: { ...s.audio, noiseSuppression:
|
|
1306
|
+
onChange: (n) => S({
|
|
1307
|
+
audio: { ...s.audio, noiseSuppression: n.target.checked }
|
|
1231
1308
|
})
|
|
1232
1309
|
}
|
|
1233
1310
|
),
|
|
1234
|
-
"Noise Suppression"
|
|
1311
|
+
r("screenRecorder.noiseSuppression", "Noise Suppression")
|
|
1235
1312
|
] })
|
|
1236
1313
|
] })
|
|
1237
1314
|
] }),
|
|
1238
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1239
|
-
/* @__PURE__ */ e("h4", { children: "Output" }),
|
|
1315
|
+
/* @__PURE__ */ t("div", { className: "nice-screen-recorder__settings-section", children: [
|
|
1316
|
+
/* @__PURE__ */ e("h4", { children: r("screenRecorder.output", "Output") }),
|
|
1240
1317
|
/* @__PURE__ */ t("label", { children: [
|
|
1241
|
-
"Format",
|
|
1318
|
+
r("screenRecorder.format", "Format"),
|
|
1242
1319
|
/* @__PURE__ */ t(
|
|
1243
1320
|
"select",
|
|
1244
1321
|
{
|
|
1245
1322
|
value: s.output.format,
|
|
1246
|
-
onChange: (
|
|
1247
|
-
output: { ...s.output, format:
|
|
1323
|
+
onChange: (n) => S({
|
|
1324
|
+
output: { ...s.output, format: n.target.value }
|
|
1248
1325
|
}),
|
|
1249
1326
|
children: [
|
|
1250
1327
|
/* @__PURE__ */ e("option", { value: "webm", children: "WebM (Best Web)" }),
|
|
@@ -1255,20 +1332,20 @@ const fe = {
|
|
|
1255
1332
|
)
|
|
1256
1333
|
] }),
|
|
1257
1334
|
/* @__PURE__ */ t("label", { children: [
|
|
1258
|
-
"Quality",
|
|
1335
|
+
r("screenRecorder.quality", "Quality"),
|
|
1259
1336
|
/* @__PURE__ */ t(
|
|
1260
1337
|
"select",
|
|
1261
1338
|
{
|
|
1262
1339
|
value: s.output.quality,
|
|
1263
|
-
onChange: (
|
|
1340
|
+
onChange: (n) => S({
|
|
1264
1341
|
output: {
|
|
1265
1342
|
...s.output,
|
|
1266
|
-
quality:
|
|
1343
|
+
quality: n.target.value
|
|
1267
1344
|
}
|
|
1268
1345
|
}),
|
|
1269
1346
|
children: [
|
|
1270
1347
|
/* @__PURE__ */ e("option", { value: "low", children: "Low (Smaller file)" }),
|
|
1271
|
-
/* @__PURE__ */ e("option", { value: "medium", children: "Medium" }),
|
|
1348
|
+
/* @__PURE__ */ e("option", { value: "medium", children: r("screenRecorder.medium", "Medium") }),
|
|
1272
1349
|
/* @__PURE__ */ e("option", { value: "high", children: "High (Recommended)" }),
|
|
1273
1350
|
/* @__PURE__ */ e("option", { value: "lossless", children: "Lossless (Largest file)" })
|
|
1274
1351
|
]
|
|
@@ -1278,7 +1355,7 @@ const fe = {
|
|
|
1278
1355
|
] })
|
|
1279
1356
|
] })
|
|
1280
1357
|
] });
|
|
1281
|
-
},
|
|
1358
|
+
}, we = {
|
|
1282
1359
|
id: $(),
|
|
1283
1360
|
name: "My Stream",
|
|
1284
1361
|
protocol: "rtmp",
|
|
@@ -1306,7 +1383,7 @@ const fe = {
|
|
|
1306
1383
|
codec: "aac"
|
|
1307
1384
|
}
|
|
1308
1385
|
}
|
|
1309
|
-
},
|
|
1386
|
+
}, de = [
|
|
1310
1387
|
{
|
|
1311
1388
|
platform: "youtube",
|
|
1312
1389
|
name: "YouTube",
|
|
@@ -1322,7 +1399,7 @@ const fe = {
|
|
|
1322
1399
|
},
|
|
1323
1400
|
{ platform: "custom-rtmp", name: "Custom RTMP", icon: "link", defaultUrl: "" },
|
|
1324
1401
|
{ platform: "custom-srt", name: "Custom SRT", icon: "lock", defaultUrl: "" }
|
|
1325
|
-
],
|
|
1402
|
+
], ce = [
|
|
1326
1403
|
{ type: "camera", name: "Camera", icon: "camera" },
|
|
1327
1404
|
{ type: "screen", name: "Screen Capture", icon: "monitor" },
|
|
1328
1405
|
{ type: "window", name: "Window Capture", icon: "window" },
|
|
@@ -1331,18 +1408,18 @@ const fe = {
|
|
|
1331
1408
|
{ type: "video", name: "Video", icon: "video" },
|
|
1332
1409
|
{ type: "microphone", name: "Microphone", icon: "mic" },
|
|
1333
1410
|
{ type: "system-audio", name: "System Audio", icon: "volume" }
|
|
1334
|
-
],
|
|
1335
|
-
config:
|
|
1336
|
-
onConfigChange:
|
|
1337
|
-
onStreamStart:
|
|
1338
|
-
onStreamStop:
|
|
1339
|
-
onStatsUpdate:
|
|
1340
|
-
onError:
|
|
1341
|
-
className:
|
|
1411
|
+
], Ie = ({
|
|
1412
|
+
config: E,
|
|
1413
|
+
onConfigChange: R,
|
|
1414
|
+
onStreamStart: F,
|
|
1415
|
+
onStreamStop: L,
|
|
1416
|
+
onStatsUpdate: O,
|
|
1417
|
+
onError: I,
|
|
1418
|
+
className: b = ""
|
|
1342
1419
|
}) => {
|
|
1343
|
-
const [s, A] =
|
|
1420
|
+
const { t: r } = me(), [s, A] = g(E || we), [y, H] = g(
|
|
1344
1421
|
"sources"
|
|
1345
|
-
), [
|
|
1422
|
+
), [v, k] = g(!1), [N, D] = g({
|
|
1346
1423
|
duration: 0,
|
|
1347
1424
|
viewers: 0,
|
|
1348
1425
|
peakViewers: 0,
|
|
@@ -1351,155 +1428,155 @@ const fe = {
|
|
|
1351
1428
|
droppedFrames: 0,
|
|
1352
1429
|
cpuUsage: 0,
|
|
1353
1430
|
memoryUsage: 0
|
|
1354
|
-
}), [w,
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
}, [
|
|
1358
|
-
|
|
1431
|
+
}), [w, B] = g(null), [K, C] = g(!1), [G, W] = g(!1), [z, T] = g([s.layout]), [U, ie] = g(0), te = M(null), x = M(null), f = M(0);
|
|
1432
|
+
le(() => {
|
|
1433
|
+
E && A(E);
|
|
1434
|
+
}, [E]), le(() => () => {
|
|
1435
|
+
x.current && clearInterval(x.current);
|
|
1359
1436
|
}, []);
|
|
1360
|
-
const
|
|
1361
|
-
(
|
|
1362
|
-
const
|
|
1363
|
-
A(
|
|
1437
|
+
const _ = ue(
|
|
1438
|
+
(i) => {
|
|
1439
|
+
const c = { ...s, ...i };
|
|
1440
|
+
A(c), R == null || R(c);
|
|
1364
1441
|
},
|
|
1365
|
-
[s,
|
|
1366
|
-
),
|
|
1367
|
-
const
|
|
1442
|
+
[s, R]
|
|
1443
|
+
), V = (i) => {
|
|
1444
|
+
const c = de.find((a) => a.platform === i), l = {
|
|
1368
1445
|
id: $(),
|
|
1369
|
-
name: (
|
|
1370
|
-
platform:
|
|
1371
|
-
url: (
|
|
1446
|
+
name: (c == null ? void 0 : c.name) || "Custom",
|
|
1447
|
+
platform: i,
|
|
1448
|
+
url: (c == null ? void 0 : c.defaultUrl) || "",
|
|
1372
1449
|
streamKey: "",
|
|
1373
1450
|
enabled: !0,
|
|
1374
1451
|
status: "idle"
|
|
1375
1452
|
};
|
|
1376
|
-
|
|
1377
|
-
},
|
|
1378
|
-
|
|
1379
|
-
destinations: s.destinations.map((
|
|
1453
|
+
_({ destinations: [...s.destinations, l] }), W(!1);
|
|
1454
|
+
}, Y = (i, c) => {
|
|
1455
|
+
_({
|
|
1456
|
+
destinations: s.destinations.map((l) => l.id === i ? { ...l, ...c } : l)
|
|
1380
1457
|
});
|
|
1381
|
-
},
|
|
1382
|
-
|
|
1383
|
-
},
|
|
1384
|
-
const
|
|
1458
|
+
}, q = (i) => {
|
|
1459
|
+
_({ destinations: s.destinations.filter((c) => c.id !== i) });
|
|
1460
|
+
}, X = async (i) => {
|
|
1461
|
+
const c = ce.find((o) => o.type === i), l = {
|
|
1385
1462
|
id: $(),
|
|
1386
|
-
type:
|
|
1387
|
-
name: `${(
|
|
1463
|
+
type: i,
|
|
1464
|
+
name: `${(c == null ? void 0 : c.name) || i} ${s.sources.filter((o) => o.type === i).length + 1}`,
|
|
1388
1465
|
settings: {},
|
|
1389
1466
|
volume: 1,
|
|
1390
1467
|
muted: !1
|
|
1391
1468
|
};
|
|
1392
1469
|
try {
|
|
1393
|
-
if (
|
|
1394
|
-
const
|
|
1395
|
-
(
|
|
1470
|
+
if (i === "camera" || i === "microphone") {
|
|
1471
|
+
const o = i === "camera" ? { video: !0 } : { audio: !0 }, d = (await navigator.mediaDevices.enumerateDevices()).filter(
|
|
1472
|
+
(u) => i === "camera" ? u.kind === "videoinput" : u.kind === "audioinput"
|
|
1396
1473
|
);
|
|
1397
|
-
|
|
1398
|
-
} else (
|
|
1399
|
-
} catch (
|
|
1400
|
-
console.warn(`Could not access ${
|
|
1474
|
+
d.length > 0 && (l.settings.deviceId = d[0].deviceId);
|
|
1475
|
+
} else (i === "screen" || i === "window") && await navigator.mediaDevices.getDisplayMedia({ video: !0 });
|
|
1476
|
+
} catch (o) {
|
|
1477
|
+
console.warn(`Could not access ${i}:`, o);
|
|
1401
1478
|
}
|
|
1402
|
-
|
|
1403
|
-
const
|
|
1479
|
+
_({ sources: [...s.sources, l] });
|
|
1480
|
+
const a = {
|
|
1404
1481
|
id: $(),
|
|
1405
|
-
sourceId:
|
|
1482
|
+
sourceId: l.id,
|
|
1406
1483
|
position: { x: 0, y: 0 },
|
|
1407
1484
|
size: { width: s.layout.canvas.width, height: s.layout.canvas.height },
|
|
1408
1485
|
visible: !0,
|
|
1409
1486
|
opacity: 1,
|
|
1410
1487
|
zIndex: s.layout.layers.length
|
|
1411
1488
|
};
|
|
1412
|
-
|
|
1489
|
+
_({
|
|
1413
1490
|
layout: {
|
|
1414
1491
|
...s.layout,
|
|
1415
|
-
layers: [...s.layout.layers,
|
|
1492
|
+
layers: [...s.layout.layers, a]
|
|
1416
1493
|
}
|
|
1417
1494
|
}), C(!1);
|
|
1418
|
-
},
|
|
1419
|
-
|
|
1420
|
-
sources: s.sources.map((
|
|
1495
|
+
}, S = (i, c) => {
|
|
1496
|
+
_({
|
|
1497
|
+
sources: s.sources.map((l) => l.id === i ? { ...l, ...c } : l)
|
|
1421
1498
|
});
|
|
1422
|
-
},
|
|
1423
|
-
|
|
1424
|
-
sources: s.sources.filter((
|
|
1499
|
+
}, Z = (i) => {
|
|
1500
|
+
_({
|
|
1501
|
+
sources: s.sources.filter((c) => c.id !== i),
|
|
1425
1502
|
layout: {
|
|
1426
1503
|
...s.layout,
|
|
1427
|
-
layers: s.layout.layers.filter((
|
|
1504
|
+
layers: s.layout.layers.filter((c) => c.sourceId !== i)
|
|
1428
1505
|
}
|
|
1429
1506
|
});
|
|
1430
|
-
},
|
|
1431
|
-
|
|
1507
|
+
}, P = (i, c) => {
|
|
1508
|
+
_({
|
|
1432
1509
|
layout: {
|
|
1433
1510
|
...s.layout,
|
|
1434
|
-
layers: s.layout.layers.map((
|
|
1511
|
+
layers: s.layout.layers.map((l) => l.id === i ? { ...l, ...c } : l)
|
|
1435
1512
|
}
|
|
1436
1513
|
});
|
|
1437
|
-
},
|
|
1438
|
-
const
|
|
1439
|
-
if (
|
|
1440
|
-
const
|
|
1441
|
-
[
|
|
1442
|
-
|
|
1443
|
-
}),
|
|
1514
|
+
}, ne = (i) => {
|
|
1515
|
+
const c = s.layout.layers.findIndex((l) => l.id === i);
|
|
1516
|
+
if (c < s.layout.layers.length - 1) {
|
|
1517
|
+
const l = [...s.layout.layers];
|
|
1518
|
+
[l[c], l[c + 1]] = [l[c + 1], l[c]], l.forEach((a, o) => {
|
|
1519
|
+
a.zIndex = o;
|
|
1520
|
+
}), _({ layout: { ...s.layout, layers: l } });
|
|
1444
1521
|
}
|
|
1445
|
-
},
|
|
1446
|
-
const
|
|
1447
|
-
if (
|
|
1448
|
-
const
|
|
1449
|
-
[
|
|
1450
|
-
|
|
1451
|
-
}),
|
|
1522
|
+
}, ae = (i) => {
|
|
1523
|
+
const c = s.layout.layers.findIndex((l) => l.id === i);
|
|
1524
|
+
if (c > 0) {
|
|
1525
|
+
const l = [...s.layout.layers];
|
|
1526
|
+
[l[c], l[c - 1]] = [l[c - 1], l[c]], l.forEach((a, o) => {
|
|
1527
|
+
a.zIndex = o;
|
|
1528
|
+
}), _({ layout: { ...s.layout, layers: l } });
|
|
1452
1529
|
}
|
|
1453
|
-
},
|
|
1454
|
-
const
|
|
1455
|
-
name: `Scene ${
|
|
1530
|
+
}, J = () => {
|
|
1531
|
+
const i = {
|
|
1532
|
+
name: `Scene ${z.length + 1}`,
|
|
1456
1533
|
canvas: { ...s.layout.canvas },
|
|
1457
1534
|
layers: []
|
|
1458
1535
|
};
|
|
1459
|
-
|
|
1460
|
-
},
|
|
1461
|
-
const
|
|
1462
|
-
|
|
1463
|
-
},
|
|
1536
|
+
T([...z, i]);
|
|
1537
|
+
}, Q = (i) => {
|
|
1538
|
+
const c = [...z];
|
|
1539
|
+
c[U] = s.layout, T(c), ie(i), _({ layout: z[i] });
|
|
1540
|
+
}, ee = async () => {
|
|
1464
1541
|
try {
|
|
1465
|
-
|
|
1542
|
+
_({
|
|
1466
1543
|
destinations: s.destinations.map(
|
|
1467
|
-
(
|
|
1544
|
+
(i) => i.enabled ? { ...i, status: "connecting" } : i
|
|
1468
1545
|
)
|
|
1469
|
-
}), await new Promise((
|
|
1546
|
+
}), await new Promise((i) => setTimeout(i, 2e3)), _({
|
|
1470
1547
|
destinations: s.destinations.map(
|
|
1471
|
-
(
|
|
1548
|
+
(i) => i.enabled ? { ...i, status: "live" } : i
|
|
1472
1549
|
)
|
|
1473
|
-
}), k(!0),
|
|
1474
|
-
const
|
|
1475
|
-
duration: (Date.now() -
|
|
1476
|
-
viewers: Math.floor(Math.random() * 100) +
|
|
1477
|
-
peakViewers: Math.max(
|
|
1550
|
+
}), k(!0), f.current = Date.now(), F == null || F(), x.current = setInterval(() => {
|
|
1551
|
+
const i = {
|
|
1552
|
+
duration: (Date.now() - f.current) / 1e3,
|
|
1553
|
+
viewers: Math.floor(Math.random() * 100) + N.viewers,
|
|
1554
|
+
peakViewers: Math.max(N.peakViewers, N.viewers),
|
|
1478
1555
|
bitrate: s.settings.video.bitrate + Math.floor(Math.random() * 500 - 250),
|
|
1479
1556
|
fps: s.settings.video.frameRate - Math.random() * 2,
|
|
1480
|
-
droppedFrames:
|
|
1557
|
+
droppedFrames: N.droppedFrames + (Math.random() > 0.95 ? 1 : 0),
|
|
1481
1558
|
cpuUsage: 15 + Math.random() * 30,
|
|
1482
1559
|
memoryUsage: 40 + Math.random() * 20
|
|
1483
1560
|
};
|
|
1484
|
-
D(
|
|
1561
|
+
D(i), O == null || O(i);
|
|
1485
1562
|
}, 1e3);
|
|
1486
|
-
} catch (
|
|
1487
|
-
|
|
1488
|
-
destinations: s.destinations.map((
|
|
1489
|
-
...
|
|
1563
|
+
} catch (i) {
|
|
1564
|
+
I == null || I(i instanceof Error ? i : new Error("Failed to start stream")), _({
|
|
1565
|
+
destinations: s.destinations.map((c) => ({
|
|
1566
|
+
...c,
|
|
1490
1567
|
status: "error"
|
|
1491
1568
|
}))
|
|
1492
1569
|
});
|
|
1493
1570
|
}
|
|
1494
|
-
},
|
|
1495
|
-
|
|
1496
|
-
destinations: s.destinations.map((
|
|
1497
|
-
}), k(!1),
|
|
1498
|
-
},
|
|
1499
|
-
const
|
|
1500
|
-
return `${
|
|
1501
|
-
},
|
|
1502
|
-
switch (
|
|
1571
|
+
}, j = () => {
|
|
1572
|
+
x.current && clearInterval(x.current), _({
|
|
1573
|
+
destinations: s.destinations.map((i) => ({ ...i, status: "idle" }))
|
|
1574
|
+
}), k(!1), L == null || L();
|
|
1575
|
+
}, se = (i) => {
|
|
1576
|
+
const c = Math.floor(i / 3600), l = Math.floor(i % 3600 / 60), a = Math.floor(i % 60);
|
|
1577
|
+
return `${c.toString().padStart(2, "0")}:${l.toString().padStart(2, "0")}:${a.toString().padStart(2, "0")}`;
|
|
1578
|
+
}, re = (i) => {
|
|
1579
|
+
switch (i) {
|
|
1503
1580
|
case "live":
|
|
1504
1581
|
return "var(--nice-success, #00ff00)";
|
|
1505
1582
|
case "connecting":
|
|
@@ -1510,258 +1587,273 @@ const fe = {
|
|
|
1510
1587
|
return "var(--nice-text-secondary, #888888)";
|
|
1511
1588
|
}
|
|
1512
1589
|
};
|
|
1513
|
-
return /* @__PURE__ */ t("div", { className: `nice-live-streaming ${
|
|
1514
|
-
/* @__PURE__ */ t("header", { className: "streaming__header", children: [
|
|
1515
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1590
|
+
return /* @__PURE__ */ t("div", { className: `nice-live-streaming ${b}`, children: [
|
|
1591
|
+
/* @__PURE__ */ t("header", { className: "nice-live-streaming__header", children: [
|
|
1592
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__header-title", children: [
|
|
1516
1593
|
/* @__PURE__ */ e(
|
|
1517
1594
|
"input",
|
|
1518
1595
|
{
|
|
1519
1596
|
type: "text",
|
|
1520
1597
|
value: s.name,
|
|
1521
|
-
onChange: (
|
|
1522
|
-
className: "
|
|
1598
|
+
onChange: (i) => _({ name: i.target.value }),
|
|
1599
|
+
className: "nice-live-streaming__stream-name-input"
|
|
1523
1600
|
}
|
|
1524
1601
|
),
|
|
1525
|
-
|
|
1526
|
-
/* @__PURE__ */ e("span", { className: "live-dot" }),
|
|
1527
|
-
"
|
|
1602
|
+
v && /* @__PURE__ */ t("span", { className: "nice-live-streaming__live-badge", children: [
|
|
1603
|
+
/* @__PURE__ */ e("span", { className: "nice-live-streaming__live-dot" }),
|
|
1604
|
+
" ",
|
|
1605
|
+
r("liveStreaming.live", "LIVE")
|
|
1528
1606
|
] })
|
|
1529
1607
|
] }),
|
|
1530
|
-
/* @__PURE__ */ e("div", { className: "
|
|
1531
|
-
/* @__PURE__ */ t("span", { className: "
|
|
1532
|
-
/* @__PURE__ */ e(
|
|
1608
|
+
/* @__PURE__ */ e("div", { className: "nice-live-streaming__header-stats", children: v && /* @__PURE__ */ t(oe, { children: [
|
|
1609
|
+
/* @__PURE__ */ t("span", { className: "nice-live-streaming__stat-item", children: [
|
|
1610
|
+
/* @__PURE__ */ e(m, { name: "clock", size: 14 }),
|
|
1533
1611
|
" ",
|
|
1534
|
-
|
|
1612
|
+
se(N.duration)
|
|
1535
1613
|
] }),
|
|
1536
|
-
/* @__PURE__ */ t("span", { className: "
|
|
1537
|
-
/* @__PURE__ */ e(
|
|
1614
|
+
/* @__PURE__ */ t("span", { className: "nice-live-streaming__stat-item", children: [
|
|
1615
|
+
/* @__PURE__ */ e(m, { name: "users", size: 14 }),
|
|
1538
1616
|
" ",
|
|
1539
|
-
|
|
1617
|
+
N.viewers
|
|
1540
1618
|
] }),
|
|
1541
|
-
/* @__PURE__ */ t("span", { className: "
|
|
1542
|
-
/* @__PURE__ */ e(
|
|
1619
|
+
/* @__PURE__ */ t("span", { className: "nice-live-streaming__stat-item", children: [
|
|
1620
|
+
/* @__PURE__ */ e(m, { name: "bar-chart", size: 14 }),
|
|
1543
1621
|
" ",
|
|
1544
|
-
Math.round(
|
|
1622
|
+
Math.round(N.bitrate),
|
|
1545
1623
|
" kbps"
|
|
1546
1624
|
] }),
|
|
1547
|
-
/* @__PURE__ */ t("span", { className: "
|
|
1548
|
-
/* @__PURE__ */ e(
|
|
1625
|
+
/* @__PURE__ */ t("span", { className: "nice-live-streaming__stat-item", children: [
|
|
1626
|
+
/* @__PURE__ */ e(m, { name: "video", size: 14 }),
|
|
1549
1627
|
" ",
|
|
1550
|
-
|
|
1628
|
+
N.fps.toFixed(1),
|
|
1551
1629
|
" fps"
|
|
1552
1630
|
] })
|
|
1553
1631
|
] }) }),
|
|
1554
|
-
/* @__PURE__ */ e("div", { className: "
|
|
1632
|
+
/* @__PURE__ */ e("div", { className: "nice-live-streaming__header-actions", children: v ? /* @__PURE__ */ e(
|
|
1633
|
+
"button",
|
|
1634
|
+
{
|
|
1635
|
+
className: "nice-live-streaming__action-button nice-live-streaming__action-button--stop",
|
|
1636
|
+
onClick: j,
|
|
1637
|
+
children: r("liveStreaming.endStream", "End Stream")
|
|
1638
|
+
}
|
|
1639
|
+
) : /* @__PURE__ */ e(
|
|
1555
1640
|
"button",
|
|
1556
1641
|
{
|
|
1557
|
-
className: "
|
|
1558
|
-
onClick:
|
|
1559
|
-
disabled: s.destinations.filter((
|
|
1560
|
-
children: "Go Live"
|
|
1642
|
+
className: "nice-live-streaming__action-button nice-live-streaming__action-button--go-live",
|
|
1643
|
+
onClick: ee,
|
|
1644
|
+
disabled: s.destinations.filter((i) => i.enabled).length === 0,
|
|
1645
|
+
children: r("liveStreaming.goLive", "Go Live")
|
|
1561
1646
|
}
|
|
1562
1647
|
) })
|
|
1563
1648
|
] }),
|
|
1564
|
-
/* @__PURE__ */ t("div", { className: "streaming__main", children: [
|
|
1565
|
-
/* @__PURE__ */ t("div", { className: "streaming__preview", children: [
|
|
1566
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1567
|
-
|
|
1649
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__main", children: [
|
|
1650
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__preview", children: [
|
|
1651
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__scenes-bar", children: [
|
|
1652
|
+
z.map((i, c) => /* @__PURE__ */ e(
|
|
1568
1653
|
"button",
|
|
1569
1654
|
{
|
|
1570
|
-
className: `
|
|
1571
|
-
onClick: () =>
|
|
1572
|
-
children:
|
|
1655
|
+
className: `nice-live-streaming__scene-button ${U === c ? "nice-live-streaming__scene-button--active" : ""}`,
|
|
1656
|
+
onClick: () => Q(c),
|
|
1657
|
+
children: i.name
|
|
1573
1658
|
},
|
|
1574
|
-
|
|
1659
|
+
c
|
|
1575
1660
|
)),
|
|
1576
|
-
/* @__PURE__ */ e(
|
|
1661
|
+
/* @__PURE__ */ e(
|
|
1662
|
+
"button",
|
|
1663
|
+
{
|
|
1664
|
+
className: "nice-live-streaming__scene-button nice-live-streaming__scene-button--add",
|
|
1665
|
+
onClick: J,
|
|
1666
|
+
children: "+"
|
|
1667
|
+
}
|
|
1668
|
+
)
|
|
1577
1669
|
] }),
|
|
1578
1670
|
/* @__PURE__ */ e(
|
|
1579
1671
|
"div",
|
|
1580
1672
|
{
|
|
1581
|
-
ref:
|
|
1582
|
-
className: "
|
|
1673
|
+
ref: te,
|
|
1674
|
+
className: "nice-live-streaming__preview-canvas",
|
|
1583
1675
|
style: {
|
|
1584
1676
|
aspectRatio: `${s.layout.canvas.width}/${s.layout.canvas.height}`,
|
|
1585
1677
|
backgroundColor: s.layout.canvas.backgroundColor
|
|
1586
1678
|
},
|
|
1587
|
-
children: s.layout.layers.sort((
|
|
1588
|
-
var
|
|
1589
|
-
const
|
|
1590
|
-
return !
|
|
1679
|
+
children: s.layout.layers.sort((i, c) => i.zIndex - c.zIndex).map((i) => {
|
|
1680
|
+
var l;
|
|
1681
|
+
const c = s.sources.find((a) => a.id === i.sourceId);
|
|
1682
|
+
return !i.visible || !c ? null : /* @__PURE__ */ e(
|
|
1591
1683
|
"div",
|
|
1592
1684
|
{
|
|
1593
|
-
className: `
|
|
1685
|
+
className: `nice-live-streaming__canvas-layer ${w === i.id ? "nice-live-streaming__canvas-layer--selected" : ""}`,
|
|
1594
1686
|
style: {
|
|
1595
|
-
left: `${
|
|
1596
|
-
top: `${
|
|
1597
|
-
width: `${
|
|
1598
|
-
height: `${
|
|
1599
|
-
opacity:
|
|
1600
|
-
zIndex:
|
|
1687
|
+
left: `${i.position.x / s.layout.canvas.width * 100}%`,
|
|
1688
|
+
top: `${i.position.y / s.layout.canvas.height * 100}%`,
|
|
1689
|
+
width: `${i.size.width / s.layout.canvas.width * 100}%`,
|
|
1690
|
+
height: `${i.size.height / s.layout.canvas.height * 100}%`,
|
|
1691
|
+
opacity: i.opacity,
|
|
1692
|
+
zIndex: i.zIndex
|
|
1601
1693
|
},
|
|
1602
|
-
onClick: () =>
|
|
1603
|
-
children: /* @__PURE__ */ t("div", { className: "
|
|
1604
|
-
/* @__PURE__ */ e("span", { className: "
|
|
1605
|
-
|
|
1694
|
+
onClick: () => B(i.id),
|
|
1695
|
+
children: /* @__PURE__ */ t("div", { className: "nice-live-streaming__layer-content", children: [
|
|
1696
|
+
/* @__PURE__ */ e("span", { className: "nice-live-streaming__layer-icon", children: /* @__PURE__ */ e(
|
|
1697
|
+
m,
|
|
1606
1698
|
{
|
|
1607
|
-
name: ((
|
|
1699
|
+
name: ((l = ce.find((a) => a.type === c.type)) == null ? void 0 : l.icon) ?? "box",
|
|
1608
1700
|
size: 16
|
|
1609
1701
|
}
|
|
1610
1702
|
) }),
|
|
1611
|
-
/* @__PURE__ */ e("span", { className: "
|
|
1703
|
+
/* @__PURE__ */ e("span", { className: "nice-live-streaming__layer-name", children: c.name })
|
|
1612
1704
|
] })
|
|
1613
1705
|
},
|
|
1614
|
-
|
|
1706
|
+
i.id
|
|
1615
1707
|
);
|
|
1616
1708
|
})
|
|
1617
1709
|
}
|
|
1618
1710
|
)
|
|
1619
1711
|
] }),
|
|
1620
|
-
/* @__PURE__ */ t("aside", { className: "streaming__panel", children: [
|
|
1621
|
-
/* @__PURE__ */ e("div", { className: "
|
|
1712
|
+
/* @__PURE__ */ t("aside", { className: "nice-live-streaming__panel", children: [
|
|
1713
|
+
/* @__PURE__ */ e("div", { className: "nice-live-streaming__panel-tabs", children: ["sources", "audio", "destinations", "settings"].map((i) => /* @__PURE__ */ e(
|
|
1622
1714
|
"button",
|
|
1623
1715
|
{
|
|
1624
|
-
className: `
|
|
1625
|
-
onClick: () => H(
|
|
1626
|
-
children:
|
|
1716
|
+
className: `nice-live-streaming__panel-tab ${y === i ? "nice-live-streaming__panel-tab--active" : ""}`,
|
|
1717
|
+
onClick: () => H(i),
|
|
1718
|
+
children: i.charAt(0).toUpperCase() + i.slice(1)
|
|
1627
1719
|
},
|
|
1628
|
-
|
|
1720
|
+
i
|
|
1629
1721
|
)) }),
|
|
1630
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1631
|
-
|
|
1632
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1633
|
-
/* @__PURE__ */ e("h3", { children: "Sources" }),
|
|
1722
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__panel-content", children: [
|
|
1723
|
+
y === "sources" && /* @__PURE__ */ t("div", { className: "nice-live-streaming__sources-panel", children: [
|
|
1724
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__panel-header", children: [
|
|
1725
|
+
/* @__PURE__ */ e("h3", { children: r("liveStreaming.sources", "Sources") }),
|
|
1634
1726
|
/* @__PURE__ */ e(
|
|
1635
1727
|
"button",
|
|
1636
1728
|
{
|
|
1637
|
-
className: "
|
|
1729
|
+
className: "nice-live-streaming__add-button",
|
|
1638
1730
|
onClick: () => C(!0),
|
|
1639
|
-
disabled:
|
|
1731
|
+
disabled: v,
|
|
1640
1732
|
children: "+ Add"
|
|
1641
1733
|
}
|
|
1642
1734
|
)
|
|
1643
1735
|
] }),
|
|
1644
|
-
/* @__PURE__ */ e("div", { className: "
|
|
1645
|
-
var
|
|
1646
|
-
const
|
|
1736
|
+
/* @__PURE__ */ e("div", { className: "nice-live-streaming__sources-list", children: s.sources.filter((i) => i.type !== "microphone" && i.type !== "system-audio").map((i) => {
|
|
1737
|
+
var l;
|
|
1738
|
+
const c = s.layout.layers.find((a) => a.sourceId === i.id);
|
|
1647
1739
|
return /* @__PURE__ */ t(
|
|
1648
1740
|
"div",
|
|
1649
1741
|
{
|
|
1650
|
-
className: `
|
|
1651
|
-
onClick: () =>
|
|
1742
|
+
className: `nice-live-streaming__source-item ${w === (c == null ? void 0 : c.id) ? "nice-live-streaming__source-item--selected" : ""}`,
|
|
1743
|
+
onClick: () => c && B(c.id),
|
|
1652
1744
|
children: [
|
|
1653
|
-
/* @__PURE__ */ e("span", { className: "
|
|
1654
|
-
|
|
1745
|
+
/* @__PURE__ */ e("span", { className: "nice-live-streaming__source-icon", children: /* @__PURE__ */ e(
|
|
1746
|
+
m,
|
|
1655
1747
|
{
|
|
1656
|
-
name: ((
|
|
1748
|
+
name: ((l = ce.find((a) => a.type === i.type)) == null ? void 0 : l.icon) ?? "box",
|
|
1657
1749
|
size: 16
|
|
1658
1750
|
}
|
|
1659
1751
|
) }),
|
|
1660
|
-
/* @__PURE__ */ e("span", { className: "
|
|
1661
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1752
|
+
/* @__PURE__ */ e("span", { className: "nice-live-streaming__source-name", children: i.name }),
|
|
1753
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__source-controls", children: [
|
|
1662
1754
|
/* @__PURE__ */ e(
|
|
1663
1755
|
"button",
|
|
1664
1756
|
{
|
|
1665
|
-
className:
|
|
1666
|
-
onClick: (
|
|
1667
|
-
|
|
1757
|
+
className: `nice-live-streaming__visibility-toggle ${c != null && c.visible ? "" : "nice-live-streaming__visibility-toggle--hidden"}`,
|
|
1758
|
+
onClick: (a) => {
|
|
1759
|
+
a.stopPropagation(), c && P(c.id, { visible: !c.visible });
|
|
1668
1760
|
},
|
|
1669
|
-
children: /* @__PURE__ */ e(
|
|
1761
|
+
children: /* @__PURE__ */ e(m, { name: c != null && c.visible ? "eye" : "eye-off", size: 14 })
|
|
1670
1762
|
}
|
|
1671
1763
|
),
|
|
1672
1764
|
/* @__PURE__ */ e(
|
|
1673
1765
|
"button",
|
|
1674
1766
|
{
|
|
1675
|
-
onClick: (
|
|
1676
|
-
|
|
1767
|
+
onClick: (a) => {
|
|
1768
|
+
a.stopPropagation(), c && ne(c.id);
|
|
1677
1769
|
},
|
|
1678
|
-
children: /* @__PURE__ */ e(
|
|
1770
|
+
children: /* @__PURE__ */ e(m, { name: "arrow-up", size: 14 })
|
|
1679
1771
|
}
|
|
1680
1772
|
),
|
|
1681
1773
|
/* @__PURE__ */ e(
|
|
1682
1774
|
"button",
|
|
1683
1775
|
{
|
|
1684
|
-
onClick: (
|
|
1685
|
-
|
|
1776
|
+
onClick: (a) => {
|
|
1777
|
+
a.stopPropagation(), c && ae(c.id);
|
|
1686
1778
|
},
|
|
1687
|
-
children: /* @__PURE__ */ e(
|
|
1779
|
+
children: /* @__PURE__ */ e(m, { name: "arrow-down", size: 14 })
|
|
1688
1780
|
}
|
|
1689
1781
|
),
|
|
1690
1782
|
/* @__PURE__ */ e(
|
|
1691
1783
|
"button",
|
|
1692
1784
|
{
|
|
1693
|
-
onClick: (
|
|
1694
|
-
|
|
1785
|
+
onClick: (a) => {
|
|
1786
|
+
a.stopPropagation(), Z(i.id);
|
|
1695
1787
|
},
|
|
1696
|
-
disabled:
|
|
1697
|
-
children: /* @__PURE__ */ e(
|
|
1788
|
+
disabled: v,
|
|
1789
|
+
children: /* @__PURE__ */ e(m, { name: "trash", size: 14 })
|
|
1698
1790
|
}
|
|
1699
1791
|
)
|
|
1700
1792
|
] })
|
|
1701
1793
|
]
|
|
1702
1794
|
},
|
|
1703
|
-
|
|
1795
|
+
i.id
|
|
1704
1796
|
);
|
|
1705
1797
|
}) }),
|
|
1706
|
-
w && /* @__PURE__ */ t("div", { className: "
|
|
1707
|
-
/* @__PURE__ */ e("h4", { children: "Properties" }),
|
|
1798
|
+
w && /* @__PURE__ */ t("div", { className: "nice-live-streaming__layer-properties", children: [
|
|
1799
|
+
/* @__PURE__ */ e("h4", { children: r("liveStreaming.properties", "Properties") }),
|
|
1708
1800
|
(() => {
|
|
1709
|
-
const
|
|
1710
|
-
return
|
|
1801
|
+
const i = s.layout.layers.find((c) => c.id === w);
|
|
1802
|
+
return i ? /* @__PURE__ */ t(oe, { children: [
|
|
1711
1803
|
/* @__PURE__ */ t("label", { children: [
|
|
1712
|
-
"X Position",
|
|
1804
|
+
r("liveStreaming.xPosition", "X Position"),
|
|
1713
1805
|
/* @__PURE__ */ e(
|
|
1714
1806
|
"input",
|
|
1715
1807
|
{
|
|
1716
1808
|
type: "number",
|
|
1717
|
-
value:
|
|
1718
|
-
onChange: (
|
|
1719
|
-
position: { ...
|
|
1809
|
+
value: i.position.x,
|
|
1810
|
+
onChange: (c) => P(i.id, {
|
|
1811
|
+
position: { ...i.position, x: parseInt(c.target.value) || 0 }
|
|
1720
1812
|
})
|
|
1721
1813
|
}
|
|
1722
1814
|
)
|
|
1723
1815
|
] }),
|
|
1724
1816
|
/* @__PURE__ */ t("label", { children: [
|
|
1725
|
-
"Y Position",
|
|
1817
|
+
r("liveStreaming.yPosition", "Y Position"),
|
|
1726
1818
|
/* @__PURE__ */ e(
|
|
1727
1819
|
"input",
|
|
1728
1820
|
{
|
|
1729
1821
|
type: "number",
|
|
1730
|
-
value:
|
|
1731
|
-
onChange: (
|
|
1732
|
-
position: { ...
|
|
1822
|
+
value: i.position.y,
|
|
1823
|
+
onChange: (c) => P(i.id, {
|
|
1824
|
+
position: { ...i.position, y: parseInt(c.target.value) || 0 }
|
|
1733
1825
|
})
|
|
1734
1826
|
}
|
|
1735
1827
|
)
|
|
1736
1828
|
] }),
|
|
1737
1829
|
/* @__PURE__ */ t("label", { children: [
|
|
1738
|
-
"Width",
|
|
1830
|
+
r("liveStreaming.width", "Width"),
|
|
1739
1831
|
/* @__PURE__ */ e(
|
|
1740
1832
|
"input",
|
|
1741
1833
|
{
|
|
1742
1834
|
type: "number",
|
|
1743
|
-
value:
|
|
1744
|
-
onChange: (
|
|
1745
|
-
size: { ...
|
|
1835
|
+
value: i.size.width,
|
|
1836
|
+
onChange: (c) => P(i.id, {
|
|
1837
|
+
size: { ...i.size, width: parseInt(c.target.value) || 100 }
|
|
1746
1838
|
})
|
|
1747
1839
|
}
|
|
1748
1840
|
)
|
|
1749
1841
|
] }),
|
|
1750
1842
|
/* @__PURE__ */ t("label", { children: [
|
|
1751
|
-
"Height",
|
|
1843
|
+
r("liveStreaming.height", "Height"),
|
|
1752
1844
|
/* @__PURE__ */ e(
|
|
1753
1845
|
"input",
|
|
1754
1846
|
{
|
|
1755
1847
|
type: "number",
|
|
1756
|
-
value:
|
|
1757
|
-
onChange: (
|
|
1758
|
-
size: { ...
|
|
1848
|
+
value: i.size.height,
|
|
1849
|
+
onChange: (c) => P(i.id, {
|
|
1850
|
+
size: { ...i.size, height: parseInt(c.target.value) || 100 }
|
|
1759
1851
|
})
|
|
1760
1852
|
}
|
|
1761
1853
|
)
|
|
1762
1854
|
] }),
|
|
1763
1855
|
/* @__PURE__ */ t("label", { children: [
|
|
1764
|
-
"Opacity",
|
|
1856
|
+
r("liveStreaming.opacity", "Opacity"),
|
|
1765
1857
|
/* @__PURE__ */ e(
|
|
1766
1858
|
"input",
|
|
1767
1859
|
{
|
|
@@ -1769,9 +1861,9 @@ const fe = {
|
|
|
1769
1861
|
min: "0",
|
|
1770
1862
|
max: "1",
|
|
1771
1863
|
step: "0.1",
|
|
1772
|
-
value:
|
|
1773
|
-
onChange: (
|
|
1774
|
-
opacity: parseFloat(
|
|
1864
|
+
value: i.opacity,
|
|
1865
|
+
onChange: (c) => P(i.id, {
|
|
1866
|
+
opacity: parseFloat(c.target.value)
|
|
1775
1867
|
})
|
|
1776
1868
|
}
|
|
1777
1869
|
)
|
|
@@ -1780,46 +1872,46 @@ const fe = {
|
|
|
1780
1872
|
})()
|
|
1781
1873
|
] })
|
|
1782
1874
|
] }),
|
|
1783
|
-
|
|
1784
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1785
|
-
/* @__PURE__ */ e("h3", { children: "Audio Mixer" }),
|
|
1875
|
+
y === "audio" && /* @__PURE__ */ t("div", { className: "nice-live-streaming__audio-panel", children: [
|
|
1876
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__panel-header", children: [
|
|
1877
|
+
/* @__PURE__ */ e("h3", { children: r("liveStreaming.audioMixer", "Audio Mixer") }),
|
|
1786
1878
|
/* @__PURE__ */ e(
|
|
1787
1879
|
"button",
|
|
1788
1880
|
{
|
|
1789
|
-
className: "
|
|
1881
|
+
className: "nice-live-streaming__add-button",
|
|
1790
1882
|
onClick: () => {
|
|
1791
1883
|
C(!0);
|
|
1792
1884
|
},
|
|
1793
|
-
disabled:
|
|
1885
|
+
disabled: v,
|
|
1794
1886
|
children: "+ Add"
|
|
1795
1887
|
}
|
|
1796
1888
|
)
|
|
1797
1889
|
] }),
|
|
1798
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1890
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__audio-sources", children: [
|
|
1799
1891
|
s.sources.filter(
|
|
1800
|
-
(
|
|
1801
|
-
).map((
|
|
1802
|
-
var
|
|
1803
|
-
return /* @__PURE__ */ t("div", { className: "
|
|
1804
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1805
|
-
/* @__PURE__ */ e("span", { className: "
|
|
1806
|
-
|
|
1892
|
+
(i) => i.type === "microphone" || i.type === "system-audio" || i.type === "video"
|
|
1893
|
+
).map((i) => {
|
|
1894
|
+
var c;
|
|
1895
|
+
return /* @__PURE__ */ t("div", { className: "nice-live-streaming__audio-source", children: [
|
|
1896
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__audio-header", children: [
|
|
1897
|
+
/* @__PURE__ */ e("span", { className: "nice-live-streaming__audio-icon", children: /* @__PURE__ */ e(
|
|
1898
|
+
m,
|
|
1807
1899
|
{
|
|
1808
|
-
name: ((
|
|
1900
|
+
name: ((c = ce.find((l) => l.type === i.type)) == null ? void 0 : c.icon) ?? "box",
|
|
1809
1901
|
size: 16
|
|
1810
1902
|
}
|
|
1811
1903
|
) }),
|
|
1812
|
-
/* @__PURE__ */ e("span", { className: "
|
|
1904
|
+
/* @__PURE__ */ e("span", { className: "nice-live-streaming__audio-name", children: i.name }),
|
|
1813
1905
|
/* @__PURE__ */ e(
|
|
1814
1906
|
"button",
|
|
1815
1907
|
{
|
|
1816
|
-
className:
|
|
1817
|
-
onClick: () =>
|
|
1818
|
-
children: /* @__PURE__ */ e(
|
|
1908
|
+
className: `nice-live-streaming__mute-toggle ${i.muted ? "nice-live-streaming__mute-toggle--muted" : ""}`,
|
|
1909
|
+
onClick: () => S(i.id, { muted: !i.muted }),
|
|
1910
|
+
children: /* @__PURE__ */ e(m, { name: i.muted ? "volume-off" : "volume", size: 14 })
|
|
1819
1911
|
}
|
|
1820
1912
|
)
|
|
1821
1913
|
] }),
|
|
1822
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1914
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__audio-slider", children: [
|
|
1823
1915
|
/* @__PURE__ */ e(
|
|
1824
1916
|
"input",
|
|
1825
1917
|
{
|
|
@@ -1827,100 +1919,100 @@ const fe = {
|
|
|
1827
1919
|
min: "0",
|
|
1828
1920
|
max: "1",
|
|
1829
1921
|
step: "0.01",
|
|
1830
|
-
value:
|
|
1831
|
-
onChange: (
|
|
1832
|
-
disabled:
|
|
1922
|
+
value: i.volume ?? 1,
|
|
1923
|
+
onChange: (l) => S(i.id, { volume: parseFloat(l.target.value) }),
|
|
1924
|
+
disabled: i.muted
|
|
1833
1925
|
}
|
|
1834
1926
|
),
|
|
1835
|
-
/* @__PURE__ */ t("span", { className: "
|
|
1836
|
-
Math.round((
|
|
1927
|
+
/* @__PURE__ */ t("span", { className: "nice-live-streaming__volume-value", children: [
|
|
1928
|
+
Math.round((i.volume ?? 1) * 100),
|
|
1837
1929
|
"%"
|
|
1838
1930
|
] })
|
|
1839
1931
|
] }),
|
|
1840
|
-
/* @__PURE__ */ e("div", { className: "
|
|
1932
|
+
/* @__PURE__ */ e("div", { className: "nice-live-streaming__audio-meter", children: /* @__PURE__ */ e(
|
|
1841
1933
|
"div",
|
|
1842
1934
|
{
|
|
1843
|
-
className: "
|
|
1844
|
-
style: { width: `${(
|
|
1935
|
+
className: "nice-live-streaming__meter-fill",
|
|
1936
|
+
style: { width: `${(i.volume ?? 1) * 70 + Math.random() * 30}%` }
|
|
1845
1937
|
}
|
|
1846
1938
|
) })
|
|
1847
|
-
] },
|
|
1939
|
+
] }, i.id);
|
|
1848
1940
|
}),
|
|
1849
1941
|
s.sources.filter(
|
|
1850
|
-
(
|
|
1851
|
-
).length === 0 && /* @__PURE__ */ e("p", { className: "
|
|
1942
|
+
(i) => i.type === "microphone" || i.type === "system-audio"
|
|
1943
|
+
).length === 0 && /* @__PURE__ */ e("p", { className: "nice-live-streaming__empty-message", children: r("liveStreaming.noAudioSourcesAdded", "No audio sources added") })
|
|
1852
1944
|
] })
|
|
1853
1945
|
] }),
|
|
1854
|
-
|
|
1855
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1856
|
-
/* @__PURE__ */ e("h3", { children: "Destinations" }),
|
|
1946
|
+
y === "destinations" && /* @__PURE__ */ t("div", { className: "nice-live-streaming__destinations-panel", children: [
|
|
1947
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__panel-header", children: [
|
|
1948
|
+
/* @__PURE__ */ e("h3", { children: r("liveStreaming.destinations", "Destinations") }),
|
|
1857
1949
|
/* @__PURE__ */ e(
|
|
1858
1950
|
"button",
|
|
1859
1951
|
{
|
|
1860
|
-
className: "
|
|
1861
|
-
onClick: () =>
|
|
1862
|
-
disabled:
|
|
1952
|
+
className: "nice-live-streaming__add-button",
|
|
1953
|
+
onClick: () => W(!0),
|
|
1954
|
+
disabled: v,
|
|
1863
1955
|
children: "+ Add"
|
|
1864
1956
|
}
|
|
1865
1957
|
)
|
|
1866
1958
|
] }),
|
|
1867
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1868
|
-
s.destinations.map((
|
|
1869
|
-
var
|
|
1870
|
-
return /* @__PURE__ */ t("div", { className: "
|
|
1871
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1959
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__destinations-list", children: [
|
|
1960
|
+
s.destinations.map((i) => {
|
|
1961
|
+
var c;
|
|
1962
|
+
return /* @__PURE__ */ t("div", { className: "nice-live-streaming__destination-item", children: [
|
|
1963
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__destination-header", children: [
|
|
1872
1964
|
/* @__PURE__ */ e(
|
|
1873
1965
|
"span",
|
|
1874
1966
|
{
|
|
1875
|
-
className: "
|
|
1876
|
-
style: { backgroundColor:
|
|
1967
|
+
className: "nice-live-streaming__status-indicator",
|
|
1968
|
+
style: { backgroundColor: re(i.status) }
|
|
1877
1969
|
}
|
|
1878
1970
|
),
|
|
1879
|
-
/* @__PURE__ */ e("span", { className: "
|
|
1880
|
-
|
|
1971
|
+
/* @__PURE__ */ e("span", { className: "nice-live-streaming__destination-icon", children: /* @__PURE__ */ e(
|
|
1972
|
+
m,
|
|
1881
1973
|
{
|
|
1882
|
-
name: ((
|
|
1974
|
+
name: ((c = de.find((l) => l.platform === i.platform)) == null ? void 0 : c.icon) ?? "link",
|
|
1883
1975
|
size: 16
|
|
1884
1976
|
}
|
|
1885
1977
|
) }),
|
|
1886
|
-
/* @__PURE__ */ e("span", { className: "
|
|
1887
|
-
/* @__PURE__ */ t("label", { className: "
|
|
1978
|
+
/* @__PURE__ */ e("span", { className: "nice-live-streaming__destination-name", children: i.name }),
|
|
1979
|
+
/* @__PURE__ */ t("label", { className: "nice-live-streaming__toggle", children: [
|
|
1888
1980
|
/* @__PURE__ */ e(
|
|
1889
1981
|
"input",
|
|
1890
1982
|
{
|
|
1891
1983
|
type: "checkbox",
|
|
1892
|
-
checked:
|
|
1893
|
-
onChange: (
|
|
1894
|
-
disabled:
|
|
1984
|
+
checked: i.enabled,
|
|
1985
|
+
onChange: (l) => Y(i.id, { enabled: l.target.checked }),
|
|
1986
|
+
disabled: v
|
|
1895
1987
|
}
|
|
1896
1988
|
),
|
|
1897
|
-
/* @__PURE__ */ e("span", { className: "
|
|
1989
|
+
/* @__PURE__ */ e("span", { className: "nice-live-streaming__toggle-slider" })
|
|
1898
1990
|
] })
|
|
1899
1991
|
] }),
|
|
1900
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1992
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__destination-config", children: [
|
|
1901
1993
|
/* @__PURE__ */ t("label", { children: [
|
|
1902
|
-
"Server URL",
|
|
1994
|
+
r("liveStreaming.serverUrl", "Server URL"),
|
|
1903
1995
|
/* @__PURE__ */ e(
|
|
1904
1996
|
"input",
|
|
1905
1997
|
{
|
|
1906
1998
|
type: "text",
|
|
1907
|
-
value:
|
|
1908
|
-
onChange: (
|
|
1909
|
-
placeholder: "rtmp://...",
|
|
1910
|
-
disabled:
|
|
1999
|
+
value: i.url,
|
|
2000
|
+
onChange: (l) => Y(i.id, { url: l.target.value }),
|
|
2001
|
+
placeholder: r("liveStreaming.rtmp", "rtmp://..."),
|
|
2002
|
+
disabled: v
|
|
1911
2003
|
}
|
|
1912
2004
|
)
|
|
1913
2005
|
] }),
|
|
1914
2006
|
/* @__PURE__ */ t("label", { children: [
|
|
1915
|
-
"Stream Key",
|
|
2007
|
+
r("liveStreaming.streamKey", "Stream Key"),
|
|
1916
2008
|
/* @__PURE__ */ e(
|
|
1917
2009
|
"input",
|
|
1918
2010
|
{
|
|
1919
2011
|
type: "password",
|
|
1920
|
-
value:
|
|
1921
|
-
onChange: (
|
|
1922
|
-
placeholder: "Enter stream key",
|
|
1923
|
-
disabled:
|
|
2012
|
+
value: i.streamKey || "",
|
|
2013
|
+
onChange: (l) => Y(i.id, { streamKey: l.target.value }),
|
|
2014
|
+
placeholder: r("liveStreaming.enterStreamKey", "Enter stream key"),
|
|
2015
|
+
disabled: v
|
|
1924
2016
|
}
|
|
1925
2017
|
)
|
|
1926
2018
|
] })
|
|
@@ -1928,40 +2020,40 @@ const fe = {
|
|
|
1928
2020
|
/* @__PURE__ */ e(
|
|
1929
2021
|
"button",
|
|
1930
2022
|
{
|
|
1931
|
-
className: "
|
|
1932
|
-
onClick: () =>
|
|
1933
|
-
disabled:
|
|
1934
|
-
children: "Remove"
|
|
2023
|
+
className: "nice-live-streaming__remove-button",
|
|
2024
|
+
onClick: () => q(i.id),
|
|
2025
|
+
disabled: v,
|
|
2026
|
+
children: r("liveStreaming.remove", "Remove")
|
|
1935
2027
|
}
|
|
1936
2028
|
)
|
|
1937
|
-
] },
|
|
2029
|
+
] }, i.id);
|
|
1938
2030
|
}),
|
|
1939
|
-
s.destinations.length === 0 && /* @__PURE__ */ e("p", { className: "
|
|
2031
|
+
s.destinations.length === 0 && /* @__PURE__ */ e("p", { className: "nice-live-streaming__empty-message", children: r("liveStreaming.noDestinationsConfigured", "No destinations configured") })
|
|
1940
2032
|
] })
|
|
1941
2033
|
] }),
|
|
1942
|
-
|
|
1943
|
-
/* @__PURE__ */ t("div", { className: "
|
|
1944
|
-
/* @__PURE__ */ e("h4", { children: "Video" }),
|
|
2034
|
+
y === "settings" && /* @__PURE__ */ t("div", { className: "nice-live-streaming__settings-panel", children: [
|
|
2035
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__setting-section", children: [
|
|
2036
|
+
/* @__PURE__ */ e("h4", { children: r("liveStreaming.video", "Video") }),
|
|
1945
2037
|
/* @__PURE__ */ t("label", { children: [
|
|
1946
|
-
"Resolution",
|
|
2038
|
+
r("liveStreaming.resolution", "Resolution"),
|
|
1947
2039
|
/* @__PURE__ */ t(
|
|
1948
2040
|
"select",
|
|
1949
2041
|
{
|
|
1950
2042
|
value: `${s.settings.video.resolution.width}x${s.settings.video.resolution.height}`,
|
|
1951
|
-
onChange: (
|
|
1952
|
-
const [
|
|
1953
|
-
|
|
2043
|
+
onChange: (i) => {
|
|
2044
|
+
const [c, l] = i.target.value.split("x").map(Number);
|
|
2045
|
+
_({
|
|
1954
2046
|
settings: {
|
|
1955
2047
|
...s.settings,
|
|
1956
|
-
video: { ...s.settings.video, resolution: { width:
|
|
2048
|
+
video: { ...s.settings.video, resolution: { width: c, height: l } }
|
|
1957
2049
|
},
|
|
1958
2050
|
layout: {
|
|
1959
2051
|
...s.layout,
|
|
1960
|
-
canvas: { ...s.layout.canvas, width:
|
|
2052
|
+
canvas: { ...s.layout.canvas, width: c, height: l }
|
|
1961
2053
|
}
|
|
1962
2054
|
});
|
|
1963
2055
|
},
|
|
1964
|
-
disabled:
|
|
2056
|
+
disabled: v,
|
|
1965
2057
|
children: [
|
|
1966
2058
|
/* @__PURE__ */ e("option", { value: "1920x1080", children: "1080p (1920x1080)" }),
|
|
1967
2059
|
/* @__PURE__ */ e("option", { value: "1280x720", children: "720p (1280x720)" }),
|
|
@@ -1971,21 +2063,21 @@ const fe = {
|
|
|
1971
2063
|
)
|
|
1972
2064
|
] }),
|
|
1973
2065
|
/* @__PURE__ */ t("label", { children: [
|
|
1974
|
-
"Frame Rate",
|
|
2066
|
+
r("liveStreaming.frameRate", "Frame Rate"),
|
|
1975
2067
|
/* @__PURE__ */ t(
|
|
1976
2068
|
"select",
|
|
1977
2069
|
{
|
|
1978
2070
|
value: s.settings.video.frameRate,
|
|
1979
|
-
onChange: (
|
|
2071
|
+
onChange: (i) => _({
|
|
1980
2072
|
settings: {
|
|
1981
2073
|
...s.settings,
|
|
1982
2074
|
video: {
|
|
1983
2075
|
...s.settings.video,
|
|
1984
|
-
frameRate: parseInt(
|
|
2076
|
+
frameRate: parseInt(i.target.value)
|
|
1985
2077
|
}
|
|
1986
2078
|
}
|
|
1987
2079
|
}),
|
|
1988
|
-
disabled:
|
|
2080
|
+
disabled: v,
|
|
1989
2081
|
children: [
|
|
1990
2082
|
/* @__PURE__ */ e("option", { value: "24", children: "24 fps" }),
|
|
1991
2083
|
/* @__PURE__ */ e("option", { value: "30", children: "30 fps" }),
|
|
@@ -2001,18 +2093,18 @@ const fe = {
|
|
|
2001
2093
|
{
|
|
2002
2094
|
type: "number",
|
|
2003
2095
|
value: s.settings.video.bitrate,
|
|
2004
|
-
onChange: (
|
|
2096
|
+
onChange: (i) => _({
|
|
2005
2097
|
settings: {
|
|
2006
2098
|
...s.settings,
|
|
2007
2099
|
video: {
|
|
2008
2100
|
...s.settings.video,
|
|
2009
|
-
bitrate: parseInt(
|
|
2101
|
+
bitrate: parseInt(i.target.value) || 6e3
|
|
2010
2102
|
}
|
|
2011
2103
|
}
|
|
2012
2104
|
}),
|
|
2013
2105
|
min: "1000",
|
|
2014
2106
|
max: "50000",
|
|
2015
|
-
disabled:
|
|
2107
|
+
disabled: v
|
|
2016
2108
|
}
|
|
2017
2109
|
)
|
|
2018
2110
|
] }),
|
|
@@ -2023,40 +2115,40 @@ const fe = {
|
|
|
2023
2115
|
{
|
|
2024
2116
|
type: "number",
|
|
2025
2117
|
value: s.settings.video.keyframe,
|
|
2026
|
-
onChange: (
|
|
2118
|
+
onChange: (i) => _({
|
|
2027
2119
|
settings: {
|
|
2028
2120
|
...s.settings,
|
|
2029
2121
|
video: {
|
|
2030
2122
|
...s.settings.video,
|
|
2031
|
-
keyframe: parseInt(
|
|
2123
|
+
keyframe: parseInt(i.target.value) || 2
|
|
2032
2124
|
}
|
|
2033
2125
|
}
|
|
2034
2126
|
}),
|
|
2035
2127
|
min: "1",
|
|
2036
2128
|
max: "10",
|
|
2037
|
-
disabled:
|
|
2129
|
+
disabled: v
|
|
2038
2130
|
}
|
|
2039
2131
|
)
|
|
2040
2132
|
] })
|
|
2041
2133
|
] }),
|
|
2042
|
-
/* @__PURE__ */ t("div", { className: "
|
|
2043
|
-
/* @__PURE__ */ e("h4", { children: "Audio" }),
|
|
2134
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__setting-section", children: [
|
|
2135
|
+
/* @__PURE__ */ e("h4", { children: r("liveStreaming.audio", "Audio") }),
|
|
2044
2136
|
/* @__PURE__ */ t("label", { children: [
|
|
2045
|
-
"Sample Rate",
|
|
2137
|
+
r("liveStreaming.sampleRate", "Sample Rate"),
|
|
2046
2138
|
/* @__PURE__ */ t(
|
|
2047
2139
|
"select",
|
|
2048
2140
|
{
|
|
2049
2141
|
value: s.settings.audio.sampleRate,
|
|
2050
|
-
onChange: (
|
|
2142
|
+
onChange: (i) => _({
|
|
2051
2143
|
settings: {
|
|
2052
2144
|
...s.settings,
|
|
2053
2145
|
audio: {
|
|
2054
2146
|
...s.settings.audio,
|
|
2055
|
-
sampleRate: parseInt(
|
|
2147
|
+
sampleRate: parseInt(i.target.value)
|
|
2056
2148
|
}
|
|
2057
2149
|
}
|
|
2058
2150
|
}),
|
|
2059
|
-
disabled:
|
|
2151
|
+
disabled: v,
|
|
2060
2152
|
children: [
|
|
2061
2153
|
/* @__PURE__ */ e("option", { value: "44100", children: "44.1 kHz" }),
|
|
2062
2154
|
/* @__PURE__ */ e("option", { value: "48000", children: "48 kHz" })
|
|
@@ -2070,13 +2162,13 @@ const fe = {
|
|
|
2070
2162
|
"select",
|
|
2071
2163
|
{
|
|
2072
2164
|
value: s.settings.audio.bitrate,
|
|
2073
|
-
onChange: (
|
|
2165
|
+
onChange: (i) => _({
|
|
2074
2166
|
settings: {
|
|
2075
2167
|
...s.settings,
|
|
2076
|
-
audio: { ...s.settings.audio, bitrate: parseInt(
|
|
2168
|
+
audio: { ...s.settings.audio, bitrate: parseInt(i.target.value) }
|
|
2077
2169
|
}
|
|
2078
2170
|
}),
|
|
2079
|
-
disabled:
|
|
2171
|
+
disabled: v,
|
|
2080
2172
|
children: [
|
|
2081
2173
|
/* @__PURE__ */ e("option", { value: "96", children: "96 kbps" }),
|
|
2082
2174
|
/* @__PURE__ */ e("option", { value: "128", children: "128 kbps" }),
|
|
@@ -2091,86 +2183,86 @@ const fe = {
|
|
|
2091
2183
|
] })
|
|
2092
2184
|
] })
|
|
2093
2185
|
] }),
|
|
2094
|
-
|
|
2095
|
-
/* @__PURE__ */ t("span", { className: "
|
|
2186
|
+
v && /* @__PURE__ */ e("footer", { className: "nice-live-streaming__footer", children: /* @__PURE__ */ t("div", { className: "nice-live-streaming__footer-stats", children: [
|
|
2187
|
+
/* @__PURE__ */ t("span", { className: "nice-live-streaming__stat", children: [
|
|
2096
2188
|
/* @__PURE__ */ e("label", { children: "CPU" }),
|
|
2097
|
-
/* @__PURE__ */ t("span", { className: "
|
|
2098
|
-
|
|
2189
|
+
/* @__PURE__ */ t("span", { className: "nice-live-streaming__value", children: [
|
|
2190
|
+
N.cpuUsage.toFixed(1),
|
|
2099
2191
|
"%"
|
|
2100
2192
|
] })
|
|
2101
2193
|
] }),
|
|
2102
|
-
/* @__PURE__ */ t("span", { className: "
|
|
2103
|
-
/* @__PURE__ */ e("label", { children: "Memory" }),
|
|
2104
|
-
/* @__PURE__ */ t("span", { className: "
|
|
2105
|
-
|
|
2194
|
+
/* @__PURE__ */ t("span", { className: "nice-live-streaming__stat", children: [
|
|
2195
|
+
/* @__PURE__ */ e("label", { children: r("liveStreaming.memory", "Memory") }),
|
|
2196
|
+
/* @__PURE__ */ t("span", { className: "nice-live-streaming__value", children: [
|
|
2197
|
+
N.memoryUsage.toFixed(1),
|
|
2106
2198
|
"%"
|
|
2107
2199
|
] })
|
|
2108
2200
|
] }),
|
|
2109
|
-
/* @__PURE__ */ t("span", { className: "
|
|
2110
|
-
/* @__PURE__ */ e("label", { children: "Dropped" }),
|
|
2111
|
-
/* @__PURE__ */ e("span", { className: "
|
|
2201
|
+
/* @__PURE__ */ t("span", { className: "nice-live-streaming__stat", children: [
|
|
2202
|
+
/* @__PURE__ */ e("label", { children: r("liveStreaming.dropped", "Dropped") }),
|
|
2203
|
+
/* @__PURE__ */ e("span", { className: "nice-live-streaming__value", children: N.droppedFrames })
|
|
2112
2204
|
] }),
|
|
2113
|
-
/* @__PURE__ */ t("span", { className: "
|
|
2114
|
-
/* @__PURE__ */ e("label", { children: "Peak Viewers" }),
|
|
2115
|
-
/* @__PURE__ */ e("span", { className: "
|
|
2205
|
+
/* @__PURE__ */ t("span", { className: "nice-live-streaming__stat", children: [
|
|
2206
|
+
/* @__PURE__ */ e("label", { children: r("liveStreaming.peakViewers", "Peak Viewers") }),
|
|
2207
|
+
/* @__PURE__ */ e("span", { className: "nice-live-streaming__value", children: N.peakViewers })
|
|
2116
2208
|
] })
|
|
2117
2209
|
] }) }),
|
|
2118
|
-
|
|
2119
|
-
/* @__PURE__ */ t("div", { className: "
|
|
2120
|
-
/* @__PURE__ */ e("h3", { children: "Add Source" }),
|
|
2210
|
+
K && /* @__PURE__ */ e("div", { className: "nice-live-streaming__modal-overlay", children: /* @__PURE__ */ t("div", { className: "nice-live-streaming__modal", children: [
|
|
2211
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__modal-header", children: [
|
|
2212
|
+
/* @__PURE__ */ e("h3", { children: r("liveStreaming.addSource", "Add Source") }),
|
|
2121
2213
|
/* @__PURE__ */ e(
|
|
2122
2214
|
"button",
|
|
2123
2215
|
{
|
|
2124
|
-
"aria-label": "Close",
|
|
2125
|
-
className: "
|
|
2216
|
+
"aria-label": r("liveStreaming.close", "Close"),
|
|
2217
|
+
className: "nice-live-streaming__close-button",
|
|
2126
2218
|
onClick: () => C(!1),
|
|
2127
|
-
children: /* @__PURE__ */ e(
|
|
2219
|
+
children: /* @__PURE__ */ e(m, { name: "close", size: 16 })
|
|
2128
2220
|
}
|
|
2129
2221
|
)
|
|
2130
2222
|
] }),
|
|
2131
|
-
/* @__PURE__ */ e("div", { className: "
|
|
2223
|
+
/* @__PURE__ */ e("div", { className: "nice-live-streaming__modal-content", children: /* @__PURE__ */ e("div", { className: "nice-live-streaming__source-type-grid", children: ce.map((i) => /* @__PURE__ */ t(
|
|
2132
2224
|
"button",
|
|
2133
2225
|
{
|
|
2134
|
-
className: "
|
|
2135
|
-
onClick: () =>
|
|
2226
|
+
className: "nice-live-streaming__source-type-button",
|
|
2227
|
+
onClick: () => X(i.type),
|
|
2136
2228
|
children: [
|
|
2137
|
-
/* @__PURE__ */ e("span", { className: "
|
|
2138
|
-
/* @__PURE__ */ e("span", { className: "
|
|
2229
|
+
/* @__PURE__ */ e("span", { className: "nice-live-streaming__icon", children: /* @__PURE__ */ e(m, { name: i.icon, size: 24 }) }),
|
|
2230
|
+
/* @__PURE__ */ e("span", { className: "nice-live-streaming__name", children: i.name })
|
|
2139
2231
|
]
|
|
2140
2232
|
},
|
|
2141
|
-
|
|
2233
|
+
i.type
|
|
2142
2234
|
)) }) })
|
|
2143
2235
|
] }) }),
|
|
2144
|
-
|
|
2145
|
-
/* @__PURE__ */ t("div", { className: "
|
|
2146
|
-
/* @__PURE__ */ e("h3", { children: "Add Destination" }),
|
|
2236
|
+
G && /* @__PURE__ */ e("div", { className: "nice-live-streaming__modal-overlay", children: /* @__PURE__ */ t("div", { className: "nice-live-streaming__modal", children: [
|
|
2237
|
+
/* @__PURE__ */ t("div", { className: "nice-live-streaming__modal-header", children: [
|
|
2238
|
+
/* @__PURE__ */ e("h3", { children: r("liveStreaming.addDestination", "Add Destination") }),
|
|
2147
2239
|
/* @__PURE__ */ e(
|
|
2148
2240
|
"button",
|
|
2149
2241
|
{
|
|
2150
|
-
"aria-label": "Close",
|
|
2151
|
-
className: "
|
|
2152
|
-
onClick: () =>
|
|
2153
|
-
children: /* @__PURE__ */ e(
|
|
2242
|
+
"aria-label": r("liveStreaming.close", "Close"),
|
|
2243
|
+
className: "nice-live-streaming__close-button",
|
|
2244
|
+
onClick: () => W(!1),
|
|
2245
|
+
children: /* @__PURE__ */ e(m, { name: "close", size: 16 })
|
|
2154
2246
|
}
|
|
2155
2247
|
)
|
|
2156
2248
|
] }),
|
|
2157
|
-
/* @__PURE__ */ e("div", { className: "
|
|
2249
|
+
/* @__PURE__ */ e("div", { className: "nice-live-streaming__modal-content", children: /* @__PURE__ */ e("div", { className: "nice-live-streaming__platform-grid", children: de.map((i) => /* @__PURE__ */ t(
|
|
2158
2250
|
"button",
|
|
2159
2251
|
{
|
|
2160
|
-
className: "
|
|
2161
|
-
onClick: () =>
|
|
2252
|
+
className: "nice-live-streaming__platform-button",
|
|
2253
|
+
onClick: () => V(i.platform),
|
|
2162
2254
|
children: [
|
|
2163
|
-
/* @__PURE__ */ e("span", { className: "
|
|
2164
|
-
/* @__PURE__ */ e("span", { className: "
|
|
2255
|
+
/* @__PURE__ */ e("span", { className: "nice-live-streaming__icon", children: /* @__PURE__ */ e(m, { name: i.icon, size: 24 }) }),
|
|
2256
|
+
/* @__PURE__ */ e("span", { className: "nice-live-streaming__name", children: i.name })
|
|
2165
2257
|
]
|
|
2166
2258
|
},
|
|
2167
|
-
|
|
2259
|
+
i.platform
|
|
2168
2260
|
)) }) })
|
|
2169
2261
|
] }) })
|
|
2170
2262
|
] });
|
|
2171
2263
|
};
|
|
2172
2264
|
export {
|
|
2173
|
-
|
|
2174
|
-
|
|
2265
|
+
Ie as NiceLiveStreaming,
|
|
2266
|
+
Te as NiceScreenRecorder,
|
|
2175
2267
|
ze as NiceVideoEditor
|
|
2176
2268
|
};
|