softbuilders-react-video-player 1.2.13 → 1.2.15
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/BigPlayButton/index.d.ts +4 -1
- package/dist/components/BigPlayButton/index.js +4 -2
- package/dist/components/BigPlayButton/index.js.map +1 -1
- package/dist/components/BigPlayButton/index.tsx +18 -3
- package/dist/components/ControlBar/index.d.ts +2 -1
- package/dist/components/ControlBar/index.js +16 -12
- package/dist/components/ControlBar/index.js.map +1 -1
- package/dist/components/ControlBar/index.tsx +58 -46
- package/dist/components/QualityMenu/index.d.ts +2 -1
- package/dist/components/QualityMenu/index.js +6 -6
- package/dist/components/QualityMenu/index.js.map +1 -1
- package/dist/components/QualityMenu/index.tsx +13 -5
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Slider/index.tsx +36 -36
- package/dist/components/SoftBuildersVideoPlayer/index.d.ts +2 -0
- package/dist/components/SoftBuildersVideoPlayer/index.js +2 -2
- package/dist/components/SoftBuildersVideoPlayer/index.js.map +1 -1
- package/dist/components/SoftBuildersVideoPlayer/index.tsx +6 -0
- package/dist/components/SubtitleMenu/index.d.ts +2 -1
- package/dist/components/SubtitleMenu/index.js +2 -2
- package/dist/components/SubtitleMenu/index.js.map +1 -1
- package/dist/components/SubtitleMenu/index.tsx +6 -2
- package/dist/components/TimeSlider/index.js.map +1 -1
- package/dist/components/TimeSlider/index.tsx +0 -1
- package/dist/components/VideoPlayerComponent/index.d.ts +2 -0
- package/dist/components/VideoPlayerComponent/index.js +33 -19
- package/dist/components/VideoPlayerComponent/index.js.map +1 -1
- package/dist/components/VideoPlayerComponent/index.tsx +76 -40
- package/dist/components/VolumeSlider/index.d.ts +2 -1
- package/dist/components/VolumeSlider/index.js +29 -8
- package/dist/components/VolumeSlider/index.js.map +1 -1
- package/dist/components/VolumeSlider/index.tsx +57 -15
- package/dist/components/icons/SubIcon.js +1 -1
- package/dist/components/icons/SubIcon.js.map +1 -1
- package/dist/components/icons/SubIcon.tsx +27 -28
- package/dist/components/icons/VolumeHigh.d.ts +3 -0
- package/dist/components/icons/VolumeHigh.js +4 -0
- package/dist/components/icons/VolumeHigh.js.map +1 -0
- package/dist/components/icons/VolumeHigh.tsx +15 -0
- package/dist/components/icons/VolumeHighIcon.d.ts +3 -0
- package/dist/components/icons/VolumeHighIcon.js +4 -0
- package/dist/components/icons/VolumeHighIcon.js.map +1 -0
- package/dist/components/icons/VolumeHighIcon.tsx +16 -0
- package/dist/components/icons/VolumeIconHigh.d.ts +3 -0
- package/dist/components/icons/VolumeIconHigh.js +4 -0
- package/dist/components/icons/VolumeIconHigh.js.map +1 -0
- package/dist/components/icons/VolumeIconHigh.tsx +16 -0
- package/dist/components/icons/VolumeIconLow copy.d.ts +3 -0
- package/dist/components/icons/VolumeIconLow copy.js +4 -0
- package/dist/components/icons/VolumeIconLow copy.js.map +1 -0
- package/dist/components/icons/VolumeIconLow copy.tsx +17 -0
- package/dist/components/icons/VolumeLow.d.ts +3 -0
- package/dist/components/icons/VolumeLow.js +4 -0
- package/dist/components/icons/VolumeLow.js.map +1 -0
- package/dist/components/icons/VolumeLow.tsx +14 -0
- package/dist/components/icons/VolumeLowIcon.d.ts +3 -0
- package/dist/components/icons/VolumeLowIcon.js +4 -0
- package/dist/components/icons/VolumeLowIcon.js.map +1 -0
- package/dist/components/icons/VolumeLowIcon.tsx +15 -0
- package/dist/components/icons/VolumeMute.d.ts +3 -0
- package/dist/components/icons/VolumeMute.js +10 -0
- package/dist/components/icons/VolumeMute.js.map +1 -0
- package/dist/components/icons/VolumeMute.tsx +25 -0
- package/dist/components/icons/VolumeVLow.d.ts +3 -0
- package/dist/components/icons/VolumeVLow.js +4 -0
- package/dist/components/icons/VolumeVLow.js.map +1 -0
- package/dist/components/icons/VolumeVLow.tsx +14 -0
- package/dist/components/icons/index.d.ts +4 -0
- package/dist/components/icons/index.js +4 -0
- package/dist/components/icons/index.js.map +1 -1
- package/dist/components/icons/index.ts +19 -15
- package/dist/index.css +17 -2
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +369 -261
- package/dist/styles/tailwind.css +17 -2
- package/dist/types.d.ts +2 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -352,31 +352,6 @@ var LeftArrowIcon_default = SvgLeftArrowIcon;
|
|
352
352
|
|
353
353
|
// src/components/icons/MuteIcon.tsx
|
354
354
|
import { jsx as jsx10, jsxs } from "react/jsx-runtime";
|
355
|
-
var SvgMuteIcon = (props) => /* @__PURE__ */ jsxs(
|
356
|
-
"svg",
|
357
|
-
__spreadProps(__spreadValues({
|
358
|
-
xmlns: "http://www.w3.org/2000/svg",
|
359
|
-
width: "1em",
|
360
|
-
height: "1em",
|
361
|
-
fill: "none",
|
362
|
-
viewBox: "0 0 17 13"
|
363
|
-
}, props), {
|
364
|
-
children: [
|
365
|
-
/* @__PURE__ */ jsx10("path", { fill: "#FFF", d: "M7.925 1.5 4.59 4.357H1.925v4.286H4.59L7.925 11.5z" }),
|
366
|
-
/* @__PURE__ */ jsx10(
|
367
|
-
"path",
|
368
|
-
{
|
369
|
-
stroke: "#E5E7EB",
|
370
|
-
strokeLinecap: "round",
|
371
|
-
strokeLinejoin: "round",
|
372
|
-
strokeWidth: 2,
|
373
|
-
d: "m15.925 4.357-4 4.286m0-4.286 4 4.286m-8-7.143L4.59 4.357H1.925v4.286H4.59L7.925 11.5z"
|
374
|
-
}
|
375
|
-
)
|
376
|
-
]
|
377
|
-
})
|
378
|
-
);
|
379
|
-
var MuteIcon_default = SvgMuteIcon;
|
380
355
|
|
381
356
|
// src/components/icons/NoteIcon.tsx
|
382
357
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
@@ -447,58 +422,32 @@ var SvgSettingsIcon = (props) => /* @__PURE__ */ jsx15(
|
|
447
422
|
);
|
448
423
|
var SettingsIcon_default = SvgSettingsIcon;
|
449
424
|
|
450
|
-
// src/components/icons/UnmuteIcon.tsx
|
451
|
-
import { jsx as jsx16 } from "react/jsx-runtime";
|
452
|
-
var SvgUnmuteIcon = (props) => /* @__PURE__ */ jsx16(
|
453
|
-
"svg",
|
454
|
-
__spreadProps(__spreadValues({
|
455
|
-
xmlns: "http://www.w3.org/2000/svg",
|
456
|
-
width: "1em",
|
457
|
-
height: "1em",
|
458
|
-
fill: "none",
|
459
|
-
viewBox: "0 0 8 15"
|
460
|
-
}, props), {
|
461
|
-
children: /* @__PURE__ */ jsx16(
|
462
|
-
"path",
|
463
|
-
{
|
464
|
-
fill: "#FFF",
|
465
|
-
d: "M7.659 14.275h-.001l-3.979-3.251a.16.16 0 0 0-.104-.035H2.252A1.33 1.33 0 0 1 .924 9.66V5.32A1.33 1.33 0 0 1 2.252 3.99h1.323a.16.16 0 0 0 .101-.035L7.66.725a.163.163 0 0 1 .265.126v13.297a.162.162 0 0 1-.264.127z"
|
466
|
-
}
|
467
|
-
)
|
468
|
-
})
|
469
|
-
);
|
470
|
-
var UnmuteIcon_default = SvgUnmuteIcon;
|
471
|
-
|
472
|
-
// src/components/icons/SubtitlesIcon.tsx
|
473
|
-
import { jsx as jsx17, jsxs as jsxs2 } from "react/jsx-runtime";
|
474
|
-
|
475
425
|
// src/components/icons/SubIcon.tsx
|
476
|
-
import { jsx as
|
477
|
-
var SvgSubIcon = (props) => /* @__PURE__ */
|
426
|
+
import { jsx as jsx16, jsxs as jsxs2 } from "react/jsx-runtime";
|
427
|
+
var SvgSubIcon = (props) => /* @__PURE__ */ jsxs2(
|
478
428
|
"svg",
|
479
429
|
__spreadProps(__spreadValues({
|
480
430
|
xmlns: "http://www.w3.org/2000/svg",
|
481
431
|
width: "1em",
|
482
432
|
height: "1em",
|
483
433
|
fill: "none",
|
484
|
-
stroke: "currentColor",
|
485
434
|
viewBox: "0 0 15 15"
|
486
435
|
}, props), {
|
487
436
|
children: [
|
488
|
-
/* @__PURE__ */
|
437
|
+
/* @__PURE__ */ jsx16(
|
489
438
|
"path",
|
490
439
|
{
|
491
|
-
stroke: "
|
440
|
+
stroke: "#D1D5DB",
|
492
441
|
strokeLinecap: "round",
|
493
442
|
strokeLinejoin: "round",
|
494
443
|
strokeWidth: 1.5,
|
495
444
|
d: "M1.25 7.5c0-2.487 0-3.731.658-4.561q.159-.2.346-.367c.785-.697 1.96-.697 4.309-.697h1.875c2.349 0 3.523 0 4.307.697q.19.168.347.367c.658.83.658 2.074.658 4.561s0 3.731-.658 4.561q-.157.2-.347.367c-.784.697-1.957.697-4.307.697H6.562c-2.349 0-3.523 0-4.308-.697a3 3 0 0 1-.346-.367c-.658-.83-.658-2.073-.658-4.561"
|
496
445
|
}
|
497
446
|
),
|
498
|
-
/* @__PURE__ */
|
447
|
+
/* @__PURE__ */ jsx16(
|
499
448
|
"path",
|
500
449
|
{
|
501
|
-
stroke: "
|
450
|
+
stroke: "#D1D5DB",
|
502
451
|
strokeLinecap: "round",
|
503
452
|
strokeLinejoin: "round",
|
504
453
|
strokeWidth: 1.5,
|
@@ -510,15 +459,105 @@ var SvgSubIcon = (props) => /* @__PURE__ */ jsxs3(
|
|
510
459
|
);
|
511
460
|
var SubIcon_default = SvgSubIcon;
|
512
461
|
|
513
|
-
// src/components/
|
462
|
+
// src/components/icons/SubtitlesIcon.tsx
|
463
|
+
import { jsx as jsx17, jsxs as jsxs3 } from "react/jsx-runtime";
|
464
|
+
|
465
|
+
// src/components/icons/UnmuteIcon.tsx
|
466
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
467
|
+
|
468
|
+
// src/components/icons/VolumeHigh.tsx
|
514
469
|
import { jsx as jsx19, jsxs as jsxs4 } from "react/jsx-runtime";
|
470
|
+
var SvgVolumeHigh = (props) => /* @__PURE__ */ jsxs4(
|
471
|
+
"svg",
|
472
|
+
__spreadProps(__spreadValues({
|
473
|
+
xmlns: "http://www.w3.org/2000/svg",
|
474
|
+
width: "1em",
|
475
|
+
height: "1em",
|
476
|
+
fill: "#fff",
|
477
|
+
viewBox: "0 0 512 512"
|
478
|
+
}, props), {
|
479
|
+
children: [
|
480
|
+
/* @__PURE__ */ jsx19("path", { d: "M264 416.19a23.92 23.92 0 0 1-14.21-4.69l-.66-.51-91.46-75H88a24 24 0 0 1-24-24V200a24 24 0 0 1 24-24h69.65l91.46-75 .66-.51A24 24 0 0 1 288 119.83v272.34a24 24 0 0 1-24 24ZM352 336a16 16 0 0 1-14.29-23.18c9.49-18.9 14.3-38 14.3-56.82 0-19.36-4.66-37.92-14.25-56.73a16 16 0 0 1 28.5-14.54C378.2 208.16 384 231.47 384 256c0 23.83-6 47.78-17.7 71.18A16 16 0 0 1 352 336" }),
|
481
|
+
/* @__PURE__ */ jsx19("path", { d: "M400 384a16 16 0 0 1-13.87-24C405 327.05 416 299.45 416 256c0-44.12-10.94-71.52-29.83-103.95A16 16 0 0 1 413.83 136C434.92 172.16 448 204.88 448 256c0 50.36-13.06 83.24-34.12 120a16 16 0 0 1-13.88 8" })
|
482
|
+
]
|
483
|
+
})
|
484
|
+
);
|
485
|
+
var VolumeHigh_default = SvgVolumeHigh;
|
486
|
+
|
487
|
+
// src/components/icons/VolumeLow.tsx
|
488
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
489
|
+
var SvgVolumeLow = (props) => /* @__PURE__ */ jsx20(
|
490
|
+
"svg",
|
491
|
+
__spreadProps(__spreadValues({
|
492
|
+
xmlns: "http://www.w3.org/2000/svg",
|
493
|
+
width: "1em",
|
494
|
+
height: "1em",
|
495
|
+
fill: "#fff",
|
496
|
+
viewBox: "0 0 512 512"
|
497
|
+
}, props), {
|
498
|
+
children: /* @__PURE__ */ jsx20("path", { d: "M296 416.19a23.92 23.92 0 0 1-14.21-4.69l-.66-.51-91.46-75H120a24 24 0 0 1-24-24V200a24 24 0 0 1 24-24h69.65l91.46-75 .66-.51A24 24 0 0 1 320 119.83v272.34a24 24 0 0 1-24 24ZM384 336a16 16 0 0 1-14.29-23.18c9.49-18.9 14.3-38 14.3-56.82 0-19.36-4.66-37.92-14.25-56.73a16 16 0 0 1 28.5-14.54C410.2 208.16 416 231.47 416 256c0 23.83-6 47.78-17.7 71.18A16 16 0 0 1 384 336" })
|
499
|
+
})
|
500
|
+
);
|
501
|
+
var VolumeLow_default = SvgVolumeLow;
|
502
|
+
|
503
|
+
// src/components/icons/VolumeMute.tsx
|
504
|
+
import { jsx as jsx21, jsxs as jsxs5 } from "react/jsx-runtime";
|
505
|
+
var SvgVolumeMute = (props) => /* @__PURE__ */ jsxs5(
|
506
|
+
"svg",
|
507
|
+
__spreadProps(__spreadValues({
|
508
|
+
xmlns: "http://www.w3.org/2000/svg",
|
509
|
+
width: "1em",
|
510
|
+
height: "1em",
|
511
|
+
fill: "#fff",
|
512
|
+
viewBox: "0 0 512 512"
|
513
|
+
}, props), {
|
514
|
+
children: [
|
515
|
+
/* @__PURE__ */ jsx21(
|
516
|
+
"path",
|
517
|
+
{
|
518
|
+
d: "M416 432 64 80",
|
519
|
+
style: {
|
520
|
+
fill: "none",
|
521
|
+
stroke: "#fff",
|
522
|
+
strokeLinecap: "round",
|
523
|
+
strokeMiterlimit: 10,
|
524
|
+
strokeWidth: 32
|
525
|
+
}
|
526
|
+
}
|
527
|
+
),
|
528
|
+
/* @__PURE__ */ jsx21("path", { d: "M243.33 98.86a23.89 23.89 0 0 0-25.55 1.82l-.66.51-28.52 23.35a8 8 0 0 0-.59 11.85l54.33 54.33a8 8 0 0 0 13.66-5.66v-64.49a24.51 24.51 0 0 0-12.67-21.71M251.33 335.29 96.69 180.69A16 16 0 0 0 85.38 176H56a24 24 0 0 0-24 24v112a24 24 0 0 0 24 24h69.76l92 75.31a23.9 23.9 0 0 0 25.87 1.69A24.51 24.51 0 0 0 256 391.45v-44.86a16 16 0 0 0-4.67-11.3M352 256c0-24.56-5.81-47.87-17.75-71.27a16 16 0 1 0-28.5 14.55C315.34 218.06 320 236.62 320 256q0 4-.31 8.13a8 8 0 0 0 2.32 6.25l14.36 14.36a8 8 0 0 0 13.55-4.31A146 146 0 0 0 352 256M416 256c0-51.18-13.08-83.89-34.18-120.06a16 16 0 0 0-27.64 16.12C373.07 184.44 384 211.83 384 256c0 23.83-3.29 42.88-9.37 60.65a8 8 0 0 0 1.9 8.26L389 337.4a8 8 0 0 0 13.13-2.79C411 311.76 416 287.26 416 256" }),
|
529
|
+
/* @__PURE__ */ jsx21("path", { d: "M480 256c0-74.25-20.19-121.11-50.51-168.61a16 16 0 1 0-27 17.22C429.82 147.38 448 189.5 448 256c0 46.19-8.43 80.27-22.43 110.53a8 8 0 0 0 1.59 9l11.92 11.92a8 8 0 0 0 12.92-2.16C471.6 344.9 480 305 480 256" })
|
530
|
+
]
|
531
|
+
})
|
532
|
+
);
|
533
|
+
var VolumeMute_default = SvgVolumeMute;
|
534
|
+
|
535
|
+
// src/components/icons/VolumeVLow.tsx
|
536
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
537
|
+
var SvgVolumeVLow = (props) => /* @__PURE__ */ jsx22(
|
538
|
+
"svg",
|
539
|
+
__spreadProps(__spreadValues({
|
540
|
+
xmlns: "http://www.w3.org/2000/svg",
|
541
|
+
width: "1em",
|
542
|
+
height: "1em",
|
543
|
+
fill: "#fff",
|
544
|
+
viewBox: "0 0 512 512"
|
545
|
+
}, props), {
|
546
|
+
children: /* @__PURE__ */ jsx22("path", { d: "M344 416a23.92 23.92 0 0 1-14.21-4.69c-.23-.16-.44-.33-.66-.51l-91.46-74.9H168a24 24 0 0 1-24-24V200.07a24 24 0 0 1 24-24h69.65l91.46-74.9c.22-.18.43-.35.66-.51A24 24 0 0 1 368 120v272a24 24 0 0 1-24 24" })
|
547
|
+
})
|
548
|
+
);
|
549
|
+
var VolumeVLow_default = SvgVolumeVLow;
|
550
|
+
|
551
|
+
// src/components/VolumeSlider/index.tsx
|
552
|
+
import { jsx as jsx23, jsxs as jsxs6 } from "react/jsx-runtime";
|
515
553
|
var MIN = 0;
|
516
554
|
var MAX = 100;
|
517
555
|
var VolumeSlider = ({
|
518
556
|
width = 0,
|
519
557
|
setIsSeeking,
|
520
558
|
handleControlDisplayTimer,
|
521
|
-
volumeSliderToggler
|
559
|
+
volumeSliderToggler,
|
560
|
+
isTrailer
|
522
561
|
}) => {
|
523
562
|
const { player } = useSoftBuildersVideoPlayerContext();
|
524
563
|
const [isVisible, setVisible] = useState2(false);
|
@@ -534,6 +573,20 @@ var VolumeSlider = ({
|
|
534
573
|
player == null ? void 0 : player.off("volumechange", updateVolumeState);
|
535
574
|
};
|
536
575
|
}, [player]);
|
576
|
+
const handleVolumeSliderClick = (e) => {
|
577
|
+
e.stopPropagation();
|
578
|
+
const slider = e.currentTarget;
|
579
|
+
const rect = slider.getBoundingClientRect();
|
580
|
+
const offsetX = e.clientY - rect.top;
|
581
|
+
const newVolume = offsetX / rect.height * 100;
|
582
|
+
setVolume(newVolume);
|
583
|
+
player == null ? void 0 : player.volume(newVolume / 100);
|
584
|
+
if (newVolume === 0) {
|
585
|
+
player == null ? void 0 : player.muted(true);
|
586
|
+
} else {
|
587
|
+
player == null ? void 0 : player.muted(false);
|
588
|
+
}
|
589
|
+
};
|
537
590
|
const timeoutRef = React2.useRef(null);
|
538
591
|
useEffect2(() => {
|
539
592
|
setVisible(false);
|
@@ -549,7 +602,7 @@ var VolumeSlider = ({
|
|
549
602
|
if (volume == 0 && !isVisible) {
|
550
603
|
setVolume(60);
|
551
604
|
player == null ? void 0 : player.volume(0.6);
|
552
|
-
player == null ? void 0 : player.muted(false);
|
605
|
+
player && (player == null ? void 0 : player.muted(false));
|
553
606
|
}
|
554
607
|
setVisible((prev) => !prev);
|
555
608
|
timeoutRef.current = setTimeout(() => {
|
@@ -563,46 +616,62 @@ var VolumeSlider = ({
|
|
563
616
|
setVolume(newVolume);
|
564
617
|
player == null ? void 0 : player.volume(newVolume / 100);
|
565
618
|
if (newVolume === 0) {
|
566
|
-
player == null ? void 0 : player.muted(true);
|
619
|
+
player && (player == null ? void 0 : player.muted(true));
|
567
620
|
} else {
|
568
|
-
player == null ? void 0 : player.muted(false);
|
621
|
+
player && (player == null ? void 0 : player.muted(false));
|
569
622
|
}
|
570
623
|
};
|
571
|
-
|
624
|
+
const handleDoubleClick = (e) => {
|
625
|
+
setVolume(0);
|
626
|
+
player == null ? void 0 : player.muted(true);
|
627
|
+
};
|
628
|
+
return /* @__PURE__ */ jsxs6(
|
572
629
|
"div",
|
573
630
|
{
|
574
|
-
className: `sb-flex ${isVisible ? "" : ""} ${width > 400 ? "sb-flex-col-reverse" :
|
631
|
+
className: `sb-flex ${isVisible ? "" : ""} ${width > 400 && !isTrailer ? "sb-flex-col-reverse" : `sb-flex-col ${isTrailer ? "sb-justify-start" : ""}`} sb-items-center sb-gap-1 sb-h-full`,
|
575
632
|
children: [
|
576
|
-
/* @__PURE__ */
|
633
|
+
/* @__PURE__ */ jsx23(
|
577
634
|
"div",
|
578
635
|
{
|
579
|
-
className: `sb-flex sb-relative ${width < 400 ? "-sb-top-1" : "sb-top-1"}`,
|
636
|
+
className: `sb-flex sb-relative ${width < 400 || isTrailer ? "-sb-top-1" : "sb-top-1"}`,
|
580
637
|
onClick: toggleVisibility,
|
581
|
-
|
582
|
-
|
638
|
+
onDoubleClick: handleDoubleClick,
|
639
|
+
children: volume == 0 || (player == null ? void 0 : player.muted()) ? /* @__PURE__ */ jsx23(
|
640
|
+
VolumeMute_default,
|
583
641
|
{
|
584
|
-
className: `sb-w-3 sb-h-3 ${width < 400 ? "" : ""} sb-h-5 sb-w-5`
|
642
|
+
className: `sb-w-3 sb-h-3 ${width < 400 || isTrailer ? "" : ""} sb-h-5 sb-w-5`
|
585
643
|
}
|
586
|
-
) : /* @__PURE__ */
|
587
|
-
|
644
|
+
) : volume < 25 ? /* @__PURE__ */ jsx23(
|
645
|
+
VolumeVLow_default,
|
588
646
|
{
|
589
|
-
className: `sb-w-3 sb-h-3 ${width < 400 ? "" : ""} sb-h-5 sb-w-5`
|
647
|
+
className: `sb-w-3 sb-h-3 ${width < 400 || isTrailer ? "" : ""} sb-h-5 sb-w-5`
|
648
|
+
}
|
649
|
+
) : volume < 50 ? /* @__PURE__ */ jsx23(
|
650
|
+
VolumeLow_default,
|
651
|
+
{
|
652
|
+
className: `sb-w-3 sb-h-3 ${width < 400 || isTrailer ? "" : ""} sb-h-5 sb-w-5`
|
653
|
+
}
|
654
|
+
) : /* @__PURE__ */ jsx23(
|
655
|
+
VolumeHigh_default,
|
656
|
+
{
|
657
|
+
className: `sb-w-3 sb-h-3 ${width < 400 || isTrailer ? "" : ""} sb-h-5 sb-w-5`
|
590
658
|
}
|
591
659
|
)
|
592
660
|
}
|
593
661
|
),
|
594
|
-
/* @__PURE__ */
|
662
|
+
/* @__PURE__ */ jsx23("div", { className: "sb-flex sb-w-fit sb-h-fit sb-items-center sb-justify-center", children: /* @__PURE__ */ jsx23(
|
595
663
|
"div",
|
596
664
|
{
|
597
|
-
className: `sb-transition-all sb-ease-in-out sb-duration-500 ${isVisible ? "sb-w-[22px] sb-opacity-100 sb-visible" : "sb-w-[22px] sb-opacity-0 sb-invisible"} ${width > 400 ? "-sb-rotate-90 -sb-translate-y-1" : "sb-rotate-90 sb-translate-y-1"} sb-relative`,
|
598
|
-
children: /* @__PURE__ */
|
665
|
+
className: `sb-p-1 !sb-h-fit sb-transition-all sb-ease-in-out sb-duration-500 ${isVisible ? "sb-w-[22px] sb-opacity-100 sb-visible" : "sb-w-[22px] sb-opacity-0 sb-invisible"} ${width > 400 && !isTrailer ? "-sb-rotate-90 -sb-translate-y-1" : "sb-rotate-90 sb-translate-y-1"} sb-relative`,
|
666
|
+
children: /* @__PURE__ */ jsx23(
|
599
667
|
Slider_default,
|
600
668
|
{
|
601
669
|
value: volume,
|
602
670
|
handleValueChange,
|
603
671
|
min: MIN,
|
604
672
|
max: MAX,
|
605
|
-
className: "!sb-w-16"
|
673
|
+
className: "!sb-w-16 ",
|
674
|
+
handleSliderClick: handleVolumeSliderClick
|
606
675
|
}
|
607
676
|
)
|
608
677
|
}
|
@@ -618,7 +687,7 @@ import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
618
687
|
|
619
688
|
// src/components/MenuButton/index.tsx
|
620
689
|
import { useCallback, useEffect as useEffect3, useRef, useState as useState3 } from "react";
|
621
|
-
import { jsx as
|
690
|
+
import { jsx as jsx24, jsxs as jsxs7 } from "react/jsx-runtime";
|
622
691
|
var MenuButton = ({
|
623
692
|
buttonContent,
|
624
693
|
menuContent,
|
@@ -653,14 +722,14 @@ var MenuButton = ({
|
|
653
722
|
useEffect3(() => {
|
654
723
|
setNoteOpen && setNoteOpen(isOpen);
|
655
724
|
}, [isOpen]);
|
656
|
-
return /* @__PURE__ */
|
725
|
+
return /* @__PURE__ */ jsxs7(
|
657
726
|
"div",
|
658
727
|
{
|
659
728
|
onMouseEnter,
|
660
729
|
onMouseLeave,
|
661
730
|
className: "sb-relative sb-flex sb-items-end",
|
662
731
|
children: [
|
663
|
-
/* @__PURE__ */
|
732
|
+
/* @__PURE__ */ jsx24(
|
664
733
|
"button",
|
665
734
|
{
|
666
735
|
ref: buttonRef,
|
@@ -676,7 +745,7 @@ var MenuButton = ({
|
|
676
745
|
children: buttonContent
|
677
746
|
}
|
678
747
|
),
|
679
|
-
!disablePopUp && isOpen && /* @__PURE__ */
|
748
|
+
!disablePopUp && isOpen && /* @__PURE__ */ jsx24(
|
680
749
|
"div",
|
681
750
|
{
|
682
751
|
ref: menuRef,
|
@@ -694,31 +763,32 @@ var MenuButton = ({
|
|
694
763
|
var MenuButton_default = MenuButton;
|
695
764
|
|
696
765
|
// src/components/QualityMenu/index.tsx
|
697
|
-
import { jsx as
|
766
|
+
import { jsx as jsx25, jsxs as jsxs8 } from "react/jsx-runtime";
|
698
767
|
var QualityOption = ({
|
699
768
|
isSelected,
|
700
769
|
quality,
|
701
770
|
onClick,
|
702
|
-
width
|
771
|
+
width,
|
772
|
+
isTrailer
|
703
773
|
}) => {
|
704
|
-
return /* @__PURE__ */
|
774
|
+
return /* @__PURE__ */ jsx25(
|
705
775
|
"button",
|
706
776
|
{
|
707
|
-
className: `hover:sb-text-orange-500 ${width > 400 ? "sb-p-2" : "sp-pb-1"}`,
|
777
|
+
className: `hover:sb-text-orange-500 ${width > 400 && !isTrailer ? "sb-p-2" : "sp-pb-1"}`,
|
708
778
|
onClick,
|
709
|
-
children: /* @__PURE__ */
|
710
|
-
/* @__PURE__ */
|
779
|
+
children: /* @__PURE__ */ jsxs8("div", { className: "sb-grid sb-grid-cols-12 sb-items-center sb-gap-2", children: [
|
780
|
+
/* @__PURE__ */ jsx25("div", { className: "sb-col-span-3", children: isSelected ? /* @__PURE__ */ jsx25(
|
711
781
|
CheckedIcon_default,
|
712
782
|
{
|
713
|
-
className: `${width > 400 ? "sb-w-5 sb-h-5" : "sb-w-3 sb-h-3"}`
|
783
|
+
className: `${width > 400 && !isTrailer ? "sb-w-5 sb-h-5" : "sb-w-3 sb-h-3"}`
|
714
784
|
}
|
715
|
-
) : /* @__PURE__ */
|
716
|
-
/* @__PURE__ */
|
785
|
+
) : /* @__PURE__ */ jsx25("div", {}) }),
|
786
|
+
/* @__PURE__ */ jsx25("p", { className: "sb-text-left sb-col-span-9", children: quality == null ? void 0 : quality.label })
|
717
787
|
] })
|
718
788
|
}
|
719
789
|
);
|
720
790
|
};
|
721
|
-
var QualityMenu = ({ width, onClick }) => {
|
791
|
+
var QualityMenu = ({ width, onClick, isTrailer }) => {
|
722
792
|
const { player } = useSoftBuildersVideoPlayerContext();
|
723
793
|
const [closeMenuFunction, setCloseMenuFunction] = useState4(void 0);
|
724
794
|
const [qualities, setQualities] = useState4(
|
@@ -742,25 +812,25 @@ var QualityMenu = ({ width, onClick }) => {
|
|
742
812
|
}
|
743
813
|
}
|
744
814
|
}, [player]);
|
745
|
-
return /* @__PURE__ */
|
815
|
+
return /* @__PURE__ */ jsx25(
|
746
816
|
MenuButton_default,
|
747
817
|
{
|
748
|
-
classContainer: `${width < 400 ? "!sb-top-8 -sb-left-9" : ""}`,
|
818
|
+
classContainer: `${width < 400 || isTrailer ? "!sb-top-8 -sb-left-9" : ""}`,
|
749
819
|
onClick: (e, isOpen) => {
|
750
820
|
onClick && onClick(e, isOpen);
|
751
821
|
},
|
752
|
-
buttonContent: /* @__PURE__ */
|
753
|
-
menuContent: /* @__PURE__ */
|
822
|
+
buttonContent: /* @__PURE__ */ jsx25(SettingsIcon_default, { className: "sb-w-3 sb-h-3" }),
|
823
|
+
menuContent: /* @__PURE__ */ jsx25(
|
754
824
|
"div",
|
755
825
|
{
|
756
|
-
className: `sb-rounded-md sb-bg-[#303030] sb-bg-opacity-50 ${width > 400 ? "sb-w-[150px] sb-py-5" : "sb-w-[90px] sb-items-center sb-justify-center sb-py-1"}`,
|
757
|
-
children: /* @__PURE__ */
|
758
|
-
/* @__PURE__ */
|
826
|
+
className: `sb-rounded-md sb-bg-[#303030] sb-bg-opacity-50 ${width > 400 && !isTrailer ? "sb-w-[150px] sb-py-5" : "sb-w-[90px] sb-items-center sb-justify-center sb-py-1"}`,
|
827
|
+
children: /* @__PURE__ */ jsxs8("div", { className: "sb-flex sb-flex-col sb-gap-3", children: [
|
828
|
+
/* @__PURE__ */ jsxs8(
|
759
829
|
"div",
|
760
830
|
{
|
761
831
|
className: `sb-px-5 sb-flex sb-flex-row sb-gap-3 sb-items-start sb-relative sb-top-2`,
|
762
832
|
children: [
|
763
|
-
/* @__PURE__ */
|
833
|
+
/* @__PURE__ */ jsx25(
|
764
834
|
"button",
|
765
835
|
{
|
766
836
|
onClick: () => {
|
@@ -769,19 +839,20 @@ var QualityMenu = ({ width, onClick }) => {
|
|
769
839
|
}
|
770
840
|
},
|
771
841
|
className: "hover:sb-scale-150",
|
772
|
-
children: /* @__PURE__ */
|
842
|
+
children: /* @__PURE__ */ jsx25(LeftArrowIcon_default, { className: "sb-w-3 sb-h-3" })
|
773
843
|
}
|
774
844
|
),
|
775
|
-
/* @__PURE__ */
|
845
|
+
/* @__PURE__ */ jsx25("h3", { children: "Quality" })
|
776
846
|
]
|
777
847
|
}
|
778
848
|
),
|
779
|
-
/* @__PURE__ */
|
780
|
-
/* @__PURE__ */
|
781
|
-
return /* @__PURE__ */
|
849
|
+
/* @__PURE__ */ jsx25("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }),
|
850
|
+
/* @__PURE__ */ jsx25("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-3 sb-items-start ", children: qualities == null ? void 0 : qualities.map((q, i) => {
|
851
|
+
return /* @__PURE__ */ jsx25(
|
782
852
|
QualityOption,
|
783
853
|
{
|
784
854
|
width,
|
855
|
+
isTrailer,
|
785
856
|
isSelected: currentQualitySrc === (q == null ? void 0 : q.label),
|
786
857
|
quality: q,
|
787
858
|
onClick: () => {
|
@@ -813,7 +884,7 @@ var QualityMenu_default = QualityMenu;
|
|
813
884
|
|
814
885
|
// src/components/CreateNoteMenu/index.tsx
|
815
886
|
import React5, { useState as useState5 } from "react";
|
816
|
-
import { jsx as
|
887
|
+
import { jsx as jsx26, jsxs as jsxs9 } from "react/jsx-runtime";
|
817
888
|
var CreateNoteMenu = ({
|
818
889
|
handleSaveNoteAction,
|
819
890
|
width,
|
@@ -836,7 +907,7 @@ var CreateNoteMenu = ({
|
|
836
907
|
);
|
837
908
|
}
|
838
909
|
};
|
839
|
-
return /* @__PURE__ */
|
910
|
+
return /* @__PURE__ */ jsx26(
|
840
911
|
MenuButton_default,
|
841
912
|
{
|
842
913
|
onMouseEnter,
|
@@ -845,21 +916,21 @@ var CreateNoteMenu = ({
|
|
845
916
|
noteButtonClick,
|
846
917
|
setNoteOpen,
|
847
918
|
classContainer: `${width < 400 ? "!sb-top-8 -sb-left-[9.75rem]" : ""}`,
|
848
|
-
buttonContent: /* @__PURE__ */
|
849
|
-
menuContent: /* @__PURE__ */
|
919
|
+
buttonContent: /* @__PURE__ */ jsx26(ClosedNoteIcon_default, { className: "sb-w-3 sb-h-3" }),
|
920
|
+
menuContent: /* @__PURE__ */ jsx26(
|
850
921
|
"div",
|
851
922
|
{
|
852
923
|
className: `sb-rounded-md sb-bg-[#303030] sb-bg-opacity-50 ${width > 400 ? " sb-py-5 sb-w-[220px]" : "sb-py-1 sb-w-[150px]"}`,
|
853
|
-
children: /* @__PURE__ */
|
924
|
+
children: /* @__PURE__ */ jsxs9(
|
854
925
|
"div",
|
855
926
|
{
|
856
927
|
className: "sb-flex sb-flex-col sb-gap-3 sb-items-center sb-justify-center",
|
857
928
|
onClick: (e) => e.stopPropagation(),
|
858
929
|
children: [
|
859
|
-
/* @__PURE__ */
|
860
|
-
/* @__PURE__ */
|
861
|
-
/* @__PURE__ */
|
862
|
-
/* @__PURE__ */
|
930
|
+
/* @__PURE__ */ jsx26("h3", { className: "sb-px-5", children: "Add Note" }),
|
931
|
+
/* @__PURE__ */ jsx26("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }),
|
932
|
+
/* @__PURE__ */ jsxs9("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-4 sb-items-start", children: [
|
933
|
+
/* @__PURE__ */ jsx26(
|
863
934
|
"input",
|
864
935
|
{
|
865
936
|
onClick: (e) => e.stopPropagation(),
|
@@ -872,7 +943,7 @@ var CreateNoteMenu = ({
|
|
872
943
|
className: "sb-text-white placeholder:sb-text-white sb-w-full sb-bg-transparent sb-px-4 sb-py-3 sb-border sb-border-[#AAAAAA] sb-rounded-md"
|
873
944
|
}
|
874
945
|
),
|
875
|
-
/* @__PURE__ */
|
946
|
+
/* @__PURE__ */ jsx26("button", { className: "sb-w-full", onClick: handleSaveNote, children: /* @__PURE__ */ jsx26("div", { className: "sb-px-4 sb-py-3 sb-text-center sb-font-bold sb-bg-orange-500 sb-rounded-md", children: "Save" }) })
|
876
947
|
] })
|
877
948
|
]
|
878
949
|
}
|
@@ -891,10 +962,10 @@ import { useEffect as useEffect6, useState as useState7 } from "react";
|
|
891
962
|
import { useState as useState6 } from "react";
|
892
963
|
|
893
964
|
// src/components/Tooltip/index.tsx
|
894
|
-
import { jsx as
|
965
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
895
966
|
var Tooltip = ({ open, children }) => {
|
896
967
|
if (!open) return null;
|
897
|
-
return /* @__PURE__ */
|
968
|
+
return /* @__PURE__ */ jsx27(
|
898
969
|
"div",
|
899
970
|
{
|
900
971
|
className: "sb-absolute sb-bottom-full sb-mb-2 sb-left-1/2 sb-transform sb--translate-x-1/2 sb-z-10 sb-whitespace-nowrap",
|
@@ -905,14 +976,14 @@ var Tooltip = ({ open, children }) => {
|
|
905
976
|
var Tooltip_default = Tooltip;
|
906
977
|
|
907
978
|
// src/components/NoteTooltip/index.tsx
|
908
|
-
import { jsx as
|
979
|
+
import { jsx as jsx28, jsxs as jsxs10 } from "react/jsx-runtime";
|
909
980
|
var NoteTooltip = ({ note }) => {
|
910
981
|
const [open, setOpen] = useState6(false);
|
911
982
|
const { currentTime, player } = useSoftBuildersVideoPlayerContext();
|
912
983
|
const handleValueChange = () => {
|
913
984
|
player == null ? void 0 : player.currentTime(note.time);
|
914
985
|
};
|
915
|
-
return /* @__PURE__ */
|
986
|
+
return /* @__PURE__ */ jsx28(
|
916
987
|
"div",
|
917
988
|
{
|
918
989
|
onClick: handleValueChange,
|
@@ -920,9 +991,9 @@ var NoteTooltip = ({ note }) => {
|
|
920
991
|
style: { left: `${note == null ? void 0 : note.percentage}%` },
|
921
992
|
onMouseEnter: () => setOpen(true),
|
922
993
|
onMouseLeave: () => setOpen(false),
|
923
|
-
children: /* @__PURE__ */
|
924
|
-
/* @__PURE__ */
|
925
|
-
/* @__PURE__ */
|
994
|
+
children: /* @__PURE__ */ jsx28("div", { className: "sb-relative", children: /* @__PURE__ */ jsx28(Tooltip_default, { open, children: /* @__PURE__ */ jsxs10("div", { className: "sb-flex sb-flex-col sb-gap-2 sb-items-center", children: [
|
995
|
+
/* @__PURE__ */ jsx28("p", { children: note == null ? void 0 : note.label }),
|
996
|
+
/* @__PURE__ */ jsx28("p", { className: "sb-p-2 sb-bg-[#303030] sb-bg-opacity-50 sb-rounded-md", children: durationFormater(note.time) })
|
926
997
|
] }) }) })
|
927
998
|
}
|
928
999
|
);
|
@@ -930,7 +1001,7 @@ var NoteTooltip = ({ note }) => {
|
|
930
1001
|
var NoteTooltip_default = NoteTooltip;
|
931
1002
|
|
932
1003
|
// src/components/NotesPanal/index.tsx
|
933
|
-
import { jsx as
|
1004
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
934
1005
|
var NotesPanal = ({ notes }) => {
|
935
1006
|
const [ns, setNs] = useState7([]);
|
936
1007
|
const { duration } = useSoftBuildersVideoPlayerContext();
|
@@ -943,7 +1014,7 @@ var NotesPanal = ({ notes }) => {
|
|
943
1014
|
});
|
944
1015
|
newNs && setNs(newNs);
|
945
1016
|
}, [notes, duration]);
|
946
|
-
return /* @__PURE__ */
|
1017
|
+
return /* @__PURE__ */ jsx29("div", { id: "notes-panal", className: "sb-w-full sb-h-full sb-relative ", children: ns.map((n, i) => /* @__PURE__ */ jsx29(NoteTooltip_default, { note: n }, `note-${i}-${n.time}`)) });
|
947
1018
|
};
|
948
1019
|
var NotesPanal_default = NotesPanal;
|
949
1020
|
|
@@ -952,7 +1023,7 @@ import { useEffect as useEffect8, useState as useState9 } from "react";
|
|
952
1023
|
|
953
1024
|
// src/components/ChapterTooltip/index.tsx
|
954
1025
|
import { useEffect as useEffect7, useState as useState8 } from "react";
|
955
|
-
import { jsx as
|
1026
|
+
import { jsx as jsx30, jsxs as jsxs11 } from "react/jsx-runtime";
|
956
1027
|
var ChapterTooltip = ({ chapter }) => {
|
957
1028
|
const { player } = useSoftBuildersVideoPlayerContext();
|
958
1029
|
const [open, setOpen] = useState8(false);
|
@@ -974,7 +1045,7 @@ var ChapterTooltip = ({ chapter }) => {
|
|
974
1045
|
const clickedTime = chapter.startTime + clickPercentage * (chapter.endTime - chapter.startTime);
|
975
1046
|
player == null ? void 0 : player.currentTime(clickedTime);
|
976
1047
|
};
|
977
|
-
return /* @__PURE__ */
|
1048
|
+
return /* @__PURE__ */ jsx30(
|
978
1049
|
"div",
|
979
1050
|
{
|
980
1051
|
id: `ii-section-${chapter.title}`,
|
@@ -985,15 +1056,15 @@ var ChapterTooltip = ({ chapter }) => {
|
|
985
1056
|
},
|
986
1057
|
onMouseEnter: () => setOpen(true),
|
987
1058
|
onMouseLeave: () => setOpen(false),
|
988
|
-
children: /* @__PURE__ */
|
1059
|
+
children: /* @__PURE__ */ jsx30(
|
989
1060
|
"button",
|
990
1061
|
{
|
991
1062
|
id: `section-${chapter.title}`,
|
992
1063
|
className: "sb-h-full sb-w-full",
|
993
1064
|
onClick: handleClickChapter,
|
994
|
-
children: /* @__PURE__ */
|
995
|
-
/* @__PURE__ */
|
996
|
-
/* @__PURE__ */
|
1065
|
+
children: /* @__PURE__ */ jsx30("div", { className: "sb-relative sb-flex sb-h-full sb-w-full sb-justify-between sb-items-center", children: /* @__PURE__ */ jsx30(Tooltip_default, { open, children: /* @__PURE__ */ jsxs11("div", { className: "sb-flex sb-flex-col sb-gap-2 sb-items-center", children: [
|
1066
|
+
/* @__PURE__ */ jsx30("p", { children: chapter.title }),
|
1067
|
+
/* @__PURE__ */ jsxs11("p", { className: "sb-p-2 sb-bg-[#303030] sb-bg-opacity-50 sb-rounded-md", children: [
|
997
1068
|
durationFormater(chapter.startTime),
|
998
1069
|
" -",
|
999
1070
|
" ",
|
@@ -1008,7 +1079,7 @@ var ChapterTooltip = ({ chapter }) => {
|
|
1008
1079
|
var ChapterTooltip_default = ChapterTooltip;
|
1009
1080
|
|
1010
1081
|
// src/components/ChaptersPanal/index.tsx
|
1011
|
-
import { jsx as
|
1082
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
1012
1083
|
var ChaptersPanal = ({ chapters }) => {
|
1013
1084
|
const [cs, setCs] = useState9([]);
|
1014
1085
|
const { duration } = useSoftBuildersVideoPlayerContext();
|
@@ -1023,13 +1094,13 @@ var ChaptersPanal = ({ chapters }) => {
|
|
1023
1094
|
});
|
1024
1095
|
newCs && setCs(newCs);
|
1025
1096
|
}, [chapters, duration]);
|
1026
|
-
return /* @__PURE__ */
|
1097
|
+
return /* @__PURE__ */ jsx31("div", { id: "chapters-panal", className: "sb-w-full sb-h-full sb-relative ", children: cs.map((c, i) => /* @__PURE__ */ jsx31(ChapterTooltip_default, { chapter: c }, `chapter-${i}-${c.startTime}`)) });
|
1027
1098
|
};
|
1028
1099
|
var ChaptersPanal_default = ChaptersPanal;
|
1029
1100
|
|
1030
1101
|
// src/components/TimeSlider/index.tsx
|
1031
1102
|
import { useEffect as useEffect9, useState as useState10 } from "react";
|
1032
|
-
import { jsx as
|
1103
|
+
import { jsx as jsx32, jsxs as jsxs12 } from "react/jsx-runtime";
|
1033
1104
|
var MIN2 = 0;
|
1034
1105
|
var MAX2 = 100;
|
1035
1106
|
var DEFERENCE = Math.abs(MAX2 - MIN2);
|
@@ -1078,8 +1149,8 @@ var TimeSlider = ({ chapters }) => {
|
|
1078
1149
|
arr.push(`black 100%`);
|
1079
1150
|
setMaskCuttes(arr.toString());
|
1080
1151
|
}, [chapters, duration]);
|
1081
|
-
return /* @__PURE__ */
|
1082
|
-
/* @__PURE__ */
|
1152
|
+
return /* @__PURE__ */ jsxs12("div", { className: " sb-w-full sb-h-2 sb-flex sb-items-center sb-justify-center", children: [
|
1153
|
+
/* @__PURE__ */ jsx32("div", { className: "sb-absolute sb-top-0 sb-left-0 sb-w-full sb-z-10", children: /* @__PURE__ */ jsx32(
|
1083
1154
|
Slider_default,
|
1084
1155
|
{
|
1085
1156
|
value: timeSlider,
|
@@ -1092,7 +1163,7 @@ var TimeSlider = ({ chapters }) => {
|
|
1092
1163
|
}
|
1093
1164
|
}
|
1094
1165
|
) }),
|
1095
|
-
/* @__PURE__ */
|
1166
|
+
/* @__PURE__ */ jsx32(
|
1096
1167
|
"div",
|
1097
1168
|
{
|
1098
1169
|
className: "sb-absolute sb-top-0 sb-left-0 sb-w-full sb-h-2 sb-bg-slate-400 sb-rounded-md",
|
@@ -1122,24 +1193,24 @@ var TimeSlider = ({ chapters }) => {
|
|
1122
1193
|
var TimeSlider_default = TimeSlider;
|
1123
1194
|
|
1124
1195
|
// src/components/TimeSliderContainer/index.tsx
|
1125
|
-
import { jsx as
|
1196
|
+
import { jsx as jsx33, jsxs as jsxs13 } from "react/jsx-runtime";
|
1126
1197
|
var TimeSliderContainer = ({ notes, chapters }) => {
|
1127
|
-
return /* @__PURE__ */
|
1198
|
+
return /* @__PURE__ */ jsxs13(
|
1128
1199
|
"div",
|
1129
1200
|
{
|
1130
1201
|
id: "time-slider-container",
|
1131
1202
|
className: "sb-w-full sb-relative sb-flex sb-items-center sb-justify-center",
|
1132
1203
|
children: [
|
1133
|
-
/* @__PURE__ */
|
1204
|
+
/* @__PURE__ */ jsx33(
|
1134
1205
|
"div",
|
1135
1206
|
{
|
1136
1207
|
id: "notes-panal",
|
1137
1208
|
className: "sb-absolute sb-w-full sb-h-full sb-top-[27%] sb-left-0",
|
1138
|
-
children: /* @__PURE__ */
|
1209
|
+
children: /* @__PURE__ */ jsx33(NotesPanal_default, { notes })
|
1139
1210
|
}
|
1140
1211
|
),
|
1141
|
-
/* @__PURE__ */
|
1142
|
-
/* @__PURE__ */
|
1212
|
+
/* @__PURE__ */ jsx33("div", { className: "sb-absolute sb-w-full sb-h-full sb-top-0 sb-left-0", children: /* @__PURE__ */ jsx33(ChaptersPanal_default, { chapters }) }),
|
1213
|
+
/* @__PURE__ */ jsx33(TimeSlider_default, { chapters })
|
1143
1214
|
]
|
1144
1215
|
}
|
1145
1216
|
);
|
@@ -1148,7 +1219,7 @@ var TimeSliderContainer_default = TimeSliderContainer;
|
|
1148
1219
|
|
1149
1220
|
// src/components/BufferTracker/index.tsx
|
1150
1221
|
import { useEffect as useEffect10 } from "react";
|
1151
|
-
import { Fragment, jsx as
|
1222
|
+
import { Fragment, jsx as jsx34 } from "react/jsx-runtime";
|
1152
1223
|
var BufferTracker = () => {
|
1153
1224
|
const { player, setDownloadedBufferTimeufferTime } = useSoftBuildersVideoPlayerContext();
|
1154
1225
|
useEffect10(() => {
|
@@ -1157,13 +1228,13 @@ var BufferTracker = () => {
|
|
1157
1228
|
}, 1e3);
|
1158
1229
|
return () => clearInterval(intervalId);
|
1159
1230
|
}, [player]);
|
1160
|
-
return /* @__PURE__ */
|
1231
|
+
return /* @__PURE__ */ jsx34(Fragment, {});
|
1161
1232
|
};
|
1162
1233
|
var BufferTracker_default = BufferTracker;
|
1163
1234
|
|
1164
1235
|
// src/components/CurrentTimeTracker/index.tsx
|
1165
1236
|
import { useEffect as useEffect11 } from "react";
|
1166
|
-
import { Fragment as Fragment2, jsx as
|
1237
|
+
import { Fragment as Fragment2, jsx as jsx35 } from "react/jsx-runtime";
|
1167
1238
|
var CurrentTimeTracker = () => {
|
1168
1239
|
const { setCurrentTime, player } = useSoftBuildersVideoPlayerContext();
|
1169
1240
|
useEffect11(() => {
|
@@ -1172,19 +1243,19 @@ var CurrentTimeTracker = () => {
|
|
1172
1243
|
}, 500);
|
1173
1244
|
return () => clearInterval(intervalId);
|
1174
1245
|
}, [player]);
|
1175
|
-
return /* @__PURE__ */
|
1246
|
+
return /* @__PURE__ */ jsx35(Fragment2, {});
|
1176
1247
|
};
|
1177
1248
|
var CurrentTimeTracker_default = CurrentTimeTracker;
|
1178
1249
|
|
1179
1250
|
// src/components/SubtitleMenu/index.tsx
|
1180
1251
|
import { useEffect as useEffect12, useState as useState11 } from "react";
|
1181
|
-
import { jsx as
|
1252
|
+
import { jsx as jsx36, jsxs as jsxs14 } from "react/jsx-runtime";
|
1182
1253
|
var SubtitleOption = ({
|
1183
1254
|
isSelected,
|
1184
1255
|
subtitle,
|
1185
1256
|
onClick
|
1186
1257
|
}) => {
|
1187
|
-
return /* @__PURE__ */
|
1258
|
+
return /* @__PURE__ */ jsx36(
|
1188
1259
|
"button",
|
1189
1260
|
{
|
1190
1261
|
className: "hover:sb-text-orange-500 sb-p-2",
|
@@ -1192,9 +1263,9 @@ var SubtitleOption = ({
|
|
1192
1263
|
e.stopPropagation();
|
1193
1264
|
onClick(e);
|
1194
1265
|
},
|
1195
|
-
children: /* @__PURE__ */
|
1196
|
-
/* @__PURE__ */
|
1197
|
-
/* @__PURE__ */
|
1266
|
+
children: /* @__PURE__ */ jsxs14("div", { className: "sb-grid sb-grid-cols-12 sb-items-center sb-gap-2", children: [
|
1267
|
+
/* @__PURE__ */ jsx36("div", { className: "sb-col-span-3", children: isSelected ? /* @__PURE__ */ jsx36(CheckedIcon_default, { className: "sb-w-5 sb-h-5" }) : /* @__PURE__ */ jsx36("div", {}) }),
|
1268
|
+
/* @__PURE__ */ jsx36("p", { className: "sb-text-left sb-col-span-9", children: subtitle.label })
|
1198
1269
|
] })
|
1199
1270
|
}
|
1200
1271
|
);
|
@@ -1203,7 +1274,8 @@ var SubtitleMenu = ({
|
|
1203
1274
|
width,
|
1204
1275
|
onClick,
|
1205
1276
|
onMouseEnter,
|
1206
|
-
onMouseLeave
|
1277
|
+
onMouseLeave,
|
1278
|
+
isTrailer
|
1207
1279
|
}) => {
|
1208
1280
|
const { player } = useSoftBuildersVideoPlayerContext();
|
1209
1281
|
const [closeMenuFunction, setCloseMenuFunction] = useState11(void 0);
|
@@ -1226,7 +1298,7 @@ var SubtitleMenu = ({
|
|
1226
1298
|
setSubtitles(textTracks);
|
1227
1299
|
}
|
1228
1300
|
}, [player]);
|
1229
|
-
return /* @__PURE__ */
|
1301
|
+
return /* @__PURE__ */ jsx36(
|
1230
1302
|
MenuButton_default,
|
1231
1303
|
{
|
1232
1304
|
onMouseEnter,
|
@@ -1234,15 +1306,15 @@ var SubtitleMenu = ({
|
|
1234
1306
|
onClick: (e, isOpen) => {
|
1235
1307
|
onClick && onClick(e, isOpen);
|
1236
1308
|
},
|
1237
|
-
classContainer: `${width < 400 ? "!sb-top-8 -sb-left-9" : ""}`,
|
1238
|
-
buttonContent: /* @__PURE__ */
|
1239
|
-
menuContent: /* @__PURE__ */
|
1309
|
+
classContainer: `${width < 400 || isTrailer ? "!sb-top-8 -sb-left-9" : ""}`,
|
1310
|
+
buttonContent: /* @__PURE__ */ jsx36(SubIcon_default, { className: "sb-w-4 sb-h-4 sb-text-white " }),
|
1311
|
+
menuContent: /* @__PURE__ */ jsx36(
|
1240
1312
|
"div",
|
1241
1313
|
{
|
1242
|
-
className: `sb-rounded-md sb-bg-[#303030] sb-bg-opacity-50 ${width > 400 ? "sb-w-[150px] sb-py-5" : "sb-w-[90px] sb-items-center sb-justify-center sb-py-1"}`,
|
1243
|
-
children: /* @__PURE__ */
|
1244
|
-
/* @__PURE__ */
|
1245
|
-
/* @__PURE__ */
|
1314
|
+
className: `sb-rounded-md sb-bg-[#303030] sb-bg-opacity-50 ${width > 400 && !isTrailer ? "sb-w-[150px] sb-py-5" : "sb-w-[90px] sb-items-center sb-justify-center sb-py-1"}`,
|
1315
|
+
children: /* @__PURE__ */ jsxs14("div", { className: "sb-flex sb-flex-col sb-gap-3", children: [
|
1316
|
+
/* @__PURE__ */ jsxs14("div", { className: "sb-px-5 sb-flex sb-flex-row sb-gap-3 sb-items-center sb-justify-center", children: [
|
1317
|
+
/* @__PURE__ */ jsx36(
|
1246
1318
|
"button",
|
1247
1319
|
{
|
1248
1320
|
onClick: () => {
|
@@ -1251,14 +1323,14 @@ var SubtitleMenu = ({
|
|
1251
1323
|
}
|
1252
1324
|
},
|
1253
1325
|
className: "hover:sb-scale-150",
|
1254
|
-
children: /* @__PURE__ */
|
1326
|
+
children: /* @__PURE__ */ jsx36(LeftArrowIcon_default, { className: "sb-w-3 sb-h-3" })
|
1255
1327
|
}
|
1256
1328
|
),
|
1257
|
-
/* @__PURE__ */
|
1329
|
+
/* @__PURE__ */ jsx36("h3", { children: "Subtitle" })
|
1258
1330
|
] }),
|
1259
|
-
/* @__PURE__ */
|
1260
|
-
/* @__PURE__ */
|
1261
|
-
return /* @__PURE__ */
|
1331
|
+
/* @__PURE__ */ jsx36("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }),
|
1332
|
+
/* @__PURE__ */ jsx36("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-3 sb-items-start", children: subtitles.map((q, i) => {
|
1333
|
+
return /* @__PURE__ */ jsx36(
|
1262
1334
|
SubtitleOption,
|
1263
1335
|
{
|
1264
1336
|
isSelected: q.mode === "showing",
|
@@ -1283,7 +1355,7 @@ var SubtitleMenu_default = SubtitleMenu;
|
|
1283
1355
|
|
1284
1356
|
// src/components/Tooltip/GlobalTooltip.tsx
|
1285
1357
|
import { useState as useState12 } from "react";
|
1286
|
-
import { jsx as
|
1358
|
+
import { jsx as jsx37, jsxs as jsxs15 } from "react/jsx-runtime";
|
1287
1359
|
var TooltipModal = ({
|
1288
1360
|
content,
|
1289
1361
|
children,
|
@@ -1293,13 +1365,13 @@ var TooltipModal = ({
|
|
1293
1365
|
const [isOpen, setIsOpen] = useState12(false);
|
1294
1366
|
const showTooltip = () => setIsOpen(true);
|
1295
1367
|
const hideTooltip = () => setIsOpen(false);
|
1296
|
-
return /* @__PURE__ */
|
1368
|
+
return /* @__PURE__ */ jsxs15(
|
1297
1369
|
"div",
|
1298
1370
|
{
|
1299
1371
|
className: "tooltip-container",
|
1300
1372
|
style: { position: "relative", display: "inline-block" },
|
1301
1373
|
children: [
|
1302
|
-
/* @__PURE__ */
|
1374
|
+
/* @__PURE__ */ jsx37(
|
1303
1375
|
"div",
|
1304
1376
|
{
|
1305
1377
|
onMouseEnter: showTooltip,
|
@@ -1308,7 +1380,7 @@ var TooltipModal = ({
|
|
1308
1380
|
children
|
1309
1381
|
}
|
1310
1382
|
),
|
1311
|
-
isOpen && /* @__PURE__ */
|
1383
|
+
isOpen && /* @__PURE__ */ jsx37(
|
1312
1384
|
"div",
|
1313
1385
|
{
|
1314
1386
|
className: `sb-tooltip-modal sb-text-orange-900 sb-my-2 ${width > 400 ? "!sb-bottom-[105%]" : "!sb-top-[105%]"}`,
|
@@ -1333,7 +1405,7 @@ var TooltipModal = ({
|
|
1333
1405
|
var GlobalTooltip_default = TooltipModal;
|
1334
1406
|
|
1335
1407
|
// src/components/ControlBar/index.tsx
|
1336
|
-
import { jsx as
|
1408
|
+
import { Fragment as Fragment3, jsx as jsx38, jsxs as jsxs16 } from "react/jsx-runtime";
|
1337
1409
|
var ControlBar = ({
|
1338
1410
|
player,
|
1339
1411
|
isPaused,
|
@@ -1349,7 +1421,8 @@ var ControlBar = ({
|
|
1349
1421
|
setIsSubtitleMenuOpen,
|
1350
1422
|
setNoteOpen,
|
1351
1423
|
disableNote,
|
1352
|
-
noteButtonClick
|
1424
|
+
noteButtonClick,
|
1425
|
+
isTrailer
|
1353
1426
|
}) => {
|
1354
1427
|
const { setPlayer, setDuration } = useSoftBuildersVideoPlayerContext();
|
1355
1428
|
const [width, setWidth] = useState13(0);
|
@@ -1383,93 +1456,98 @@ var ControlBar = ({
|
|
1383
1456
|
useEffect13(() => {
|
1384
1457
|
setDuration(duration);
|
1385
1458
|
}, [duration]);
|
1386
|
-
return /* @__PURE__ */
|
1459
|
+
return /* @__PURE__ */ jsxs16(
|
1387
1460
|
"div",
|
1388
1461
|
{
|
1389
|
-
className: ` !sb-px-4 sb-flex sb-pt-2 sb-justify-center sb-gap-3 sb-w-full sb-h-full ${width > 400 ? "sb-absolute sb-bottom-1 sb-items-end sb-mb-1 sb-pb-2 " : "sb-items-start"} sb-pb-2`,
|
1462
|
+
className: ` !sb-px-4 sb-flex sb-pt-2 sb-justify-center sb-gap-3 sb-w-full sb-h-full ${width > 400 && !isTrailer ? "sb-absolute sb-bottom-1 sb-items-end sb-mb-1 sb-pb-2 " : "sb-items-start"} sb-pb-2`,
|
1390
1463
|
children: [
|
1391
|
-
/* @__PURE__ */
|
1392
|
-
/* @__PURE__ */
|
1393
|
-
/* @__PURE__ */
|
1394
|
-
"
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1407
|
-
|
1408
|
-
|
1409
|
-
|
1410
|
-
|
1411
|
-
|
1412
|
-
{
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1464
|
+
/* @__PURE__ */ jsx38(BufferTracker_default, {}),
|
1465
|
+
/* @__PURE__ */ jsx38(CurrentTimeTracker_default, {}),
|
1466
|
+
!isTrailer && /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
1467
|
+
" ",
|
1468
|
+
/* @__PURE__ */ jsx38(
|
1469
|
+
"button",
|
1470
|
+
{
|
1471
|
+
onClick: () => {
|
1472
|
+
seek(-seekStep);
|
1473
|
+
},
|
1474
|
+
children: /* @__PURE__ */ jsx38(
|
1475
|
+
GlobalTooltip_default,
|
1476
|
+
{
|
1477
|
+
width,
|
1478
|
+
content: /* @__PURE__ */ jsx38("p", { children: "Backward 5 sec" }),
|
1479
|
+
isLeft: true,
|
1480
|
+
children: /* @__PURE__ */ jsx38(BackwardIcon_default, { className: "sb-w-3 sb-h-3" })
|
1481
|
+
}
|
1482
|
+
)
|
1483
|
+
}
|
1484
|
+
),
|
1485
|
+
/* @__PURE__ */ jsx38("button", { onClick: togglePlay, children: /* @__PURE__ */ jsx38(
|
1486
|
+
GlobalTooltip_default,
|
1487
|
+
{
|
1488
|
+
width,
|
1489
|
+
content: /* @__PURE__ */ jsx38("p", { children: isPaused ? "Play" : "pause" }),
|
1490
|
+
isLeft: true,
|
1491
|
+
children: isPaused ? /* @__PURE__ */ jsx38(PlayIcon_default, { className: "sb-w-3 sb-h-3" }) : /* @__PURE__ */ jsx38(PauseIcon_default, { className: "sb-w-3 sb-h-3" })
|
1492
|
+
}
|
1493
|
+
) }),
|
1494
|
+
/* @__PURE__ */ jsx38(
|
1495
|
+
"button",
|
1496
|
+
{
|
1497
|
+
onClick: (e) => {
|
1498
|
+
e.preventDefault();
|
1499
|
+
seek(seekStep);
|
1500
|
+
},
|
1501
|
+
children: /* @__PURE__ */ jsx38(
|
1502
|
+
GlobalTooltip_default,
|
1503
|
+
{
|
1504
|
+
width,
|
1505
|
+
content: /* @__PURE__ */ jsx38("p", { children: "Forward 5 sec" }),
|
1506
|
+
isLeft: true,
|
1507
|
+
children: /* @__PURE__ */ jsx38(ForwardIcon_default, { className: "sb-w-3 sb-h-3" })
|
1508
|
+
}
|
1509
|
+
)
|
1510
|
+
}
|
1511
|
+
)
|
1512
|
+
] }),
|
1437
1513
|
// isSeeking ||
|
1438
1514
|
// width > 400 &&
|
1439
|
-
/* @__PURE__ */
|
1515
|
+
/* @__PURE__ */ jsx38(
|
1440
1516
|
"div",
|
1441
1517
|
{
|
1442
|
-
className: `${width < 400 ? "sb-flex-1 sb-ml-0 sb-mr-0" : "sb-w-full"}`,
|
1443
|
-
children: /* @__PURE__ */
|
1518
|
+
className: `${width < 400 && !isTrailer ? "sb-flex-1 sb-ml-0 sb-mr-0" : "sb-w-full"}`,
|
1519
|
+
children: /* @__PURE__ */ jsxs16(
|
1444
1520
|
"div",
|
1445
1521
|
{
|
1446
|
-
style: width < 400 ? {
|
1522
|
+
style: width < 400 && !isTrailer ? {
|
1447
1523
|
width: `${width * 0.9}px`,
|
1448
1524
|
left: "5%",
|
1449
1525
|
top: "90%"
|
1450
1526
|
} : { width: "98%" },
|
1451
|
-
className: `flex gap-2 ${width < 400 ? "absolute sb-top-1" : "-sb-translate-y-0 sb-w-full"} hover:sb-w-[45%] `,
|
1527
|
+
className: `flex gap-2 ${width < 400 && !isTrailer ? "absolute sb-top-1" : "-sb-translate-y-0 sb-w-full"} hover:sb-w-[45%] `,
|
1452
1528
|
children: [
|
1453
|
-
/* @__PURE__ */
|
1454
|
-
/* @__PURE__ */
|
1455
|
-
/* @__PURE__ */
|
1529
|
+
/* @__PURE__ */ jsx38(CurrentTimeLabel_default, {}),
|
1530
|
+
/* @__PURE__ */ jsx38(TimeSliderContainer_default, { chapters, notes }),
|
1531
|
+
/* @__PURE__ */ jsx38("p", { children: durationFormater(duration) })
|
1456
1532
|
]
|
1457
1533
|
}
|
1458
1534
|
)
|
1459
1535
|
}
|
1460
1536
|
),
|
1461
|
-
/* @__PURE__ */
|
1537
|
+
/* @__PURE__ */ jsx38("div", { className: "sb-h-full", children: /* @__PURE__ */ jsx38(
|
1462
1538
|
VolumeSlider_default,
|
1463
1539
|
{
|
1540
|
+
isTrailer,
|
1464
1541
|
volumeSliderToggler,
|
1465
1542
|
width,
|
1466
1543
|
setIsSeeking: (val) => setIsSeeking(val),
|
1467
1544
|
handleControlDisplayTimer
|
1468
1545
|
}
|
1469
1546
|
) }),
|
1470
|
-
/* @__PURE__ */
|
1547
|
+
/* @__PURE__ */ jsx38(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx38("p", { children: "Quality" }), children: /* @__PURE__ */ jsx38(
|
1471
1548
|
QualityMenu_default,
|
1472
1549
|
{
|
1550
|
+
isTrailer,
|
1473
1551
|
width,
|
1474
1552
|
onClick: (e, isOpen) => {
|
1475
1553
|
setVolumeToggler(!volumeSliderToggler);
|
@@ -1477,7 +1555,7 @@ var ControlBar = ({
|
|
1477
1555
|
}
|
1478
1556
|
}
|
1479
1557
|
) }),
|
1480
|
-
disableNote && /* @__PURE__ */
|
1558
|
+
disableNote && /* @__PURE__ */ jsx38(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx38("p", { children: "Create note" }), children: /* @__PURE__ */ jsx38(
|
1481
1559
|
CreateNoteMenu_default,
|
1482
1560
|
{
|
1483
1561
|
handleSaveNoteAction,
|
@@ -1492,9 +1570,10 @@ var ControlBar = ({
|
|
1492
1570
|
}
|
1493
1571
|
}
|
1494
1572
|
) }),
|
1495
|
-
/* @__PURE__ */
|
1573
|
+
/* @__PURE__ */ jsx38(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx38("p", { children: "Subtitle" }), children: /* @__PURE__ */ jsx38(
|
1496
1574
|
SubtitleMenu_default,
|
1497
1575
|
{
|
1576
|
+
isTrailer,
|
1498
1577
|
width,
|
1499
1578
|
onClick: (e, isOpen) => {
|
1500
1579
|
setVolumeToggler(!volumeSliderToggler);
|
@@ -1502,7 +1581,7 @@ var ControlBar = ({
|
|
1502
1581
|
}
|
1503
1582
|
}
|
1504
1583
|
) }),
|
1505
|
-
/* @__PURE__ */
|
1584
|
+
/* @__PURE__ */ jsx38(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx38("p", { children: "Full screen" }), children: /* @__PURE__ */ jsx38(
|
1506
1585
|
"button",
|
1507
1586
|
{
|
1508
1587
|
onClick: (e) => {
|
@@ -1514,7 +1593,7 @@ var ControlBar = ({
|
|
1514
1593
|
player == null ? void 0 : player.requestFullscreen();
|
1515
1594
|
}
|
1516
1595
|
},
|
1517
|
-
children: /* @__PURE__ */
|
1596
|
+
children: /* @__PURE__ */ jsx38(FullScreenIcon_default, { className: "sb-w-3 sb-h-3" })
|
1518
1597
|
}
|
1519
1598
|
) })
|
1520
1599
|
]
|
@@ -1527,28 +1606,36 @@ var ControlBar_default = ControlBar;
|
|
1527
1606
|
import { isEqual } from "lodash";
|
1528
1607
|
|
1529
1608
|
// src/components/BigPlayButton/index.tsx
|
1530
|
-
import { jsx as
|
1531
|
-
var BigPlayButton = ({
|
1609
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
1610
|
+
var BigPlayButton = ({
|
1611
|
+
player,
|
1612
|
+
isPaused,
|
1613
|
+
setIsPaused,
|
1614
|
+
height,
|
1615
|
+
id,
|
1616
|
+
heightValue
|
1617
|
+
}) => {
|
1532
1618
|
const togglePlay = () => {
|
1533
1619
|
if (isPaused) player == null ? void 0 : player.play();
|
1534
1620
|
else player == null ? void 0 : player.pause();
|
1535
1621
|
setIsPaused(!isPaused);
|
1536
1622
|
};
|
1537
|
-
return /* @__PURE__ */
|
1623
|
+
return /* @__PURE__ */ jsx39(
|
1538
1624
|
"div",
|
1539
1625
|
{
|
1626
|
+
style: __spreadValues({}, height ? { position: "absolute", top: `-${(heightValue - height) / 2}px` } : {}),
|
1540
1627
|
onClick: togglePlay,
|
1541
|
-
className:
|
1542
|
-
children: isPaused ? /* @__PURE__ */
|
1628
|
+
className: ` sb-w-16 sb-h-16 sb-rounded-full sb-bg-white/30 sb-backdrop-blur-lg sb-flex sb-items-center sb-justify-center`,
|
1629
|
+
children: isPaused ? /* @__PURE__ */ jsx39(PlayIcon_default, { className: "sb-w-4 sb-h-4" }) : /* @__PURE__ */ jsx39(PauseIcon_default, { className: "sb-w-4 sb-h-4" })
|
1543
1630
|
}
|
1544
1631
|
);
|
1545
1632
|
};
|
1546
1633
|
var BigPlayButton_default = BigPlayButton;
|
1547
1634
|
|
1548
1635
|
// src/components/VideoPlayerComponent/index.tsx
|
1549
|
-
import { jsx as
|
1636
|
+
import { Fragment as Fragment4, jsx as jsx40, jsxs as jsxs17 } from "react/jsx-runtime";
|
1550
1637
|
var bigPlayButtonRoot = {};
|
1551
|
-
var renderBigPlayButton = (id, player, isPaused, setIsPaused, opacity = "100") => {
|
1638
|
+
var renderBigPlayButton = (id, player, isPaused, setIsPaused, opacity = "100", height, heightValue) => {
|
1552
1639
|
const container = document.getElementById(`video-container-${id}`);
|
1553
1640
|
if (container) {
|
1554
1641
|
container.style.height = "100%";
|
@@ -1559,12 +1646,14 @@ var renderBigPlayButton = (id, player, isPaused, setIsPaused, opacity = "100") =
|
|
1559
1646
|
bigPlayButtonRoot[id] = ReactDOM.createRoot(element);
|
1560
1647
|
}
|
1561
1648
|
bigPlayButtonRoot[id].render(
|
1562
|
-
/* @__PURE__ */
|
1649
|
+
/* @__PURE__ */ jsx40(
|
1563
1650
|
BigPlayButton_default,
|
1564
1651
|
{
|
1565
1652
|
player,
|
1566
1653
|
isPaused,
|
1567
|
-
setIsPaused
|
1654
|
+
setIsPaused,
|
1655
|
+
height,
|
1656
|
+
heightValue
|
1568
1657
|
}
|
1569
1658
|
)
|
1570
1659
|
);
|
@@ -1573,7 +1662,7 @@ var renderBigPlayButton = (id, player, isPaused, setIsPaused, opacity = "100") =
|
|
1573
1662
|
};
|
1574
1663
|
var controlBarRoot = {};
|
1575
1664
|
var renderControlBar = (id, player, isPaused, setIsPaused, duration, notes, chapters, seekStep = 5, handleSaveNoteAction, opacity = "0", handleControlDisplayTimer = () => {
|
1576
|
-
}, bgColor = "transparent", setIsQualityMenuOpen, setIsSubtitleMenuOpen, disableNote, setNoteOpen, noteButtonClick) => {
|
1665
|
+
}, bgColor = "transparent", setIsQualityMenuOpen, setIsSubtitleMenuOpen, disableNote, setNoteOpen, noteButtonClick, isTrailer) => {
|
1577
1666
|
const container = document.getElementById(`video-container-${id}`);
|
1578
1667
|
if (container) {
|
1579
1668
|
container.style.height = "100%";
|
@@ -1589,7 +1678,7 @@ var renderControlBar = (id, player, isPaused, setIsPaused, duration, notes, chap
|
|
1589
1678
|
element.style.height = "100%";
|
1590
1679
|
element.style.alignItems = "flex-end";
|
1591
1680
|
controlBarRoot[id].render(
|
1592
|
-
/* @__PURE__ */
|
1681
|
+
/* @__PURE__ */ jsx40(SoftBuildersVideoPlayerProvider, { children: /* @__PURE__ */ jsx40(
|
1593
1682
|
ControlBar_default,
|
1594
1683
|
{
|
1595
1684
|
id,
|
@@ -1606,7 +1695,8 @@ var renderControlBar = (id, player, isPaused, setIsPaused, duration, notes, chap
|
|
1606
1695
|
setIsQualityMenuOpen,
|
1607
1696
|
disableNote,
|
1608
1697
|
setNoteOpen,
|
1609
|
-
noteButtonClick
|
1698
|
+
noteButtonClick,
|
1699
|
+
isTrailer
|
1610
1700
|
}
|
1611
1701
|
) })
|
1612
1702
|
);
|
@@ -1628,7 +1718,9 @@ var VideoPlayerComponent = forwardRef(
|
|
1628
1718
|
childRef,
|
1629
1719
|
bottomRedBar = true,
|
1630
1720
|
noteButtonClick,
|
1631
|
-
videoID
|
1721
|
+
videoID,
|
1722
|
+
isTrailer,
|
1723
|
+
height
|
1632
1724
|
}, ref) => {
|
1633
1725
|
const videoRef = useRef2(void 0);
|
1634
1726
|
const playerRef = useRef2(void 0);
|
@@ -1643,6 +1735,7 @@ var VideoPlayerComponent = forwardRef(
|
|
1643
1735
|
const [isSubtitleMenuOpen, setIsSubtitleMenuOpen] = useState14(false);
|
1644
1736
|
const [isHovered, setIsHovered] = useState14(false);
|
1645
1737
|
const [isNoteOpen, setNoteOpen] = useState14(false);
|
1738
|
+
const [heightValue, setHeightValue] = useState14(0);
|
1646
1739
|
const onReady = (player) => {
|
1647
1740
|
if (playerRef) {
|
1648
1741
|
playerRef.current = player;
|
@@ -1767,7 +1860,8 @@ var VideoPlayerComponent = forwardRef(
|
|
1767
1860
|
setIsSubtitleMenuOpen,
|
1768
1861
|
disableNote,
|
1769
1862
|
setNoteOpen,
|
1770
|
-
noteButtonClick
|
1863
|
+
noteButtonClick,
|
1864
|
+
isTrailer
|
1771
1865
|
);
|
1772
1866
|
}, 0);
|
1773
1867
|
return () => clearTimeout(controlBarTimeout);
|
@@ -1789,12 +1883,14 @@ var VideoPlayerComponent = forwardRef(
|
|
1789
1883
|
playerRef.current,
|
1790
1884
|
isPaused,
|
1791
1885
|
setIsPaused,
|
1792
|
-
opacity
|
1886
|
+
opacity,
|
1887
|
+
height,
|
1888
|
+
heightValue
|
1793
1889
|
);
|
1794
1890
|
}, 500);
|
1795
1891
|
return () => clearTimeout(playButtonTimeout);
|
1796
1892
|
}
|
1797
|
-
}, [isPaused, opacity, isReady, id]);
|
1893
|
+
}, [isPaused, opacity, isReady, id, height, heightValue]);
|
1798
1894
|
useEffect14(() => {
|
1799
1895
|
if (playerRef.current) {
|
1800
1896
|
const intervalId = setInterval(() => {
|
@@ -1841,11 +1937,6 @@ var VideoPlayerComponent = forwardRef(
|
|
1841
1937
|
}
|
1842
1938
|
setOpacity("100");
|
1843
1939
|
setIsControlBarPresent(true);
|
1844
|
-
timeoutRef.current = setTimeout(() => {
|
1845
|
-
setOpacity("0");
|
1846
|
-
setBgColor("transparent");
|
1847
|
-
setIsControlBarPresent(false);
|
1848
|
-
}, 3e3);
|
1849
1940
|
if (isTimerOnly) {
|
1850
1941
|
return;
|
1851
1942
|
}
|
@@ -1915,7 +2006,20 @@ var VideoPlayerComponent = forwardRef(
|
|
1915
2006
|
const interval = setInterval(updateTimeSeeker, 500);
|
1916
2007
|
return () => clearInterval(interval);
|
1917
2008
|
}, [playerRef]);
|
1918
|
-
|
2009
|
+
const container = document.getElementById(`video-container-${id}`);
|
2010
|
+
function handleWidthChange(height2) {
|
2011
|
+
setHeightValue(height2);
|
2012
|
+
}
|
2013
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
2014
|
+
for (let entry of entries) {
|
2015
|
+
const currentHeight = entry.contentRect.height;
|
2016
|
+
handleWidthChange(currentHeight);
|
2017
|
+
}
|
2018
|
+
});
|
2019
|
+
container && resizeObserver.observe(
|
2020
|
+
container && container.querySelector(".vjs-control-bar")
|
2021
|
+
);
|
2022
|
+
return /* @__PURE__ */ jsx40(Fragment4, { children: /* @__PURE__ */ jsxs17(
|
1919
2023
|
"div",
|
1920
2024
|
{
|
1921
2025
|
ref: videoRefs,
|
@@ -1927,7 +2031,7 @@ var VideoPlayerComponent = forwardRef(
|
|
1927
2031
|
onMouseEnter: () => setIsHovered(true),
|
1928
2032
|
onMouseLeave: () => setIsHovered(false),
|
1929
2033
|
children: [
|
1930
|
-
bottomRedBar && /* @__PURE__ */
|
2034
|
+
bottomRedBar && /* @__PURE__ */ jsx40(
|
1931
2035
|
"div",
|
1932
2036
|
{
|
1933
2037
|
ref: childRef,
|
@@ -1938,12 +2042,12 @@ var VideoPlayerComponent = forwardRef(
|
|
1938
2042
|
}
|
1939
2043
|
}
|
1940
2044
|
),
|
1941
|
-
/* @__PURE__ */
|
2045
|
+
/* @__PURE__ */ jsx40(
|
1942
2046
|
"div",
|
1943
2047
|
{
|
1944
2048
|
className: "hover:sb-cursor-pointer sb-w-full sb-h-full",
|
1945
2049
|
"data-vjs-player": true,
|
1946
|
-
children: /* @__PURE__ */
|
2050
|
+
children: /* @__PURE__ */ jsx40(
|
1947
2051
|
"div",
|
1948
2052
|
{
|
1949
2053
|
onClick: handlePlayerClick,
|
@@ -1955,7 +2059,7 @@ var VideoPlayerComponent = forwardRef(
|
|
1955
2059
|
)
|
1956
2060
|
]
|
1957
2061
|
}
|
1958
|
-
);
|
2062
|
+
) });
|
1959
2063
|
}
|
1960
2064
|
);
|
1961
2065
|
var VideoPlayerComponent_default = VideoPlayerComponent;
|
@@ -1963,7 +2067,7 @@ var VideoPlayerComponent_default = VideoPlayerComponent;
|
|
1963
2067
|
// src/components/SoftBuildersVideoPlayer/index.tsx
|
1964
2068
|
import { isEqual as isEqual2 } from "lodash";
|
1965
2069
|
import { v4 as uuidv4 } from "uuid";
|
1966
|
-
import { jsx as
|
2070
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
1967
2071
|
var DEFAULT_OPTIONS = {
|
1968
2072
|
autoplay: false,
|
1969
2073
|
controls: true,
|
@@ -1988,7 +2092,9 @@ var Component = forwardRef2(
|
|
1988
2092
|
childRef,
|
1989
2093
|
bottomRedBar,
|
1990
2094
|
noteButtonClick,
|
1991
|
-
videoId
|
2095
|
+
videoId,
|
2096
|
+
isTrailer = false,
|
2097
|
+
height
|
1992
2098
|
}) => {
|
1993
2099
|
options = __spreadProps(__spreadValues({}, options), {
|
1994
2100
|
responsive: true,
|
@@ -2030,7 +2136,7 @@ var Component = forwardRef2(
|
|
2030
2136
|
useEffect15(() => {
|
2031
2137
|
setUuid(uuidv4());
|
2032
2138
|
}, []);
|
2033
|
-
return /* @__PURE__ */
|
2139
|
+
return /* @__PURE__ */ jsx41(
|
2034
2140
|
VideoPlayerComponent_default,
|
2035
2141
|
{
|
2036
2142
|
id: uuid,
|
@@ -2045,7 +2151,9 @@ var Component = forwardRef2(
|
|
2045
2151
|
onPlay,
|
2046
2152
|
childRef,
|
2047
2153
|
bottomRedBar,
|
2048
|
-
noteButtonClick
|
2154
|
+
noteButtonClick,
|
2155
|
+
isTrailer,
|
2156
|
+
height
|
2049
2157
|
}
|
2050
2158
|
);
|
2051
2159
|
}
|