softbuilders-react-video-player 1.1.72 → 1.1.74

Sign up to get free protection for your applications and to get access to all the features.
@@ -73,6 +73,7 @@ const ControlBar = ({ player, isPaused, setIsPaused, duration, notes, chapters,
73
73
  time: Number((player === null || player === void 0 ? void 0 : player.currentTime()) || 0),
74
74
  isOpen: e,
75
75
  });
76
+ player.pause();
76
77
  } }) })), _jsx(TooltipModal, { width: width, content: _jsx("p", { children: "Subtitle" }), children: _jsx(SubtitleMenu, { width: width, onClick: (e, isOpen) => {
77
78
  setVolumeToggler(!volumeSliderToggler);
78
79
  setIsSubtitleMenuOpen && setIsSubtitleMenuOpen(isOpen);
@@ -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;AAoBpD,MAAM,UAAU,GAAG,CAAK,EACtB,MAAM,EACN,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,QAAQ,GAAG,CAAC,EACZ,EAAE,E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;wBAC9B,CAAC;oBACH,CAAC,YAED,KAAC,cAAc,IAAC,SAAS,EAAC,eAAe,GAAG,GACrC,GACI,IACX,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -218,6 +218,7 @@ const ControlBar = <T,>({
218
218
  time: Number(player?.currentTime() || 0),
219
219
  isOpen: e,
220
220
  });
221
+ player.pause();
221
222
  }}
222
223
  />
223
224
  </TooltipModal>
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  type Props<T> = {
2
3
  handleSaveNoteAction?: (time: number, note: string) => Promise<T>;
3
4
  width: number;
@@ -6,5 +7,5 @@ type Props<T> = {
6
7
  onMouseEnter?: () => void;
7
8
  onMouseLeave?: () => void;
8
9
  };
9
- declare const CreateNoteMenu: <T>({ handleSaveNoteAction, width, setNoteOpen, noteButtonClick, onMouseEnter, onMouseLeave, }: Props<T>) => import("react/jsx-runtime").JSX.Element;
10
- export default CreateNoteMenu;
10
+ declare const _default: React.MemoExoticComponent<(<T>({ handleSaveNoteAction, width, setNoteOpen, noteButtonClick, onMouseEnter, onMouseLeave, }: Props<T>) => import("react/jsx-runtime").JSX.Element)>;
11
+ export default _default;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from "react";
2
+ import React, { useState } from "react";
3
3
  import MenuButton from "../MenuButton";
4
4
  import { useSoftBuildersVideoPlayerContext } from "../VideoPlayerComponent/provider";
5
5
  import { ClosedNoteIcon } from "../../images";
@@ -19,5 +19,5 @@ const CreateNoteMenu = ({ handleSaveNoteAction, width, setNoteOpen, noteButtonCl
19
19
  };
20
20
  return (_jsx(MenuButton, { onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, disablePopUp: true, noteButtonClick: noteButtonClick, setNoteOpen: setNoteOpen, classContainer: `${width < 400 ? "!sb-top-8 -sb-left-[9.75rem]" : ""}`, buttonContent: _jsx(ClosedNoteIcon, { className: "sb-w-3 sb-h-3" }), menuContent: _jsx("div", { className: `sb-rounded-md sb-bg-[#303030] sb-bg-opacity-50 ${width > 400 ? " sb-py-5 sb-w-[220px]" : "sb-py-1 sb-w-[150px]"}`, children: _jsxs("div", { className: "sb-flex sb-flex-col sb-gap-3 sb-items-center sb-justify-center", onClick: (e) => e.stopPropagation(), children: [_jsx("h3", { className: "sb-px-5", children: "Add Note" }), _jsx("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }), _jsxs("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-4 sb-items-start", children: [_jsx("input", { onClick: (e) => e.stopPropagation(), name: "note", type: "text", placeholder: "Add a note", value: note, onChange: (e) => setNote(e.target.value), required: true, className: "sb-text-white placeholder:sb-text-white sb-w-full sb-bg-transparent sb-px-4 sb-py-3 sb-border sb-border-[#AAAAAA] sb-rounded-md" }), _jsx("button", { className: "sb-w-full", onClick: handleSaveNote, children: _jsx("div", { className: "sb-px-4 sb-py-3 sb-text-center sb-font-bold sb-bg-orange-500 sb-rounded-md", children: "Save" }) })] })] }) }) }));
21
21
  };
22
- export default CreateNoteMenu;
22
+ export default React.memo(CreateNoteMenu);
23
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/CreateNoteMenu/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAU9C,MAAM,cAAc,GAAG,CAAK,EAC1B,oBAAoB,EACpB,KAAK,EACL,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY,GACH,EAAE,EAAE;IACb,MAAM,EAAE,MAAM,EAAE,GAAG,iCAAiC,EAAE,CAAC;IAEvD,MAAM,CAA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CAAC,cAAc,CAAC,CAAC"}
@@ -84,4 +84,4 @@ const CreateNoteMenu = <T,>({
84
84
  );
85
85
  };
86
86
 
87
- export default CreateNoteMenu;
87
+ export default React.memo(CreateNoteMenu);
@@ -28,12 +28,12 @@ const MenuButton = ({ buttonContent, menuContent, close, classContainer, onClick
28
28
  setNoteOpen && setNoteOpen(isOpen);
29
29
  }, [isOpen]);
30
30
  return (_jsxs("div", { onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, className: "sb-relative sb-flex sb-items-end", children: [_jsx("button", { ref: buttonRef, onClick: (e) => {
31
- isOpen && e.stopPropagation();
31
+ e.stopPropagation();
32
32
  // if (!disablePopUp) {
33
33
  toggleMenu();
34
34
  onClick && onClick(e, !isOpen);
35
35
  // }
36
- noteButtonClick && noteButtonClick(!isOpen);
36
+ noteButtonClick && noteButtonClick(true);
37
37
  }, "aria-haspopup": "true", "aria-expanded": isOpen, "aria-label": "Open menu", children: buttonContent }), !disablePopUp && isOpen && (_jsx("div", { ref: menuRef, role: "menu", "aria-orientation": "vertical", "aria-labelledby": "Open menu", className: `sb-absolute sb-shadow-lg sb-right-0 sb-bottom-10 ${classContainer}`, children: menuContent }))] }));
38
38
  };
39
39
  export default MenuButton;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MenuButton/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAgBxE,MAAM,UAAU,GAAG,CAAC,EAClB,aAAa,EACb,WAAW,EACX,KAAK,EACL,cAAc,EACd,OAAO,EACP,WAAW,EACX,eAAe,EACf,YAAY,GAAG,KAAK,EACpB,YAAY,EACZ,YAAY,GACN,EAAE,EAAE;IACV,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,SAAS,GAAG,MAAM,CAA2B,IAA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AM,CAAC,CAAC;oBAC/B,IAAI;oBAEJ,eAAe,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;gBAC3C,CAAC,mBACa,MAAM,mBACL,MAAM,gBACV,WAAW,YAErB,aAAa,GACP,EAER,CAAC,YAAY,IAAI,MAAM,IAAI,CAC1B,cACE,GAAG,EAAE,OAAO,EACZ,IAAI,EAAC,MAAM,sBACM,UAAU,qBACX,WAAW,EAC3B,SAAS,EAAE,oDAAoD,cAAc,EAAE,YAE9E,WAAW,GACR,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -67,13 +67,13 @@ const MenuButton = ({
67
67
  <button
68
68
  ref={buttonRef}
69
69
  onClick={(e: any) => {
70
- isOpen && e.stopPropagation();
70
+ e.stopPropagation();
71
71
  // if (!disablePopUp) {
72
72
  toggleMenu();
73
73
  onClick && onClick(e, !isOpen);
74
74
  // }
75
75
 
76
- noteButtonClick && noteButtonClick(!isOpen);
76
+ noteButtonClick && noteButtonClick(true);
77
77
  }}
78
78
  aria-haspopup="true"
79
79
  aria-expanded={isOpen}
@@ -1,20 +1,23 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState } from "react";
2
+ import { useState } from "react";
3
3
  import Tooltip from "../Tooltip";
4
4
  import { durationFormater } from "../../utils";
5
5
  import { useSoftBuildersVideoPlayerContext } from "../VideoPlayerComponent/provider";
6
6
  const NoteTooltip = ({ note }) => {
7
7
  const [open, setOpen] = useState(false);
8
- const { currentTime } = useSoftBuildersVideoPlayerContext();
9
- useEffect(() => {
10
- if (currentTime === Math.floor(note.time)) {
11
- setOpen(true);
12
- setTimeout(() => {
13
- setOpen(false);
14
- }, 5000);
15
- }
16
- }, [currentTime, note.time]);
17
- return (_jsx("div", { 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) })] }) }) }) }));
8
+ const { currentTime, player } = useSoftBuildersVideoPlayerContext();
9
+ const handleValueChange = () => {
10
+ player === null || player === void 0 ? void 0 : player.currentTime(note.time);
11
+ };
12
+ // useEffect(() => {
13
+ // if (currentTime === Math.floor(note.time)) {
14
+ // setOpen(true);
15
+ // setTimeout(() => {
16
+ // setOpen(false);
17
+ // }, 5000);
18
+ // }
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) })] }) }) }) }));
18
21
  };
