softbuilders-react-video-player 1.2.23 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/ControlBar/index.js +16 -11
- package/dist/components/ControlBar/index.js.map +1 -1
- package/dist/components/ControlBar/index.tsx +29 -10
- package/dist/components/QualityMenu/index.d.ts +2 -1
- package/dist/components/QualityMenu/index.js +16 -8
- package/dist/components/QualityMenu/index.js.map +1 -1
- package/dist/components/QualityMenu/index.tsx +22 -8
- package/dist/components/SubtitleMenu/index.js +3 -1
- package/dist/components/SubtitleMenu/index.js.map +1 -1
- package/dist/components/SubtitleMenu/index.tsx +4 -2
- package/dist/components/Tooltip/GlobalTooltip.d.ts +1 -1
- package/dist/components/Tooltip/GlobalTooltip.js +8 -3
- package/dist/components/Tooltip/GlobalTooltip.js.map +1 -1
- package/dist/components/Tooltip/GlobalTooltip.tsx +9 -3
- package/dist/components/VideoPlayerComponent/index.js +2 -0
- package/dist/components/VideoPlayerComponent/index.js.map +1 -1
- package/dist/components/VideoPlayerComponent/index.tsx +1 -0
- package/dist/components/VolumeSlider/index.js +13 -3
- package/dist/components/VolumeSlider/index.js.map +1 -1
- package/dist/components/VolumeSlider/index.tsx +17 -7
- package/dist/index.mjs +111 -68
- package/package.json +1 -1
@@ -122,11 +122,21 @@ const VolumeSlider = ({ width = 0, setIsSeeking, handleControlDisplayTimer, volu
|
|
122
122
|
setVolume(0);
|
123
123
|
player === null || player === void 0 ? void 0 : player.muted(true);
|
124
124
|
};
|
125
|
-
return (_jsxs("div", { className: `sb-flex ${isVisible ? "" : ""} ${width > 400 && !isTrailer
|
125
|
+
return (_jsxs("div", { className: `sb-flex ${isVisible ? "" : ""} ${(width > 400 || (player === null || player === void 0 ? void 0 : player.isFullscreen_) === true) && !isTrailer
|
126
126
|
? "sb-flex-col-reverse"
|
127
|
-
: `sb-flex-col ${isTrailer ? "sb-justify-start" : ""}`} sb-items-center sb-gap-1 sb-h-full`, children: [_jsx("div", { className: `sb-flex sb-relative ${width < 400
|
127
|
+
: `sb-flex-col ${isTrailer ? "sb-justify-start" : ""}`} sb-items-center sb-gap-1 sb-h-full`, children: [_jsx("div", { className: `sb-flex sb-relative ${(width < 400 && (player === null || player === void 0 ? void 0 : player.isFullscreen_) === false) || isTrailer
|
128
|
+
? "-sb-top-1"
|
129
|
+
: "sb-top-1"}`, onClick: toggleVisibility, onDoubleClick: handleDoubleClick, children: volume == 0 || (player === null || player === void 0 ? void 0 : player.muted()) ? (_jsx(VolumeMute, { className: `sb-w-3 sb-h-3 ${(width < 400 && (player === null || player === void 0 ? void 0 : player.isFullscreen_) === false) || isTrailer
|
130
|
+
? ""
|
131
|
+
: ""} sb-h-5 sb-w-5` })) : volume < 25 ? (_jsx(VolumeVLow, { className: `sb-w-3 sb-h-3 ${(width < 400 && (player === null || player === void 0 ? void 0 : player.isFullscreen_) === false) || isTrailer
|
132
|
+
? ""
|
133
|
+
: ""} sb-h-5 sb-w-5` })) : volume < 50 ? (_jsx(VolumeLow, { className: `sb-w-3 sb-h-3 ${(width < 400 && (player === null || player === void 0 ? void 0 : player.isFullscreen_) === false) || isTrailer
|
134
|
+
? ""
|
135
|
+
: ""} sb-h-5 sb-w-5` })) : (_jsx(VolumeHigh, { className: `sb-w-3 sb-h-3 ${(width < 400 && (player === null || player === void 0 ? void 0 : player.isFullscreen_) === false) || isTrailer
|
136
|
+
? ""
|
137
|
+
: ""} sb-h-5 sb-w-5` })) }), _jsx("div", { className: "sb-flex sb-items-center sb-justify-center", children: _jsx("div", { className: ` sb-transition-all sb-ease-in-out sb-duration-500 ${isVisible
|
128
138
|
? "sb-w-[22px] sb-opacity-100 sb-visible"
|
129
|
-
: "sb-w-[22px] sb-opacity-0 sb-invisible"} ${width > 400 && !isTrailer
|
139
|
+
: "sb-w-[22px] sb-opacity-0 sb-invisible"} ${(width > 400 || (player === null || player === void 0 ? void 0 : player.isFullscreen_) === true) && !isTrailer
|
130
140
|
? "-sb-rotate-90 -sb-translate-y-1"
|
131
141
|
: "sb-rotate-90 sb-translate-y-1"} sb-relative`, children: _jsx(Slider, { onMouseMove: (e) => onMouseMove(e), setNoteOpen: setNoteOpen, value: volume, handleValueChange: handleValueChange, min: MIN, max: MAX, className: "!sb-w-16 ", handleSliderClick: handleVolumeSliderClick, setClicked: setClicked }) }) })] }));
|
132
142
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/VolumeSlider/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AAErF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGzE,MAAM,GAAG,GAAG,CAAC,EACX,GAAG,GAAG,GAAG,CAAC;AAWZ,MAAM,YAAY,GAAG,CAAC,EACpB,KAAK,GAAG,CAAC,EACT,YAAY,EACZ,yBAAyB,EACzB,mBAAmB,EACnB,SAAS,EACT,WAAW,GACL,EAAE,EAAE;IACV,MAAM,EAAE,MAAM,EAAE,GAAG,iCAAiC,EAAE,CAAC;IACvD,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACxC,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEhD,yDAAyD;IACzD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,iBAAiB,GAAG,GAAG,EAAE;YAC7B,MAAM,aAAa,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,EAAE;gBACnC,CAAC,CAAC,CAAC;gBACH,CAAC,CAAC,MAAM,CAAC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,MAAM,IACL,WAAW,EAAE,CAAC,CAAmC,EAAE,EAAE,CACnD,WAAW,CAAC,CAAC,CAAC,EAEhB,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,MAAM,EACb,iBAAiB,EAAE,iBAAiB,EACpC,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAC,WAAW,EACrB,iBAAiB,EAAE,uBAAuB,EAC1C,UAAU,EAAE,UAAU,GACtB,GACE,GACF,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
@@ -150,7 +150,7 @@ const VolumeSlider = ({
|
|
150
150
|
return (
|
151
151
|
<div
|
152
152
|
className={`sb-flex ${isVisible ? "" : ""} ${
|
153
|
-
width > 400 && !isTrailer
|
153
|
+
(width > 400 || player?.isFullscreen_ === true) && !isTrailer
|
154
154
|
? "sb-flex-col-reverse"
|
155
155
|
: `sb-flex-col ${isTrailer ? "sb-justify-start" : ""}`
|
156
156
|
} sb-items-center sb-gap-1 sb-h-full`}
|
@@ -158,7 +158,9 @@ const VolumeSlider = ({
|
|
158
158
|
{/* Mute/Unmute Icon */}
|
159
159
|
<div
|
160
160
|
className={`sb-flex sb-relative ${
|
161
|
-
width < 400
|
161
|
+
(width < 400 && player?.isFullscreen_ === false) || isTrailer
|
162
|
+
? "-sb-top-1"
|
163
|
+
: "sb-top-1"
|
162
164
|
}`}
|
163
165
|
onClick={toggleVisibility}
|
164
166
|
onDoubleClick={handleDoubleClick}
|
@@ -166,25 +168,33 @@ const VolumeSlider = ({
|
|
166
168
|
{volume == 0 || player?.muted() ? (
|
167
169
|
<VolumeMute
|
168
170
|
className={`sb-w-3 sb-h-3 ${
|
169
|
-
width < 400
|
171
|
+
(width < 400 && player?.isFullscreen_ === false) || isTrailer
|
172
|
+
? ""
|
173
|
+
: ""
|
170
174
|
} sb-h-5 sb-w-5`}
|
171
175
|
/>
|
172
176
|
) : volume < 25 ? (
|
173
177
|
<VolumeVLow
|
174
178
|
className={`sb-w-3 sb-h-3 ${
|
175
|
-
width < 400
|
179
|
+
(width < 400 && player?.isFullscreen_ === false) || isTrailer
|
180
|
+
? ""
|
181
|
+
: ""
|
176
182
|
} sb-h-5 sb-w-5`}
|
177
183
|
/>
|
178
184
|
) : volume < 50 ? (
|
179
185
|
<VolumeLow
|
180
186
|
className={`sb-w-3 sb-h-3 ${
|
181
|
-
width < 400
|
187
|
+
(width < 400 && player?.isFullscreen_ === false) || isTrailer
|
188
|
+
? ""
|
189
|
+
: ""
|
182
190
|
} sb-h-5 sb-w-5`}
|
183
191
|
></VolumeLow>
|
184
192
|
) : (
|
185
193
|
<VolumeHigh
|
186
194
|
className={`sb-w-3 sb-h-3 ${
|
187
|
-
width < 400
|
195
|
+
(width < 400 && player?.isFullscreen_ === false) || isTrailer
|
196
|
+
? ""
|
197
|
+
: ""
|
188
198
|
} sb-h-5 sb-w-5`}
|
189
199
|
></VolumeHigh>
|
190
200
|
)}
|
@@ -199,7 +209,7 @@ const VolumeSlider = ({
|
|
199
209
|
? "sb-w-[22px] sb-opacity-100 sb-visible"
|
200
210
|
: "sb-w-[22px] sb-opacity-0 sb-invisible"
|
201
211
|
} ${
|
202
|
-
width > 400 && !isTrailer
|
212
|
+
(width > 400 || player?.isFullscreen_ === true) && !isTrailer
|
203
213
|
? "-sb-rotate-90 -sb-translate-y-1"
|
204
214
|
: "sb-rotate-90 sb-translate-y-1"
|
205
215
|
} sb-relative`}
|
package/dist/index.mjs
CHANGED
@@ -31,13 +31,13 @@ var __objRest = (source, exclude) => {
|
|
31
31
|
};
|
32
32
|
|
33
33
|
// src/components/SoftBuildersVideoPlayer/index.tsx
|
34
|
-
import { forwardRef as forwardRef2, memo, useEffect as
|
34
|
+
import { forwardRef as forwardRef2, memo, useEffect as useEffect16, useState as useState15 } from "react";
|
35
35
|
|
36
36
|
// src/components/VideoPlayerComponent/index.tsx
|
37
37
|
import {
|
38
38
|
forwardRef,
|
39
39
|
Suspense,
|
40
|
-
useEffect as
|
40
|
+
useEffect as useEffect15,
|
41
41
|
useRef as useRef2,
|
42
42
|
useState as useState14
|
43
43
|
} from "react";
|
@@ -46,7 +46,7 @@ import videojs from "video.js";
|
|
46
46
|
import "video.js/dist/video-js.css";
|
47
47
|
|
48
48
|
// src/components/ControlBar/index.tsx
|
49
|
-
import { useEffect as
|
49
|
+
import { useEffect as useEffect14, useState as useState13 } from "react";
|
50
50
|
|
51
51
|
// src/utils/index.ts
|
52
52
|
var durationFormater = (seconds) => {
|
@@ -727,33 +727,33 @@ var VolumeSlider = ({
|
|
727
727
|
return /* @__PURE__ */ jsxs7(
|
728
728
|
"div",
|
729
729
|
{
|
730
|
-
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`,
|
730
|
+
className: `sb-flex ${isVisible ? "" : ""} ${(width > 400 || (player == null ? void 0 : player.isFullscreen_) === true) && !isTrailer ? "sb-flex-col-reverse" : `sb-flex-col ${isTrailer ? "sb-justify-start" : ""}`} sb-items-center sb-gap-1 sb-h-full`,
|
731
731
|
children: [
|
732
732
|
/* @__PURE__ */ jsx24(
|
733
733
|
"div",
|
734
734
|
{
|
735
|
-
className: `sb-flex sb-relative ${width < 400 || isTrailer ? "-sb-top-1" : "sb-top-1"}`,
|
735
|
+
className: `sb-flex sb-relative ${width < 400 && (player == null ? void 0 : player.isFullscreen_) === false || isTrailer ? "-sb-top-1" : "sb-top-1"}`,
|
736
736
|
onClick: toggleVisibility,
|
737
737
|
onDoubleClick: handleDoubleClick,
|
738
738
|
children: volume == 0 || (player == null ? void 0 : player.muted()) ? /* @__PURE__ */ jsx24(
|
739
739
|
VolumeMute_default,
|
740
740
|
{
|
741
|
-
className: `sb-w-3 sb-h-3 ${width < 400 || isTrailer ? "" : ""} sb-h-5 sb-w-5`
|
741
|
+
className: `sb-w-3 sb-h-3 ${width < 400 && (player == null ? void 0 : player.isFullscreen_) === false || isTrailer ? "" : ""} sb-h-5 sb-w-5`
|
742
742
|
}
|
743
743
|
) : volume < 25 ? /* @__PURE__ */ jsx24(
|
744
744
|
VolumeVLow_default,
|
745
745
|
{
|
746
|
-
className: `sb-w-3 sb-h-3 ${width < 400 || isTrailer ? "" : ""} sb-h-5 sb-w-5`
|
746
|
+
className: `sb-w-3 sb-h-3 ${width < 400 && (player == null ? void 0 : player.isFullscreen_) === false || isTrailer ? "" : ""} sb-h-5 sb-w-5`
|
747
747
|
}
|
748
748
|
) : volume < 50 ? /* @__PURE__ */ jsx24(
|
749
749
|
VolumeLow_default,
|
750
750
|
{
|
751
|
-
className: `sb-w-3 sb-h-3 ${width < 400 || isTrailer ? "" : ""} sb-h-5 sb-w-5`
|
751
|
+
className: `sb-w-3 sb-h-3 ${width < 400 && (player == null ? void 0 : player.isFullscreen_) === false || isTrailer ? "" : ""} sb-h-5 sb-w-5`
|
752
752
|
}
|
753
753
|
) : /* @__PURE__ */ jsx24(
|
754
754
|
VolumeHigh_default,
|
755
755
|
{
|
756
|
-
className: `sb-w-3 sb-h-3 ${width < 400 || isTrailer ? "" : ""} sb-h-5 sb-w-5`
|
756
|
+
className: `sb-w-3 sb-h-3 ${width < 400 && (player == null ? void 0 : player.isFullscreen_) === false || isTrailer ? "" : ""} sb-h-5 sb-w-5`
|
757
757
|
}
|
758
758
|
)
|
759
759
|
}
|
@@ -761,7 +761,7 @@ var VolumeSlider = ({
|
|
761
761
|
/* @__PURE__ */ jsx24("div", { className: "sb-flex sb-items-center sb-justify-center", children: /* @__PURE__ */ jsx24(
|
762
762
|
"div",
|
763
763
|
{
|
764
|
-
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`,
|
764
|
+
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 || (player == null ? void 0 : player.isFullscreen_) === true) && !isTrailer ? "-sb-rotate-90 -sb-translate-y-1" : "sb-rotate-90 sb-translate-y-1"} sb-relative`,
|
765
765
|
children: /* @__PURE__ */ jsx24(
|
766
766
|
Slider_default,
|
767
767
|
{
|
@@ -873,10 +873,11 @@ var QualityOption = ({
|
|
873
873
|
width,
|
874
874
|
isTrailer
|
875
875
|
}) => {
|
876
|
+
const { player } = useSoftBuildersVideoPlayerContext();
|
876
877
|
return /* @__PURE__ */ jsx26(
|
877
878
|
"button",
|
878
879
|
{
|
879
|
-
className: `hover:sb-text-orange-500 ${width > 400 && !isTrailer ? "sb-p-2" : "sp-pb-1"}`,
|
880
|
+
className: `hover:sb-text-orange-500 ${(width > 400 || (player == null ? void 0 : player.isFullscreen_) === true) && !isTrailer ? "sb-p-2" : "sp-pb-1"}`,
|
880
881
|
onClick: (e) => {
|
881
882
|
e.stopPropagation();
|
882
883
|
onClick(e);
|
@@ -885,7 +886,7 @@ var QualityOption = ({
|
|
885
886
|
/* @__PURE__ */ jsx26("div", { className: "sb-col-span-3", children: isSelected ? /* @__PURE__ */ jsx26(
|
886
887
|
CheckedIcon_default,
|
887
888
|
{
|
888
|
-
className: `${width > 400 && !isTrailer ? "sb-w-5 sb-h-5" : "sb-w-3 sb-h-3"}`
|
889
|
+
className: `${(width > 400 || (player == null ? void 0 : player.isFullscreen_) === true) && !isTrailer ? "sb-w-5 sb-h-5" : "sb-w-3 sb-h-3"}`
|
889
890
|
}
|
890
891
|
) : /* @__PURE__ */ jsx26("div", {}) }),
|
891
892
|
/* @__PURE__ */ jsx26("p", { className: "sb-text-left sb-col-span-9", children: quality == null ? void 0 : quality.label })
|
@@ -893,7 +894,12 @@ var QualityOption = ({
|
|
893
894
|
}
|
894
895
|
);
|
895
896
|
};
|
896
|
-
var QualityMenu = ({
|
897
|
+
var QualityMenu = ({
|
898
|
+
width,
|
899
|
+
onClick,
|
900
|
+
isTrailer,
|
901
|
+
setIsModalChanged
|
902
|
+
}) => {
|
897
903
|
const { player } = useSoftBuildersVideoPlayerContext();
|
898
904
|
const [closeMenuFunction, setCloseMenuFunction] = useState4(void 0);
|
899
905
|
const [qualities, setQualities] = useState4(
|
@@ -920,7 +926,7 @@ var QualityMenu = ({ width, onClick, isTrailer }) => {
|
|
920
926
|
return /* @__PURE__ */ jsx26(
|
921
927
|
MenuButton_default,
|
922
928
|
{
|
923
|
-
classContainer: `${width < 400 || isTrailer ? "!sb-top-8 -sb-left-9" : ""}`,
|
929
|
+
classContainer: `${width < 400 && (player == null ? void 0 : player.isFullscreen_) === false || isTrailer ? "!sb-top-8 -sb-left-9" : ""}`,
|
924
930
|
onClick: (e, isOpen) => {
|
925
931
|
onClick && onClick(e, isOpen);
|
926
932
|
},
|
@@ -928,7 +934,7 @@ var QualityMenu = ({ width, onClick, isTrailer }) => {
|
|
928
934
|
menuContent: /* @__PURE__ */ jsx26(
|
929
935
|
"div",
|
930
936
|
{
|
931
|
-
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"}`,
|
937
|
+
className: `sb-rounded-md sb-bg-[#303030] sb-bg-opacity-50 ${(width > 400 || (player == null ? void 0 : player.isFullscreen_) === true) && !isTrailer ? "sb-w-[150px] sb-py-5" : "sb-w-[90px] sb-items-center sb-justify-center sb-py-1"}`,
|
932
938
|
children: /* @__PURE__ */ jsxs9("div", { className: "sb-flex sb-flex-col sb-gap-3", children: [
|
933
939
|
/* @__PURE__ */ jsxs9(
|
934
940
|
"div",
|
@@ -965,10 +971,14 @@ var QualityMenu = ({ width, onClick, isTrailer }) => {
|
|
965
971
|
(_q) => (q == null ? void 0 : q.label) == (_q == null ? void 0 : _q.label)
|
966
972
|
);
|
967
973
|
if (source && source.src != currentQualitySrc) {
|
974
|
+
player == null ? void 0 : player.src(source.src);
|
968
975
|
const currentTime = player == null ? void 0 : player.currentTime();
|
969
976
|
setCurrentQualitySrc(source == null ? void 0 : source.label);
|
977
|
+
player == null ? void 0 : player.currentTime(currentTime);
|
978
|
+
player == null ? void 0 : player.play();
|
970
979
|
}
|
971
980
|
closeMenuFunction && closeMenuFunction();
|
981
|
+
setIsModalChanged(false);
|
972
982
|
}
|
973
983
|
},
|
974
984
|
`quality-${q == null ? void 0 : q.label}-${i}`
|
@@ -1413,12 +1423,12 @@ var SubtitleMenu = ({
|
|
1413
1423
|
onClick: (e, isOpen) => {
|
1414
1424
|
onClick && onClick(e, isOpen);
|
1415
1425
|
},
|
1416
|
-
classContainer: `${width < 400 || isTrailer ? "!sb-top-8 -sb-left-9" : ""}`,
|
1426
|
+
classContainer: `${width < 400 && (player == null ? void 0 : player.isFullscreen_) === false || isTrailer ? "!sb-top-8 -sb-left-9" : ""}`,
|
1417
1427
|
buttonContent: /* @__PURE__ */ jsx37(SubIcon_default, { className: "sb-w-4 sb-h-4 sb-text-white " }),
|
1418
1428
|
menuContent: /* @__PURE__ */ jsx37(
|
1419
1429
|
"div",
|
1420
1430
|
{
|
1421
|
-
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"}`,
|
1431
|
+
className: `sb-rounded-md sb-bg-[#303030] sb-bg-opacity-50 ${(width > 400 || (player == null ? void 0 : player.isFullscreen_) === true) && !isTrailer ? "sb-w-[150px] sb-py-5" : "sb-w-[90px] sb-items-center sb-justify-center sb-py-1"}`,
|
1422
1432
|
children: /* @__PURE__ */ jsxs15("div", { className: "sb-flex sb-flex-col sb-gap-3", children: [
|
1423
1433
|
/* @__PURE__ */ jsxs15("div", { className: "sb-px-5 sb-flex sb-flex-row sb-gap-3 sb-items-center sb-justify-center", children: [
|
1424
1434
|
/* @__PURE__ */ jsx37(
|
@@ -1461,17 +1471,22 @@ var SubtitleMenu = ({
|
|
1461
1471
|
var SubtitleMenu_default = SubtitleMenu;
|
1462
1472
|
|
1463
1473
|
// src/components/Tooltip/GlobalTooltip.tsx
|
1464
|
-
import { useState as useState12 } from "react";
|
1474
|
+
import { useEffect as useEffect13, useState as useState12 } from "react";
|
1465
1475
|
import { jsx as jsx38, jsxs as jsxs16 } from "react/jsx-runtime";
|
1466
1476
|
var TooltipModal = ({
|
1467
1477
|
content,
|
1468
1478
|
children,
|
1469
1479
|
isLeft = false,
|
1470
|
-
width = 0
|
1480
|
+
width = 0,
|
1481
|
+
isModalChanged,
|
1482
|
+
player
|
1471
1483
|
}) => {
|
1472
1484
|
const [isOpen, setIsOpen] = useState12(false);
|
1473
1485
|
const showTooltip = () => setIsOpen(true);
|
1474
1486
|
const hideTooltip = () => setIsOpen(false);
|
1487
|
+
useEffect13(() => {
|
1488
|
+
hideTooltip();
|
1489
|
+
}, [isModalChanged]);
|
1475
1490
|
return /* @__PURE__ */ jsxs16(
|
1476
1491
|
"div",
|
1477
1492
|
{
|
@@ -1490,7 +1505,7 @@ var TooltipModal = ({
|
|
1490
1505
|
isOpen && /* @__PURE__ */ jsx38(
|
1491
1506
|
"div",
|
1492
1507
|
{
|
1493
|
-
className: `sb-tooltip-modal sb-text-orange-900 sb-my-2 ${width > 400 ? "!sb-bottom-[105%]" : "!sb-top-[105%]"}`,
|
1508
|
+
className: `sb-tooltip-modal sb-text-orange-900 sb-my-2 ${width > 400 || (player == null ? void 0 : player.isFullscreen_) === true ? "!sb-bottom-[105%]" : "!sb-top-[105%]"}`,
|
1494
1509
|
style: {
|
1495
1510
|
position: "absolute",
|
1496
1511
|
left: !isLeft ? "-100%" : "100%",
|
@@ -1534,6 +1549,7 @@ var ControlBar = ({
|
|
1534
1549
|
const { setPlayer, setDuration } = useSoftBuildersVideoPlayerContext();
|
1535
1550
|
const [width, setWidth] = useState13(0);
|
1536
1551
|
const [isSeeking, setIsSeeking] = useState13(true);
|
1552
|
+
const [isModalChanged, setIsModalChanged] = useState13(false);
|
1537
1553
|
const seek = (duration2) => {
|
1538
1554
|
const currentTime = Number((player == null ? void 0 : player.currentTime()) || 0);
|
1539
1555
|
player == null ? void 0 : player.currentTime(currentTime + duration2);
|
@@ -1557,28 +1573,31 @@ var ControlBar = ({
|
|
1557
1573
|
else player == null ? void 0 : player.pause();
|
1558
1574
|
setIsPaused(!isPaused);
|
1559
1575
|
};
|
1560
|
-
|
1576
|
+
useEffect14(() => {
|
1561
1577
|
setPlayer(player);
|
1562
1578
|
}, [player]);
|
1563
|
-
|
1579
|
+
useEffect14(() => {
|
1564
1580
|
setDuration(duration);
|
1565
1581
|
}, [duration]);
|
1566
1582
|
return /* @__PURE__ */ jsxs17(
|
1567
1583
|
"div",
|
1568
1584
|
{
|
1569
|
-
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`,
|
1585
|
+
className: ` !sb-px-4 sb-flex sb-pt-2 sb-justify-center sb-gap-3 sb-w-full sb-h-full ${(width > 400 || (player == null ? void 0 : player.isFullscreen_) === true) && !isTrailer ? "sb-absolute sb-bottom-1 sb-items-end sb-mb-1 sb-pb-2 " : "sb-items-start"} sb-pb-2`,
|
1570
1586
|
children: [
|
1571
1587
|
/* @__PURE__ */ jsx39(BufferTracker_default, {}),
|
1572
1588
|
/* @__PURE__ */ jsx39(CurrentTimeTracker_default, {}),
|
1573
1589
|
!isTrailer && /* @__PURE__ */ jsx39(
|
1574
1590
|
"button",
|
1575
1591
|
{
|
1576
|
-
onClick: () => {
|
1592
|
+
onClick: (e) => {
|
1593
|
+
e.preventDefault();
|
1594
|
+
e.stopPropagation();
|
1577
1595
|
seek(-seekStep);
|
1578
1596
|
},
|
1579
1597
|
children: /* @__PURE__ */ jsx39(
|
1580
1598
|
GlobalTooltip_default,
|
1581
1599
|
{
|
1600
|
+
player,
|
1582
1601
|
width,
|
1583
1602
|
content: /* @__PURE__ */ jsx39("p", { children: "Backward 5 sec" }),
|
1584
1603
|
isLeft: true,
|
@@ -1590,6 +1609,7 @@ var ControlBar = ({
|
|
1590
1609
|
/* @__PURE__ */ jsx39("button", { onClick: togglePlay, children: /* @__PURE__ */ jsx39(
|
1591
1610
|
GlobalTooltip_default,
|
1592
1611
|
{
|
1612
|
+
player,
|
1593
1613
|
width,
|
1594
1614
|
content: /* @__PURE__ */ jsx39("p", { children: isPaused ? "Play" : "pause" }),
|
1595
1615
|
isLeft: true,
|
@@ -1601,11 +1621,13 @@ var ControlBar = ({
|
|
1601
1621
|
{
|
1602
1622
|
onClick: (e) => {
|
1603
1623
|
e.preventDefault();
|
1624
|
+
e.stopPropagation();
|
1604
1625
|
seek(seekStep);
|
1605
1626
|
},
|
1606
1627
|
children: /* @__PURE__ */ jsx39(
|
1607
1628
|
GlobalTooltip_default,
|
1608
1629
|
{
|
1630
|
+
player,
|
1609
1631
|
width,
|
1610
1632
|
content: /* @__PURE__ */ jsx39("p", { children: "Forward 5 sec" }),
|
1611
1633
|
isLeft: true,
|
@@ -1619,16 +1641,16 @@ var ControlBar = ({
|
|
1619
1641
|
/* @__PURE__ */ jsx39(
|
1620
1642
|
"div",
|
1621
1643
|
{
|
1622
|
-
className: `${width < 400 && !isTrailer ? "sb-flex-1 sb-ml-0 sb-mr-0" : "sb-w-full"}`,
|
1644
|
+
className: `${width < 400 && !isTrailer && (player == null ? void 0 : player.isFullscreen_) === false ? "sb-flex-1 sb-ml-0 sb-mr-0" : "sb-w-full"}`,
|
1623
1645
|
children: /* @__PURE__ */ jsxs17(
|
1624
1646
|
"div",
|
1625
1647
|
{
|
1626
|
-
style: width < 400 && !isTrailer ? {
|
1648
|
+
style: width < 400 && !isTrailer && (player == null ? void 0 : player.isFullscreen_) === false ? {
|
1627
1649
|
width: `${width * 0.9}px`,
|
1628
1650
|
left: "5%",
|
1629
1651
|
top: "90%"
|
1630
1652
|
} : { width: "98%" },
|
1631
|
-
className: `flex gap-2 ${width < 400 && !isTrailer ? "absolute sb-top-1" : "-sb-translate-y-0 sb-w-full"} hover:sb-w-[45%] `,
|
1653
|
+
className: `flex gap-2 ${width < 400 && !isTrailer && (player == null ? void 0 : player.isFullscreen_) === false ? "absolute sb-top-1" : "-sb-translate-y-0 sb-w-full"} hover:sb-w-[45%] `,
|
1632
1654
|
children: [
|
1633
1655
|
/* @__PURE__ */ jsx39(CurrentTimeLabel_default, {}),
|
1634
1656
|
/* @__PURE__ */ jsx39(TimeSliderContainer_default, { chapters, notes }),
|
@@ -1649,33 +1671,52 @@ var ControlBar = ({
|
|
1649
1671
|
handleControlDisplayTimer
|
1650
1672
|
}
|
1651
1673
|
) }),
|
1652
|
-
/* @__PURE__ */ jsx39(
|
1653
|
-
|
1674
|
+
/* @__PURE__ */ jsx39(
|
1675
|
+
GlobalTooltip_default,
|
1654
1676
|
{
|
1655
|
-
|
1677
|
+
player,
|
1678
|
+
isModalChanged,
|
1656
1679
|
width,
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1680
|
+
content: /* @__PURE__ */ jsx39("p", { children: "Quality" }),
|
1681
|
+
children: /* @__PURE__ */ jsx39(
|
1682
|
+
QualityMenu_default,
|
1683
|
+
{
|
1684
|
+
isTrailer,
|
1685
|
+
width,
|
1686
|
+
setIsModalChanged: (val) => setIsModalChanged(val),
|
1687
|
+
onClick: (e, isOpen) => {
|
1688
|
+
setVolumeToggler(!volumeSliderToggler);
|
1689
|
+
setIsQualityMenuOpen && setIsQualityMenuOpen(isOpen);
|
1690
|
+
setIsModalChanged(true);
|
1691
|
+
}
|
1692
|
+
}
|
1693
|
+
)
|
1661
1694
|
}
|
1662
|
-
)
|
1663
|
-
disableNote && /* @__PURE__ */ jsx39(
|
1664
|
-
|
1695
|
+
),
|
1696
|
+
disableNote && /* @__PURE__ */ jsx39(
|
1697
|
+
GlobalTooltip_default,
|
1665
1698
|
{
|
1666
|
-
|
1699
|
+
player,
|
1667
1700
|
width,
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1701
|
+
content: /* @__PURE__ */ jsx39("p", { children: "Create note" }),
|
1702
|
+
children: /* @__PURE__ */ jsx39(
|
1703
|
+
CreateNoteMenu_default,
|
1704
|
+
{
|
1705
|
+
handleSaveNoteAction,
|
1706
|
+
width,
|
1707
|
+
setNoteOpen,
|
1708
|
+
noteButtonClick: (e) => {
|
1709
|
+
noteButtonClick && noteButtonClick({
|
1710
|
+
time: Number((player == null ? void 0 : player.currentTime()) || 0),
|
1711
|
+
isOpen: e
|
1712
|
+
});
|
1713
|
+
player == null ? void 0 : player.pause();
|
1714
|
+
}
|
1715
|
+
}
|
1716
|
+
)
|
1676
1717
|
}
|
1677
|
-
)
|
1678
|
-
/* @__PURE__ */ jsx39(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx39("p", { children: "Subtitle" }), children: /* @__PURE__ */ jsx39(
|
1718
|
+
),
|
1719
|
+
/* @__PURE__ */ jsx39(GlobalTooltip_default, { player, width, content: /* @__PURE__ */ jsx39("p", { children: "Subtitle" }), children: /* @__PURE__ */ jsx39(
|
1679
1720
|
SubtitleMenu_default,
|
1680
1721
|
{
|
1681
1722
|
isTrailer,
|
@@ -1686,7 +1727,7 @@ var ControlBar = ({
|
|
1686
1727
|
}
|
1687
1728
|
}
|
1688
1729
|
) }),
|
1689
|
-
/* @__PURE__ */ jsx39(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx39("p", { children: "Full screen" }), children: /* @__PURE__ */ jsx39(
|
1730
|
+
/* @__PURE__ */ jsx39(GlobalTooltip_default, { player, width, content: /* @__PURE__ */ jsx39("p", { children: "Full screen" }), children: /* @__PURE__ */ jsx39(
|
1690
1731
|
"button",
|
1691
1732
|
{
|
1692
1733
|
onClick: (e) => {
|
@@ -1832,6 +1873,7 @@ var VideoPlayerComponent = forwardRef(
|
|
1832
1873
|
isTrailer,
|
1833
1874
|
height
|
1834
1875
|
}, ref) => {
|
1876
|
+
var _a;
|
1835
1877
|
const videoRef = useRef2(void 0);
|
1836
1878
|
const playerRef = useRef2(void 0);
|
1837
1879
|
const idRef = useRef2(void 0);
|
@@ -1864,7 +1906,7 @@ var VideoPlayerComponent = forwardRef(
|
|
1864
1906
|
});
|
1865
1907
|
}
|
1866
1908
|
};
|
1867
|
-
|
1909
|
+
useEffect15(() => {
|
1868
1910
|
if (!playerRef.current) {
|
1869
1911
|
const videoElement = document.createElement("video-js");
|
1870
1912
|
videoElement.setAttribute("playsinline", "true");
|
@@ -1898,7 +1940,7 @@ var VideoPlayerComponent = forwardRef(
|
|
1898
1940
|
}
|
1899
1941
|
};
|
1900
1942
|
}, [id]);
|
1901
|
-
|
1943
|
+
useEffect15(() => {
|
1902
1944
|
if (!playerRef.current) {
|
1903
1945
|
const videoElement = document.createElement("video-js");
|
1904
1946
|
videoElement.setAttribute("playsinline", "true");
|
@@ -1915,9 +1957,9 @@ var VideoPlayerComponent = forwardRef(
|
|
1915
1957
|
});
|
1916
1958
|
}
|
1917
1959
|
return () => {
|
1918
|
-
var
|
1960
|
+
var _a2, _b;
|
1919
1961
|
if (playerRef.current) {
|
1920
|
-
if (!isEqual((_b = (
|
1962
|
+
if (!isEqual((_b = (_a2 = idRef == null ? void 0 : idRef.current) == null ? void 0 : _a2.sources) != null ? _b : "", options.sources)) {
|
1921
1963
|
idRef.current = options;
|
1922
1964
|
playerRef.current.dispose();
|
1923
1965
|
playerRef.current = void 0;
|
@@ -1935,12 +1977,12 @@ var VideoPlayerComponent = forwardRef(
|
|
1935
1977
|
}
|
1936
1978
|
};
|
1937
1979
|
}, [options]);
|
1938
|
-
|
1980
|
+
useEffect15(() => {
|
1939
1981
|
if (playerRef.current) {
|
1940
1982
|
playerRef.current.currentTime(startTime);
|
1941
1983
|
}
|
1942
1984
|
}, [startTime]);
|
1943
|
-
|
1985
|
+
useEffect15(() => {
|
1944
1986
|
if (playerRef.current && isReady) {
|
1945
1987
|
const currentTime = playerRef.current.currentTime() || 0;
|
1946
1988
|
if (isPaused) {
|
@@ -1950,7 +1992,7 @@ var VideoPlayerComponent = forwardRef(
|
|
1950
1992
|
}
|
1951
1993
|
}
|
1952
1994
|
}, [isPaused]);
|
1953
|
-
|
1995
|
+
useEffect15(() => {
|
1954
1996
|
const controlBarTimeout = setTimeout(() => {
|
1955
1997
|
renderControlBar(
|
1956
1998
|
id,
|
@@ -1984,9 +2026,10 @@ var VideoPlayerComponent = forwardRef(
|
|
1984
2026
|
duration,
|
1985
2027
|
opacity,
|
1986
2028
|
isReady,
|
1987
|
-
id
|
2029
|
+
id,
|
2030
|
+
(_a = playerRef == null ? void 0 : playerRef.current) == null ? void 0 : _a.isFullscreen_
|
1988
2031
|
]);
|
1989
|
-
|
2032
|
+
useEffect15(() => {
|
1990
2033
|
if (isReady) {
|
1991
2034
|
const playButtonTimeout = setTimeout(() => {
|
1992
2035
|
renderBigPlayButton(
|
@@ -2003,7 +2046,7 @@ var VideoPlayerComponent = forwardRef(
|
|
2003
2046
|
return () => clearTimeout(playButtonTimeout);
|
2004
2047
|
}
|
2005
2048
|
}, [isPaused, opacity, isReady, id, height, heightValue, isLoading]);
|
2006
|
-
|
2049
|
+
useEffect15(() => {
|
2007
2050
|
if (playerRef.current) {
|
2008
2051
|
const intervalId = setInterval(() => {
|
2009
2052
|
if (playerRef.current) setIsPaused(playerRef.current.paused());
|
@@ -2012,7 +2055,7 @@ var VideoPlayerComponent = forwardRef(
|
|
2012
2055
|
}
|
2013
2056
|
}, []);
|
2014
2057
|
const timeoutRef = useRef2(null);
|
2015
|
-
|
2058
|
+
useEffect15(() => {
|
2016
2059
|
if (isQualityMenuOpen || isSubtitleMenuOpen) {
|
2017
2060
|
if (timeoutRef.current) {
|
2018
2061
|
clearTimeout(timeoutRef.current);
|
@@ -2028,7 +2071,7 @@ var VideoPlayerComponent = forwardRef(
|
|
2028
2071
|
}, 3e3);
|
2029
2072
|
}
|
2030
2073
|
}, [isQualityMenuOpen, isSubtitleMenuOpen]);
|
2031
|
-
|
2074
|
+
useEffect15(() => {
|
2032
2075
|
if (isNoteOpen) {
|
2033
2076
|
if (timeoutRef.current) {
|
2034
2077
|
clearTimeout(timeoutRef.current);
|
@@ -2076,13 +2119,13 @@ var VideoPlayerComponent = forwardRef(
|
|
2076
2119
|
}
|
2077
2120
|
};
|
2078
2121
|
const videoRefs = useRef2(null);
|
2079
|
-
|
2122
|
+
useEffect15(() => {
|
2080
2123
|
const observer = new IntersectionObserver(
|
2081
2124
|
(entries) => {
|
2082
2125
|
entries.forEach((entry) => {
|
2083
|
-
var
|
2126
|
+
var _a2, _b;
|
2084
2127
|
if (entry.isIntersecting === false) {
|
2085
|
-
if (((
|
2128
|
+
if (((_a2 = playerRef == null ? void 0 : playerRef.current) == null ? void 0 : _a2.paused()) === false) {
|
2086
2129
|
try {
|
2087
2130
|
(_b = playerRef == null ? void 0 : playerRef.current) == null ? void 0 : _b.pause();
|
2088
2131
|
setIsPaused(true);
|
@@ -2108,7 +2151,7 @@ var VideoPlayerComponent = forwardRef(
|
|
2108
2151
|
};
|
2109
2152
|
}, []);
|
2110
2153
|
const [timeSeeker, setTimeSeeker] = useState14("0");
|
2111
|
-
|
2154
|
+
useEffect15(() => {
|
2112
2155
|
const updateTimeSeeker = () => {
|
2113
2156
|
if (playerRef.current && isReady) {
|
2114
2157
|
const currentTime = playerRef.current.currentTime();
|
@@ -2255,9 +2298,9 @@ var Component = forwardRef2(
|
|
2255
2298
|
if (options.height === void 0) options.height = DEFAULT_OPTIONS.height;
|
2256
2299
|
if (options.width === void 0) options.width = DEFAULT_OPTIONS.width;
|
2257
2300
|
const [tracks, setTracks] = useState15([]);
|
2258
|
-
|
2301
|
+
useEffect16(() => {
|
2259
2302
|
}, [isFocused]);
|
2260
|
-
|
2303
|
+
useEffect16(() => {
|
2261
2304
|
const getTracks = async () => {
|
2262
2305
|
const newTracks = [];
|
2263
2306
|
if (Array.isArray(options == null ? void 0 : options.tracks))
|
@@ -2276,7 +2319,7 @@ var Component = forwardRef2(
|
|
2276
2319
|
}, [options == null ? void 0 : options.tracks]);
|
2277
2320
|
const id = (Date.now() + Math.random() * 100).toString();
|
2278
2321
|
const [uuid, setUuid] = useState15("");
|
2279
|
-
|
2322
|
+
useEffect16(() => {
|
2280
2323
|
setUuid(uuidv4());
|
2281
2324
|
}, []);
|
2282
2325
|
return /* @__PURE__ */ jsx42(
|