softbuilders-react-video-player 1.2.14 → 1.2.16
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/BigPlayButton/index.d.ts +4 -1
- package/dist/components/BigPlayButton/index.js +4 -2
- package/dist/components/BigPlayButton/index.js.map +1 -1
- package/dist/components/BigPlayButton/index.tsx +18 -3
- package/dist/components/ControlBar/index.d.ts +2 -1
- package/dist/components/ControlBar/index.js +16 -12
- package/dist/components/ControlBar/index.js.map +1 -1
- package/dist/components/ControlBar/index.tsx +58 -46
- package/dist/components/QualityMenu/index.d.ts +2 -1
- package/dist/components/QualityMenu/index.js +6 -6
- package/dist/components/QualityMenu/index.js.map +1 -1
- package/dist/components/QualityMenu/index.tsx +13 -5
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Slider/index.tsx +36 -36
- package/dist/components/SoftBuildersVideoPlayer/index.d.ts +2 -0
- package/dist/components/SoftBuildersVideoPlayer/index.js +2 -2
- package/dist/components/SoftBuildersVideoPlayer/index.js.map +1 -1
- package/dist/components/SoftBuildersVideoPlayer/index.tsx +6 -0
- package/dist/components/SubtitleMenu/index.d.ts +2 -1
- package/dist/components/SubtitleMenu/index.js +2 -2
- package/dist/components/SubtitleMenu/index.js.map +1 -1
- package/dist/components/SubtitleMenu/index.tsx +6 -2
- package/dist/components/TimeSlider/index.js.map +1 -1
- package/dist/components/TimeSlider/index.tsx +0 -1
- package/dist/components/VideoPlayerComponent/index.d.ts +2 -0
- package/dist/components/VideoPlayerComponent/index.js +35 -20
- package/dist/components/VideoPlayerComponent/index.js.map +1 -1
- package/dist/components/VideoPlayerComponent/index.tsx +76 -41
- package/dist/components/VolumeSlider/index.d.ts +2 -1
- package/dist/components/VolumeSlider/index.js +29 -8
- package/dist/components/VolumeSlider/index.js.map +1 -1
- package/dist/components/VolumeSlider/index.tsx +57 -15
- package/dist/components/icons/SubIcon.js +1 -1
- package/dist/components/icons/SubIcon.js.map +1 -1
- package/dist/components/icons/SubIcon.tsx +27 -28
- package/dist/components/icons/VolumeHigh.d.ts +3 -0
- package/dist/components/icons/VolumeHigh.js +4 -0
- package/dist/components/icons/VolumeHigh.js.map +1 -0
- package/dist/components/icons/VolumeHigh.tsx +15 -0
- package/dist/components/icons/VolumeHighIcon.d.ts +3 -0
- package/dist/components/icons/VolumeHighIcon.js +4 -0
- package/dist/components/icons/VolumeHighIcon.js.map +1 -0
- package/dist/components/icons/VolumeHighIcon.tsx +16 -0
- package/dist/components/icons/VolumeIconHigh.d.ts +3 -0
- package/dist/components/icons/VolumeIconHigh.js +4 -0
- package/dist/components/icons/VolumeIconHigh.js.map +1 -0
- package/dist/components/icons/VolumeIconHigh.tsx +16 -0
- package/dist/components/icons/VolumeIconLow copy.d.ts +3 -0
- package/dist/components/icons/VolumeIconLow copy.js +4 -0
- package/dist/components/icons/VolumeIconLow copy.js.map +1 -0
- package/dist/components/icons/VolumeIconLow copy.tsx +17 -0
- package/dist/components/icons/VolumeLow.d.ts +3 -0
- package/dist/components/icons/VolumeLow.js +4 -0
- package/dist/components/icons/VolumeLow.js.map +1 -0
- package/dist/components/icons/VolumeLow.tsx +14 -0
- package/dist/components/icons/VolumeLowIcon.d.ts +3 -0
- package/dist/components/icons/VolumeLowIcon.js +4 -0
- package/dist/components/icons/VolumeLowIcon.js.map +1 -0
- package/dist/components/icons/VolumeLowIcon.tsx +15 -0
- package/dist/components/icons/VolumeMute.d.ts +3 -0
- package/dist/components/icons/VolumeMute.js +10 -0
- package/dist/components/icons/VolumeMute.js.map +1 -0
- package/dist/components/icons/VolumeMute.tsx +25 -0
- package/dist/components/icons/VolumeVLow.d.ts +3 -0
- package/dist/components/icons/VolumeVLow.js +4 -0
- package/dist/components/icons/VolumeVLow.js.map +1 -0
- package/dist/components/icons/VolumeVLow.tsx +14 -0
- package/dist/components/icons/index.d.ts +4 -0
- package/dist/components/icons/index.js +4 -0
- package/dist/components/icons/index.js.map +1 -1
- package/dist/components/icons/index.ts +19 -15
- package/dist/index.css +17 -2
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +370 -262
- package/dist/styles/tailwind.css +17 -2
- package/dist/types.d.ts +2 -1
- package/package.json +2 -1
@@ -4,6 +4,9 @@ type Props = {
|
|
4
4
|
player: Player | undefined;
|
5
5
|
isPaused: boolean;
|
6
6
|
setIsPaused: React.Dispatch<React.SetStateAction<boolean>>;
|
7
|
+
height?: number;
|
8
|
+
id?: string;
|
9
|
+
heightValue?: number;
|
7
10
|
};
|
8
|
-
declare const BigPlayButton: ({ player, isPaused, setIsPaused }: Props) => import("react/jsx-runtime").JSX.Element;
|
11
|
+
declare const BigPlayButton: ({ player, isPaused, setIsPaused, height, id, heightValue, }: Props) => import("react/jsx-runtime").JSX.Element;
|
9
12
|
export default BigPlayButton;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { PauseIcon, PlayIcon } from "../../images";
|
3
|
-
const BigPlayButton = ({ player, isPaused, setIsPaused }) => {
|
3
|
+
const BigPlayButton = ({ player, isPaused, setIsPaused, height, id, heightValue, }) => {
|
4
4
|
const togglePlay = () => {
|
5
5
|
if (isPaused)
|
6
6
|
player === null || player === void 0 ? void 0 : player.play();
|
@@ -8,7 +8,9 @@ const BigPlayButton = ({ player, isPaused, setIsPaused }) => {
|
|
8
8
|
player === null || player === void 0 ? void 0 : player.pause();
|
9
9
|
setIsPaused(!isPaused);
|
10
10
|
};
|
11
|
-
return (_jsx("div", {
|
11
|
+
return (_jsx("div", { style: Object.assign({}, (height && heightValue
|
12
|
+
? { position: "absolute", top: `-${(heightValue - height) / 2}px` }
|
13
|
+
: {})), onClick: togglePlay, 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`, children: isPaused ? (_jsx(PlayIcon, { className: "sb-w-4 sb-h-4" })) : (_jsx(PauseIcon, { className: "sb-w-4 sb-h-4" })) }));
|
12
14
|
};
|
13
15
|
export default BigPlayButton;
|
14
16
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/BigPlayButton/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/BigPlayButton/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAWnD,MAAM,aAAa,GAAG,CAAC,EACrB,MAAM,EACN,QAAQ,EACR,WAAW,EACX,MAAM,EACN,EAAE,EACF,WAAW,GACL,EAAE,EAAE;IACV,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,IAAI,QAAQ;YAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,EAAE,CAAC;;YACxB,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,EAAE,CAAC;QAErB,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC,CAAC;IAEF,OAAO,CACL,cACE,KAAK,oBACA,CAAC,MAAM,IAAI,WAAW;YACvB,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE;YACnE,CAAC,CAAC,EAAE,CAAC,GAET,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,+GAA+G,YAEzH,QAAQ,CAAC,CAAC,CAAC,CACV,KAAC,QAAQ,IAAC,SAAS,EAAC,eAAe,GAAG,CACvC,CAAC,CAAC,CAAC,CACF,KAAC,SAAS,IAAC,SAAS,EAAC,eAAe,GAAG,CACxC,GACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React from "react";
|
1
|
+
import React, { useState } from "react";
|
2
2
|
import Player from "video.js/dist/types/player";
|
3
3
|
import { PauseIcon, PlayIcon } from "../../images";
|
4
4
|
import log from "video.js/dist/types/utils/log";
|
@@ -7,8 +7,18 @@ type Props = {
|
|
7
7
|
player: Player | undefined;
|
8
8
|
isPaused: boolean;
|
9
9
|
setIsPaused: React.Dispatch<React.SetStateAction<boolean>>;
|
10
|
+
height?: number;
|
11
|
+
id?: string;
|
12
|
+
heightValue?: number;
|
10
13
|
};
|
11
|
-
const BigPlayButton = ({
|
14
|
+
const BigPlayButton = ({
|
15
|
+
player,
|
16
|
+
isPaused,
|
17
|
+
setIsPaused,
|
18
|
+
height,
|
19
|
+
id,
|
20
|
+
heightValue,
|
21
|
+
}: Props) => {
|
12
22
|
const togglePlay = () => {
|
13
23
|
if (isPaused) player?.play();
|
14
24
|
else player?.pause();
|
@@ -18,8 +28,13 @@ const BigPlayButton = ({ player, isPaused, setIsPaused }: Props) => {
|
|
18
28
|
|
19
29
|
return (
|
20
30
|
<div
|
31
|
+
style={{
|
32
|
+
...(height && heightValue
|
33
|
+
? { position: "absolute", top: `-${(heightValue - height) / 2}px` }
|
34
|
+
: {}),
|
35
|
+
}}
|
21
36
|
onClick={togglePlay}
|
22
|
-
className=
|
37
|
+
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`}
|
23
38
|
>
|
24
39
|
{isPaused ? (
|
25
40
|
<PlayIcon className="sb-w-4 sb-h-4" />
|
@@ -17,6 +17,7 @@ type Props<T> = {
|
|
17
17
|
disableNote?: boolean;
|
18
18
|
setNoteOpen?: (val: boolean) => void;
|
19
19
|
noteButtonClick?: (e: any) => void;
|
20
|
+
isTrailer?: boolean;
|
20
21
|
};
|
21
|
-
declare const ControlBar: <T>({ player, isPaused, setIsPaused, duration, notes, chapters, seekStep, id, handleSaveNoteAction, handleControlDisplayTimer, setIsQualityMenuOpen, setIsSubtitleMenuOpen, setNoteOpen, disableNote, noteButtonClick, }: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
22
|
+
declare const ControlBar: <T>({ player, isPaused, setIsPaused, duration, notes, chapters, seekStep, id, handleSaveNoteAction, handleControlDisplayTimer, setIsQualityMenuOpen, setIsSubtitleMenuOpen, setNoteOpen, disableNote, noteButtonClick, isTrailer, }: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
22
23
|
export default ControlBar;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import { useEffect, useState } from "react";
|
3
3
|
import CurrentTimeLabel from "../CurrentTimeLabel";
|
4
4
|
import { durationFormater } from "../../utils";
|
@@ -12,7 +12,7 @@ import { useSoftBuildersVideoPlayerContext } from "../VideoPlayerComponent/provi
|
|
12
12
|
import SubtitleMenu from "../SubtitleMenu";
|
13
13
|
import { BackwardIcon, ForwardIcon, FullScreenIcon, PauseIcon, PlayIcon, } from "../../images";
|
14
14
|
import TooltipModal from "../Tooltip/GlobalTooltip";
|
15
|
-
const ControlBar = ({ player, isPaused, setIsPaused, duration, notes, chapters, seekStep = 5, id, handleSaveNoteAction, handleControlDisplayTimer, setIsQualityMenuOpen, setIsSubtitleMenuOpen, setNoteOpen, disableNote, noteButtonClick, }) => {
|
15
|
+
const ControlBar = ({ player, isPaused, setIsPaused, duration, notes, chapters, seekStep = 5, id, handleSaveNoteAction, handleControlDisplayTimer, setIsQualityMenuOpen, setIsSubtitleMenuOpen, setNoteOpen, disableNote, noteButtonClick, isTrailer, }) => {
|
16
16
|
const { setPlayer, setDuration } = useSoftBuildersVideoPlayerContext();
|
17
17
|
const [width, setWidth] = useState(0);
|
18
18
|
const [isSeeking, setIsSeeking] = useState(true);
|
@@ -48,23 +48,27 @@ const ControlBar = ({ player, isPaused, setIsPaused, duration, notes, chapters,
|
|
48
48
|
useEffect(() => {
|
49
49
|
setDuration(duration);
|
50
50
|
}, [duration]);
|
51
|
-
return (_jsxs("div", { className: ` !sb-px-4 sb-flex sb-pt-2 sb-justify-center sb-gap-3 sb-w-full sb-h-full ${width > 400
|
51
|
+
return (_jsxs("div", { className: ` !sb-px-4 sb-flex sb-pt-2 sb-justify-center sb-gap-3 sb-w-full sb-h-full ${width > 400 && !isTrailer
|
52
52
|
? "sb-absolute sb-bottom-1 sb-items-end sb-mb-1 sb-pb-2 "
|
53
|
-
: "sb-items-start"} sb-pb-2`, children: [_jsx(BufferTracker, {}), _jsx(CurrentTimeTracker, {}), _jsx("button", { onClick: () => {
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
53
|
+
: "sb-items-start"} sb-pb-2`, children: [_jsx(BufferTracker, {}), _jsx(CurrentTimeTracker, {}), !isTrailer && (_jsxs(_Fragment, { children: [" ", _jsx("button", { onClick: () => {
|
54
|
+
seek(-seekStep);
|
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) => {
|
56
|
+
e.preventDefault();
|
57
|
+
seek(seekStep);
|
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" }) }) })] })),
|
59
59
|
// isSeeking ||
|
60
60
|
// width > 400 &&
|
61
|
-
_jsx("div", { className: `${width < 400
|
61
|
+
_jsx("div", { className: `${width < 400 && !isTrailer
|
62
|
+
? "sb-flex-1 sb-ml-0 sb-mr-0"
|
63
|
+
: "sb-w-full"}`, children: _jsxs("div", { style: width < 400 && !isTrailer
|
62
64
|
? {
|
63
65
|
width: `${width * 0.9}px`,
|
64
66
|
left: "5%",
|
65
67
|
top: "90%",
|
66
68
|
}
|
67
|
-
: { width: "98%" }, className: `flex gap-2 ${width < 400
|
69
|
+
: { width: "98%" }, className: `flex gap-2 ${width < 400 && !isTrailer
|
70
|
+
? "absolute sb-top-1"
|
71
|
+
: "-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, { isTrailer: isTrailer, volumeSliderToggler: volumeSliderToggler, width: width, setIsSeeking: (val) => setIsSeeking(val), handleControlDisplayTimer: handleControlDisplayTimer }) }), _jsx(TooltipModal, { width: width, content: _jsx("p", { children: "Quality" }), children: _jsx(QualityMenu, { isTrailer: isTrailer, width: width, onClick: (e, isOpen) => {
|
68
72
|
setVolumeToggler(!volumeSliderToggler);
|
69
73
|
setIsQualityMenuOpen && setIsQualityMenuOpen(isOpen);
|
70
74
|
} }) }), disableNote && (_jsx(TooltipModal, { width: width, content: _jsx("p", { children: "Create note" }), children: _jsx(CreateNoteMenu, { handleSaveNoteAction: handleSaveNoteAction, width: width, setNoteOpen: setNoteOpen, noteButtonClick: (e) => {
|
@@ -74,7 +78,7 @@ const ControlBar = ({ player, isPaused, setIsPaused, duration, notes, chapters,
|
|
74
78
|
isOpen: e,
|
75
79
|
});
|
76
80
|
player === null || player === void 0 ? void 0 : player.pause();
|
77
|
-
} }) })), _jsx(TooltipModal, { width: width, content: _jsx("p", { children: "Subtitle" }), children: _jsx(SubtitleMenu, { width: width, onClick: (e, isOpen) => {
|
81
|
+
} }) })), _jsx(TooltipModal, { width: width, content: _jsx("p", { children: "Subtitle" }), children: _jsx(SubtitleMenu, { isTrailer: isTrailer, width: width, onClick: (e, isOpen) => {
|
78
82
|
setVolumeToggler(!volumeSliderToggler);
|
79
83
|
setIsSubtitleMenuOpen && setIsSubtitleMenuOpen(isOpen);
|
80
84
|
} }) }), _jsx(TooltipModal, { width: width, content: _jsx("p", { children: "Full screen" }), children: _jsx("button", { onClick: (e) => {
|
@@ -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;AACtB,OAAO,YAAY,MAAM,0BAA0B,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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E,KAAI,CAAC,CAAC;gCACxC,MAAM,EAAE,CAAC;6BACV,CAAC,CAAC;wBACL,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,EAAE,CAAC;oBAClB,CAAC,GACD,GACW,CAChB,EACD,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,mCAAe,YAClD,KAAC,YAAY,IACX,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,CAAC,CAAM,EAAE,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"}
|
@@ -39,6 +39,7 @@ type Props<T> = {
|
|
39
39
|
disableNote?: boolean;
|
40
40
|
setNoteOpen?: (val: boolean) => void;
|
41
41
|
noteButtonClick?: (e: any) => void;
|
42
|
+
isTrailer?: boolean;
|
42
43
|
};
|
43
44
|
|
44
45
|
const ControlBar = <T,>({
|
@@ -57,6 +58,7 @@ const ControlBar = <T,>({
|
|
57
58
|
setNoteOpen,
|
58
59
|
disableNote,
|
59
60
|
noteButtonClick,
|
61
|
+
isTrailer,
|
60
62
|
}: Props<T>) => {
|
61
63
|
const { setPlayer, setDuration } = useSoftBuildersVideoPlayerContext();
|
62
64
|
const [width, setWidth] = useState<number>(0);
|
@@ -103,7 +105,7 @@ const ControlBar = <T,>({
|
|
103
105
|
return (
|
104
106
|
<div
|
105
107
|
className={` !sb-px-4 sb-flex sb-pt-2 sb-justify-center sb-gap-3 sb-w-full sb-h-full ${
|
106
|
-
width > 400
|
108
|
+
width > 400 && !isTrailer
|
107
109
|
? "sb-absolute sb-bottom-1 sb-items-end sb-mb-1 sb-pb-2 "
|
108
110
|
: "sb-items-start"
|
109
111
|
} sb-pb-2`}
|
@@ -113,60 +115,65 @@ const ControlBar = <T,>({
|
|
113
115
|
{/* Doesn't display anything, just set the current time */}
|
114
116
|
<CurrentTimeTracker />
|
115
117
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
118
|
+
{!isTrailer && (
|
119
|
+
<>
|
120
|
+
{" "}
|
121
|
+
<button
|
122
|
+
onClick={() => {
|
123
|
+
seek(-seekStep);
|
124
|
+
}}
|
125
|
+
>
|
126
|
+
<TooltipModal
|
127
|
+
width={width}
|
128
|
+
content={<p>Backward 5 sec</p>}
|
129
|
+
isLeft={true}
|
130
|
+
>
|
131
|
+
<BackwardIcon className="sb-w-3 sb-h-3" />
|
132
|
+
</TooltipModal>
|
133
|
+
</button>
|
134
|
+
<button onClick={togglePlay}>
|
135
|
+
<TooltipModal
|
136
|
+
width={width}
|
137
|
+
content={<p>{isPaused ? "Play" : "pause"}</p>}
|
138
|
+
isLeft={true}
|
139
|
+
>
|
140
|
+
{isPaused ? (
|
141
|
+
<PlayIcon className="sb-w-3 sb-h-3" />
|
142
|
+
) : (
|
143
|
+
<PauseIcon className="sb-w-3 sb-h-3" />
|
144
|
+
)}
|
145
|
+
</TooltipModal>
|
146
|
+
</button>
|
147
|
+
<button
|
148
|
+
onClick={(e) => {
|
149
|
+
e.preventDefault();
|
150
|
+
seek(seekStep);
|
151
|
+
}}
|
152
|
+
>
|
153
|
+
<TooltipModal
|
154
|
+
width={width}
|
155
|
+
content={<p>Forward 5 sec</p>}
|
156
|
+
isLeft={true}
|
157
|
+
>
|
158
|
+
<ForwardIcon className="sb-w-3 sb-h-3" />
|
159
|
+
</TooltipModal>
|
160
|
+
</button>
|
161
|
+
</>
|
162
|
+
)}
|
158
163
|
|
159
164
|
{
|
160
165
|
// isSeeking ||
|
161
166
|
// width > 400 &&
|
162
167
|
<div
|
163
168
|
className={`${
|
164
|
-
width < 400
|
169
|
+
width < 400 && !isTrailer
|
170
|
+
? "sb-flex-1 sb-ml-0 sb-mr-0"
|
171
|
+
: "sb-w-full"
|
165
172
|
}`}
|
166
173
|
>
|
167
174
|
<div
|
168
175
|
style={
|
169
|
-
width < 400
|
176
|
+
width < 400 && !isTrailer
|
170
177
|
? {
|
171
178
|
width: `${width * 0.9}px`,
|
172
179
|
left: "5%",
|
@@ -175,7 +182,9 @@ const ControlBar = <T,>({
|
|
175
182
|
: { width: "98%" }
|
176
183
|
}
|
177
184
|
className={`flex gap-2 ${
|
178
|
-
width < 400
|
185
|
+
width < 400 && !isTrailer
|
186
|
+
? "absolute sb-top-1"
|
187
|
+
: "-sb-translate-y-0 sb-w-full"
|
179
188
|
} hover:sb-w-[45%] `}
|
180
189
|
>
|
181
190
|
{/* sb-transition-all sb-ease-in-out sb-duration-500 */}
|
@@ -189,6 +198,7 @@ const ControlBar = <T,>({
|
|
189
198
|
|
190
199
|
<div className="sb-h-full">
|
191
200
|
<VolumeSlider
|
201
|
+
isTrailer={isTrailer}
|
192
202
|
volumeSliderToggler={volumeSliderToggler}
|
193
203
|
width={width}
|
194
204
|
setIsSeeking={(val) => setIsSeeking(val)}
|
@@ -197,6 +207,7 @@ const ControlBar = <T,>({
|
|
197
207
|
</div>
|
198
208
|
<TooltipModal width={width} content={<p>Quality</p>}>
|
199
209
|
<QualityMenu
|
210
|
+
isTrailer={isTrailer}
|
200
211
|
width={width}
|
201
212
|
onClick={(e: any, isOpen: boolean) => {
|
202
213
|
setVolumeToggler(!volumeSliderToggler);
|
@@ -225,6 +236,7 @@ const ControlBar = <T,>({
|
|
225
236
|
)}
|
226
237
|
<TooltipModal width={width} content={<p>Subtitle</p>}>
|
227
238
|
<SubtitleMenu
|
239
|
+
isTrailer={isTrailer}
|
228
240
|
width={width}
|
229
241
|
onClick={(e: any, isOpen: boolean) => {
|
230
242
|
setVolumeToggler(!volumeSliderToggler);
|
@@ -1,6 +1,7 @@
|
|
1
1
|
type QualityMenuProps = {
|
2
2
|
width: number;
|
3
3
|
onClick?: (e: any, toggleMenu: boolean) => void;
|
4
|
+
isTrailer?: boolean;
|
4
5
|
};
|
5
|
-
declare const QualityMenu: ({ width, onClick }: QualityMenuProps) => import("react/jsx-runtime").JSX.Element;
|
6
|
+
declare const QualityMenu: ({ width, onClick, isTrailer }: QualityMenuProps) => import("react/jsx-runtime").JSX.Element;
|
6
7
|
export default QualityMenu;
|
@@ -3,10 +3,10 @@ import { useEffect, useState } from "react";
|
|
3
3
|
import MenuButton from "../MenuButton";
|
4
4
|
import { useSoftBuildersVideoPlayerContext } from "../VideoPlayerComponent/provider";
|
5
5
|
import { CheckedIcon, LeftArrowIcon, SettingsIcon } from "../../images";
|
6
|
-
const QualityOption = ({ isSelected, quality, onClick, width, }) => {
|
7
|
-
return (_jsx("button", { className: `hover:sb-text-orange-500 ${width > 400 ? "sb-p-2" : "sp-pb-1"}`, onClick: onClick, children: _jsxs("div", { className: "sb-grid sb-grid-cols-12 sb-items-center sb-gap-2", children: [_jsx("div", { className: "sb-col-span-3", children: isSelected ? (_jsx(CheckedIcon, { className: `${width > 400 ? "sb-w-5 sb-h-5" : "sb-w-3 sb-h-3"}` })) : (_jsx("div", {})) }), _jsx("p", { className: "sb-text-left sb-col-span-9", children: quality === null || quality === void 0 ? void 0 : quality.label })] }) }));
|
6
|
+
const QualityOption = ({ isSelected, quality, onClick, width, isTrailer, }) => {
|
7
|
+
return (_jsx("button", { className: `hover:sb-text-orange-500 ${width > 400 && !isTrailer ? "sb-p-2" : "sp-pb-1"}`, onClick: onClick, children: _jsxs("div", { className: "sb-grid sb-grid-cols-12 sb-items-center sb-gap-2", children: [_jsx("div", { className: "sb-col-span-3", children: isSelected ? (_jsx(CheckedIcon, { className: `${width > 400 && !isTrailer ? "sb-w-5 sb-h-5" : "sb-w-3 sb-h-3"}` })) : (_jsx("div", {})) }), _jsx("p", { className: "sb-text-left sb-col-span-9", children: quality === null || quality === void 0 ? void 0 : quality.label })] }) }));
|
8
8
|
};
|
9
|
-
const QualityMenu = ({ width, onClick }) => {
|
9
|
+
const QualityMenu = ({ width, onClick, isTrailer }) => {
|
10
10
|
const { player } = useSoftBuildersVideoPlayerContext();
|
11
11
|
const [closeMenuFunction, setCloseMenuFunction] = useState(undefined);
|
12
12
|
const [qualities, setQualities] = useState([]);
|
@@ -27,16 +27,16 @@ const QualityMenu = ({ width, onClick }) => {
|
|
27
27
|
}
|
28
28
|
}
|
29
29
|
}, [player]);
|
30
|
-
return (_jsx(MenuButton, { classContainer: `${width < 400 ? "!sb-top-8 -sb-left-9" : ""}`, onClick: (e, isOpen) => {
|
30
|
+
return (_jsx(MenuButton, { classContainer: `${width < 400 || isTrailer ? "!sb-top-8 -sb-left-9" : ""}`, onClick: (e, isOpen) => {
|
31
31
|
onClick && onClick(e, isOpen);
|
32
|
-
}, buttonContent: _jsx(SettingsIcon, { className: "sb-w-3 sb-h-3" }), menuContent: _jsx("div", { className: `sb-rounded-md sb-bg-[#303030] sb-bg-opacity-50 ${width > 400
|
32
|
+
}, buttonContent: _jsx(SettingsIcon, { className: "sb-w-3 sb-h-3" }), menuContent: _jsx("div", { className: `sb-rounded-md sb-bg-[#303030] sb-bg-opacity-50 ${width > 400 && !isTrailer
|
33
33
|
? "sb-w-[150px] sb-py-5"
|
34
34
|
: "sb-w-[90px] sb-items-center sb-justify-center sb-py-1"}`, children: _jsxs("div", { className: "sb-flex sb-flex-col sb-gap-3", children: [_jsxs("div", { className: `sb-px-5 sb-flex sb-flex-row sb-gap-3 sb-items-start sb-relative sb-top-2`, children: [_jsx("button", { onClick: () => {
|
35
35
|
if (closeMenuFunction) {
|
36
36
|
closeMenuFunction();
|
37
37
|
}
|
38
38
|
}, 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) => {
|
39
|
-
return (_jsx(QualityOption, { width: width, isSelected: currentQualitySrc === (q === null || q === void 0 ? void 0 : q.label), quality: q, onClick: () => {
|
39
|
+
return (_jsx(QualityOption, { width: width, isTrailer: isTrailer, isSelected: currentQualitySrc === (q === null || q === void 0 ? void 0 : q.label), quality: q, onClick: () => {
|
40
40
|
const source = qualities.find((_q) => (q === null || q === void 0 ? void 0 : q.label) == (_q === null || _q === void 0 ? void 0 : _q.label));
|
41
41
|
if (source && source.src != currentQualitySrc) {
|
42
42
|
player === null || player === void 0 ? void 0 : player.src(source.src);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/QualityMenu/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAe,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AAGrF,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/QualityMenu/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAe,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AAGrF,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AASxE,MAAM,aAAa,GAAG,CAAC,EACrB,UAAU,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,GACU,EAAE,EAAE;IACvB,OAAO,CACL,iBACE,SAAS,EAAE,4BACT,KAAK,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SACzC,EAAE,EACF,OAAO,EAAE,OAAO,YAEhB,eAAK,SAAS,EAAC,kDAAkD,aAC/D,cAAK,SAAS,EAAC,eAAe,YAC3B,UAAU,CAAC,CAAC,CAAC,CACZ,KAAC,WAAW,IACV,SAAS,EAAE,GACT,KAAK,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAChD,EAAE,GACF,CACH,CAAC,CAAC,CAAC,CACF,eAAW,CACZ,GACG,EAEN,YAAG,SAAS,EAAC,4BAA4B,YAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,GAAK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AC,IAAI,CAC3B,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,KAAK,MAAI,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,KAAK,CAAA,CAC9B,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,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC;wCACpC,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,aAAD,CAAC,uBAAD,CAAC,CAAE,KAAK,IAAI,CAAC,EAAE,CAe/B,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"}
|
@@ -10,17 +10,19 @@ type QualityOptionProps = {
|
|
10
10
|
quality: SoftBuildersVideoPlayerSource;
|
11
11
|
onClick: () => void;
|
12
12
|
width: number;
|
13
|
+
isTrailer?: boolean;
|
13
14
|
};
|
14
15
|
const QualityOption = ({
|
15
16
|
isSelected,
|
16
17
|
quality,
|
17
18
|
onClick,
|
18
19
|
width,
|
20
|
+
isTrailer,
|
19
21
|
}: QualityOptionProps) => {
|
20
22
|
return (
|
21
23
|
<button
|
22
24
|
className={`hover:sb-text-orange-500 ${
|
23
|
-
width > 400 ? "sb-p-2" : "sp-pb-1"
|
25
|
+
width > 400 && !isTrailer ? "sb-p-2" : "sp-pb-1"
|
24
26
|
}`}
|
25
27
|
onClick={onClick}
|
26
28
|
>
|
@@ -28,7 +30,9 @@ const QualityOption = ({
|
|
28
30
|
<div className="sb-col-span-3">
|
29
31
|
{isSelected ? (
|
30
32
|
<CheckedIcon
|
31
|
-
className={`${
|
33
|
+
className={`${
|
34
|
+
width > 400 && !isTrailer ? "sb-w-5 sb-h-5" : "sb-w-3 sb-h-3"
|
35
|
+
}`}
|
32
36
|
/>
|
33
37
|
) : (
|
34
38
|
<div></div>
|
@@ -44,9 +48,10 @@ const QualityOption = ({
|
|
44
48
|
type QualityMenuProps = {
|
45
49
|
width: number;
|
46
50
|
onClick?: (e: any, toggleMenu: boolean) => void;
|
51
|
+
isTrailer?: boolean;
|
47
52
|
};
|
48
53
|
|
49
|
-
const QualityMenu = ({ width, onClick }: QualityMenuProps) => {
|
54
|
+
const QualityMenu = ({ width, onClick, isTrailer }: QualityMenuProps) => {
|
50
55
|
const { player } = useSoftBuildersVideoPlayerContext();
|
51
56
|
|
52
57
|
const [closeMenuFunction, setCloseMenuFunction] = useState<
|
@@ -88,7 +93,9 @@ const QualityMenu = ({ width, onClick }: QualityMenuProps) => {
|
|
88
93
|
|
89
94
|
return (
|
90
95
|
<MenuButton
|
91
|
-
classContainer={`${
|
96
|
+
classContainer={`${
|
97
|
+
width < 400 || isTrailer ? "!sb-top-8 -sb-left-9" : ""
|
98
|
+
}`}
|
92
99
|
onClick={(e, isOpen) => {
|
93
100
|
onClick && onClick(e, isOpen);
|
94
101
|
}}
|
@@ -96,7 +103,7 @@ const QualityMenu = ({ width, onClick }: QualityMenuProps) => {
|
|
96
103
|
menuContent={
|
97
104
|
<div
|
98
105
|
className={`sb-rounded-md sb-bg-[#303030] sb-bg-opacity-50 ${
|
99
|
-
width > 400
|
106
|
+
width > 400 && !isTrailer
|
100
107
|
? "sb-w-[150px] sb-py-5"
|
101
108
|
: "sb-w-[90px] sb-items-center sb-justify-center sb-py-1"
|
102
109
|
}`}
|
@@ -125,6 +132,7 @@ const QualityMenu = ({ width, onClick }: QualityMenuProps) => {
|
|
125
132
|
return (
|
126
133
|
<QualityOption
|
127
134
|
width={width}
|
135
|
+
isTrailer={isTrailer}
|
128
136
|
key={`quality-${q?.label}-${i}`}
|
129
137
|
isSelected={currentQualitySrc === q?.label}
|
130
138
|
quality={q}
|
@@ -13,7 +13,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import "./style.css";
|
14
14
|
const Slider = (_a) => {
|
15
15
|
var { value, handleValueChange, min = 0, max = 100, className, handleSliderClick = () => { } } = _a, rest = __rest(_a, ["value", "handleValueChange", "min", "max", "className", "handleSliderClick"]);
|
16
|
-
return (_jsx("input", Object.assign({ type:
|
16
|
+
return (_jsx("input", Object.assign({ type: "range", min: min, onMouseDown: (e) => e.stopPropagation(), onClick: (e) => {
|
17
17
|
e.stopPropagation();
|
18
18
|
handleSliderClick(e);
|
19
19
|
}, onMouseUp: (e) => e.stopPropagation(), max: max, value: value, onChange: (e) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Slider/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,aAAa,CAAC;AAUrB,MAAM,MAAM,GAAG,CAAC,EAQR,EAAE,EAAE;QARI,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Slider/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,aAAa,CAAC;AAUrB,MAAM,MAAM,GAAG,CAAC,EAQR,EAAE,EAAE;QARI,EACd,KAAK,EACL,iBAAiB,EACjB,GAAG,GAAG,CAAC,EACP,GAAG,GAAG,GAAG,EACT,SAAS,EACT,iBAAiB,GAAG,GAAG,EAAE,GAAE,CAAC,OAEtB,EADH,IAAI,cAPO,8EAQf,CADQ;IAEP,OAAO,CACL,8BACE,IAAI,EAAC,OAAO,EACZ,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACvC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,iBAAiB,CAAC,CAAC,CAAC,CAAC;QACvB,CAAC,EACD,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACrC,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;YACd,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,iBAAiB,CAAC,CAAC,CAAC,CAAC;QACvB,CAAC,EACD,SAAS,EAAE;UACP,SAAS,EAAE,EACf,KAAK,EAAE;YACL,UAAU,EAAE,qCAAqC,KAAK,gBAAgB,KAAK,IAAI;SAChF,IACG,IAAI,EACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
@@ -2,47 +2,47 @@ import React, { InputHTMLAttributes, SetStateAction, useState } from "react";
|
|
2
2
|
import "./style.css";
|
3
3
|
|
4
4
|
type Props = {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
value: number;
|
6
|
+
handleValueChange: React.ChangeEventHandler<HTMLInputElement>;
|
7
|
+
handleSliderClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
8
|
+
min?: number;
|
9
|
+
max?: number;
|
10
10
|
} & InputHTMLAttributes<HTMLInputElement>;
|
11
11
|
|
12
12
|
const Slider = ({
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
value,
|
14
|
+
handleValueChange,
|
15
|
+
min = 0,
|
16
|
+
max = 100,
|
17
|
+
className,
|
18
|
+
handleSliderClick = () => {},
|
19
|
+
...rest
|
20
20
|
}: Props) => {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
21
|
+
return (
|
22
|
+
<input
|
23
|
+
type="range"
|
24
|
+
min={min}
|
25
|
+
onMouseDown={(e) => e.stopPropagation()}
|
26
|
+
onClick={(e) => {
|
27
|
+
e.stopPropagation();
|
28
|
+
handleSliderClick(e);
|
29
|
+
}}
|
30
|
+
onMouseUp={(e) => e.stopPropagation()}
|
31
|
+
max={max}
|
32
|
+
value={value}
|
33
|
+
onChange={(e) => {
|
34
|
+
e.preventDefault();
|
35
|
+
e.stopPropagation();
|
36
|
+
handleValueChange(e);
|
37
|
+
}}
|
38
|
+
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
|
39
39
|
${className}`}
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
style={{
|
41
|
+
background: `linear-gradient(to right, #f97316 ${value}%, #30303070 ${value}%)`,
|
42
|
+
}}
|
43
|
+
{...rest}
|
44
|
+
/>
|
45
|
+
);
|
46
46
|
};
|
47
47
|
|
48
48
|
export default Slider;
|
@@ -14,6 +14,8 @@ export type Props<T = any> = {
|
|
14
14
|
childRef?: React.Ref<HTMLDivElement>;
|
15
15
|
noteButtonClick?: (e: any) => void;
|
16
16
|
videoId?: string;
|
17
|
+
isTrailer?: boolean;
|
18
|
+
height?: number;
|
17
19
|
};
|
18
20
|
declare const SoftBuildersVideoPlayer: React.MemoExoticComponent<React.ForwardRefExoticComponent<Props<any> & React.RefAttributes<HTMLDivElement>>>;
|
19
21
|
export default SoftBuildersVideoPlayer;
|
@@ -14,7 +14,7 @@ const DEFAULT_OPTIONS = {
|
|
14
14
|
sources: [],
|
15
15
|
tracks: [],
|
16
16
|
};
|
17
|
-
const Component = forwardRef(({ options, notes, chapters, startTime = 0, handleSaveNoteAction, onPlay, onPause, isFocused = true, disableNote, childRef, bottomRedBar, noteButtonClick, videoId, }) => {
|
17
|
+
const Component = forwardRef(({ options, notes, chapters, startTime = 0, handleSaveNoteAction, onPlay, onPause, isFocused = true, disableNote, childRef, bottomRedBar, noteButtonClick, videoId, isTrailer = false, height, }) => {
|
18
18
|
options = Object.assign(Object.assign({}, options), { responsive: true, inactivityTimeout: 0, fullscreen: {
|
19
19
|
navigationUI: "hide",
|
20
20
|
} });
|
@@ -52,7 +52,7 @@ const Component = forwardRef(({ options, notes, chapters, startTime = 0, handleS
|
|
52
52
|
useEffect(() => {
|
53
53
|
setUuid(uuidv4());
|
54
54
|
}, []);
|
55
|
-
return (_jsx(VideoPlayerComponent, { id: uuid, chapters: chapters, options: Object.assign(Object.assign({}, options), { tracks }), notes: notes, poster: "", startTime: startTime, handleSaveNoteAction: handleSaveNoteAction, disableNote: disableNote, onPause: onPause, onPlay: onPlay, childRef: childRef, bottomRedBar: bottomRedBar, noteButtonClick: noteButtonClick }));
|
55
|
+
return (_jsx(VideoPlayerComponent, { id: uuid, chapters: chapters, options: Object.assign(Object.assign({}, options), { tracks }), notes: notes, poster: "", startTime: startTime, handleSaveNoteAction: handleSaveNoteAction, disableNote: disableNote, onPause: onPause, onPlay: onPlay, childRef: childRef, bottomRedBar: bottomRedBar, noteButtonClick: noteButtonClick, isTrailer: isTrailer, height: height }));
|
56
56
|
});
|
57
57
|
const SoftBuildersVideoPlayer = memo(Component, (prevProps, nextProps) => {
|
58
58
|
return (isEqual(prevProps.options, nextProps.options) &&
|