softbuilders-react-video-player 1.1.29 → 1.1.31
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/ChaptersPanal/index.d.ts +1 -1
- package/dist/components/ChaptersPanal/index.js +2 -2
- package/dist/components/ChaptersPanal/index.js.map +1 -1
- package/dist/components/ChaptersPanal/index.tsx +3 -3
- package/dist/components/ControlBar/index.d.ts +2 -2
- package/dist/components/ControlBar/index.tsx +2 -2
- package/dist/components/NotesPanal/index.d.ts +1 -1
- package/dist/components/NotesPanal/index.js +2 -2
- package/dist/components/NotesPanal/index.js.map +1 -1
- package/dist/components/NotesPanal/index.tsx +3 -3
- package/dist/components/SoftBuildersVideoPlayer/index.d.ts +2 -2
- package/dist/components/SoftBuildersVideoPlayer/index.js +3 -3
- package/dist/components/SoftBuildersVideoPlayer/index.js.map +1 -1
- package/dist/components/SoftBuildersVideoPlayer/index.tsx +5 -5
- package/dist/components/TimeSlider/index.d.ts +1 -1
- package/dist/components/TimeSlider/index.js +1 -1
- package/dist/components/TimeSlider/index.js.map +1 -1
- package/dist/components/TimeSlider/index.tsx +2 -2
- package/dist/components/TimeSliderContainer/index.d.ts +2 -2
- package/dist/components/TimeSliderContainer/index.tsx +2 -2
- package/dist/components/VideoPlayerComponent/index.d.ts +2 -2
- package/dist/components/VideoPlayerComponent/index.js +2 -0
- package/dist/components/VideoPlayerComponent/index.js.map +1 -1
- package/dist/components/VideoPlayerComponent/index.tsx +7 -5
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +10 -8
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
import { SoftBuildersVideoPlayerChapter } from "../../types";
|
2
2
|
type Props = {
|
3
|
-
chapters
|
3
|
+
chapters?: SoftBuildersVideoPlayerChapter[];
|
4
4
|
};
|
5
5
|
declare const ChaptersPanal: ({ chapters }: Props) => import("react/jsx-runtime").JSX.Element;
|
6
6
|
export default ChaptersPanal;
|
@@ -6,13 +6,13 @@ const ChaptersPanal = ({ chapters }) => {
|
|
6
6
|
const [cs, setCs] = useState([]);
|
7
7
|
const { duration } = useSoftBuildersVideoPlayerContext();
|
8
8
|
useEffect(() => {
|
9
|
-
const newCs = chapters.map((c) => {
|
9
|
+
const newCs = chapters === null || chapters === void 0 ? void 0 : chapters.map((c) => {
|
10
10
|
const startPercentage = Math.floor((c.startTime * 100) / duration);
|
11
11
|
const endPercentage = Math.floor((c.endTime * 100) / duration);
|
12
12
|
return Object.assign(Object.assign({}, c), { startPercentage,
|
13
13
|
endPercentage });
|
14
14
|
});
|
15
|
-
setCs(newCs);
|
15
|
+
newCs && setCs(newCs);
|
16
16
|
}, [chapters, duration]);
|
17
17
|
return (_jsx("div", { id: "chapters-panal", className: "sb-w-full sb-h-full sb-relative ", children: cs.map((c, i) => (_jsx(ChapterTooltip, { chapter: c }, `chapter-${i}-${c.startTime}`))) }));
|
18
18
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ChaptersPanal/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AASrF,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAS,EAAE,EAAE;IAC5C,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,QAAQ,CAAY,EAAE,CAAC,CAAC;IAC5C,MAAM,EAAE,QAAQ,EAAE,GAAG,iCAAiC,EAAE,CAAC;IAEzD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,QAAQ,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ChaptersPanal/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,cAAc,MAA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= {
|
12
|
-
chapters
|
12
|
+
chapters?: SoftBuildersVideoPlayerChapter[];
|
13
13
|
};
|
14
14
|
const ChaptersPanal = ({ chapters }: Props) => {
|
15
15
|
const [cs, setCs] = useState<Chapter[]>([]);
|
16
16
|
const { duration } = useSoftBuildersVideoPlayerContext();
|
17
17
|
|
18
18
|
useEffect(() => {
|
19
|
-
const newCs = chapters
|
19
|
+
const newCs = chapters?.map((c) => {
|
20
20
|
const startPercentage = Math.floor((c.startTime * 100) / duration);
|
21
21
|
const endPercentage = Math.floor((c.endTime * 100) / duration);
|
22
22
|
return {
|
@@ -25,7 +25,7 @@ const ChaptersPanal = ({ chapters }: Props) => {
|
|
25
25
|
endPercentage,
|
26
26
|
};
|
27
27
|
});
|
28
|
-
setCs(newCs);
|
28
|
+
newCs && setCs(newCs);
|
29
29
|
}, [chapters, duration]);
|
30
30
|
|
31
31
|
return (
|
@@ -6,8 +6,8 @@ type Props<T> = {
|
|
6
6
|
isPaused: boolean;
|
7
7
|
setIsPaused: React.Dispatch<React.SetStateAction<boolean>>;
|
8
8
|
duration: number;
|
9
|
-
notes
|
10
|
-
chapters
|
9
|
+
notes?: SoftBuildersVideoPlayerNote[];
|
10
|
+
chapters?: SoftBuildersVideoPlayerChapter[];
|
11
11
|
seekStep?: number;
|
12
12
|
id?: string;
|
13
13
|
handleSaveNoteAction?: (time: number, note: string) => Promise<T>;
|
@@ -27,8 +27,8 @@ type Props<T> = {
|
|
27
27
|
isPaused: boolean;
|
28
28
|
setIsPaused: React.Dispatch<React.SetStateAction<boolean>>;
|
29
29
|
duration: number;
|
30
|
-
notes
|
31
|
-
chapters
|
30
|
+
notes?: SoftBuildersVideoPlayerNote[];
|
31
|
+
chapters?: SoftBuildersVideoPlayerChapter[];
|
32
32
|
seekStep?: number;
|
33
33
|
id?: string;
|
34
34
|
handleSaveNoteAction?: (time: number, note: string) => Promise<T>;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { SoftBuildersVideoPlayerNote } from "../../types";
|
2
2
|
type Props = {
|
3
|
-
notes
|
3
|
+
notes?: SoftBuildersVideoPlayerNote[];
|
4
4
|
};
|
5
5
|
declare const NotesPanal: ({ notes }: Props) => import("react/jsx-runtime").JSX.Element;
|
6
6
|
export default NotesPanal;
|
@@ -6,11 +6,11 @@ const NotesPanal = ({ notes }) => {
|
|
6
6
|
const [ns, setNs] = useState([]);
|
7
7
|
const { duration } = useSoftBuildersVideoPlayerContext();
|
8
8
|
useEffect(() => {
|
9
|
-
const newNs = notes.map((n) => {
|
9
|
+
const newNs = notes === null || notes === void 0 ? void 0 : notes.map((n) => {
|
10
10
|
const percentage = Math.floor((n.time * 100) / duration);
|
11
11
|
return Object.assign(Object.assign({}, n), { percentage });
|
12
12
|
});
|
13
|
-
setNs(newNs);
|
13
|
+
newNs && setNs(newNs);
|
14
14
|
}, [notes, duration]);
|
15
15
|
return (_jsx("div", { id: "notes-panal", className: "sb-w-full sb-h-full sb-relative ", children: ns.map((n, i) => (_jsx(NoteTooltip, { note: n }, `note-${i}-${n.time}`))) }));
|
16
16
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/NotesPanal/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AAOrF,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAS,EAAE,EAAE;IACtC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAC;IAEzC,MAAM,EAAE,QAAQ,EAAE,GAAG,iCAAiC,EAAE,CAAC;IAEzD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,KAAK,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/NotesPanal/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AAOrF,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAS,EAAE,EAAE;IACtC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAC;IAEzC,MAAM,EAAE,QAAQ,EAAE,GAAG,iCAAiC,EAAE,CAAC;IAEzD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YAC7B,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC;YACzD,uCACK,CAAC,KACJ,UAAU,IACV;QACJ,CAAC,CAAC,CAAC;QACH,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;IACtB,OAAO,CACL,cAAK,EAAE,EAAC,aAAa,EAAC,SAAS,EAAC,kCAAkC,YAC/D,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAChB,KAAC,WAAW,IAA6B,IAAI,EAAE,CAAC,IAA9B,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAa,CACrD,CAAC,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
@@ -5,7 +5,7 @@ import { SoftBuildersVideoPlayerNote } from "../../types";
|
|
5
5
|
|
6
6
|
type Note = SoftBuildersVideoPlayerNote & { percentage: number };
|
7
7
|
type Props = {
|
8
|
-
notes
|
8
|
+
notes?: SoftBuildersVideoPlayerNote[];
|
9
9
|
};
|
10
10
|
const NotesPanal = ({ notes }: Props) => {
|
11
11
|
const [ns, setNs] = useState<Note[]>([]);
|
@@ -13,14 +13,14 @@ const NotesPanal = ({ notes }: Props) => {
|
|
13
13
|
const { duration } = useSoftBuildersVideoPlayerContext();
|
14
14
|
|
15
15
|
useEffect(() => {
|
16
|
-
const newNs = notes
|
16
|
+
const newNs = notes?.map((n) => {
|
17
17
|
const percentage = Math.floor((n.time * 100) / duration);
|
18
18
|
return {
|
19
19
|
...n,
|
20
20
|
percentage,
|
21
21
|
};
|
22
22
|
});
|
23
|
-
setNs(newNs);
|
23
|
+
newNs && setNs(newNs);
|
24
24
|
}, [notes, duration]);
|
25
25
|
return (
|
26
26
|
<div id="notes-panal" className="sb-w-full sb-h-full sb-relative ">
|
@@ -2,8 +2,8 @@ import React from "react";
|
|
2
2
|
import { SoftBuildersVideoPlayerChapter, SoftBuildersVideoPlayerNote, SoftBuildersVideoPlayerOptions } from "../../types";
|
3
3
|
export type Props<T = any> = {
|
4
4
|
options: SoftBuildersVideoPlayerOptions;
|
5
|
-
notes
|
6
|
-
chapters
|
5
|
+
notes?: SoftBuildersVideoPlayerNote[];
|
6
|
+
chapters?: SoftBuildersVideoPlayerChapter[];
|
7
7
|
startTime?: number;
|
8
8
|
handleSaveNoteAction?: (time: number, note: string) => Promise<T>;
|
9
9
|
onPlay?: (time: number) => void;
|
@@ -35,8 +35,8 @@ const Component = ({ options, notes, chapters, startTime = 0, handleSaveNoteActi
|
|
35
35
|
useEffect(() => {
|
36
36
|
const getTracks = async () => {
|
37
37
|
const newTracks = [];
|
38
|
-
if (Array.isArray(options.tracks))
|
39
|
-
for (const [i, s] of options.tracks.entries()) {
|
38
|
+
if (Array.isArray(options === null || options === void 0 ? void 0 : options.tracks))
|
39
|
+
for (const [i, s] of options === null || options === void 0 ? void 0 : options.tracks.entries()) {
|
40
40
|
let src = s.src;
|
41
41
|
if (s.memeType == "text/srt") {
|
42
42
|
src = await convertSRTtoVTT(s.src);
|
@@ -46,7 +46,7 @@ const Component = ({ options, notes, chapters, startTime = 0, handleSaveNoteActi
|
|
46
46
|
setTracks(newTracks);
|
47
47
|
};
|
48
48
|
getTracks();
|
49
|
-
}, [options.tracks]);
|
49
|
+
}, [options === null || options === void 0 ? void 0 : options.tracks]);
|
50
50
|
const id = (Date.now() + Math.random() * 100).toString();
|
51
51
|
return (_jsx(VideoPlayerComponent, { id: id, chapters: chapters, options: Object.assign(Object.assign({}, options), { tracks }), notes: notes, poster: "", startTime: startTime, handleSaveNoteAction: handleSaveNoteAction, onPause: onPause, onPlay: onPlay }));
|
52
52
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/SoftBuildersVideoPlayer/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,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,IAAI;IACX,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;IACV,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,EAAE;CACX,CAAC;AAaF,MAAM,SAAS,GAAG,CAAK,EACrB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,SAAS,GAAG,CAAC,EACb,oBAAoB,EACpB,MAAM,EACN,OAAO,EACP,SAAS,GAAG,IAAI,GACP,EAAE,EAAE;IACb,OAAO,GAAG,gCACL,OAAO,KACV,UAAU,EAAE,IAAI,EAChB,iBAAiB,EAAE,CAAC,EACpB,UAAU,EAAE;YACV,YAAY,EAAE,MAAM;SACrB,GACK,CAAC;IAET,I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;AACJ,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;IACvE,OAAO,CACL,SAAS,CAAC,OAAO,KAAK,SAAS,CAAC,OAAO;QACvC,SAAS,CAAC,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"}
|
@@ -21,8 +21,8 @@ const DEFAULT_OPTIONS: SoftBuildersVideoPlayerOptions = {
|
|
21
21
|
|
22
22
|
export type Props<T = any> = {
|
23
23
|
options: SoftBuildersVideoPlayerOptions;
|
24
|
-
notes
|
25
|
-
chapters
|
24
|
+
notes?: SoftBuildersVideoPlayerNote[];
|
25
|
+
chapters?: SoftBuildersVideoPlayerChapter[];
|
26
26
|
startTime?: number;
|
27
27
|
handleSaveNoteAction?: (time: number, note: string) => Promise<T>;
|
28
28
|
onPlay?: (time: number) => void;
|
@@ -65,8 +65,8 @@ const Component = <T,>({
|
|
65
65
|
useEffect(() => {
|
66
66
|
const getTracks = async () => {
|
67
67
|
const newTracks: SoftBuildersVideoPlayerTrack[] = [];
|
68
|
-
if (Array.isArray(options
|
69
|
-
for (const [i, s] of options
|
68
|
+
if (Array.isArray(options?.tracks))
|
69
|
+
for (const [i, s] of options?.tracks.entries()) {
|
70
70
|
let src = s.src;
|
71
71
|
|
72
72
|
if (s.memeType == "text/srt") {
|
@@ -83,7 +83,7 @@ const Component = <T,>({
|
|
83
83
|
};
|
84
84
|
|
85
85
|
getTracks();
|
86
|
-
}, [options
|
86
|
+
}, [options?.tracks]);
|
87
87
|
|
88
88
|
const id = (Date.now() + Math.random() * 100).toString();
|
89
89
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { SoftBuildersVideoPlayerChapter } from "../../types";
|
2
2
|
type Props = {
|
3
|
-
chapters
|
3
|
+
chapters?: SoftBuildersVideoPlayerChapter[];
|
4
4
|
};
|
5
5
|
declare const TimeSlider: ({ chapters }: Props) => import("react/jsx-runtime").JSX.Element;
|
6
6
|
export default TimeSlider;
|
@@ -26,7 +26,7 @@ const TimeSlider = ({ chapters }) => {
|
|
26
26
|
const [maskCuttes, setMaskCuttes] = useState("");
|
27
27
|
useEffect(() => {
|
28
28
|
const arr = ["black 0%"];
|
29
|
-
chapters.forEach((c) => {
|
29
|
+
chapters === null || chapters === void 0 ? void 0 : chapters.forEach((c) => {
|
30
30
|
const startPercentage = Math.floor((c.startTime * 100) / duration);
|
31
31
|
const endPercentage = Math.floor((c.endTime * 100) / duration);
|
32
32
|
arr.push(`black ${startPercentage}%`);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/TimeSlider/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AAGrF,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,MA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AAG,EACR,GAAG,EAAE,GAAG,EACR,KAAK,EAAE;wBACL,UAAU,EAAE,aAAa;qBAC1B,GACD,GACE,EAEN,cACE,SAAS,EAAC,+EAA+E,EACzF,KAAK,EAAE;oBACL,UAAU,EAAE;;;sBAGA,UAAU;wBACR,UAAU;wBACV,0BAA0B;wBAC1B,UAAU;;;SAGzB;oBACC,SAAS,EAAE;;cAEP,UAAU;;SAEf;oBACC,QAAQ,EAAE,WAAW;oBACrB,UAAU,EAAE,WAAW;iBACxB,GACI,IACH,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
@@ -9,7 +9,7 @@ const DEFERENCE = Math.abs(MAX - MIN);
|
|
9
9
|
const BAR_PERCENTAGE_WIDTH = 0.5;
|
10
10
|
|
11
11
|
type Props = {
|
12
|
-
chapters
|
12
|
+
chapters?: SoftBuildersVideoPlayerChapter[];
|
13
13
|
};
|
14
14
|
|
15
15
|
const TimeSlider = ({ chapters }: Props) => {
|
@@ -44,7 +44,7 @@ const TimeSlider = ({ chapters }: Props) => {
|
|
44
44
|
|
45
45
|
useEffect(() => {
|
46
46
|
const arr: string[] = ["black 0%"];
|
47
|
-
chapters
|
47
|
+
chapters?.forEach((c) => {
|
48
48
|
const startPercentage = Math.floor((c.startTime * 100) / duration);
|
49
49
|
const endPercentage = Math.floor((c.endTime * 100) / duration);
|
50
50
|
arr.push(`black ${startPercentage}%`);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { SoftBuildersVideoPlayerChapter, SoftBuildersVideoPlayerNote } from "../../types";
|
2
2
|
type Props = {
|
3
|
-
notes
|
4
|
-
chapters
|
3
|
+
notes?: SoftBuildersVideoPlayerNote[];
|
4
|
+
chapters?: SoftBuildersVideoPlayerChapter[];
|
5
5
|
};
|
6
6
|
declare const TimeSliderContainer: ({ notes, chapters }: Props) => import("react/jsx-runtime").JSX.Element;
|
7
7
|
export default TimeSliderContainer;
|
@@ -8,8 +8,8 @@ import {
|
|
8
8
|
} from "../../types";
|
9
9
|
|
10
10
|
type Props = {
|
11
|
-
notes
|
12
|
-
chapters
|
11
|
+
notes?: SoftBuildersVideoPlayerNote[];
|
12
|
+
chapters?: SoftBuildersVideoPlayerChapter[];
|
13
13
|
};
|
14
14
|
const TimeSliderContainer = ({ notes, chapters }: Props) => {
|
15
15
|
return (
|
@@ -5,8 +5,8 @@ import "../../styles/tailwind.css";
|
|
5
5
|
export type Props<T = any> = {
|
6
6
|
id: string;
|
7
7
|
options: SoftBuildersVideoPlayerOptions;
|
8
|
-
notes
|
9
|
-
chapters
|
8
|
+
notes?: SoftBuildersVideoPlayerNote[];
|
9
|
+
chapters?: SoftBuildersVideoPlayerChapter[];
|
10
10
|
startTime?: number;
|
11
11
|
poster?: string;
|
12
12
|
handleSaveNoteAction?: (time: number, note: string) => Promise<T>;
|
@@ -12,6 +12,7 @@ let bigPlayButtonRoot = {};
|
|
12
12
|
const renderBigPlayButton = (id, player, isPaused, setIsPaused) => {
|
13
13
|
const container = document.getElementById(`video-container-${id}`);
|
14
14
|
if (container) {
|
15
|
+
container.style.height = "100%";
|
15
16
|
const element = container.querySelector(".vjs-big-play-button");
|
16
17
|
if (element) {
|
17
18
|
if (!bigPlayButtonRoot[id]) {
|
@@ -25,6 +26,7 @@ let controlBarRoot = {};
|
|
25
26
|
const renderControlBar = (id, player, isPaused, setIsPaused, duration, notes, chapters, seekStep = 5, handleSaveNoteAction, opacity = "0", handleControlDisplayTimer = () => { }, bgColor = "transparent") => {
|
26
27
|
const container = document.getElementById(`video-container-${id}`);
|
27
28
|
if (container) {
|
29
|
+
container.style.height = "100%";
|
28
30
|
const element = container.querySelector(".vjs-control-bar");
|
29
31
|
if (element) {
|
30
32
|
if (!controlBarRoot[id]) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/VideoPlayerComponent/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,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CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,EACD;YACE,SAAS,EAAE,GAAG,EAAE,2EAA2E;SAC5F,CACF,CAAC;QAEF,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;YACtB,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,gCAAgC;QACvE,CAAC;QAED,OAAO,GAAG,EAAE;YACV,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;gBACtB,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,oDAAoD;YAC5F,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,cACE,GAAG,EAAE,SAAS,EACd,EAAE,EAAE,mBAAmB,EAAE,EAAE,EAC3B,SAAS,EAAC,mEAAmE,YAE7E,cACE,SAAS,EAAC,6CAA6C,qCAIvD,cACE,OAAO,EAAE,iBAAiB,EAC1B,GAAG,EAAE,QAAQ,EACb,SAAS,EAAC,qBAAqB,GAC/B,GACE,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,oBAAoB,CAAC"}
|
@@ -13,7 +13,6 @@ import "./style/style.css";
|
|
13
13
|
import "../../styles/tailwind.css";
|
14
14
|
import { SoftBuildersVideoPlayerProvider } from "./provider";
|
15
15
|
import BigPlayButton from "../BigPlayButton";
|
16
|
-
import { set } from "video.js/dist/types/tech/middleware";
|
17
16
|
let bigPlayButtonRoot: {
|
18
17
|
[key: string]: ReactDOM.Root | undefined;
|
19
18
|
} = {};
|
@@ -24,7 +23,9 @@ const renderBigPlayButton = (
|
|
24
23
|
setIsPaused: React.Dispatch<React.SetStateAction<boolean>>
|
25
24
|
) => {
|
26
25
|
const container = document.getElementById(`video-container-${id}`);
|
26
|
+
|
27
27
|
if (container) {
|
28
|
+
container.style.height = "100%";
|
28
29
|
const element: any = container.querySelector(".vjs-big-play-button");
|
29
30
|
if (element) {
|
30
31
|
if (!bigPlayButtonRoot[id]) {
|
@@ -49,8 +50,8 @@ const renderControlBar = <T,>(
|
|
49
50
|
isPaused: boolean,
|
50
51
|
setIsPaused: React.Dispatch<React.SetStateAction<boolean>>,
|
51
52
|
duration: number,
|
52
|
-
notes
|
53
|
-
chapters
|
53
|
+
notes?: SoftBuildersVideoPlayerNote[],
|
54
|
+
chapters?: SoftBuildersVideoPlayerChapter[],
|
54
55
|
seekStep: number = 5,
|
55
56
|
handleSaveNoteAction?: (time: number, note: string) => Promise<T>,
|
56
57
|
opacity: string = "0",
|
@@ -60,6 +61,7 @@ const renderControlBar = <T,>(
|
|
60
61
|
) => {
|
61
62
|
const container = document.getElementById(`video-container-${id}`);
|
62
63
|
if (container) {
|
64
|
+
container.style.height = "100%";
|
63
65
|
const element: any = container.querySelector(".vjs-control-bar");
|
64
66
|
if (element) {
|
65
67
|
if (!controlBarRoot[id]) {
|
@@ -92,8 +94,8 @@ const renderControlBar = <T,>(
|
|
92
94
|
export type Props<T = any> = {
|
93
95
|
id: string;
|
94
96
|
options: SoftBuildersVideoPlayerOptions;
|
95
|
-
notes
|
96
|
-
chapters
|
97
|
+
notes?: SoftBuildersVideoPlayerNote[];
|
98
|
+
chapters?: SoftBuildersVideoPlayerChapter[];
|
97
99
|
startTime?: number;
|
98
100
|
poster?: string; // Changed to string type for poster URL
|
99
101
|
handleSaveNoteAction?: (time: number, note: string) => Promise<T>;
|
package/dist/index.d.mts
CHANGED
@@ -21,7 +21,7 @@ type SoftBuildersVideoPlayerOptions = {
|
|
21
21
|
muted?: boolean;
|
22
22
|
poster?: string;
|
23
23
|
sources: SoftBuildersVideoPlayerSource[];
|
24
|
-
tracks
|
24
|
+
tracks?: SoftBuildersVideoPlayerTrack[];
|
25
25
|
width?: number;
|
26
26
|
height?: number;
|
27
27
|
};
|
@@ -37,8 +37,8 @@ interface SoftBuildersVideoPlayerChapter {
|
|
37
37
|
|
38
38
|
type Props<T = any> = {
|
39
39
|
options: SoftBuildersVideoPlayerOptions;
|
40
|
-
notes
|
41
|
-
chapters
|
40
|
+
notes?: SoftBuildersVideoPlayerNote[];
|
41
|
+
chapters?: SoftBuildersVideoPlayerChapter[];
|
42
42
|
startTime?: number;
|
43
43
|
handleSaveNoteAction?: (time: number, note: string) => Promise<T>;
|
44
44
|
onPlay?: (time: number) => void;
|
package/dist/index.mjs
CHANGED
@@ -869,13 +869,13 @@ var NotesPanal = ({ notes }) => {
|
|
869
869
|
const [ns, setNs] = useState7([]);
|
870
870
|
const { duration } = useSoftBuildersVideoPlayerContext();
|
871
871
|
useEffect6(() => {
|
872
|
-
const newNs = notes.map((n) => {
|
872
|
+
const newNs = notes == null ? void 0 : notes.map((n) => {
|
873
873
|
const percentage = Math.floor(n.time * 100 / duration);
|
874
874
|
return __spreadProps(__spreadValues({}, n), {
|
875
875
|
percentage
|
876
876
|
});
|
877
877
|
});
|
878
|
-
setNs(newNs);
|
878
|
+
newNs && setNs(newNs);
|
879
879
|
}, [notes, duration]);
|
880
880
|
return /* @__PURE__ */ jsx25("div", { id: "notes-panal", className: "sb-w-full sb-h-full sb-relative ", children: ns.map((n, i) => /* @__PURE__ */ jsx25(NoteTooltip_default, { note: n }, `note-${i}-${n.time}`)) });
|
881
881
|
};
|
@@ -941,7 +941,7 @@ var ChaptersPanal = ({ chapters }) => {
|
|
941
941
|
const [cs, setCs] = useState9([]);
|
942
942
|
const { duration } = useSoftBuildersVideoPlayerContext();
|
943
943
|
useEffect8(() => {
|
944
|
-
const newCs = chapters.map((c) => {
|
944
|
+
const newCs = chapters == null ? void 0 : chapters.map((c) => {
|
945
945
|
const startPercentage = Math.floor(c.startTime * 100 / duration);
|
946
946
|
const endPercentage = Math.floor(c.endTime * 100 / duration);
|
947
947
|
return __spreadProps(__spreadValues({}, c), {
|
@@ -949,7 +949,7 @@ var ChaptersPanal = ({ chapters }) => {
|
|
949
949
|
endPercentage
|
950
950
|
});
|
951
951
|
});
|
952
|
-
setCs(newCs);
|
952
|
+
newCs && setCs(newCs);
|
953
953
|
}, [chapters, duration]);
|
954
954
|
return /* @__PURE__ */ jsx27("div", { id: "chapters-panal", className: "sb-w-full sb-h-full sb-relative ", children: cs.map((c, i) => /* @__PURE__ */ jsx27(ChapterTooltip_default, { chapter: c }, `chapter-${i}-${c.startTime}`)) });
|
955
955
|
};
|
@@ -982,7 +982,7 @@ var TimeSlider = ({ chapters }) => {
|
|
982
982
|
const [maskCuttes, setMaskCuttes] = useState10("");
|
983
983
|
useEffect9(() => {
|
984
984
|
const arr = ["black 0%"];
|
985
|
-
chapters.forEach((c) => {
|
985
|
+
chapters == null ? void 0 : chapters.forEach((c) => {
|
986
986
|
const startPercentage = Math.floor(c.startTime * 100 / duration);
|
987
987
|
const endPercentage = Math.floor(c.endTime * 100 / duration);
|
988
988
|
arr.push(`black ${startPercentage}%`);
|
@@ -1359,6 +1359,7 @@ var bigPlayButtonRoot = {};
|
|
1359
1359
|
var renderBigPlayButton = (id, player, isPaused, setIsPaused) => {
|
1360
1360
|
const container = document.getElementById(`video-container-${id}`);
|
1361
1361
|
if (container) {
|
1362
|
+
container.style.height = "100%";
|
1362
1363
|
const element = container.querySelector(".vjs-big-play-button");
|
1363
1364
|
if (element) {
|
1364
1365
|
if (!bigPlayButtonRoot[id]) {
|
@@ -1382,6 +1383,7 @@ var renderControlBar = (id, player, isPaused, setIsPaused, duration, notes, chap
|
|
1382
1383
|
}, bgColor = "transparent") => {
|
1383
1384
|
const container = document.getElementById(`video-container-${id}`);
|
1384
1385
|
if (container) {
|
1386
|
+
container.style.height = "100%";
|
1385
1387
|
const element = container.querySelector(".vjs-control-bar");
|
1386
1388
|
if (element) {
|
1387
1389
|
if (!controlBarRoot[id]) {
|
@@ -1686,8 +1688,8 @@ var Component = ({
|
|
1686
1688
|
useEffect15(() => {
|
1687
1689
|
const getTracks = async () => {
|
1688
1690
|
const newTracks = [];
|
1689
|
-
if (Array.isArray(options.tracks))
|
1690
|
-
for (const [i, s] of options.tracks.entries()) {
|
1691
|
+
if (Array.isArray(options == null ? void 0 : options.tracks))
|
1692
|
+
for (const [i, s] of options == null ? void 0 : options.tracks.entries()) {
|
1691
1693
|
let src = s.src;
|
1692
1694
|
if (s.memeType == "text/srt") {
|
1693
1695
|
src = await convertSRTtoVTT(s.src);
|
@@ -1699,7 +1701,7 @@ var Component = ({
|
|
1699
1701
|
setTracks(newTracks);
|
1700
1702
|
};
|
1701
1703
|
getTracks();
|
1702
|
-
}, [options.tracks]);
|
1704
|
+
}, [options == null ? void 0 : options.tracks]);
|
1703
1705
|
const id = (Date.now() + Math.random() * 100).toString();
|
1704
1706
|
return /* @__PURE__ */ jsx36(
|
1705
1707
|
VideoPlayerComponent_default,
|
package/dist/types.d.ts
CHANGED
@@ -18,7 +18,7 @@ export type SoftBuildersVideoPlayerOptions = {
|
|
18
18
|
muted?: boolean;
|
19
19
|
poster?: string;
|
20
20
|
sources: SoftBuildersVideoPlayerSource[];
|
21
|
-
tracks
|
21
|
+
tracks?: SoftBuildersVideoPlayerTrack[];
|
22
22
|
width?: number;
|
23
23
|
height?: number;
|
24
24
|
};
|