softbuilders-react-video-player 1.1.47 → 1.1.48

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,7 +18,9 @@ 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.label);
21
+ console.log(quality, "qualiy", JSON.stringify(source), "");
22
+ // setCurrentQualitySrc(quality.label);
23
+ qs && setCurrentQualitySrc(qs[0].label);
22
24
  }
23
25
  }, [player]);
24
26
  return (_jsx(MenuButton, { classContainer: `${width < 400 ? "!sb-top-8 -sb-left-9" : ""}`, onClick: (e, isOpen) => {
@@ -30,16 +32,16 @@ const QualityMenu = ({ width, onClick }) => {
30
32
  closeMenuFunction();
31
33
  }
32
34
  }, 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 (_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}`)] }));
35
+ return (_jsx(_Fragment, { children: _jsx(QualityOption, { width: width, isSelected: currentQualitySrc === q.label, quality: q, onClick: () => {
36
+ const source = qualities.find((_q) => q.label == _q.label);
37
+ if (source && source.src != currentQualitySrc) {
38
+ player === null || player === void 0 ? void 0 : player.src(source.src);
39
+ const currentTime = player === null || player === void 0 ? void 0 : player.currentTime();
40
+ setCurrentQualitySrc(source.label);
41
+ player === null || player === void 0 ? void 0 : player.currentTime(currentTime);
42
+ player === null || player === void 0 ? void 0 : player.play();
43
+ }
44
+ } }, `quality-${q.label}-${i}`) }));
43
45
  }) })] }) }), close: (fn) => {
44
46
  setCloseMenuFunction(() => fn);
45
47
  } }));
@@ -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,SAAS,EAAE,4BACT,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAC3B,EAAE,EACF,OAAO,EAAE,OAAO,YAEhB,eAAK,SAAS,EAAC,kDAAkD,aAC/D,cAAK,SAAS,EAAC,eAAe,YAC3B,UAAU,CAAC,CAAC,CAAC,CACZ,KAAC,WAAW,IACV,SAAS,EAAE,GAAG,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,EAAE,GAC/D,CACH,CAAC,CAAC,CAAC,CACF,eAAW,CACZ,GACG,EAEN,YAAG,SAAS,EAAC,4BAA4B,YAAE,OAAO,CAAC,KAAK,GAAK,IACzD,GACC,CACV,CAAC;AACJ,CAAC,CAAC;AAOF,MAAM,WAAW,GAAG,CAAC,EA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,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;4CACxB,MAAM,WAAW,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,EAAE,CAAC;4CAC1C,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;4CACnC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,CAAC,WAAW,CAAC,CAAC;4CACjC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,EAAE,CAAC;wCACjB,CAAC;oCACH,CAAC,IAdI,WAAW,CAAC,CAAC,KAAK,IAAI,CAAC,EAAE,CAe9B,GACD,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"}
@@ -76,8 +76,10 @@ const QualityMenu = ({ width, onClick }: QualityMenuProps) => {
76
76
  const quality: SoftBuildersVideoPlayerSource = JSON.parse(
77
77
  JSON.stringify(source)
78
78
  );
79
+ console.log(quality, "qualiy", JSON.stringify(source), "");
79
80
 
80
- setCurrentQualitySrc(quality.label);
81
+ // setCurrentQualitySrc(quality.label);
82
+ qs && setCurrentQualitySrc(qs[0].label);
81
83
  }
82
84
  }, [player]);
83
85
 
@@ -119,8 +121,6 @@ const QualityMenu = ({ width, onClick }: QualityMenuProps) => {
119
121
  {qualities.map((q, i) => {
120
122
  return (
121
123
  <>
122
- {console.log(currentQualitySrc, "1")}
123
- {console.log(q, "2")}
124
124
  <QualityOption
125
125
  width={width}
126
126
  key={`quality-${q.label}-${i}`}
package/dist/index.mjs CHANGED
@@ -702,7 +702,8 @@ var QualityMenu = ({ width, onClick }) => {
702
702
  const quality = JSON.parse(
703
703
  JSON.stringify(source)
704
704
  );
705
- setCurrentQualitySrc(quality.label);
705
+ console.log(quality, "qualiy", JSON.stringify(source), "");
706
+ qs && setCurrentQualitySrc(qs[0].label);
706
707
  }
707
708
  }, [player]);
708
709
  return /* @__PURE__ */ jsx21(
@@ -741,31 +742,27 @@ var QualityMenu = ({ width, onClick }) => {
741
742
  ),
742
743
  /* @__PURE__ */ jsx21("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }),
743
744
  /* @__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__ */ 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
- }
745
+ return /* @__PURE__ */ jsx21(Fragment, { children: /* @__PURE__ */ jsx21(
746
+ QualityOption,
747
+ {
748
+ width,
749
+ isSelected: currentQualitySrc === q.label,
750
+ quality: q,
751
+ onClick: () => {
752
+ const source = qualities.find(
753
+ (_q) => q.label == _q.label
754
+ );
755
+ if (source && source.src != currentQualitySrc) {
756
+ player == null ? void 0 : player.src(source.src);
757
+ const currentTime = player == null ? void 0 : player.currentTime();
758
+ setCurrentQualitySrc(source.label);
759
+ player == null ? void 0 : player.currentTime(currentTime);
760
+ player == null ? void 0 : player.play();
764
761
  }
765
- },
766
- `quality-${q.label}-${i}`
767
- )
768
- ] });
762
+ }
763
+ },
764
+ `quality-${q.label}-${i}`
765
+ ) });
769
766
  }) })
770
767
  ] })
771
768
  }
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.47",
4
+ "version": "1.1.48",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [