markdown-flow-ui 0.1.115-beta.4 → 0.1.115-beta.5
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/dist/components/Slide/Player.cjs.js +1 -1
- package/dist/components/Slide/Player.cjs.js.map +1 -1
- package/dist/components/Slide/Player.es.js +291 -280
- package/dist/components/Slide/Player.es.js.map +1 -1
- package/dist/components/Slide/Slide.cjs.js +1 -1
- package/dist/components/Slide/Slide.cjs.js.map +1 -1
- package/dist/components/Slide/Slide.es.js +478 -481
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/utils/audioCompletion.cjs.js +2 -0
- package/dist/components/Slide/utils/audioCompletion.cjs.js.map +1 -0
- package/dist/components/Slide/utils/audioCompletion.d.ts +7 -0
- package/dist/components/Slide/utils/audioCompletion.es.js +9 -0
- package/dist/components/Slide/utils/audioCompletion.es.js.map +1 -0
- package/dist/components/Slide/utils/audioCompletion.test.d.ts +1 -0
- package/dist/components/Slide/utils/playbackSequence.cjs.js +1 -1
- package/dist/components/Slide/utils/playbackSequence.cjs.js.map +1 -1
- package/dist/components/Slide/utils/playbackSequence.d.ts +0 -4
- package/dist/components/Slide/utils/playbackSequence.es.js +7 -20
- package/dist/components/Slide/utils/playbackSequence.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import { cn as
|
|
4
|
-
import
|
|
5
|
-
import { DEFAULT_SLIDE_PLAYER_TEXTS as
|
|
6
|
-
import { DEFAULT_MOBILE_VIEW_MODE as
|
|
7
|
-
import {
|
|
1
|
+
import { j as t } from "../../_virtual/jsx-runtime.es.js";
|
|
2
|
+
import er, { memo as rr, useRef as c, useState as ke, useMemo as q, useEffect as S, useCallback as u } from "react";
|
|
3
|
+
import { cn as Ee } from "../../lib/utils.es.js";
|
|
4
|
+
import tr from "./MobilePlayerSettingsSheet.es.js";
|
|
5
|
+
import { DEFAULT_SLIDE_PLAYER_TEXTS as nr } from "./constants.es.js";
|
|
6
|
+
import { DEFAULT_MOBILE_VIEW_MODE as ur } from "./utils/mobileScreenMode.es.js";
|
|
7
|
+
import { hasReachedAudioEnd as sr } from "./utils/audioCompletion.es.js";
|
|
8
|
+
import { toPlayerCustomActionList as lr } from "./utils/playerCustomActions.es.js";
|
|
8
9
|
/* empty css */
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
const
|
|
19
|
-
if (typeof window > "u" || !R ||
|
|
10
|
+
import ar from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
|
|
11
|
+
import cr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
|
|
12
|
+
import ir from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions.es.js";
|
|
13
|
+
import or from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
|
|
14
|
+
import fr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js";
|
|
15
|
+
import dr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js";
|
|
16
|
+
import mr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
|
|
17
|
+
import pr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/maximize.es.js";
|
|
18
|
+
import hr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
|
|
19
|
+
const Ne = /* @__PURE__ */ new Map(), Re = (R) => {
|
|
20
|
+
if (typeof window > "u" || !R || Ne.has(R))
|
|
20
21
|
return;
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
},
|
|
22
|
+
const v = window.document.createElement("audio");
|
|
23
|
+
v.preload = "auto", v.setAttribute("playsinline", "true"), v.src = R, v.load(), Ne.set(R, v);
|
|
24
|
+
}, gr = () => /* @__PURE__ */ t.jsxs(
|
|
24
25
|
"svg",
|
|
25
26
|
{
|
|
26
27
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -29,17 +30,17 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
29
30
|
viewBox: "0 0 34 34",
|
|
30
31
|
fill: "none",
|
|
31
32
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ t.jsx(
|
|
33
34
|
"path",
|
|
34
35
|
{
|
|
35
36
|
d: "M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z",
|
|
36
37
|
fill: "#0A0A0A"
|
|
37
38
|
}
|
|
38
39
|
),
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ t.jsx("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
|
|
40
41
|
]
|
|
41
42
|
}
|
|
42
|
-
),
|
|
43
|
+
), yr = () => /* @__PURE__ */ t.jsxs(
|
|
43
44
|
"svg",
|
|
44
45
|
{
|
|
45
46
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -48,294 +49,303 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
48
49
|
viewBox: "0 0 34 34",
|
|
49
50
|
fill: "none",
|
|
50
51
|
children: [
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ t.jsx(
|
|
52
53
|
"path",
|
|
53
54
|
{
|
|
54
55
|
d: "M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z",
|
|
55
56
|
fill: "#0A0A0A"
|
|
56
57
|
}
|
|
57
58
|
),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ t.jsx("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
|
|
59
60
|
]
|
|
60
61
|
}
|
|
61
|
-
),
|
|
62
|
+
), _r = ({
|
|
62
63
|
audioList: R = [],
|
|
63
|
-
className:
|
|
64
|
+
className: v,
|
|
64
65
|
currentAudioIndex: m = -1,
|
|
65
66
|
defaultPlaying: A = !0,
|
|
66
|
-
isPlaybackPaused:
|
|
67
|
-
isAutoAdvanceEnabled:
|
|
68
|
-
useAutoAdvanceToggle:
|
|
69
|
-
onLoadingChange:
|
|
70
|
-
onPlaybackStarted:
|
|
71
|
-
onPlaybackTimeChange:
|
|
72
|
-
onSubtitleToggle:
|
|
73
|
-
onPrev:
|
|
74
|
-
onNext:
|
|
67
|
+
isPlaybackPaused: F = !1,
|
|
68
|
+
isAutoAdvanceEnabled: G = !0,
|
|
69
|
+
useAutoAdvanceToggle: J = !1,
|
|
70
|
+
onLoadingChange: ne,
|
|
71
|
+
onPlaybackStarted: ue,
|
|
72
|
+
onPlaybackTimeChange: z,
|
|
73
|
+
onSubtitleToggle: se,
|
|
74
|
+
onPrev: Te,
|
|
75
|
+
onNext: Ce,
|
|
75
76
|
onFullscreen: le,
|
|
76
|
-
isFullscreen:
|
|
77
|
-
mobileViewMode:
|
|
78
|
-
settingsPortalContainer:
|
|
79
|
-
onMobileViewModeChange:
|
|
80
|
-
onEnded:
|
|
81
|
-
onAutoAdvanceToggle:
|
|
82
|
-
onInteractionToggle:
|
|
83
|
-
hasInteraction:
|
|
84
|
-
isInteractionOpen:
|
|
85
|
-
isSubtitleEnabled:
|
|
86
|
-
prevDisabled:
|
|
87
|
-
nextDisabled:
|
|
88
|
-
showControls:
|
|
89
|
-
customActions:
|
|
90
|
-
customActionContext:
|
|
91
|
-
texts:
|
|
92
|
-
...
|
|
77
|
+
isFullscreen: ae = !1,
|
|
78
|
+
mobileViewMode: Le = ur,
|
|
79
|
+
settingsPortalContainer: ve,
|
|
80
|
+
onMobileViewModeChange: ce,
|
|
81
|
+
onEnded: ie,
|
|
82
|
+
onAutoAdvanceToggle: Fe,
|
|
83
|
+
onInteractionToggle: Ue,
|
|
84
|
+
hasInteraction: We = !1,
|
|
85
|
+
isInteractionOpen: $ = !1,
|
|
86
|
+
isSubtitleEnabled: Q = !0,
|
|
87
|
+
prevDisabled: Pe = !1,
|
|
88
|
+
nextDisabled: Ve = !1,
|
|
89
|
+
showControls: I = !0,
|
|
90
|
+
customActions: oe,
|
|
91
|
+
customActionContext: fe,
|
|
92
|
+
texts: de,
|
|
93
|
+
...Be
|
|
93
94
|
}) => {
|
|
94
|
-
const
|
|
95
|
+
const p = c(null), me = c($), M = c(null), pe = c(null), x = c(0), a = c(null), D = c(void 0), j = c([]), H = c(!1), he = c(!1), g = c(!1), T = c(null), y = c(!1), s = c(!1), h = c(null), w = c(!1), U = c(null), ee = c(0), C = c("unknown"), [re, i] = ke(A), [ge, B] = ke(!1), f = m >= 0 ? R[m] : void 0, K = f?.audioUrl, k = q(
|
|
95
96
|
() => [...f?.audioSegments ?? []].sort(
|
|
96
|
-
(e,
|
|
97
|
+
(e, r) => e.segment_index - r.segment_index
|
|
97
98
|
),
|
|
98
99
|
[f?.audioSegments]
|
|
99
|
-
),
|
|
100
|
-
() =>
|
|
101
|
-
[
|
|
102
|
-
),
|
|
100
|
+
), ye = q(
|
|
101
|
+
() => lr(oe, fe),
|
|
102
|
+
[fe, oe]
|
|
103
|
+
), _e = ye.length + 5, Ke = q(
|
|
103
104
|
() => ({
|
|
104
|
-
"--slide-player-mobile-control-count": String(
|
|
105
|
+
"--slide-player-mobile-control-count": String(_e)
|
|
105
106
|
}),
|
|
106
|
-
[
|
|
107
|
-
), W =
|
|
107
|
+
[_e]
|
|
108
|
+
), W = q(
|
|
108
109
|
() => ({
|
|
109
|
-
...
|
|
110
|
-
...
|
|
110
|
+
...nr,
|
|
111
|
+
...de
|
|
111
112
|
}),
|
|
112
|
-
[
|
|
113
|
-
),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}, [f]),
|
|
117
|
-
|
|
118
|
-
}, [
|
|
119
|
-
!
|
|
120
|
-
}, [
|
|
113
|
+
[de]
|
|
114
|
+
), te = q(() => f ? f.audioKey ?? `${String(f.sequenceNumber ?? "none")}:${String(f.audioUrl ?? "")}` : "none", [f]), Ze = J ? G : re, $e = J ? G ? "Pause autoplay" : "Play autoplay" : re ? "Pause" : "Play";
|
|
115
|
+
S(() => {
|
|
116
|
+
D.current = f;
|
|
117
|
+
}, [f]), S(() => {
|
|
118
|
+
I || B(!1);
|
|
119
|
+
}, [I]), S(() => {
|
|
120
|
+
!me.current && $ && B(!1), me.current = $;
|
|
121
|
+
}, [$]), S(() => {
|
|
121
122
|
j.current = k;
|
|
122
|
-
}, [k]),
|
|
123
|
-
const e = f?.audioUrl,
|
|
124
|
-
|
|
123
|
+
}, [k]), S(() => {
|
|
124
|
+
const e = f?.audioUrl, r = m >= 0 ? R[m + 1]?.audioUrl : void 0;
|
|
125
|
+
Re(e), Re(r);
|
|
125
126
|
}, [R, f?.audioUrl, m]);
|
|
126
|
-
const
|
|
127
|
-
(e,
|
|
128
|
-
|
|
127
|
+
const n = u(
|
|
128
|
+
(e, r = null) => {
|
|
129
|
+
he.current === e && (!e || r === null) || (he.current = e, ne?.({
|
|
129
130
|
loading: e,
|
|
130
|
-
reason: e ?
|
|
131
|
+
reason: e ? r : null
|
|
131
132
|
}));
|
|
132
133
|
},
|
|
133
|
-
[
|
|
134
|
-
),
|
|
134
|
+
[ne]
|
|
135
|
+
), be = u((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), L = u(() => A && !F && !g.current && C.current !== "blocked", [A, F]), Se = u((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), xe = u(() => {
|
|
135
136
|
const e = a.current;
|
|
136
137
|
return e == null || e <= 0 ? 0 : j.current.slice(0, e).reduce(
|
|
137
|
-
(
|
|
138
|
+
(r, l) => r + Math.max(Number(l.duration_ms ?? 0), 0),
|
|
138
139
|
0
|
|
139
140
|
) / 1e3;
|
|
140
141
|
}, []), P = u((e) => e <= 0 ? 0 : j.current.slice(0, e).reduce(
|
|
141
|
-
(
|
|
142
|
+
(r, l) => r + Math.max(Number(l.duration_ms ?? 0), 0),
|
|
142
143
|
0
|
|
143
|
-
), []),
|
|
144
|
-
const e =
|
|
145
|
-
return e ?
|
|
144
|
+
), []), we = u(() => {
|
|
145
|
+
const e = p.current;
|
|
146
|
+
return e ? T.current === "segment" ? P(x.current) + Math.max(e.currentTime, 0) * 1e3 : h.current !== null && e.readyState === 0 ? h.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : a.current != null ? P(a.current) : 0;
|
|
146
147
|
}, [P]), _ = u(
|
|
147
148
|
(e) => {
|
|
148
|
-
const
|
|
149
|
-
|
|
149
|
+
const r = Math.max(e, 0);
|
|
150
|
+
ee.current !== r && (ee.current = r, z?.(r));
|
|
150
151
|
},
|
|
151
|
-
[
|
|
152
|
+
[z]
|
|
152
153
|
), o = u(() => {
|
|
153
|
-
_(
|
|
154
|
-
}, [
|
|
154
|
+
_(we());
|
|
155
|
+
}, [we, _]), d = u(() => {
|
|
155
156
|
typeof window > "u" || U.current === null || (window.cancelAnimationFrame(U.current), U.current = null);
|
|
156
|
-
}, []),
|
|
157
|
+
}, []), Ae = u(() => {
|
|
157
158
|
if (typeof window > "u" || U.current !== null)
|
|
158
159
|
return;
|
|
159
160
|
const e = () => {
|
|
160
161
|
o();
|
|
161
|
-
const
|
|
162
|
-
if (!
|
|
162
|
+
const r = p.current;
|
|
163
|
+
if (!r || r.paused || r.ended) {
|
|
163
164
|
U.current = null;
|
|
164
165
|
return;
|
|
165
166
|
}
|
|
166
167
|
U.current = window.requestAnimationFrame(e);
|
|
167
168
|
};
|
|
168
169
|
U.current = window.requestAnimationFrame(e);
|
|
169
|
-
}, [o]),
|
|
170
|
-
const e =
|
|
171
|
-
e && (d(),
|
|
172
|
-
}, [_, d,
|
|
170
|
+
}, [o]), O = u(() => {
|
|
171
|
+
const e = p.current;
|
|
172
|
+
e && (d(), s.current = !1, g.current = !1, H.current = !1, T.current = null, h.current = null, y.current = !1, w.current = !1, e.pause(), e.removeAttribute("src"), e.load(), M.current = null, x.current = 0, a.current = null, _(0), i(!1), n(!1));
|
|
173
|
+
}, [_, d, n]), b = u(
|
|
173
174
|
(e) => {
|
|
174
|
-
const
|
|
175
|
-
if (!
|
|
175
|
+
const r = p.current;
|
|
176
|
+
if (!r)
|
|
176
177
|
return !1;
|
|
177
|
-
const
|
|
178
|
-
return
|
|
179
|
-
|
|
178
|
+
const l = r.play();
|
|
179
|
+
return l && typeof l.then == "function" && l.then(() => {
|
|
180
|
+
C.current === "unknown" && (C.current = "auto"), s.current = !1, w.current = !1;
|
|
180
181
|
}).catch((V) => {
|
|
181
|
-
|
|
182
|
+
C.current === "unknown" && be(V) && (C.current = "blocked", s.current = !1, n(!1)), w.current = !1, i(!1);
|
|
182
183
|
}), !0;
|
|
183
184
|
},
|
|
184
|
-
[
|
|
185
|
+
[be, n]
|
|
185
186
|
), E = u(
|
|
186
|
-
(e,
|
|
187
|
-
const
|
|
188
|
-
if (!
|
|
187
|
+
(e, r) => {
|
|
188
|
+
const l = p.current, V = j.current[e];
|
|
189
|
+
if (!l || !V)
|
|
189
190
|
return !1;
|
|
190
|
-
const N =
|
|
191
|
-
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
const
|
|
195
|
-
return
|
|
191
|
+
const N = Se(V.audio_data);
|
|
192
|
+
x.current = e, a.current = null, y.current = !1, w.current = !0, _(P(e));
|
|
193
|
+
const Y = L();
|
|
194
|
+
s.current = Y, n(!1);
|
|
195
|
+
const Ie = M.current !== N;
|
|
196
|
+
return T.current = "segment", Ie && (l.pause(), l.removeAttribute("src"), l.load(), M.current = N, l.src = N, l.load()), h.current = 0, l.readyState > 0 && (l.currentTime = 0, h.current = null), Y ? b(`start-segment:${r}`) : (s.current = !1, w.current = !1, l.pause(), i(!1), !0);
|
|
196
197
|
},
|
|
197
198
|
[
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
L,
|
|
200
|
+
Se,
|
|
200
201
|
P,
|
|
201
202
|
_,
|
|
202
203
|
b,
|
|
203
|
-
|
|
204
|
+
n
|
|
204
205
|
]
|
|
205
|
-
),
|
|
206
|
+
), Z = u(
|
|
206
207
|
(e) => {
|
|
207
|
-
d(),
|
|
208
|
+
d(), s.current = !1, y.current = !1, w.current = !1, o(), i(!1), n(!1), m >= 0 && ie?.(m);
|
|
208
209
|
},
|
|
209
210
|
[
|
|
210
211
|
m,
|
|
211
|
-
|
|
212
|
+
ie,
|
|
212
213
|
d,
|
|
213
214
|
o,
|
|
214
|
-
|
|
215
|
+
n
|
|
215
216
|
]
|
|
216
|
-
),
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
), X = u(
|
|
218
|
+
(e) => {
|
|
219
|
+
const r = p.current;
|
|
220
|
+
return !r || T.current !== "url" || !sr({
|
|
221
|
+
currentTimeSeconds: Math.max(r.currentTime, 0),
|
|
222
|
+
durationSeconds: r.duration
|
|
223
|
+
}) ? !1 : (s.current = !1, r.pause(), Z(e), !0);
|
|
224
|
+
},
|
|
225
|
+
[Z]
|
|
226
|
+
), Me = u(() => {
|
|
227
|
+
const e = x.current + 1, r = j.current, l = r[e], V = D.current, N = r.some((Y) => Y.is_final);
|
|
228
|
+
if (l) {
|
|
219
229
|
E(e, "ended");
|
|
220
230
|
return;
|
|
221
231
|
}
|
|
222
232
|
if (V?.isAudioStreaming || !N) {
|
|
223
|
-
|
|
233
|
+
x.current = e, a.current = e, y.current = !0, s.current = A, _(P(e)), i(!1), n(!0, "waitingForMoreAudio");
|
|
224
234
|
return;
|
|
225
235
|
}
|
|
226
|
-
|
|
236
|
+
Z("segments-completed");
|
|
227
237
|
}, [
|
|
228
238
|
A,
|
|
229
|
-
|
|
239
|
+
Z,
|
|
230
240
|
P,
|
|
231
241
|
_,
|
|
232
242
|
E,
|
|
233
|
-
|
|
243
|
+
n
|
|
234
244
|
]);
|
|
235
|
-
|
|
236
|
-
if (
|
|
245
|
+
S(() => {
|
|
246
|
+
if (pe.current === te)
|
|
237
247
|
return;
|
|
238
|
-
|
|
239
|
-
const e =
|
|
248
|
+
pe.current = te, x.current = 0, a.current = null, y.current = !1, g.current = !1, H.current = !1, s.current = !1, w.current = !1, T.current = null, M.current = null, d(), _(0), n(!1);
|
|
249
|
+
const e = p.current;
|
|
240
250
|
e && (e.pause(), e.removeAttribute("src"), e.load(), i(!1));
|
|
241
251
|
}, [
|
|
242
252
|
m,
|
|
243
|
-
|
|
253
|
+
te,
|
|
244
254
|
k.length,
|
|
245
255
|
K,
|
|
246
256
|
_,
|
|
247
257
|
d,
|
|
248
|
-
|
|
249
|
-
]),
|
|
250
|
-
const e =
|
|
258
|
+
n
|
|
259
|
+
]), S(() => {
|
|
260
|
+
const e = p.current;
|
|
251
261
|
if (e) {
|
|
252
|
-
if (
|
|
253
|
-
|
|
262
|
+
if (F) {
|
|
263
|
+
H.current = !!(D.current && !g.current && (!e.paused || s.current || a.current !== null)), s.current = !1, n(!1), e.pause(), i(!1);
|
|
254
264
|
return;
|
|
255
265
|
}
|
|
256
|
-
if (!(
|
|
257
|
-
if (
|
|
266
|
+
if (!(!H.current || !D.current || g.current)) {
|
|
267
|
+
if (H.current = !1, a.current !== null) {
|
|
258
268
|
if (a.current < j.current.length) {
|
|
259
269
|
E(a.current, "external-resume");
|
|
260
270
|
return;
|
|
261
271
|
}
|
|
262
|
-
|
|
272
|
+
s.current = !0, n(!0, "waitingForMoreAudio");
|
|
263
273
|
return;
|
|
264
274
|
}
|
|
265
275
|
if (!M.current && j.current.length > 0) {
|
|
266
276
|
E(
|
|
267
277
|
Math.min(
|
|
268
|
-
|
|
278
|
+
x.current,
|
|
269
279
|
j.current.length - 1
|
|
270
280
|
),
|
|
271
281
|
"external-resume-init"
|
|
272
282
|
);
|
|
273
283
|
return;
|
|
274
284
|
}
|
|
275
|
-
e.paused && (
|
|
285
|
+
e.paused && (s.current = !0, b("external-resume"));
|
|
276
286
|
}
|
|
277
287
|
}
|
|
278
288
|
}, [
|
|
279
|
-
|
|
289
|
+
F,
|
|
280
290
|
E,
|
|
281
291
|
b,
|
|
282
|
-
|
|
283
|
-
]),
|
|
284
|
-
const e =
|
|
292
|
+
n
|
|
293
|
+
]), S(() => {
|
|
294
|
+
const e = p.current;
|
|
285
295
|
if (e) {
|
|
286
296
|
if (!f) {
|
|
287
|
-
|
|
297
|
+
O();
|
|
288
298
|
return;
|
|
289
299
|
}
|
|
290
|
-
if (
|
|
291
|
-
|
|
300
|
+
if (F) {
|
|
301
|
+
s.current = !1, n(!1), e.pause(), i(!1);
|
|
292
302
|
return;
|
|
293
303
|
}
|
|
294
304
|
if (K) {
|
|
295
|
-
const
|
|
296
|
-
if (
|
|
297
|
-
if (!
|
|
298
|
-
|
|
305
|
+
const r = M.current !== K, l = L();
|
|
306
|
+
if (T.current === "segment" && !!M.current && a.current === null) {
|
|
307
|
+
if (!l) {
|
|
308
|
+
s.current = !1, e.pause(), i(!1);
|
|
299
309
|
return;
|
|
300
310
|
}
|
|
301
|
-
e.paused && (
|
|
311
|
+
e.paused && (s.current = !0, b("keep-segment-source"));
|
|
302
312
|
return;
|
|
303
313
|
}
|
|
304
|
-
if (
|
|
314
|
+
if (r) {
|
|
305
315
|
const N = a.current !== null ? xe() : 0;
|
|
306
|
-
e.pause(), e.removeAttribute("src"), e.load(), M.current = K,
|
|
316
|
+
e.pause(), e.removeAttribute("src"), e.load(), M.current = K, T.current = "url", e.src = K, e.load(), h.current = N, _(N * 1e3), e.readyState > 0 && (e.currentTime = N, h.current = null);
|
|
307
317
|
}
|
|
308
|
-
if (
|
|
309
|
-
|
|
318
|
+
if (s.current = l, y.current = !1, w.current = !1, n(!1), !l) {
|
|
319
|
+
s.current = !1, e.pause(), i(!1);
|
|
310
320
|
return;
|
|
311
321
|
}
|
|
312
|
-
b(
|
|
322
|
+
b(r ? "sync-url-init" : "sync-url");
|
|
313
323
|
return;
|
|
314
324
|
}
|
|
315
325
|
if (a.current !== null) {
|
|
316
326
|
if (a.current < k.length) {
|
|
317
327
|
if (g.current) {
|
|
318
|
-
i(!1),
|
|
328
|
+
i(!1), n(!1);
|
|
319
329
|
return;
|
|
320
330
|
}
|
|
321
331
|
E(a.current, "wait-resume");
|
|
322
332
|
return;
|
|
323
333
|
}
|
|
324
|
-
y.current = !0,
|
|
334
|
+
y.current = !0, s.current = L(), i(!1), n(L());
|
|
325
335
|
return;
|
|
326
336
|
}
|
|
327
337
|
if (!k.length) {
|
|
328
338
|
if (f.isAudioStreaming) {
|
|
329
|
-
a.current =
|
|
339
|
+
a.current = x.current, y.current = !0, s.current = L(), i(!1), n(L());
|
|
330
340
|
return;
|
|
331
341
|
}
|
|
332
|
-
|
|
342
|
+
O();
|
|
333
343
|
return;
|
|
334
344
|
}
|
|
335
345
|
if (!M.current) {
|
|
336
346
|
E(
|
|
337
347
|
Math.min(
|
|
338
|
-
|
|
348
|
+
x.current,
|
|
339
349
|
k.length - 1
|
|
340
350
|
),
|
|
341
351
|
"effect-init"
|
|
@@ -343,10 +353,10 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
343
353
|
return;
|
|
344
354
|
}
|
|
345
355
|
if (!A || g.current) {
|
|
346
|
-
|
|
356
|
+
s.current = !1, e.pause(), i(!1);
|
|
347
357
|
return;
|
|
348
358
|
}
|
|
349
|
-
e.paused && (
|
|
359
|
+
e.paused && (s.current = !0, b("sync-paused-retry"));
|
|
350
360
|
}
|
|
351
361
|
}, [
|
|
352
362
|
f,
|
|
@@ -354,89 +364,90 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
354
364
|
k,
|
|
355
365
|
K,
|
|
356
366
|
A,
|
|
357
|
-
|
|
358
|
-
|
|
367
|
+
F,
|
|
368
|
+
L,
|
|
359
369
|
_,
|
|
360
|
-
|
|
370
|
+
O,
|
|
361
371
|
E,
|
|
362
372
|
b,
|
|
363
373
|
xe,
|
|
364
|
-
|
|
365
|
-
]),
|
|
366
|
-
const
|
|
367
|
-
o(),
|
|
374
|
+
n
|
|
375
|
+
]), S(() => O, [O]), S(() => d, [d]);
|
|
376
|
+
const He = u(() => {
|
|
377
|
+
o(), Ae(), i(!0), n(!1), ue?.();
|
|
368
378
|
}, [
|
|
369
|
-
|
|
370
|
-
|
|
379
|
+
ue,
|
|
380
|
+
Ae,
|
|
371
381
|
o,
|
|
372
|
-
|
|
373
|
-
]),
|
|
382
|
+
n
|
|
383
|
+
]), Oe = u(() => {
|
|
374
384
|
y.current || w.current || (d(), o(), i(!1));
|
|
375
|
-
}, [m, d, o]),
|
|
376
|
-
const e =
|
|
377
|
-
e &&
|
|
385
|
+
}, [m, d, o]), qe = u(() => {
|
|
386
|
+
const e = p.current;
|
|
387
|
+
e && h.current !== null && (e.currentTime = h.current, h.current = null), o(), !X("canplay-seek-finished") && (!s.current || !A || b("canplay"));
|
|
378
388
|
}, [
|
|
379
389
|
m,
|
|
380
390
|
A,
|
|
391
|
+
X,
|
|
381
392
|
o,
|
|
382
393
|
b
|
|
383
|
-
]),
|
|
384
|
-
const e =
|
|
385
|
-
e &&
|
|
386
|
-
}, [m, o]),
|
|
394
|
+
]), ze = u(() => {
|
|
395
|
+
const e = p.current;
|
|
396
|
+
e && h.current !== null && (e.currentTime = h.current, h.current = null), o(), X("metadata-seek-finished");
|
|
397
|
+
}, [m, X, o]), De = u(() => {
|
|
387
398
|
o();
|
|
388
|
-
}, [o]),
|
|
389
|
-
y.current ||
|
|
390
|
-
}, [
|
|
399
|
+
}, [o]), Xe = u(() => {
|
|
400
|
+
y.current || n(!0, "loadingAudio");
|
|
401
|
+
}, [n]), Ye = u(() => {
|
|
391
402
|
if (y.current) {
|
|
392
|
-
|
|
403
|
+
n(!0, "waitingForMoreAudio");
|
|
393
404
|
return;
|
|
394
405
|
}
|
|
395
|
-
|
|
396
|
-
}, [
|
|
406
|
+
n(!0, "loadingAudio");
|
|
407
|
+
}, [n]), je = u(() => {
|
|
397
408
|
o();
|
|
398
|
-
}, [o]),
|
|
399
|
-
const e =
|
|
409
|
+
}, [o]), Ge = u(() => {
|
|
410
|
+
const e = T.current === "url" || j.current.length === 0;
|
|
400
411
|
if (d(), w.current = !1, e) {
|
|
401
|
-
|
|
412
|
+
Z("url-ended");
|
|
402
413
|
return;
|
|
403
414
|
}
|
|
404
|
-
|
|
405
|
-
}, [
|
|
406
|
-
d(), o(), i(!1),
|
|
407
|
-
}, [d, o,
|
|
415
|
+
Me();
|
|
416
|
+
}, [Z, Me, d]), Je = u(() => {
|
|
417
|
+
d(), o(), i(!1), n(!1);
|
|
418
|
+
}, [d, o, n]), Qe = u(
|
|
408
419
|
(e) => {
|
|
409
|
-
|
|
420
|
+
ce?.(e), B(!1);
|
|
410
421
|
},
|
|
411
|
-
[
|
|
422
|
+
[ce]
|
|
412
423
|
);
|
|
413
|
-
return
|
|
414
|
-
|
|
415
|
-
}, [
|
|
416
|
-
/* @__PURE__ */
|
|
424
|
+
return S(() => {
|
|
425
|
+
z?.(ee.current);
|
|
426
|
+
}, [z]), /* @__PURE__ */ t.jsxs("div", { className: Ee("slide-player", v), ...Be, children: [
|
|
427
|
+
/* @__PURE__ */ t.jsx(
|
|
417
428
|
"audio",
|
|
418
429
|
{
|
|
419
|
-
ref:
|
|
430
|
+
ref: p,
|
|
420
431
|
preload: "auto",
|
|
421
432
|
playsInline: !0,
|
|
422
|
-
onLoadStart:
|
|
423
|
-
onLoadedMetadata:
|
|
424
|
-
onCanPlay:
|
|
425
|
-
onPlay:
|
|
426
|
-
onPause:
|
|
427
|
-
onWaiting:
|
|
428
|
-
onSeeking:
|
|
429
|
-
onSeeked:
|
|
430
|
-
onTimeUpdate:
|
|
431
|
-
onEnded:
|
|
432
|
-
onError:
|
|
433
|
+
onLoadStart: Xe,
|
|
434
|
+
onLoadedMetadata: ze,
|
|
435
|
+
onCanPlay: qe,
|
|
436
|
+
onPlay: He,
|
|
437
|
+
onPause: Oe,
|
|
438
|
+
onWaiting: Ye,
|
|
439
|
+
onSeeking: je,
|
|
440
|
+
onSeeked: je,
|
|
441
|
+
onTimeUpdate: De,
|
|
442
|
+
onEnded: Ge,
|
|
443
|
+
onError: Je
|
|
433
444
|
}
|
|
434
445
|
),
|
|
435
|
-
|
|
436
|
-
/* @__PURE__ */
|
|
437
|
-
|
|
446
|
+
I ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
447
|
+
/* @__PURE__ */ t.jsx(
|
|
448
|
+
tr,
|
|
438
449
|
{
|
|
439
|
-
container:
|
|
450
|
+
container: ve,
|
|
440
451
|
labels: {
|
|
441
452
|
fullscreen: W.fullscreenLabel,
|
|
442
453
|
nonFullscreen: W.nonFullscreenLabel,
|
|
@@ -445,22 +456,22 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
445
456
|
subtitleToggle: W.subtitleToggleAriaLabel,
|
|
446
457
|
title: W.settingsTitle
|
|
447
458
|
},
|
|
448
|
-
isSubtitleEnabled:
|
|
459
|
+
isSubtitleEnabled: Q,
|
|
449
460
|
onClose: () => B(!1),
|
|
450
461
|
onOpenChange: B,
|
|
451
|
-
onSubtitleToggle:
|
|
462
|
+
onSubtitleToggle: se ?? (() => {
|
|
452
463
|
}),
|
|
453
|
-
onViewModeChange:
|
|
454
|
-
open:
|
|
455
|
-
viewMode:
|
|
464
|
+
onViewModeChange: Qe,
|
|
465
|
+
open: ge,
|
|
466
|
+
viewMode: Le
|
|
456
467
|
}
|
|
457
468
|
),
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
-
/* @__PURE__ */
|
|
460
|
-
/* @__PURE__ */
|
|
469
|
+
/* @__PURE__ */ t.jsxs("div", { className: "slide-player__controls", style: Ke, children: [
|
|
470
|
+
/* @__PURE__ */ t.jsxs("div", { className: "slide-player__group", children: [
|
|
471
|
+
/* @__PURE__ */ t.jsx(
|
|
461
472
|
"button",
|
|
462
473
|
{
|
|
463
|
-
"aria-expanded":
|
|
474
|
+
"aria-expanded": ge,
|
|
464
475
|
"aria-haspopup": "dialog",
|
|
465
476
|
"aria-label": "More options",
|
|
466
477
|
className: "slide-player__action slide-player__action--mobile-more",
|
|
@@ -468,8 +479,8 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
468
479
|
B((e) => !e);
|
|
469
480
|
},
|
|
470
481
|
type: "button",
|
|
471
|
-
children: /* @__PURE__ */
|
|
472
|
-
|
|
482
|
+
children: /* @__PURE__ */ t.jsx(
|
|
483
|
+
ar,
|
|
473
484
|
{
|
|
474
485
|
className: "slide-player__icon",
|
|
475
486
|
strokeWidth: 2.25
|
|
@@ -477,17 +488,17 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
477
488
|
)
|
|
478
489
|
}
|
|
479
490
|
),
|
|
480
|
-
/* @__PURE__ */
|
|
481
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ t.jsx("button", { "aria-label": "Volume", className: "hidden", type: "button", children: /* @__PURE__ */ t.jsx(cr, { className: "slide-player__icon", strokeWidth: 2.25 }) }),
|
|
492
|
+
/* @__PURE__ */ t.jsx(
|
|
482
493
|
"button",
|
|
483
494
|
{
|
|
484
495
|
"aria-label": W.subtitleToggleAriaLabel,
|
|
485
|
-
"aria-pressed":
|
|
496
|
+
"aria-pressed": Q,
|
|
486
497
|
className: "slide-player__action slide-player__action--subtitle",
|
|
487
|
-
onClick:
|
|
498
|
+
onClick: se,
|
|
488
499
|
type: "button",
|
|
489
|
-
children:
|
|
490
|
-
|
|
500
|
+
children: Q ? /* @__PURE__ */ t.jsx(ir, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ t.jsx(
|
|
501
|
+
or,
|
|
491
502
|
{
|
|
492
503
|
className: "slide-player__icon",
|
|
493
504
|
strokeWidth: 2.25
|
|
@@ -495,41 +506,41 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
495
506
|
)
|
|
496
507
|
}
|
|
497
508
|
),
|
|
498
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ t.jsx(
|
|
499
510
|
"button",
|
|
500
511
|
{
|
|
501
512
|
"aria-label": "Rewind",
|
|
502
513
|
className: "slide-player__action slide-player__action--prev",
|
|
503
|
-
disabled:
|
|
504
|
-
onClick:
|
|
514
|
+
disabled: Pe,
|
|
515
|
+
onClick: Te,
|
|
505
516
|
type: "button",
|
|
506
|
-
children: /* @__PURE__ */
|
|
517
|
+
children: /* @__PURE__ */ t.jsx(fr, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
507
518
|
}
|
|
508
519
|
),
|
|
509
|
-
/* @__PURE__ */
|
|
520
|
+
/* @__PURE__ */ t.jsx(
|
|
510
521
|
"button",
|
|
511
522
|
{
|
|
512
|
-
"aria-label":
|
|
523
|
+
"aria-label": $e,
|
|
513
524
|
className: "slide-player__toggle slide-player__toggle--playback",
|
|
514
525
|
onClick: () => {
|
|
515
|
-
if (
|
|
516
|
-
|
|
526
|
+
if (J) {
|
|
527
|
+
Fe?.(!G);
|
|
517
528
|
return;
|
|
518
529
|
}
|
|
519
|
-
const e =
|
|
520
|
-
if (!(
|
|
530
|
+
const e = p.current;
|
|
531
|
+
if (!(F || !e || !f)) {
|
|
521
532
|
if (a.current !== null) {
|
|
522
|
-
if (
|
|
523
|
-
|
|
533
|
+
if (re) {
|
|
534
|
+
s.current = !1, g.current = !0, a.current = null, y.current = !1, i(!1), n(!1), e.pause();
|
|
524
535
|
return;
|
|
525
536
|
}
|
|
526
|
-
|
|
537
|
+
C.current = "manual", g.current = !1, s.current = !0, n(!0, "waitingForMoreAudio");
|
|
527
538
|
return;
|
|
528
539
|
}
|
|
529
540
|
if (!e.src && k.length > 0) {
|
|
530
|
-
|
|
541
|
+
C.current = "manual", g.current = !1, E(
|
|
531
542
|
Math.min(
|
|
532
|
-
|
|
543
|
+
x.current,
|
|
533
544
|
k.length - 1
|
|
534
545
|
),
|
|
535
546
|
"toggle"
|
|
@@ -537,42 +548,42 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
537
548
|
return;
|
|
538
549
|
}
|
|
539
550
|
if (e.paused) {
|
|
540
|
-
|
|
551
|
+
C.current = "manual", g.current = !1, s.current = !0, b("toggle-resume");
|
|
541
552
|
return;
|
|
542
553
|
}
|
|
543
|
-
|
|
554
|
+
s.current = !1, g.current = !0, e.pause();
|
|
544
555
|
}
|
|
545
556
|
},
|
|
546
557
|
type: "button",
|
|
547
|
-
children:
|
|
558
|
+
children: Ze ? /* @__PURE__ */ t.jsx(gr, {}) : /* @__PURE__ */ t.jsx(yr, {})
|
|
548
559
|
}
|
|
549
560
|
),
|
|
550
|
-
/* @__PURE__ */
|
|
561
|
+
/* @__PURE__ */ t.jsx(
|
|
551
562
|
"button",
|
|
552
563
|
{
|
|
553
564
|
"aria-label": "Forward",
|
|
554
565
|
className: "slide-player__action slide-player__action--next",
|
|
555
|
-
disabled:
|
|
556
|
-
onClick:
|
|
566
|
+
disabled: Ve,
|
|
567
|
+
onClick: Ce,
|
|
557
568
|
type: "button",
|
|
558
|
-
children: /* @__PURE__ */
|
|
569
|
+
children: /* @__PURE__ */ t.jsx(dr, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
559
570
|
}
|
|
560
571
|
),
|
|
561
|
-
le ? /* @__PURE__ */
|
|
572
|
+
le ? /* @__PURE__ */ t.jsx(
|
|
562
573
|
"button",
|
|
563
574
|
{
|
|
564
|
-
"aria-label":
|
|
575
|
+
"aria-label": ae ? "Exit fullscreen" : "Enter fullscreen",
|
|
565
576
|
className: "slide-player__action slide-player__action--fullscreen",
|
|
566
577
|
onClick: le,
|
|
567
578
|
type: "button",
|
|
568
|
-
children:
|
|
569
|
-
|
|
579
|
+
children: ae ? /* @__PURE__ */ t.jsx(
|
|
580
|
+
mr,
|
|
570
581
|
{
|
|
571
582
|
className: "slide-player__icon",
|
|
572
583
|
strokeWidth: 2.25
|
|
573
584
|
}
|
|
574
|
-
) : /* @__PURE__ */
|
|
575
|
-
|
|
585
|
+
) : /* @__PURE__ */ t.jsx(
|
|
586
|
+
pr,
|
|
576
587
|
{
|
|
577
588
|
className: "slide-player__icon",
|
|
578
589
|
strokeWidth: 2.25
|
|
@@ -581,22 +592,22 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
581
592
|
}
|
|
582
593
|
) : null
|
|
583
594
|
] }),
|
|
584
|
-
/* @__PURE__ */
|
|
585
|
-
/* @__PURE__ */
|
|
586
|
-
|
|
587
|
-
/* @__PURE__ */
|
|
595
|
+
/* @__PURE__ */ t.jsx("div", { className: "slide-player__separator" }),
|
|
596
|
+
/* @__PURE__ */ t.jsxs("div", { className: "slide-player__group", children: [
|
|
597
|
+
ye.map((e, r) => /* @__PURE__ */ t.jsx(er.Fragment, { children: e }, `custom-action-${r}`)),
|
|
598
|
+
/* @__PURE__ */ t.jsx(
|
|
588
599
|
"button",
|
|
589
600
|
{
|
|
590
601
|
"aria-label": "Notes",
|
|
591
|
-
className:
|
|
602
|
+
className: Ee(
|
|
592
603
|
"slide-player__action slide-player__action--notes",
|
|
593
|
-
|
|
604
|
+
$ && "slide-player__action--active"
|
|
594
605
|
),
|
|
595
|
-
disabled: !
|
|
596
|
-
onClick:
|
|
606
|
+
disabled: !We,
|
|
607
|
+
onClick: Ue,
|
|
597
608
|
type: "button",
|
|
598
|
-
children: /* @__PURE__ */
|
|
599
|
-
|
|
609
|
+
children: /* @__PURE__ */ t.jsx(
|
|
610
|
+
hr,
|
|
600
611
|
{
|
|
601
612
|
className: "slide-player__icon",
|
|
602
613
|
strokeWidth: 2.25
|
|
@@ -608,9 +619,9 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
|
|
|
608
619
|
] })
|
|
609
620
|
] }) : null
|
|
610
621
|
] });
|
|
611
|
-
},
|
|
612
|
-
|
|
622
|
+
}, br = rr(_r);
|
|
623
|
+
br.displayName = "Player";
|
|
613
624
|
export {
|
|
614
|
-
|
|
625
|
+
br as default
|
|
615
626
|
};
|
|
616
627
|
//# sourceMappingURL=Player.es.js.map
|