softbuilders-react-video-player 1.2.23 → 1.2.24

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,6 +16,7 @@ const ControlBar = ({ player, isPaused, setIsPaused, duration, notes, chapters,
16
16
  const { setPlayer, setDuration } = useSoftBuildersVideoPlayerContext();
17
17
  const [width, setWidth] = useState(0);
18
18
  const [isSeeking, setIsSeeking] = useState(true);
19
+ const [isModalChanged, setIsModalChanged] = useState(false);
19
20
  const seek = (duration) => {
20
21
  const currentTime = Number((player === null || player === void 0 ? void 0 : player.currentTime()) || 0);
21
22
  player === null || player === void 0 ? void 0 : player.currentTime(currentTime + duration);
@@ -68,9 +69,10 @@ const ControlBar = ({ player, isPaused, setIsPaused, duration, notes, chapters,
68
69
  }
69
70
  : { width: "98%" }, className: `flex gap-2 ${width < 400 && !isTrailer
70
71
  ? "absolute sb-top-1"
71
- : "-sb-translate-y-0 sb-w-full"} hover:sb-w-[45%] `, children: [_jsx(CurrentTimeLabel, {}), _jsx(TimeSliderContainer, { chapters: chapters, notes: notes }), _jsx("p", { children: durationFormater(duration) })] }) }), _jsx("div", { className: "sb-h-full", children: _jsx(VolumeSlider, { setNoteOpen: setNoteOpen, isTrailer: isTrailer, volumeSliderToggler: volumeSliderToggler, width: width, setIsSeeking: (val) => setIsSeeking(val), handleControlDisplayTimer: handleControlDisplayTimer }) }), _jsx(TooltipModal, { width: width, content: _jsx("p", { children: "Quality" }), children: _jsx(QualityMenu, { isTrailer: isTrailer, width: width, onClick: (e, isOpen) => {
72
+ : "-sb-translate-y-0 sb-w-full"} hover:sb-w-[45%] `, children: [_jsx(CurrentTimeLabel, {}), _jsx(TimeSliderContainer, { chapters: chapters, notes: notes }), _jsx("p", { children: durationFormater(duration) })] }) }), _jsx("div", { className: "sb-h-full", children: _jsx(VolumeSlider, { setNoteOpen: setNoteOpen, isTrailer: isTrailer, volumeSliderToggler: volumeSliderToggler, width: width, setIsSeeking: (val) => setIsSeeking(val), handleControlDisplayTimer: handleControlDisplayTimer }) }), _jsx(TooltipModal, { isModalChanged: isModalChanged, width: width, content: _jsx("p", { children: "Quality" }), children: _jsx(QualityMenu, { isTrailer: isTrailer, width: width, setIsModalChanged: (val) => setIsModalChanged(val), onClick: (e, isOpen) => {
72
73
  setVolumeToggler(!volumeSliderToggler);
73
74
  setIsQualityMenuOpen && setIsQualityMenuOpen(isOpen);
75
+ setIsModalChanged(true);
74
76
  } }) }), disableNote && (_jsx(TooltipModal, { width: width, content: _jsx("p", { children: "Create note" }), children: _jsx(CreateNoteMenu, { handleSaveNoteAction: handleSaveNoteAction, width: width, setNoteOpen: setNoteOpen, noteButtonClick: (e) => {
75
77
  noteButtonClick &&
76
78
  noteButtonClick({
@@ -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;AAqBpD,MAAM,UAAU,GAAG,CAAK,EACtB,MAAM,EACN,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,QA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C;wBACL,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,EAAE,CAAC;oBAClB,CAAC,GACD,GACW,CAChB,EACD,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,mCAAe,YAClD,KAAC,YAAY,IACX,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,CAAC,CAAM,EAAE,MAAe,EAAE,EAAE;wBACnC,gBAAgB,CAAC,CAAC,mBAAmB,CAAC,CAAC;wBACvC,qBAAqB,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC;oBACzD,CAAC,GACD,GACW,EACf,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,sCAAkB,YACrD,iBACE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;wBACb,CAAC,CAAC,cAAc,EAAE,CAAC;wBACnB,CAAC,CAAC,eAAe,EAAE,CAAC;wBAEpB,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,EAAE,EAAE,CAAC;4BAC3B,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,cAAc,EAAE,CAAC;wBAC3B,CAAC;6BAAM,CAAC;4BACN,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,iBAAiB,EAAE,CAAC;wBAC9B,CAAC;oBACH,CAAC,YAED,KAAC,cAAc,IAAC,SAAS,EAAC,eAAe,GAAG,GACrC,GACI,IACX,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -63,6 +63,8 @@ const ControlBar = <T,>({
63
63
  const { setPlayer, setDuration } = useSoftBuildersVideoPlayerContext();
64
64
  const [width, setWidth] = useState<number>(0);
65
65
  const [isSeeking, setIsSeeking] = useState(true);
66
+ const [isModalChanged, setIsModalChanged] = useState(false);
67
+
66
68
  const seek = (duration: number) => {
67
69
  const currentTime = Number(player?.currentTime() || 0);
68
70
  player?.currentTime(currentTime + duration);
@@ -205,13 +207,19 @@ const ControlBar = <T,>({
205
207
  handleControlDisplayTimer={handleControlDisplayTimer}
206
208
  />
207
209
  </div>
208
- <TooltipModal width={width} content={<p>Quality</p>}>
210
+ <TooltipModal
211
+ isModalChanged={isModalChanged}
212
+ width={width}
213
+ content={<p>Quality</p>}
214
+ >
209
215
  <QualityMenu
210
216
  isTrailer={isTrailer}
211
217
  width={width}
218
+ setIsModalChanged={(val: boolean) => setIsModalChanged(val)}
212
219
  onClick={(e: any, isOpen: boolean) => {
213
220
  setVolumeToggler(!volumeSliderToggler);
214
221
  setIsQualityMenuOpen && setIsQualityMenuOpen(isOpen);
222
+ setIsModalChanged(true);
215
223
  }}
216
224
  />
217
225
  </TooltipModal>
@@ -2,6 +2,7 @@ type QualityMenuProps = {
2
2
  width: number;
3
3
  onClick?: (e: any, toggleMenu: boolean) => void;
4
4
  isTrailer?: boolean;
5
+ setIsModalChanged: (isModalChanged: boolean) => void;
5
6
  };
6
- declare const QualityMenu: ({ width, onClick, isTrailer }: QualityMenuProps) => import("react/jsx-runtime").JSX.Element;
7
+ declare const QualityMenu: ({ width, onClick, isTrailer, setIsModalChanged, }: QualityMenuProps) => import("react/jsx-runtime").JSX.Element;
7
8
  export default QualityMenu;
@@ -9,7 +9,7 @@ const QualityOption = ({ isSelected, quality, onClick, width, isTrailer, }) => {
9
9
  onClick(e);
10
10
  }, children: _jsxs("div", { className: "sb-grid sb-grid-cols-12 sb-items-center sb-gap-2", children: [_jsx("div", { className: "sb-col-span-3", children: isSelected ? (_jsx(CheckedIcon, { className: `${width > 400 && !isTrailer ? "sb-w-5 sb-h-5" : "sb-w-3 sb-h-3"}` })) : (_jsx("div", {})) }), _jsx("p", { className: "sb-text-left sb-col-span-9", children: quality === null || quality === void 0 ? void 0 : quality.label })] }) }));
11
11
  };
12
- const QualityMenu = ({ width, onClick, isTrailer }) => {
12
+ const QualityMenu = ({ width, onClick, isTrailer, setIsModalChanged, }) => {
13
13
  const { player } = useSoftBuildersVideoPlayerContext();
14
14
  const [closeMenuFunction, setCloseMenuFunction] = useState(undefined);
15
15
  const [qualities, setQualities] = useState([]);
@@ -49,6 +49,7 @@ const QualityMenu = ({ width, onClick, isTrailer }) => {
49
49
  // player?.play();
50
50
  }
51
51
  closeMenuFunction && closeMenuFunction();
52
+ setIsModalChanged(false);
52
53
  } }, `quality-${q === null || q === void 0 ? void 0 : q.label}-${i}`));
53
54
  }) })] }) }), close: (fn) => {
54
55
  setCloseMenuFunction(() => fn);
@@ -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;AASxE,MAAM,aAAa,GAAG,CAAC,EACrB,UAAU,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,GACU,EAAE,EAAE;IACvB,OAAO,CACL,iBACE,SAAS,EAAE,4BACT,KAAK,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SACzC,EAAE,EACF,OAAO,EAAE,CAAC,CAAsC,EAAE,EAAE;YAClD,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,OAAO,CAAC,CAAC,CAAC,CAAC;QACb,CAAC,YAED,eAAK,SAAS,EAAC,kDAAkD,aAC/D,cAAK,SAAS,EAAC,eAAe,YAC3B,UAAU,CAAC,CAAC,CAAC,CACZ,KAAC,WAAW,IACV,SAAS,EAAE,GACT,KAAK,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAChD,EAAE,GACF,CACH,CAAC,CAAC,CAAC,CACF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C,iBAAiB,CAAC,KAAK,CAAC,CAAC;gCAC3B,CAAC,IAhBI,WAAW,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,KAAK,IAAI,CAAC,EAAE,CAiB/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"}
@@ -52,9 +52,15 @@ type QualityMenuProps = {
52
52
  width: number;
53
53
  onClick?: (e: any, toggleMenu: boolean) => void;
54
54
  isTrailer?: boolean;
55
+ setIsModalChanged: (isModalChanged: boolean) => void;
55
56
  };
56
57
 
57
- const QualityMenu = ({ width, onClick, isTrailer }: QualityMenuProps) => {
58
+ const QualityMenu = ({
59
+ width,
60
+ onClick,
61
+ isTrailer,
62
+ setIsModalChanged,
63
+ }: QualityMenuProps) => {
58
64
  const { player } = useSoftBuildersVideoPlayerContext();
59
65
 
60
66
  const [closeMenuFunction, setCloseMenuFunction] = useState<
@@ -151,6 +157,7 @@ const QualityMenu = ({ width, onClick, isTrailer }: QualityMenuProps) => {
151
157
  // player?.play();
152
158
  }
153
159
  closeMenuFunction && closeMenuFunction();
160
+ setIsModalChanged(false);
154
161
  }}
155
162
  />
156
163
  );
@@ -1,2 +1,2 @@
1
- declare const TooltipModal: ({ content, children, isLeft, width, }: any) => import("react/jsx-runtime").JSX.Element;
1
+ declare const TooltipModal: ({ content, children, isLeft, width, isModalChanged, }: any) => import("react/jsx-runtime").JSX.Element;
2
2
  export default TooltipModal;
@@ -1,9 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from "react";
3
- const TooltipModal = ({ content, children, isLeft = false, width = 0, }) => {
2
+ import { useEffect, useState } from "react";
3
+ const TooltipModal = ({ content, children, isLeft = false, width = 0, isModalChanged, }) => {
4
4
  const [isOpen, setIsOpen] = useState(false);
5
5
  const showTooltip = () => setIsOpen(true);
6
6
  const hideTooltip = () => setIsOpen(false);
7
+ useEffect(() => {
8
+ hideTooltip();
9
+ }, [isModalChanged]);
7
10
  return (_jsxs("div", { className: "tooltip-container", style: { position: "relative", display: "inline-block" }, children: [_jsx("div", { onMouseEnter: showTooltip, onMouseLeave: hideTooltip, style: { cursor: "pointer" }, children: children }), isOpen && (_jsx("div", { className: `sb-tooltip-modal sb-text-orange-900 sb-my-2 ${width > 400 ? "!sb-bottom-[105%]" : "!sb-top-[105%]"}`, style: {
8
11
  position: "absolute",
9
12
  left: !isLeft ? "-100%" : "100%",
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalTooltip.js","sourceRoot":"","sources":["../../../src/components/Tooltip/GlobalTooltip.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,MAAM,YAAY,GAAG,CAAC,EACpB,OAAO,EACP,QAAQ,EACR,MAAM,GAAG,KAAK,EACd,KAAK,GAAG,CAAC,GACL,EAAE,EAAE;IACR,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5C,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAE3C,OAAO,CACL,eACE,SAAS,EAAC,mBAAmB,EAC7B,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,aAGxD,cACE,YAAY,EAAE,WAAW,EACzB,YAAY,EAAE,WAAW,EACzB,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,YAE3B,QAAQ,GACL,EAGL,MAAM,IAAI,CACT,cACE,SAAS,EAAE,+CACT,KAAK,GAAG,GAAG,CA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aAGxD,cACE,YAAY,EAAE,WAAW,EACzB,YAAY,EAAE,WAAW,EACzB,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,YAE3B,QAAQ,GACL,EAGL,MAAM,IAAI,CACT,cACE,SAAS,EAAE,+CACT,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,gBACtC,EAAE,EACF,KAAK,EAAE;oBACL,QAAQ,EAAE,UAAU;oBACpB,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;oBAChC,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,gBAAgB;oBAC1D,eAAe,EAAE,OAAO;oBACxB,OAAO,EAAE,KAAK;oBACd,YAAY,EAAE,KAAK;oBACnB,UAAU,EAAE,QAAQ;oBACpB,SAAS,EAAE,kBAAkB;oBAC7B,MAAM,EAAE,IAAI;iBACb,YAEA,OAAO,GACJ,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,15 +1,18 @@
1
- import React, { useState } from "react";
1
+ import React, { useEffect, useState } from "react";
2
2
 
3
3
  const TooltipModal = ({
4
4
  content,
5
5
  children,
6
6
  isLeft = false,
7
7
  width = 0,
8
+ isModalChanged,
8
9
  }: any) => {
9
10
  const [isOpen, setIsOpen] = useState(false);
10
-
11
11
  const showTooltip = () => setIsOpen(true);
12
12
  const hideTooltip = () => setIsOpen(false);
13
+ useEffect(() => {
14
+ hideTooltip();
15
+ }, [isModalChanged]);
13
16
 
14
17
  return (
15
18
  <div
package/dist/index.mjs CHANGED
@@ -31,13 +31,13 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
 
33
33
  // src/components/SoftBuildersVideoPlayer/index.tsx
34
- import { forwardRef as forwardRef2, memo, useEffect as useEffect15, useState as useState15 } from "react";
34
+ import { forwardRef as forwardRef2, memo, useEffect as useEffect16, useState as useState15 } from "react";
35
35
 
36
36
  // src/components/VideoPlayerComponent/index.tsx
37
37
  import {
38
38
  forwardRef,
39
39
  Suspense,
40
- useEffect as useEffect14,
40
+ useEffect as useEffect15,
41
41
  useRef as useRef2,
42
42
  useState as useState14
43
43
  } from "react";
@@ -46,7 +46,7 @@ import videojs from "video.js";
46
46
  import "video.js/dist/video-js.css";
47
47
 
48
48
  // src/components/ControlBar/index.tsx
49
- import { useEffect as useEffect13, useState as useState13 } from "react";
49
+ import { useEffect as useEffect14, useState as useState13 } from "react";
50
50
 
51
51
  // src/utils/index.ts
52
52
  var durationFormater = (seconds) => {
@@ -893,7 +893,12 @@ var QualityOption = ({
893
893
  }
894
894
  );
895
895
  };
896
- var QualityMenu = ({ width, onClick, isTrailer }) => {
896
+ var QualityMenu = ({
897
+ width,
898
+ onClick,
899
+ isTrailer,
900
+ setIsModalChanged
901
+ }) => {
897
902
  const { player } = useSoftBuildersVideoPlayerContext();
898
903
  const [closeMenuFunction, setCloseMenuFunction] = useState4(void 0);
899
904
  const [qualities, setQualities] = useState4(
@@ -969,6 +974,7 @@ var QualityMenu = ({ width, onClick, isTrailer }) => {
969
974
  setCurrentQualitySrc(source == null ? void 0 : source.label);
970
975
  }
971
976
  closeMenuFunction && closeMenuFunction();
977
+ setIsModalChanged(false);
972
978
  }
973
979
  },
974
980
  `quality-${q == null ? void 0 : q.label}-${i}`
@@ -1461,17 +1467,21 @@ var SubtitleMenu = ({
1461
1467
  var SubtitleMenu_default = SubtitleMenu;
1462
1468
 
1463
1469
  // src/components/Tooltip/GlobalTooltip.tsx
1464
- import { useState as useState12 } from "react";
1470
+ import { useEffect as useEffect13, useState as useState12 } from "react";
1465
1471
  import { jsx as jsx38, jsxs as jsxs16 } from "react/jsx-runtime";
1466
1472
  var TooltipModal = ({
1467
1473
  content,
1468
1474
  children,
1469
1475
  isLeft = false,
1470
- width = 0
1476
+ width = 0,
1477
+ isModalChanged
1471
1478
  }) => {
1472
1479
  const [isOpen, setIsOpen] = useState12(false);
1473
1480
  const showTooltip = () => setIsOpen(true);
1474
1481
  const hideTooltip = () => setIsOpen(false);
1482
+ useEffect13(() => {
1483
+ hideTooltip();
1484
+ }, [isModalChanged]);
1475
1485
  return /* @__PURE__ */ jsxs16(
1476
1486
  "div",
1477
1487
  {
@@ -1534,6 +1544,7 @@ var ControlBar = ({
1534
1544
  const { setPlayer, setDuration } = useSoftBuildersVideoPlayerContext();
1535
1545
  const [width, setWidth] = useState13(0);
1536
1546
  const [isSeeking, setIsSeeking] = useState13(true);
1547
+ const [isModalChanged, setIsModalChanged] = useState13(false);
1537
1548
  const seek = (duration2) => {
1538
1549
  const currentTime = Number((player == null ? void 0 : player.currentTime()) || 0);
1539
1550
  player == null ? void 0 : player.currentTime(currentTime + duration2);
@@ -1557,10 +1568,10 @@ var ControlBar = ({
1557
1568
  else player == null ? void 0 : player.pause();
1558
1569
  setIsPaused(!isPaused);
1559
1570
  };
1560
- useEffect13(() => {
1571
+ useEffect14(() => {
1561
1572
  setPlayer(player);
1562
1573
  }, [player]);
1563
- useEffect13(() => {
1574
+ useEffect14(() => {
1564
1575
  setDuration(duration);
1565
1576
  }, [duration]);
1566
1577
  return /* @__PURE__ */ jsxs17(
@@ -1649,17 +1660,27 @@ var ControlBar = ({
1649
1660
  handleControlDisplayTimer
1650
1661
  }
1651
1662
  ) }),
1652
- /* @__PURE__ */ jsx39(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx39("p", { children: "Quality" }), children: /* @__PURE__ */ jsx39(
1653
- QualityMenu_default,
1663
+ /* @__PURE__ */ jsx39(
1664
+ GlobalTooltip_default,
1654
1665
  {
1655
- isTrailer,
1666
+ isModalChanged,
1656
1667
  width,
1657
- onClick: (e, isOpen) => {
1658
- setVolumeToggler(!volumeSliderToggler);
1659
- setIsQualityMenuOpen && setIsQualityMenuOpen(isOpen);
1660
- }
1668
+ content: /* @__PURE__ */ jsx39("p", { children: "Quality" }),
1669
+ children: /* @__PURE__ */ jsx39(
1670
+ QualityMenu_default,
1671
+ {
1672
+ isTrailer,
1673
+ width,
1674
+ setIsModalChanged: (val) => setIsModalChanged(val),
1675
+ onClick: (e, isOpen) => {
1676
+ setVolumeToggler(!volumeSliderToggler);
1677
+ setIsQualityMenuOpen && setIsQualityMenuOpen(isOpen);
1678
+ setIsModalChanged(true);
1679
+ }
1680
+ }
1681
+ )
1661
1682
  }
1662
- ) }),
1683
+ ),
1663
1684
  disableNote && /* @__PURE__ */ jsx39(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx39("p", { children: "Create note" }), children: /* @__PURE__ */ jsx39(
1664
1685
  CreateNoteMenu_default,
1665
1686
  {
@@ -1864,7 +1885,7 @@ var VideoPlayerComponent = forwardRef(
1864
1885
  });
1865
1886
  }
1866
1887
  };
1867
- useEffect14(() => {
1888
+ useEffect15(() => {
1868
1889
  if (!playerRef.current) {
1869
1890
  const videoElement = document.createElement("video-js");
1870
1891
  videoElement.setAttribute("playsinline", "true");
@@ -1898,7 +1919,7 @@ var VideoPlayerComponent = forwardRef(
1898
1919
  }
1899
1920
  };
1900
1921
  }, [id]);
1901
- useEffect14(() => {
1922
+ useEffect15(() => {
1902
1923
  if (!playerRef.current) {
1903
1924
  const videoElement = document.createElement("video-js");
1904
1925
  videoElement.setAttribute("playsinline", "true");
@@ -1935,12 +1956,12 @@ var VideoPlayerComponent = forwardRef(
1935
1956
  }
1936
1957
  };
1937
1958
  }, [options]);
1938
- useEffect14(() => {
1959
+ useEffect15(() => {
1939
1960
  if (playerRef.current) {
1940
1961
  playerRef.current.currentTime(startTime);
1941
1962
  }
1942
1963
  }, [startTime]);
1943
- useEffect14(() => {
1964
+ useEffect15(() => {
1944
1965
  if (playerRef.current && isReady) {
1945
1966
  const currentTime = playerRef.current.currentTime() || 0;
1946
1967
  if (isPaused) {
@@ -1950,7 +1971,7 @@ var VideoPlayerComponent = forwardRef(
1950
1971
  }
1951
1972
  }
1952
1973
  }, [isPaused]);
1953
- useEffect14(() => {
1974
+ useEffect15(() => {
1954
1975
  const controlBarTimeout = setTimeout(() => {
1955
1976
  renderControlBar(
1956
1977
  id,
@@ -1986,7 +2007,7 @@ var VideoPlayerComponent = forwardRef(
1986
2007
  isReady,
1987
2008
  id
1988
2009
  ]);
1989
- useEffect14(() => {
2010
+ useEffect15(() => {
1990
2011
  if (isReady) {
1991
2012
  const playButtonTimeout = setTimeout(() => {
1992
2013
  renderBigPlayButton(
@@ -2003,7 +2024,7 @@ var VideoPlayerComponent = forwardRef(
2003
2024
  return () => clearTimeout(playButtonTimeout);
2004
2025
  }
2005
2026
  }, [isPaused, opacity, isReady, id, height, heightValue, isLoading]);
2006
- useEffect14(() => {
2027
+ useEffect15(() => {
2007
2028
  if (playerRef.current) {
2008
2029
  const intervalId = setInterval(() => {
2009
2030
  if (playerRef.current) setIsPaused(playerRef.current.paused());
@@ -2012,7 +2033,7 @@ var VideoPlayerComponent = forwardRef(
2012
2033
  }
2013
2034
  }, []);
2014
2035
  const timeoutRef = useRef2(null);
2015
- useEffect14(() => {
2036
+ useEffect15(() => {
2016
2037
  if (isQualityMenuOpen || isSubtitleMenuOpen) {
2017
2038
  if (timeoutRef.current) {
2018
2039
  clearTimeout(timeoutRef.current);
@@ -2028,7 +2049,7 @@ var VideoPlayerComponent = forwardRef(
2028
2049
  }, 3e3);
2029
2050
  }
2030
2051
  }, [isQualityMenuOpen, isSubtitleMenuOpen]);
2031
- useEffect14(() => {
2052
+ useEffect15(() => {
2032
2053
  if (isNoteOpen) {
2033
2054
  if (timeoutRef.current) {
2034
2055
  clearTimeout(timeoutRef.current);
@@ -2076,7 +2097,7 @@ var VideoPlayerComponent = forwardRef(
2076
2097
  }
2077
2098
  };
2078
2099
  const videoRefs = useRef2(null);
2079
- useEffect14(() => {
2100
+ useEffect15(() => {
2080
2101
  const observer = new IntersectionObserver(
2081
2102
  (entries) => {
2082
2103
  entries.forEach((entry) => {
@@ -2108,7 +2129,7 @@ var VideoPlayerComponent = forwardRef(
2108
2129
  };
2109
2130
  }, []);
2110
2131
  const [timeSeeker, setTimeSeeker] = useState14("0");
2111
- useEffect14(() => {
2132
+ useEffect15(() => {
2112
2133
  const updateTimeSeeker = () => {
2113
2134
  if (playerRef.current && isReady) {
2114
2135
  const currentTime = playerRef.current.currentTime();
@@ -2255,9 +2276,9 @@ var Component = forwardRef2(
2255
2276
  if (options.height === void 0) options.height = DEFAULT_OPTIONS.height;
2256
2277
  if (options.width === void 0) options.width = DEFAULT_OPTIONS.width;
2257
2278
  const [tracks, setTracks] = useState15([]);
2258
- useEffect15(() => {
2279
+ useEffect16(() => {
2259
2280
  }, [isFocused]);
2260
- useEffect15(() => {
2281
+ useEffect16(() => {
2261
2282
  const getTracks = async () => {
2262
2283
  const newTracks = [];
2263
2284
  if (Array.isArray(options == null ? void 0 : options.tracks))
@@ -2276,7 +2297,7 @@ var Component = forwardRef2(
2276
2297
  }, [options == null ? void 0 : options.tracks]);
2277
2298
  const id = (Date.now() + Math.random() * 100).toString();
2278
2299
  const [uuid, setUuid] = useState15("");
2279
- useEffect15(() => {
2300
+ useEffect16(() => {
2280
2301
  setUuid(uuidv4());
2281
2302
  }, []);
2282
2303
  return /* @__PURE__ */ jsx42(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "softbuilders-react-video-player",
3
3
  "description": "Standalone video player component",
4
- "version": "1.2.23",
4
+ "version": "1.2.24",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [