highsoft-ui 1.0.146 → 1.0.148
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +13 -1
- package/dist/{Button-DIGyNR41.js → Button-BGsqFCRW.js} +1 -1
- package/dist/{ButtonGroup-BSQzx-sZ.js → ButtonGroup-DKfaXOeS.js} +1 -1
- package/dist/{Checkbox-wlH6EGWW.js → Checkbox-CniRhVkQ.js} +1 -1
- package/dist/{CodeBlock-DtTAC5ru.js → CodeBlock-BeseY88j.js} +5 -5
- package/dist/{CookiePolicyModal-CGRXL0wR.js → CookiePolicyModal-k89sCBEJ.js} +2 -2
- package/dist/{CopyCode-_MHQorJS.js → CopyCode-_yeXCeeq.js} +3 -3
- package/dist/{Dropdown-CVyrHJiC.js → Dropdown-B_Ib6i1c.js} +1 -1
- package/dist/{Footer-DW2asf8g.js → Footer-_P2pj3K7.js} +8 -8
- package/dist/{FooterBottom-CP0f9kYj.js → FooterBottom-CqpN8Wky.js} +1 -1
- package/dist/{FooterHelp-BxDXmtHK.js → FooterHelp-Cb5sraAE.js} +3 -3
- package/dist/{FooterLinks-BZwAVSm4.js → FooterLinks-CogdK_5Z.js} +2 -2
- package/dist/{Header-DQ1xi25C.js → Header-CVKH_INR.js} +25 -25
- package/dist/{InputGrouped-BE3zLov9.js → InputGrouped-CHGCMmsK.js} +11 -11
- package/dist/{Label-C_KZM-FN.js → Label-CgiWi1v6.js} +1 -1
- package/dist/{NewsletterSignup-CJAI81M3.js → NewsletterSignup-DrcPfdrg.js} +2 -2
- package/dist/{Notification-C2kN_ceR.js → Notification-B3skQvZE.js} +3 -3
- package/dist/{PrefPanel-BZUX1nfw.js → PrefPanel-BGw72I_D.js} +10 -10
- package/dist/{RoadmapDetails-CfayA5CZ.js → RoadmapDetails-XS0OylnP.js} +5 -5
- package/dist/{Search-Cw_e1PyF.js → Search-UPVxQliM.js} +12 -12
- package/dist/{SearchDropdown-ECOTZ1Uf.js → SearchDropdown-L_rQz1vn.js} +1 -1
- package/dist/VideoCover-DqMDvzvA.js +195 -0
- package/dist/VideoPlayer-Cq_garSg.js +455 -0
- package/dist/{VideoPlayerModal-DbP3OjSF.js → VideoPlayerModal-D1v1O2kW.js} +2 -2
- package/dist/{YoutubeModal-D_ZHayEn.js → YoutubeModal-BBYdQil8.js} +4 -2
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonGroup/index.js +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/CodeBlock/index.js +1 -1
- package/dist/components/CopyCode/index.js +1 -1
- package/dist/components/Dropdown/index.js +1 -1
- package/dist/components/Footer/CookiePolicyModal.js +1 -1
- package/dist/components/Footer/FooterBottom.js +1 -1
- package/dist/components/Footer/FooterHelp.js +1 -1
- package/dist/components/Footer/FooterLinks.js +1 -1
- package/dist/components/Footer/YoutubeModal.js +1 -1
- package/dist/components/Footer/index.js +1 -1
- package/dist/components/Header/index.js +1 -1
- package/dist/components/InputGrouped/index.js +1 -1
- package/dist/components/Label/index.js +1 -1
- package/dist/components/Modal/ModalContactFooter.js +2 -2
- package/dist/components/Modal/index.js +2 -2
- package/dist/components/NewsletterSignup/index.js +1 -1
- package/dist/components/Notification/index.js +1 -1
- package/dist/components/PrefPanel/index.js +1 -1
- package/dist/components/RoadmapDetails/index.js +1 -1
- package/dist/components/Search/index.js +1 -1
- package/dist/components/SearchDropdown/index.js +1 -1
- package/dist/components/Sidebar/Sidebar.js +1 -1
- package/dist/components/VideoCover/index.js +1 -1
- package/dist/components/VideoPlayer/VideoPlayerModal.js +1 -1
- package/dist/components/VideoPlayer/index.js +1 -1
- package/dist/components/VideoPlayer/useMediaEngine.js +58 -55
- package/dist/{create-element-WbENDceu.js → create-element-CDnUGrhg.js} +1 -1
- package/dist/{esm-B0YmMAXt.js → esm-BnxclXHW.js} +121 -51
- package/dist/highsoft-ui.css +1 -1
- package/dist/lib/components/VideoCover/index.d.ts +39 -5
- package/dist/lib/components/VideoPlayer/index.d.ts +33 -1
- package/dist/lib/main.d.ts +1 -1
- package/dist/main.js +18 -18
- package/dist/{prism-light-C4xXs3Qn.js → prism-light-COlcVrfu.js} +1 -1
- package/dist/scss/variables.scss +4 -0
- package/package.json +1 -1
- package/dist/VideoCover-BN8wnHpf.js +0 -92
- package/dist/VideoPlayer-CKjq7IRq.js +0 -324
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../CopyCode-
|
|
1
|
+
import { t as e } from "../../CopyCode-_yeXCeeq.js";
|
|
2
2
|
export { e as CopyCode };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "../../Dropdown-
|
|
1
|
+
import { n as e, r as t, t as n } from "../../Dropdown-B_Ib6i1c.js";
|
|
2
2
|
export { n as Dropdown, e as DropdownItem, t as DropdownSeparator };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../CookiePolicyModal-
|
|
1
|
+
import { t as e } from "../../CookiePolicyModal-k89sCBEJ.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../FooterBottom-
|
|
1
|
+
import { t as e } from "../../FooterBottom-CqpN8Wky.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../FooterHelp-
|
|
1
|
+
import { t as e } from "../../FooterHelp-Cb5sraAE.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../FooterLinks-
|
|
1
|
+
import { t as e } from "../../FooterLinks-CogdK_5Z.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../YoutubeModal-
|
|
1
|
+
import { t as e } from "../../YoutubeModal-BBYdQil8.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../Footer-
|
|
1
|
+
import { t as e } from "../../Footer-_P2pj3K7.js";
|
|
2
2
|
export { e as Footer };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../../Header-
|
|
1
|
+
import { n as e, t } from "../../Header-CVKH_INR.js";
|
|
2
2
|
export { t as Header, e as SubHeader };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as e, n as t, r as n, t as r } from "../../InputGrouped-
|
|
1
|
+
import { i as e, n as t, r as n, t as r } from "../../InputGrouped-CHGCMmsK.js";
|
|
2
2
|
export { r as FormGroup, t as FormRow, n as InputGrouped, e as SelectGrouped };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../../Label-
|
|
1
|
+
import { n as e, t } from "../../Label-CgiWi1v6.js";
|
|
2
2
|
export { t as Label, e as NewTag };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../../Button-
|
|
1
|
+
import { A as e } from "../../esm-BnxclXHW.js";
|
|
2
|
+
import { t } from "../../Button-BGsqFCRW.js";
|
|
3
3
|
import { t as n } from "../../Typography-AvvBRu-u.js";
|
|
4
4
|
import { t as r } from "../../styles.module-BDcr8Smc.js";
|
|
5
5
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "../../clsx-BWCAbrjV.js";
|
|
2
|
-
import { t } from "../../esm-
|
|
3
|
-
import { t as n } from "../../Button-
|
|
2
|
+
import { t } from "../../esm-BnxclXHW.js";
|
|
3
|
+
import { t as n } from "../../Button-BGsqFCRW.js";
|
|
4
4
|
import { t as r } from "../../Typography-AvvBRu-u.js";
|
|
5
5
|
import { t as i } from "../../styles.module-BDcr8Smc.js";
|
|
6
6
|
import { useEffect as a, useRef as o } from "react";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../NewsletterSignup-
|
|
1
|
+
import { t as e } from "../../NewsletterSignup-DrcPfdrg.js";
|
|
2
2
|
export { e as NewsletterSignup };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../Notification-
|
|
1
|
+
import { t as e } from "../../Notification-B3skQvZE.js";
|
|
2
2
|
export { e as Notification };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../../PrefPanel-
|
|
1
|
+
import { n as e, t } from "../../PrefPanel-BGw72I_D.js";
|
|
2
2
|
export { t as PrefPanel, e as PrefRadio };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../RoadmapDetails-
|
|
1
|
+
import { t as e } from "../../RoadmapDetails-XS0OylnP.js";
|
|
2
2
|
export { e as RoadmapDetails };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../Search-
|
|
1
|
+
import { t as e } from "../../Search-UPVxQliM.js";
|
|
2
2
|
export { e as Search };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../SearchDropdown-
|
|
1
|
+
import { t as e } from "../../SearchDropdown-L_rQz1vn.js";
|
|
2
2
|
export { e as SearchDropdown };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../../clsx-BWCAbrjV.js";
|
|
3
|
-
import { t } from "../../Button-
|
|
3
|
+
import { t } from "../../Button-BGsqFCRW.js";
|
|
4
4
|
import { SidebarSectionContext as n, useSidebarLayout as r } from "./context.js";
|
|
5
5
|
import { t as i } from "../../styles.module-Bd4HbnpA.js";
|
|
6
6
|
import { SidebarResizer as a } from "./SidebarResizer.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../VideoCover-
|
|
1
|
+
import { t as e } from "../../VideoCover-DqMDvzvA.js";
|
|
2
2
|
export { e as VideoCover };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../VideoPlayerModal-
|
|
1
|
+
import { t as e } from "../../VideoPlayerModal-D1v1O2kW.js";
|
|
2
2
|
export { e as VideoPlayerModal };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../VideoPlayer-
|
|
1
|
+
import { t as e } from "../../VideoPlayer-Cq_garSg.js";
|
|
2
2
|
export { e as VideoPlayer };
|
|
@@ -46,31 +46,33 @@ var p = (e) => ({
|
|
|
46
46
|
muted: e
|
|
47
47
|
});
|
|
48
48
|
function m({ provider: a, src: c, muted: l, autoPlay: d, loop: m }) {
|
|
49
|
-
let [h, g] = r(() => p(l)), _ =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
let [h, g] = r(() => p(l)), _ = n(1), v = e((e) => {
|
|
50
|
+
e.volume != null && e.volume > 0 && (_.current = e.volume), g((t) => ({
|
|
51
|
+
...t,
|
|
52
|
+
...e
|
|
53
|
+
}));
|
|
54
|
+
}, []), y = n(h);
|
|
55
|
+
y.current = h;
|
|
56
|
+
let b = n({
|
|
55
57
|
muted: l,
|
|
56
58
|
autoPlay: d,
|
|
57
59
|
loop: m
|
|
58
60
|
});
|
|
59
|
-
|
|
61
|
+
b.current = {
|
|
60
62
|
muted: l,
|
|
61
63
|
autoPlay: d,
|
|
62
64
|
loop: m
|
|
63
65
|
};
|
|
64
|
-
let
|
|
65
|
-
S.current = e;
|
|
66
|
-
}, []), T = e((e) => {
|
|
66
|
+
let x = n(!1), S = n(null), C = n(null), w = n(null), T = e((e) => {
|
|
67
67
|
C.current = e;
|
|
68
|
+
}, []), E = e((e) => {
|
|
69
|
+
w.current = e;
|
|
68
70
|
}, []);
|
|
69
71
|
return t(() => {
|
|
70
72
|
if (a !== "file") return;
|
|
71
|
-
let e =
|
|
73
|
+
let e = C.current;
|
|
72
74
|
if (!e) return;
|
|
73
|
-
|
|
75
|
+
S.current = {
|
|
74
76
|
play: () => void e.play().catch(() => {}),
|
|
75
77
|
pause: () => e.pause(),
|
|
76
78
|
seek: (t) => {
|
|
@@ -83,34 +85,34 @@ function m({ provider: a, src: c, muted: l, autoPlay: d, loop: m }) {
|
|
|
83
85
|
e.muted = t, !t && e.volume === 0 && (e.volume = 1);
|
|
84
86
|
}
|
|
85
87
|
};
|
|
86
|
-
let t = () =>
|
|
88
|
+
let t = () => v({
|
|
87
89
|
playing: !0,
|
|
88
90
|
ended: !1
|
|
89
|
-
}), n = () =>
|
|
91
|
+
}), n = () => v({ playing: !1 }), r = () => v({
|
|
90
92
|
playing: !1,
|
|
91
93
|
ended: !0
|
|
92
94
|
}), o = () => {
|
|
93
95
|
let t = e.buffered;
|
|
94
|
-
|
|
95
|
-
...
|
|
96
|
+
v({
|
|
97
|
+
...x.current ? {} : { currentTime: e.currentTime },
|
|
96
98
|
buffered: t.length && e.duration ? i(t.end(t.length - 1) / e.duration) : 0
|
|
97
99
|
});
|
|
98
|
-
}, s = () =>
|
|
100
|
+
}, s = () => v({ duration: Number.isFinite(e.duration) ? e.duration : 0 }), c = () => v({
|
|
99
101
|
volume: e.muted ? 0 : e.volume,
|
|
100
102
|
muted: e.muted || e.volume === 0
|
|
101
103
|
});
|
|
102
|
-
return e.addEventListener("play", t), e.addEventListener("pause", n), e.addEventListener("ended", r), e.addEventListener("timeupdate", o), e.addEventListener("progress", o), e.addEventListener("durationchange", s), e.addEventListener("loadedmetadata", s), e.addEventListener("volumechange", c),
|
|
104
|
+
return e.addEventListener("play", t), e.addEventListener("pause", n), e.addEventListener("ended", r), e.addEventListener("timeupdate", o), e.addEventListener("progress", o), e.addEventListener("durationchange", s), e.addEventListener("loadedmetadata", s), e.addEventListener("volumechange", c), v({
|
|
103
105
|
ready: !0,
|
|
104
106
|
muted: e.muted,
|
|
105
107
|
volume: e.muted ? 0 : e.volume
|
|
106
108
|
}), () => {
|
|
107
|
-
e.removeEventListener("play", t), e.removeEventListener("pause", n), e.removeEventListener("ended", r), e.removeEventListener("timeupdate", o), e.removeEventListener("progress", o), e.removeEventListener("durationchange", s), e.removeEventListener("loadedmetadata", s), e.removeEventListener("volumechange", c),
|
|
109
|
+
e.removeEventListener("play", t), e.removeEventListener("pause", n), e.removeEventListener("ended", r), e.removeEventListener("timeupdate", o), e.removeEventListener("progress", o), e.removeEventListener("durationchange", s), e.removeEventListener("loadedmetadata", s), e.removeEventListener("volumechange", c), S.current = null;
|
|
108
110
|
};
|
|
109
|
-
}, [a,
|
|
111
|
+
}, [a, v]), t(() => {
|
|
110
112
|
if (a !== "youtube" || !c) return;
|
|
111
|
-
let e =
|
|
113
|
+
let e = w.current;
|
|
112
114
|
if (!e) return;
|
|
113
|
-
let t = null, n, r = !1, { muted: i, autoPlay: s, loop: l } =
|
|
115
|
+
let t = null, n, r = !1, { muted: i, autoPlay: s, loop: l } = b.current, d = o(c);
|
|
114
116
|
return u().then((a) => {
|
|
115
117
|
if (r) return;
|
|
116
118
|
let o = document.createElement("div");
|
|
@@ -133,7 +135,7 @@ function m({ provider: a, src: c, muted: l, autoPlay: d, loop: m }) {
|
|
|
133
135
|
events: {
|
|
134
136
|
onReady: (e) => {
|
|
135
137
|
let r = e.target;
|
|
136
|
-
i && r.mute(),
|
|
138
|
+
i && r.mute(), S.current = {
|
|
137
139
|
play: () => r.playVideo(),
|
|
138
140
|
pause: () => r.pauseVideo(),
|
|
139
141
|
seek: (e) => r.seekTo(e, !0),
|
|
@@ -141,14 +143,14 @@ function m({ provider: a, src: c, muted: l, autoPlay: d, loop: m }) {
|
|
|
141
143
|
e === 0 ? r.mute() : (r.unMute(), r.setVolume(e * 100));
|
|
142
144
|
},
|
|
143
145
|
setMuted: (e) => e ? r.mute() : r.unMute()
|
|
144
|
-
},
|
|
146
|
+
}, v({
|
|
145
147
|
ready: !0,
|
|
146
148
|
duration: r.getDuration() || 0,
|
|
147
149
|
muted: r.isMuted(),
|
|
148
150
|
volume: r.isMuted() ? 0 : r.getVolume() / 100
|
|
149
151
|
}), n = window.setInterval(() => {
|
|
150
|
-
t &&
|
|
151
|
-
...
|
|
152
|
+
t && v({
|
|
153
|
+
...x.current ? {} : { currentTime: t.getCurrentTime() || 0 },
|
|
152
154
|
duration: t.getDuration() || 0,
|
|
153
155
|
buffered: t.getVideoLoadedFraction() || 0,
|
|
154
156
|
muted: t.isMuted(),
|
|
@@ -157,10 +159,10 @@ function m({ provider: a, src: c, muted: l, autoPlay: d, loop: m }) {
|
|
|
157
159
|
}, 250);
|
|
158
160
|
},
|
|
159
161
|
onStateChange: (e) => {
|
|
160
|
-
e.data === 1 ?
|
|
162
|
+
e.data === 1 ? v({
|
|
161
163
|
playing: !0,
|
|
162
164
|
ended: !1
|
|
163
|
-
}) : e.data === 2 ?
|
|
165
|
+
}) : e.data === 2 ? v({ playing: !1 }) : e.data === 0 && v({
|
|
164
166
|
playing: !1,
|
|
165
167
|
ended: !0
|
|
166
168
|
});
|
|
@@ -168,7 +170,7 @@ function m({ provider: a, src: c, muted: l, autoPlay: d, loop: m }) {
|
|
|
168
170
|
}
|
|
169
171
|
});
|
|
170
172
|
}), () => {
|
|
171
|
-
r = !0, window.clearInterval(n),
|
|
173
|
+
r = !0, window.clearInterval(n), S.current = null;
|
|
172
174
|
try {
|
|
173
175
|
t?.destroy();
|
|
174
176
|
} catch {}
|
|
@@ -177,12 +179,12 @@ function m({ provider: a, src: c, muted: l, autoPlay: d, loop: m }) {
|
|
|
177
179
|
}, [
|
|
178
180
|
a,
|
|
179
181
|
c,
|
|
180
|
-
|
|
182
|
+
v
|
|
181
183
|
]), t(() => {
|
|
182
184
|
if (a !== "vimeo" || !c) return;
|
|
183
|
-
let e =
|
|
185
|
+
let e = w.current;
|
|
184
186
|
if (!e) return;
|
|
185
|
-
let t = null, n = !1, { muted: r, autoPlay: o, loop: l } =
|
|
187
|
+
let t = null, n = !1, { muted: r, autoPlay: o, loop: l } = b.current;
|
|
186
188
|
return f().then((a) => {
|
|
187
189
|
if (n) return;
|
|
188
190
|
t = new a.Player(e, {
|
|
@@ -196,7 +198,7 @@ function m({ provider: a, src: c, muted: l, autoPlay: d, loop: m }) {
|
|
|
196
198
|
width: e.clientWidth || void 0
|
|
197
199
|
});
|
|
198
200
|
let u = t;
|
|
199
|
-
|
|
201
|
+
S.current = {
|
|
200
202
|
play: () => void u.play().catch(() => {}),
|
|
201
203
|
pause: () => void u.pause().catch(() => {}),
|
|
202
204
|
seek: (e) => void u.setCurrentTime(e).catch(() => {}),
|
|
@@ -205,29 +207,29 @@ function m({ provider: a, src: c, muted: l, autoPlay: d, loop: m }) {
|
|
|
205
207
|
},
|
|
206
208
|
setMuted: (e) => void u.setMuted(e)
|
|
207
209
|
}, u.ready().then(async () => {
|
|
208
|
-
|
|
210
|
+
v({
|
|
209
211
|
ready: !0,
|
|
210
212
|
duration: await u.getDuration().catch(() => 0),
|
|
211
213
|
muted: r,
|
|
212
214
|
volume: +!r
|
|
213
215
|
});
|
|
214
|
-
}), u.on("play", () =>
|
|
216
|
+
}), u.on("play", () => v({
|
|
215
217
|
playing: !0,
|
|
216
218
|
ended: !1
|
|
217
|
-
})), u.on("pause", () =>
|
|
219
|
+
})), u.on("pause", () => v({ playing: !1 })), u.on("ended", () => v({
|
|
218
220
|
playing: !1,
|
|
219
221
|
ended: !0
|
|
220
222
|
})), u.on("timeupdate", (e) => {
|
|
221
|
-
|
|
222
|
-
...
|
|
223
|
+
v({
|
|
224
|
+
...x.current ? {} : { currentTime: e.seconds },
|
|
223
225
|
duration: e.duration
|
|
224
226
|
});
|
|
225
|
-
}), u.on("progress", (e) =>
|
|
227
|
+
}), u.on("progress", (e) => v({ buffered: i(e.percent) })), u.on("volumechange", (e) => v({
|
|
226
228
|
volume: e.volume,
|
|
227
229
|
muted: e.volume === 0
|
|
228
230
|
}));
|
|
229
231
|
}), () => {
|
|
230
|
-
n = !0,
|
|
232
|
+
n = !0, S.current = null;
|
|
231
233
|
try {
|
|
232
234
|
t?.destroy();
|
|
233
235
|
} catch {}
|
|
@@ -236,38 +238,39 @@ function m({ provider: a, src: c, muted: l, autoPlay: d, loop: m }) {
|
|
|
236
238
|
}, [
|
|
237
239
|
a,
|
|
238
240
|
c,
|
|
239
|
-
|
|
241
|
+
v
|
|
240
242
|
]), {
|
|
241
243
|
state: h,
|
|
242
|
-
videoRef:
|
|
243
|
-
mountRef:
|
|
244
|
+
videoRef: T,
|
|
245
|
+
mountRef: E,
|
|
244
246
|
toggle: e(() => {
|
|
245
|
-
|
|
247
|
+
y.current.playing ? S.current?.pause() : S.current?.play();
|
|
246
248
|
}, []),
|
|
247
249
|
seekFraction: e((e) => {
|
|
248
|
-
let t =
|
|
250
|
+
let t = y.current.duration;
|
|
249
251
|
if (!t) return;
|
|
250
252
|
let n = i(e) * t;
|
|
251
|
-
|
|
252
|
-
}, [
|
|
253
|
+
v({ currentTime: n }), S.current?.seek(n);
|
|
254
|
+
}, [v]),
|
|
253
255
|
seekBy: e((e) => {
|
|
254
|
-
let { currentTime: t, duration: n } =
|
|
256
|
+
let { currentTime: t, duration: n } = y.current;
|
|
255
257
|
if (!n) return;
|
|
256
258
|
let r = Math.max(0, Math.min(n, t + e));
|
|
257
|
-
|
|
258
|
-
}, [
|
|
259
|
+
v({ currentTime: r }), S.current?.seek(r);
|
|
260
|
+
}, [v]),
|
|
259
261
|
setVolume: e((e) => {
|
|
260
|
-
|
|
262
|
+
let t = i(e);
|
|
263
|
+
t > 0 && (_.current = t), S.current?.setVolume(t);
|
|
261
264
|
}, []),
|
|
262
265
|
toggleMute: e(() => {
|
|
263
|
-
let e =
|
|
264
|
-
|
|
266
|
+
let e = y.current, t = e.muted || e.volume === 0;
|
|
267
|
+
t && e.volume === 0 && S.current?.setVolume(_.current), S.current?.setMuted(!t);
|
|
265
268
|
}, []),
|
|
266
269
|
beginSeek: e(() => {
|
|
267
|
-
|
|
270
|
+
x.current = !0;
|
|
268
271
|
}, []),
|
|
269
272
|
endSeek: e(() => {
|
|
270
|
-
|
|
273
|
+
x.current = !1;
|
|
271
274
|
}, [])
|
|
272
275
|
};
|
|
273
276
|
}
|