softbuilders-react-video-player 1.1.46 → 1.1.47

Sign up to get free protection for your applications and to get access to all the features.
@@ -47,7 +47,7 @@ const ControlBar = ({ player, isPaused, setIsPaused, duration, notes, chapters,
47
47
  useEffect(() => {
48
48
  setDuration(duration);
49
49
  }, [duration]);
50
- return (_jsxs("div", { className: ` sb-px-2 sb-flex sb-pt-2 sb-justify-center sb-gap-3 sb-w-full sb-h-full ${width > 400 ? "sb-items-end" : "sb-items-start"} sb-pb-2`, children: [_jsx(BufferTracker, {}), _jsx(CurrentTimeTracker, {}), _jsx("button", { onClick: () => {
50
+ return (_jsxs("div", { className: ` !sb-px-4 sb-flex sb-pt-2 sb-justify-center sb-gap-3 sb-w-full sb-h-full ${width > 400 ? "sb-items-end sb-mb-1 " : "sb-items-start"} sb-pb-2`, children: [_jsx(BufferTracker, {}), _jsx(CurrentTimeTracker, {}), _jsx("button", { onClick: () => {
51
51
  seek(-seekStep);
52
52
  }, children: _jsx(BackwardIcon, { className: "sb-w-3 sb-h-3" }) }), _jsx("button", { onClick: togglePlay, children: isPaused ? (_jsx(PlayIcon, { className: "sb-w-3 sb-h-3" })) : (_jsx(PauseIcon, { className: "sb-w-3 sb-h-3" })) }), _jsx("button", { onClick: (e) => {
53
53
  e.preventDefault();
@@ -61,7 +61,7 @@ const ControlBar = ({ player, isPaused, setIsPaused, duration, notes, chapters,
61
61
  left: "5%",
62
62
  top: "90%",
63
63
  }
64
- : { width: "100%" }, className: `flex gap-2 ${width < 400 ? "absolute sb-top-1" : "-sb-translate-y-0 sb-w-full"} hover:sb-w-[45%] sb-transition-all sb-ease-in-out sb-duration-500`, children: [_jsx(CurrentTimeLabel, {}), _jsx(TimeSliderContainer, { chapters: chapters, notes: notes }), _jsx("p", { children: durationFormater(duration) })] }) }), _jsx("div", { className: "sb-h-full", children: _jsx(VolumeSlider, { volumeSliderToggler: volumeSliderToggler, width: width, setIsSeeking: (val) => setIsSeeking(val), handleControlDisplayTimer: handleControlDisplayTimer }) }), _jsx(QualityMenu, { width: width, onClick: (e, isOpen) => {
64
+ : { width: "98%" }, className: `flex gap-2 ${width < 400 ? "absolute sb-top-1" : "-sb-translate-y-0 sb-w-full"} hover:sb-w-[45%] sb-transition-all sb-ease-in-out sb-duration-500`, children: [_jsx(CurrentTimeLabel, {}), _jsx(TimeSliderContainer, { chapters: chapters, notes: notes }), _jsx("p", { children: durationFormater(duration) })] }) }), _jsx("div", { className: "sb-h-full", children: _jsx(VolumeSlider, { volumeSliderToggler: volumeSliderToggler, width: width, setIsSeeking: (val) => setIsSeeking(val), handleControlDisplayTimer: handleControlDisplayTimer }) }), _jsx(QualityMenu, { width: width, onClick: (e, isOpen) => {
65
65
  setVolumeToggler(!volumeSliderToggler);
66
66
  setIsQualityMenuOpen && setIsQualityMenuOpen(isOpen);
67
67
  } }), true && (_jsx(CreateNoteMenu, { handleSaveNoteAction: handleSaveNoteAction, width: width })), _jsx(SubtitleMenu, { width: width, onClick: (e, 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,QAA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AC;gBACvD,CAAC,GACD,EAED,IAAI,IAAI,CACP,KAAC,cAAc,IACb,oBAAoB,EAAE,oBAAoB,EAC1C,KAAK,EAAE,KAAK,GACZ,CACH,EAED,KAAC,YAAY,IACX,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,CAAC,CAAM,EAAE,MAAe,EAAE,EAAE;oBACnC,gBAAgB,CAAC,CAAC,mBAAmB,CAAC,CAAC;oBACvC,qBAAqB,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC;gBACzD,CAAC,GACD,EACF,iBACE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;oBACb,CAAC,CAAC,cAAc,EAAE,CAAC;oBACnB,CAAC,CAAC,eAAe,EAAE,CAAC;oBAEpB,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,EAAE,EAAE,CAAC;wBAC3B,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,cAAc,EAAE,CAAC;oBAC3B,CAAC;yBAAM,CAAC;wBACN,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,iBAAiB,EAAE,CAAC;oBAC9B,CAAC;gBACH,CAAC,YAED,KAAC,cAAc,IAAC,SAAS,EAAC,eAAe,GAAG,GACrC,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -95,8 +95,8 @@ const ControlBar = <T,>({
95
95
 
96
96
  return (
97
97
  <div
98
- className={` sb-px-2 sb-flex sb-pt-2 sb-justify-center sb-gap-3 sb-w-full sb-h-full ${
99
- width > 400 ? "sb-items-end" : "sb-items-start"
98
+ className={` !sb-px-4 sb-flex sb-pt-2 sb-justify-center sb-gap-3 sb-w-full sb-h-full ${
99
+ width > 400 ? "sb-items-end sb-mb-1 " : "sb-items-start"
100
100
  } sb-pb-2`}
101
101
  >
102
102
  {/* Doesn't display anything, just set the downloaded buffer percentage */}
@@ -143,7 +143,7 @@ const ControlBar = <T,>({
143
143
  left: "5%",
144
144
  top: "90%",
145
145
  }
146
- : { width: "100%" }
146
+ : { width: "98%" }
147
147
  }
148
148
  className={`flex gap-2 ${
149
149
  width < 400 ? "absolute sb-top-1" : "-sb-translate-y-0 sb-w-full"
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from "react";
3
3
  import MenuButton from "../MenuButton";
4
4
  import { useSoftBuildersVideoPlayerContext } from "../VideoPlayerComponent/provider";
@@ -10,7 +10,7 @@ const QualityMenu = ({ width, onClick }) => {
10
10
  const { player } = useSoftBuildersVideoPlayerContext();
11
11
  const [closeMenuFunction, setCloseMenuFunction] = useState(undefined);
12
12
  const [qualities, setQualities] = useState([]);
13
- const [currentQualitySrc, setCurrentQualitySrc] = useState(undefined);
13
+ const [currentQualitySrc, setCurrentQualitySrc] = useState("Auto");
14
14
  useEffect(() => {
15
15
  if (player) {
16
16
  const sources = player === null || player === void 0 ? void 0 : player.currentSources();
@@ -18,7 +18,7 @@ const QualityMenu = ({ width, onClick }) => {
18
18
  setQualities(qs);
19
19
  const source = player === null || player === void 0 ? void 0 : player.currentSource();
20
20
  const quality = JSON.parse(JSON.stringify(source));
21
- setCurrentQualitySrc(quality.src);
21
+ setCurrentQualitySrc(quality.label);
22
22
  }
23
23
  }, [player]);
24
24
  return (_jsx(MenuButton, { classContainer: `${width < 400 ? "!sb-top-8 -sb-left-9" : ""}`, onClick: (e, isOpen) => {
@@ -30,16 +30,16 @@ const QualityMenu = ({ width, onClick }) => {
30
30
  closeMenuFunction();
31
31
  }
32
32
  }, className: "hover:sb-scale-150", children: _jsx(LeftArrowIcon, { className: "sb-w-3 sb-h-3" }) }), _jsx("h3", { children: "Quality" })] }), _jsx("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }), _jsx("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-3 sb-items-start ", children: qualities.map((q, i) => {
33
- return (_jsx(QualityOption, { width: width, isSelected: currentQualitySrc === q.src, quality: q, onClick: () => {
34
- const source = qualities.find((_q) => q.label == _q.label);
35
- if (source && source.src != currentQualitySrc) {
36
- player === null || player === void 0 ? void 0 : player.src(source.src);
37
- const currentTime = player === null || player === void 0 ? void 0 : player.currentTime();
38
- setCurrentQualitySrc(source.src);
39
- player === null || player === void 0 ? void 0 : player.currentTime(currentTime);
40
- player === null || player === void 0 ? void 0 : player.play();
41
- }
42
- } }, `quality-${q.label}-${i}`));
33
+ return (_jsxs(_Fragment, { children: [console.log(currentQualitySrc, "1"), console.log(q, "2"), _jsx(QualityOption, { width: width, isSelected: currentQualitySrc === q.label, quality: q, onClick: () => {
34
+ const source = qualities.find((_q) => q.label == _q.label);
35
+ if (source && source.src != currentQualitySrc) {
36
+ player === null || player === void 0 ? void 0 : player.src(source.src);
37
+ const currentTime = player === null || player === void 0 ? void 0 : player.currentTime();
38
+ setCurrentQualitySrc(source.label);
39
+ player === null || player === void 0 ? void 0 : player.currentTime(currentTime);
40
+ player === null || player === void 0 ? void 0 : player.play();
41
+ }
42
+ } }, `quality-${q.label}-${i}`)] }));
43
43
  }) })] }) }), close: (fn) => {
44
44
  setCloseMenuFunction(() => fn);
45
45
  } }));
@@ -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,GACc,EAAE,EAAE;IACvB,OAAO,CACL,iBACE,SA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,iBAAiB,KAAK,CAAC,CAAC,KAAK,EACzC,OAAO,EAAE,CAAC,EACV,OAAO,EAAE,GAAG,EAAE;4CACZ,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAC3B,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,KAAK,CAC5B,CAAC;4CACF,IAAI,MAAM,IAAI,MAAM,CAAC,GAAG,IAAI,iBAAiB,EAAE,CAAC;gDAC9C,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gDACxB,MAAM,WAAW,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,EAAE,CAAC;gDAC1C,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gDACnC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,CAAC,WAAW,CAAC,CAAC;gDACjC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,EAAE,CAAC;4CACjB,CAAC;wCACH,CAAC,IAdI,WAAW,CAAC,CAAC,KAAK,IAAI,CAAC,EAAE,CAe9B,IACD,CACJ,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"}
@@ -60,7 +60,7 @@ const QualityMenu = ({ width, onClick }: QualityMenuProps) => {
60
60
 
61
61
  const [currentQualitySrc, setCurrentQualitySrc] = useState<
62
62
  string | undefined
63
- >(undefined);
63
+ >("Auto");
64
64
 
65
65
  useEffect(() => {
66
66
  if (player) {
@@ -77,7 +77,7 @@ const QualityMenu = ({ width, onClick }: QualityMenuProps) => {
77
77
  JSON.stringify(source)
78
78
  );
79
79
 
80
- setCurrentQualitySrc(quality.src);
80
+ setCurrentQualitySrc(quality.label);
81
81
  }
82
82
  }, [player]);
83
83
 
@@ -118,24 +118,28 @@ const QualityMenu = ({ width, onClick }: QualityMenuProps) => {
118
118
  <div className="sb-px-5 sb-flex sb-flex-col sb-gap-3 sb-items-start ">
119
119
  {qualities.map((q, i) => {
120
120
  return (
121
- <QualityOption
122
- width={width}
123
- key={`quality-${q.label}-${i}`}
124
- isSelected={currentQualitySrc === q.src}
125
- quality={q}
126
- onClick={() => {
127
- const source = qualities.find(
128
- (_q) => q.label == _q.label
129
- );
130
- if (source && source.src != currentQualitySrc) {
131
- player?.src(source.src);
132
- const currentTime = player?.currentTime();
133
- setCurrentQualitySrc(source.src);
134
- player?.currentTime(currentTime);
135
- player?.play();
136
- }
137
- }}
138
- />
121
+ <>
122
+ {console.log(currentQualitySrc, "1")}
123
+ {console.log(q, "2")}
124
+ <QualityOption
125
+ width={width}
126
+ key={`quality-${q.label}-${i}`}
127
+ isSelected={currentQualitySrc === q.label}
128
+ quality={q}
129
+ onClick={() => {
130
+ const source = qualities.find(
131
+ (_q) => q.label == _q.label
132
+ );
133
+ if (source && source.src != currentQualitySrc) {
134
+ player?.src(source.src);
135
+ const currentTime = player?.currentTime();
136
+ setCurrentQualitySrc(source.label);
137
+ player?.currentTime(currentTime);
138
+ player?.play();
139
+ }
140
+ }}
141
+ />
142
+ </>
139
143
  );
140
144
  })}
141
145
  </div>
package/dist/index.css CHANGED
@@ -482,6 +482,9 @@ video {
482
482
  .sb-col-span-9 {
483
483
  grid-column: span 9 / span 9;
484
484
  }
485
+ .sb-mb-1 {
486
+ margin-bottom: 0.25rem;
487
+ }
485
488
  .sb-mb-2 {
486
489
  margin-bottom: 0.5rem;
487
490
  }
@@ -716,9 +719,9 @@ video {
716
719
  .sb-p-2 {
717
720
  padding: 0.5rem;
718
721
  }
719
- .sb-px-2 {
720
- padding-left: 0.5rem;
721
- padding-right: 0.5rem;
722
+ .\!sb-px-4 {
723
+ padding-left: 1rem !important;
724
+ padding-right: 1rem !important;
722
725
  }
723
726
  .sb-px-4 {
724
727
  padding-left: 1rem;
package/dist/index.mjs CHANGED
@@ -660,7 +660,7 @@ var MenuButton = ({
660
660
  var MenuButton_default = MenuButton;
661
661
 
662
662
  // src/components/QualityMenu/index.tsx
663
- import { jsx as jsx21, jsxs as jsxs6 } from "react/jsx-runtime";
663
+ import { Fragment, jsx as jsx21, jsxs as jsxs6 } from "react/jsx-runtime";
664
664
  var QualityOption = ({
665
665
  isSelected,
666
666
  quality,
@@ -690,7 +690,7 @@ var QualityMenu = ({ width, onClick }) => {
690
690
  const [qualities, setQualities] = useState4(
691
691
  []
692
692
  );
693
- const [currentQualitySrc, setCurrentQualitySrc] = useState4(void 0);
693
+ const [currentQualitySrc, setCurrentQualitySrc] = useState4("Auto");
694
694
  useEffect4(() => {
695
695
  if (player) {
696
696
  const sources = player == null ? void 0 : player.currentSources();
@@ -702,7 +702,7 @@ var QualityMenu = ({ width, onClick }) => {
702
702
  const quality = JSON.parse(
703
703
  JSON.stringify(source)
704
704
  );
705
- setCurrentQualitySrc(quality.src);
705
+ setCurrentQualitySrc(quality.label);
706
706
  }
707
707
  }, [player]);
708
708
  return /* @__PURE__ */ jsx21(
@@ -741,27 +741,31 @@ var QualityMenu = ({ width, onClick }) => {
741
741
  ),
742
742
  /* @__PURE__ */ jsx21("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }),
743
743
  /* @__PURE__ */ jsx21("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-3 sb-items-start ", children: qualities.map((q, i) => {
744
- return /* @__PURE__ */ jsx21(
745
- QualityOption,
746
- {
747
- width,
748
- isSelected: currentQualitySrc === q.src,
749
- quality: q,
750
- onClick: () => {
751
- const source = qualities.find(
752
- (_q) => q.label == _q.label
753
- );
754
- if (source && source.src != currentQualitySrc) {
755
- player == null ? void 0 : player.src(source.src);
756
- const currentTime = player == null ? void 0 : player.currentTime();
757
- setCurrentQualitySrc(source.src);
758
- player == null ? void 0 : player.currentTime(currentTime);
759
- player == null ? void 0 : player.play();
744
+ return /* @__PURE__ */ jsxs6(Fragment, { children: [
745
+ console.log(currentQualitySrc, "1"),
746
+ console.log(q, "2"),
747
+ /* @__PURE__ */ jsx21(
748
+ QualityOption,
749
+ {
750
+ width,
751
+ isSelected: currentQualitySrc === q.label,
752
+ quality: q,
753
+ onClick: () => {
754
+ const source = qualities.find(
755
+ (_q) => q.label == _q.label
756
+ );
757
+ if (source && source.src != currentQualitySrc) {
758
+ player == null ? void 0 : player.src(source.src);
759
+ const currentTime = player == null ? void 0 : player.currentTime();
760
+ setCurrentQualitySrc(source.label);
761
+ player == null ? void 0 : player.currentTime(currentTime);
762
+ player == null ? void 0 : player.play();
763
+ }
760
764
  }
761
- }
762
- },
763
- `quality-${q.label}-${i}`
764
- );
765
+ },
766
+ `quality-${q.label}-${i}`
767
+ )
768
+ ] });
765
769
  }) })
766
770
  ] })
767
771
  }
@@ -1081,7 +1085,7 @@ var TimeSliderContainer_default = TimeSliderContainer;
1081
1085
 
1082
1086
  // src/components/BufferTracker/index.tsx
1083
1087
  import { useEffect as useEffect10 } from "react";
1084
- import { Fragment, jsx as jsx30 } from "react/jsx-runtime";
1088
+ import { Fragment as Fragment2, jsx as jsx30 } from "react/jsx-runtime";
1085
1089
  var BufferTracker = () => {
1086
1090
  const { player, setDownloadedBufferTimeufferTime } = useSoftBuildersVideoPlayerContext();
1087
1091
  useEffect10(() => {
@@ -1090,13 +1094,13 @@ var BufferTracker = () => {
1090
1094
  }, 1e3);
1091
1095
  return () => clearInterval(intervalId);
1092
1096
  }, [player]);
1093
- return /* @__PURE__ */ jsx30(Fragment, {});
1097
+ return /* @__PURE__ */ jsx30(Fragment2, {});
1094
1098
  };
1095
1099
  var BufferTracker_default = BufferTracker;
1096
1100
 
1097
1101
  // src/components/CurrentTimeTracker/index.tsx
1098
1102
  import { useEffect as useEffect11 } from "react";
1099
- import { Fragment as Fragment2, jsx as jsx31 } from "react/jsx-runtime";
1103
+ import { Fragment as Fragment3, jsx as jsx31 } from "react/jsx-runtime";
1100
1104
  var CurrentTimeTracker = () => {
1101
1105
  const { setCurrentTime, player } = useSoftBuildersVideoPlayerContext();
1102
1106
  useEffect11(() => {
@@ -1105,7 +1109,7 @@ var CurrentTimeTracker = () => {
1105
1109
  }, 500);
1106
1110
  return () => clearInterval(intervalId);
1107
1111
  }, [player]);
1108
- return /* @__PURE__ */ jsx31(Fragment2, {});
1112
+ return /* @__PURE__ */ jsx31(Fragment3, {});
1109
1113
  };
1110
1114
  var CurrentTimeTracker_default = CurrentTimeTracker;
1111
1115
 
@@ -1258,7 +1262,7 @@ var ControlBar = ({
1258
1262
  return /* @__PURE__ */ jsxs13(
1259
1263
  "div",
1260
1264
  {
1261
- className: ` sb-px-2 sb-flex sb-pt-2 sb-justify-center sb-gap-3 sb-w-full sb-h-full ${width > 400 ? "sb-items-end" : "sb-items-start"} sb-pb-2`,
1265
+ className: ` !sb-px-4 sb-flex sb-pt-2 sb-justify-center sb-gap-3 sb-w-full sb-h-full ${width > 400 ? "sb-items-end sb-mb-1 " : "sb-items-start"} sb-pb-2`,
1262
1266
  children: [
1263
1267
  /* @__PURE__ */ jsx33(BufferTracker_default, {}),
1264
1268
  /* @__PURE__ */ jsx33(CurrentTimeTracker_default, {}),
@@ -1295,7 +1299,7 @@ var ControlBar = ({
1295
1299
  width: `${width * 0.9}px`,
1296
1300
  left: "5%",
1297
1301
  top: "90%"
1298
- } : { width: "100%" },
1302
+ } : { width: "98%" },
1299
1303
  className: `flex gap-2 ${width < 400 ? "absolute sb-top-1" : "-sb-translate-y-0 sb-w-full"} hover:sb-w-[45%] sb-transition-all sb-ease-in-out sb-duration-500`,
1300
1304
  children: [
1301
1305
  /* @__PURE__ */ jsx33(CurrentTimeLabel_default, {}),
@@ -571,6 +571,9 @@ video {
571
571
  .sb-col-span-9 {
572
572
  grid-column: span 9 / span 9;
573
573
  }
574
+ .sb-mb-1 {
575
+ margin-bottom: 0.25rem;
576
+ }
574
577
  .sb-mb-2 {
575
578
  margin-bottom: 0.5rem;
576
579
  }
@@ -805,9 +808,9 @@ video {
805
808
  .sb-p-2 {
806
809
  padding: 0.5rem;
807
810
  }
808
- .sb-px-2 {
809
- padding-left: 0.5rem;
810
- padding-right: 0.5rem;
811
+ .\!sb-px-4 {
812
+ padding-left: 1rem !important;
813
+ padding-right: 1rem !important;
811
814
  }
812
815
  .sb-px-4 {
813
816
  padding-left: 1rem;
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.46",
4
+ "version": "1.1.47",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [