softbuilders-react-video-player 1.1.47 → 1.1.49
Sign up to get free protection for your applications and to get access to all the features.
@@ -18,7 +18,8 @@ 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
|
+
// setCurrentQualitySrc(quality.label);
|
22
|
+
qs && setCurrentQualitySrc(qs[0].label);
|
22
23
|
}
|
23
24
|
}, [player]);
|
24
25
|
return (_jsx(MenuButton, { classContainer: `${width < 400 ? "!sb-top-8 -sb-left-9" : ""}`, onClick: (e, isOpen) => {
|
@@ -30,16 +31,16 @@ const QualityMenu = ({ width, onClick }) => {
|
|
30
31
|
closeMenuFunction();
|
31
32
|
}
|
32
33
|
}, 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 (
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
34
|
+
return (_jsx(_Fragment, { children: _jsx(QualityOption, { width: width, isSelected: currentQualitySrc === q.label, quality: q, onClick: () => {
|
35
|
+
const source = qualities.find((_q) => q.label == _q.label);
|
36
|
+
if (source && source.src != currentQualitySrc) {
|
37
|
+
player === null || player === void 0 ? void 0 : player.src(source.src);
|
38
|
+
const currentTime = player === null || player === void 0 ? void 0 : player.currentTime();
|
39
|
+
setCurrentQualitySrc(source.label);
|
40
|
+
player === null || player === void 0 ? void 0 : player.currentTime(currentTime);
|
41
|
+
player === null || player === void 0 ? void 0 : player.play();
|
42
|
+
}
|
43
|
+
} }, `quality-${q.label}-${i}`) }));
|
43
44
|
}) })] }) }), close: (fn) => {
|
44
45
|
setCloseMenuFunction(() => fn);
|
45
46
|
} }));
|
@@ -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,EAAE,KAAK,EAAE,OAAO,EAAoB,EAAE,EAAE;IAC3D,MAAM,EAAE,MAAM,EAAE,GAAG,iCAAiC,EAAE,CAAC;IAEvD,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAExD,SAAS,CAAC,CAAC;IAEb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CAAC,GAAG,IAAI,iBAAiB,EAAE,CAAC;4CAC9C,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,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"}
|
@@ -77,7 +77,8 @@ const QualityMenu = ({ width, onClick }: QualityMenuProps) => {
|
|
77
77
|
JSON.stringify(source)
|
78
78
|
);
|
79
79
|
|
80
|
-
setCurrentQualitySrc(quality.label);
|
80
|
+
// setCurrentQualitySrc(quality.label);
|
81
|
+
qs && setCurrentQualitySrc(qs[0].label);
|
81
82
|
}
|
82
83
|
}, [player]);
|
83
84
|
|
@@ -119,8 +120,6 @@ const QualityMenu = ({ width, onClick }: QualityMenuProps) => {
|
|
119
120
|
{qualities.map((q, i) => {
|
120
121
|
return (
|
121
122
|
<>
|
122
|
-
{console.log(currentQualitySrc, "1")}
|
123
|
-
{console.log(q, "2")}
|
124
123
|
<QualityOption
|
125
124
|
width={width}
|
126
125
|
key={`quality-${q.label}-${i}`}
|
package/dist/index.mjs
CHANGED
@@ -702,7 +702,7 @@ var QualityMenu = ({ width, onClick }) => {
|
|
702
702
|
const quality = JSON.parse(
|
703
703
|
JSON.stringify(source)
|
704
704
|
);
|
705
|
-
setCurrentQualitySrc(
|
705
|
+
qs && setCurrentQualitySrc(qs[0].label);
|
706
706
|
}
|
707
707
|
}, [player]);
|
708
708
|
return /* @__PURE__ */ jsx21(
|
@@ -741,31 +741,27 @@ 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__ */
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
);
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
setCurrentQualitySrc(source.label);
|
761
|
-
player == null ? void 0 : player.currentTime(currentTime);
|
762
|
-
player == null ? void 0 : player.play();
|
763
|
-
}
|
744
|
+
return /* @__PURE__ */ jsx21(Fragment, { children: /* @__PURE__ */ jsx21(
|
745
|
+
QualityOption,
|
746
|
+
{
|
747
|
+
width,
|
748
|
+
isSelected: currentQualitySrc === q.label,
|
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.label);
|
758
|
+
player == null ? void 0 : player.currentTime(currentTime);
|
759
|
+
player == null ? void 0 : player.play();
|
764
760
|
}
|
765
|
-
}
|
766
|
-
|
767
|
-
|
768
|
-
|
761
|
+
}
|
762
|
+
},
|
763
|
+
`quality-${q.label}-${i}`
|
764
|
+
) });
|
769
765
|
}) })
|
770
766
|
] })
|
771
767
|
}
|