softbuilders-react-video-player 1.1.30 → 1.1.32
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.js +1 -1
- package/dist/components/SoftBuildersVideoPlayer/index.js.map +1 -1
- package/dist/components/SoftBuildersVideoPlayer/index.tsx +1 -1
- 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 +1 -1
- package/dist/components/VideoPlayerComponent/index.js +6 -3
- package/dist/components/VideoPlayerComponent/index.js.map +1 -1
- package/dist/components/VideoPlayerComponent/index.tsx +11 -7
- package/dist/components/VideoPlayerComponent/style/style.css +3 -0
- package/dist/index.css +3 -0
- package/dist/index.mjs +12 -9
- 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,MAAM,mBAAmB,CAAC;AAE/C,OAAO,E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?: 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,OA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ideoPlayerNote[];
|
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 ">
|
@@ -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,
|
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,KAAK;IACZ,KAAK,EA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,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"}
|
@@ -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,CA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C,CAAC,CAAC;QACH,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAEvB,aAAa,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChC,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEzB,OAAO,CACL,eAAK,SAAS,EAAC,6DAA6D,aAC1E,cAAK,SAAS,EAAC,kDAAkD,YAC/D,KAAC,MAAM,IACL,KAAK,EAAE,UAAU,EACjB,iBAAiB,EAAE,iBAAiB,EACpC,GAAG,EAAE,GAAG,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 (
|
@@ -6,7 +6,7 @@ export type Props<T = any> = {
|
|
6
6
|
id: string;
|
7
7
|
options: SoftBuildersVideoPlayerOptions;
|
8
8
|
notes?: SoftBuildersVideoPlayerNote[];
|
9
|
-
chapters
|
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,8 @@ 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%";
|
30
|
+
container.style.aspectRatio = "16 / 9";
|
28
31
|
const element = container.querySelector(".vjs-control-bar");
|
29
32
|
if (element) {
|
30
33
|
if (!controlBarRoot[id]) {
|
@@ -66,8 +69,6 @@ const VideoPlayerComponent = ({ id, options, notes, chapters, startTime = 0, han
|
|
66
69
|
useEffect(() => {
|
67
70
|
if (!playerRef.current) {
|
68
71
|
const videoElement = document.createElement("video-js");
|
69
|
-
videoElement.style.width = "100%";
|
70
|
-
videoElement.style.height = "100%";
|
71
72
|
videoElement.setAttribute("playsinline", "true");
|
72
73
|
videoElement.classList.add("vjs-big-play-centered");
|
73
74
|
// Set the poster attribute here
|
@@ -75,6 +76,8 @@ const VideoPlayerComponent = ({ id, options, notes, chapters, startTime = 0, han
|
|
75
76
|
videoElement.setAttribute("poster", poster);
|
76
77
|
}
|
77
78
|
videoRef.current.appendChild(videoElement);
|
79
|
+
videoElement.style.width = "100%";
|
80
|
+
videoElement.style.height = "100%";
|
78
81
|
playerRef.current = videojs(videoElement, options, () => {
|
79
82
|
onReady(playerRef.current);
|
80
83
|
});
|
@@ -227,7 +230,7 @@ const VideoPlayerComponent = ({ id, options, notes, chapters, startTime = 0, han
|
|
227
230
|
}
|
228
231
|
};
|
229
232
|
}, []);
|
230
|
-
return (_jsx("div", { ref: videoRefs, id: `video-container-${id}`, className: "sb-relative sb-rounded-md sb-overflow-hidden sb-w-full sb-h-full ", children: _jsx("div", { className: "hover:sb-cursor-pointer sb-w-full sb-h-full", "data-vjs-player": true, children: _jsx("div", { onClick: handlePlayerClick, ref: videoRef, className: "sb-
|
233
|
+
return (_jsx("div", { ref: videoRefs, id: `video-container-${id}`, className: "sb-relative sb-rounded-md sb-overflow-hidden sb-w-full sb-h-full ", children: _jsx("div", { className: "hover:sb-cursor-pointer sb-w-full sb-h-full", "data-vjs-player": true, children: _jsx("div", { onClick: handlePlayerClick, ref: videoRef, className: "sb-h-full sb-w-full" }) }) }));
|
231
234
|
};
|
232
235
|
export default VideoPlayerComponent;
|
233
236
|
//# sourceMappingURL=index.js.map
|
@@ -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,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,OAAO,MAAM,UAAU,CAAC;AAE/B,OAAO,4BAA4B,CAAC;AACpC,OAAO,UAAU,MAAM,eAAe,CAAC;AAMvC,OAAO,mBAAmB,CAAC;AAC3B,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,aAAa,MAAM,kBAAkB,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/VideoPlayerComponent/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,OAAO,MAAM,UAAU,CAAC;AAE/B,OAAO,4BAA4B,CAAC;AACpC,OAAO,UAAU,MAAM,eAAe,CAAC;AAMvC,OAAO,mBAAmB,CAAC;AAC3B,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,IAAI,iBAAiB,GAEjB,EAAE,CAAC;AACP,MAAM,mBAAmB,GAAG,CAC1B,EAAU,EACV,MAA0B,EAC1B,QAAiB,EACjB,WAA0D,EAC1D,EAAE;IACF,MAAM,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;IAEnE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AM,EAAE,MAAK,KAAK,EAAE,CAAC;wBAC3C,IAAI,CAAC;4BACH,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,0CAAE,KAAK,EAAE,CAAC;4BAC5B,WAAW,CAAC,IAAI,CAAC,CAAC;wBACpB,CAAC;wBAAC,OAAO,KAAK,EAAE,CAAC;4BACf,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;wBAChD,CAAC;oBACH,CAAC;gBACH,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,8 @@ const renderControlBar = <T,>(
|
|
60
61
|
) => {
|
61
62
|
const container = document.getElementById(`video-container-${id}`);
|
62
63
|
if (container) {
|
64
|
+
container.style.height = "100%";
|
65
|
+
container.style.aspectRatio = "16 / 9";
|
63
66
|
const element: any = container.querySelector(".vjs-control-bar");
|
64
67
|
if (element) {
|
65
68
|
if (!controlBarRoot[id]) {
|
@@ -93,7 +96,7 @@ export type Props<T = any> = {
|
|
93
96
|
id: string;
|
94
97
|
options: SoftBuildersVideoPlayerOptions;
|
95
98
|
notes?: SoftBuildersVideoPlayerNote[];
|
96
|
-
chapters
|
99
|
+
chapters?: SoftBuildersVideoPlayerChapter[];
|
97
100
|
startTime?: number;
|
98
101
|
poster?: string; // Changed to string type for poster URL
|
99
102
|
handleSaveNoteAction?: (time: number, note: string) => Promise<T>;
|
@@ -137,8 +140,7 @@ const VideoPlayerComponent = <T,>({
|
|
137
140
|
useEffect(() => {
|
138
141
|
if (!playerRef.current) {
|
139
142
|
const videoElement = document.createElement("video-js");
|
140
|
-
|
141
|
-
videoElement.style.height = "100%";
|
143
|
+
|
142
144
|
videoElement.setAttribute("playsinline", "true");
|
143
145
|
|
144
146
|
videoElement.classList.add("vjs-big-play-centered");
|
@@ -147,6 +149,8 @@ const VideoPlayerComponent = <T,>({
|
|
147
149
|
videoElement.setAttribute("poster", poster);
|
148
150
|
}
|
149
151
|
videoRef.current.appendChild(videoElement);
|
152
|
+
videoElement.style.width = "100%";
|
153
|
+
videoElement.style.height = "100%";
|
150
154
|
playerRef.current = videojs(videoElement, options, () => {
|
151
155
|
onReady(playerRef.current as Player);
|
152
156
|
});
|
@@ -325,7 +329,7 @@ const VideoPlayerComponent = <T,>({
|
|
325
329
|
<div
|
326
330
|
onClick={handlePlayerClick}
|
327
331
|
ref={videoRef}
|
328
|
-
className="sb-
|
332
|
+
className="sb-h-full sb-w-full"
|
329
333
|
/>
|
330
334
|
</div>
|
331
335
|
</div>
|
package/dist/index.css
CHANGED
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,8 @@ 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%";
|
1387
|
+
container.style.aspectRatio = "16 / 9";
|
1385
1388
|
const element = container.querySelector(".vjs-control-bar");
|
1386
1389
|
if (element) {
|
1387
1390
|
if (!controlBarRoot[id]) {
|
@@ -1450,14 +1453,14 @@ var VideoPlayerComponent = ({
|
|
1450
1453
|
useEffect14(() => {
|
1451
1454
|
if (!playerRef.current) {
|
1452
1455
|
const videoElement = document.createElement("video-js");
|
1453
|
-
videoElement.style.width = "100%";
|
1454
|
-
videoElement.style.height = "100%";
|
1455
1456
|
videoElement.setAttribute("playsinline", "true");
|
1456
1457
|
videoElement.classList.add("vjs-big-play-centered");
|
1457
1458
|
if (poster) {
|
1458
1459
|
videoElement.setAttribute("poster", poster);
|
1459
1460
|
}
|
1460
1461
|
videoRef.current.appendChild(videoElement);
|
1462
|
+
videoElement.style.width = "100%";
|
1463
|
+
videoElement.style.height = "100%";
|
1461
1464
|
playerRef.current = videojs(videoElement, options, () => {
|
1462
1465
|
onReady(playerRef.current);
|
1463
1466
|
});
|
@@ -1632,7 +1635,7 @@ var VideoPlayerComponent = ({
|
|
1632
1635
|
{
|
1633
1636
|
onClick: handlePlayerClick,
|
1634
1637
|
ref: videoRef,
|
1635
|
-
className: "sb-
|
1638
|
+
className: "sb-h-full sb-w-full"
|
1636
1639
|
}
|
1637
1640
|
)
|
1638
1641
|
}
|
@@ -1647,7 +1650,7 @@ import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1647
1650
|
var DEFAULT_OPTIONS = {
|
1648
1651
|
autoplay: false,
|
1649
1652
|
controls: true,
|
1650
|
-
fluid:
|
1653
|
+
fluid: false,
|
1651
1654
|
muted: true,
|
1652
1655
|
height: 420,
|
1653
1656
|
width: 720,
|