softbuilders-react-video-player 1.2.17 → 1.2.18
Sign up to get free protection for your applications and to get access to all the features.
@@ -29,8 +29,16 @@ const VolumeSlider = ({ width = 0, setIsSeeking, handleControlDisplayTimer, volu
|
|
29
29
|
e.stopPropagation();
|
30
30
|
const slider = e.currentTarget;
|
31
31
|
const rect = slider.getBoundingClientRect();
|
32
|
-
|
33
|
-
|
32
|
+
let offsetX;
|
33
|
+
let newVolume;
|
34
|
+
if (!isTrailer && width > 400) {
|
35
|
+
offsetX = e.clientY - rect.bottom;
|
36
|
+
newVolume = (offsetX / rect.height) * -100;
|
37
|
+
}
|
38
|
+
else {
|
39
|
+
offsetX = e.clientY - rect.top;
|
40
|
+
newVolume = (offsetX / rect.height) * 100;
|
41
|
+
}
|
34
42
|
setVolume(newVolume);
|
35
43
|
player === null || player === void 0 ? void 0 : player.volume(newVolume / 100);
|
36
44
|
if (newVolume === 0) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/VolumeSlider/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AAErF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGzE,MAAM,GAAG,GAAG,CAAC,EACX,GAAG,GAAG,GAAG,CAAC;AAUZ,MAAM,YAAY,GAAG,CAAC,EACpB,KAAK,GAAG,CAAC,EACT,YAAY,EACZ,yBAAyB,EACzB,mBAAmB,EACnB,SAAS,GACH,EAAE,EAAE;IACV,MAAM,EAAE,MAAM,EAAE,GAAG,iCAAiC,EAAE,CAAC;IACvD,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChD,MAA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S,IACR,SAAS,EAAE,iBACT,KAAK,GAAG,GAAG,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAClC,gBAAgB,GACL,CACd,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,IACT,SAAS,EAAE,iBACT,KAAK,GAAG,GAAG,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAClC,gBAAgB,GACJ,CACf,GACG,EAGN,cAAK,SAAS,EAAC,4CAA4C,YAEzD,cACE,SAAS,EAAE,sDACT,SAAS;wBACP,CAAC,CAAC,uCAAuC;wBACzC,CAAC,CAAC,uCACN,IACE,KAAK,GAAG,GAAG,IAAI,CAAC,SAAS;wBACvB,CAAC,CAAC,iCAAiC;wBACnC,CAAC,CAAC,+BACN,cAAc,YAEd,KAAC,MAAM,IACL,KAAK,EAAE,MAAM,EACb,iBAAiB,EAAE,iBAAiB,EACpC,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAC,WAAW,EACrB,iBAAiB,EAAE,uBAAuB,GAC1C,GACE,GACF,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
@@ -51,8 +51,15 @@ const VolumeSlider = ({
|
|
51
51
|
e.stopPropagation();
|
52
52
|
const slider = e.currentTarget;
|
53
53
|
const rect = slider.getBoundingClientRect();
|
54
|
-
|
55
|
-
|
54
|
+
let offsetX;
|
55
|
+
let newVolume;
|
56
|
+
if (!isTrailer && width > 400) {
|
57
|
+
offsetX = e.clientY - rect.bottom;
|
58
|
+
newVolume = (offsetX / rect.height) * -100;
|
59
|
+
} else {
|
60
|
+
offsetX = e.clientY - rect.top;
|
61
|
+
newVolume = (offsetX / rect.height) * 100;
|
62
|
+
}
|
56
63
|
|
57
64
|
setVolume(newVolume);
|
58
65
|
player?.volume(newVolume / 100);
|
package/dist/index.mjs
CHANGED
@@ -577,8 +577,15 @@ var VolumeSlider = ({
|
|
577
577
|
e.stopPropagation();
|
578
578
|
const slider = e.currentTarget;
|
579
579
|
const rect = slider.getBoundingClientRect();
|
580
|
-
|
581
|
-
|
580
|
+
let offsetX;
|
581
|
+
let newVolume;
|
582
|
+
if (!isTrailer && width > 400) {
|
583
|
+
offsetX = e.clientY - rect.bottom;
|
584
|
+
newVolume = offsetX / rect.height * -100;
|
585
|
+
} else {
|
586
|
+
offsetX = e.clientY - rect.top;
|
587
|
+
newVolume = offsetX / rect.height * 100;
|
588
|
+
}
|
582
589
|
setVolume(newVolume);
|
583
590
|
player == null ? void 0 : player.volume(newVolume / 100);
|
584
591
|
if (newVolume === 0) {
|