@geekapps/silo-elements-nextjs 0.3.3 → 0.3.5
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/FileUploader.js +208 -137
- package/dist/FileUploader.js.map +1 -1
- package/dist/MediaUploader.js +208 -137
- package/dist/MediaUploader.js.map +1 -1
- package/dist/VideoPlayer.js +24 -4
- package/dist/VideoPlayer.js.map +1 -1
- package/dist/VideoUploader.js +208 -137
- package/dist/VideoUploader.js.map +1 -1
- package/dist/index.js +232 -141
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/styles.css +1 -1
package/dist/index.js
CHANGED
|
@@ -400,50 +400,50 @@ var VIDEO_CODECS = [
|
|
|
400
400
|
{
|
|
401
401
|
value: "h264",
|
|
402
402
|
label: "H.264",
|
|
403
|
-
|
|
403
|
+
sublabel: "Compat\xEDvel com tudo",
|
|
404
|
+
description: "Funciona em qualquer dispositivo \u2014 celulares, Smart TVs, navegadores antigos e novos. A escolha mais segura se voc\xEA n\xE3o sabe onde o v\xEDdeo ser\xE1 assistido."
|
|
404
405
|
},
|
|
405
406
|
{
|
|
406
407
|
value: "h265",
|
|
407
408
|
label: "H.265",
|
|
408
|
-
|
|
409
|
+
sublabel: "Menor tamanho",
|
|
410
|
+
description: "Arquivo at\xE9 50% menor que H.264 com a mesma qualidade de imagem. Requer dispositivo moderno (2016+). Ideal para v\xEDdeos longos ou em alta resolu\xE7\xE3o."
|
|
409
411
|
},
|
|
410
412
|
{
|
|
411
413
|
value: "av1",
|
|
412
414
|
label: "AV1",
|
|
413
|
-
|
|
414
|
-
|
|
415
|
+
sublabel: "M\xE1x. efici\xEAncia",
|
|
416
|
+
description: "O codec mais eficiente dispon\xEDvel \u2014 arquivo at\xE9 50% menor que H.265. Exige navegador recente (Chrome 70+, Firefox 67+, Safari 17+).",
|
|
417
|
+
warning: "N\xE3o funciona em iPhones com iOS abaixo de 16 nem em Smart TVs mais antigas. Use H.264 se precisar de compatibilidade ampla."
|
|
415
418
|
}
|
|
416
419
|
];
|
|
417
420
|
var AUDIO_SIMPLE = [
|
|
418
421
|
{
|
|
419
422
|
value: "passthrough",
|
|
420
|
-
label: "
|
|
423
|
+
label: "Manter original",
|
|
421
424
|
badge: "Recomendado",
|
|
422
|
-
description: "
|
|
425
|
+
description: "Mant\xE9m o \xE1udio exatamente como est\xE1 no arquivo original, sem perdas. Se o formato n\xE3o for compat\xEDvel com streaming, converte automaticamente para AAC est\xE9reo."
|
|
423
426
|
},
|
|
424
427
|
{
|
|
425
428
|
value: "aac",
|
|
426
429
|
label: "AAC",
|
|
427
|
-
description: "
|
|
430
|
+
description: "Formato mais compat\xEDvel do mercado \u2014 funciona em absolutamente todos os players, celulares e Smart TVs."
|
|
428
431
|
},
|
|
429
432
|
{
|
|
430
433
|
value: "opus",
|
|
431
434
|
label: "Opus",
|
|
432
|
-
description: "Melhor
|
|
435
|
+
description: "Melhor qualidade que AAC no mesmo tamanho. Funciona em Chrome, Firefox e Android. N\xE3o suportado no Safari/iPhone."
|
|
433
436
|
}
|
|
434
437
|
];
|
|
435
438
|
var AUDIO_ADVANCED_CODEC = [
|
|
436
|
-
{ value: "passthrough", label: "Original", description: "
|
|
437
|
-
{ value: "aac", label: "AAC", description: "Compatibilidade m\xE1xima." },
|
|
438
|
-
{ value: "opus", label: "Opus", description: "
|
|
439
|
-
{ value: "ac3", label: "AC3", description: "Dolby Digital. Compat\xEDvel com HLS e home theaters." },
|
|
440
|
-
{ value: "eac3", label: "E-AC3", description: "Dolby Digital Plus. Suporta Atmos. Netflix, Disney+, Apple TV+." }
|
|
439
|
+
{ value: "passthrough", label: "Original", description: "Copia sem reprocessar quando compat\xEDvel (mant\xE9m AC3, E-AC3, Dolby Atmos). AAC est\xE9reo como fallback." },
|
|
440
|
+
{ value: "aac", label: "AAC", description: "Compatibilidade m\xE1xima com todos os dispositivos." },
|
|
441
|
+
{ value: "opus", label: "Opus", description: "Qualidade superior ao AAC. Chrome/Firefox/Android." }
|
|
441
442
|
];
|
|
442
443
|
var AUDIO_CHANNELS = [
|
|
443
444
|
{ value: "original", label: "Original", description: "Mant\xE9m os canais do arquivo fonte." },
|
|
444
|
-
{ value: "stereo", label: "Est\xE9reo", description: "
|
|
445
|
-
{ value: "5.1", label: "5.1", description: "
|
|
446
|
-
{ value: "7.1", label: "7.1", description: "Surround 7.1." }
|
|
445
|
+
{ value: "stereo", label: "Est\xE9reo (2.0)", description: "Dois canais \u2014 compat\xEDvel com fones e qualquer dispositivo." },
|
|
446
|
+
{ value: "5.1", label: "Surround 5.1", description: "Seis canais. Ideal para home theaters." }
|
|
447
447
|
];
|
|
448
448
|
var RESOLUTIONS = ["144", "240", "360", "480", "720", "1080", "1440", "2160"];
|
|
449
449
|
var RESOLUTION_LABELS = {
|
|
@@ -451,35 +451,61 @@ var RESOLUTION_LABELS = {
|
|
|
451
451
|
"240": "240p",
|
|
452
452
|
"360": "360p",
|
|
453
453
|
"480": "480p",
|
|
454
|
-
"720": "720p",
|
|
455
|
-
"1080": "1080p",
|
|
456
|
-
"1440": "1440p",
|
|
457
|
-
"2160": "4K"
|
|
454
|
+
"720": "720p HD",
|
|
455
|
+
"1080": "1080p Full HD",
|
|
456
|
+
"1440": "1440p 2K",
|
|
457
|
+
"2160": "4K UHD"
|
|
458
458
|
};
|
|
459
|
-
function
|
|
460
|
-
|
|
459
|
+
function btn(active, disabled = false) {
|
|
460
|
+
if (disabled) return {
|
|
461
|
+
border: "1px solid rgba(255,255,255,0.08)",
|
|
462
|
+
background: "rgba(255,255,255,0.03)",
|
|
463
|
+
color: "rgba(255,255,255,0.2)",
|
|
464
|
+
padding: "4px 10px",
|
|
465
|
+
borderRadius: 6,
|
|
466
|
+
fontSize: 12,
|
|
467
|
+
fontWeight: 600,
|
|
468
|
+
cursor: "not-allowed"
|
|
469
|
+
};
|
|
470
|
+
return active ? { border: "1px solid #6366f1", background: "#6366f1", color: "#fff", padding: "4px 10px", borderRadius: 6, fontSize: 12, fontWeight: 600, cursor: "pointer" } : { border: "1px solid rgba(255,255,255,0.15)", background: "rgba(255,255,255,0.05)", color: "rgba(255,255,255,0.7)", padding: "4px 10px", borderRadius: 6, fontSize: 12, fontWeight: 600, cursor: "pointer" };
|
|
461
471
|
}
|
|
462
|
-
function
|
|
463
|
-
return /* @__PURE__ */ jsx("div", { style: { fontSize: 11, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.05em", marginBottom:
|
|
472
|
+
function Label({ children }) {
|
|
473
|
+
return /* @__PURE__ */ jsx("div", { style: { fontSize: 11, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: 7, color: "rgba(255,255,255,0.28)" }, children });
|
|
464
474
|
}
|
|
465
475
|
function Hint({ children }) {
|
|
466
|
-
return /* @__PURE__ */ jsx("p", { style: { marginTop: 5, fontSize: 11, color: "rgba(255,255,255,0.
|
|
476
|
+
return /* @__PURE__ */ jsx("p", { style: { marginTop: 5, fontSize: 11, color: "rgba(255,255,255,0.38)", lineHeight: 1.55 }, children });
|
|
467
477
|
}
|
|
468
|
-
function
|
|
469
|
-
return /* @__PURE__ */
|
|
470
|
-
"\u26A0
|
|
471
|
-
children
|
|
472
|
-
] })
|
|
478
|
+
function Warn({ children }) {
|
|
479
|
+
return /* @__PURE__ */ jsxs("div", { style: { marginTop: 6, display: "flex", gap: 6, background: "rgba(251,191,36,0.07)", border: "1px solid rgba(251,191,36,0.18)", borderRadius: 7, padding: "6px 10px" }, children: [
|
|
480
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 12, flexShrink: 0 }, children: "\u26A0" }),
|
|
481
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 11, color: "#fbbf24", lineHeight: 1.55 }, children })
|
|
482
|
+
] });
|
|
473
483
|
}
|
|
474
|
-
function
|
|
475
|
-
return /* @__PURE__ */ jsxs("div", { style: {
|
|
476
|
-
/* @__PURE__ */ jsx("span", { style: {
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
/* @__PURE__ */ jsx("span", { style: { fontSize: 12, fontWeight: 500, color: "rgba(255,255,255,0.85)" }, children: label }),
|
|
479
|
-
hint && /* @__PURE__ */ jsx("p", { style: { fontSize: 11, color: "rgba(255,255,255,0.4)", marginTop: 1, lineHeight: 1.4 }, children: hint })
|
|
480
|
-
] })
|
|
484
|
+
function Note({ children }) {
|
|
485
|
+
return /* @__PURE__ */ jsxs("div", { style: { marginTop: 6, display: "flex", gap: 6, background: "rgba(99,102,241,0.07)", border: "1px solid rgba(99,102,241,0.18)", borderRadius: 7, padding: "6px 10px" }, children: [
|
|
486
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 12, flexShrink: 0 }, children: "\u2139" }),
|
|
487
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 11, color: "rgba(165,180,252,0.9)", lineHeight: 1.55 }, children })
|
|
481
488
|
] });
|
|
482
489
|
}
|
|
490
|
+
function Toggle({ checked, onToggle, label, hint, disabled }) {
|
|
491
|
+
return /* @__PURE__ */ jsxs(
|
|
492
|
+
"div",
|
|
493
|
+
{
|
|
494
|
+
style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: disabled ? "not-allowed" : "pointer", userSelect: "none", opacity: disabled ? 0.4 : 1 },
|
|
495
|
+
onClick: () => !disabled && onToggle(),
|
|
496
|
+
children: [
|
|
497
|
+
/* @__PURE__ */ jsx("span", { style: { position: "relative", display: "inline-block", width: 32, height: 18, borderRadius: 9, flexShrink: 0, marginTop: 1, background: checked && !disabled ? "#6366f1" : "rgba(255,255,255,0.12)", transition: "background 150ms" }, children: /* @__PURE__ */ jsx("span", { style: { position: "absolute", top: 2, left: checked && !disabled ? 16 : 2, width: 14, height: 14, borderRadius: "50%", background: "#fff", boxShadow: "0 1px 3px rgba(0,0,0,.3)", transition: "left 150ms" } }) }),
|
|
498
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
499
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 12, fontWeight: 500, color: disabled ? "rgba(255,255,255,0.4)" : "rgba(255,255,255,0.85)" }, children: label }),
|
|
500
|
+
hint && /* @__PURE__ */ jsx("p", { style: { fontSize: 11, color: "rgba(255,255,255,0.35)", marginTop: 2, lineHeight: 1.5 }, children: hint })
|
|
501
|
+
] })
|
|
502
|
+
]
|
|
503
|
+
}
|
|
504
|
+
);
|
|
505
|
+
}
|
|
506
|
+
function Divider() {
|
|
507
|
+
return /* @__PURE__ */ jsx("div", { style: { height: 1, background: "rgba(255,255,255,0.06)", margin: "2px 0" } });
|
|
508
|
+
}
|
|
483
509
|
function VideoOptions({ value, onChange, style }) {
|
|
484
510
|
const [advanced, setAdvanced] = useState(false);
|
|
485
511
|
const codec = value.codec ?? "h264";
|
|
@@ -490,7 +516,10 @@ function VideoOptions({ value, onChange, style }) {
|
|
|
490
516
|
const audioChannels = value.audioChannels ?? "original";
|
|
491
517
|
const preserveAtmos = value.preserveAtmos ?? true;
|
|
492
518
|
const hdrMode = value.hdr ?? "preserve";
|
|
493
|
-
const
|
|
519
|
+
const hdrSupported = codec === "h265" || codec === "av1";
|
|
520
|
+
const showAtmosOpt = audioCodec === "passthrough";
|
|
521
|
+
const showAtmosWarn = audioCodec === "aac" || audioCodec === "opus";
|
|
522
|
+
const selectedCodec = VIDEO_CODECS.find((c) => c.value === codec);
|
|
494
523
|
function toggleRes(r) {
|
|
495
524
|
if (isAuto) {
|
|
496
525
|
onChange({ ...value, transcoding: [r] });
|
|
@@ -499,130 +528,172 @@ function VideoOptions({ value, onChange, style }) {
|
|
|
499
528
|
const next = selectedRes.includes(r) ? selectedRes.filter((x) => x !== r) : [...selectedRes, r];
|
|
500
529
|
onChange({ ...value, transcoding: next.length === 0 ? "auto" : next });
|
|
501
530
|
}
|
|
502
|
-
|
|
503
|
-
const showAtmosWarning = audioCodec === "aac" || audioCodec === "opus" || audioCodec === "ac3";
|
|
504
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", style, children: [
|
|
505
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
506
|
-
/* @__PURE__ */ jsx(SectionLabel, { children: "Codec de v\xEDdeo" }),
|
|
507
|
-
/* @__PURE__ */ jsx("div", { className: "flex gap-1.5 flex-wrap", children: VIDEO_CODECS.map((c) => /* @__PURE__ */ jsx(
|
|
508
|
-
"button",
|
|
509
|
-
{
|
|
510
|
-
type: "button",
|
|
511
|
-
onClick: () => onChange({ ...value, codec: c.value }),
|
|
512
|
-
style: optBtnStyle(codec === c.value),
|
|
513
|
-
children: c.label
|
|
514
|
-
},
|
|
515
|
-
c.value
|
|
516
|
-
)) }),
|
|
517
|
-
selectedVideoCodec && /* @__PURE__ */ jsx(Hint, { children: selectedVideoCodec.description }),
|
|
518
|
-
selectedVideoCodec?.warning && /* @__PURE__ */ jsx(Warning, { children: selectedVideoCodec.warning })
|
|
519
|
-
] }),
|
|
531
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5", style, children: [
|
|
520
532
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
521
|
-
/* @__PURE__ */ jsx(
|
|
522
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
523
|
-
/* @__PURE__ */ jsx("
|
|
524
|
-
RESOLUTIONS.map((r) => /* @__PURE__ */ jsx("button", { type: "button", onClick: () => toggleRes(r), style: optBtnStyle(!isAuto && selectedRes.includes(r)), children: RESOLUTION_LABELS[r] }, r))
|
|
525
|
-
] }),
|
|
526
|
-
isAuto && /* @__PURE__ */ jsx(Hint, { children: "Gera todas as resolu\xE7\xF5es at\xE9 a resolu\xE7\xE3o original do v\xEDdeo." })
|
|
527
|
-
] }),
|
|
528
|
-
!advanced && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
529
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
530
|
-
/* @__PURE__ */ jsx(SectionLabel, { children: "\xC1udio" }),
|
|
531
|
-
/* @__PURE__ */ jsx("div", { className: "flex gap-1.5 flex-wrap", children: AUDIO_SIMPLE.map((a) => /* @__PURE__ */ jsxs(
|
|
533
|
+
/* @__PURE__ */ jsx(Label, { children: "Formato de v\xEDdeo" }),
|
|
534
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
|
|
535
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-1.5 flex-wrap mb-1", children: VIDEO_CODECS.map((c) => /* @__PURE__ */ jsx(
|
|
532
536
|
"button",
|
|
533
537
|
{
|
|
534
538
|
type: "button",
|
|
535
|
-
onClick: () => onChange({ ...value,
|
|
536
|
-
style:
|
|
537
|
-
children:
|
|
538
|
-
a.label,
|
|
539
|
-
"badge" in a && a.badge ? /* @__PURE__ */ jsx("span", { style: { marginLeft: 5, fontSize: 9, fontWeight: 700, background: "rgba(255,255,255,0.15)", borderRadius: 4, padding: "1px 4px", verticalAlign: "middle" }, children: a.badge }) : null
|
|
540
|
-
]
|
|
539
|
+
onClick: () => onChange({ ...value, codec: c.value }),
|
|
540
|
+
style: btn(codec === c.value),
|
|
541
|
+
children: c.label
|
|
541
542
|
},
|
|
542
|
-
|
|
543
|
+
c.value
|
|
543
544
|
)) }),
|
|
544
|
-
/* @__PURE__ */
|
|
545
|
+
selectedCodec && /* @__PURE__ */ jsxs(Hint, { children: [
|
|
546
|
+
/* @__PURE__ */ jsxs("strong", { style: { color: "rgba(255,255,255,0.55)" }, children: [
|
|
547
|
+
selectedCodec.sublabel,
|
|
548
|
+
"."
|
|
549
|
+
] }),
|
|
550
|
+
" ",
|
|
551
|
+
selectedCodec.description
|
|
552
|
+
] }),
|
|
553
|
+
"warning" in (selectedCodec ?? {}) && selectedCodec.warning && /* @__PURE__ */ jsx(Warn, { children: selectedCodec.warning })
|
|
545
554
|
] }),
|
|
546
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
547
|
-
/* @__PURE__ */ jsx(
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
|
|
550
|
-
{
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
555
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
|
|
556
|
+
/* @__PURE__ */ jsx(Label, { children: "Vers\xF5es de qualidade (resolu\xE7\xF5es)" }),
|
|
557
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-1.5 flex-wrap mb-1", children: [
|
|
558
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: () => onChange({ ...value, transcoding: "auto" }), style: btn(isAuto), children: "Autom\xE1tico" }),
|
|
559
|
+
RESOLUTIONS.map((r) => /* @__PURE__ */ jsx("button", { type: "button", onClick: () => toggleRes(r), style: btn(!isAuto && selectedRes.includes(r)), children: RESOLUTION_LABELS[r] }, r))
|
|
560
|
+
] }),
|
|
561
|
+
/* @__PURE__ */ jsx(Hint, { children: isAuto ? "Gera automaticamente todas as vers\xF5es at\xE9 a qualidade original do v\xEDdeo." : "Somente as vers\xF5es selecionadas ser\xE3o geradas." })
|
|
562
|
+
] }),
|
|
563
|
+
/* @__PURE__ */ jsxs("div", { style: { opacity: hdrSupported ? 1 : 0.45 }, children: [
|
|
564
|
+
/* @__PURE__ */ jsx(Label, { children: "Imagem HDR (alto contraste e cores vibrantes)" }),
|
|
565
|
+
!advanced ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
566
|
+
/* @__PURE__ */ jsx(
|
|
567
|
+
Toggle,
|
|
568
|
+
{
|
|
569
|
+
checked: hdrMode === "preserve",
|
|
570
|
+
onToggle: () => onChange({ ...value, hdr: hdrMode === "preserve" ? "sdr" : "preserve" }),
|
|
571
|
+
label: "Manter imagem HDR do v\xEDdeo original",
|
|
572
|
+
hint: "Preserva HDR10, HDR10+, HLG e Dolby Vision. S\xF3 funciona com H.265 ou AV1.",
|
|
573
|
+
disabled: !hdrSupported
|
|
574
|
+
}
|
|
575
|
+
),
|
|
576
|
+
!hdrSupported && /* @__PURE__ */ jsx(Warn, { children: "O H.264 n\xE3o suporta HDR. Se o v\xEDdeo for HDR, a imagem ser\xE1 convertida automaticamente para SDR. Para manter o HDR, escolha H.265 ou AV1." })
|
|
577
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
578
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-1.5 flex-wrap mb-1", children: [
|
|
579
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: () => hdrSupported && onChange({ ...value, hdr: "preserve" }), style: btn(hdrMode === "preserve" && hdrSupported, !hdrSupported), children: "Manter HDR" }),
|
|
580
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: () => onChange({ ...value, hdr: "sdr" }), style: btn(hdrMode === "sdr" || !hdrSupported), children: "Converter para SDR" })
|
|
581
|
+
] }),
|
|
582
|
+
!hdrSupported ? /* @__PURE__ */ jsx(Warn, { children: "O H.264 n\xE3o suporta HDR. O v\xEDdeo ser\xE1 convertido para SDR automaticamente. Escolha H.265 ou AV1 para manter o HDR." }) : /* @__PURE__ */ jsx(Hint, { children: hdrMode === "preserve" ? "HDR10, HDR10+, HLG e Dolby Vision preservados. Em telas sem HDR o v\xEDdeo funciona normalmente." : "Convertido para SDR padr\xE3o \u2014 compat\xEDvel com qualquer tela." })
|
|
583
|
+
] })
|
|
557
584
|
] })
|
|
558
585
|
] }),
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
586
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
587
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
588
|
+
/* @__PURE__ */ jsx(Label, { children: "\xC1udio" }),
|
|
589
|
+
!advanced ? /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
|
|
590
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-1.5 flex-wrap mb-1", children: AUDIO_SIMPLE.map((a) => /* @__PURE__ */ jsxs(
|
|
563
591
|
"button",
|
|
564
592
|
{
|
|
565
593
|
type: "button",
|
|
566
594
|
onClick: () => onChange({ ...value, audioCodec: a.value }),
|
|
567
|
-
style:
|
|
568
|
-
children:
|
|
595
|
+
style: btn(audioCodec === a.value),
|
|
596
|
+
children: [
|
|
597
|
+
a.label,
|
|
598
|
+
"badge" in a && a.badge ? /* @__PURE__ */ jsx("span", { style: { marginLeft: 5, fontSize: 9, fontWeight: 700, background: "rgba(255,255,255,0.15)", borderRadius: 4, padding: "1px 4px", verticalAlign: "middle" }, children: a.badge }) : null
|
|
599
|
+
]
|
|
569
600
|
},
|
|
570
601
|
a.value
|
|
571
602
|
)) }),
|
|
572
|
-
/* @__PURE__ */ jsx(Hint, { children:
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
checked: preserveAtmos,
|
|
595
|
-
onToggle: () => onChange({ ...value, preserveAtmos: !preserveAtmos }),
|
|
596
|
-
label: "Preservar Dolby Atmos quando dispon\xEDvel",
|
|
597
|
-
hint: "Mant\xE9m os metadados Atmos no E-AC3 de sa\xEDda. Efetivo somente com codec E-AC3 ou Original."
|
|
598
|
-
}
|
|
599
|
-
)
|
|
600
|
-
] }),
|
|
601
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
602
|
-
/* @__PURE__ */ jsx(SectionLabel, { children: "HDR" }),
|
|
603
|
-
/* @__PURE__ */ jsxs("div", { className: "flex gap-1.5 flex-wrap", children: [
|
|
604
|
-
/* @__PURE__ */ jsx("button", { type: "button", onClick: () => onChange({ ...value, hdr: "preserve" }), style: optBtnStyle(hdrMode === "preserve"), children: "Preservar HDR" }),
|
|
605
|
-
/* @__PURE__ */ jsx("button", { type: "button", onClick: () => onChange({ ...value, hdr: "sdr" }), style: optBtnStyle(hdrMode === "sdr"), children: "Converter para SDR" })
|
|
603
|
+
/* @__PURE__ */ jsx(Hint, { children: AUDIO_SIMPLE.find((a) => a.value === audioCodec)?.description })
|
|
604
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
605
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
|
|
606
|
+
/* @__PURE__ */ jsx(Label, { children: "Formato de \xE1udio (codec)" }),
|
|
607
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-1.5 flex-wrap mb-1", children: AUDIO_ADVANCED_CODEC.map((a) => /* @__PURE__ */ jsx(
|
|
608
|
+
"button",
|
|
609
|
+
{
|
|
610
|
+
type: "button",
|
|
611
|
+
onClick: () => onChange({ ...value, audioCodec: a.value }),
|
|
612
|
+
style: btn(audioCodec === a.value),
|
|
613
|
+
children: a.label
|
|
614
|
+
},
|
|
615
|
+
a.value
|
|
616
|
+
)) }),
|
|
617
|
+
/* @__PURE__ */ jsx(Hint, { children: AUDIO_ADVANCED_CODEC.find((a) => a.value === audioCodec)?.description }),
|
|
618
|
+
showAtmosWarn && /* @__PURE__ */ jsxs(Warn, { children: [
|
|
619
|
+
"Este formato n\xE3o suporta Dolby Atmos. Use ",
|
|
620
|
+
/* @__PURE__ */ jsx("strong", { children: "Dolby Digital Plus (E-AC3)" }),
|
|
621
|
+
" ou ",
|
|
622
|
+
/* @__PURE__ */ jsx("strong", { children: "Original" }),
|
|
623
|
+
" para manter o som espacial 3D."
|
|
624
|
+
] })
|
|
606
625
|
] }),
|
|
607
|
-
/* @__PURE__ */
|
|
608
|
-
|
|
626
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
|
|
627
|
+
/* @__PURE__ */ jsx(Label, { children: "Canais de \xE1udio" }),
|
|
628
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-1.5 flex-wrap mb-1", children: AUDIO_CHANNELS.map((c) => /* @__PURE__ */ jsx(
|
|
629
|
+
"button",
|
|
630
|
+
{
|
|
631
|
+
type: "button",
|
|
632
|
+
onClick: () => onChange({ ...value, audioChannels: c.value }),
|
|
633
|
+
style: btn(audioChannels === c.value),
|
|
634
|
+
children: c.label
|
|
635
|
+
},
|
|
636
|
+
c.value
|
|
637
|
+
)) }),
|
|
638
|
+
/* @__PURE__ */ jsx(Hint, { children: AUDIO_CHANNELS.find((c) => c.value === audioChannels)?.description })
|
|
639
|
+
] }),
|
|
640
|
+
showAtmosOpt && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
|
|
641
|
+
/* @__PURE__ */ jsx(Label, { children: "Dolby Atmos (som espacial 3D)" }),
|
|
642
|
+
/* @__PURE__ */ jsx(
|
|
643
|
+
Toggle,
|
|
644
|
+
{
|
|
645
|
+
checked: preserveAtmos,
|
|
646
|
+
onToggle: () => onChange({ ...value, preserveAtmos: !preserveAtmos }),
|
|
647
|
+
label: "Manter Dolby Atmos quando dispon\xEDvel no arquivo",
|
|
648
|
+
hint: "Funciona somente com Dolby Digital Plus (E-AC3) ou Original."
|
|
649
|
+
}
|
|
650
|
+
),
|
|
651
|
+
!preserveAtmos && /* @__PURE__ */ jsx(Note, { children: "Com Atmos desativado, o \xE1udio ser\xE1 mixado em surround convencional sem informa\xE7\xE3o espacial." })
|
|
652
|
+
] })
|
|
653
|
+
] }),
|
|
654
|
+
/* @__PURE__ */ jsx(
|
|
655
|
+
Toggle,
|
|
656
|
+
{
|
|
657
|
+
checked: value.separateAudio ?? false,
|
|
658
|
+
onToggle: () => onChange({ ...value, separateAudio: !value.separateAudio }),
|
|
659
|
+
label: "Exportar faixa de \xE1udio separada",
|
|
660
|
+
hint: "Gera tamb\xE9m um arquivo de \xE1udio independente do v\xEDdeo."
|
|
661
|
+
}
|
|
662
|
+
)
|
|
609
663
|
] }),
|
|
664
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
610
665
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
611
|
-
/* @__PURE__ */ jsx(
|
|
612
|
-
/* @__PURE__ */
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
666
|
+
/* @__PURE__ */ jsx(Label, { children: "Miniaturas (thumbnails)" }),
|
|
667
|
+
/* @__PURE__ */ jsx(
|
|
668
|
+
Toggle,
|
|
669
|
+
{
|
|
670
|
+
checked: value.thumbnails ?? true,
|
|
671
|
+
onToggle: () => onChange({ ...value, thumbnails: !(value.thumbnails ?? true) }),
|
|
672
|
+
label: "Gerar miniaturas automaticamente",
|
|
673
|
+
hint: "Imagens de pr\xE9via usadas em players, listas e compartilhamentos. Recomendado manter ativo."
|
|
674
|
+
}
|
|
675
|
+
)
|
|
676
|
+
] }),
|
|
677
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
678
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
679
|
+
/* @__PURE__ */ jsx(Label, { children: "Storyboard" }),
|
|
680
|
+
/* @__PURE__ */ jsx(
|
|
681
|
+
Toggle,
|
|
682
|
+
{
|
|
683
|
+
checked: value.storyboard ?? false,
|
|
684
|
+
onToggle: () => onChange({ ...value, storyboard: !value.storyboard }),
|
|
685
|
+
label: "Gerar storyboard para pr\xE9-visualiza\xE7\xE3o",
|
|
686
|
+
hint: "Mostra frames do v\xEDdeo ao passar o mouse na barra de progresso do player. Aumenta levemente o tempo de processamento."
|
|
687
|
+
}
|
|
688
|
+
)
|
|
618
689
|
] }),
|
|
619
690
|
/* @__PURE__ */ jsx(
|
|
620
691
|
"button",
|
|
621
692
|
{
|
|
622
693
|
type: "button",
|
|
623
694
|
onClick: () => setAdvanced((v) => !v),
|
|
624
|
-
style: { alignSelf: "flex-start", fontSize: 11, color: "rgba(255,255,255,0.
|
|
625
|
-
children: advanced ? "\u2190
|
|
695
|
+
style: { alignSelf: "flex-start", fontSize: 11, color: "rgba(255,255,255,0.3)", background: "none", border: "none", cursor: "pointer", padding: 0, textDecoration: "underline", textUnderlineOffset: 3 },
|
|
696
|
+
children: advanced ? "\u2190 Voltar ao modo simples" : "Configura\xE7\xF5es avan\xE7adas de \xE1udio e HDR \u2192"
|
|
626
697
|
}
|
|
627
698
|
)
|
|
628
699
|
] });
|
|
@@ -1461,6 +1532,7 @@ function Video({
|
|
|
1461
1532
|
const ageRatingTextRef = useRef(null);
|
|
1462
1533
|
const ageRatingShownRef = useRef(false);
|
|
1463
1534
|
const ageRatingQueuedRef = useRef(false);
|
|
1535
|
+
const ageRatingPendingRef = useRef(false);
|
|
1464
1536
|
const [clickIcon, setClickIcon] = useState(null);
|
|
1465
1537
|
const clickIconTimerRef = useRef(null);
|
|
1466
1538
|
const clickIconRef = useRef(null);
|
|
@@ -1610,7 +1682,13 @@ function Video({
|
|
|
1610
1682
|
gsap.to(el, {
|
|
1611
1683
|
opacity: controlsVisible ? 1 : 0,
|
|
1612
1684
|
duration: 0.2,
|
|
1613
|
-
ease: "power1.inOut"
|
|
1685
|
+
ease: "power1.inOut",
|
|
1686
|
+
onComplete: () => {
|
|
1687
|
+
if (!controlsVisible && ageRatingPendingRef.current) {
|
|
1688
|
+
ageRatingPendingRef.current = false;
|
|
1689
|
+
showAgeRatingRef.current?.();
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1614
1692
|
});
|
|
1615
1693
|
el.style.pointerEvents = controlsVisible ? "" : "none";
|
|
1616
1694
|
if (player) {
|
|
@@ -1686,7 +1764,7 @@ function Video({
|
|
|
1686
1764
|
if (!wrap) return;
|
|
1687
1765
|
if (ageRatingTlRef.current) ageRatingTlRef.current.kill();
|
|
1688
1766
|
const HOLD = 12;
|
|
1689
|
-
const tl = gsap.timeline({ delay: 0.
|
|
1767
|
+
const tl = gsap.timeline({ delay: 0.3 });
|
|
1690
1768
|
tl.fromTo(wrap, { opacity: 0 }, { opacity: 1, duration: 0.5, ease: "power2.out" });
|
|
1691
1769
|
if (icon) {
|
|
1692
1770
|
tl.fromTo(
|
|
@@ -1719,7 +1797,7 @@ function Video({
|
|
|
1719
1797
|
}
|
|
1720
1798
|
const shouldShow = !ageRatingShownRef.current || ageRatingQueuedRef.current;
|
|
1721
1799
|
ageRatingQueuedRef.current = false;
|
|
1722
|
-
if (shouldShow)
|
|
1800
|
+
if (shouldShow) ageRatingPendingRef.current = true;
|
|
1723
1801
|
setHasPlayed(true);
|
|
1724
1802
|
showControlsTemporarily();
|
|
1725
1803
|
};
|
|
@@ -3318,7 +3396,20 @@ function Video({
|
|
|
3318
3396
|
activeCue && /* @__PURE__ */ jsx(
|
|
3319
3397
|
"div",
|
|
3320
3398
|
{
|
|
3321
|
-
className:
|
|
3399
|
+
className: "pointer-events-none absolute inset-x-0 z-40 flex justify-center px-4",
|
|
3400
|
+
style: {
|
|
3401
|
+
bottom: (() => {
|
|
3402
|
+
if (preview) {
|
|
3403
|
+
const frameW = preview.cue.w ?? 160;
|
|
3404
|
+
const frameH = preview.cue.h ?? 90;
|
|
3405
|
+
const thumbH = Math.round(200 * (frameH / frameW));
|
|
3406
|
+
return `${80 + thumbH + 32 + 10}px`;
|
|
3407
|
+
}
|
|
3408
|
+
if (controlsVisible) return "5rem";
|
|
3409
|
+
return "1rem";
|
|
3410
|
+
})(),
|
|
3411
|
+
transition: "bottom 0.2s ease"
|
|
3412
|
+
},
|
|
3322
3413
|
children: /* @__PURE__ */ jsx(
|
|
3323
3414
|
"div",
|
|
3324
3415
|
{
|