softbuilders-react-video-player 1.1.77 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ChapterTooltip/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;AAE/C,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AAQrF,MAAM,cAAc,GAAG,CAAC,EAAE,OAAO,EAAS,EAAE,EAAE;IAC5C,MAAM,EAAE,MAAM,EAAE,GAAG,iCAAiC,EAAE,CAAC;IAEvD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,EAAE,WAAW,EAAE,GAAG,iCAAiC,EAAE,CAAC;IAE5D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,WAAW,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;YAClD,OAAO,CAAC,IAAI,CAAC,CAAC;YAEd,UAAU,CAAC,GAAG,EAAE;gBACd,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC,EAAE,IAAI,CAAC,CAAC;QACX,CAAC;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IAErC,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,EAAE;QAC/B,CAAC,CAAC,eAAe,EAAE,CAAC;QAEpB,MAAM,cAAc,GAAG,CAAC,CAAC,aAAa,CAAC;QACvC,MAAM,aAAa,GACjB,CAAC,CAAC,OAAO,GAAG,cAAc,CAAC,qBAAqB,EAAE,CAAC,IAAI,CAAC;QAC1D,MAAM,YAAY,GAAG,cAAc,CAAC,WAAW,CAAC;QAEhD,0E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AAC,CAAC;QAE1D,oDAAoD;QACpD,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC,CAAC;IAEF,OAAO,CACL,cACE,EAAE,EAAE,cAAc,OAAO,CAAC,KAAK,EAAE,EACjC,SAAS,EAAC,iEAAiE,EAC3E,KAAK,EAAE;YACL,IAAI,EAAE,GAAG,OAAO,CAAC,eAAe,GAAG;YACnC,KAAK,EAAE,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,eAAe,GAAG;SAC7D,EACD,YAAY,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EACjC,YAAY,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,YAElC,iBACE,EAAE,EAAE,WAAW,OAAO,CAAC,KAAK,EAAE,EAC9B,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAE,kBAAkB,YAE3B,cAAK,SAAS,EAAC,4EAA4E,YACzF,KAAC,OAAO,IAAC,IAAI,EAAE,IAAI,YACjB,eAAK,SAAS,EAAC,8CAA8C,aAC3D,sBAAI,OAAO,CAAC,KAAK,GAAK,EACtB,aAAG,SAAS,EAAC,uDAAuD,aACjE,gBAAgB,CAAC,OAAO,CAAC,SAAS,CAAC,QAAI,GAAG,EAC1C,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,IAChC,IACA,GACE,GACN,GACC,GACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -26,7 +26,7 @@ const ChapterTooltip = ({ chapter }: Props) => {
26
26
  }
27
27
  }, [currentTime, chapter.startTime]);
28
28
 
29
- const handleClickChapter = (e) => {
29
+ const handleClickChapter = (e: any) => {
30
30
  e.stopPropagation();
31
31
 
32
32
  const chapterElement = e.currentTarget;
@@ -3,8 +3,9 @@ import "./style.css";
3
3
  type Props = {
4
4
  value: number;
5
5
  handleValueChange: React.ChangeEventHandler<HTMLInputElement>;
6
+ handleSliderClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
6
7
  min?: number;
7
8
  max?: number;
8
9
  } & InputHTMLAttributes<HTMLInputElement>;
9
- declare const Slider: ({ value, handleValueChange, min, max, className, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ declare const Slider: ({ value, handleValueChange, min, max, className, handleSliderClick, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
10
11
  export default Slider;
@@ -12,9 +12,10 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import "./style.css";
14
14
  const Slider = (_a) => {
15
- var { value, handleValueChange, min = 0, max = 100, className } = _a, rest = __rest(_a, ["value", "handleValueChange", "min", "max", "className"]);
16
- return (_jsx("input", Object.assign({ type: "range", min: min, onMouseDown: (e) => e.stopPropagation(), onClick: (e) => {
15
+ var { value, handleValueChange, min = 0, max = 100, className, handleSliderClick = () => { } } = _a, rest = __rest(_a, ["value", "handleValueChange", "min", "max", "className", "handleSliderClick"]);
16
+ return (_jsx("input", Object.assign({ type: 'range', min: min, onMouseDown: (e) => e.stopPropagation(), onClick: (e) => {
17
17
  e.stopPropagation();
18
+ handleSliderClick(e);
18
19
  }, onMouseUp: (e) => e.stopPropagation(), max: max, value: value, onChange: (e) => {
19
20
  e.preventDefault();
20
21
  e.stopPropagation();
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Slider/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,aAAa,CAAC;AASrB,MAAM,MAAM,GAAG,CAAC,EAOR,EAAE,EAAE;QAPI,EACd,KAAK,EACL,iBAAiB,EACjB,GAAG,GAAG,CAAC,EACP,GAAG,GAAG,GAAG,EACT,SAAS,OAEH,EADH,IAAI,cANO,yDAOf,CADQ;IAEP,OAAO,CACL,8BACE,IAAI,EAAC,OAAO,EACZ,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACvC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,eAAe,EAAE,CAAC;QACtB,CAAC,EACD,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACrC,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;YACd,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,iBAAiB,CAAC,CAAC,CAAC,CAAC;QACvB,CAAC,EACD,SAAS,EAAE;UACP,SAAS,EAAE,EACf,KAAK,EAAE;YACL,UAAU,EAAE,qCAAqC,KAAK,gBAAgB,KAAK,IAAI;SAChF,IACG,IAAI,EACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Slider/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,aAAa,CAAC;AAUrB,MAAM,MAAM,GAAG,CAAC,EAQR,EAAE,EAAE;QARI,EACf,KAAK,EACL,iBAAiB,EACjB,GAAG,GAAG,CAAC,EACP,GAAG,GAAG,GAAG,EACT,SAAS,EACT,iBAAiB,GAAG,GAAG,EAAE,GAAE,CAAC,OAErB,EADJ,IAAI,cAPQ,8EAQf,CADO;IAEP,OAAO,CACN,8BACC,IAAI,EAAC,OAAO,EACZ,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACvC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACd,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,iBAAiB,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC,EACD,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACrC,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;YACf,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,iBAAiB,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC,EACD,SAAS,EAAE;UACJ,SAAS,EAAE,EAClB,KAAK,EAAE;YACN,UAAU,EAAE,qCAAqC,KAAK,gBAAgB,KAAK,IAAI;SAC/E,IACG,IAAI,EACP,CACF,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -2,44 +2,47 @@ import React, { InputHTMLAttributes, SetStateAction, useState } from "react";
2
2
  import "./style.css";
3
3
 
4
4
  type Props = {
5
- value: number;
6
- handleValueChange: React.ChangeEventHandler<HTMLInputElement>;
7
- min?: number;
8
- max?: number;
5
+ value: number;
6
+ handleValueChange: React.ChangeEventHandler<HTMLInputElement>;
7
+ handleSliderClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
8
+ min?: number;
9
+ max?: number;
9
10
  } & InputHTMLAttributes<HTMLInputElement>;
10
11
 
11
12
  const Slider = ({
12
- value,
13
- handleValueChange,
14
- min = 0,
15
- max = 100,
16
- className,
17
- ...rest
13
+ value,
14
+ handleValueChange,
15
+ min = 0,
16
+ max = 100,
17
+ className,
18
+ handleSliderClick = () => {},
19
+ ...rest
18
20
  }: Props) => {
19
- return (
20
- <input
21
- type="range"
22
- min={min}
23
- onMouseDown={(e) => e.stopPropagation()}
24
- onClick={(e) => {
25
- e.stopPropagation();
26
- }}
27
- onMouseUp={(e) => e.stopPropagation()}
28
- max={max}
29
- value={value}
30
- onChange={(e) => {
31
- e.preventDefault();
32
- e.stopPropagation();
33
- handleValueChange(e);
34
- }}
35
- className={`sb-w-full sb-h-2 sb-bg-transparent sb-bg-opacity-50 sb-rounded-lg sb-appearance-none sb-cursor-pointer sb-range-slider sb-slider-thumb
21
+ return (
22
+ <input
23
+ type='range'
24
+ min={min}
25
+ onMouseDown={(e) => e.stopPropagation()}
26
+ onClick={(e) => {
27
+ e.stopPropagation();
28
+ handleSliderClick(e);
29
+ }}
30
+ onMouseUp={(e) => e.stopPropagation()}
31
+ max={max}
32
+ value={value}
33
+ onChange={(e) => {
34
+ e.preventDefault();
35
+ e.stopPropagation();
36
+ handleValueChange(e);
37
+ }}
38
+ className={`sb-w-full sb-h-2 sb-bg-transparent sb-bg-opacity-50 sb-rounded-lg sb-appearance-none sb-cursor-pointer sb-range-slider sb-slider-thumb
36
39
  ${className}`}
37
- style={{
38
- background: `linear-gradient(to right, #f97316 ${value}%, #30303070 ${value}%)`,
39
- }}
40
- {...rest}
41
- />
42
- );
40
+ style={{
41
+ background: `linear-gradient(to right, #f97316 ${value}%, #30303070 ${value}%)`,
42
+ }}
43
+ {...rest}
44
+ />
45
+ );
43
46
  };
44
47
 
45
48
  export default Slider;
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, memo, useCallback, useEffect, useMemo, useState, } from "react";
3
3
  import VideoPlayerComponent from "../VideoPlayerComponent";
4
4
  import { convertSRTtoVTT } from "../../utils";
5
+ import { isEqual } from "lodash";
5
6
  const DEFAULT_OPTIONS = {
6
7
  autoplay: false,
7
8
  controls: true,
@@ -72,8 +73,10 @@ const Component = forwardRef(({ options, notes, chapters, startTime = 0, handleS
72
73
  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 }));
73
74
  });
74
75
  const SoftBuildersVideoPlayer = memo(Component, (prevProps, nextProps) => {
75
- return (prevProps.options === nextProps.options &&
76
- // prevProps.notes === nextProps.notes &&
76
+ console.log(isEqual(prevProps.options, nextProps.options, "oooop"));
77
+ console.log(nextProps.notes, prevProps.notes, "oooop");
78
+ return (isEqual(prevProps.options, nextProps.options) &&
79
+ prevProps.notes === nextProps.notes &&
77
80
  prevProps.chapters === nextProps.chapters &&
78
81
  prevProps.startTime === nextProps.startTime);
79
82
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/SoftBuildersVideoPlayer/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EACZ,UAAU,EACV,IAAI,EACJ,WAAW,EACX,SAAS,EACT,OAAO,EACP,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,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,EAAE,IAAI;IACX,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;IACV,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,EAAE;CACX,CAAC;AAiBF,MAAM,SAAS,GAAG,UAAU,CAC1B,CACE,EACE,OAAO,EACP,KAAK,EACL,QAAQ,EACR,SAAS,GAAG,CAAC,EACb,oBAAoB,EACpB,MAAM,EACN,OAAO,EACP,SAAS,GAAG,IAAI,EAChB,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,eAAe,GACJ,EACb,GAAS,EACT,EAAE;IACF,cAAc;IACd,gBAAgB;IAChB,sBAAsB;IACtB,0BAA0B;IAC1B,kBAAkB;IAClB,4BAA4B;IAC5B,OAAO;IACP,YAAY;IAEZ,MAAM,aAAa,GAAG,OAAO,CAC3B,GAAG,EAAE,CAAC,+CACD,eAAe,GACf,OAAO,KACV,UAAU,EAAE,IAAI,EAChB,iBAAiB,EAAE,CAAC,EACpB,UAAU,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,IACpC,EACF,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AAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,GAChC,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,uBAAuB,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;IACvE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IACpE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAEvD,OAAO,CACL,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC;QAC7C,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"}
@@ -14,7 +14,7 @@ import {
14
14
  SoftBuildersVideoPlayerTrack,
15
15
  } from "../../types";
16
16
  import { convertSRTtoVTT } from "../../utils";
17
-
17
+ import { isEqual } from "lodash";
18
18
  const DEFAULT_OPTIONS: SoftBuildersVideoPlayerOptions = {
19
19
  autoplay: false,
20
20
  controls: true,
@@ -158,9 +158,12 @@ const Component = forwardRef<HTMLDivElement, Props<any>>(
158
158
  );
159
159
 
160
160
  const SoftBuildersVideoPlayer = memo(Component, (prevProps, nextProps) => {
161
+ console.log(isEqual(prevProps.options, nextProps.options, "oooop"));
162
+ console.log(nextProps.notes, prevProps.notes, "oooop");
163
+
161
164
  return (
162
- prevProps.options === nextProps.options &&
163
- // prevProps.notes === nextProps.notes &&
165
+ isEqual(prevProps.options, nextProps.options) &&
166
+ prevProps.notes === nextProps.notes &&
164
167
  prevProps.chapters === nextProps.chapters &&
165
168
  prevProps.startTime === nextProps.startTime
166
169
  );
@@ -16,6 +16,16 @@ const TimeSlider = ({ chapters }) => {
16
16
  console.log("time: ", time);
17
17
  player === null || player === void 0 ? void 0 : player.currentTime(time);
18
18
  };
19
+ const handleSliderClick = (e) => {
20
+ const slider = e.currentTarget; // Get the slider element
21
+ const rect = slider.getBoundingClientRect(); // Get the bounding rect of the slider
22
+ const offsetX = e.clientX - rect.left; // Get the click position relative to the slider
23
+ const newTimeSlider = (offsetX / rect.width) * DEFERENCE; // Calculate the new slider value
24
+ // Update the time using the same function
25
+ const time = (newTimeSlider * duration) / DEFERENCE;
26
+ player === null || player === void 0 ? void 0 : player.currentTime(time);
27
+ setTimeSlider(newTimeSlider); // Update the state to reflect the change
28
+ };
19
29
  useEffect(() => {
20
30
  const intervalId = setInterval(() => {
21
31
  const currentTime = (player === null || player === void 0 ? void 0 : player.currentTime()) || 0;
@@ -43,9 +53,9 @@ const TimeSlider = ({ chapters }) => {
43
53
  arr.push(`black 100%`);
44
54
  setMaskCuttes(arr.toString());
45
55
  }, [chapters, duration]);
46
- return (_jsxs("div", { className: " sb-w-full sb-h-2 sb-flex sb-items-center sb-justify-center", children: [_jsx("div", { className: "sb-absolute sb-top-0 sb-left-0 sb-w-full sb-z-10", children: _jsx(Slider, { value: timeSlider, handleValueChange: handleValueChange, min: MIN, max: MAX, style: {
56
+ return (_jsxs("div", { className: ' sb-w-full sb-h-2 sb-flex sb-items-center sb-justify-center', children: [_jsx("div", { className: 'sb-absolute sb-top-0 sb-left-0 sb-w-full sb-z-10', children: _jsx(Slider, { value: timeSlider, handleValueChange: handleValueChange, handleSliderClick: handleSliderClick, min: MIN, max: MAX, style: {
47
57
  background: "transparent",
48
- } }) }), _jsx("div", { className: "sb-absolute sb-top-0 sb-left-0 sb-w-full sb-h-2 sb-bg-slate-400 sb-rounded-md", style: {
58
+ } }) }), _jsx("div", { className: 'sb-absolute sb-top-0 sb-left-0 sb-w-full sb-h-2 sb-bg-slate-400 sb-rounded-md', style: {
49
59
  background: `
50
60
  linear-gradient(to right,
51
61
  #f97316 0%,
@@ -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;AAIrF,MAAM,GAAG,GAAG,CAAC,EACX,GAAG,GAAG,GAAG,CAAC;AACZ,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;AACtC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAMjC,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAS,EAAE,EAAE;IACzC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEhD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,0BAA0B,EAAE,GACpD,iCAAiC,EAAE,CAAC;IAEtC,MAAM,iBAAiB,GAAG,CAAC,CAAsC,EAAE,EAAE;QACnE,MAAM,aAAa,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7C,aAAa,CAAC,aAAa,CAAC,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;QAE9C,MAAM,IAAI,GAAG,CAAC,aAAa,GAAG,QAAQ,CAAC,GAAG,SAAS,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAE5B,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,UAAU,GAAG,WAAW,C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  import log from "video.js/dist/types/utils/log";
6
6
 
7
7
  const MIN = 0,
8
- MAX = 100;
8
+ MAX = 100;
9
9
  const DEFERENCE = Math.abs(MAX - MIN);
10
10
  const BAR_PERCENTAGE_WIDTH = 0.5;
11
11
 
12
12
  type Props = {
13
- chapters?: SoftBuildersVideoPlayerChapter[];
13
+ chapters?: SoftBuildersVideoPlayerChapter[];
14
14
  };
15
15
 
16
16
  const TimeSlider = ({ chapters }: Props) => {
17
- const [timeSlider, setTimeSlider] = useState(0);
18
-
19
- const { player, duration, downloadedBufferPercentage } =
20
- useSoftBuildersVideoPlayerContext();
21
-
22
- const handleValueChange = (e: React.ChangeEvent<HTMLInputElement>) => {
23
- const newTimeSlider = Number(e.target.value);
24
- setTimeSlider(newTimeSlider);
25
- console.log("newTimeSlider: ", newTimeSlider);
26
-
27
- const time = (newTimeSlider * duration) / DEFERENCE;
28
- console.log("time: ", time);
29
-
30
- player?.currentTime(time);
31
- };
32
-
33
- useEffect(() => {
34
- const intervalId = setInterval(() => {
35
- const currentTime = player?.currentTime() || 0;
36
-
37
- const time = (currentTime * DEFERENCE) / duration;
38
-
39
- setTimeSlider(time);
40
- }, 1000);
41
-
42
- // Cleanup function to clear the interval
43
- return () => clearInterval(intervalId);
44
- }, [player, duration]);
45
-
46
- const [maskCuttes, setMaskCuttes] = useState("");
47
-
48
- useEffect(() => {
49
- const arr: string[] = ["black 0%"];
50
- chapters?.forEach((c) => {
51
- const startPercentage = Math.floor((c.startTime * 100) / duration);
52
- const endPercentage = Math.floor((c.endTime * 100) / duration);
53
- arr.push(`black ${startPercentage}%`);
54
- arr.push(`transparent ${startPercentage}%`);
55
- arr.push(`transparent ${startPercentage + BAR_PERCENTAGE_WIDTH}%`);
56
-
57
- arr.push(`black ${startPercentage + BAR_PERCENTAGE_WIDTH}%`);
58
- arr.push(`black ${endPercentage}%`);
59
-
60
- arr.push(`transparent ${endPercentage}%`);
61
- arr.push(`transparent ${endPercentage + BAR_PERCENTAGE_WIDTH}%`);
62
-
63
- arr.push(`black ${endPercentage + BAR_PERCENTAGE_WIDTH}%`);
64
- });
65
- arr.push(`black 100%`);
66
-
67
- setMaskCuttes(arr.toString());
68
- }, [chapters, duration]);
69
-
70
- return (
71
- <div className=" sb-w-full sb-h-2 sb-flex sb-items-center sb-justify-center">
72
- <div className="sb-absolute sb-top-0 sb-left-0 sb-w-full sb-z-10">
73
- <Slider
74
- value={timeSlider}
75
- handleValueChange={handleValueChange}
76
- min={MIN}
77
- max={MAX}
78
- style={{
79
- background: "transparent",
80
- }}
81
- />
82
- </div>
83
-
84
- <div
85
- className="sb-absolute sb-top-0 sb-left-0 sb-w-full sb-h-2 sb-bg-slate-400 sb-rounded-md"
86
- style={{
87
- background: `
17
+ const [timeSlider, setTimeSlider] = useState(0);
18
+
19
+ const { player, duration, downloadedBufferPercentage } =
20
+ useSoftBuildersVideoPlayerContext();
21
+
22
+ const handleValueChange = (e: React.ChangeEvent<HTMLInputElement>) => {
23
+ const newTimeSlider = Number(e.target.value);
24
+ setTimeSlider(newTimeSlider);
25
+ console.log("newTimeSlider: ", newTimeSlider);
26
+
27
+ const time = (newTimeSlider * duration) / DEFERENCE;
28
+ console.log("time: ", time);
29
+
30
+ player?.currentTime(time);
31
+ };
32
+
33
+ const handleSliderClick = (e: React.MouseEvent<HTMLDivElement>) => {
34
+ const slider = e.currentTarget; // Get the slider element
35
+ const rect = slider.getBoundingClientRect(); // Get the bounding rect of the slider
36
+ const offsetX = e.clientX - rect.left; // Get the click position relative to the slider
37
+ const newTimeSlider = (offsetX / rect.width) * DEFERENCE; // Calculate the new slider value
38
+
39
+ // Update the time using the same function
40
+ const time = (newTimeSlider * duration) / DEFERENCE;
41
+ player?.currentTime(time);
42
+ setTimeSlider(newTimeSlider); // Update the state to reflect the change
43
+ };
44
+
45
+ useEffect(() => {
46
+ const intervalId = setInterval(() => {
47
+ const currentTime = player?.currentTime() || 0;
48
+
49
+ const time = (currentTime * DEFERENCE) / duration;
50
+
51
+ setTimeSlider(time);
52
+ }, 1000);
53
+
54
+ // Cleanup function to clear the interval
55
+ return () => clearInterval(intervalId);
56
+ }, [player, duration]);
57
+
58
+ const [maskCuttes, setMaskCuttes] = useState("");
59
+
60
+ useEffect(() => {
61
+ const arr: string[] = ["black 0%"];
62
+ chapters?.forEach((c) => {
63
+ const startPercentage = Math.floor((c.startTime * 100) / duration);
64
+ const endPercentage = Math.floor((c.endTime * 100) / duration);
65
+ arr.push(`black ${startPercentage}%`);
66
+ arr.push(`transparent ${startPercentage}%`);
67
+ arr.push(`transparent ${startPercentage + BAR_PERCENTAGE_WIDTH}%`);
68
+
69
+ arr.push(`black ${startPercentage + BAR_PERCENTAGE_WIDTH}%`);
70
+ arr.push(`black ${endPercentage}%`);
71
+
72
+ arr.push(`transparent ${endPercentage}%`);
73
+ arr.push(`transparent ${endPercentage + BAR_PERCENTAGE_WIDTH}%`);
74
+
75
+ arr.push(`black ${endPercentage + BAR_PERCENTAGE_WIDTH}%`);
76
+ });
77
+ arr.push(`black 100%`);
78
+
79
+ setMaskCuttes(arr.toString());
80
+ }, [chapters, duration]);
81
+
82
+ return (
83
+ <div className=' sb-w-full sb-h-2 sb-flex sb-items-center sb-justify-center'>
84
+ <div className='sb-absolute sb-top-0 sb-left-0 sb-w-full sb-z-10'>
85
+ <Slider
86
+ value={timeSlider}
87
+ handleValueChange={handleValueChange}
88
+ handleSliderClick={handleSliderClick}
89
+ min={MIN}
90
+ max={MAX}
91
+ style={{
92
+ background: "transparent",
93
+ }}
94
+ />
95
+ </div>
96
+
97
+ <div
98
+ className='sb-absolute sb-top-0 sb-left-0 sb-w-full sb-h-2 sb-bg-slate-400 sb-rounded-md'
99
+ style={{
100
+ background: `
88
101
  linear-gradient(to right,
89
102
  #f97316 0%,
90
103
  #f97316 ${timeSlider}%,
@@ -94,17 +107,16 @@ const TimeSlider = ({ chapters }: Props) => {
94
107
  #30303030 100%
95
108
  )
96
109
  `,
97
- maskImage: `
110
+ maskImage: `
98
111
  linear-gradient(to right,
99
112
  ${maskCuttes}
100
113
  )
101
114
  `,
102
- maskSize: "100% 100%",
103
- maskRepeat: "no-repeat",
104
- }}
105
- ></div>
106
- </div>
107
- );
115
+ maskSize: "100% 100%",
116
+ maskRepeat: "no-repeat",
117
+ }}></div>
118
+ </div>
119
+ );
108
120
  };
109
121
 
110
122
  export default TimeSlider;
@@ -8,6 +8,7 @@ import "./style/style.css";
8
8
  import "../../styles/tailwind.css";
9
9
  import { SoftBuildersVideoPlayerProvider } from "./provider";
10
10
  import BigPlayButton from "../BigPlayButton";
11
+ import { isEqual } from "lodash";
11
12
  let bigPlayButtonRoot = {};
12
13
  const renderBigPlayButton = (id, player, isPaused, setIsPaused, opacity = "100") => {
13
14
  const container = document.getElementById(`video-container-${id}`);
@@ -58,6 +59,7 @@ const VideoPlayerComponent = forwardRef(({ id, options, notes, chapters, startTi
58
59
  const [isQualityMenuOpen, setIsQualityMenuOpen] = useState(false);
59
60
  const [isSubtitleMenuOpen, setIsSubtitleMenuOpen] = useState(false);
60
61
  const [isNoteOpen, setNoteOpen] = useState(false);
62
+ console.log("notes", notes);
61
63
  const onReady = (player) => {
62
64
  console.log("onReady: ", onReady);
63
65
  if (playerRef) {
@@ -75,24 +77,55 @@ const VideoPlayerComponent = forwardRef(({ id, options, notes, chapters, startTi
75
77
  });
76
78
  }
77
79
  };
80
+ const initializePlayer = () => {
81
+ const videoElement = document.createElement("video-js");
82
+ videoElement.setAttribute("playsinline", "true");
83
+ videoElement.classList.add("vjs-big-play-centered");
84
+ if (poster) {
85
+ videoElement.setAttribute("poster", poster);
86
+ }
87
+ videoRef.current.appendChild(videoElement);
88
+ videoElement.style.width = "100%";
89
+ videoElement.style.height = "100%";
90
+ playerRef.current = videojs(videoElement, options, () => {
91
+ var _a;
92
+ (_a = playerRef.current) === null || _a === void 0 ? void 0 : _a.currentTime(startTime);
93
+ });
94
+ onReady(playerRef.current);
95
+ };
78
96
  useEffect(() => {
79
- if (!playerRef.current) {
80
- const videoElement = document.createElement("video-js");
81
- videoElement.setAttribute("playsinline", "true");
82
- videoElement.classList.add("vjs-big-play-centered");
83
- // Set the poster attribute here
84
- if (poster) {
85
- videoElement.setAttribute("poster", poster);
97
+ if (playerRef.current) {
98
+ if (!isEqual(playerRef.current.poster_, poster)) {
99
+ playerRef.current.dispose();
100
+ console.log("dispose: ");
101
+ playerRef.current = undefined;
86
102
  }
87
- videoRef.current.appendChild(videoElement);
88
- videoElement.style.width = "100%";
89
- videoElement.style.height = "100%";
90
- videoElement.style.objectFit = "cover";
91
- playerRef.current = videojs(videoElement, options, () => {
92
- onReady(playerRef.current);
93
- });
94
103
  }
95
- }, [options, poster]); // Added poster to dependency array
104
+ initializePlayer();
105
+ console.log("initializePlayer: ghhh");
106
+ }, [options]);
107
+ useEffect(() => {
108
+ return () => {
109
+ if (playerRef.current) {
110
+ console.log(playerRef.current, options, "jk");
111
+ if (!isEqual(playerRef.current.poster_, poster)) {
112
+ playerRef.current.dispose();
113
+ console.log("dispose7: ");
114
+ playerRef.current = undefined;
115
+ setTimeout(() => {
116
+ if (bigPlayButtonRoot[id]) {
117
+ bigPlayButtonRoot[id].unmount();
118
+ bigPlayButtonRoot[id] = undefined;
119
+ }
120
+ if (controlBarRoot[id]) {
121
+ controlBarRoot[id].unmount();
122
+ controlBarRoot[id] = undefined;
123
+ }
124
+ }, 0);
125
+ }
126
+ }
127
+ };
128
+ }, [options]);
96
129
  useEffect(() => {
97
130
  if (playerRef.current && isReady) {
98
131
  const currentTime = playerRef.current.currentTime() || 0;
@@ -109,6 +142,7 @@ const VideoPlayerComponent = forwardRef(({ id, options, notes, chapters, startTi
109
142
  useEffect(() => {
110
143
  if (isReady) {
111
144
  const controlBarTimeout = setTimeout(() => {
145
+ console.log("isReady: ", isReady);
112
146
  renderControlBar(id, playerRef.current, isPaused, setIsPaused, duration, notes, chapters, 5, handleSaveNoteAction, opacity, (e) => {
113
147
  handlePlayerClick(e, true);
114
148
  }, bgColor, setIsQualityMenuOpen, setIsSubtitleMenuOpen, disableNote, setNoteOpen, noteButtonClick);
@@ -134,7 +168,7 @@ const VideoPlayerComponent = forwardRef(({ id, options, notes, chapters, startTi
134
168
  }, 500);
135
169
  return () => clearTimeout(playButtonTimeout);
136
170
  }
137
- }, [id, isPaused, isReady, opacity]);
171
+ }, [id, isPaused, isReady, opacity, options, notes]);
138
172
  useEffect(() => {
139
173
  if (playerRef.current) {
140
174
  const intervalId = setInterval(() => {
@@ -152,27 +186,6 @@ const VideoPlayerComponent = forwardRef(({ id, options, notes, chapters, startTi
152
186
  (_b = playerRef.current) === null || _b === void 0 ? void 0 : _b.play();
153
187
  }
154
188
  }, [startTime]);
155
- useEffect(() => {
156
- return () => {
157
- if (playerRef.current) {
158
- // Defer cleanup to avoid flushSync issues during rendering
159
- setTimeout(() => {
160
- var _a;
161
- if (bigPlayButtonRoot[id]) {
162
- bigPlayButtonRoot[id].unmount();
163
- bigPlayButtonRoot[id] = undefined;
164
- }
165
- if (controlBarRoot[id]) {
166
- controlBarRoot[id].unmount();
167
- controlBarRoot[id] = undefined;
168
- }
169
- // Dispose the player after custom elements are cleaned up
170
- (_a = playerRef.current) === null || _a === void 0 ? void 0 : _a.dispose();
171
- playerRef.current = undefined;
172
- }, 0);
173
- }
174
- };
175
- }, []);
176
189
  const timeoutRef = useRef(null);
177
190
  useEffect(() => {
178
191
  if (isQualityMenuOpen || isSubtitleMenuOpen) {
@@ -192,8 +205,7 @@ const VideoPlayerComponent = forwardRef(({ id, options, notes, chapters, startTi
192
205
  }
193
206
  }, [isQualityMenuOpen, isSubtitleMenuOpen]);
194
207
  useEffect(() => {
195
- if (playerRef.current) {
196
- }
208
+ console.log("notes: ", notes);
197
209
  }, [notes]);
198
210
  const handlePlayerClick = async (e, isTimerOnly = false) => {
199
211
  e.preventDefault();
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/VideoPlayerComponent/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,S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;AACJ,CAAC,CACF,CAAC;AACF,eAAe,oBAAoB,CAAC"}
@@ -13,8 +13,8 @@ import "./style/style.css";
13
13
  import "../../styles/tailwind.css";
14
14
  import { SoftBuildersVideoPlayerProvider } from "./provider";
15
15
  import BigPlayButton from "../BigPlayButton";
16
- import { flushSync } from "react-dom";
17
- import { use } from "video.js/dist/types/tech/middleware";
16
+ import { isEqual } from "lodash";
17
+
18
18
  let bigPlayButtonRoot: {
19
19
  [key: string]: ReactDOM.Root | undefined;
20
20
  } = {};
@@ -129,6 +129,7 @@ export type Props<T = any> = {
129
129
  childRef?: React.Ref<HTMLDivElement>;
130
130
  noteButtonClick?: (e: any) => void;
131
131
  };
132
+
132
133
  const VideoPlayerComponent = forwardRef<HTMLDivElement, Props<any>>(
133
134
  (
134
135
  {
@@ -159,6 +160,8 @@ const VideoPlayerComponent = forwardRef<HTMLDivElement, Props<any>>(
159
160
  const [isQualityMenuOpen, setIsQualityMenuOpen] = useState(false);
160
161
  const [isSubtitleMenuOpen, setIsSubtitleMenuOpen] = useState(false);
161
162
  const [isNoteOpen, setNoteOpen] = useState(false);
163
+ console.log("notes", notes);
164
+
162
165
  const onReady = (player: Player) => {
163
166
  console.log("onReady: ", onReady);
164
167
  if (playerRef) {
@@ -177,26 +180,56 @@ const VideoPlayerComponent = forwardRef<HTMLDivElement, Props<any>>(
177
180
  });
178
181
  }
179
182
  };
180
- useEffect(() => {
181
- if (!playerRef.current) {
182
- const videoElement = document.createElement("video-js");
183
183
 
184
- videoElement.setAttribute("playsinline", "true");
184
+ const initializePlayer = () => {
185
+ const videoElement = document.createElement("video-js");
186
+ videoElement.setAttribute("playsinline", "true");
187
+ videoElement.classList.add("vjs-big-play-centered");
188
+ if (poster) {
189
+ videoElement.setAttribute("poster", poster);
190
+ }
191
+ videoRef.current.appendChild(videoElement);
192
+ videoElement.style.width = "100%";
193
+ videoElement.style.height = "100%";
185
194
 
186
- videoElement.classList.add("vjs-big-play-centered");
187
- // Set the poster attribute here
188
- if (poster) {
189
- videoElement.setAttribute("poster", poster);
195
+ playerRef.current = videojs(videoElement, options, () => {
196
+ playerRef.current?.currentTime(startTime);
197
+ });
198
+ onReady(playerRef.current);
199
+ };
200
+ useEffect(() => {
201
+ if (playerRef.current) {
202
+ if (!isEqual(playerRef.current.poster_, poster)) {
203
+ playerRef.current.dispose();
204
+ console.log("dispose: ");
205
+ playerRef.current = undefined;
190
206
  }
191
- videoRef.current.appendChild(videoElement);
192
- videoElement.style.width = "100%";
193
- videoElement.style.height = "100%";
194
- videoElement.style.objectFit = "cover";
195
- playerRef.current = videojs(videoElement, options, () => {
196
- onReady(playerRef.current as Player);
197
- });
198
207
  }
199
- }, [options, poster]); // Added poster to dependency array
208
+ initializePlayer();
209
+ console.log("initializePlayer: ghhh");
210
+ }, [options]);
211
+ useEffect(() => {
212
+ return () => {
213
+ if (playerRef.current) {
214
+ console.log(playerRef.current, options, "jk");
215
+ if (!isEqual(playerRef.current.poster_, poster)) {
216
+ playerRef.current.dispose();
217
+ console.log("dispose7: ");
218
+ playerRef.current = undefined;
219
+ setTimeout(() => {
220
+ if (bigPlayButtonRoot[id]) {
221
+ bigPlayButtonRoot[id].unmount();
222
+ bigPlayButtonRoot[id] = undefined;
223
+ }
224
+ if (controlBarRoot[id]) {
225
+ controlBarRoot[id].unmount();
226
+ controlBarRoot[id] = undefined;
227
+ }
228
+ }, 0);
229
+ }
230
+ }
231
+ };
232
+ }, [options]);
200
233
  useEffect(() => {
201
234
  if (playerRef.current && isReady) {
202
235
  const currentTime = playerRef.current.currentTime() || 0;
@@ -211,6 +244,8 @@ const VideoPlayerComponent = forwardRef<HTMLDivElement, Props<any>>(
211
244
  useEffect(() => {
212
245
  if (isReady) {
213
246
  const controlBarTimeout = setTimeout(() => {
247
+ console.log("isReady: ", isReady);
248
+
214
249
  renderControlBar(
215
250
  id,
216
251
  playerRef.current,
@@ -260,7 +295,7 @@ const VideoPlayerComponent = forwardRef<HTMLDivElement, Props<any>>(
260
295
  }, 500);
261
296
  return () => clearTimeout(playButtonTimeout);
262
297
  }
263
- }, [id, isPaused, isReady, opacity]);
298
+ }, [id, isPaused, isReady, opacity, options, notes]);
264
299
  useEffect(() => {
265
300
  if (playerRef.current) {
266
301
  const intervalId = setInterval(() => {
@@ -276,27 +311,7 @@ const VideoPlayerComponent = forwardRef<HTMLDivElement, Props<any>>(
276
311
  playerRef.current?.play();
277
312
  }
278
313
  }, [startTime]);
279
- useEffect(() => {
280
- return () => {
281
- if (playerRef.current) {
282
- // Defer cleanup to avoid flushSync issues during rendering
283
- setTimeout(() => {
284
- if (bigPlayButtonRoot[id]) {
285
- bigPlayButtonRoot[id].unmount();
286
- bigPlayButtonRoot[id] = undefined;
287
- }
288
- if (controlBarRoot[id]) {
289
- controlBarRoot[id].unmount();
290
- controlBarRoot[id] = undefined;
291
- }
292
314
 
293
- // Dispose the player after custom elements are cleaned up
294
- playerRef.current?.dispose();
295
- playerRef.current = undefined;
296
- }, 0);
297
- }
298
- };
299
- }, []);
300
315
  const timeoutRef = useRef<any>(null);
301
316
  useEffect(() => {
302
317
  if (isQualityMenuOpen || isSubtitleMenuOpen) {
@@ -317,8 +332,7 @@ const VideoPlayerComponent = forwardRef<HTMLDivElement, Props<any>>(
317
332
  }, [isQualityMenuOpen, isSubtitleMenuOpen]);
318
333
 
319
334
  useEffect(() => {
320
- if (playerRef.current) {
321
- }
335
+ console.log("notes: ", notes);
322
336
  }, [notes]);
323
337
 
324
338
  const handlePlayerClick = async (e: any, isTimerOnly = false) => {
package/dist/index.mjs CHANGED
@@ -171,13 +171,16 @@ var Slider = (_a) => {
171
171
  handleValueChange,
172
172
  min = 0,
173
173
  max = 100,
174
- className
174
+ className,
175
+ handleSliderClick = () => {
176
+ }
175
177
  } = _b, rest = __objRest(_b, [
176
178
  "value",
177
179
  "handleValueChange",
178
180
  "min",
179
181
  "max",
180
- "className"
182
+ "className",
183
+ "handleSliderClick"
181
184
  ]);
182
185
  return /* @__PURE__ */ jsx3(
183
186
  "input",
@@ -187,6 +190,7 @@ var Slider = (_a) => {
187
190
  onMouseDown: (e) => e.stopPropagation(),
188
191
  onClick: (e) => {
189
192
  e.stopPropagation();
193
+ handleSliderClick(e);
190
194
  },
191
195
  onMouseUp: (e) => e.stopPropagation(),
192
196
  max,
@@ -1048,6 +1052,15 @@ var TimeSlider = ({ chapters }) => {
1048
1052
  console.log("time: ", time);
1049
1053
  player == null ? void 0 : player.currentTime(time);
1050
1054
  };
1055
+ const handleSliderClick = (e) => {
1056
+ const slider = e.currentTarget;
1057
+ const rect = slider.getBoundingClientRect();
1058
+ const offsetX = e.clientX - rect.left;
1059
+ const newTimeSlider = offsetX / rect.width * DEFERENCE;
1060
+ const time = newTimeSlider * duration / DEFERENCE;
1061
+ player == null ? void 0 : player.currentTime(time);
1062
+ setTimeSlider(newTimeSlider);
1063
+ };
1051
1064
  useEffect9(() => {
1052
1065
  const intervalId = setInterval(() => {
1053
1066
  const currentTime = (player == null ? void 0 : player.currentTime()) || 0;
@@ -1080,6 +1093,7 @@ var TimeSlider = ({ chapters }) => {
1080
1093
  {
1081
1094
  value: timeSlider,
1082
1095
  handleValueChange,
1096
+ handleSliderClick,
1083
1097
  min: MIN2,
1084
1098
  max: MAX2,
1085
1099
  style: {
@@ -1538,6 +1552,7 @@ var BigPlayButton = ({ player, isPaused, setIsPaused }) => {
1538
1552
  var BigPlayButton_default = BigPlayButton;
1539
1553
 
1540
1554
  // src/components/VideoPlayerComponent/index.tsx
1555
+ import { isEqual } from "lodash";
1541
1556
  import { jsx as jsx36, jsxs as jsxs15 } from "react/jsx-runtime";
1542
1557
  var bigPlayButtonRoot = {};
1543
1558
  var renderBigPlayButton = (id, player, isPaused, setIsPaused, opacity = "100") => {
@@ -1635,6 +1650,7 @@ var VideoPlayerComponent = forwardRef(
1635
1650
  const [isQualityMenuOpen, setIsQualityMenuOpen] = useState14(false);
1636
1651
  const [isSubtitleMenuOpen, setIsSubtitleMenuOpen] = useState14(false);
1637
1652
  const [isNoteOpen, setNoteOpen] = useState14(false);
1653
+ console.log("notes", notes);
1638
1654
  const onReady = (player) => {
1639
1655
  console.log("onReady: ", onReady);
1640
1656
  if (playerRef) {
@@ -1653,23 +1669,55 @@ var VideoPlayerComponent = forwardRef(
1653
1669
  });
1654
1670
  }
1655
1671
  };
1672
+ const initializePlayer = () => {
1673
+ const videoElement = document.createElement("video-js");
1674
+ videoElement.setAttribute("playsinline", "true");
1675
+ videoElement.classList.add("vjs-big-play-centered");
1676
+ if (poster) {
1677
+ videoElement.setAttribute("poster", poster);
1678
+ }
1679
+ videoRef.current.appendChild(videoElement);
1680
+ videoElement.style.width = "100%";
1681
+ videoElement.style.height = "100%";
1682
+ playerRef.current = videojs(videoElement, options, () => {
1683
+ var _a;
1684
+ (_a = playerRef.current) == null ? void 0 : _a.currentTime(startTime);
1685
+ });
1686
+ onReady(playerRef.current);
1687
+ };
1656
1688
  useEffect14(() => {
1657
- if (!playerRef.current) {
1658
- const videoElement = document.createElement("video-js");
1659
- videoElement.setAttribute("playsinline", "true");
1660
- videoElement.classList.add("vjs-big-play-centered");
1661
- if (poster) {
1662
- videoElement.setAttribute("poster", poster);
1689
+ if (playerRef.current) {
1690
+ if (!isEqual(playerRef.current.poster_, poster)) {
1691
+ playerRef.current.dispose();
1692
+ console.log("dispose: ");
1693
+ playerRef.current = void 0;
1663
1694
  }
1664
- videoRef.current.appendChild(videoElement);
1665
- videoElement.style.width = "100%";
1666
- videoElement.style.height = "100%";
1667
- videoElement.style.objectFit = "cover";
1668
- playerRef.current = videojs(videoElement, options, () => {
1669
- onReady(playerRef.current);
1670
- });
1671
1695
  }
1672
- }, [options, poster]);
1696
+ initializePlayer();
1697
+ console.log("initializePlayer: ghhh");
1698
+ }, [options]);
1699
+ useEffect14(() => {
1700
+ return () => {
1701
+ if (playerRef.current) {
1702
+ console.log(playerRef.current, options, "jk");
1703
+ if (!isEqual(playerRef.current.poster_, poster)) {
1704
+ playerRef.current.dispose();
1705
+ console.log("dispose7: ");
1706
+ playerRef.current = void 0;
1707
+ setTimeout(() => {
1708
+ if (bigPlayButtonRoot[id]) {
1709
+ bigPlayButtonRoot[id].unmount();
1710
+ bigPlayButtonRoot[id] = void 0;
1711
+ }
1712
+ if (controlBarRoot[id]) {
1713
+ controlBarRoot[id].unmount();
1714
+ controlBarRoot[id] = void 0;
1715
+ }
1716
+ }, 0);
1717
+ }
1718
+ }
1719
+ };
1720
+ }, [options]);
1673
1721
  useEffect14(() => {
1674
1722
  if (playerRef.current && isReady) {
1675
1723
  const currentTime = playerRef.current.currentTime() || 0;
@@ -1683,6 +1731,7 @@ var VideoPlayerComponent = forwardRef(
1683
1731
  useEffect14(() => {
1684
1732
  if (isReady) {
1685
1733
  const controlBarTimeout = setTimeout(() => {
1734
+ console.log("isReady: ", isReady);
1686
1735
  renderControlBar(
1687
1736
  id,
1688
1737
  playerRef.current,
@@ -1732,7 +1781,7 @@ var VideoPlayerComponent = forwardRef(
1732
1781
  }, 500);
1733
1782
  return () => clearTimeout(playButtonTimeout);
1734
1783
  }
1735
- }, [id, isPaused, isReady, opacity]);
1784
+ }, [id, isPaused, isReady, opacity, options, notes]);
1736
1785
  useEffect14(() => {
1737
1786
  if (playerRef.current) {
1738
1787
  const intervalId = setInterval(() => {
@@ -1749,25 +1798,6 @@ var VideoPlayerComponent = forwardRef(
1749
1798
  (_b = playerRef.current) == null ? void 0 : _b.play();
1750
1799
  }
1751
1800
  }, [startTime]);
1752
- useEffect14(() => {
1753
- return () => {
1754
- if (playerRef.current) {
1755
- setTimeout(() => {
1756
- var _a;
1757
- if (bigPlayButtonRoot[id]) {
1758
- bigPlayButtonRoot[id].unmount();
1759
- bigPlayButtonRoot[id] = void 0;
1760
- }
1761
- if (controlBarRoot[id]) {
1762
- controlBarRoot[id].unmount();
1763
- controlBarRoot[id] = void 0;
1764
- }
1765
- (_a = playerRef.current) == null ? void 0 : _a.dispose();
1766
- playerRef.current = void 0;
1767
- }, 0);
1768
- }
1769
- };
1770
- }, []);
1771
1801
  const timeoutRef = useRef2(null);
1772
1802
  useEffect14(() => {
1773
1803
  if (isQualityMenuOpen || isSubtitleMenuOpen) {
@@ -1786,8 +1816,7 @@ var VideoPlayerComponent = forwardRef(
1786
1816
  }
1787
1817
  }, [isQualityMenuOpen, isSubtitleMenuOpen]);
1788
1818
  useEffect14(() => {
1789
- if (playerRef.current) {
1790
- }
1819
+ console.log("notes: ", notes);
1791
1820
  }, [notes]);
1792
1821
  const handlePlayerClick = async (e, isTimerOnly = false) => {
1793
1822
  e.preventDefault();
@@ -1915,6 +1944,7 @@ var VideoPlayerComponent = forwardRef(
1915
1944
  var VideoPlayerComponent_default = VideoPlayerComponent;
1916
1945
 
1917
1946
  // src/components/SoftBuildersVideoPlayer/index.tsx
1947
+ import { isEqual as isEqual2 } from "lodash";
1918
1948
  import { jsx as jsx37 } from "react/jsx-runtime";
1919
1949
  var DEFAULT_OPTIONS = {
1920
1950
  autoplay: false,
@@ -1988,8 +2018,9 @@ var Component = forwardRef2(
1988
2018
  }
1989
2019
  );
1990
2020
  var SoftBuildersVideoPlayer = memo(Component, (prevProps, nextProps) => {
1991
- return prevProps.options === nextProps.options && // prevProps.notes === nextProps.notes &&
1992
- prevProps.chapters === nextProps.chapters && prevProps.startTime === nextProps.startTime;
2021
+ console.log(isEqual2(prevProps.options, nextProps.options, "oooop"));
2022
+ console.log(nextProps.notes, prevProps.notes, "oooop");
2023
+ return isEqual2(prevProps.options, nextProps.options) && prevProps.notes === nextProps.notes && prevProps.chapters === nextProps.chapters && prevProps.startTime === nextProps.startTime;
1993
2024
  });
1994
2025
  var SoftBuildersVideoPlayer_default = SoftBuildersVideoPlayer;
1995
2026
 
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.1.77",
4
+ "version": "1.2.1",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [
@@ -24,6 +24,7 @@
24
24
  "react-dom": "^18.3.1"
25
25
  },
26
26
  "dependencies": {
27
+ "lodash": "^4.17.21",
27
28
  "typescript": "^5.6.2",
28
29
  "video.js": "^8.18.0"
29
30
  },