softbuilders-react-video-player 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/ControlBar/index.js +1 -0
- package/dist/components/ControlBar/index.js.map +1 -1
- package/dist/components/ControlBar/index.tsx +2 -0
- package/dist/components/NoteTooltip/index.js +1 -1
- package/dist/components/NoteTooltip/index.js.map +1 -1
- package/dist/components/NoteTooltip/index.tsx +2 -2
- package/dist/components/QualityMenu/index.js +8 -6
- package/dist/components/QualityMenu/index.js.map +1 -1
- package/dist/components/QualityMenu/index.tsx +8 -7
- package/dist/components/SoftBuildersVideoPlayer/index.d.ts +1 -0
- package/dist/components/SoftBuildersVideoPlayer/index.js +34 -58
- package/dist/components/SoftBuildersVideoPlayer/index.js.map +1 -1
- package/dist/components/SoftBuildersVideoPlayer/index.tsx +58 -101
- package/dist/components/SubtitleMenu/index.js +1 -1
- package/dist/components/SubtitleMenu/index.js.map +1 -1
- package/dist/components/SubtitleMenu/index.tsx +1 -1
- package/dist/components/TimeSlider/index.js +8 -2
- package/dist/components/TimeSlider/index.js.map +1 -1
- package/dist/components/TimeSlider/index.tsx +102 -93
- package/dist/components/VideoPlayerComponent/index.d.ts +1 -0
- package/dist/components/VideoPlayerComponent/index.js +91 -82
- package/dist/components/VideoPlayerComponent/index.js.map +1 -1
- package/dist/components/VideoPlayerComponent/index.tsx +135 -128
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +137 -148
- package/package.json +1 -1
@@ -34,6 +34,7 @@ const ControlBar = ({ player, isPaused, setIsPaused, duration, notes, chapters,
|
|
34
34
|
// Start observing the element
|
35
35
|
container && resizeObserver.observe(container);
|
36
36
|
const togglePlay = (e) => {
|
37
|
+
console.log(player.currentTime());
|
37
38
|
e.preventDefault();
|
38
39
|
e.stopPropagation();
|
39
40
|
if (isPaused)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ControlBar/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EA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M,uBAAN,MAAM,CAAE,WAAW,EAAE,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,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"}
|
@@ -17,7 +17,7 @@ const NoteTooltip = ({ note }) => {
|
|
17
17
|
// }, 5000);
|
18
18
|
// }
|
19
19
|
// }, [currentTime, note.time]);
|
20
|
-
return (_jsx("div", { onClick: handleValueChange, className: "sb-w-1 sb-h-1 sb-rounded-full sb-bg-white sb-absolute sb-z-30", style: { left: `${note.percentage}%` }, onMouseEnter: () => setOpen(true), onMouseLeave: () => setOpen(false), children: _jsx("div", { className: "sb-relative", children: _jsx(Tooltip, { open: open, children: _jsxs("div", { className: "sb-flex sb-flex-col sb-gap-2 sb-items-center", children: [_jsx("p", { children: note.label }), _jsx("p", { className: "sb-p-2 sb-bg-[#303030] sb-bg-opacity-50 sb-rounded-md", children: durationFormater(note.time) })] }) }) }) }));
|
20
|
+
return (_jsx("div", { onClick: handleValueChange, className: "sb-w-1 sb-h-1 sb-rounded-full sb-bg-white sb-absolute sb-z-30", style: { left: `${note === null || note === void 0 ? void 0 : note.percentage}%` }, onMouseEnter: () => setOpen(true), onMouseLeave: () => setOpen(false), children: _jsx("div", { className: "sb-relative", children: _jsx(Tooltip, { open: open, children: _jsxs("div", { className: "sb-flex sb-flex-col sb-gap-2 sb-items-center", children: [_jsx("p", { children: note === null || note === void 0 ? void 0 : note.label }), _jsx("p", { className: "sb-p-2 sb-bg-[#303030] sb-bg-opacity-50 sb-rounded-md", children: durationFormater(note.time) })] }) }) }) }));
|
21
21
|
};
|
22
22
|
export default NoteTooltip;
|
23
23
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/NoteTooltip/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAa,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AAQrF,MAAM,WAAW,GAAG,CAAC,EAAE,IAAI,EAAS,EAAE,EAAE;IACtC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,iCAAiC,EAAE,CAAC;IAEpE,M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,uBAAJ,IAAI,CAAE,UAAU,GAAG,EAAE,EACvC,YAAY,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EACjC,YAAY,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,YAElC,cAAK,SAAS,EAAC,aAAa,YAC1B,KAAC,OAAO,IAAC,IAAI,EAAE,IAAI,YACjB,eAAK,SAAS,EAAC,8CAA8C,aAC3D,sBAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,GAAK,EACpB,YAAG,SAAS,EAAC,uDAAuD,YACjE,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,GAC1B,IACA,GACE,GACN,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
@@ -29,14 +29,14 @@ const NoteTooltip = ({ note }: Props) => {
|
|
29
29
|
<div
|
30
30
|
onClick={handleValueChange}
|
31
31
|
className="sb-w-1 sb-h-1 sb-rounded-full sb-bg-white sb-absolute sb-z-30"
|
32
|
-
style={{ left: `${note
|
32
|
+
style={{ left: `${note?.percentage}%` }}
|
33
33
|
onMouseEnter={() => setOpen(true)}
|
34
34
|
onMouseLeave={() => setOpen(false)}
|
35
35
|
>
|
36
36
|
<div className="sb-relative">
|
37
37
|
<Tooltip open={open}>
|
38
38
|
<div className="sb-flex sb-flex-col sb-gap-2 sb-items-center">
|
39
|
-
<p>{note
|
39
|
+
<p>{note?.label}</p>
|
40
40
|
<p className="sb-p-2 sb-bg-[#303030] sb-bg-opacity-50 sb-rounded-md">
|
41
41
|
{durationFormater(note.time)}
|
42
42
|
</p>
|
@@ -4,7 +4,7 @@ import MenuButton from "../MenuButton";
|
|
4
4
|
import { useSoftBuildersVideoPlayerContext } from "../VideoPlayerComponent/provider";
|
5
5
|
import { CheckedIcon, LeftArrowIcon, SettingsIcon } from "../../images";
|
6
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.label })] }) }));
|
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 })] }) }));
|
8
8
|
};
|
9
9
|
const QualityMenu = ({ width, onClick }) => {
|
10
10
|
const { player } = useSoftBuildersVideoPlayerContext();
|
@@ -21,7 +21,9 @@ const QualityMenu = ({ width, onClick }) => {
|
|
21
21
|
// setCurrentQualitySrc(quality.label);
|
22
22
|
if (qs) {
|
23
23
|
const el = qs === null || qs === void 0 ? void 0 : qs.find((ele) => ele.default);
|
24
|
-
el
|
24
|
+
el
|
25
|
+
? setCurrentQualitySrc(el === null || el === void 0 ? void 0 : el.label)
|
26
|
+
: setCurrentQualitySrc(qs[0].label);
|
25
27
|
}
|
26
28
|
}
|
27
29
|
}, [player]);
|
@@ -34,16 +36,16 @@ const QualityMenu = ({ width, onClick }) => {
|
|
34
36
|
closeMenuFunction();
|
35
37
|
}
|
36
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) => {
|
37
|
-
return (_jsx(QualityOption, { width: width, isSelected: currentQualitySrc === q.label, quality: q, onClick: () => {
|
38
|
-
const source = qualities.find((_q) => q.label == _q.label);
|
39
|
+
return (_jsx(QualityOption, { width: width, isSelected: currentQualitySrc === (q === null || q === void 0 ? void 0 : q.label), quality: q, onClick: () => {
|
40
|
+
const source = qualities.find((_q) => (q === null || q === void 0 ? void 0 : q.label) == (_q === null || _q === void 0 ? void 0 : _q.label));
|
39
41
|
if (source && source.src != currentQualitySrc) {
|
40
42
|
player === null || player === void 0 ? void 0 : player.src(source.src);
|
41
43
|
const currentTime = player === null || player === void 0 ? void 0 : player.currentTime();
|
42
|
-
setCurrentQualitySrc(source.label);
|
44
|
+
setCurrentQualitySrc(source === null || source === void 0 ? void 0 : source.label);
|
43
45
|
player === null || player === void 0 ? void 0 : player.currentTime(currentTime);
|
44
46
|
player === null || player === void 0 ? void 0 : player.play();
|
45
47
|
}
|
46
|
-
} }, `quality-${q.label}-${i}`));
|
48
|
+
} }, `quality-${q === null || q === void 0 ? void 0 : q.label}-${i}`));
|
47
49
|
}) })] }) }), close: (fn) => {
|
48
50
|
setCloseMenuFunction(() => fn);
|
49
51
|
} }));
|
@@ -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":"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N,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"}
|
@@ -4,7 +4,6 @@ import { useSoftBuildersVideoPlayerContext } from "../VideoPlayerComponent/provi
|
|
4
4
|
|
5
5
|
import { SoftBuildersVideoPlayerSource } from "../../types";
|
6
6
|
import { CheckedIcon, LeftArrowIcon, SettingsIcon } from "../../images";
|
7
|
-
import { on } from "video.js/dist/types/utils/events";
|
8
7
|
|
9
8
|
type QualityOptionProps = {
|
10
9
|
isSelected: boolean;
|
@@ -36,7 +35,7 @@ const QualityOption = ({
|
|
36
35
|
)}
|
37
36
|
</div>
|
38
37
|
|
39
|
-
<p className="sb-text-left sb-col-span-9">{quality
|
38
|
+
<p className="sb-text-left sb-col-span-9">{quality?.label}</p>
|
40
39
|
</div>
|
41
40
|
</button>
|
42
41
|
);
|
@@ -80,7 +79,9 @@ const QualityMenu = ({ width, onClick }: QualityMenuProps) => {
|
|
80
79
|
// setCurrentQualitySrc(quality.label);
|
81
80
|
if (qs) {
|
82
81
|
const el = qs?.find((ele) => ele.default);
|
83
|
-
el
|
82
|
+
el
|
83
|
+
? setCurrentQualitySrc(el?.label)
|
84
|
+
: setCurrentQualitySrc(qs[0].label);
|
84
85
|
}
|
85
86
|
}
|
86
87
|
}, [player]);
|
@@ -124,17 +125,17 @@ const QualityMenu = ({ width, onClick }: QualityMenuProps) => {
|
|
124
125
|
return (
|
125
126
|
<QualityOption
|
126
127
|
width={width}
|
127
|
-
key={`quality-${q
|
128
|
-
isSelected={currentQualitySrc === q
|
128
|
+
key={`quality-${q?.label}-${i}`}
|
129
|
+
isSelected={currentQualitySrc === q?.label}
|
129
130
|
quality={q}
|
130
131
|
onClick={() => {
|
131
132
|
const source = qualities.find(
|
132
|
-
(_q) => q
|
133
|
+
(_q) => q?.label == _q?.label
|
133
134
|
);
|
134
135
|
if (source && source.src != currentQualitySrc) {
|
135
136
|
player?.src(source.src);
|
136
137
|
const currentTime = player?.currentTime();
|
137
|
-
setCurrentQualitySrc(source
|
138
|
+
setCurrentQualitySrc(source?.label);
|
138
139
|
player?.currentTime(currentTime);
|
139
140
|
player?.play();
|
140
141
|
}
|
@@ -13,6 +13,7 @@ export type Props<T = any> = {
|
|
13
13
|
bottomRedBar?: boolean;
|
14
14
|
childRef?: React.Ref<HTMLDivElement>;
|
15
15
|
noteButtonClick?: (e: any) => void;
|
16
|
+
videoId?: string;
|
16
17
|
};
|
17
18
|
declare const SoftBuildersVideoPlayer: React.MemoExoticComponent<React.ForwardRefExoticComponent<Props<any> & React.RefAttributes<HTMLDivElement>>>;
|
18
19
|
export default SoftBuildersVideoPlayer;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import { forwardRef, memo,
|
2
|
+
import { forwardRef, memo, useEffect, useState } from "react";
|
3
3
|
import VideoPlayerComponent from "../VideoPlayerComponent";
|
4
4
|
import { convertSRTtoVTT } from "../../utils";
|
5
5
|
import { isEqual } from "lodash";
|
@@ -13,68 +13,44 @@ const DEFAULT_OPTIONS = {
|
|
13
13
|
sources: [],
|
14
14
|
tracks: [],
|
15
15
|
};
|
16
|
-
const Component = forwardRef(({ options, notes, chapters, startTime = 0, handleSaveNoteAction, onPlay, onPause, isFocused = true, disableNote, childRef, bottomRedBar, noteButtonClick,
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
// if (options.height === undefined) options.height = DEFAULT_OPTIONS.height;
|
33
|
-
// if (options.width === undefined) options.width = DEFAULT_OPTIONS.width;
|
34
|
-
// const [tracks, setTracks] = useState<SoftBuildersVideoPlayerTrack[]>([]);
|
35
|
-
// useEffect(() => {}, [isFocused]);
|
36
|
-
// useEffect(() => {
|
37
|
-
// const getTracks = async () => {
|
38
|
-
// const newTracks: SoftBuildersVideoPlayerTrack[] = [];
|
39
|
-
// if (Array.isArray(options?.tracks))
|
40
|
-
// for (const [i, s] of options?.tracks.entries()) {
|
41
|
-
// let src = s.src;
|
42
|
-
// if (s.memeType == "text/srt") {
|
43
|
-
// src = await convertSRTtoVTT(s.src);
|
44
|
-
// }
|
45
|
-
// newTracks.push({
|
46
|
-
// ...s,
|
47
|
-
// src,
|
48
|
-
// });
|
49
|
-
// }
|
50
|
-
// setTracks(newTracks);
|
51
|
-
// };
|
52
|
-
// getTracks();
|
53
|
-
// }, [options?.tracks]);
|
54
|
-
// const id = (Date.now() + Math.random() * 100).toString();
|
16
|
+
const Component = forwardRef(({ options, notes, chapters, startTime = 0, handleSaveNoteAction, onPlay, onPause, isFocused = true, disableNote, childRef, bottomRedBar, noteButtonClick, videoId, }) => {
|
17
|
+
options = Object.assign(Object.assign({}, options), { responsive: true, inactivityTimeout: 0, fullscreen: {
|
18
|
+
navigationUI: "hide",
|
19
|
+
} });
|
20
|
+
if (options.autoplay === undefined)
|
21
|
+
options.autoplay = DEFAULT_OPTIONS.autoplay;
|
22
|
+
if (options.controls === undefined)
|
23
|
+
options.controls = DEFAULT_OPTIONS.controls;
|
24
|
+
if (options.fluid === undefined)
|
25
|
+
options.fluid = DEFAULT_OPTIONS.fluid;
|
26
|
+
if ((options === null || options === void 0 ? void 0 : options.muted) === undefined)
|
27
|
+
options.muted = DEFAULT_OPTIONS === null || DEFAULT_OPTIONS === void 0 ? void 0 : DEFAULT_OPTIONS.muted;
|
28
|
+
if (options.height === undefined)
|
29
|
+
options.height = DEFAULT_OPTIONS.height;
|
30
|
+
if (options.width === undefined)
|
31
|
+
options.width = DEFAULT_OPTIONS.width;
|
55
32
|
const [tracks, setTracks] = useState([]);
|
56
|
-
|
57
|
-
const newTracks = [];
|
58
|
-
if (Array.isArray(mergedOptions.tracks)) {
|
59
|
-
for (const s of mergedOptions.tracks) {
|
60
|
-
let src = s.src;
|
61
|
-
if (s.memeType === "text/srt") {
|
62
|
-
src = await convertSRTtoVTT(s.src);
|
63
|
-
}
|
64
|
-
newTracks.push(Object.assign(Object.assign({}, s), { src }));
|
65
|
-
}
|
66
|
-
}
|
67
|
-
setTracks(newTracks);
|
68
|
-
}, [mergedOptions.tracks]);
|
33
|
+
useEffect(() => { }, [isFocused]);
|
69
34
|
useEffect(() => {
|
35
|
+
const getTracks = async () => {
|
36
|
+
const newTracks = [];
|
37
|
+
if (Array.isArray(options === null || options === void 0 ? void 0 : options.tracks))
|
38
|
+
for (const [i, s] of options === null || options === void 0 ? void 0 : options.tracks.entries()) {
|
39
|
+
let src = s.src;
|
40
|
+
if (s.memeType == "text/srt") {
|
41
|
+
src = await convertSRTtoVTT(s.src);
|
42
|
+
}
|
43
|
+
newTracks.push(Object.assign(Object.assign({}, s), { src }));
|
44
|
+
}
|
45
|
+
setTracks(newTracks);
|
46
|
+
};
|
70
47
|
getTracks();
|
71
|
-
}, [
|
72
|
-
const id =
|
73
|
-
|
48
|
+
}, [options === null || options === void 0 ? void 0 : options.tracks]);
|
49
|
+
const id = (Date.now() + Math.random() * 100).toString();
|
50
|
+
console.log("id: ", id);
|
51
|
+
return (_jsx(VideoPlayerComponent, { id: "videoID", 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 }));
|
74
52
|
});
|
75
53
|
const SoftBuildersVideoPlayer = memo(Component, (prevProps, nextProps) => {
|
76
|
-
console.log(isEqual(prevProps.options, nextProps.options));
|
77
|
-
console.log(nextProps.notes, prevProps.notes);
|
78
54
|
return (isEqual(prevProps.options, nextProps.options) &&
|
79
55
|
prevProps.notes === nextProps.notes &&
|
80
56
|
prevProps.chapters === nextProps.chapters &&
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/SoftBuildersVideoPlayer/index.tsx"],"names":[],"mappings":";AAAA,OAAc,
|
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;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,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;AAkBF,MAAM,SAAS,GAAG,UAAU,CAC1B,CAAC,EACC,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,EACf,OAAO,GACI,EAAE,EAAE;I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KAAK,KAAK,SAAS,CAAC,KAAK;QACnC,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ;QACzC,SAAS,CAAC,SAAS,KAAK,SAAS,CAAC,SAAS,CAC5C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
|
@@ -1,11 +1,4 @@
|
|
1
|
-
import React, {
|
2
|
-
forwardRef,
|
3
|
-
memo,
|
4
|
-
useCallback,
|
5
|
-
useEffect,
|
6
|
-
useMemo,
|
7
|
-
useState,
|
8
|
-
} from "react";
|
1
|
+
import React, { forwardRef, memo, useEffect, useState } from "react";
|
9
2
|
import VideoPlayerComponent from "../VideoPlayerComponent";
|
10
3
|
import {
|
11
4
|
SoftBuildersVideoPlayerChapter,
|
@@ -39,109 +32,76 @@ export type Props<T = any> = {
|
|
39
32
|
bottomRedBar?: boolean;
|
40
33
|
childRef?: React.Ref<HTMLDivElement>;
|
41
34
|
noteButtonClick?: (e: any) => void;
|
35
|
+
videoId?: string;
|
42
36
|
};
|
43
37
|
|
44
38
|
const Component = forwardRef<HTMLDivElement, Props<any>>(
|
45
|
-
(
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
fullscreen: { navigationUI: "hide" },
|
78
|
-
}),
|
79
|
-
[options]
|
80
|
-
);
|
81
|
-
|
82
|
-
// if (options.autoplay === undefined)
|
83
|
-
// options.autoplay = DEFAULT_OPTIONS.autoplay;
|
84
|
-
// if (options.controls === undefined)
|
85
|
-
// options.controls = DEFAULT_OPTIONS.controls;
|
86
|
-
// if (options.fluid === undefined) options.fluid = DEFAULT_OPTIONS.fluid;
|
87
|
-
// if (options?.muted === undefined) options.muted = DEFAULT_OPTIONS?.muted;
|
88
|
-
// if (options.height === undefined) options.height = DEFAULT_OPTIONS.height;
|
89
|
-
// if (options.width === undefined) options.width = DEFAULT_OPTIONS.width;
|
90
|
-
|
91
|
-
// const [tracks, setTracks] = useState<SoftBuildersVideoPlayerTrack[]>([]);
|
92
|
-
// useEffect(() => {}, [isFocused]);
|
93
|
-
// useEffect(() => {
|
94
|
-
// const getTracks = async () => {
|
95
|
-
// const newTracks: SoftBuildersVideoPlayerTrack[] = [];
|
96
|
-
// if (Array.isArray(options?.tracks))
|
97
|
-
// for (const [i, s] of options?.tracks.entries()) {
|
98
|
-
// let src = s.src;
|
99
|
-
|
100
|
-
// if (s.memeType == "text/srt") {
|
101
|
-
// src = await convertSRTtoVTT(s.src);
|
102
|
-
// }
|
103
|
-
|
104
|
-
// newTracks.push({
|
105
|
-
// ...s,
|
106
|
-
// src,
|
107
|
-
// });
|
108
|
-
// }
|
109
|
-
|
110
|
-
// setTracks(newTracks);
|
111
|
-
// };
|
112
|
-
|
113
|
-
// getTracks();
|
114
|
-
// }, [options?.tracks]);
|
115
|
-
|
116
|
-
// const id = (Date.now() + Math.random() * 100).toString();
|
39
|
+
({
|
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
|
+
videoId,
|
53
|
+
}: Props<any>) => {
|
54
|
+
options = {
|
55
|
+
...options,
|
56
|
+
responsive: true,
|
57
|
+
inactivityTimeout: 0,
|
58
|
+
fullscreen: {
|
59
|
+
navigationUI: "hide",
|
60
|
+
},
|
61
|
+
} as any;
|
62
|
+
|
63
|
+
if (options.autoplay === undefined)
|
64
|
+
options.autoplay = DEFAULT_OPTIONS.autoplay;
|
65
|
+
if (options.controls === undefined)
|
66
|
+
options.controls = DEFAULT_OPTIONS.controls;
|
67
|
+
if (options.fluid === undefined) options.fluid = DEFAULT_OPTIONS.fluid;
|
68
|
+
if (options?.muted === undefined) options.muted = DEFAULT_OPTIONS?.muted;
|
69
|
+
if (options.height === undefined) options.height = DEFAULT_OPTIONS.height;
|
70
|
+
if (options.width === undefined) options.width = DEFAULT_OPTIONS.width;
|
117
71
|
|
118
72
|
const [tracks, setTracks] = useState<SoftBuildersVideoPlayerTrack[]>([]);
|
119
|
-
|
120
|
-
|
121
|
-
const
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
73
|
+
useEffect(() => {}, [isFocused]);
|
74
|
+
useEffect(() => {
|
75
|
+
const getTracks = async () => {
|
76
|
+
const newTracks: SoftBuildersVideoPlayerTrack[] = [];
|
77
|
+
if (Array.isArray(options?.tracks))
|
78
|
+
for (const [i, s] of options?.tracks.entries()) {
|
79
|
+
let src = s.src;
|
80
|
+
|
81
|
+
if (s.memeType == "text/srt") {
|
82
|
+
src = await convertSRTtoVTT(s.src);
|
83
|
+
}
|
84
|
+
|
85
|
+
newTracks.push({
|
86
|
+
...s,
|
87
|
+
src,
|
88
|
+
});
|
127
89
|
}
|
128
|
-
newTracks.push({ ...s, src });
|
129
|
-
}
|
130
|
-
}
|
131
|
-
setTracks(newTracks);
|
132
|
-
}, [mergedOptions.tracks]);
|
133
90
|
|
134
|
-
|
91
|
+
setTracks(newTracks);
|
92
|
+
};
|
93
|
+
|
135
94
|
getTracks();
|
136
|
-
}, [
|
95
|
+
}, [options?.tracks]);
|
137
96
|
|
138
|
-
const id =
|
97
|
+
const id = (Date.now() + Math.random() * 100).toString();
|
98
|
+
console.log("id: ", id);
|
139
99
|
|
140
100
|
return (
|
141
101
|
<VideoPlayerComponent
|
142
|
-
id={
|
102
|
+
id={"videoID"}
|
143
103
|
chapters={chapters}
|
144
|
-
options={{ ...
|
104
|
+
options={{ ...options, tracks }}
|
145
105
|
notes={notes}
|
146
106
|
poster=""
|
147
107
|
startTime={startTime}
|
@@ -158,9 +118,6 @@ const Component = forwardRef<HTMLDivElement, Props<any>>(
|
|
158
118
|
);
|
159
119
|
|
160
120
|
const SoftBuildersVideoPlayer = memo(Component, (prevProps, nextProps) => {
|
161
|
-
console.log(isEqual(prevProps.options, nextProps.options));
|
162
|
-
console.log(nextProps.notes, prevProps.notes);
|
163
|
-
|
164
121
|
return (
|
165
122
|
isEqual(prevProps.options, nextProps.options) &&
|
166
123
|
prevProps.notes === nextProps.notes &&
|
@@ -15,7 +15,7 @@ const SubtitleMenu = ({ width, onClick, onMouseEnter, onMouseLeave, }) => {
|
|
15
15
|
const [subtitles, setSubtitles] = useState([]);
|
16
16
|
const handleSelectSubtitle = (textTrack) => {
|
17
17
|
const newSubtitles = subtitles.map((s) => {
|
18
|
-
if (s.label === textTrack.label) {
|
18
|
+
if ((s === null || s === void 0 ? void 0 : s.label) === (textTrack === null || textTrack === void 0 ? void 0 : textTrack.label)) {
|
19
19
|
s.mode = "showing";
|
20
20
|
}
|
21
21
|
else {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/SubtitleMenu/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;AACrF,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAOnE,MAAM,cAAc,GAAG,CAAC,EACtB,UAAU,EACV,QAAQ,EACR,OAAO,GACa,EAAE,EAAE;IACxB,OAAO,CACL,iBACE,SAAS,EAAC,iCAAiC,EAC3C,OAAO,EAAE,CAAC,CAAM,EAAE,EAAE;YAClB,CAAC,CAA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,oBAAoB,CAAC,CAAC,CAAC,CAAC;gCAC1B,CAAC,IALI,YAAY,CAAC,CAAC,KAAK,IAAI,CAAC,EAAE,CAM/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,YAAY,CAAC"}
|
@@ -55,7 +55,7 @@ const SubtitleMenu = ({
|
|
55
55
|
|
56
56
|
const handleSelectSubtitle = (textTrack: TextTrack) => {
|
57
57
|
const newSubtitles = subtitles.map((s) => {
|
58
|
-
if (s
|
58
|
+
if (s?.label === textTrack?.label) {
|
59
59
|
s.mode = "showing";
|
60
60
|
} else {
|
61
61
|
s.mode = "disabled";
|
@@ -35,6 +35,12 @@ const TimeSlider = ({ chapters }) => {
|
|
35
35
|
// Cleanup function to clear the interval
|
36
36
|
return () => clearInterval(intervalId);
|
37
37
|
}, [player, duration]);
|
38
|
+
// useLayoutEffect(() => {
|
39
|
+
// const currentTime = player?.currentTime() || 0;
|
40
|
+
// const time = (currentTime * DEFERENCE) / duration;
|
41
|
+
// setTimeSlider(time);
|
42
|
+
// console.log("currentTime: ", time);
|
43
|
+
// }, []);
|
38
44
|
const [maskCuttes, setMaskCuttes] = useState("");
|
39
45
|
useEffect(() => {
|
40
46
|
const arr = ["black 0%"];
|
@@ -53,9 +59,9 @@ const TimeSlider = ({ chapters }) => {
|
|
53
59
|
arr.push(`black 100%`);
|
54
60
|
setMaskCuttes(arr.toString());
|
55
61
|
}, [chapters, duration]);
|
56
|
-
return (_jsxs("div", { className:
|
62
|
+
return (_jsxs("div", { className: " sb-w-full sb-h-2 sb-flex sb-items-center sb-justify-center", children: [_jsx("div", { className: "sb-absolute sb-top-0 sb-left-0 sb-w-full sb-z-10", children: _jsx(Slider, { value: timeSlider, handleValueChange: handleValueChange, handleSliderClick: handleSliderClick, min: MIN, max: MAX, style: {
|
57
63
|
background: "transparent",
|
58
|
-
} }) }), _jsx("div", { className:
|
64
|
+
} }) }), _jsx("div", { className: "sb-absolute sb-top-0 sb-left-0 sb-w-full sb-h-2 sb-bg-slate-400 sb-rounded-md", style: {
|
59
65
|
background: `
|
60
66
|
linear-gradient(to right,
|
61
67
|
#f97316 0%,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/TimeSlider/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/TimeSlider/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAmB,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AAIrF,MAAM,GAAG,GAAG,CAAC,EACX,GAAG,GAAG,GAAG,CAAC;AACZ,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;AACtC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAMjC,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAS,EAAE,EAAE;IACzC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEhD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,0BAA0B,EAAE,GACpD,iCAAiC,EAAE,CAAC;IAEtC,MAAM,iBAAiB,GAAG,CAAC,CAAsC,EAAE,EAAE;QACnE,MAAM,aAAa,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7C,aAAa,CAAC,aAAa,CAAC,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,aAAa,CAAC,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