softbuilders-react-video-player 1.2.18 → 1.2.19
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/BigPlayButton/index.d.ts +2 -1
- package/dist/components/BigPlayButton/index.js +4 -4
- package/dist/components/BigPlayButton/index.js.map +1 -1
- package/dist/components/BigPlayButton/index.tsx +13 -5
- package/dist/components/ControlBar/index.js +7 -7
- package/dist/components/ControlBar/index.js.map +1 -1
- package/dist/components/ControlBar/index.tsx +40 -41
- package/dist/components/Slider/index.d.ts +3 -1
- package/dist/components/Slider/index.js +9 -3
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Slider/index.tsx +13 -2
- package/dist/components/SoftBuildersVideoPlayer/index.js +2 -1
- package/dist/components/SoftBuildersVideoPlayer/index.js.map +1 -1
- package/dist/components/SoftBuildersVideoPlayer/index.tsx +2 -1
- package/dist/components/TimeSlider/index.js +25 -10
- package/dist/components/TimeSlider/index.js.map +1 -1
- package/dist/components/TimeSlider/index.tsx +27 -11
- package/dist/components/VideoPlayerComponent/index.js +26 -4
- package/dist/components/VideoPlayerComponent/index.js.map +1 -1
- package/dist/components/VideoPlayerComponent/index.tsx +35 -4
- package/dist/components/VideoPlayerComponent/style/style.css +17 -1
- package/dist/components/VolumeSlider/index.js +26 -1
- package/dist/components/VolumeSlider/index.js.map +1 -1
- package/dist/components/VolumeSlider/index.tsx +29 -0
- package/dist/components/icons/SkillamiIcon.d.ts +3 -0
- package/dist/components/icons/SkillamiIcon.js +4 -0
- package/dist/components/icons/SkillamiIcon.js.map +1 -0
- package/dist/components/icons/SkillamiIcon.tsx +25 -0
- package/dist/components/icons/index.d.ts +1 -0
- package/dist/components/icons/index.js +1 -0
- package/dist/components/icons/index.js.map +1 -1
- package/dist/components/icons/index.ts +1 -0
- package/dist/images/index.d.ts +1 -0
- package/dist/images/index.js +1 -0
- package/dist/images/index.js.map +1 -1
- package/dist/index.css +30 -0
- package/dist/index.mjs +309 -207
- package/dist/styles/tailwind.css +15 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -166,26 +166,37 @@ var Slider = (_a) => {
|
|
166
166
|
max = 100,
|
167
167
|
className,
|
168
168
|
handleSliderClick = () => {
|
169
|
-
}
|
169
|
+
},
|
170
|
+
setClicked,
|
171
|
+
onMouseMove
|
170
172
|
} = _b, rest = __objRest(_b, [
|
171
173
|
"value",
|
172
174
|
"handleValueChange",
|
173
175
|
"min",
|
174
176
|
"max",
|
175
177
|
"className",
|
176
|
-
"handleSliderClick"
|
178
|
+
"handleSliderClick",
|
179
|
+
"setClicked",
|
180
|
+
"onMouseMove"
|
177
181
|
]);
|
178
182
|
return /* @__PURE__ */ jsx3(
|
179
183
|
"input",
|
180
184
|
__spreadValues({
|
181
185
|
type: "range",
|
182
186
|
min,
|
183
|
-
|
187
|
+
onMouseMove: (e) => onMouseMove && onMouseMove(e),
|
188
|
+
onMouseDown: (e) => {
|
189
|
+
e.stopPropagation();
|
190
|
+
setClicked && setClicked(true);
|
191
|
+
},
|
184
192
|
onClick: (e) => {
|
185
193
|
e.stopPropagation();
|
186
194
|
handleSliderClick(e);
|
187
195
|
},
|
188
|
-
onMouseUp: (e) =>
|
196
|
+
onMouseUp: (e) => {
|
197
|
+
e.stopPropagation();
|
198
|
+
setClicked && setClicked(false);
|
199
|
+
},
|
189
200
|
max,
|
190
201
|
value,
|
191
202
|
onChange: (e) => {
|
@@ -422,9 +433,47 @@ var SvgSettingsIcon = (props) => /* @__PURE__ */ jsx15(
|
|
422
433
|
);
|
423
434
|
var SettingsIcon_default = SvgSettingsIcon;
|
424
435
|
|
425
|
-
// src/components/icons/
|
436
|
+
// src/components/icons/SkillamiIcon.tsx
|
426
437
|
import { jsx as jsx16, jsxs as jsxs2 } from "react/jsx-runtime";
|
427
|
-
var
|
438
|
+
var SvgSkillamiIcon = (props) => /* @__PURE__ */ jsxs2(
|
439
|
+
"svg",
|
440
|
+
__spreadProps(__spreadValues({
|
441
|
+
xmlns: "http://www.w3.org/2000/svg",
|
442
|
+
fill: "none",
|
443
|
+
viewBox: "0 0 45 46",
|
444
|
+
width: "1em",
|
445
|
+
height: "1em"
|
446
|
+
}, props), {
|
447
|
+
children: [
|
448
|
+
/* @__PURE__ */ jsx16(
|
449
|
+
"path",
|
450
|
+
{
|
451
|
+
fill: "#fff",
|
452
|
+
d: "m22.736 37.857-11.924-3.255-3.194-12.153a.99.99 0 0 0-1.213-.714c-.53.145-.843.7-.7 1.236l3.343 12.715a.991.991 0 0 0 .7.714l12.476 3.406a.985.985 0 0 0 1.213-.713 1.01 1.01 0 0 0-.7-1.236M44.733 25.943 39.51 6.074a1 1 0 0 0-.7-.714L19.308.033a.98.98 0 0 0-.957.26L9.389 9.428a1.02 1.02 0 0 0 0 1.428.976.976 0 0 0 1.402 0l8.56-8.717 18.39 5.024 4.93 18.741-8.56 8.724a1.02 1.02 0 0 0 0 1.428.977.977 0 0 0 1.4 0l8.963-9.133c.249-.254.348-.627.256-.975z"
|
453
|
+
}
|
454
|
+
),
|
455
|
+
/* @__PURE__ */ jsx16(
|
456
|
+
"path",
|
457
|
+
{
|
458
|
+
fill: "#fff",
|
459
|
+
d: "m24.323 30.829-7.735-2.113-2.074-7.883a.99.99 0 0 0-1.213-.714c-.53.145-.842.7-.7 1.236l2.223 8.445a.991.991 0 0 0 .7.714l8.287 2.265a.985.985 0 0 0 1.212-.714 1.01 1.01 0 0 0-.7-1.236M15.887 15.86l5.573-5.68 4.278 1.168a.985.985 0 0 0 1.213-.714 1.01 1.01 0 0 0-.7-1.236l-4.83-1.32a.98.98 0 0 0-.957.262l-5.979 6.092a1.02 1.02 0 0 0 0 1.428.977.977 0 0 0 1.402 0M29.206 30.858a.976.976 0 0 0 1.4 0l5.98-6.093c.248-.253.348-.627.255-.975l-1.294-4.921a.99.99 0 0 0-1.213-.715c-.53.145-.843.7-.7 1.236l1.145 4.36-5.574 5.68a1.02 1.02 0 0 0 0 1.428"
|
460
|
+
}
|
461
|
+
),
|
462
|
+
/* @__PURE__ */ jsx16(
|
463
|
+
"path",
|
464
|
+
{
|
465
|
+
fill: "#F26C21",
|
466
|
+
d: "m29.383 36.008-2.99-11 2.745-2.798-1.007-3.83 2.45-2.498 3.76 1.026 3.56-3.628L36.6 8.322l-4.865-1.327-3.56 3.628 1.007 3.831-2.45 2.497-3.76-1.026-2.745 2.799-10.794-3.049-1.007-3.834-4.865-1.327L0 14.142l1.302 4.959 4.865 1.326 2.745-2.798 10.794 3.048 1.007 3.835 3.762 1.025 2.991 11-2.745 2.798 1.302 4.959 4.865 1.326 3.56-3.628-1.302-4.958-3.763-1.03zM32.328 9.25l2.653.725.712 2.704-1.942 1.979-2.653-.725-.712-2.704zM5.573 18.173l-2.653-.725-.711-2.704 1.941-1.979 2.653.725.712 2.704zm16.761 4.686-.71-2.704 1.941-1.979 2.653.725.711 2.704-1.941 1.979zm7.963 20.507-2.653-.725-.711-2.704 1.942-1.979 2.653.725.711 2.704z"
|
467
|
+
}
|
468
|
+
)
|
469
|
+
]
|
470
|
+
})
|
471
|
+
);
|
472
|
+
var SkillamiIcon_default = SvgSkillamiIcon;
|
473
|
+
|
474
|
+
// src/components/icons/SubIcon.tsx
|
475
|
+
import { jsx as jsx17, jsxs as jsxs3 } from "react/jsx-runtime";
|
476
|
+
var SvgSubIcon = (props) => /* @__PURE__ */ jsxs3(
|
428
477
|
"svg",
|
429
478
|
__spreadProps(__spreadValues({
|
430
479
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -434,7 +483,7 @@ var SvgSubIcon = (props) => /* @__PURE__ */ jsxs2(
|
|
434
483
|
viewBox: "0 0 15 15"
|
435
484
|
}, props), {
|
436
485
|
children: [
|
437
|
-
/* @__PURE__ */
|
486
|
+
/* @__PURE__ */ jsx17(
|
438
487
|
"path",
|
439
488
|
{
|
440
489
|
stroke: "#D1D5DB",
|
@@ -444,7 +493,7 @@ var SvgSubIcon = (props) => /* @__PURE__ */ jsxs2(
|
|
444
493
|
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"
|
445
494
|
}
|
446
495
|
),
|
447
|
-
/* @__PURE__ */
|
496
|
+
/* @__PURE__ */ jsx17(
|
448
497
|
"path",
|
449
498
|
{
|
450
499
|
stroke: "#D1D5DB",
|
@@ -460,14 +509,14 @@ var SvgSubIcon = (props) => /* @__PURE__ */ jsxs2(
|
|
460
509
|
var SubIcon_default = SvgSubIcon;
|
461
510
|
|
462
511
|
// src/components/icons/SubtitlesIcon.tsx
|
463
|
-
import { jsx as
|
512
|
+
import { jsx as jsx18, jsxs as jsxs4 } from "react/jsx-runtime";
|
464
513
|
|
465
514
|
// src/components/icons/UnmuteIcon.tsx
|
466
|
-
import { jsx as
|
515
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
467
516
|
|
468
517
|
// src/components/icons/VolumeHigh.tsx
|
469
|
-
import { jsx as
|
470
|
-
var SvgVolumeHigh = (props) => /* @__PURE__ */
|
518
|
+
import { jsx as jsx20, jsxs as jsxs5 } from "react/jsx-runtime";
|
519
|
+
var SvgVolumeHigh = (props) => /* @__PURE__ */ jsxs5(
|
471
520
|
"svg",
|
472
521
|
__spreadProps(__spreadValues({
|
473
522
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -477,16 +526,16 @@ var SvgVolumeHigh = (props) => /* @__PURE__ */ jsxs4(
|
|
477
526
|
viewBox: "0 0 512 512"
|
478
527
|
}, props), {
|
479
528
|
children: [
|
480
|
-
/* @__PURE__ */
|
481
|
-
/* @__PURE__ */
|
529
|
+
/* @__PURE__ */ jsx20("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" }),
|
530
|
+
/* @__PURE__ */ jsx20("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
531
|
]
|
483
532
|
})
|
484
533
|
);
|
485
534
|
var VolumeHigh_default = SvgVolumeHigh;
|
486
535
|
|
487
536
|
// src/components/icons/VolumeLow.tsx
|
488
|
-
import { jsx as
|
489
|
-
var SvgVolumeLow = (props) => /* @__PURE__ */
|
537
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
538
|
+
var SvgVolumeLow = (props) => /* @__PURE__ */ jsx21(
|
490
539
|
"svg",
|
491
540
|
__spreadProps(__spreadValues({
|
492
541
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -495,14 +544,14 @@ var SvgVolumeLow = (props) => /* @__PURE__ */ jsx20(
|
|
495
544
|
fill: "#fff",
|
496
545
|
viewBox: "0 0 512 512"
|
497
546
|
}, props), {
|
498
|
-
children: /* @__PURE__ */
|
547
|
+
children: /* @__PURE__ */ jsx21("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
548
|
})
|
500
549
|
);
|
501
550
|
var VolumeLow_default = SvgVolumeLow;
|
502
551
|
|
503
552
|
// src/components/icons/VolumeMute.tsx
|
504
|
-
import { jsx as
|
505
|
-
var SvgVolumeMute = (props) => /* @__PURE__ */
|
553
|
+
import { jsx as jsx22, jsxs as jsxs6 } from "react/jsx-runtime";
|
554
|
+
var SvgVolumeMute = (props) => /* @__PURE__ */ jsxs6(
|
506
555
|
"svg",
|
507
556
|
__spreadProps(__spreadValues({
|
508
557
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -512,7 +561,7 @@ var SvgVolumeMute = (props) => /* @__PURE__ */ jsxs5(
|
|
512
561
|
viewBox: "0 0 512 512"
|
513
562
|
}, props), {
|
514
563
|
children: [
|
515
|
-
/* @__PURE__ */
|
564
|
+
/* @__PURE__ */ jsx22(
|
516
565
|
"path",
|
517
566
|
{
|
518
567
|
d: "M416 432 64 80",
|
@@ -525,16 +574,16 @@ var SvgVolumeMute = (props) => /* @__PURE__ */ jsxs5(
|
|
525
574
|
}
|
526
575
|
}
|
527
576
|
),
|
528
|
-
/* @__PURE__ */
|
529
|
-
/* @__PURE__ */
|
577
|
+
/* @__PURE__ */ jsx22("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" }),
|
578
|
+
/* @__PURE__ */ jsx22("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
579
|
]
|
531
580
|
})
|
532
581
|
);
|
533
582
|
var VolumeMute_default = SvgVolumeMute;
|
534
583
|
|
535
584
|
// src/components/icons/VolumeVLow.tsx
|
536
|
-
import { jsx as
|
537
|
-
var SvgVolumeVLow = (props) => /* @__PURE__ */
|
585
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
586
|
+
var SvgVolumeVLow = (props) => /* @__PURE__ */ jsx23(
|
538
587
|
"svg",
|
539
588
|
__spreadProps(__spreadValues({
|
540
589
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -543,13 +592,13 @@ var SvgVolumeVLow = (props) => /* @__PURE__ */ jsx22(
|
|
543
592
|
fill: "#fff",
|
544
593
|
viewBox: "0 0 512 512"
|
545
594
|
}, props), {
|
546
|
-
children: /* @__PURE__ */
|
595
|
+
children: /* @__PURE__ */ jsx23("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
596
|
})
|
548
597
|
);
|
549
598
|
var VolumeVLow_default = SvgVolumeVLow;
|
550
599
|
|
551
600
|
// src/components/VolumeSlider/index.tsx
|
552
|
-
import { jsx as
|
601
|
+
import { jsx as jsx24, jsxs as jsxs7 } from "react/jsx-runtime";
|
553
602
|
var MIN = 0;
|
554
603
|
var MAX = 100;
|
555
604
|
var VolumeSlider = ({
|
@@ -562,6 +611,7 @@ var VolumeSlider = ({
|
|
562
611
|
const { player } = useSoftBuildersVideoPlayerContext();
|
563
612
|
const [isVisible, setVisible] = useState2(false);
|
564
613
|
const [volume, setVolume] = useState2(0);
|
614
|
+
const [isClicked, setClicked] = useState2(false);
|
565
615
|
useEffect2(() => {
|
566
616
|
const updateVolumeState = () => {
|
567
617
|
const currentVolume = (player == null ? void 0 : player.muted()) ? 0 : Number((player == null ? void 0 : player.volume()) || 0) * 100;
|
@@ -594,6 +644,28 @@ var VolumeSlider = ({
|
|
594
644
|
player == null ? void 0 : player.muted(false);
|
595
645
|
}
|
596
646
|
};
|
647
|
+
const onMouseMove = (e) => {
|
648
|
+
if (isClicked) {
|
649
|
+
const slider = e.currentTarget;
|
650
|
+
const rect = slider.getBoundingClientRect();
|
651
|
+
let offsetX;
|
652
|
+
let newVolume;
|
653
|
+
if (!isTrailer && width > 400) {
|
654
|
+
offsetX = e.clientY - rect.bottom;
|
655
|
+
newVolume = offsetX / rect.height * -100;
|
656
|
+
} else {
|
657
|
+
offsetX = e.clientY - rect.top;
|
658
|
+
newVolume = offsetX / rect.height * 100;
|
659
|
+
}
|
660
|
+
setVolume(newVolume);
|
661
|
+
player == null ? void 0 : player.volume(newVolume / 100);
|
662
|
+
if (newVolume === 0) {
|
663
|
+
player == null ? void 0 : player.muted(true);
|
664
|
+
} else {
|
665
|
+
player == null ? void 0 : player.muted(false);
|
666
|
+
}
|
667
|
+
}
|
668
|
+
};
|
597
669
|
const timeoutRef = React2.useRef(null);
|
598
670
|
useEffect2(() => {
|
599
671
|
setVisible(false);
|
@@ -632,33 +704,33 @@ var VolumeSlider = ({
|
|
632
704
|
setVolume(0);
|
633
705
|
player == null ? void 0 : player.muted(true);
|
634
706
|
};
|
635
|
-
return /* @__PURE__ */
|
707
|
+
return /* @__PURE__ */ jsxs7(
|
636
708
|
"div",
|
637
709
|
{
|
638
710
|
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`,
|
639
711
|
children: [
|
640
|
-
/* @__PURE__ */
|
712
|
+
/* @__PURE__ */ jsx24(
|
641
713
|
"div",
|
642
714
|
{
|
643
715
|
className: `sb-flex sb-relative ${width < 400 || isTrailer ? "-sb-top-1" : "sb-top-1"}`,
|
644
716
|
onClick: toggleVisibility,
|
645
717
|
onDoubleClick: handleDoubleClick,
|
646
|
-
children: volume == 0 || (player == null ? void 0 : player.muted()) ? /* @__PURE__ */
|
718
|
+
children: volume == 0 || (player == null ? void 0 : player.muted()) ? /* @__PURE__ */ jsx24(
|
647
719
|
VolumeMute_default,
|
648
720
|
{
|
649
721
|
className: `sb-w-3 sb-h-3 ${width < 400 || isTrailer ? "" : ""} sb-h-5 sb-w-5`
|
650
722
|
}
|
651
|
-
) : volume < 25 ? /* @__PURE__ */
|
723
|
+
) : volume < 25 ? /* @__PURE__ */ jsx24(
|
652
724
|
VolumeVLow_default,
|
653
725
|
{
|
654
726
|
className: `sb-w-3 sb-h-3 ${width < 400 || isTrailer ? "" : ""} sb-h-5 sb-w-5`
|
655
727
|
}
|
656
|
-
) : volume < 50 ? /* @__PURE__ */
|
728
|
+
) : volume < 50 ? /* @__PURE__ */ jsx24(
|
657
729
|
VolumeLow_default,
|
658
730
|
{
|
659
731
|
className: `sb-w-3 sb-h-3 ${width < 400 || isTrailer ? "" : ""} sb-h-5 sb-w-5`
|
660
732
|
}
|
661
|
-
) : /* @__PURE__ */
|
733
|
+
) : /* @__PURE__ */ jsx24(
|
662
734
|
VolumeHigh_default,
|
663
735
|
{
|
664
736
|
className: `sb-w-3 sb-h-3 ${width < 400 || isTrailer ? "" : ""} sb-h-5 sb-w-5`
|
@@ -666,19 +738,21 @@ var VolumeSlider = ({
|
|
666
738
|
)
|
667
739
|
}
|
668
740
|
),
|
669
|
-
/* @__PURE__ */
|
741
|
+
/* @__PURE__ */ jsx24("div", { className: "sb-flex sb-items-center sb-justify-center", children: /* @__PURE__ */ jsx24(
|
670
742
|
"div",
|
671
743
|
{
|
672
744
|
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 && !isTrailer ? "-sb-rotate-90 -sb-translate-y-1" : "sb-rotate-90 sb-translate-y-1"} sb-relative`,
|
673
|
-
children: /* @__PURE__ */
|
745
|
+
children: /* @__PURE__ */ jsx24(
|
674
746
|
Slider_default,
|
675
747
|
{
|
748
|
+
onMouseMove: (e) => onMouseMove(e),
|
676
749
|
value: volume,
|
677
750
|
handleValueChange,
|
678
751
|
min: MIN,
|
679
752
|
max: MAX,
|
680
753
|
className: "!sb-w-16 ",
|
681
|
-
handleSliderClick: handleVolumeSliderClick
|
754
|
+
handleSliderClick: handleVolumeSliderClick,
|
755
|
+
setClicked
|
682
756
|
}
|
683
757
|
)
|
684
758
|
}
|
@@ -694,7 +768,7 @@ import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
694
768
|
|
695
769
|
// src/components/MenuButton/index.tsx
|
696
770
|
import { useCallback, useEffect as useEffect3, useRef, useState as useState3 } from "react";
|
697
|
-
import { jsx as
|
771
|
+
import { jsx as jsx25, jsxs as jsxs8 } from "react/jsx-runtime";
|
698
772
|
var MenuButton = ({
|
699
773
|
buttonContent,
|
700
774
|
menuContent,
|
@@ -729,14 +803,14 @@ var MenuButton = ({
|
|
729
803
|
useEffect3(() => {
|
730
804
|
setNoteOpen && setNoteOpen(isOpen);
|
731
805
|
}, [isOpen]);
|
732
|
-
return /* @__PURE__ */
|
806
|
+
return /* @__PURE__ */ jsxs8(
|
733
807
|
"div",
|
734
808
|
{
|
735
809
|
onMouseEnter,
|
736
810
|
onMouseLeave,
|
737
811
|
className: "sb-relative sb-flex sb-items-end",
|
738
812
|
children: [
|
739
|
-
/* @__PURE__ */
|
813
|
+
/* @__PURE__ */ jsx25(
|
740
814
|
"button",
|
741
815
|
{
|
742
816
|
ref: buttonRef,
|
@@ -752,7 +826,7 @@ var MenuButton = ({
|
|
752
826
|
children: buttonContent
|
753
827
|
}
|
754
828
|
),
|
755
|
-
!disablePopUp && isOpen && /* @__PURE__ */
|
829
|
+
!disablePopUp && isOpen && /* @__PURE__ */ jsx25(
|
756
830
|
"div",
|
757
831
|
{
|
758
832
|
ref: menuRef,
|
@@ -770,7 +844,7 @@ var MenuButton = ({
|
|
770
844
|
var MenuButton_default = MenuButton;
|
771
845
|
|
772
846
|
// src/components/QualityMenu/index.tsx
|
773
|
-
import { jsx as
|
847
|
+
import { jsx as jsx26, jsxs as jsxs9 } from "react/jsx-runtime";
|
774
848
|
var QualityOption = ({
|
775
849
|
isSelected,
|
776
850
|
quality,
|
@@ -778,19 +852,19 @@ var QualityOption = ({
|
|
778
852
|
width,
|
779
853
|
isTrailer
|
780
854
|
}) => {
|
781
|
-
return /* @__PURE__ */
|
855
|
+
return /* @__PURE__ */ jsx26(
|
782
856
|
"button",
|
783
857
|
{
|
784
858
|
className: `hover:sb-text-orange-500 ${width > 400 && !isTrailer ? "sb-p-2" : "sp-pb-1"}`,
|
785
859
|
onClick,
|
786
|
-
children: /* @__PURE__ */
|
787
|
-
/* @__PURE__ */
|
860
|
+
children: /* @__PURE__ */ jsxs9("div", { className: "sb-grid sb-grid-cols-12 sb-items-center sb-gap-2", children: [
|
861
|
+
/* @__PURE__ */ jsx26("div", { className: "sb-col-span-3", children: isSelected ? /* @__PURE__ */ jsx26(
|
788
862
|
CheckedIcon_default,
|
789
863
|
{
|
790
864
|
className: `${width > 400 && !isTrailer ? "sb-w-5 sb-h-5" : "sb-w-3 sb-h-3"}`
|
791
865
|
}
|
792
|
-
) : /* @__PURE__ */
|
793
|
-
/* @__PURE__ */
|
866
|
+
) : /* @__PURE__ */ jsx26("div", {}) }),
|
867
|
+
/* @__PURE__ */ jsx26("p", { className: "sb-text-left sb-col-span-9", children: quality == null ? void 0 : quality.label })
|
794
868
|
] })
|
795
869
|
}
|
796
870
|
);
|
@@ -819,25 +893,25 @@ var QualityMenu = ({ width, onClick, isTrailer }) => {
|
|
819
893
|
}
|
820
894
|
}
|
821
895
|
}, [player]);
|
822
|
-
return /* @__PURE__ */
|
896
|
+
return /* @__PURE__ */ jsx26(
|
823
897
|
MenuButton_default,
|
824
898
|
{
|
825
899
|
classContainer: `${width < 400 || isTrailer ? "!sb-top-8 -sb-left-9" : ""}`,
|
826
900
|
onClick: (e, isOpen) => {
|
827
901
|
onClick && onClick(e, isOpen);
|
828
902
|
},
|
829
|
-
buttonContent: /* @__PURE__ */
|
830
|
-
menuContent: /* @__PURE__ */
|
903
|
+
buttonContent: /* @__PURE__ */ jsx26(SettingsIcon_default, { className: "sb-w-3 sb-h-3" }),
|
904
|
+
menuContent: /* @__PURE__ */ jsx26(
|
831
905
|
"div",
|
832
906
|
{
|
833
907
|
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"}`,
|
834
|
-
children: /* @__PURE__ */
|
835
|
-
/* @__PURE__ */
|
908
|
+
children: /* @__PURE__ */ jsxs9("div", { className: "sb-flex sb-flex-col sb-gap-3", children: [
|
909
|
+
/* @__PURE__ */ jsxs9(
|
836
910
|
"div",
|
837
911
|
{
|
838
912
|
className: `sb-px-5 sb-flex sb-flex-row sb-gap-3 sb-items-start sb-relative sb-top-2`,
|
839
913
|
children: [
|
840
|
-
/* @__PURE__ */
|
914
|
+
/* @__PURE__ */ jsx26(
|
841
915
|
"button",
|
842
916
|
{
|
843
917
|
onClick: () => {
|
@@ -846,16 +920,16 @@ var QualityMenu = ({ width, onClick, isTrailer }) => {
|
|
846
920
|
}
|
847
921
|
},
|
848
922
|
className: "hover:sb-scale-150",
|
849
|
-
children: /* @__PURE__ */
|
923
|
+
children: /* @__PURE__ */ jsx26(LeftArrowIcon_default, { className: "sb-w-3 sb-h-3" })
|
850
924
|
}
|
851
925
|
),
|
852
|
-
/* @__PURE__ */
|
926
|
+
/* @__PURE__ */ jsx26("h3", { children: "Quality" })
|
853
927
|
]
|
854
928
|
}
|
855
929
|
),
|
856
|
-
/* @__PURE__ */
|
857
|
-
/* @__PURE__ */
|
858
|
-
return /* @__PURE__ */
|
930
|
+
/* @__PURE__ */ jsx26("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }),
|
931
|
+
/* @__PURE__ */ jsx26("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) => {
|
932
|
+
return /* @__PURE__ */ jsx26(
|
859
933
|
QualityOption,
|
860
934
|
{
|
861
935
|
width,
|
@@ -891,7 +965,7 @@ var QualityMenu_default = QualityMenu;
|
|
891
965
|
|
892
966
|
// src/components/CreateNoteMenu/index.tsx
|
893
967
|
import React5, { useState as useState5 } from "react";
|
894
|
-
import { jsx as
|
968
|
+
import { jsx as jsx27, jsxs as jsxs10 } from "react/jsx-runtime";
|
895
969
|
var CreateNoteMenu = ({
|
896
970
|
handleSaveNoteAction,
|
897
971
|
width,
|
@@ -914,7 +988,7 @@ var CreateNoteMenu = ({
|
|
914
988
|
);
|
915
989
|
}
|
916
990
|
};
|
917
|
-
return /* @__PURE__ */
|
991
|
+
return /* @__PURE__ */ jsx27(
|
918
992
|
MenuButton_default,
|
919
993
|
{
|
920
994
|
onMouseEnter,
|
@@ -923,21 +997,21 @@ var CreateNoteMenu = ({
|
|
923
997
|
noteButtonClick,
|
924
998
|
setNoteOpen,
|
925
999
|
classContainer: `${width < 400 ? "!sb-top-8 -sb-left-[9.75rem]" : ""}`,
|
926
|
-
buttonContent: /* @__PURE__ */
|
927
|
-
menuContent: /* @__PURE__ */
|
1000
|
+
buttonContent: /* @__PURE__ */ jsx27(ClosedNoteIcon_default, { className: "sb-w-3 sb-h-3" }),
|
1001
|
+
menuContent: /* @__PURE__ */ jsx27(
|
928
1002
|
"div",
|
929
1003
|
{
|
930
1004
|
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]"}`,
|
931
|
-
children: /* @__PURE__ */
|
1005
|
+
children: /* @__PURE__ */ jsxs10(
|
932
1006
|
"div",
|
933
1007
|
{
|
934
1008
|
className: "sb-flex sb-flex-col sb-gap-3 sb-items-center sb-justify-center",
|
935
1009
|
onClick: (e) => e.stopPropagation(),
|
936
1010
|
children: [
|
937
|
-
/* @__PURE__ */
|
938
|
-
/* @__PURE__ */
|
939
|
-
/* @__PURE__ */
|
940
|
-
/* @__PURE__ */
|
1011
|
+
/* @__PURE__ */ jsx27("h3", { className: "sb-px-5", children: "Add Note" }),
|
1012
|
+
/* @__PURE__ */ jsx27("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }),
|
1013
|
+
/* @__PURE__ */ jsxs10("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-4 sb-items-start", children: [
|
1014
|
+
/* @__PURE__ */ jsx27(
|
941
1015
|
"input",
|
942
1016
|
{
|
943
1017
|
onClick: (e) => e.stopPropagation(),
|
@@ -950,7 +1024,7 @@ var CreateNoteMenu = ({
|
|
950
1024
|
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"
|
951
1025
|
}
|
952
1026
|
),
|
953
|
-
/* @__PURE__ */
|
1027
|
+
/* @__PURE__ */ jsx27("button", { className: "sb-w-full", onClick: handleSaveNote, children: /* @__PURE__ */ jsx27("div", { className: "sb-px-4 sb-py-3 sb-text-center sb-font-bold sb-bg-orange-500 sb-rounded-md", children: "Save" }) })
|
954
1028
|
] })
|
955
1029
|
]
|
956
1030
|
}
|
@@ -969,10 +1043,10 @@ import { useEffect as useEffect6, useState as useState7 } from "react";
|
|
969
1043
|
import { useState as useState6 } from "react";
|
970
1044
|
|
971
1045
|
// src/components/Tooltip/index.tsx
|
972
|
-
import { jsx as
|
1046
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
973
1047
|
var Tooltip = ({ open, children }) => {
|
974
1048
|
if (!open) return null;
|
975
|
-
return /* @__PURE__ */
|
1049
|
+
return /* @__PURE__ */ jsx28(
|
976
1050
|
"div",
|
977
1051
|
{
|
978
1052
|
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",
|
@@ -983,14 +1057,14 @@ var Tooltip = ({ open, children }) => {
|
|
983
1057
|
var Tooltip_default = Tooltip;
|
984
1058
|
|
985
1059
|
// src/components/NoteTooltip/index.tsx
|
986
|
-
import { jsx as
|
1060
|
+
import { jsx as jsx29, jsxs as jsxs11 } from "react/jsx-runtime";
|
987
1061
|
var NoteTooltip = ({ note }) => {
|
988
1062
|
const [open, setOpen] = useState6(false);
|
989
1063
|
const { currentTime, player } = useSoftBuildersVideoPlayerContext();
|
990
1064
|
const handleValueChange = () => {
|
991
1065
|
player == null ? void 0 : player.currentTime(note.time);
|
992
1066
|
};
|
993
|
-
return /* @__PURE__ */
|
1067
|
+
return /* @__PURE__ */ jsx29(
|
994
1068
|
"div",
|
995
1069
|
{
|
996
1070
|
onClick: handleValueChange,
|
@@ -998,9 +1072,9 @@ var NoteTooltip = ({ note }) => {
|
|
998
1072
|
style: { left: `${note == null ? void 0 : note.percentage}%` },
|
999
1073
|
onMouseEnter: () => setOpen(true),
|
1000
1074
|
onMouseLeave: () => setOpen(false),
|
1001
|
-
children: /* @__PURE__ */
|
1002
|
-
/* @__PURE__ */
|
1003
|
-
/* @__PURE__ */
|
1075
|
+
children: /* @__PURE__ */ jsx29("div", { className: "sb-relative", children: /* @__PURE__ */ jsx29(Tooltip_default, { open, children: /* @__PURE__ */ jsxs11("div", { className: "sb-flex sb-flex-col sb-gap-2 sb-items-center", children: [
|
1076
|
+
/* @__PURE__ */ jsx29("p", { children: note == null ? void 0 : note.label }),
|
1077
|
+
/* @__PURE__ */ jsx29("p", { className: "sb-p-2 sb-bg-[#303030] sb-bg-opacity-50 sb-rounded-md", children: durationFormater(note.time) })
|
1004
1078
|
] }) }) })
|
1005
1079
|
}
|
1006
1080
|
);
|
@@ -1008,7 +1082,7 @@ var NoteTooltip = ({ note }) => {
|
|
1008
1082
|
var NoteTooltip_default = NoteTooltip;
|
1009
1083
|
|
1010
1084
|
// src/components/NotesPanal/index.tsx
|
1011
|
-
import { jsx as
|
1085
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
1012
1086
|
var NotesPanal = ({ notes }) => {
|
1013
1087
|
const [ns, setNs] = useState7([]);
|
1014
1088
|
const { duration } = useSoftBuildersVideoPlayerContext();
|
@@ -1021,7 +1095,7 @@ var NotesPanal = ({ notes }) => {
|
|
1021
1095
|
});
|
1022
1096
|
newNs && setNs(newNs);
|
1023
1097
|
}, [notes, duration]);
|
1024
|
-
return /* @__PURE__ */
|
1098
|
+
return /* @__PURE__ */ jsx30("div", { id: "notes-panal", className: "sb-w-full sb-h-full sb-relative ", children: ns.map((n, i) => /* @__PURE__ */ jsx30(NoteTooltip_default, { note: n }, `note-${i}-${n.time}`)) });
|
1025
1099
|
};
|
1026
1100
|
var NotesPanal_default = NotesPanal;
|
1027
1101
|
|
@@ -1030,7 +1104,7 @@ import { useEffect as useEffect8, useState as useState9 } from "react";
|
|
1030
1104
|
|
1031
1105
|
// src/components/ChapterTooltip/index.tsx
|
1032
1106
|
import { useEffect as useEffect7, useState as useState8 } from "react";
|
1033
|
-
import { jsx as
|
1107
|
+
import { jsx as jsx31, jsxs as jsxs12 } from "react/jsx-runtime";
|
1034
1108
|
var ChapterTooltip = ({ chapter }) => {
|
1035
1109
|
const { player } = useSoftBuildersVideoPlayerContext();
|
1036
1110
|
const [open, setOpen] = useState8(false);
|
@@ -1052,7 +1126,7 @@ var ChapterTooltip = ({ chapter }) => {
|
|
1052
1126
|
const clickedTime = chapter.startTime + clickPercentage * (chapter.endTime - chapter.startTime);
|
1053
1127
|
player == null ? void 0 : player.currentTime(clickedTime);
|
1054
1128
|
};
|
1055
|
-
return /* @__PURE__ */
|
1129
|
+
return /* @__PURE__ */ jsx31(
|
1056
1130
|
"div",
|
1057
1131
|
{
|
1058
1132
|
id: `ii-section-${chapter.title}`,
|
@@ -1063,15 +1137,15 @@ var ChapterTooltip = ({ chapter }) => {
|
|
1063
1137
|
},
|
1064
1138
|
onMouseEnter: () => setOpen(true),
|
1065
1139
|
onMouseLeave: () => setOpen(false),
|
1066
|
-
children: /* @__PURE__ */
|
1140
|
+
children: /* @__PURE__ */ jsx31(
|
1067
1141
|
"button",
|
1068
1142
|
{
|
1069
1143
|
id: `section-${chapter.title}`,
|
1070
1144
|
className: "sb-h-full sb-w-full",
|
1071
1145
|
onClick: handleClickChapter,
|
1072
|
-
children: /* @__PURE__ */
|
1073
|
-
/* @__PURE__ */
|
1074
|
-
/* @__PURE__ */
|
1146
|
+
children: /* @__PURE__ */ jsx31("div", { className: "sb-relative sb-flex sb-h-full sb-w-full sb-justify-between sb-items-center", children: /* @__PURE__ */ jsx31(Tooltip_default, { open, children: /* @__PURE__ */ jsxs12("div", { className: "sb-flex sb-flex-col sb-gap-2 sb-items-center", children: [
|
1147
|
+
/* @__PURE__ */ jsx31("p", { children: chapter.title }),
|
1148
|
+
/* @__PURE__ */ jsxs12("p", { className: "sb-p-2 sb-bg-[#303030] sb-bg-opacity-50 sb-rounded-md", children: [
|
1075
1149
|
durationFormater(chapter.startTime),
|
1076
1150
|
" -",
|
1077
1151
|
" ",
|
@@ -1086,7 +1160,7 @@ var ChapterTooltip = ({ chapter }) => {
|
|
1086
1160
|
var ChapterTooltip_default = ChapterTooltip;
|
1087
1161
|
|
1088
1162
|
// src/components/ChaptersPanal/index.tsx
|
1089
|
-
import { jsx as
|
1163
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
1090
1164
|
var ChaptersPanal = ({ chapters }) => {
|
1091
1165
|
const [cs, setCs] = useState9([]);
|
1092
1166
|
const { duration } = useSoftBuildersVideoPlayerContext();
|
@@ -1101,19 +1175,20 @@ var ChaptersPanal = ({ chapters }) => {
|
|
1101
1175
|
});
|
1102
1176
|
newCs && setCs(newCs);
|
1103
1177
|
}, [chapters, duration]);
|
1104
|
-
return /* @__PURE__ */
|
1178
|
+
return /* @__PURE__ */ jsx32("div", { id: "chapters-panal", className: "sb-w-full sb-h-full sb-relative ", children: cs.map((c, i) => /* @__PURE__ */ jsx32(ChapterTooltip_default, { chapter: c }, `chapter-${i}-${c.startTime}`)) });
|
1105
1179
|
};
|
1106
1180
|
var ChaptersPanal_default = ChaptersPanal;
|
1107
1181
|
|
1108
1182
|
// src/components/TimeSlider/index.tsx
|
1109
1183
|
import { useEffect as useEffect9, useState as useState10 } from "react";
|
1110
|
-
import { jsx as
|
1184
|
+
import { jsx as jsx33, jsxs as jsxs13 } from "react/jsx-runtime";
|
1111
1185
|
var MIN2 = 0;
|
1112
1186
|
var MAX2 = 100;
|
1113
1187
|
var DEFERENCE = Math.abs(MAX2 - MIN2);
|
1114
1188
|
var BAR_PERCENTAGE_WIDTH = 0.5;
|
1115
1189
|
var TimeSlider = ({ chapters }) => {
|
1116
1190
|
const [timeSlider, setTimeSlider] = useState10(0);
|
1191
|
+
const [isClicked, setClicked] = useState10(false);
|
1117
1192
|
const { player, duration, downloadedBufferPercentage } = useSoftBuildersVideoPlayerContext();
|
1118
1193
|
const handleValueChange = (e) => {
|
1119
1194
|
const newTimeSlider = Number(e.target.value);
|
@@ -1121,14 +1196,16 @@ var TimeSlider = ({ chapters }) => {
|
|
1121
1196
|
const time = newTimeSlider * duration / DEFERENCE;
|
1122
1197
|
player == null ? void 0 : player.currentTime(time);
|
1123
1198
|
};
|
1124
|
-
const
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1199
|
+
const onMouseMove = (e) => {
|
1200
|
+
if (isClicked) {
|
1201
|
+
const slider = e.currentTarget;
|
1202
|
+
const rect = slider.getBoundingClientRect();
|
1203
|
+
const offsetX = e.clientX - rect.left;
|
1204
|
+
const newTimeSlider = offsetX / rect.width * DEFERENCE;
|
1205
|
+
const time = newTimeSlider * duration / DEFERENCE;
|
1206
|
+
player == null ? void 0 : player.currentTime(time);
|
1207
|
+
setTimeSlider(newTimeSlider);
|
1208
|
+
}
|
1132
1209
|
};
|
1133
1210
|
useEffect9(() => {
|
1134
1211
|
const intervalId = setInterval(() => {
|
@@ -1156,13 +1233,14 @@ var TimeSlider = ({ chapters }) => {
|
|
1156
1233
|
arr.push(`black 100%`);
|
1157
1234
|
setMaskCuttes(arr.toString());
|
1158
1235
|
}, [chapters, duration]);
|
1159
|
-
return /* @__PURE__ */
|
1160
|
-
/* @__PURE__ */
|
1236
|
+
return /* @__PURE__ */ jsxs13("div", { className: " sb-w-full sb-h-2 sb-flex sb-items-center sb-justify-center", children: [
|
1237
|
+
/* @__PURE__ */ jsx33("div", { className: "sb-absolute sb-top-0 sb-left-0 sb-w-full sb-z-10", children: /* @__PURE__ */ jsx33(
|
1161
1238
|
Slider_default,
|
1162
1239
|
{
|
1240
|
+
onMouseMove: (e) => onMouseMove(e),
|
1241
|
+
setClicked,
|
1163
1242
|
value: timeSlider,
|
1164
1243
|
handleValueChange,
|
1165
|
-
handleSliderClick,
|
1166
1244
|
min: MIN2,
|
1167
1245
|
max: MAX2,
|
1168
1246
|
style: {
|
@@ -1170,7 +1248,7 @@ var TimeSlider = ({ chapters }) => {
|
|
1170
1248
|
}
|
1171
1249
|
}
|
1172
1250
|
) }),
|
1173
|
-
/* @__PURE__ */
|
1251
|
+
/* @__PURE__ */ jsx33(
|
1174
1252
|
"div",
|
1175
1253
|
{
|
1176
1254
|
className: "sb-absolute sb-top-0 sb-left-0 sb-w-full sb-h-2 sb-bg-slate-400 sb-rounded-md",
|
@@ -1200,24 +1278,24 @@ var TimeSlider = ({ chapters }) => {
|
|
1200
1278
|
var TimeSlider_default = TimeSlider;
|
1201
1279
|
|
1202
1280
|
// src/components/TimeSliderContainer/index.tsx
|
1203
|
-
import { jsx as
|
1281
|
+
import { jsx as jsx34, jsxs as jsxs14 } from "react/jsx-runtime";
|
1204
1282
|
var TimeSliderContainer = ({ notes, chapters }) => {
|
1205
|
-
return /* @__PURE__ */
|
1283
|
+
return /* @__PURE__ */ jsxs14(
|
1206
1284
|
"div",
|
1207
1285
|
{
|
1208
1286
|
id: "time-slider-container",
|
1209
1287
|
className: "sb-w-full sb-relative sb-flex sb-items-center sb-justify-center",
|
1210
1288
|
children: [
|
1211
|
-
/* @__PURE__ */
|
1289
|
+
/* @__PURE__ */ jsx34(
|
1212
1290
|
"div",
|
1213
1291
|
{
|
1214
1292
|
id: "notes-panal",
|
1215
1293
|
className: "sb-absolute sb-w-full sb-h-full sb-top-[27%] sb-left-0",
|
1216
|
-
children: /* @__PURE__ */
|
1294
|
+
children: /* @__PURE__ */ jsx34(NotesPanal_default, { notes })
|
1217
1295
|
}
|
1218
1296
|
),
|
1219
|
-
/* @__PURE__ */
|
1220
|
-
/* @__PURE__ */
|
1297
|
+
/* @__PURE__ */ jsx34("div", { className: "sb-absolute sb-w-full sb-h-full sb-top-0 sb-left-0", children: /* @__PURE__ */ jsx34(ChaptersPanal_default, { chapters }) }),
|
1298
|
+
/* @__PURE__ */ jsx34(TimeSlider_default, { chapters })
|
1221
1299
|
]
|
1222
1300
|
}
|
1223
1301
|
);
|
@@ -1226,7 +1304,7 @@ var TimeSliderContainer_default = TimeSliderContainer;
|
|
1226
1304
|
|
1227
1305
|
// src/components/BufferTracker/index.tsx
|
1228
1306
|
import { useEffect as useEffect10 } from "react";
|
1229
|
-
import { Fragment, jsx as
|
1307
|
+
import { Fragment, jsx as jsx35 } from "react/jsx-runtime";
|
1230
1308
|
var BufferTracker = () => {
|
1231
1309
|
const { player, setDownloadedBufferTimeufferTime } = useSoftBuildersVideoPlayerContext();
|
1232
1310
|
useEffect10(() => {
|
@@ -1235,13 +1313,13 @@ var BufferTracker = () => {
|
|
1235
1313
|
}, 1e3);
|
1236
1314
|
return () => clearInterval(intervalId);
|
1237
1315
|
}, [player]);
|
1238
|
-
return /* @__PURE__ */
|
1316
|
+
return /* @__PURE__ */ jsx35(Fragment, {});
|
1239
1317
|
};
|
1240
1318
|
var BufferTracker_default = BufferTracker;
|
1241
1319
|
|
1242
1320
|
// src/components/CurrentTimeTracker/index.tsx
|
1243
1321
|
import { useEffect as useEffect11 } from "react";
|
1244
|
-
import { Fragment as Fragment2, jsx as
|
1322
|
+
import { Fragment as Fragment2, jsx as jsx36 } from "react/jsx-runtime";
|
1245
1323
|
var CurrentTimeTracker = () => {
|
1246
1324
|
const { setCurrentTime, player } = useSoftBuildersVideoPlayerContext();
|
1247
1325
|
useEffect11(() => {
|
@@ -1250,19 +1328,19 @@ var CurrentTimeTracker = () => {
|
|
1250
1328
|
}, 500);
|
1251
1329
|
return () => clearInterval(intervalId);
|
1252
1330
|
}, [player]);
|
1253
|
-
return /* @__PURE__ */
|
1331
|
+
return /* @__PURE__ */ jsx36(Fragment2, {});
|
1254
1332
|
};
|
1255
1333
|
var CurrentTimeTracker_default = CurrentTimeTracker;
|
1256
1334
|
|
1257
1335
|
// src/components/SubtitleMenu/index.tsx
|
1258
1336
|
import { useEffect as useEffect12, useState as useState11 } from "react";
|
1259
|
-
import { jsx as
|
1337
|
+
import { jsx as jsx37, jsxs as jsxs15 } from "react/jsx-runtime";
|
1260
1338
|
var SubtitleOption = ({
|
1261
1339
|
isSelected,
|
1262
1340
|
subtitle,
|
1263
1341
|
onClick
|
1264
1342
|
}) => {
|
1265
|
-
return /* @__PURE__ */
|
1343
|
+
return /* @__PURE__ */ jsx37(
|
1266
1344
|
"button",
|
1267
1345
|
{
|
1268
1346
|
className: "hover:sb-text-orange-500 sb-p-2",
|
@@ -1270,9 +1348,9 @@ var SubtitleOption = ({
|
|
1270
1348
|
e.stopPropagation();
|
1271
1349
|
onClick(e);
|
1272
1350
|
},
|
1273
|
-
children: /* @__PURE__ */
|
1274
|
-
/* @__PURE__ */
|
1275
|
-
/* @__PURE__ */
|
1351
|
+
children: /* @__PURE__ */ jsxs15("div", { className: "sb-grid sb-grid-cols-12 sb-items-center sb-gap-2", children: [
|
1352
|
+
/* @__PURE__ */ jsx37("div", { className: "sb-col-span-3", children: isSelected ? /* @__PURE__ */ jsx37(CheckedIcon_default, { className: "sb-w-5 sb-h-5" }) : /* @__PURE__ */ jsx37("div", {}) }),
|
1353
|
+
/* @__PURE__ */ jsx37("p", { className: "sb-text-left sb-col-span-9", children: subtitle.label })
|
1276
1354
|
] })
|
1277
1355
|
}
|
1278
1356
|
);
|
@@ -1305,7 +1383,7 @@ var SubtitleMenu = ({
|
|
1305
1383
|
setSubtitles(textTracks);
|
1306
1384
|
}
|
1307
1385
|
}, [player]);
|
1308
|
-
return /* @__PURE__ */
|
1386
|
+
return /* @__PURE__ */ jsx37(
|
1309
1387
|
MenuButton_default,
|
1310
1388
|
{
|
1311
1389
|
onMouseEnter,
|
@@ -1314,14 +1392,14 @@ var SubtitleMenu = ({
|
|
1314
1392
|
onClick && onClick(e, isOpen);
|
1315
1393
|
},
|
1316
1394
|
classContainer: `${width < 400 || isTrailer ? "!sb-top-8 -sb-left-9" : ""}`,
|
1317
|
-
buttonContent: /* @__PURE__ */
|
1318
|
-
menuContent: /* @__PURE__ */
|
1395
|
+
buttonContent: /* @__PURE__ */ jsx37(SubIcon_default, { className: "sb-w-4 sb-h-4 sb-text-white " }),
|
1396
|
+
menuContent: /* @__PURE__ */ jsx37(
|
1319
1397
|
"div",
|
1320
1398
|
{
|
1321
1399
|
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"}`,
|
1322
|
-
children: /* @__PURE__ */
|
1323
|
-
/* @__PURE__ */
|
1324
|
-
/* @__PURE__ */
|
1400
|
+
children: /* @__PURE__ */ jsxs15("div", { className: "sb-flex sb-flex-col sb-gap-3", children: [
|
1401
|
+
/* @__PURE__ */ jsxs15("div", { className: "sb-px-5 sb-flex sb-flex-row sb-gap-3 sb-items-center sb-justify-center", children: [
|
1402
|
+
/* @__PURE__ */ jsx37(
|
1325
1403
|
"button",
|
1326
1404
|
{
|
1327
1405
|
onClick: () => {
|
@@ -1330,14 +1408,14 @@ var SubtitleMenu = ({
|
|
1330
1408
|
}
|
1331
1409
|
},
|
1332
1410
|
className: "hover:sb-scale-150",
|
1333
|
-
children: /* @__PURE__ */
|
1411
|
+
children: /* @__PURE__ */ jsx37(LeftArrowIcon_default, { className: "sb-w-3 sb-h-3" })
|
1334
1412
|
}
|
1335
1413
|
),
|
1336
|
-
/* @__PURE__ */
|
1414
|
+
/* @__PURE__ */ jsx37("h3", { children: "Subtitle" })
|
1337
1415
|
] }),
|
1338
|
-
/* @__PURE__ */
|
1339
|
-
/* @__PURE__ */
|
1340
|
-
return /* @__PURE__ */
|
1416
|
+
/* @__PURE__ */ jsx37("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }),
|
1417
|
+
/* @__PURE__ */ jsx37("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-3 sb-items-start", children: subtitles.map((q, i) => {
|
1418
|
+
return /* @__PURE__ */ jsx37(
|
1341
1419
|
SubtitleOption,
|
1342
1420
|
{
|
1343
1421
|
isSelected: q.mode === "showing",
|
@@ -1362,7 +1440,7 @@ var SubtitleMenu_default = SubtitleMenu;
|
|
1362
1440
|
|
1363
1441
|
// src/components/Tooltip/GlobalTooltip.tsx
|
1364
1442
|
import { useState as useState12 } from "react";
|
1365
|
-
import { jsx as
|
1443
|
+
import { jsx as jsx38, jsxs as jsxs16 } from "react/jsx-runtime";
|
1366
1444
|
var TooltipModal = ({
|
1367
1445
|
content,
|
1368
1446
|
children,
|
@@ -1372,13 +1450,13 @@ var TooltipModal = ({
|
|
1372
1450
|
const [isOpen, setIsOpen] = useState12(false);
|
1373
1451
|
const showTooltip = () => setIsOpen(true);
|
1374
1452
|
const hideTooltip = () => setIsOpen(false);
|
1375
|
-
return /* @__PURE__ */
|
1453
|
+
return /* @__PURE__ */ jsxs16(
|
1376
1454
|
"div",
|
1377
1455
|
{
|
1378
1456
|
className: "tooltip-container",
|
1379
1457
|
style: { position: "relative", display: "inline-block" },
|
1380
1458
|
children: [
|
1381
|
-
/* @__PURE__ */
|
1459
|
+
/* @__PURE__ */ jsx38(
|
1382
1460
|
"div",
|
1383
1461
|
{
|
1384
1462
|
onMouseEnter: showTooltip,
|
@@ -1387,7 +1465,7 @@ var TooltipModal = ({
|
|
1387
1465
|
children
|
1388
1466
|
}
|
1389
1467
|
),
|
1390
|
-
isOpen && /* @__PURE__ */
|
1468
|
+
isOpen && /* @__PURE__ */ jsx38(
|
1391
1469
|
"div",
|
1392
1470
|
{
|
1393
1471
|
className: `sb-tooltip-modal sb-text-orange-900 sb-my-2 ${width > 400 ? "!sb-bottom-[105%]" : "!sb-top-[105%]"}`,
|
@@ -1412,7 +1490,7 @@ var TooltipModal = ({
|
|
1412
1490
|
var GlobalTooltip_default = TooltipModal;
|
1413
1491
|
|
1414
1492
|
// src/components/ControlBar/index.tsx
|
1415
|
-
import {
|
1493
|
+
import { jsx as jsx39, jsxs as jsxs17 } from "react/jsx-runtime";
|
1416
1494
|
var ControlBar = ({
|
1417
1495
|
player,
|
1418
1496
|
isPaused,
|
@@ -1463,67 +1541,64 @@ var ControlBar = ({
|
|
1463
1541
|
useEffect13(() => {
|
1464
1542
|
setDuration(duration);
|
1465
1543
|
}, [duration]);
|
1466
|
-
return /* @__PURE__ */
|
1544
|
+
return /* @__PURE__ */ jsxs17(
|
1467
1545
|
"div",
|
1468
1546
|
{
|
1469
1547
|
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`,
|
1470
1548
|
children: [
|
1471
|
-
/* @__PURE__ */
|
1472
|
-
/* @__PURE__ */
|
1473
|
-
!isTrailer && /* @__PURE__ */
|
1474
|
-
"
|
1475
|
-
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
{
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
{
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
{
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
}
|
1518
|
-
)
|
1519
|
-
] }),
|
1549
|
+
/* @__PURE__ */ jsx39(BufferTracker_default, {}),
|
1550
|
+
/* @__PURE__ */ jsx39(CurrentTimeTracker_default, {}),
|
1551
|
+
!isTrailer && /* @__PURE__ */ jsx39(
|
1552
|
+
"button",
|
1553
|
+
{
|
1554
|
+
onClick: () => {
|
1555
|
+
seek(-seekStep);
|
1556
|
+
},
|
1557
|
+
children: /* @__PURE__ */ jsx39(
|
1558
|
+
GlobalTooltip_default,
|
1559
|
+
{
|
1560
|
+
width,
|
1561
|
+
content: /* @__PURE__ */ jsx39("p", { children: "Backward 5 sec" }),
|
1562
|
+
isLeft: true,
|
1563
|
+
children: /* @__PURE__ */ jsx39(BackwardIcon_default, { className: "sb-w-3 sb-h-3" })
|
1564
|
+
}
|
1565
|
+
)
|
1566
|
+
}
|
1567
|
+
),
|
1568
|
+
/* @__PURE__ */ jsx39("button", { onClick: togglePlay, children: /* @__PURE__ */ jsx39(
|
1569
|
+
GlobalTooltip_default,
|
1570
|
+
{
|
1571
|
+
width,
|
1572
|
+
content: /* @__PURE__ */ jsx39("p", { children: isPaused ? "Play" : "pause" }),
|
1573
|
+
isLeft: true,
|
1574
|
+
children: isPaused ? /* @__PURE__ */ jsx39(PlayIcon_default, { className: "sb-w-3 sb-h-3" }) : /* @__PURE__ */ jsx39(PauseIcon_default, { className: "sb-w-3 sb-h-3" })
|
1575
|
+
}
|
1576
|
+
) }),
|
1577
|
+
!isTrailer && /* @__PURE__ */ jsx39(
|
1578
|
+
"button",
|
1579
|
+
{
|
1580
|
+
onClick: (e) => {
|
1581
|
+
e.preventDefault();
|
1582
|
+
seek(seekStep);
|
1583
|
+
},
|
1584
|
+
children: /* @__PURE__ */ jsx39(
|
1585
|
+
GlobalTooltip_default,
|
1586
|
+
{
|
1587
|
+
width,
|
1588
|
+
content: /* @__PURE__ */ jsx39("p", { children: "Forward 5 sec" }),
|
1589
|
+
isLeft: true,
|
1590
|
+
children: /* @__PURE__ */ jsx39(ForwardIcon_default, { className: "sb-w-3 sb-h-3" })
|
1591
|
+
}
|
1592
|
+
)
|
1593
|
+
}
|
1594
|
+
),
|
1520
1595
|
// isSeeking ||
|
1521
1596
|
// width > 400 &&
|
1522
|
-
/* @__PURE__ */
|
1597
|
+
/* @__PURE__ */ jsx39(
|
1523
1598
|
"div",
|
1524
1599
|
{
|
1525
1600
|
className: `${width < 400 && !isTrailer ? "sb-flex-1 sb-ml-0 sb-mr-0" : "sb-w-full"}`,
|
1526
|
-
children: /* @__PURE__ */
|
1601
|
+
children: /* @__PURE__ */ jsxs17(
|
1527
1602
|
"div",
|
1528
1603
|
{
|
1529
1604
|
style: width < 400 && !isTrailer ? {
|
@@ -1533,15 +1608,15 @@ var ControlBar = ({
|
|
1533
1608
|
} : { width: "98%" },
|
1534
1609
|
className: `flex gap-2 ${width < 400 && !isTrailer ? "absolute sb-top-1" : "-sb-translate-y-0 sb-w-full"} hover:sb-w-[45%] `,
|
1535
1610
|
children: [
|
1536
|
-
/* @__PURE__ */
|
1537
|
-
/* @__PURE__ */
|
1538
|
-
/* @__PURE__ */
|
1611
|
+
/* @__PURE__ */ jsx39(CurrentTimeLabel_default, {}),
|
1612
|
+
/* @__PURE__ */ jsx39(TimeSliderContainer_default, { chapters, notes }),
|
1613
|
+
/* @__PURE__ */ jsx39("p", { children: durationFormater(duration) })
|
1539
1614
|
]
|
1540
1615
|
}
|
1541
1616
|
)
|
1542
1617
|
}
|
1543
1618
|
),
|
1544
|
-
/* @__PURE__ */
|
1619
|
+
/* @__PURE__ */ jsx39("div", { className: "sb-h-full", children: /* @__PURE__ */ jsx39(
|
1545
1620
|
VolumeSlider_default,
|
1546
1621
|
{
|
1547
1622
|
isTrailer,
|
@@ -1551,7 +1626,7 @@ var ControlBar = ({
|
|
1551
1626
|
handleControlDisplayTimer
|
1552
1627
|
}
|
1553
1628
|
) }),
|
1554
|
-
/* @__PURE__ */
|
1629
|
+
/* @__PURE__ */ jsx39(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx39("p", { children: "Quality" }), children: /* @__PURE__ */ jsx39(
|
1555
1630
|
QualityMenu_default,
|
1556
1631
|
{
|
1557
1632
|
isTrailer,
|
@@ -1562,7 +1637,7 @@ var ControlBar = ({
|
|
1562
1637
|
}
|
1563
1638
|
}
|
1564
1639
|
) }),
|
1565
|
-
disableNote && /* @__PURE__ */
|
1640
|
+
disableNote && /* @__PURE__ */ jsx39(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx39("p", { children: "Create note" }), children: /* @__PURE__ */ jsx39(
|
1566
1641
|
CreateNoteMenu_default,
|
1567
1642
|
{
|
1568
1643
|
handleSaveNoteAction,
|
@@ -1577,7 +1652,7 @@ var ControlBar = ({
|
|
1577
1652
|
}
|
1578
1653
|
}
|
1579
1654
|
) }),
|
1580
|
-
/* @__PURE__ */
|
1655
|
+
/* @__PURE__ */ jsx39(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx39("p", { children: "Subtitle" }), children: /* @__PURE__ */ jsx39(
|
1581
1656
|
SubtitleMenu_default,
|
1582
1657
|
{
|
1583
1658
|
isTrailer,
|
@@ -1588,7 +1663,7 @@ var ControlBar = ({
|
|
1588
1663
|
}
|
1589
1664
|
}
|
1590
1665
|
) }),
|
1591
|
-
/* @__PURE__ */
|
1666
|
+
/* @__PURE__ */ jsx39(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx39("p", { children: "Full screen" }), children: /* @__PURE__ */ jsx39(
|
1592
1667
|
"button",
|
1593
1668
|
{
|
1594
1669
|
onClick: (e) => {
|
@@ -1600,7 +1675,7 @@ var ControlBar = ({
|
|
1600
1675
|
player == null ? void 0 : player.requestFullscreen();
|
1601
1676
|
}
|
1602
1677
|
},
|
1603
|
-
children: /* @__PURE__ */
|
1678
|
+
children: /* @__PURE__ */ jsx39(FullScreenIcon_default, { className: "sb-w-3 sb-h-3" })
|
1604
1679
|
}
|
1605
1680
|
) })
|
1606
1681
|
]
|
@@ -1613,36 +1688,40 @@ var ControlBar_default = ControlBar;
|
|
1613
1688
|
import { isEqual } from "lodash";
|
1614
1689
|
|
1615
1690
|
// src/components/BigPlayButton/index.tsx
|
1616
|
-
import { jsx as
|
1691
|
+
import { jsx as jsx40, jsxs as jsxs18 } from "react/jsx-runtime";
|
1617
1692
|
var BigPlayButton = ({
|
1618
1693
|
player,
|
1619
1694
|
isPaused,
|
1620
1695
|
setIsPaused,
|
1621
1696
|
height,
|
1622
1697
|
id,
|
1623
|
-
heightValue
|
1698
|
+
heightValue,
|
1699
|
+
isLoading
|
1624
1700
|
}) => {
|
1625
1701
|
const togglePlay = () => {
|
1626
1702
|
if (isPaused) player == null ? void 0 : player.play();
|
1627
1703
|
else player == null ? void 0 : player.pause();
|
1628
1704
|
setIsPaused(!isPaused);
|
1629
1705
|
};
|
1630
|
-
return /* @__PURE__ */
|
1706
|
+
return /* @__PURE__ */ jsx40(
|
1631
1707
|
"div",
|
1632
1708
|
{
|
1633
1709
|
style: __spreadValues({}, height && heightValue ? { position: "absolute", top: `-${(heightValue - height) / 2}px` } : {}),
|
1634
1710
|
onClick: togglePlay,
|
1635
|
-
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`,
|
1636
|
-
children: isPaused ? /* @__PURE__ */
|
1711
|
+
className: ` sb-w-16 sb-h-16 sb-rounded-full ${!isLoading ? "sb-bg-white/30 sb-backdrop-blur-lg" : ""} sb-flex sb-items-center sb-justify-center`,
|
1712
|
+
children: isPaused || isLoading ? /* @__PURE__ */ jsxs18("div", { children: [
|
1713
|
+
!isLoading && /* @__PURE__ */ jsx40(PlayIcon_default, { className: "sb-w-4 sb-h-4" }),
|
1714
|
+
isLoading && /* @__PURE__ */ jsx40(SkillamiIcon_default, { className: " sb-w-16 sb-h-16 sb-animate-spin sb-absolute -sb-top-2 -sb-right-2 " })
|
1715
|
+
] }) : /* @__PURE__ */ jsx40(PauseIcon_default, { className: "sb-w-4 sb-h-4" })
|
1637
1716
|
}
|
1638
1717
|
);
|
1639
1718
|
};
|
1640
1719
|
var BigPlayButton_default = BigPlayButton;
|
1641
1720
|
|
1642
1721
|
// src/components/VideoPlayerComponent/index.tsx
|
1643
|
-
import { Fragment as
|
1722
|
+
import { Fragment as Fragment3, jsx as jsx41, jsxs as jsxs19 } from "react/jsx-runtime";
|
1644
1723
|
var bigPlayButtonRoot = {};
|
1645
|
-
var renderBigPlayButton = (id, player, isPaused, setIsPaused, opacity = "100", height, heightValue) => {
|
1724
|
+
var renderBigPlayButton = (id, player, isPaused, setIsPaused, opacity = "100", height, heightValue, isLoading) => {
|
1646
1725
|
const container = document.getElementById(`video-container-${id}`);
|
1647
1726
|
if (container) {
|
1648
1727
|
container.style.height = "100%";
|
@@ -1653,14 +1732,15 @@ var renderBigPlayButton = (id, player, isPaused, setIsPaused, opacity = "100", h
|
|
1653
1732
|
bigPlayButtonRoot[id] = ReactDOM.createRoot(element);
|
1654
1733
|
}
|
1655
1734
|
bigPlayButtonRoot[id].render(
|
1656
|
-
/* @__PURE__ */
|
1735
|
+
/* @__PURE__ */ jsx41(
|
1657
1736
|
BigPlayButton_default,
|
1658
1737
|
{
|
1659
1738
|
player,
|
1660
1739
|
isPaused,
|
1661
1740
|
setIsPaused,
|
1662
1741
|
height,
|
1663
|
-
heightValue
|
1742
|
+
heightValue,
|
1743
|
+
isLoading
|
1664
1744
|
}
|
1665
1745
|
)
|
1666
1746
|
);
|
@@ -1685,7 +1765,7 @@ var renderControlBar = (id, player, isPaused, setIsPaused, duration, notes, chap
|
|
1685
1765
|
element.style.height = "100%";
|
1686
1766
|
element.style.alignItems = "flex-end";
|
1687
1767
|
controlBarRoot[id].render(
|
1688
|
-
/* @__PURE__ */
|
1768
|
+
/* @__PURE__ */ jsx41(SoftBuildersVideoPlayerProvider, { children: /* @__PURE__ */ jsx41(
|
1689
1769
|
ControlBar_default,
|
1690
1770
|
{
|
1691
1771
|
id,
|
@@ -1743,6 +1823,7 @@ var VideoPlayerComponent = forwardRef(
|
|
1743
1823
|
const [isHovered, setIsHovered] = useState14(false);
|
1744
1824
|
const [isNoteOpen, setNoteOpen] = useState14(false);
|
1745
1825
|
const [heightValue, setHeightValue] = useState14(0);
|
1826
|
+
const [isLoading, setIsloading] = useState14(false);
|
1746
1827
|
const onReady = (player) => {
|
1747
1828
|
if (playerRef) {
|
1748
1829
|
playerRef.current = player;
|
@@ -1892,12 +1973,13 @@ var VideoPlayerComponent = forwardRef(
|
|
1892
1973
|
setIsPaused,
|
1893
1974
|
opacity,
|
1894
1975
|
height,
|
1895
|
-
heightValue
|
1976
|
+
heightValue,
|
1977
|
+
isLoading
|
1896
1978
|
);
|
1897
1979
|
}, 500);
|
1898
1980
|
return () => clearTimeout(playButtonTimeout);
|
1899
1981
|
}
|
1900
|
-
}, [isPaused, opacity, isReady, id, height, heightValue]);
|
1982
|
+
}, [isPaused, opacity, isReady, id, height, heightValue, isLoading]);
|
1901
1983
|
useEffect14(() => {
|
1902
1984
|
if (playerRef.current) {
|
1903
1985
|
const intervalId = setInterval(() => {
|
@@ -2027,7 +2109,27 @@ var VideoPlayerComponent = forwardRef(
|
|
2027
2109
|
if (controlBar) {
|
2028
2110
|
resizeObserver.observe(controlBar);
|
2029
2111
|
}
|
2030
|
-
|
2112
|
+
function debounce(func, delay) {
|
2113
|
+
let timeoutId;
|
2114
|
+
return function(arg) {
|
2115
|
+
if (timeoutId) {
|
2116
|
+
clearTimeout(timeoutId);
|
2117
|
+
}
|
2118
|
+
timeoutId = setTimeout(() => {
|
2119
|
+
func(arg);
|
2120
|
+
}, delay);
|
2121
|
+
};
|
2122
|
+
}
|
2123
|
+
if (playerRef.current) {
|
2124
|
+
playerRef.current.on("waiting", function() {
|
2125
|
+
console.log("The player is buffering...");
|
2126
|
+
debounce((arg) => setIsloading(arg), 300)(true);
|
2127
|
+
});
|
2128
|
+
playerRef.current.on("playing", function() {
|
2129
|
+
debounce((arg) => setIsloading(arg), 300)(false);
|
2130
|
+
});
|
2131
|
+
}
|
2132
|
+
return /* @__PURE__ */ jsx41(Fragment3, { children: /* @__PURE__ */ jsxs19(
|
2031
2133
|
"div",
|
2032
2134
|
{
|
2033
2135
|
ref: videoRefs,
|
@@ -2039,7 +2141,7 @@ var VideoPlayerComponent = forwardRef(
|
|
2039
2141
|
onMouseEnter: () => setIsHovered(true),
|
2040
2142
|
onMouseLeave: () => setIsHovered(false),
|
2041
2143
|
children: [
|
2042
|
-
bottomRedBar && /* @__PURE__ */
|
2144
|
+
bottomRedBar && /* @__PURE__ */ jsx41(
|
2043
2145
|
"div",
|
2044
2146
|
{
|
2045
2147
|
ref: childRef,
|
@@ -2050,12 +2152,12 @@ var VideoPlayerComponent = forwardRef(
|
|
2050
2152
|
}
|
2051
2153
|
}
|
2052
2154
|
),
|
2053
|
-
/* @__PURE__ */
|
2155
|
+
/* @__PURE__ */ jsx41(
|
2054
2156
|
"div",
|
2055
2157
|
{
|
2056
2158
|
className: "hover:sb-cursor-pointer sb-w-full sb-h-full",
|
2057
2159
|
"data-vjs-player": true,
|
2058
|
-
children: /* @__PURE__ */
|
2160
|
+
children: /* @__PURE__ */ jsx41(
|
2059
2161
|
"div",
|
2060
2162
|
{
|
2061
2163
|
onClick: handlePlayerClick,
|
@@ -2075,7 +2177,7 @@ var VideoPlayerComponent_default = VideoPlayerComponent;
|
|
2075
2177
|
// src/components/SoftBuildersVideoPlayer/index.tsx
|
2076
2178
|
import { isEqual as isEqual2 } from "lodash";
|
2077
2179
|
import { v4 as uuidv4 } from "uuid";
|
2078
|
-
import { jsx as
|
2180
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
2079
2181
|
var DEFAULT_OPTIONS = {
|
2080
2182
|
autoplay: false,
|
2081
2183
|
controls: true,
|
@@ -2144,7 +2246,7 @@ var Component = forwardRef2(
|
|
2144
2246
|
useEffect15(() => {
|
2145
2247
|
setUuid(uuidv4());
|
2146
2248
|
}, []);
|
2147
|
-
return /* @__PURE__ */
|
2249
|
+
return /* @__PURE__ */ jsx42(
|
2148
2250
|
VideoPlayerComponent_default,
|
2149
2251
|
{
|
2150
2252
|
id: uuid,
|
@@ -2167,7 +2269,7 @@ var Component = forwardRef2(
|
|
2167
2269
|
}
|
2168
2270
|
);
|
2169
2271
|
var SoftBuildersVideoPlayer = memo(Component, (prevProps, nextProps) => {
|
2170
|
-
return isEqual2(prevProps.options, nextProps.options) && prevProps.notes === nextProps.notes && prevProps.chapters === nextProps.chapters && prevProps.startTime === nextProps.startTime;
|
2272
|
+
return isEqual2(prevProps.options, nextProps.options) && prevProps.notes === nextProps.notes && prevProps.chapters === nextProps.chapters && prevProps.startTime === nextProps.startTime && prevProps.height === nextProps.height;
|
2171
2273
|
});
|
2172
2274
|
var SoftBuildersVideoPlayer_default = SoftBuildersVideoPlayer;
|
2173
2275
|
|