softbuilders-react-video-player 1.1.70 → 1.1.72
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/ControlBar/index.js +25 -37
- package/dist/components/ControlBar/index.js.map +1 -1
- package/dist/components/ControlBar/index.tsx +75 -78
- package/dist/components/QualityMenu/index.js +12 -12
- package/dist/components/QualityMenu/index.js.map +1 -1
- package/dist/components/QualityMenu/index.tsx +19 -21
- package/dist/components/SoftBuildersVideoPlayer/index.js +1 -1
- package/dist/components/SoftBuildersVideoPlayer/index.js.map +1 -1
- package/dist/components/SoftBuildersVideoPlayer/index.tsx +17 -14
- package/dist/components/Tooltip/GlobalTooltip.d.ts +2 -0
- package/dist/components/Tooltip/GlobalTooltip.js +20 -0
- package/dist/components/Tooltip/GlobalTooltip.js.map +1 -0
- package/dist/components/Tooltip/GlobalTooltip.tsx +53 -0
- package/dist/components/Tooltip/index.d.ts +4 -3
- package/dist/components/Tooltip/index.js +5 -10
- package/dist/components/Tooltip/index.js.map +1 -1
- package/dist/components/Tooltip/index.tsx +7 -19
- package/dist/components/VideoPlayerComponent/index.js +1 -1
- package/dist/components/VideoPlayerComponent/index.js.map +1 -1
- package/dist/components/VideoPlayerComponent/index.tsx +18 -15
- package/dist/components/VolumeSlider/index.js +25 -6
- package/dist/components/VolumeSlider/index.js.map +1 -1
- package/dist/components/VolumeSlider/index.tsx +45 -17
- package/dist/index.css +18 -69
- package/dist/index.mjs +163 -103
- package/dist/styles/tailwind.css +18 -66
- package/package.json +1 -1
@@ -11,6 +11,7 @@ import CurrentTimeTracker from "../CurrentTimeTracker";
|
|
11
11
|
import { useSoftBuildersVideoPlayerContext } from "../VideoPlayerComponent/provider";
|
12
12
|
import SubtitleMenu from "../SubtitleMenu";
|
13
13
|
import { BackwardIcon, ForwardIcon, FullScreenIcon, PauseIcon, PlayIcon, } from "../../images";
|
14
|
+
import TooltipModal from "../Tooltip/GlobalTooltip";
|
14
15
|
const ControlBar = ({ player, isPaused, setIsPaused, duration, notes, chapters, seekStep = 5, id, handleSaveNoteAction, handleControlDisplayTimer, setIsQualityMenuOpen, setIsSubtitleMenuOpen, setNoteOpen, disableNote, noteButtonClick, }) => {
|
15
16
|
const { setPlayer, setDuration } = useSoftBuildersVideoPlayerContext();
|
16
17
|
const [width, setWidth] = useState(0);
|
@@ -21,16 +22,6 @@ const ControlBar = ({ player, isPaused, setIsPaused, duration, notes, chapters,
|
|
21
22
|
};
|
22
23
|
const [volumeSliderToggler, setVolumeToggler] = useState(false);
|
23
24
|
const container = document.getElementById(`video-container-${id}`);
|
24
|
-
const [isToolTip, setIsToolTip] = useState({
|
25
|
-
sub: false,
|
26
|
-
seekForward: false,
|
27
|
-
seekBackward: false,
|
28
|
-
play: false,
|
29
|
-
pause: false,
|
30
|
-
volume: false,
|
31
|
-
quality: false,
|
32
|
-
fullScreen: false,
|
33
|
-
});
|
34
25
|
function handleWidthChange(width) {
|
35
26
|
setWidth(width);
|
36
27
|
}
|
@@ -61,10 +52,10 @@ const ControlBar = ({ player, isPaused, setIsPaused, duration, notes, chapters,
|
|
61
52
|
? "sb-absolute sb-bottom-1 sb-items-end sb-mb-1 sb-pb-2 "
|
62
53
|
: "sb-items-start"} sb-pb-2`, children: [_jsx(BufferTracker, {}), _jsx(CurrentTimeTracker, {}), _jsx("button", { onClick: () => {
|
63
54
|
seek(-seekStep);
|
64
|
-
}, children: _jsx(BackwardIcon, { className: "sb-w-3 sb-h-3" }) }), _jsx("button", { onClick: togglePlay, children: isPaused ? (_jsx(PlayIcon, { className: "sb-w-3 sb-h-3" })) : (_jsx(PauseIcon, { className: "sb-w-3 sb-h-3" })) }), _jsx("button", { onClick: (e) => {
|
55
|
+
}, children: _jsx(TooltipModal, { width: width, content: _jsx("p", { children: "Backward 5 sec" }), isLeft: true, children: _jsx(BackwardIcon, { className: "sb-w-3 sb-h-3" }) }) }), _jsx("button", { onClick: togglePlay, children: _jsx(TooltipModal, { width: width, content: _jsx("p", { children: isPaused ? "Play" : "pause" }), isLeft: true, children: isPaused ? (_jsx(PlayIcon, { className: "sb-w-3 sb-h-3" })) : (_jsx(PauseIcon, { className: "sb-w-3 sb-h-3" })) }) }), _jsx("button", { onClick: (e) => {
|
65
56
|
e.preventDefault();
|
66
57
|
seek(seekStep);
|
67
|
-
}, children: _jsx(ForwardIcon, { className: "sb-w-3 sb-h-3" }) }),
|
58
|
+
}, children: _jsx(TooltipModal, { width: width, content: _jsx("p", { children: "Forward 5 sec" }), isLeft: true, children: _jsx(ForwardIcon, { className: "sb-w-3 sb-h-3" }) }) }),
|
68
59
|
// isSeeking ||
|
69
60
|
// width > 400 &&
|
70
61
|
_jsx("div", { className: `${width < 400 ? "sb-flex-1 sb-ml-0 sb-mr-0" : "sb-w-full"}`, children: _jsxs("div", { style: width < 400
|
@@ -73,31 +64,28 @@ const ControlBar = ({ player, isPaused, setIsPaused, duration, notes, chapters,
|
|
73
64
|
left: "5%",
|
74
65
|
top: "90%",
|
75
66
|
}
|
76
|
-
: { width: "98%" }, className: `flex gap-2 ${width < 400 ? "absolute sb-top-1" : "-sb-translate-y-0 sb-w-full"} hover:sb-w-[45%] `, children: [_jsx(CurrentTimeLabel, {}), _jsx(TimeSliderContainer, { chapters: chapters, notes: notes }), _jsx("p", { children: durationFormater(duration) })] }) }), _jsx("div", { className: "sb-h-full", children: _jsx(VolumeSlider, { volumeSliderToggler: volumeSliderToggler, width: width, setIsSeeking: (val) => setIsSeeking(val), handleControlDisplayTimer: handleControlDisplayTimer }) }), _jsx(QualityMenu, { width: width, onClick: (e, isOpen) => {
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
player === null || player === void 0 ? void 0 : player.requestFullscreen();
|
99
|
-
}
|
100
|
-
}, children: _jsx(FullScreenIcon, { className: "sb-w-3 sb-h-3" }) })] }));
|
67
|
+
: { width: "98%" }, className: `flex gap-2 ${width < 400 ? "absolute sb-top-1" : "-sb-translate-y-0 sb-w-full"} hover:sb-w-[45%] `, children: [_jsx(CurrentTimeLabel, {}), _jsx(TimeSliderContainer, { chapters: chapters, notes: notes }), _jsx("p", { children: durationFormater(duration) })] }) }), _jsx("div", { className: "sb-h-full", children: _jsx(VolumeSlider, { volumeSliderToggler: volumeSliderToggler, width: width, setIsSeeking: (val) => setIsSeeking(val), handleControlDisplayTimer: handleControlDisplayTimer }) }), _jsx(TooltipModal, { width: width, content: _jsx("p", { children: "Quality" }), children: _jsx(QualityMenu, { width: width, onClick: (e, isOpen) => {
|
68
|
+
setVolumeToggler(!volumeSliderToggler);
|
69
|
+
setIsQualityMenuOpen && setIsQualityMenuOpen(isOpen);
|
70
|
+
} }) }), disableNote && (_jsx(TooltipModal, { width: width, content: _jsx("p", { children: "Create note" }), children: _jsx(CreateNoteMenu, { handleSaveNoteAction: handleSaveNoteAction, width: width, setNoteOpen: setNoteOpen, noteButtonClick: (e) => {
|
71
|
+
noteButtonClick &&
|
72
|
+
noteButtonClick({
|
73
|
+
time: Number((player === null || player === void 0 ? void 0 : player.currentTime()) || 0),
|
74
|
+
isOpen: e,
|
75
|
+
});
|
76
|
+
} }) })), _jsx(TooltipModal, { width: width, content: _jsx("p", { children: "Subtitle" }), children: _jsx(SubtitleMenu, { width: width, onClick: (e, isOpen) => {
|
77
|
+
setVolumeToggler(!volumeSliderToggler);
|
78
|
+
setIsSubtitleMenuOpen && setIsSubtitleMenuOpen(isOpen);
|
79
|
+
} }) }), _jsx(TooltipModal, { width: width, content: _jsx("p", { children: "Full screen" }), children: _jsx("button", { onClick: (e) => {
|
80
|
+
e.preventDefault();
|
81
|
+
e.stopPropagation();
|
82
|
+
if (player === null || player === void 0 ? void 0 : player.isFullscreen()) {
|
83
|
+
player === null || player === void 0 ? void 0 : player.exitFullscreen();
|
84
|
+
}
|
85
|
+
else {
|
86
|
+
player === null || player === void 0 ? void 0 : player.requestFullscreen();
|
87
|
+
}
|
88
|
+
}, children: _jsx(FullScreenIcon, { className: "sb-w-3 sb-h-3" }) }) })] }));
|
101
89
|
};
|
102
90
|
export default ControlBar;
|
103
91
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ControlBar/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AACzD,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AAKvD,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AACrF,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,YAAY,EACZ,WAAW,EACX,cAAc,EACd,SAAS,EACT,QAAQ,GACT,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ControlBar/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,mBAAmB,MAAM,wBA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,MAAe,EAAE,EAAE;wBACnC,gBAAgB,CAAC,CAAC,mBAAmB,CAAC,CAAC;wBACvC,qBAAqB,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC;oBACzD,CAAC,GACD,GACW,EACf,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,sCAAkB,YACrD,iBACE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;wBACb,CAAC,CAAC,cAAc,EAAE,CAAC;wBACnB,CAAC,CAAC,eAAe,EAAE,CAAC;wBAEpB,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,EAAE,EAAE,CAAC;4BAC3B,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,cAAc,EAAE,CAAC;wBAC3B,CAAC;6BAAM,CAAC;4BACN,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,iBAAiB,EAAE,CAAC;wBAC9B,CAAC;oBACH,CAAC,YAED,KAAC,cAAc,IAAC,SAAS,EAAC,eAAe,GAAG,GACrC,GACI,IACX,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
@@ -21,7 +21,7 @@ import {
|
|
21
21
|
PauseIcon,
|
22
22
|
PlayIcon,
|
23
23
|
} from "../../images";
|
24
|
-
import
|
24
|
+
import TooltipModal from "../Tooltip/GlobalTooltip";
|
25
25
|
|
26
26
|
type Props<T> = {
|
27
27
|
player: Player | undefined;
|
@@ -40,16 +40,6 @@ type Props<T> = {
|
|
40
40
|
setNoteOpen?: (val: boolean) => void;
|
41
41
|
noteButtonClick?: (e: any) => void;
|
42
42
|
};
|
43
|
-
type TTool = {
|
44
|
-
sub: boolean;
|
45
|
-
seekForward: boolean;
|
46
|
-
seekBackward: boolean;
|
47
|
-
play: boolean;
|
48
|
-
pause: boolean;
|
49
|
-
volume: boolean;
|
50
|
-
quality: boolean;
|
51
|
-
fullScreen: boolean;
|
52
|
-
};
|
53
43
|
|
54
44
|
const ControlBar = <T,>({
|
55
45
|
player,
|
@@ -77,16 +67,7 @@ const ControlBar = <T,>({
|
|
77
67
|
};
|
78
68
|
const [volumeSliderToggler, setVolumeToggler] = useState(false);
|
79
69
|
const container = document.getElementById(`video-container-${id}`);
|
80
|
-
|
81
|
-
sub: false,
|
82
|
-
seekForward: false,
|
83
|
-
seekBackward: false,
|
84
|
-
play: false,
|
85
|
-
pause: false,
|
86
|
-
volume: false,
|
87
|
-
quality: false,
|
88
|
-
fullScreen: false,
|
89
|
-
});
|
70
|
+
|
90
71
|
function handleWidthChange(width: any) {
|
91
72
|
setWidth(width);
|
92
73
|
}
|
@@ -137,22 +118,42 @@ const ControlBar = <T,>({
|
|
137
118
|
seek(-seekStep);
|
138
119
|
}}
|
139
120
|
>
|
140
|
-
<
|
121
|
+
<TooltipModal
|
122
|
+
width={width}
|
123
|
+
content={<p>Backward 5 sec</p>}
|
124
|
+
isLeft={true}
|
125
|
+
>
|
126
|
+
<BackwardIcon className="sb-w-3 sb-h-3" />
|
127
|
+
</TooltipModal>
|
141
128
|
</button>
|
129
|
+
|
142
130
|
<button onClick={togglePlay}>
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
131
|
+
<TooltipModal
|
132
|
+
width={width}
|
133
|
+
content={<p>{isPaused ? "Play" : "pause"}</p>}
|
134
|
+
isLeft={true}
|
135
|
+
>
|
136
|
+
{isPaused ? (
|
137
|
+
<PlayIcon className="sb-w-3 sb-h-3" />
|
138
|
+
) : (
|
139
|
+
<PauseIcon className="sb-w-3 sb-h-3" />
|
140
|
+
)}
|
141
|
+
</TooltipModal>
|
148
142
|
</button>
|
143
|
+
|
149
144
|
<button
|
150
145
|
onClick={(e) => {
|
151
146
|
e.preventDefault();
|
152
147
|
seek(seekStep);
|
153
148
|
}}
|
154
149
|
>
|
155
|
-
<
|
150
|
+
<TooltipModal
|
151
|
+
width={width}
|
152
|
+
content={<p>Forward 5 sec</p>}
|
153
|
+
isLeft={true}
|
154
|
+
>
|
155
|
+
<ForwardIcon className="sb-w-3 sb-h-3" />
|
156
|
+
</TooltipModal>
|
156
157
|
</button>
|
157
158
|
|
158
159
|
{
|
@@ -194,62 +195,58 @@ const ControlBar = <T,>({
|
|
194
195
|
handleControlDisplayTimer={handleControlDisplayTimer}
|
195
196
|
/>
|
196
197
|
</div>
|
198
|
+
<TooltipModal width={width} content={<p>Quality</p>}>
|
199
|
+
<QualityMenu
|
200
|
+
width={width}
|
201
|
+
onClick={(e: any, isOpen: boolean) => {
|
202
|
+
setVolumeToggler(!volumeSliderToggler);
|
203
|
+
setIsQualityMenuOpen && setIsQualityMenuOpen(isOpen);
|
204
|
+
}}
|
205
|
+
/>
|
206
|
+
</TooltipModal>
|
197
207
|
|
198
|
-
<QualityMenu
|
199
|
-
width={width}
|
200
|
-
onClick={(e: any, isOpen: boolean) => {
|
201
|
-
setVolumeToggler(!volumeSliderToggler);
|
202
|
-
setIsQualityMenuOpen && setIsQualityMenuOpen(isOpen);
|
203
|
-
}}
|
204
|
-
/>
|
205
208
|
{/* handleSaveNoteAction */}
|
206
209
|
{disableNote && (
|
207
|
-
<
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
210
|
+
<TooltipModal width={width} content={<p>Create note</p>}>
|
211
|
+
<CreateNoteMenu
|
212
|
+
handleSaveNoteAction={handleSaveNoteAction}
|
213
|
+
width={width}
|
214
|
+
setNoteOpen={setNoteOpen}
|
215
|
+
noteButtonClick={(e) => {
|
216
|
+
noteButtonClick &&
|
217
|
+
noteButtonClick({
|
218
|
+
time: Number(player?.currentTime() || 0),
|
219
|
+
isOpen: e,
|
220
|
+
});
|
221
|
+
}}
|
222
|
+
/>
|
223
|
+
</TooltipModal>
|
224
|
+
)}
|
225
|
+
<TooltipModal width={width} content={<p>Subtitle</p>}>
|
226
|
+
<SubtitleMenu
|
213
227
|
width={width}
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
noteButtonClick({
|
218
|
-
time: Number(player?.currentTime() || 0),
|
219
|
-
isOpen: e,
|
220
|
-
});
|
228
|
+
onClick={(e: any, isOpen: boolean) => {
|
229
|
+
setVolumeToggler(!volumeSliderToggler);
|
230
|
+
setIsSubtitleMenuOpen && setIsSubtitleMenuOpen(isOpen);
|
221
231
|
}}
|
222
232
|
/>
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
onClick={(e) => {
|
241
|
-
e.preventDefault();
|
242
|
-
e.stopPropagation();
|
243
|
-
|
244
|
-
if (player?.isFullscreen()) {
|
245
|
-
player?.exitFullscreen();
|
246
|
-
} else {
|
247
|
-
player?.requestFullscreen();
|
248
|
-
}
|
249
|
-
}}
|
250
|
-
>
|
251
|
-
<FullScreenIcon className="sb-w-3 sb-h-3" />
|
252
|
-
</button>
|
233
|
+
</TooltipModal>
|
234
|
+
<TooltipModal width={width} content={<p>Full screen</p>}>
|
235
|
+
<button
|
236
|
+
onClick={(e) => {
|
237
|
+
e.preventDefault();
|
238
|
+
e.stopPropagation();
|
239
|
+
|
240
|
+
if (player?.isFullscreen()) {
|
241
|
+
player?.exitFullscreen();
|
242
|
+
} else {
|
243
|
+
player?.requestFullscreen();
|
244
|
+
}
|
245
|
+
}}
|
246
|
+
>
|
247
|
+
<FullScreenIcon className="sb-w-3 sb-h-3" />
|
248
|
+
</button>
|
249
|
+
</TooltipModal>
|
253
250
|
</div>
|
254
251
|
);
|
255
252
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import { useEffect, useState } from "react";
|
3
3
|
import MenuButton from "../MenuButton";
|
4
4
|
import { useSoftBuildersVideoPlayerContext } from "../VideoPlayerComponent/provider";
|
@@ -33,17 +33,17 @@ const QualityMenu = ({ width, onClick }) => {
|
|
33
33
|
if (closeMenuFunction) {
|
34
34
|
closeMenuFunction();
|
35
35
|
}
|
36
|
-
}, className: "hover:sb-scale-150", children: _jsx(LeftArrowIcon, { className: "sb-w-3 sb-h-3" }) }), _jsx("h3", { children: "Quality" })] }), _jsx("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }), _jsx("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-3 sb-items-start ", children: qualities.map((q, i) => {
|
37
|
-
return (_jsx(
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
36
|
+
}, className: "hover:sb-scale-150", children: _jsx(LeftArrowIcon, { className: "sb-w-3 sb-h-3" }) }), _jsx("h3", { children: "Quality" })] }), _jsx("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }), _jsx("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-3 sb-items-start ", children: qualities === null || qualities === void 0 ? void 0 : qualities.map((q, i) => {
|
37
|
+
return (_jsx(QualityOption, { width: width, isSelected: currentQualitySrc === q.label, quality: q, onClick: () => {
|
38
|
+
const source = qualities.find((_q) => q.label == _q.label);
|
39
|
+
if (source && source.src != currentQualitySrc) {
|
40
|
+
player === null || player === void 0 ? void 0 : player.src(source.src);
|
41
|
+
const currentTime = player === null || player === void 0 ? void 0 : player.currentTime();
|
42
|
+
setCurrentQualitySrc(source.label);
|
43
|
+
player === null || player === void 0 ? void 0 : player.currentTime(currentTime);
|
44
|
+
player === null || player === void 0 ? void 0 : player.play();
|
45
|
+
}
|
46
|
+
} }, `quality-${q.label}-${i}`));
|
47
47
|
}) })] }) }), close: (fn) => {
|
48
48
|
setCloseMenuFunction(() => fn);
|
49
49
|
} }));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src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AC,KAAK,CAC5B,CAAC;oCACF,IAAI,MAAM,IAAI,MAAM,CAAC,GAAG,IAAI,iBAAiB,EAAE,CAAC;wCAC9C,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;wCACxB,MAAM,WAAW,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,EAAE,CAAC;wCAC1C,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;wCACnC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,CAAC,WAAW,CAAC,CAAC;wCACjC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,EAAE,CAAC;oCACjB,CAAC;gCACH,CAAC,IAdI,WAAW,CAAC,CAAC,KAAK,IAAI,CAAC,EAAE,CAe9B,CACH,CAAC;wBACJ,CAAC,CAAC,GACE,IACF,GACF,EAER,KAAK,EAAE,CAAC,EAAY,EAAE,EAAE;YACtB,oBAAoB,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QACjC,CAAC,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
@@ -120,28 +120,26 @@ const QualityMenu = ({ width, onClick }: QualityMenuProps) => {
|
|
120
120
|
<div className="sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" />
|
121
121
|
|
122
122
|
<div className="sb-px-5 sb-flex sb-flex-col sb-gap-3 sb-items-start ">
|
123
|
-
{qualities
|
123
|
+
{qualities?.map((q, i) => {
|
124
124
|
return (
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
/>
|
144
|
-
</>
|
125
|
+
<QualityOption
|
126
|
+
width={width}
|
127
|
+
key={`quality-${q.label}-${i}`}
|
128
|
+
isSelected={currentQualitySrc === q.label}
|
129
|
+
quality={q}
|
130
|
+
onClick={() => {
|
131
|
+
const source = qualities.find(
|
132
|
+
(_q) => q.label == _q.label
|
133
|
+
);
|
134
|
+
if (source && source.src != currentQualitySrc) {
|
135
|
+
player?.src(source.src);
|
136
|
+
const currentTime = player?.currentTime();
|
137
|
+
setCurrentQualitySrc(source.label);
|
138
|
+
player?.currentTime(currentTime);
|
139
|
+
player?.play();
|
140
|
+
}
|
141
|
+
}}
|
142
|
+
/>
|
145
143
|
);
|
146
144
|
})}
|
147
145
|
</div>
|
@@ -12,7 +12,7 @@ const DEFAULT_OPTIONS = {
|
|
12
12
|
sources: [],
|
13
13
|
tracks: [],
|
14
14
|
};
|
15
|
-
const Component = forwardRef(({ options, notes, chapters, startTime = 0, handleSaveNoteAction, onPlay, onPause, isFocused = true, disableNote, childRef, bottomRedBar, noteButtonClick, }) => {
|
15
|
+
const Component = forwardRef(({ options, notes, chapters, startTime = 0, handleSaveNoteAction, onPlay, onPause, isFocused = true, disableNote, childRef, bottomRedBar, noteButtonClick, }, ref) => {
|
16
16
|
options = Object.assign(Object.assign({}, options), { responsive: true, inactivityTimeout: 0, fullscreen: {
|
17
17
|
navigationUI: "hide",
|
18
18
|
} });
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/SoftBuildersVideoPlayer/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAO3D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,eAAe,GAAmC;IACtD,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;IACV,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,EAAE;CACX,CAAC;AAiBF,MAAM,SAAS,GAAG,UAAU,CAC1B,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/SoftBuildersVideoPlayer/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAO3D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,eAAe,GAAmC;IACtD,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;IACV,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,EAAE;CACX,CAAC;AAiBF,MAAM,SAAS,GAAG,UAAU,CAC1B,CACE,EACE,OAAO,EACP,KAAK,EACL,QAAQ,EACR,SAAS,GAAG,CAAC,EACb,oBAAoB,EACpB,MAAM,EACN,OAAO,EACP,SAAS,GAAG,IAAI,EAChB,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,eAAe,GACJ,EACb,GAAS,EACT,EAAE;IACF,OAAO,GAAG,gCACL,OAAO,KACV,UAAU,EAAE,IAAI,EAChB,iBAAiB,EAAE,CAAC,EACpB,UAAU,EAAE;YACV,YAAY,EAAE,MAAM;SACrB,GACK,CAAC;IAET,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS;QAChC,OAAO,CAAC,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC;IAC9C,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS;QAChC,OAAO,CAAC,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC;IAC9C,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;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{
|
40
|
+
options,
|
41
|
+
notes,
|
42
|
+
chapters,
|
43
|
+
startTime = 0,
|
44
|
+
handleSaveNoteAction,
|
45
|
+
onPlay,
|
46
|
+
onPause,
|
47
|
+
isFocused = true,
|
48
|
+
disableNote,
|
49
|
+
childRef,
|
50
|
+
bottomRedBar,
|
51
|
+
noteButtonClick,
|
52
|
+
}: Props<any>,
|
53
|
+
ref?: any
|
54
|
+
) => {
|
52
55
|
options = {
|
53
56
|
...options,
|
54
57
|
responsive: true,
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { useState } from "react";
|
3
|
+
const TooltipModal = ({ content, children, isLeft = false, width = 0, }) => {
|
4
|
+
const [isOpen, setIsOpen] = useState(false);
|
5
|
+
const showTooltip = () => setIsOpen(true);
|
6
|
+
const hideTooltip = () => setIsOpen(false);
|
7
|
+
return (_jsxs("div", { className: "tooltip-container", style: { position: "relative", display: "inline-block" }, children: [_jsx("div", { onMouseEnter: showTooltip, onMouseLeave: hideTooltip, style: { cursor: "pointer" }, children: children }), isOpen && (_jsx("div", { className: `sb-tooltip-modal sb-text-orange-900 sb-my-2 ${width > 400 ? "!sb-bottom-[105%]" : "!sb-top-[105%]"}`, style: {
|
8
|
+
position: "absolute",
|
9
|
+
left: !isLeft ? "-100%" : "100%",
|
10
|
+
transform: !isLeft ? "translateX(-50%)" : "translateX(0%)",
|
11
|
+
backgroundColor: "white",
|
12
|
+
padding: "8px",
|
13
|
+
borderRadius: "4px",
|
14
|
+
whiteSpace: "nowrap",
|
15
|
+
boxShadow: "0px 0px 5px grey",
|
16
|
+
zIndex: 1000,
|
17
|
+
}, children: content }))] }));
|
18
|
+
};
|
19
|
+
export default TooltipModal;
|
20
|
+
//# sourceMappingURL=GlobalTooltip.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"GlobalTooltip.js","sourceRoot":"","sources":["../../../src/components/Tooltip/GlobalTooltip.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0 +1,53 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
|
3
|
+
const TooltipModal = ({
|
4
|
+
content,
|
5
|
+
children,
|
6
|
+
isLeft = false,
|
7
|
+
width = 0,
|
8
|
+
}: any) => {
|
9
|
+
const [isOpen, setIsOpen] = useState(false);
|
10
|
+
|
11
|
+
const showTooltip = () => setIsOpen(true);
|
12
|
+
const hideTooltip = () => setIsOpen(false);
|
13
|
+
|
14
|
+
return (
|
15
|
+
<div
|
16
|
+
className="tooltip-container"
|
17
|
+
style={{ position: "relative", display: "inline-block" }}
|
18
|
+
>
|
19
|
+
{/* Element that triggers the tooltip */}
|
20
|
+
<div
|
21
|
+
onMouseEnter={showTooltip}
|
22
|
+
onMouseLeave={hideTooltip}
|
23
|
+
style={{ cursor: "pointer" }}
|
24
|
+
>
|
25
|
+
{children}
|
26
|
+
</div>
|
27
|
+
|
28
|
+
{/* Tooltip content (modal) */}
|
29
|
+
{isOpen && (
|
30
|
+
<div
|
31
|
+
className={`sb-tooltip-modal sb-text-orange-900 sb-my-2 ${
|
32
|
+
width > 400 ? "!sb-bottom-[105%]" : "!sb-top-[105%]"
|
33
|
+
}`}
|
34
|
+
style={{
|
35
|
+
position: "absolute",
|
36
|
+
left: !isLeft ? "-100%" : "100%",
|
37
|
+
transform: !isLeft ? "translateX(-50%)" : "translateX(0%)",
|
38
|
+
backgroundColor: "white",
|
39
|
+
padding: "8px",
|
40
|
+
borderRadius: "4px",
|
41
|
+
whiteSpace: "nowrap",
|
42
|
+
boxShadow: "0px 0px 5px grey",
|
43
|
+
zIndex: 1000,
|
44
|
+
}}
|
45
|
+
>
|
46
|
+
{content}
|
47
|
+
</div>
|
48
|
+
)}
|
49
|
+
</div>
|
50
|
+
);
|
51
|
+
};
|
52
|
+
|
53
|
+
export default TooltipModal;
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import React from "react";
|
2
|
-
type
|
2
|
+
type Props = {
|
3
3
|
open: boolean;
|
4
4
|
children: React.ReactNode;
|
5
|
-
|
5
|
+
onMouseEnter?: (e: any) => void;
|
6
|
+
onMouseLeave?: (e: any) => void;
|
6
7
|
};
|
7
|
-
declare const Tooltip:
|
8
|
+
declare const Tooltip: ({ open, children }: Props) => import("react/jsx-runtime").JSX.Element;
|
8
9
|
export default Tooltip;
|
@@ -1,16 +1,11 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
const Tooltip = ({ open, children
|
2
|
+
const Tooltip = ({ open, children }) => {
|
3
3
|
if (!open)
|
4
4
|
return null;
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
bottom: "sb-top-full sb-left-1/2 sb-transform -sb-translate-x-1/2 sb-mt-2",
|
10
|
-
left: "sb-right-full sb-top-1/2 sb-transform -sb-translate-y-1/2 sb-mr-2",
|
11
|
-
right: "sb-left-full sb-top-1/2 sb-transform -sb-translate-y-1/2 sb-ml-2",
|
12
|
-
};
|
13
|
-
return (_jsx("div", { className: `sb-relative sb-bg-black sb-text-white sb-text-sm sb-px-2 sb-py-1 sb-rounded sb-shadow-md sb-z-50 ${positionClasses[position]}`, children: children }));
|
5
|
+
return (_jsx("div", {
|
6
|
+
// onMouseEnter={onMouseEnter}
|
7
|
+
// on
|
8
|
+
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: children }));
|
14
9
|
};
|
15
10
|
export default Tooltip;
|
16
11
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Tooltip/index.tsx"],"names":[],"mappings":";AAQA,MAAM,OAAO,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Tooltip/index.tsx"],"names":[],"mappings":";AAQA,MAAM,OAAO,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAS,EAAE,EAAE;IAC5C,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,OAAO,CACL;QACE,8BAA8B;QAC9B,KAAK;QACL,SAAS,EAAC,8GAA8G,YAEvH,QAAQ,GACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|