19
22
  export default NoteTooltip;
20
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/NoteTooltip/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,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,C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AAiC,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,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC7B,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC,CAAC;IACF,oBAAoB;IACpB,iDAAiD;IACjD,qBAAqB;IAErB,yBAAyB;IACzB,wBAAwB;IACxB,gBAAgB;IAChB,MAAM;IACN,gCAAgC;IAChC,OAAO,CACL,cACE,OAAO,EAAE,iBAAiB,EAC1B,SAAS,EAAC,+DAA+D,EACzE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,UAAU,GAAG,EAAE,EACtC,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,CAAC,KAAK,GAAK,EACnB,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"}
@@ -11,19 +11,23 @@ type Props = {
11
11
 
12
12
  const NoteTooltip = ({ note }: Props) => {
13
13
  const [open, setOpen] = useState(false);
14
- const { currentTime } = useSoftBuildersVideoPlayerContext();
14
+ const { currentTime, player } = useSoftBuildersVideoPlayerContext();
15
15
 
16
- useEffect(() => {
17
- if (currentTime === Math.floor(note.time)) {
18
- setOpen(true);
16
+ const handleValueChange = () => {
17
+ player?.currentTime(note.time);
18
+ };
19
+ // useEffect(() => {
20
+ // if (currentTime === Math.floor(note.time)) {
21
+ // setOpen(true);
19
22
 
20
- setTimeout(() => {
21
- setOpen(false);
22
- }, 5000);
23
- }
24
- }, [currentTime, note.time]);
23
+ // setTimeout(() => {
24
+ // setOpen(false);
25
+ // }, 5000);
26
+ // }
27
+ // }, [currentTime, note.time]);
25
28
  return (
26
29
  <div
30
+ onClick={handleValueChange}
27
31
  className="sb-w-1 sb-h-1 sb-rounded-full sb-bg-white sb-absolute sb-z-30"
28
32
  style={{ left: `${note.percentage}%` }}
29
33
  onMouseEnter={() => setOpen(true)}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef, memo, useEffect, useState } from "react";
2
+ import { forwardRef, memo, useCallback, useEffect, useMemo, useState, } from "react";
3
3
  import VideoPlayerComponent from "../VideoPlayerComponent";
4
4
  import { convertSRTtoVTT } from "../../utils";
5
5
  const DEFAULT_OPTIONS = {
@@ -13,44 +13,67 @@ const DEFAULT_OPTIONS = {
13
13
  tracks: [],
14
14
  };
15
15
  const Component = forwardRef(({ options, notes, chapters, startTime = 0, handleSaveNoteAction, onPlay, onPause, isFocused = true, disableNote, childRef, bottomRedBar, noteButtonClick, }, ref) => {
16
- options = Object.assign(Object.assign({}, options), { responsive: true, inactivityTimeout: 0, fullscreen: {
17
- navigationUI: "hide",
18
- } });
19
- if (options.autoplay === undefined)
20
- options.autoplay = DEFAULT_OPTIONS.autoplay;
21
- if (options.controls === undefined)
22
- options.controls = DEFAULT_OPTIONS.controls;
23
- if (options.fluid === undefined)
24
- options.fluid = DEFAULT_OPTIONS.fluid;
25
- if ((options === null || options === void 0 ? void 0 : options.muted) === undefined)
26
- options.muted = DEFAULT_OPTIONS === null || DEFAULT_OPTIONS === void 0 ? void 0 : DEFAULT_OPTIONS.muted;
27
- if (options.height === undefined)
28
- options.height = DEFAULT_OPTIONS.height;
29
- if (options.width === undefined)
30
- options.width = DEFAULT_OPTIONS.width;
16
+ // options = {
17
+ // ...options,
18
+ // responsive: true,
19
+ // inactivityTimeout: 0,
20
+ // fullscreen: {
21
+ // navigationUI: "hide",
22
+ // },
23
+ // } as any;
24
+ const mergedOptions = useMemo(() => (Object.assign(Object.assign(Object.assign({}, DEFAULT_OPTIONS), options), { responsive: true, inactivityTimeout: 0, fullscreen: { navigationUI: "hide" } })), [options]);
25
+ // if (options.autoplay === undefined)
26
+ // options.autoplay = DEFAULT_OPTIONS.autoplay;
27
+ // if (options.controls === undefined)
28
+ // options.controls = DEFAULT_OPTIONS.controls;
29
+ // if (options.fluid === undefined) options.fluid = DEFAULT_OPTIONS.fluid;
30
+ // if (options?.muted === undefined) options.muted = DEFAULT_OPTIONS?.muted;
31
+ // if (options.height === undefined) options.height = DEFAULT_OPTIONS.height;
32
+ // if (options.width === undefined) options.width = DEFAULT_OPTIONS.width;
33
+ // const [tracks, setTracks] = useState<SoftBuildersVideoPlayerTrack[]>([]);
34
+ // useEffect(() => {}, [isFocused]);
35
+ // useEffect(() => {
36
+ // const getTracks = async () => {
37
+ // const newTracks: SoftBuildersVideoPlayerTrack[] = [];
38
+ // if (Array.isArray(options?.tracks))
39
+ // for (const [i, s] of options?.tracks.entries()) {
40
+ // let src = s.src;
41
+ // if (s.memeType == "text/srt") {
42
+ // src = await convertSRTtoVTT(s.src);
43
+ // }
44
+ // newTracks.push({
45
+ // ...s,
46
+ // src,
47
+ // });
48
+ // }
49
+ // setTracks(newTracks);
50
+ // };
51
+ // getTracks();
52
+ // }, [options?.tracks]);
53
+ // const id = (Date.now() + Math.random() * 100).toString();
31
54
  const [tracks, setTracks] = useState([]);
32
- useEffect(() => { }, [isFocused]);
33
- useEffect(() => {
34
- const getTracks = async () => {
35
- const newTracks = [];
36
- if (Array.isArray(options === null || options === void 0 ? void 0 : options.tracks))
37
- for (const [i, s] of options === null || options === void 0 ? void 0 : options.tracks.entries()) {
38
- let src = s.src;
39
- if (s.memeType == "text/srt") {
40
- src = await convertSRTtoVTT(s.src);
41
- }
42
- newTracks.push(Object.assign(Object.assign({}, s), { src }));
55
+ const getTracks = useCallback(async () => {
56
+ const newTracks = [];
57
+ if (Array.isArray(mergedOptions.tracks)) {
58
+ for (const s of mergedOptions.tracks) {
59
+ let src = s.src;
60
+ if (s.memeType === "text/srt") {
61
+ src = await convertSRTtoVTT(s.src);
43
62
  }
44
- setTracks(newTracks);
45
- };
63
+ newTracks.push(Object.assign(Object.assign({}, s), { src }));
64
+ }
65
+ }
66
+ setTracks(newTracks);
67
+ }, [mergedOptions.tracks]);
68
+ useEffect(() => {
46
69
  getTracks();
47
- }, [options === null || options === void 0 ? void 0 : options.tracks]);
48
- const id = (Date.now() + Math.random() * 100).toString();
49
- return (_jsx(VideoPlayerComponent, { id: id, 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 }));
70
+ }, [getTracks]);
71
+ const id = useMemo(() => (Date.now() + Math.random() * 100).toString(), []);
72
+ return (_jsx(VideoPlayerComponent, { id: id, chapters: chapters, options: Object.assign(Object.assign({}, mergedOptions), { tracks }), notes: notes, poster: "", startTime: startTime, handleSaveNoteAction: handleSaveNoteAction, disableNote: disableNote, onPause: onPause, onPlay: onPlay, childRef: childRef, bottomRedBar: bottomRedBar, noteButtonClick: noteButtonClick }));
50
73
  });
51
74
  const SoftBuildersVideoPlayer = memo(Component, (prevProps, nextProps) => {
52
75
  return (prevProps.options === nextProps.options &&
53
- prevProps.notes === nextProps.notes &&
76
+ // prevProps.notes === nextProps.notes &&
54
77
  prevProps.chapters === nextProps.chapters &&
55
78
  prevProps.startTime === nextProps.startTime);
56
79
  });
@@ -1 +1 @@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AuB,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;IACvE,OAAO,CACL,SAAS,CAAC,OAAO,KAAK,SAAS,CAAC,OAAO;QACvC,yCAAyC;QACzC,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,4 +1,11 @@
1
- import React, { forwardRef, memo, useEffect, useState } from "react";
1
+ import React, {
2
+ forwardRef,
3
+ memo,
4
+ useCallback,
5
+ useEffect,
6
+ useMemo,
7
+ useState,
8
+ } from "react";
2
9
  import VideoPlayerComponent from "../VideoPlayerComponent";
3
10
  import {
4
11
  SoftBuildersVideoPlayerChapter,
@@ -52,56 +59,89 @@ const Component = forwardRef<HTMLDivElement, Props<any>>(
52
59
  }: Props<any>,
53
60
  ref?: any
54
61
  ) => {
55
- options = {
56
- ...options,
57
- responsive: true,
58
- inactivityTimeout: 0,
59
- fullscreen: {
60
- navigationUI: "hide",
61
- },
62
- } as any;
63
-
64
- if (options.autoplay === undefined)
65
- options.autoplay = DEFAULT_OPTIONS.autoplay;
66
- if (options.controls === undefined)
67
- options.controls = DEFAULT_OPTIONS.controls;
68
- if (options.fluid === undefined) options.fluid = DEFAULT_OPTIONS.fluid;
69
- if (options?.muted === undefined) options.muted = DEFAULT_OPTIONS?.muted;
70
- if (options.height === undefined) options.height = DEFAULT_OPTIONS.height;
71
- if (options.width === undefined) options.width = DEFAULT_OPTIONS.width;
62
+ // options = {
63
+ // ...options,
64
+ // responsive: true,
65
+ // inactivityTimeout: 0,
66
+ // fullscreen: {
67
+ // navigationUI: "hide",
68
+ // },
69
+ // } as any;
70
+
71
+ const mergedOptions = useMemo(
72
+ () => ({
73
+ ...DEFAULT_OPTIONS,
74
+ ...options,
75
+ responsive: true,
76
+ inactivityTimeout: 0,
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();
72
117
 
73
118
  const [tracks, setTracks] = useState<SoftBuildersVideoPlayerTrack[]>([]);
74
- useEffect(() => {}, [isFocused]);
75
- useEffect(() => {
76
- const getTracks = async () => {
77
- const newTracks: SoftBuildersVideoPlayerTrack[] = [];
78
- if (Array.isArray(options?.tracks))
79
- for (const [i, s] of options?.tracks.entries()) {
80
- let src = s.src;
81
-
82
- if (s.memeType == "text/srt") {
83
- src = await convertSRTtoVTT(s.src);
84
- }
85
-
86
- newTracks.push({
87
- ...s,
88
- src,
89
- });
90
- }
91
119
 
92
- setTracks(newTracks);
93
- };
120
+ const getTracks = useCallback(async () => {
121
+ const newTracks: SoftBuildersVideoPlayerTrack[] = [];
122
+ if (Array.isArray(mergedOptions.tracks)) {
123
+ for (const s of mergedOptions.tracks) {
124
+ let src = s.src;
125
+ if (s.memeType === "text/srt") {
126
+ src = await convertSRTtoVTT(s.src);
127
+ }
128
+ newTracks.push({ ...s, src });
129
+ }
130
+ }
131
+ setTracks(newTracks);
132
+ }, [mergedOptions.tracks]);
94
133
 
134
+ useEffect(() => {
95
135
  getTracks();
96
- }, [options?.tracks]);
136
+ }, [getTracks]);
97
137
 
98
- const id = (Date.now() + Math.random() * 100).toString();
138
+ const id = useMemo(() => (Date.now() + Math.random() * 100).toString(), []);
99
139
 
100
140
  return (
101
141
  <VideoPlayerComponent
102
142
  id={id}
103
143
  chapters={chapters}
104
- options={{ ...options, tracks }}
144
+ options={{ ...mergedOptions, tracks }}
105
145
  notes={notes}
106
146
  poster=""
107
147
  startTime={startTime}
@@ -120,7 +160,7 @@ const Component = forwardRef<HTMLDivElement, Props<any>>(
120
160
  const SoftBuildersVideoPlayer = memo(Component, (prevProps, nextProps) => {
121
161
  return (
122
162
  prevProps.options === nextProps.options &&
123
- prevProps.notes === nextProps.notes &&
163
+ // prevProps.notes === nextProps.notes &&
124
164
  prevProps.chapters === nextProps.chapters &&
125
165
  prevProps.startTime === nextProps.startTime
126
166
  );