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