softbuilders-react-video-player 1.1.8 → 1.1.10
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +21 -21
- package/README.md +126 -126
- package/dist/components/BigPlayButton/index.js +1 -1
- package/dist/components/BigPlayButton/index.js.map +1 -1
- package/dist/components/BigPlayButton/index.tsx +33 -31
- package/dist/components/BufferTracker/index.tsx +19 -19
- package/dist/components/ChapterTooltip/index.tsx +65 -65
- package/dist/components/ChaptersPanal/index.tsx +40 -40
- package/dist/components/ControlBar/index.d.ts +2 -1
- package/dist/components/ControlBar/index.js +21 -6
- package/dist/components/ControlBar/index.js.map +1 -1
- package/dist/components/ControlBar/index.tsx +150 -127
- package/dist/components/CreateNoteMenu/index.tsx +61 -61
- package/dist/components/CurrentTimeLabel/index.tsx +13 -13
- package/dist/components/CurrentTimeTracker/index.tsx +18 -18
- package/dist/components/Menu/index.tsx +49 -49
- package/dist/components/MenuButton/index.js +1 -1
- package/dist/components/MenuButton/index.js.map +1 -1
- package/dist/components/MenuButton/index.tsx +67 -67
- package/dist/components/NoteTooltip/index.tsx +46 -46
- package/dist/components/NotesPanal/index.tsx +34 -34
- package/dist/components/QualityMenu/index.js +2 -2
- package/dist/components/QualityMenu/index.js.map +1 -1
- package/dist/components/QualityMenu/index.tsx +122 -122
- package/dist/components/Slider/index.d.ts +1 -1
- package/dist/components/Slider/index.js +3 -3
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Slider/index.tsx +36 -37
- package/dist/components/Slider/style.css +49 -15
- package/dist/components/SoftBuildersVideoPlayer/index.js +1 -1
- package/dist/components/SoftBuildersVideoPlayer/index.js.map +1 -1
- package/dist/components/SoftBuildersVideoPlayer/index.tsx +110 -109
- package/dist/components/SubtitleMenu/index.js +2 -2
- package/dist/components/SubtitleMenu/index.js.map +1 -1
- package/dist/components/SubtitleMenu/index.tsx +107 -108
- package/dist/components/TimeSlider/index.js +13 -13
- package/dist/components/TimeSlider/index.tsx +107 -107
- package/dist/components/TimeSliderContainer/index.tsx +35 -35
- package/dist/components/Tooltip/index.tsx +16 -16
- package/dist/components/VideoPlayerComponent/index.d.ts +2 -1
- package/dist/components/VideoPlayerComponent/index.js +54 -38
- package/dist/components/VideoPlayerComponent/index.js.map +1 -1
- package/dist/components/VideoPlayerComponent/index.tsx +271 -249
- package/dist/components/VideoPlayerComponent/provider.tsx +82 -82
- package/dist/components/VideoPlayerComponent/style/style.css +36 -36
- package/dist/components/VolumeSlider/index.d.ts +4 -2
- package/dist/components/VolumeSlider/index.js +12 -2
- package/dist/components/VolumeSlider/index.js.map +1 -1
- package/dist/components/VolumeSlider/index.tsx +91 -52
- package/dist/components/icons/SubIcon.d.ts +3 -0
- package/dist/components/icons/SubIcon.js +4 -0
- package/dist/components/icons/SubIcon.js.map +1 -0
- package/dist/components/icons/SubIcon.tsx +28 -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 +15 -14
- 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 +78 -3
- package/dist/index.mjs +276 -169
- package/dist/styles/tailwind.css +140 -87
- package/package.json +45 -45
package/dist/index.mjs
CHANGED
@@ -31,16 +31,16 @@ var __objRest = (source, exclude) => {
|
|
31
31
|
};
|
32
32
|
|
33
33
|
// src/components/SoftBuildersVideoPlayer/index.tsx
|
34
|
-
import { memo, useEffect as useEffect15, useState as
|
34
|
+
import { memo, useEffect as useEffect15, useState as useState14 } from "react";
|
35
35
|
|
36
36
|
// src/components/VideoPlayerComponent/index.tsx
|
37
|
-
import { useEffect as useEffect14, useRef as useRef2, useState as
|
37
|
+
import { useEffect as useEffect14, useRef as useRef2, useState as useState13 } from "react";
|
38
38
|
import ReactDOM from "react-dom/client";
|
39
39
|
import videojs from "video.js";
|
40
40
|
import "video.js/dist/video-js.css";
|
41
41
|
|
42
42
|
// src/components/ControlBar/index.tsx
|
43
|
-
import { useEffect as useEffect13 } from "react";
|
43
|
+
import { useEffect as useEffect13, useState as useState12 } from "react";
|
44
44
|
|
45
45
|
// src/utils/index.ts
|
46
46
|
var durationFormater = (seconds) => {
|
@@ -163,12 +163,14 @@ var Slider = (_a) => {
|
|
163
163
|
value,
|
164
164
|
handleValueChange,
|
165
165
|
min = 0,
|
166
|
-
max = 100
|
166
|
+
max = 100,
|
167
|
+
className
|
167
168
|
} = _b, rest = __objRest(_b, [
|
168
169
|
"value",
|
169
170
|
"handleValueChange",
|
170
171
|
"min",
|
171
|
-
"max"
|
172
|
+
"max",
|
173
|
+
"className"
|
172
174
|
]);
|
173
175
|
return /* @__PURE__ */ jsx3(
|
174
176
|
"input",
|
@@ -178,7 +180,8 @@ var Slider = (_a) => {
|
|
178
180
|
max,
|
179
181
|
value,
|
180
182
|
onChange: handleValueChange,
|
181
|
-
className:
|
183
|
+
className: `sb-w-full sb-h-2 sb-bg-transparent sb-bg-opacity-50 sb-rounded-lg sb-appearance-none sb-cursor-pointer sb-range-slider sb-slider-thumb
|
184
|
+
${className}`,
|
182
185
|
style: {
|
183
186
|
background: `linear-gradient(to right, #f97316 ${value}%, #30303070 ${value}%)`
|
184
187
|
}
|
@@ -455,34 +458,59 @@ var UnmuteIcon_default = SvgUnmuteIcon;
|
|
455
458
|
|
456
459
|
// src/components/icons/SubtitlesIcon.tsx
|
457
460
|
import { jsx as jsx17, jsxs as jsxs2 } from "react/jsx-runtime";
|
458
|
-
var SvgSubtitlesIcon = (props) => /* @__PURE__ */ jsxs2("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em" }, props), { children: [
|
459
|
-
/* @__PURE__ */ jsx17(
|
460
|
-
"path",
|
461
|
-
{
|
462
|
-
fill: "#FFF",
|
463
|
-
d: "m78.649 64.733 4.772-.014c4.355-.012 8.711-.012 13.067-.01 4.703 0 9.407-.01 14.11-.02q13.815-.023 27.629-.023 11.23-.001 22.463-.012 31.861-.026 63.724-.025h6.94c18.57.001 37.138-.018 55.707-.046q28.618-.043 57.235-.04c10.706 0 21.413-.006 32.119-.027q13.673-.028 27.347-.009c4.647.006 9.295.007 13.943-.01q6.39-.024 12.783.004 2.303.005 4.605-.012c17.985-.122 33.209 4.858 46.137 17.55 8.927 9.239 14.882 21.979 14.901 34.934l.012 2.976-.003 3.246.01 3.467q.01 5.763.011 11.526l.015 8.254q.02 11.222.024 22.445l.012 14.022q.019 19.423.026 38.845v5.027l.002 5.048v2.53q.009 20.274.046 40.55.035 20.83.037 41.661-.001 11.69.025 23.38.023 9.956.012 19.913-.006 5.075.011 10.15c.013 3.677.007 7.353-.004 11.03l.025 3.206c-.1 15.234-5.618 28.587-16.181 39.571L478 426l-1.71 1.742c-12.91 12.154-30.359 13.722-47.23 13.639q-2.341.005-4.684.014c-4.25.013-8.502.007-12.753-.003-4.6-.007-9.2.004-13.8.012-8.996.013-17.991.01-26.987.002a15973 15973 0 0 0-25.105-.003q-3.18 0-6.358.003c-19.85.008-39.7-.002-59.55-.018a31884 31884 0 0 0-51.037.003 46445 46445 0 0 1-65.678.01l-3.148-.001q-10.951-.003-21.904.009-13.356.013-26.712-.01c-4.539-.008-9.077-.011-13.616-.001q-6.243.013-12.487-.012a631 631 0 0 0-4.493.006c-19.337.087-36.076-3.874-50.342-17.72-11.99-13.314-15.732-28.763-15.667-46.265l-.011-3.376c-.01-3.706-.007-7.412-.003-11.118q-.007-4.003-.015-8.006-.018-9.72-.012-19.439.002-7.905-.005-15.812l-.001-2.28-.004-4.584q-.014-21.467-.003-42.935c.006-13.068-.006-26.137-.025-39.205q-.03-20.168-.024-40.336.005-11.307-.014-22.614-.019-9.625-.002-19.252.01-4.903-.005-9.806c-.063-21.392.482-40.17 16.182-56.468L33 80l1.64-1.707C46.883 66.577 62.55 64.697 78.65 64.733M57 111c-3.615 5.55-3.427 10.594-3.394 16.994l-.019 3.364c-.017 3.722-.012 7.443-.007 11.165q-.01 4.002-.026 8.003c-.02 6.495-.025 12.99-.023 19.485a9577 9577 0 0 1-.017 20.405l-.003 2.295c-.019 14.32-.018 28.641-.01 42.961.005 13.096-.016 26.191-.05 39.287q-.05 20.178-.043 40.355c.002 7.55-.003 15.1-.028 22.65q-.033 9.641-.006 19.283.016 4.917-.01 9.834c-.019 3.558-.006 7.114.015 10.671l-.038 3.124c.093 7.623 1.84 12.297 7.234 17.703 6.322 4.896 14.068 4.11 21.659 4.042q2.337.007 4.673.02c4.269.017 8.537.003 12.806-.017 4.608-.015 9.216-.002 13.824.008 9.023.015 18.044.002 27.067-.02 10.505-.023 21.01-.021 31.516-.019 18.742.004 37.484-.017 56.226-.051q27.285-.05 54.569-.041 29.71.012 59.42-.015l3.173-.004 6.31-.006q10.986-.009 21.973-.006 13.386.003 26.77-.032c4.554-.012 9.107-.019 13.66-.013q6.252.006 12.502-.023 2.264-.008 4.526.001c2.05.007 4.098-.004 6.147-.02l3.45-.005c6.13-.735 10.246-3.731 14.154-8.378 3.27-6.025 3.426-11.188 3.381-17.962l.014-3.318c.012-3.663.003-7.326-.007-10.99q.007-3.942.016-7.885c.013-6.395.01-12.79.002-19.185a8074 8074 0 0 1-.003-17.841q0-2.258.003-4.514c.008-14.102-.002-28.204-.018-42.306q-.018-18.139.003-36.278a23436 23436 0 0 0 .01-46.65l-.001-2.235q-.003-7.785.009-15.572.014-10.484-.015-20.972-.006-3.847.004-7.696c.008-3.502-.002-7.004-.017-10.507l.02-3.075c-.055-6.664-.708-12.636-5.014-18.037l-1.7-1.352-1.675-1.398c-4.658-2.84-9.18-3.477-14.556-3.481-1.96-.01-1.96-.01-3.96-.018l-4.33.011-4.617-.011c-4.226-.01-8.452-.008-12.677-.004-4.559.002-9.117-.007-13.675-.014q-13.395-.018-26.788-.012a26146 26146 0 0 1-31.19-.01q-29.507-.013-59.014-.003c-18.001.006-36.002-.006-54.003-.025q-27.72-.03-55.438-.024c-10.376.002-20.753 0-31.13-.014q-13.248-.019-26.498-.002-6.76.011-13.521-.005-6.189-.015-12.378.007-2.239.004-4.478-.008c-10.356-.052-17.722-.02-24.759 8.386"
|
464
|
-
}
|
465
|
-
),
|
466
|
-
/* @__PURE__ */ jsx17(
|
467
|
-
"path",
|
468
|
-
{
|
469
|
-
fill: "#FFF",
|
470
|
-
d: "M211.594 166.027C225.564 177.95 232.89 192.341 237 210v15h-38l-2-12c-3.428-9.924-9.002-16.527-18.25-21.375-8.317-3.952-19.394-4.22-28.062-1.187C141.226 194.932 134.624 202.24 131 212c-1.17 3.683-1.154 7.207-1.193 11.057l-.025 2.13q-.035 3.484-.055 6.97l-.017 2.417q-.039 6.342-.06 12.685-.02 5.22-.082 10.44c-.05 4.218-.074 8.437-.081 12.657a438 438 0 0 1-.046 4.793c-.172 12.03 1.188 23.276 9.907 32.394 7.225 6.372 16.431 10.19 26.16 9.809 8.312-1.173 15.45-3.473 21.492-9.352h2l.75-1.625c1.25-2.375 1.25-2.375 3.188-5 4.139-6.774 5.081-13.528 6.062-21.375h38c0 21.963-4.801 38.798-20.363 54.422L214 337l-1.918 2.016c-13.517 13.248-32.973 17.296-51.127 17.296-18.978-.262-36.43-7.932-49.955-21.312-16.343-18.293-21.143-37.855-21.203-61.969l-.009-2.324q-.022-6.097-.028-12.193c-.006-4.15-.03-8.301-.058-12.451a1811 1811 0 0 1-.026-9.7q-.004-2.29-.024-4.582c-.185-22.871 5.05-43.382 21.063-60.465 27.59-27.967 70.078-29.363 100.879-5.289M391 162.5a300 300 0 0 1 4 3.5l2 1.54c13.042 10.34 22.013 28.145 24 44.46v13h-38l-3-14c-4.092-9.822-9.492-15.253-19-20-8.913-3.553-18.759-3.316-27.625.25-9.012 4.09-14.51 10.719-18.187 19.813-2.989 7.986-2.348 17.084-2.356 25.457l-.01 3.922q-.009 4.095-.007 8.192c0 3.47-.014 6.939-.031 10.408-.014 3.347-.013 6.693-.014 10.04l-.022 3.729c.035 13.571 1.681 25.006 11.057 35.294 7.318 6.316 16.193 9.264 25.738 9.106 9.753-.837 18.156-5.38 24.77-12.524 5.983-7.59 7.067-14.967 8.687-24.687h38c0 20.87-4.852 37.261-19 53l-1.57 1.852c-10.837 11.926-28.103 20.027-44.063 21.37-21.875.91-40.916-3.117-57.91-17.921-13.741-12.868-23.846-30.701-24.597-49.89a557 557 0 0 1-.021-4.03l-.015-2.24q-.021-3.648-.027-7.297l-.009-2.538q-.022-6.658-.028-13.315c-.006-4.547-.03-9.095-.058-13.642a2163 2163 0 0 1-.026-10.584q-.004-2.512-.024-5.023c-.175-23.795 5.888-42.815 22.536-60.43C321.02 145.335 363.02 141.156 391 162.5"
|
471
|
-
}
|
472
|
-
)
|
473
|
-
] }));
|
474
|
-
var SubtitlesIcon_default = SvgSubtitlesIcon;
|
475
461
|
|
476
|
-
// src/components/
|
462
|
+
// src/components/icons/SubIcon.tsx
|
477
463
|
import { jsx as jsx18, jsxs as jsxs3 } from "react/jsx-runtime";
|
464
|
+
var SvgSubIcon = (props) => /* @__PURE__ */ jsxs3(
|
465
|
+
"svg",
|
466
|
+
__spreadProps(__spreadValues({
|
467
|
+
xmlns: "http://www.w3.org/2000/svg",
|
468
|
+
width: "1em",
|
469
|
+
height: "1em",
|
470
|
+
fill: "none",
|
471
|
+
stroke: "currentColor",
|
472
|
+
viewBox: "0 0 15 15"
|
473
|
+
}, props), {
|
474
|
+
children: [
|
475
|
+
/* @__PURE__ */ jsx18(
|
476
|
+
"path",
|
477
|
+
{
|
478
|
+
stroke: "currentColor",
|
479
|
+
strokeLinecap: "round",
|
480
|
+
strokeLinejoin: "round",
|
481
|
+
strokeWidth: 1.5,
|
482
|
+
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"
|
483
|
+
}
|
484
|
+
),
|
485
|
+
/* @__PURE__ */ jsx18(
|
486
|
+
"path",
|
487
|
+
{
|
488
|
+
stroke: "currentColor",
|
489
|
+
strokeLinecap: "round",
|
490
|
+
strokeLinejoin: "round",
|
491
|
+
strokeWidth: 1.5,
|
492
|
+
d: "M6.563 5.625H6.25c-.582 0-.874 0-1.103.095a1.25 1.25 0 0 0-.677.677c-.095.23-.095.52-.095 1.103 0 .582 0 .874.095 1.103a1.25 1.25 0 0 0 .677.677c.23.095.52.095 1.103.095h.313m4.062-3.75h-.312c-.583 0-.874 0-1.104.095a1.25 1.25 0 0 0-.676.677c-.095.23-.095.52-.095 1.103 0 .582 0 .874.095 1.103a1.25 1.25 0 0 0 .676.677c.23.095.521.095 1.104.095h.312"
|
493
|
+
}
|
494
|
+
)
|
495
|
+
]
|
496
|
+
})
|
497
|
+
);
|
498
|
+
var SubIcon_default = SvgSubIcon;
|
499
|
+
|
500
|
+
// src/components/VolumeSlider/index.tsx
|
501
|
+
import { jsx as jsx19, jsxs as jsxs4 } from "react/jsx-runtime";
|
478
502
|
var MIN = 0;
|
479
503
|
var MAX = 100;
|
480
|
-
var VolumeSlider = ({}) => {
|
504
|
+
var VolumeSlider = ({ width }) => {
|
481
505
|
const { player } = useSoftBuildersVideoPlayerContext();
|
506
|
+
const [isVisible, setVisible] = useState2(false);
|
482
507
|
const [volume, setVolume] = useState2(0);
|
483
508
|
useEffect2(() => {
|
484
509
|
setVolume((player == null ? void 0 : player.muted()) ? 0 : Number(player == null ? void 0 : player.volume()) * 100 || 0);
|
485
510
|
}, [player]);
|
511
|
+
const toggleVisiblity = () => {
|
512
|
+
setVisible((prev) => !prev);
|
513
|
+
};
|
486
514
|
const handleValueChange = (e) => {
|
487
515
|
const newVolume = Number(e.target.value);
|
488
516
|
setVolume(newVolume);
|
@@ -493,18 +521,48 @@ var VolumeSlider = ({}) => {
|
|
493
521
|
player == null ? void 0 : player.muted(false);
|
494
522
|
}
|
495
523
|
};
|
496
|
-
return /* @__PURE__ */
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
524
|
+
return /* @__PURE__ */ jsxs4(
|
525
|
+
"div",
|
526
|
+
{
|
527
|
+
className: `sb-flex sb-flex-col-reverse ${width > 600 ? "!sb-flex-row !sb-items-end" : ""} sb-items-center sb-justify-start sb-gap-2 sb-h-full`,
|
528
|
+
children: [
|
529
|
+
/* @__PURE__ */ jsx19(
|
530
|
+
"div",
|
531
|
+
{
|
532
|
+
className: `sb-flex sb-relative ${width > 600 ? "" : ""} sb-top-1 sb-items-end`,
|
533
|
+
onClick: toggleVisiblity,
|
534
|
+
children: volume === 0 || (player == null ? void 0 : player.muted()) ? /* @__PURE__ */ jsx19(
|
535
|
+
MuteIcon_default,
|
536
|
+
{
|
537
|
+
className: `sb-w-3 sb-h-3 ${width > 600 ? " " : ""} sb-h-5 sb-w-5`
|
538
|
+
}
|
539
|
+
) : /* @__PURE__ */ jsx19(
|
540
|
+
UnmuteIcon_default,
|
541
|
+
{
|
542
|
+
className: `sb-w-3 sb-h-3 ${width > 600 ? "" : ""} sb-h-5 sb-w-5`
|
543
|
+
}
|
544
|
+
)
|
545
|
+
}
|
546
|
+
),
|
547
|
+
/* @__PURE__ */ jsx19("div", { className: "sb-flex sb-items-center sb-justify-center", children: /* @__PURE__ */ jsx19(
|
548
|
+
"div",
|
549
|
+
{
|
550
|
+
className: `${isVisible && width < 600 ? " sb-w-[22px]" : !isVisible && width < 600 ? "sb-hidden" : ""} -sb-rotate-90 -sb-translate-y-2 sb-relative ${width > 600 ? "sb-static sb-w-16 sb-rotate-0 sb-translate-y-0 " : "sb-translate-y-0"}`,
|
551
|
+
children: /* @__PURE__ */ jsx19(
|
552
|
+
Slider_default,
|
553
|
+
{
|
554
|
+
value: volume,
|
555
|
+
handleValueChange,
|
556
|
+
min: MIN,
|
557
|
+
max: MAX,
|
558
|
+
className: "!sb-w-16"
|
559
|
+
}
|
560
|
+
)
|
561
|
+
}
|
562
|
+
) })
|
563
|
+
]
|
564
|
+
}
|
565
|
+
);
|
508
566
|
};
|
509
567
|
var VolumeSlider_default = VolumeSlider;
|
510
568
|
|
@@ -513,7 +571,7 @@ import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
513
571
|
|
514
572
|
// src/components/MenuButton/index.tsx
|
515
573
|
import { useCallback, useEffect as useEffect3, useRef, useState as useState3 } from "react";
|
516
|
-
import { jsx as
|
574
|
+
import { jsx as jsx20, jsxs as jsxs5 } from "react/jsx-runtime";
|
517
575
|
var MenuButton = ({ buttonContent, menuContent, close }) => {
|
518
576
|
const [isOpen, setIsOpen] = useState3(false);
|
519
577
|
const buttonRef = useRef(null);
|
@@ -534,8 +592,8 @@ var MenuButton = ({ buttonContent, menuContent, close }) => {
|
|
534
592
|
useEffect3(() => {
|
535
593
|
if (close) close(closeMenu);
|
536
594
|
}, [close, closeMenu]);
|
537
|
-
return /* @__PURE__ */
|
538
|
-
/* @__PURE__ */
|
595
|
+
return /* @__PURE__ */ jsxs5("div", { className: "sb-relative sb-flex sb-items-end", children: [
|
596
|
+
/* @__PURE__ */ jsx20(
|
539
597
|
"button",
|
540
598
|
{
|
541
599
|
ref: buttonRef,
|
@@ -546,7 +604,7 @@ var MenuButton = ({ buttonContent, menuContent, close }) => {
|
|
546
604
|
children: buttonContent
|
547
605
|
}
|
548
606
|
),
|
549
|
-
isOpen && /* @__PURE__ */
|
607
|
+
isOpen && /* @__PURE__ */ jsx20(
|
550
608
|
"div",
|
551
609
|
{
|
552
610
|
ref: menuRef,
|
@@ -562,15 +620,15 @@ var MenuButton = ({ buttonContent, menuContent, close }) => {
|
|
562
620
|
var MenuButton_default = MenuButton;
|
563
621
|
|
564
622
|
// src/components/QualityMenu/index.tsx
|
565
|
-
import { jsx as
|
623
|
+
import { jsx as jsx21, jsxs as jsxs6 } from "react/jsx-runtime";
|
566
624
|
var QualityOption = ({
|
567
625
|
isSelected,
|
568
626
|
quality,
|
569
627
|
onClick
|
570
628
|
}) => {
|
571
|
-
return /* @__PURE__ */
|
572
|
-
/* @__PURE__ */
|
573
|
-
/* @__PURE__ */
|
629
|
+
return /* @__PURE__ */ jsx21("button", { className: "hover:sb-text-orange-500 sb-p-2", onClick, children: /* @__PURE__ */ jsxs6("div", { className: "sb-grid sb-grid-cols-12 sb-items-center sb-gap-2", children: [
|
630
|
+
/* @__PURE__ */ jsx21("div", { className: "sb-col-span-3", children: isSelected ? /* @__PURE__ */ jsx21(CheckedIcon_default, { className: "sb-w-5 sb-h-5" }) : /* @__PURE__ */ jsx21("div", {}) }),
|
631
|
+
/* @__PURE__ */ jsx21("p", { className: "sb-text-left sb-col-span-9", children: quality.label })
|
574
632
|
] }) });
|
575
633
|
};
|
576
634
|
var QualityMenu = ({}) => {
|
@@ -594,13 +652,13 @@ var QualityMenu = ({}) => {
|
|
594
652
|
setCurrentQualitySrc(quality.src);
|
595
653
|
}
|
596
654
|
}, [player]);
|
597
|
-
return /* @__PURE__ */
|
655
|
+
return /* @__PURE__ */ jsx21(
|
598
656
|
MenuButton_default,
|
599
657
|
{
|
600
|
-
buttonContent: /* @__PURE__ */
|
601
|
-
menuContent: /* @__PURE__ */
|
602
|
-
/* @__PURE__ */
|
603
|
-
/* @__PURE__ */
|
658
|
+
buttonContent: /* @__PURE__ */ jsx21(SettingsIcon_default, { className: "sb-w-3 sb-h-3" }),
|
659
|
+
menuContent: /* @__PURE__ */ jsx21("div", { className: "sb-rounded-md sb-bg-[#303030] sb-bg-opacity-50 sb-py-5 sb-w-[150px]", children: /* @__PURE__ */ jsxs6("div", { className: "sb-flex sb-flex-col sb-gap-3", children: [
|
660
|
+
/* @__PURE__ */ jsxs6("div", { className: "sb-px-5 sb-flex sb-flex-row sb-gap-3 sb-items-start sb-relative sb-top-2", children: [
|
661
|
+
/* @__PURE__ */ jsx21(
|
604
662
|
"button",
|
605
663
|
{
|
606
664
|
onClick: () => {
|
@@ -609,14 +667,14 @@ var QualityMenu = ({}) => {
|
|
609
667
|
}
|
610
668
|
},
|
611
669
|
className: "hover:sb-scale-150",
|
612
|
-
children: /* @__PURE__ */
|
670
|
+
children: /* @__PURE__ */ jsx21(LeftArrowIcon_default, { className: "sb-w-3 sb-h-3" })
|
613
671
|
}
|
614
672
|
),
|
615
|
-
/* @__PURE__ */
|
673
|
+
/* @__PURE__ */ jsx21("h3", { children: "Quality" })
|
616
674
|
] }),
|
617
|
-
/* @__PURE__ */
|
618
|
-
/* @__PURE__ */
|
619
|
-
return /* @__PURE__ */
|
675
|
+
/* @__PURE__ */ jsx21("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }),
|
676
|
+
/* @__PURE__ */ jsx21("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-3 sb-items-start ", children: qualities.map((q, i) => {
|
677
|
+
return /* @__PURE__ */ jsx21(
|
620
678
|
QualityOption,
|
621
679
|
{
|
622
680
|
isSelected: currentQualitySrc === q.src,
|
@@ -648,7 +706,7 @@ var QualityMenu_default = QualityMenu;
|
|
648
706
|
|
649
707
|
// src/components/CreateNoteMenu/index.tsx
|
650
708
|
import { useState as useState5 } from "react";
|
651
|
-
import { jsx as
|
709
|
+
import { jsx as jsx22, jsxs as jsxs7 } from "react/jsx-runtime";
|
652
710
|
var CreateNoteMenu = ({ handleSaveNoteAction }) => {
|
653
711
|
const { player } = useSoftBuildersVideoPlayerContext();
|
654
712
|
const [note, setNote] = useState5("");
|
@@ -664,15 +722,15 @@ var CreateNoteMenu = ({ handleSaveNoteAction }) => {
|
|
664
722
|
);
|
665
723
|
}
|
666
724
|
};
|
667
|
-
return /* @__PURE__ */
|
725
|
+
return /* @__PURE__ */ jsx22(
|
668
726
|
MenuButton_default,
|
669
727
|
{
|
670
|
-
buttonContent: /* @__PURE__ */
|
671
|
-
menuContent: /* @__PURE__ */
|
672
|
-
/* @__PURE__ */
|
673
|
-
/* @__PURE__ */
|
674
|
-
/* @__PURE__ */
|
675
|
-
/* @__PURE__ */
|
728
|
+
buttonContent: /* @__PURE__ */ jsx22(ClosedNoteIcon_default, { className: "sb-w-3 sb-h-3" }),
|
729
|
+
menuContent: /* @__PURE__ */ jsx22("div", { className: "sb-rounded-md sb-bg-[#303030] sb-bg-opacity-50 sb-py-5 sb-w-[220px]", children: /* @__PURE__ */ jsxs7("div", { className: "sb-flex sb-flex-col sb-gap-3", children: [
|
730
|
+
/* @__PURE__ */ jsx22("h3", { className: "sb-px-5", children: "Add Note" }),
|
731
|
+
/* @__PURE__ */ jsx22("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }),
|
732
|
+
/* @__PURE__ */ jsxs7("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-4 sb-items-start", children: [
|
733
|
+
/* @__PURE__ */ jsx22(
|
676
734
|
"input",
|
677
735
|
{
|
678
736
|
name: "note",
|
@@ -684,7 +742,7 @@ var CreateNoteMenu = ({ handleSaveNoteAction }) => {
|
|
684
742
|
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"
|
685
743
|
}
|
686
744
|
),
|
687
|
-
/* @__PURE__ */
|
745
|
+
/* @__PURE__ */ jsx22("button", { className: "sb-w-full", onClick: handleSaveNote, children: /* @__PURE__ */ jsx22("div", { className: "sb-px-4 sb-py-3 sb-text-center sb-font-bold sb-bg-orange-500 sb-rounded-md", children: "Save" }) })
|
688
746
|
] })
|
689
747
|
] }) })
|
690
748
|
}
|
@@ -699,15 +757,15 @@ import { useEffect as useEffect6, useState as useState7 } from "react";
|
|
699
757
|
import { useEffect as useEffect5, useState as useState6 } from "react";
|
700
758
|
|
701
759
|
// src/components/Tooltip/index.tsx
|
702
|
-
import { jsx as
|
760
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
703
761
|
var Tooltip = ({ open, children }) => {
|
704
762
|
if (!open) return null;
|
705
|
-
return /* @__PURE__ */
|
763
|
+
return /* @__PURE__ */ jsx23("div", { 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", children });
|
706
764
|
};
|
707
765
|
var Tooltip_default = Tooltip;
|
708
766
|
|
709
767
|
// src/components/NoteTooltip/index.tsx
|
710
|
-
import { jsx as
|
768
|
+
import { jsx as jsx24, jsxs as jsxs8 } from "react/jsx-runtime";
|
711
769
|
var NoteTooltip = ({ note }) => {
|
712
770
|
const [open, setOpen] = useState6(false);
|
713
771
|
const { currentTime } = useSoftBuildersVideoPlayerContext();
|
@@ -719,16 +777,16 @@ var NoteTooltip = ({ note }) => {
|
|
719
777
|
}, 5e3);
|
720
778
|
}
|
721
779
|
}, [currentTime, note.time]);
|
722
|
-
return /* @__PURE__ */
|
780
|
+
return /* @__PURE__ */ jsx24(
|
723
781
|
"div",
|
724
782
|
{
|
725
783
|
className: "sb-w-1 sb-h-1 sb-rounded-full sb-bg-white sb-absolute sb-z-30",
|
726
784
|
style: { left: `${note.percentage}%` },
|
727
785
|
onMouseEnter: () => setOpen(true),
|
728
786
|
onMouseLeave: () => setOpen(false),
|
729
|
-
children: /* @__PURE__ */
|
730
|
-
/* @__PURE__ */
|
731
|
-
/* @__PURE__ */
|
787
|
+
children: /* @__PURE__ */ jsx24("div", { className: "sb-relative", children: /* @__PURE__ */ jsx24(Tooltip_default, { open, children: /* @__PURE__ */ jsxs8("div", { className: "sb-flex sb-flex-col sb-gap-2 sb-items-center", children: [
|
788
|
+
/* @__PURE__ */ jsx24("p", { children: note.label }),
|
789
|
+
/* @__PURE__ */ jsx24("p", { className: "sb-p-2 sb-bg-[#303030] sb-bg-opacity-50 sb-rounded-md", children: durationFormater(note.time) })
|
732
790
|
] }) }) })
|
733
791
|
}
|
734
792
|
);
|
@@ -736,7 +794,7 @@ var NoteTooltip = ({ note }) => {
|
|
736
794
|
var NoteTooltip_default = NoteTooltip;
|
737
795
|
|
738
796
|
// src/components/NotesPanal/index.tsx
|
739
|
-
import { jsx as
|
797
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
740
798
|
var NotesPanal = ({ notes }) => {
|
741
799
|
const [ns, setNs] = useState7([]);
|
742
800
|
const { duration } = useSoftBuildersVideoPlayerContext();
|
@@ -749,7 +807,7 @@ var NotesPanal = ({ notes }) => {
|
|
749
807
|
});
|
750
808
|
setNs(newNs);
|
751
809
|
}, [notes, duration]);
|
752
|
-
return /* @__PURE__ */
|
810
|
+
return /* @__PURE__ */ jsx25("div", { id: "notes-panal", className: "sb-w-full sb-h-full sb-relative ", children: ns.map((n, i) => /* @__PURE__ */ jsx25(NoteTooltip_default, { note: n }, `note-${i}-${n.time}`)) });
|
753
811
|
};
|
754
812
|
var NotesPanal_default = NotesPanal;
|
755
813
|
|
@@ -758,7 +816,7 @@ import { useEffect as useEffect8, useState as useState9 } from "react";
|
|
758
816
|
|
759
817
|
// src/components/ChapterTooltip/index.tsx
|
760
818
|
import { useEffect as useEffect7, useState as useState8 } from "react";
|
761
|
-
import { jsx as
|
819
|
+
import { jsx as jsx26, jsxs as jsxs9 } from "react/jsx-runtime";
|
762
820
|
var ChapterTooltip = ({ chapter }) => {
|
763
821
|
const { player } = useSoftBuildersVideoPlayerContext();
|
764
822
|
const [open, setOpen] = useState8(false);
|
@@ -774,7 +832,7 @@ var ChapterTooltip = ({ chapter }) => {
|
|
774
832
|
const handleClickChapter = () => {
|
775
833
|
player == null ? void 0 : player.currentTime(chapter.startTime);
|
776
834
|
};
|
777
|
-
return /* @__PURE__ */
|
835
|
+
return /* @__PURE__ */ jsx26(
|
778
836
|
"div",
|
779
837
|
{
|
780
838
|
id: `ii-section-${chapter.title}`,
|
@@ -785,15 +843,15 @@ var ChapterTooltip = ({ chapter }) => {
|
|
785
843
|
},
|
786
844
|
onMouseEnter: () => setOpen(true),
|
787
845
|
onMouseLeave: () => setOpen(false),
|
788
|
-
children: /* @__PURE__ */
|
846
|
+
children: /* @__PURE__ */ jsx26(
|
789
847
|
"button",
|
790
848
|
{
|
791
849
|
id: `section-${chapter.title}`,
|
792
850
|
className: "sb-h-full sb-w-full",
|
793
851
|
onClick: handleClickChapter,
|
794
|
-
children: /* @__PURE__ */
|
795
|
-
/* @__PURE__ */
|
796
|
-
/* @__PURE__ */
|
852
|
+
children: /* @__PURE__ */ jsx26("div", { className: "sb-relative sb-flex sb-h-full sb-w-full sb-justify-between sb-items-center", children: /* @__PURE__ */ jsx26(Tooltip_default, { open, children: /* @__PURE__ */ jsxs9("div", { className: "sb-flex sb-flex-col sb-gap-2 sb-items-center", children: [
|
853
|
+
/* @__PURE__ */ jsx26("p", { children: chapter.title }),
|
854
|
+
/* @__PURE__ */ jsxs9("p", { className: "sb-p-2 sb-bg-[#303030] sb-bg-opacity-50 sb-rounded-md", children: [
|
797
855
|
durationFormater(chapter.startTime),
|
798
856
|
" -",
|
799
857
|
" ",
|
@@ -808,7 +866,7 @@ var ChapterTooltip = ({ chapter }) => {
|
|
808
866
|
var ChapterTooltip_default = ChapterTooltip;
|
809
867
|
|
810
868
|
// src/components/ChaptersPanal/index.tsx
|
811
|
-
import { jsx as
|
869
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
812
870
|
var ChaptersPanal = ({ chapters }) => {
|
813
871
|
const [cs, setCs] = useState9([]);
|
814
872
|
const { duration } = useSoftBuildersVideoPlayerContext();
|
@@ -823,13 +881,13 @@ var ChaptersPanal = ({ chapters }) => {
|
|
823
881
|
});
|
824
882
|
setCs(newCs);
|
825
883
|
}, [chapters, duration]);
|
826
|
-
return /* @__PURE__ */
|
884
|
+
return /* @__PURE__ */ jsx27("div", { id: "chapters-panal", className: "sb-w-full sb-h-full sb-relative ", children: cs.map((c, i) => /* @__PURE__ */ jsx27(ChapterTooltip_default, { chapter: c }, `chapter-${i}-${c.startTime}`)) });
|
827
885
|
};
|
828
886
|
var ChaptersPanal_default = ChaptersPanal;
|
829
887
|
|
830
888
|
// src/components/TimeSlider/index.tsx
|
831
889
|
import { useEffect as useEffect9, useState as useState10 } from "react";
|
832
|
-
import { jsx as
|
890
|
+
import { jsx as jsx28, jsxs as jsxs10 } from "react/jsx-runtime";
|
833
891
|
var MIN2 = 0;
|
834
892
|
var MAX2 = 100;
|
835
893
|
var DEFERENCE = Math.abs(MAX2 - MIN2);
|
@@ -869,8 +927,8 @@ var TimeSlider = ({ chapters }) => {
|
|
869
927
|
arr.push(`black 100%`);
|
870
928
|
setMaskCuttes(arr.toString());
|
871
929
|
}, [chapters, duration]);
|
872
|
-
return /* @__PURE__ */
|
873
|
-
/* @__PURE__ */
|
930
|
+
return /* @__PURE__ */ jsxs10("div", { className: " sb-w-full sb-h-2 sb-flex sb-items-center sb-justify-center", children: [
|
931
|
+
/* @__PURE__ */ jsx28("div", { className: "sb-absolute sb-top-0 sb-left-0 sb-w-full sb-z-10", children: /* @__PURE__ */ jsx28(
|
874
932
|
Slider_default,
|
875
933
|
{
|
876
934
|
value: timeSlider,
|
@@ -882,7 +940,7 @@ var TimeSlider = ({ chapters }) => {
|
|
882
940
|
}
|
883
941
|
}
|
884
942
|
) }),
|
885
|
-
/* @__PURE__ */
|
943
|
+
/* @__PURE__ */ jsx28(
|
886
944
|
"div",
|
887
945
|
{
|
888
946
|
className: "sb-absolute sb-top-0 sb-left-0 sb-w-full sb-h-2 sb-bg-slate-400 sb-rounded-md",
|
@@ -912,24 +970,24 @@ var TimeSlider = ({ chapters }) => {
|
|
912
970
|
var TimeSlider_default = TimeSlider;
|
913
971
|
|
914
972
|
// src/components/TimeSliderContainer/index.tsx
|
915
|
-
import { jsx as
|
973
|
+
import { jsx as jsx29, jsxs as jsxs11 } from "react/jsx-runtime";
|
916
974
|
var TimeSliderContainer = ({ notes, chapters }) => {
|
917
|
-
return /* @__PURE__ */
|
975
|
+
return /* @__PURE__ */ jsxs11(
|
918
976
|
"div",
|
919
977
|
{
|
920
978
|
id: "time-slider-container",
|
921
979
|
className: "sb-w-full sb-relative sb-flex sb-items-center sb-justify-center",
|
922
980
|
children: [
|
923
|
-
/* @__PURE__ */
|
981
|
+
/* @__PURE__ */ jsx29(
|
924
982
|
"div",
|
925
983
|
{
|
926
984
|
id: "notes-panal",
|
927
985
|
className: "sb-absolute sb-w-full sb-h-full sb-top-[27%] sb-left-0",
|
928
|
-
children: /* @__PURE__ */
|
986
|
+
children: /* @__PURE__ */ jsx29(NotesPanal_default, { notes })
|
929
987
|
}
|
930
988
|
),
|
931
|
-
/* @__PURE__ */
|
932
|
-
/* @__PURE__ */
|
989
|
+
/* @__PURE__ */ jsx29("div", { className: "sb-absolute sb-w-full sb-h-full sb-top-0 sb-left-0", children: /* @__PURE__ */ jsx29(ChaptersPanal_default, { chapters }) }),
|
990
|
+
/* @__PURE__ */ jsx29(TimeSlider_default, { chapters })
|
933
991
|
]
|
934
992
|
}
|
935
993
|
);
|
@@ -938,7 +996,7 @@ var TimeSliderContainer_default = TimeSliderContainer;
|
|
938
996
|
|
939
997
|
// src/components/BufferTracker/index.tsx
|
940
998
|
import { useEffect as useEffect10 } from "react";
|
941
|
-
import { Fragment, jsx as
|
999
|
+
import { Fragment, jsx as jsx30 } from "react/jsx-runtime";
|
942
1000
|
var BufferTracker = () => {
|
943
1001
|
const { player, setDownloadedBufferTimeufferTime } = useSoftBuildersVideoPlayerContext();
|
944
1002
|
useEffect10(() => {
|
@@ -947,13 +1005,13 @@ var BufferTracker = () => {
|
|
947
1005
|
}, 1e3);
|
948
1006
|
return () => clearInterval(intervalId);
|
949
1007
|
}, [player]);
|
950
|
-
return /* @__PURE__ */
|
1008
|
+
return /* @__PURE__ */ jsx30(Fragment, {});
|
951
1009
|
};
|
952
1010
|
var BufferTracker_default = BufferTracker;
|
953
1011
|
|
954
1012
|
// src/components/CurrentTimeTracker/index.tsx
|
955
1013
|
import { useEffect as useEffect11 } from "react";
|
956
|
-
import { Fragment as Fragment2, jsx as
|
1014
|
+
import { Fragment as Fragment2, jsx as jsx31 } from "react/jsx-runtime";
|
957
1015
|
var CurrentTimeTracker = () => {
|
958
1016
|
const { setCurrentTime, player } = useSoftBuildersVideoPlayerContext();
|
959
1017
|
useEffect11(() => {
|
@@ -962,21 +1020,21 @@ var CurrentTimeTracker = () => {
|
|
962
1020
|
}, 500);
|
963
1021
|
return () => clearInterval(intervalId);
|
964
1022
|
}, [player]);
|
965
|
-
return /* @__PURE__ */
|
1023
|
+
return /* @__PURE__ */ jsx31(Fragment2, {});
|
966
1024
|
};
|
967
1025
|
var CurrentTimeTracker_default = CurrentTimeTracker;
|
968
1026
|
|
969
1027
|
// src/components/SubtitleMenu/index.tsx
|
970
1028
|
import { useEffect as useEffect12, useState as useState11 } from "react";
|
971
|
-
import { jsx as
|
1029
|
+
import { jsx as jsx32, jsxs as jsxs12 } from "react/jsx-runtime";
|
972
1030
|
var SubtitleOption = ({
|
973
1031
|
isSelected,
|
974
1032
|
subtitle,
|
975
1033
|
onClick
|
976
1034
|
}) => {
|
977
|
-
return /* @__PURE__ */
|
978
|
-
/* @__PURE__ */
|
979
|
-
/* @__PURE__ */
|
1035
|
+
return /* @__PURE__ */ jsx32("button", { className: "hover:sb-text-orange-500 sb-p-2", onClick, children: /* @__PURE__ */ jsxs12("div", { className: "sb-grid sb-grid-cols-12 sb-items-center sb-gap-2", children: [
|
1036
|
+
/* @__PURE__ */ jsx32("div", { className: "sb-col-span-3", children: isSelected ? /* @__PURE__ */ jsx32(CheckedIcon_default, { className: "sb-w-5 sb-h-5" }) : /* @__PURE__ */ jsx32("div", {}) }),
|
1037
|
+
/* @__PURE__ */ jsx32("p", { className: "sb-text-left sb-col-span-9", children: subtitle.label })
|
980
1038
|
] }) });
|
981
1039
|
};
|
982
1040
|
var SubtitleMenu = ({}) => {
|
@@ -1001,13 +1059,13 @@ var SubtitleMenu = ({}) => {
|
|
1001
1059
|
setSubtitles(textTracks);
|
1002
1060
|
}
|
1003
1061
|
}, [player]);
|
1004
|
-
return /* @__PURE__ */
|
1062
|
+
return /* @__PURE__ */ jsx32(
|
1005
1063
|
MenuButton_default,
|
1006
1064
|
{
|
1007
|
-
buttonContent: /* @__PURE__ */
|
1008
|
-
menuContent: /* @__PURE__ */
|
1009
|
-
/* @__PURE__ */
|
1010
|
-
/* @__PURE__ */
|
1065
|
+
buttonContent: /* @__PURE__ */ jsx32(SubIcon_default, { className: "sb-w-4 sb-h-4 sb-text-white " }),
|
1066
|
+
menuContent: /* @__PURE__ */ jsx32("div", { className: "sb-rounded-md sb-bg-[#303030] sb-bg-opacity-50 sb-py-5 sb-w-[150px]", children: /* @__PURE__ */ jsxs12("div", { className: "sb-flex sb-flex-col sb-gap-3", children: [
|
1067
|
+
/* @__PURE__ */ jsxs12("div", { className: "sb-px-5 sb-flex sb-flex-row sb-gap-3 sb-items-start", children: [
|
1068
|
+
/* @__PURE__ */ jsx32(
|
1011
1069
|
"button",
|
1012
1070
|
{
|
1013
1071
|
onClick: () => {
|
@@ -1016,14 +1074,14 @@ var SubtitleMenu = ({}) => {
|
|
1016
1074
|
}
|
1017
1075
|
},
|
1018
1076
|
className: "hover:sb-scale-150",
|
1019
|
-
children: /* @__PURE__ */
|
1077
|
+
children: /* @__PURE__ */ jsx32(LeftArrowIcon_default, { className: "sb-w-3 sb-h-3" })
|
1020
1078
|
}
|
1021
1079
|
),
|
1022
|
-
/* @__PURE__ */
|
1080
|
+
/* @__PURE__ */ jsx32("h3", { children: "Subtitle" })
|
1023
1081
|
] }),
|
1024
|
-
/* @__PURE__ */
|
1025
|
-
/* @__PURE__ */
|
1026
|
-
return /* @__PURE__ */
|
1082
|
+
/* @__PURE__ */ jsx32("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }),
|
1083
|
+
/* @__PURE__ */ jsx32("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-3 sb-items-start", children: subtitles.map((q, i) => {
|
1084
|
+
return /* @__PURE__ */ jsx32(
|
1027
1085
|
SubtitleOption,
|
1028
1086
|
{
|
1029
1087
|
isSelected: q.mode === "showing",
|
@@ -1045,7 +1103,7 @@ var SubtitleMenu = ({}) => {
|
|
1045
1103
|
var SubtitleMenu_default = SubtitleMenu;
|
1046
1104
|
|
1047
1105
|
// src/components/ControlBar/index.tsx
|
1048
|
-
import { jsx as
|
1106
|
+
import { jsx as jsx33, jsxs as jsxs13 } from "react/jsx-runtime";
|
1049
1107
|
var ControlBar = ({
|
1050
1108
|
player,
|
1051
1109
|
isPaused,
|
@@ -1054,14 +1112,29 @@ var ControlBar = ({
|
|
1054
1112
|
notes,
|
1055
1113
|
chapters,
|
1056
1114
|
seekStep = 5,
|
1115
|
+
id,
|
1057
1116
|
handleSaveNoteAction
|
1058
1117
|
}) => {
|
1059
1118
|
const { setPlayer, setDuration } = useSoftBuildersVideoPlayerContext();
|
1119
|
+
const [width, setwidth] = useState12(null);
|
1060
1120
|
const seek = (duration2) => {
|
1061
1121
|
const currentTime = Number((player == null ? void 0 : player.currentTime()) || 0);
|
1062
1122
|
player == null ? void 0 : player.currentTime(currentTime + duration2);
|
1063
1123
|
};
|
1064
|
-
const
|
1124
|
+
const container = document.getElementById(`video-container-${id}`);
|
1125
|
+
function handleWidthChange(width2) {
|
1126
|
+
setwidth(width2);
|
1127
|
+
console.log(width2);
|
1128
|
+
}
|
1129
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
1130
|
+
for (let entry of entries) {
|
1131
|
+
const currentWidth = entry.contentRect.width;
|
1132
|
+
handleWidthChange(currentWidth);
|
1133
|
+
}
|
1134
|
+
});
|
1135
|
+
resizeObserver.observe(container);
|
1136
|
+
const togglePlay = (e) => {
|
1137
|
+
e.stopPropagation();
|
1065
1138
|
if (isPaused) player == null ? void 0 : player.play();
|
1066
1139
|
else player == null ? void 0 : player.pause();
|
1067
1140
|
setIsPaused(!isPaused);
|
@@ -1072,34 +1145,34 @@ var ControlBar = ({
|
|
1072
1145
|
useEffect13(() => {
|
1073
1146
|
setDuration(duration);
|
1074
1147
|
}, [duration]);
|
1075
|
-
return /* @__PURE__ */
|
1076
|
-
/* @__PURE__ */
|
1077
|
-
/* @__PURE__ */
|
1078
|
-
/* @__PURE__ */
|
1148
|
+
return /* @__PURE__ */ jsxs13("div", { className: " sb-px-2 sb-flex sb-justify-center sb-gap-3 sb-w-full sb-h-full sb-items-end pb-2", children: [
|
1149
|
+
/* @__PURE__ */ jsx33(BufferTracker_default, {}),
|
1150
|
+
/* @__PURE__ */ jsx33(CurrentTimeTracker_default, {}),
|
1151
|
+
/* @__PURE__ */ jsx33(
|
1079
1152
|
"button",
|
1080
1153
|
{
|
1081
1154
|
onClick: () => {
|
1082
1155
|
seek(-seekStep);
|
1083
1156
|
},
|
1084
|
-
children: /* @__PURE__ */
|
1157
|
+
children: /* @__PURE__ */ jsx33(BackwardIcon_default, { className: "sb-w-3 sb-h-3" })
|
1085
1158
|
}
|
1086
1159
|
),
|
1087
|
-
/* @__PURE__ */
|
1088
|
-
/* @__PURE__ */
|
1160
|
+
/* @__PURE__ */ jsx33("button", { onClick: togglePlay, children: isPaused ? /* @__PURE__ */ jsx33(PlayIcon_default, { className: "sb-w-3 sb-h-3" }) : /* @__PURE__ */ jsx33(PauseIcon_default, { className: "sb-w-3 sb-h-3" }) }),
|
1161
|
+
/* @__PURE__ */ jsx33(
|
1089
1162
|
"button",
|
1090
1163
|
{
|
1091
1164
|
onClick: () => {
|
1092
1165
|
seek(seekStep);
|
1093
1166
|
},
|
1094
|
-
children: /* @__PURE__ */
|
1167
|
+
children: /* @__PURE__ */ jsx33(ForwardIcon_default, { className: "sb-w-3 sb-h-3" })
|
1095
1168
|
}
|
1096
1169
|
),
|
1097
|
-
/* @__PURE__ */
|
1098
|
-
/* @__PURE__ */
|
1099
|
-
/* @__PURE__ */
|
1100
|
-
/* @__PURE__ */
|
1101
|
-
/* @__PURE__ */
|
1102
|
-
/* @__PURE__ */
|
1170
|
+
/* @__PURE__ */ jsx33(CurrentTimeLabel_default, {}),
|
1171
|
+
/* @__PURE__ */ jsx33("div", { className: "sb-w-[30%] hover:sb-w-[45%] sb-transition-all sb-ease-in-out sb-duration-500", children: /* @__PURE__ */ jsx33(TimeSliderContainer_default, { chapters, notes }) }),
|
1172
|
+
/* @__PURE__ */ jsx33("p", { children: durationFormater(duration) }),
|
1173
|
+
/* @__PURE__ */ jsx33("div", { className: "sb-h-full", children: /* @__PURE__ */ jsx33(VolumeSlider_default, { width }) }),
|
1174
|
+
/* @__PURE__ */ jsx33(QualityMenu_default, {}),
|
1175
|
+
/* @__PURE__ */ jsx33(
|
1103
1176
|
"button",
|
1104
1177
|
{
|
1105
1178
|
onClick: () => {
|
@@ -1109,29 +1182,36 @@ var ControlBar = ({
|
|
1109
1182
|
player == null ? void 0 : player.requestFullscreen();
|
1110
1183
|
}
|
1111
1184
|
},
|
1112
|
-
children: /* @__PURE__ */
|
1185
|
+
children: /* @__PURE__ */ jsx33(FullScreenIcon_default, { className: "sb-w-3 sb-h-3" })
|
1113
1186
|
}
|
1114
1187
|
),
|
1115
|
-
handleSaveNoteAction && /* @__PURE__ */
|
1116
|
-
/* @__PURE__ */
|
1188
|
+
handleSaveNoteAction && /* @__PURE__ */ jsx33(CreateNoteMenu_default, { handleSaveNoteAction }),
|
1189
|
+
/* @__PURE__ */ jsx33(SubtitleMenu_default, {})
|
1117
1190
|
] });
|
1118
1191
|
};
|
1119
1192
|
var ControlBar_default = ControlBar;
|
1120
1193
|
|
1121
1194
|
// src/components/BigPlayButton/index.tsx
|
1122
|
-
import { jsx as
|
1195
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
1123
1196
|
var BigPlayButton = ({ player, isPaused, setIsPaused }) => {
|
1124
1197
|
const togglePlay = () => {
|
1125
1198
|
if (isPaused) player == null ? void 0 : player.play();
|
1126
1199
|
else player == null ? void 0 : player.pause();
|
1127
1200
|
setIsPaused(!isPaused);
|
1128
1201
|
};
|
1129
|
-
return /* @__PURE__ */
|
1202
|
+
return /* @__PURE__ */ jsx34(
|
1203
|
+
"div",
|
1204
|
+
{
|
1205
|
+
onClick: togglePlay,
|
1206
|
+
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 ",
|
1207
|
+
children: isPaused ? /* @__PURE__ */ jsx34(PlayIcon_default, { className: "sb-w-4 sb-h-4" }) : /* @__PURE__ */ jsx34(PauseIcon_default, { className: "sb-w-4 sb-h-4" })
|
1208
|
+
}
|
1209
|
+
);
|
1130
1210
|
};
|
1131
1211
|
var BigPlayButton_default = BigPlayButton;
|
1132
1212
|
|
1133
1213
|
// src/components/VideoPlayerComponent/index.tsx
|
1134
|
-
import { jsx as
|
1214
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
1135
1215
|
var bigPlayButtonRoot = {};
|
1136
1216
|
var renderBigPlayButton = (id, player, isPaused, setIsPaused) => {
|
1137
1217
|
const container = document.getElementById(`video-container-${id}`);
|
@@ -1142,7 +1222,7 @@ var renderBigPlayButton = (id, player, isPaused, setIsPaused) => {
|
|
1142
1222
|
bigPlayButtonRoot[id] = ReactDOM.createRoot(element);
|
1143
1223
|
}
|
1144
1224
|
bigPlayButtonRoot[id].render(
|
1145
|
-
/* @__PURE__ */
|
1225
|
+
/* @__PURE__ */ jsx35(
|
1146
1226
|
BigPlayButton_default,
|
1147
1227
|
{
|
1148
1228
|
player,
|
@@ -1163,11 +1243,14 @@ var renderControlBar = (id, player, isPaused, setIsPaused, duration, notes, chap
|
|
1163
1243
|
if (!controlBarRoot[id]) {
|
1164
1244
|
controlBarRoot[id] = ReactDOM.createRoot(element);
|
1165
1245
|
}
|
1166
|
-
element.style.display = "
|
1246
|
+
element.style.display = "flex";
|
1247
|
+
element.style.height = "100%";
|
1248
|
+
element.style.alignItems = "flex-end";
|
1167
1249
|
controlBarRoot[id].render(
|
1168
|
-
/* @__PURE__ */
|
1250
|
+
/* @__PURE__ */ jsx35(SoftBuildersVideoPlayerProvider, { children: /* @__PURE__ */ jsx35(
|
1169
1251
|
ControlBar_default,
|
1170
1252
|
{
|
1253
|
+
id,
|
1171
1254
|
player,
|
1172
1255
|
isPaused,
|
1173
1256
|
setIsPaused,
|
@@ -1189,14 +1272,15 @@ var VideoPlayerComponent = ({
|
|
1189
1272
|
chapters,
|
1190
1273
|
startTime = 0,
|
1191
1274
|
handleSaveNoteAction,
|
1275
|
+
poster,
|
1192
1276
|
onPlay,
|
1193
1277
|
onPause
|
1194
1278
|
}) => {
|
1195
1279
|
const videoRef = useRef2(void 0);
|
1196
1280
|
const playerRef = useRef2(void 0);
|
1197
|
-
const [isReady, setIsReady] =
|
1198
|
-
const [isPaused, setIsPaused] =
|
1199
|
-
const [duration,
|
1281
|
+
const [isReady, setIsReady] = useState13(false);
|
1282
|
+
const [isPaused, setIsPaused] = useState13(!options.autoplay);
|
1283
|
+
const [duration, setDuration] = useState13(1);
|
1200
1284
|
const onReady = (player) => {
|
1201
1285
|
if (playerRef) {
|
1202
1286
|
playerRef.current = player;
|
@@ -1210,7 +1294,7 @@ var VideoPlayerComponent = ({
|
|
1210
1294
|
});
|
1211
1295
|
player.on("loadedmetadata", () => {
|
1212
1296
|
const d = player.duration() || 0;
|
1213
|
-
|
1297
|
+
setDuration(d);
|
1214
1298
|
});
|
1215
1299
|
}
|
1216
1300
|
};
|
@@ -1218,32 +1302,33 @@ var VideoPlayerComponent = ({
|
|
1218
1302
|
if (!playerRef.current) {
|
1219
1303
|
const videoElement = document.createElement("video-js");
|
1220
1304
|
videoElement.classList.add("vjs-big-play-centered");
|
1305
|
+
if (poster) {
|
1306
|
+
videoElement.setAttribute("poster", poster);
|
1307
|
+
}
|
1221
1308
|
videoRef.current.appendChild(videoElement);
|
1222
1309
|
playerRef.current = videojs(videoElement, options, () => {
|
1223
1310
|
onReady(playerRef.current);
|
1224
1311
|
});
|
1225
1312
|
}
|
1226
1313
|
return () => {
|
1227
|
-
if (playerRef) {
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
}, 0);
|
1241
|
-
}
|
1314
|
+
if (playerRef.current) {
|
1315
|
+
playerRef.current.dispose();
|
1316
|
+
playerRef.current = void 0;
|
1317
|
+
setTimeout(() => {
|
1318
|
+
if (bigPlayButtonRoot[id]) {
|
1319
|
+
bigPlayButtonRoot[id].unmount();
|
1320
|
+
bigPlayButtonRoot[id] = void 0;
|
1321
|
+
}
|
1322
|
+
if (controlBarRoot[id]) {
|
1323
|
+
controlBarRoot[id].unmount();
|
1324
|
+
controlBarRoot[id] = void 0;
|
1325
|
+
}
|
1326
|
+
}, 0);
|
1242
1327
|
}
|
1243
1328
|
};
|
1244
|
-
}, [options]);
|
1329
|
+
}, [options, poster]);
|
1245
1330
|
useEffect14(() => {
|
1246
|
-
if (playerRef
|
1331
|
+
if (playerRef.current && isReady) {
|
1247
1332
|
const currentTime = playerRef.current.currentTime() || 0;
|
1248
1333
|
if (isPaused) {
|
1249
1334
|
if (onPause) onPause(currentTime);
|
@@ -1281,7 +1366,7 @@ var VideoPlayerComponent = ({
|
|
1281
1366
|
duration
|
1282
1367
|
]);
|
1283
1368
|
useEffect14(() => {
|
1284
|
-
if (isReady
|
1369
|
+
if (isReady) {
|
1285
1370
|
const playButtonTimeout = setTimeout(() => {
|
1286
1371
|
renderBigPlayButton(id, playerRef.current, isPaused, setIsPaused);
|
1287
1372
|
}, 500);
|
@@ -1289,28 +1374,49 @@ var VideoPlayerComponent = ({
|
|
1289
1374
|
}
|
1290
1375
|
}, [id, isPaused, isReady]);
|
1291
1376
|
useEffect14(() => {
|
1292
|
-
if (playerRef) {
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
return () => clearInterval(intervalId);
|
1298
|
-
}
|
1377
|
+
if (playerRef.current) {
|
1378
|
+
const intervalId = setInterval(() => {
|
1379
|
+
if (playerRef.current) setIsPaused(playerRef.current.paused());
|
1380
|
+
}, 500);
|
1381
|
+
return () => clearInterval(intervalId);
|
1299
1382
|
}
|
1300
1383
|
}, []);
|
1301
|
-
|
1384
|
+
const handlePlayerClick = () => {
|
1385
|
+
if (playerRef.current) {
|
1386
|
+
if (playerRef.current.paused()) {
|
1387
|
+
playerRef.current.play();
|
1388
|
+
setIsPaused(false);
|
1389
|
+
} else {
|
1390
|
+
playerRef.current.pause();
|
1391
|
+
setIsPaused(true);
|
1392
|
+
if (onPause) onPause(playerRef.current.currentTime());
|
1393
|
+
}
|
1394
|
+
}
|
1395
|
+
};
|
1396
|
+
return /* @__PURE__ */ jsx35(
|
1302
1397
|
"div",
|
1303
1398
|
{
|
1304
1399
|
id: `video-container-${id}`,
|
1305
|
-
className: "sb-relative sb-rounded-md sb-overflow-hidden",
|
1306
|
-
|
1400
|
+
className: "sb-relative sb-rounded-md sb-overflow-hidden hover:sb-cursor-pointer",
|
1401
|
+
onClick: handlePlayerClick,
|
1402
|
+
children: /* @__PURE__ */ jsx35(
|
1403
|
+
"div",
|
1404
|
+
{
|
1405
|
+
"data-vjs-player": true,
|
1406
|
+
style: {
|
1407
|
+
height: "100%",
|
1408
|
+
position: "relative"
|
1409
|
+
},
|
1410
|
+
children: /* @__PURE__ */ jsx35("div", { ref: videoRef })
|
1411
|
+
}
|
1412
|
+
)
|
1307
1413
|
}
|
1308
1414
|
);
|
1309
1415
|
};
|
1310
1416
|
var VideoPlayerComponent_default = VideoPlayerComponent;
|
1311
1417
|
|
1312
1418
|
// src/components/SoftBuildersVideoPlayer/index.tsx
|
1313
|
-
import { jsx as
|
1419
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
1314
1420
|
var DEFAULT_OPTIONS = {
|
1315
1421
|
autoplay: false,
|
1316
1422
|
controls: true,
|
@@ -1345,7 +1451,7 @@ var Component = ({
|
|
1345
1451
|
if (options.muted === void 0) options.muted = DEFAULT_OPTIONS.muted;
|
1346
1452
|
if (options.height === void 0) options.height = DEFAULT_OPTIONS.height;
|
1347
1453
|
if (options.width === void 0) options.width = DEFAULT_OPTIONS.width;
|
1348
|
-
const [tracks, setTracks] =
|
1454
|
+
const [tracks, setTracks] = useState14([]);
|
1349
1455
|
useEffect15(() => {
|
1350
1456
|
const getTracks = async () => {
|
1351
1457
|
const newTracks = [];
|
@@ -1364,13 +1470,14 @@ var Component = ({
|
|
1364
1470
|
getTracks();
|
1365
1471
|
}, [options.tracks]);
|
1366
1472
|
const id = (Date.now() + Math.random() * 100).toString();
|
1367
|
-
return /* @__PURE__ */
|
1473
|
+
return /* @__PURE__ */ jsx36(
|
1368
1474
|
VideoPlayerComponent_default,
|
1369
1475
|
{
|
1370
1476
|
id,
|
1371
1477
|
chapters,
|
1372
1478
|
options: __spreadProps(__spreadValues({}, options), { tracks }),
|
1373
1479
|
notes,
|
1480
|
+
poster: "",
|
1374
1481
|
startTime,
|
1375
1482
|
handleSaveNoteAction,
|
1376
1483
|
onPause,
|