markdown-flow-ui 0.1.128-dev.1 → 0.1.128
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/assets/markdown-flow-ui.css +1 -1
- package/dist/components/Slide/Player.cjs.js +1 -1
- package/dist/components/Slide/Player.cjs.js.map +1 -1
- package/dist/components/Slide/Player.d.ts +5 -1
- package/dist/components/Slide/Player.es.js +615 -465
- package/dist/components/Slide/Player.es.js.map +1 -1
- package/dist/components/Slide/Slide.cjs.js.map +1 -1
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/Slide.stories.d.ts +2 -0
- package/dist/components/Slide/SubtitleOverlay.cjs.js.map +1 -1
- package/dist/components/Slide/SubtitleOverlay.es.js.map +1 -1
- package/dist/components/Slide/constants.cjs.js +1 -1
- package/dist/components/Slide/constants.cjs.js.map +1 -1
- package/dist/components/Slide/constants.d.ts +4 -2
- package/dist/components/Slide/constants.es.js +4 -2
- package/dist/components/Slide/constants.es.js.map +1 -1
- package/dist/components/Slide/useSlide.cjs.js.map +1 -1
- package/dist/components/Slide/useSlide.es.js.map +1 -1
- package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.js +1 -1
- package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.js.map +1 -1
- package/dist/components/Slide/utils/playerKeyboardShortcuts.d.ts +1 -1
- package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js +14 -5
- package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js.map +1 -1
- package/dist/components/Slide/utils/segmentSeek.cjs.js +2 -0
- package/dist/components/Slide/utils/segmentSeek.cjs.js.map +1 -0
- package/dist/components/Slide/utils/segmentSeek.d.ts +8 -0
- package/dist/components/Slide/utils/segmentSeek.es.js +31 -0
- package/dist/components/Slide/utils/segmentSeek.es.js.map +1 -0
- package/dist/components/Slide/utils/segmentSeek.test.d.ts +1 -0
- package/dist/components/Slide/utils/streamingNavigation.cjs.js.map +1 -1
- package/dist/components/Slide/utils/streamingNavigation.es.js.map +1 -1
- package/dist/components/Slide/utils/subtitleCue.cjs.js +2 -2
- package/dist/components/Slide/utils/subtitleCue.cjs.js.map +1 -1
- package/dist/components/Slide/utils/subtitleCue.d.ts +10 -0
- package/dist/components/Slide/utils/subtitleCue.es.js +59 -5
- package/dist/components/Slide/utils/subtitleCue.es.js.map +1 -1
- package/dist/lib/interaction-defaults.cjs.js.map +1 -1
- package/dist/lib/interaction-defaults.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.cjs.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.cjs.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.es.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.cjs.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.cjs.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.es.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.es.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
import { j as n } from "../../_virtual/jsx-runtime.es.js";
|
|
2
|
-
import
|
|
3
|
-
import { cn as
|
|
4
|
-
import
|
|
5
|
-
import { DEFAULT_SLIDE_PLAYER_TEXTS as
|
|
6
|
-
import { DEFAULT_MOBILE_VIEW_MODE as
|
|
7
|
-
import { hasReachedAudioEnd as
|
|
8
|
-
import { PlayerKeyboardShortcutContext as
|
|
9
|
-
import { activatePlayerKeyboardShortcutOwner as
|
|
10
|
-
import { resolveAudioPlaybackSourceType as
|
|
11
|
-
import { shouldKeepPlayingAfterNavigation as
|
|
12
|
-
import { toPlayerCustomActionList as
|
|
13
|
-
import { suppressPlayerControlsWakeAfterNavigation as
|
|
2
|
+
import Ht, { memo as $t, useId as Zt, useContext as qt, useRef as c, useState as Re, useMemo as Y, useCallback as r, useEffect as y } from "react";
|
|
3
|
+
import { cn as bt } from "../../lib/utils.es.js";
|
|
4
|
+
import zt from "./MobilePlayerSettingsSheet.es.js";
|
|
5
|
+
import { DEFAULT_SLIDE_PLAYER_TEXTS as It } from "./constants.es.js";
|
|
6
|
+
import { DEFAULT_MOBILE_VIEW_MODE as Yt } from "./utils/mobileScreenMode.es.js";
|
|
7
|
+
import { hasReachedAudioEnd as Dt } from "./utils/audioCompletion.es.js";
|
|
8
|
+
import { PlayerKeyboardShortcutContext as Xt } from "./utils/playerKeyboardShortcutContext.es.js";
|
|
9
|
+
import { activatePlayerKeyboardShortcutOwner as Gt, registerPlayerKeyboardShortcutOwner as Qt, isActivePlayerKeyboardShortcutOwner as er, getPlayerKeyboardShortcutAction as tr, shouldIgnorePlayerKeyboardShortcutEvent as rr } from "./utils/playerKeyboardShortcuts.es.js";
|
|
10
|
+
import { resolveAudioPlaybackSourceType as nr } from "./utils/playbackSource.es.js";
|
|
11
|
+
import { shouldKeepPlayingAfterNavigation as ur } from "./utils/playbackPreference.es.js";
|
|
12
|
+
import { toPlayerCustomActionList as sr } from "./utils/playerCustomActions.es.js";
|
|
13
|
+
import { suppressPlayerControlsWakeAfterNavigation as St } from "./utils/playerNavigationContext.es.js";
|
|
14
|
+
import { isPlaybackTimeCoveredBySegments as gt, resolveSegmentSeekTarget as lr } from "./utils/segmentSeek.es.js";
|
|
15
|
+
import { getSubtitleCueJumpTime as ar } from "./utils/subtitleCue.es.js";
|
|
14
16
|
/* empty css */
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
import ir from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
|
|
18
|
+
import cr from "../../node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
|
|
19
|
+
import or from "../../node_modules/lucide-react/dist/esm/icons/captions.es.js";
|
|
20
|
+
import fr from "../../node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
|
|
21
|
+
import dr from "../../node_modules/lucide-react/dist/esm/icons/skip-back.es.js";
|
|
22
|
+
import mr from "../../node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js";
|
|
23
|
+
import pr from "../../node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js";
|
|
24
|
+
import hr from "../../node_modules/lucide-react/dist/esm/icons/skip-forward.es.js";
|
|
25
|
+
import yr from "../../node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
|
|
26
|
+
import br from "../../node_modules/lucide-react/dist/esm/icons/maximize.es.js";
|
|
27
|
+
import Sr from "../../node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
|
|
28
|
+
const _t = /* @__PURE__ */ new Map(), xt = (R) => {
|
|
29
|
+
if (typeof window > "u" || !R || _t.has(R))
|
|
26
30
|
return;
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
},
|
|
31
|
+
const N = window.document.createElement("audio");
|
|
32
|
+
N.preload = "auto", N.setAttribute("playsinline", "true"), N.src = R, N.load(), _t.set(R, N);
|
|
33
|
+
}, gr = () => /* @__PURE__ */ n.jsxs(
|
|
30
34
|
"svg",
|
|
31
35
|
{
|
|
32
36
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -45,7 +49,7 @@ const sr = /* @__PURE__ */ new Map(), lr = (k) => {
|
|
|
45
49
|
/* @__PURE__ */ n.jsx("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
|
|
46
50
|
]
|
|
47
51
|
}
|
|
48
|
-
),
|
|
52
|
+
), _r = () => /* @__PURE__ */ n.jsxs(
|
|
49
53
|
"svg",
|
|
50
54
|
{
|
|
51
55
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -64,583 +68,693 @@ const sr = /* @__PURE__ */ new Map(), lr = (k) => {
|
|
|
64
68
|
/* @__PURE__ */ n.jsx("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
|
|
65
69
|
]
|
|
66
70
|
}
|
|
67
|
-
),
|
|
71
|
+
), H = {
|
|
68
72
|
fullscreen: "F",
|
|
69
73
|
next: "→",
|
|
74
|
+
nextSubtitle: "Shift+→",
|
|
70
75
|
notes: "N",
|
|
71
76
|
playback: "Space",
|
|
72
77
|
previous: "←",
|
|
78
|
+
previousSubtitle: "Shift+←",
|
|
73
79
|
subtitle: "C"
|
|
74
|
-
},
|
|
75
|
-
audioList:
|
|
76
|
-
className:
|
|
77
|
-
currentAudioIndex:
|
|
78
|
-
defaultPlaying:
|
|
79
|
-
isPlaybackPaused:
|
|
80
|
-
isAutoAdvanceEnabled:
|
|
81
|
-
useAutoAdvanceToggle:
|
|
82
|
-
onLoadingChange:
|
|
83
|
-
onPlaybackPreferenceChange:
|
|
84
|
-
onPlaybackStarted:
|
|
85
|
-
onPlaybackTimeChange:
|
|
86
|
-
onSubtitleToggle:
|
|
87
|
-
onPrev:
|
|
88
|
-
onNext:
|
|
89
|
-
onFullscreen:
|
|
90
|
-
isFullscreen:
|
|
91
|
-
mobileViewMode:
|
|
92
|
-
settingsPortalContainer:
|
|
93
|
-
onMobileViewModeChange:
|
|
94
|
-
onEnded:
|
|
95
|
-
onAutoAdvanceToggle:
|
|
96
|
-
onInteractionToggle:
|
|
97
|
-
hasInteraction:
|
|
98
|
-
isInteractionOpen:
|
|
99
|
-
isSubtitleEnabled:
|
|
100
|
-
prevDisabled:
|
|
101
|
-
nextDisabled:
|
|
102
|
-
showControls:
|
|
103
|
-
enableKeyboardShortcuts:
|
|
104
|
-
customActions:
|
|
105
|
-
customActionContext:
|
|
106
|
-
texts:
|
|
107
|
-
onFocusCapture:
|
|
108
|
-
onPointerDown:
|
|
109
|
-
...
|
|
80
|
+
}, xr = 250, kr = (R, N) => R ? `${R} (${N})` : N, wr = ({
|
|
81
|
+
audioList: R = [],
|
|
82
|
+
className: N,
|
|
83
|
+
currentAudioIndex: k = -1,
|
|
84
|
+
defaultPlaying: L = !0,
|
|
85
|
+
isPlaybackPaused: T = !1,
|
|
86
|
+
isAutoAdvanceEnabled: $ = !0,
|
|
87
|
+
useAutoAdvanceToggle: F = !1,
|
|
88
|
+
onLoadingChange: je,
|
|
89
|
+
onPlaybackPreferenceChange: Ce,
|
|
90
|
+
onPlaybackStarted: Ne,
|
|
91
|
+
onPlaybackTimeChange: ie,
|
|
92
|
+
onSubtitleToggle: ee,
|
|
93
|
+
onPrev: ce,
|
|
94
|
+
onNext: oe,
|
|
95
|
+
onFullscreen: te,
|
|
96
|
+
isFullscreen: Ee = !1,
|
|
97
|
+
mobileViewMode: kt = Yt,
|
|
98
|
+
settingsPortalContainer: wt,
|
|
99
|
+
onMobileViewModeChange: Ke,
|
|
100
|
+
onEnded: Ue,
|
|
101
|
+
onAutoAdvanceToggle: Fe,
|
|
102
|
+
onInteractionToggle: fe,
|
|
103
|
+
hasInteraction: _e = !1,
|
|
104
|
+
isInteractionOpen: re = !1,
|
|
105
|
+
isSubtitleEnabled: xe = !0,
|
|
106
|
+
prevDisabled: ke = !1,
|
|
107
|
+
nextDisabled: we = !1,
|
|
108
|
+
showControls: Me = !0,
|
|
109
|
+
enableKeyboardShortcuts: Mt = !0,
|
|
110
|
+
customActions: We,
|
|
111
|
+
customActionContext: Pe,
|
|
112
|
+
texts: Be,
|
|
113
|
+
onFocusCapture: Oe,
|
|
114
|
+
onPointerDown: Ve,
|
|
115
|
+
...Lt
|
|
110
116
|
}) => {
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
),
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
const Tt = Zt(), Je = qt(Xt), _ = c(null), He = c(re), E = c(null), $e = c(null), K = c(0), f = c(null), de = c(void 0), j = c([]), ne = c(
|
|
118
|
+
F ? $ : L
|
|
119
|
+
), ue = c(!1), Ze = c(!1), b = c(!1), U = c(null), Z = c(null), A = c(!1), l = c(!1), S = c(null), C = c(!1), q = c(null), me = c(0), qe = c(() => {
|
|
120
|
+
}), pe = c(null), W = c("unknown"), [he, d] = Re(L), [ze, D] = Re(!1), [X, At] = Re({
|
|
121
|
+
next: !1,
|
|
122
|
+
previous: !1
|
|
123
|
+
}), z = Je?.ownerId ?? Tt, P = Mt && (Je?.enabled ?? !0), o = k >= 0 ? R[k] : void 0, g = o?.audioUrl, w = Y(
|
|
124
|
+
() => [...o?.audioSegments ?? []].sort(
|
|
125
|
+
(e, t) => e.segment_index - t.segment_index
|
|
116
126
|
),
|
|
117
|
-
[
|
|
118
|
-
),
|
|
119
|
-
() =>
|
|
120
|
-
[
|
|
121
|
-
),
|
|
127
|
+
[o?.audioSegments]
|
|
128
|
+
), Ie = Y(
|
|
129
|
+
() => o?.element?.subtitle_cues ?? [],
|
|
130
|
+
[o?.element?.subtitle_cues]
|
|
131
|
+
), Ye = Y(
|
|
132
|
+
() => sr(We, Pe),
|
|
133
|
+
[Pe, We]
|
|
134
|
+
), De = Ye.length + 7, vt = Y(
|
|
122
135
|
() => ({
|
|
123
|
-
"--slide-player-mobile-control-count": String(
|
|
136
|
+
"--slide-player-mobile-control-count": String(De)
|
|
124
137
|
}),
|
|
125
|
-
[
|
|
126
|
-
),
|
|
138
|
+
[De]
|
|
139
|
+
), a = Y(
|
|
127
140
|
() => ({
|
|
128
|
-
...
|
|
129
|
-
...
|
|
141
|
+
...It,
|
|
142
|
+
...Be
|
|
130
143
|
}),
|
|
131
|
-
[
|
|
132
|
-
),
|
|
133
|
-
(e,
|
|
134
|
-
ariaKeyShortcuts:
|
|
135
|
-
title:
|
|
144
|
+
[Be]
|
|
145
|
+
), Le = Y(() => o ? o.audioKey ?? `${String(o.sequenceNumber ?? "none")}:${String(o.audioUrl ?? "")}` : "none", [o]), Rt = F ? $ : he, Xe = F ? $ ? a.pauseAutoplayLabel : a.playAutoplayLabel : he ? a.pauseLabel : a.playLabel, Ge = Ee ? a.exitFullscreenLabel : a.enterFullscreenLabel, O = r(
|
|
146
|
+
(e, t, s) => ({
|
|
147
|
+
ariaKeyShortcuts: P ? s : void 0,
|
|
148
|
+
title: P ? kr(e, t) : e
|
|
136
149
|
}),
|
|
137
|
-
[
|
|
138
|
-
),
|
|
139
|
-
|
|
140
|
-
|
|
150
|
+
[P]
|
|
151
|
+
), Qe = O(
|
|
152
|
+
a.subtitleToggleAriaLabel,
|
|
153
|
+
H.subtitle,
|
|
141
154
|
"c"
|
|
142
|
-
),
|
|
143
|
-
|
|
144
|
-
|
|
155
|
+
), et = O(
|
|
156
|
+
a.previousLabel,
|
|
157
|
+
H.previous,
|
|
145
158
|
"ArrowLeft"
|
|
146
|
-
),
|
|
147
|
-
|
|
148
|
-
|
|
159
|
+
), tt = O(
|
|
160
|
+
a.previousSubtitleLabel,
|
|
161
|
+
H.previousSubtitle,
|
|
162
|
+
"Shift+ArrowLeft"
|
|
163
|
+
), rt = O(
|
|
164
|
+
Xe,
|
|
165
|
+
H.playback,
|
|
149
166
|
"Space"
|
|
150
|
-
),
|
|
151
|
-
|
|
152
|
-
|
|
167
|
+
), nt = O(
|
|
168
|
+
a.nextLabel,
|
|
169
|
+
H.next,
|
|
153
170
|
"ArrowRight"
|
|
154
|
-
),
|
|
155
|
-
|
|
156
|
-
|
|
171
|
+
), ut = O(
|
|
172
|
+
a.nextSubtitleLabel,
|
|
173
|
+
H.nextSubtitle,
|
|
174
|
+
"Shift+ArrowRight"
|
|
175
|
+
), st = O(
|
|
176
|
+
Ge,
|
|
177
|
+
H.fullscreen,
|
|
157
178
|
"f"
|
|
158
|
-
),
|
|
159
|
-
|
|
160
|
-
|
|
179
|
+
), lt = O(
|
|
180
|
+
a.notesLabel,
|
|
181
|
+
H.notes,
|
|
161
182
|
"n"
|
|
162
|
-
),
|
|
163
|
-
|
|
164
|
-
}, [
|
|
183
|
+
), ye = r(() => {
|
|
184
|
+
P && Gt(z);
|
|
185
|
+
}, [z, P]), jt = r(
|
|
165
186
|
(e) => {
|
|
166
|
-
|
|
187
|
+
ye(), Ve?.(e);
|
|
167
188
|
},
|
|
168
|
-
[
|
|
169
|
-
),
|
|
189
|
+
[ye, Ve]
|
|
190
|
+
), Ct = r(
|
|
170
191
|
(e) => {
|
|
171
|
-
|
|
192
|
+
ye(), Oe?.(e);
|
|
172
193
|
},
|
|
173
|
-
[
|
|
194
|
+
[ye, Oe]
|
|
174
195
|
);
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}, [
|
|
178
|
-
|
|
179
|
-
}, [
|
|
180
|
-
|
|
181
|
-
}, [
|
|
182
|
-
!
|
|
183
|
-
}, [
|
|
184
|
-
|
|
185
|
-
}, [
|
|
186
|
-
const e =
|
|
187
|
-
|
|
188
|
-
}, [
|
|
189
|
-
const u =
|
|
190
|
-
(e,
|
|
191
|
-
|
|
196
|
+
y(() => {
|
|
197
|
+
de.current = o;
|
|
198
|
+
}, [o]), y(() => {
|
|
199
|
+
ne.current = F ? $ : L;
|
|
200
|
+
}, [L, $, F]), y(() => {
|
|
201
|
+
Me || D(!1);
|
|
202
|
+
}, [Me]), y(() => {
|
|
203
|
+
!He.current && re && D(!1), He.current = re;
|
|
204
|
+
}, [re]), y(() => {
|
|
205
|
+
j.current = w;
|
|
206
|
+
}, [w]), y(() => {
|
|
207
|
+
const e = o?.audioUrl, t = k >= 0 ? R[k + 1]?.audioUrl : void 0;
|
|
208
|
+
xt(e), xt(t);
|
|
209
|
+
}, [R, o?.audioUrl, k]);
|
|
210
|
+
const u = r(
|
|
211
|
+
(e, t = null) => {
|
|
212
|
+
Ze.current === e && (!e || t === null) || (Ze.current = e, je?.({
|
|
192
213
|
loading: e,
|
|
193
|
-
reason: e ?
|
|
214
|
+
reason: e ? t : null
|
|
194
215
|
}));
|
|
195
216
|
},
|
|
196
|
-
[
|
|
197
|
-
),
|
|
217
|
+
[je]
|
|
218
|
+
), B = r(
|
|
198
219
|
(e) => {
|
|
199
|
-
|
|
220
|
+
ne.current = e, Ce?.(e);
|
|
200
221
|
},
|
|
201
|
-
[
|
|
202
|
-
),
|
|
203
|
-
shouldContinuePlayback:
|
|
222
|
+
[Ce]
|
|
223
|
+
), se = r(() => F ? {
|
|
224
|
+
shouldContinuePlayback: ne.current
|
|
204
225
|
} : {
|
|
205
|
-
shouldContinuePlayback:
|
|
206
|
-
defaultPlaying:
|
|
226
|
+
shouldContinuePlayback: ur({
|
|
227
|
+
defaultPlaying: ne.current,
|
|
207
228
|
isPausedByUser: b.current
|
|
208
229
|
})
|
|
209
|
-
}, [
|
|
210
|
-
const e =
|
|
211
|
-
return e == null || e <= 0 ? 0 :
|
|
212
|
-
(
|
|
230
|
+
}, [F]), at = r((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), V = r(() => L && !T && !b.current && W.current !== "blocked", [L, T]), it = r((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), ct = r(() => {
|
|
231
|
+
const e = f.current;
|
|
232
|
+
return e == null || e <= 0 ? 0 : j.current.slice(0, e).reduce(
|
|
233
|
+
(t, s) => t + Math.max(Number(s.duration_ms ?? 0), 0),
|
|
213
234
|
0
|
|
214
235
|
) / 1e3;
|
|
215
|
-
}, []),
|
|
216
|
-
(
|
|
236
|
+
}, []), I = r((e) => e <= 0 ? 0 : j.current.slice(0, e).reduce(
|
|
237
|
+
(t, s) => t + Math.max(Number(s.duration_ms ?? 0), 0),
|
|
217
238
|
0
|
|
218
|
-
), []),
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
239
|
+
), []), ot = r(
|
|
240
|
+
(e) => !o || T ? !1 : g ? !0 : gt(w, e),
|
|
241
|
+
[o, w, g, T]
|
|
242
|
+
), le = r(
|
|
243
|
+
(e, t) => {
|
|
244
|
+
const s = ar({
|
|
245
|
+
currentTimeMs: t,
|
|
246
|
+
direction: e,
|
|
247
|
+
subtitleCues: Ie
|
|
248
|
+
});
|
|
249
|
+
return s === null || !ot(s) ? null : s;
|
|
250
|
+
},
|
|
251
|
+
[ot, Ie]
|
|
252
|
+
), Te = r(
|
|
253
|
+
(e, t = !1) => {
|
|
254
|
+
const s = Math.max(Number(e), 0);
|
|
255
|
+
if (!t && pe.current !== null && Math.abs(
|
|
256
|
+
s - pe.current
|
|
257
|
+
) < xr)
|
|
258
|
+
return;
|
|
259
|
+
pe.current = s;
|
|
260
|
+
const i = {
|
|
261
|
+
previous: le("previous", s) !== null,
|
|
262
|
+
next: le("next", s) !== null
|
|
263
|
+
};
|
|
264
|
+
At((p) => p.previous === i.previous && p.next === i.next ? p : i);
|
|
265
|
+
},
|
|
266
|
+
[le]
|
|
267
|
+
);
|
|
268
|
+
y(() => {
|
|
269
|
+
qe.current = Te, Te(me.current, !0);
|
|
270
|
+
}, [Te]);
|
|
271
|
+
const be = r(() => {
|
|
272
|
+
const e = _.current;
|
|
273
|
+
return e ? U.current === "segment" ? I(K.current) + Math.max(e.currentTime, 0) * 1e3 : S.current !== null && e.readyState === 0 ? S.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : f.current != null ? I(f.current) : 0;
|
|
274
|
+
}, [I]), x = r(
|
|
222
275
|
(e) => {
|
|
223
|
-
const
|
|
224
|
-
|
|
276
|
+
const t = Math.max(e, 0);
|
|
277
|
+
me.current !== t && (me.current = t, ie?.(t), qe.current(t));
|
|
225
278
|
},
|
|
226
|
-
[
|
|
227
|
-
),
|
|
228
|
-
|
|
229
|
-
}, [
|
|
230
|
-
typeof window > "u" ||
|
|
231
|
-
}, []),
|
|
232
|
-
if (typeof window > "u" ||
|
|
279
|
+
[ie]
|
|
280
|
+
), m = r(() => {
|
|
281
|
+
x(be());
|
|
282
|
+
}, [be, x]), h = r(() => {
|
|
283
|
+
typeof window > "u" || q.current === null || (window.cancelAnimationFrame(q.current), q.current = null);
|
|
284
|
+
}, []), ft = r(() => {
|
|
285
|
+
if (typeof window > "u" || q.current !== null)
|
|
233
286
|
return;
|
|
234
287
|
const e = () => {
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
if (!
|
|
238
|
-
|
|
288
|
+
m();
|
|
289
|
+
const t = _.current;
|
|
290
|
+
if (!t || t.paused || t.ended) {
|
|
291
|
+
q.current = null;
|
|
239
292
|
return;
|
|
240
293
|
}
|
|
241
|
-
|
|
294
|
+
q.current = window.requestAnimationFrame(e);
|
|
242
295
|
};
|
|
243
|
-
|
|
244
|
-
}, [
|
|
245
|
-
const e =
|
|
246
|
-
e && (
|
|
247
|
-
}, [
|
|
296
|
+
q.current = window.requestAnimationFrame(e);
|
|
297
|
+
}, [m]), G = r(() => {
|
|
298
|
+
const e = _.current;
|
|
299
|
+
e && (h(), l.current = !1, b.current = !1, ue.current = !1, U.current = null, S.current = null, A.current = !1, C.current = !1, Z.current = null, e.pause(), e.removeAttribute("src"), e.load(), E.current = null, K.current = 0, f.current = null, x(0), d(!1), u(!1));
|
|
300
|
+
}, [x, h, u]), M = r(
|
|
248
301
|
(e) => {
|
|
249
|
-
const
|
|
250
|
-
if (!
|
|
302
|
+
const t = _.current;
|
|
303
|
+
if (!t)
|
|
251
304
|
return !1;
|
|
252
|
-
const
|
|
253
|
-
return
|
|
254
|
-
|
|
255
|
-
}).catch((
|
|
256
|
-
|
|
305
|
+
const s = t.play();
|
|
306
|
+
return s && typeof s.then == "function" && s.then(() => {
|
|
307
|
+
W.current === "unknown" && (W.current = "auto"), l.current = !1, C.current = !1;
|
|
308
|
+
}).catch((i) => {
|
|
309
|
+
W.current === "unknown" && at(i) && (W.current = "blocked", l.current = !1, u(!1)), C.current = !1, d(!1);
|
|
257
310
|
}), !0;
|
|
258
311
|
},
|
|
259
|
-
[
|
|
260
|
-
),
|
|
261
|
-
(e,
|
|
262
|
-
const
|
|
263
|
-
if (!
|
|
312
|
+
[at, u]
|
|
313
|
+
), v = r(
|
|
314
|
+
(e, t, s = {}) => {
|
|
315
|
+
const i = _.current, p = j.current[e];
|
|
316
|
+
if (!i || !p)
|
|
264
317
|
return !1;
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
318
|
+
const J = it(p.audio_data), ge = Math.max(
|
|
319
|
+
Number(s.seekTimeSeconds ?? 0),
|
|
320
|
+
0
|
|
321
|
+
);
|
|
322
|
+
K.current = e, f.current = null, A.current = !1, C.current = !0, Z.current = "segment", x(
|
|
323
|
+
I(e) + ge * 1e3
|
|
324
|
+
);
|
|
325
|
+
const yt = s.shouldResume ?? V();
|
|
326
|
+
l.current = yt, u(!1);
|
|
327
|
+
const Jt = E.current !== J;
|
|
328
|
+
return U.current = "segment", Jt && (i.pause(), i.removeAttribute("src"), i.load(), E.current = J, i.src = J, i.load()), S.current = ge, i.readyState > 0 && (i.currentTime = ge, S.current = null), yt ? M(`start-segment:${t}`) : (l.current = !1, C.current = !1, i.pause(), d(!1), !0);
|
|
271
329
|
},
|
|
272
330
|
[
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
331
|
+
V,
|
|
332
|
+
it,
|
|
333
|
+
I,
|
|
334
|
+
x,
|
|
335
|
+
M,
|
|
278
336
|
u
|
|
279
337
|
]
|
|
280
|
-
),
|
|
338
|
+
), dt = r(
|
|
281
339
|
(e) => {
|
|
282
|
-
|
|
340
|
+
const t = _.current;
|
|
341
|
+
if (!t || !o || T)
|
|
342
|
+
return !1;
|
|
343
|
+
const s = Math.max(Number(e), 0), i = !t.paused && !t.ended || l.current || C.current || f.current !== null && ne.current && !b.current, p = gt(
|
|
344
|
+
j.current,
|
|
345
|
+
s
|
|
346
|
+
) ? lr(
|
|
347
|
+
j.current,
|
|
348
|
+
s
|
|
349
|
+
) : null;
|
|
350
|
+
if (pe.current = null, h(), l.current = i, u(!1), i && (W.current = "manual", b.current = !1, B(!0)), p && (U.current === "segment" || !g))
|
|
351
|
+
return v(
|
|
352
|
+
p.segmentIndex,
|
|
353
|
+
"subtitle-seek-segment",
|
|
354
|
+
{
|
|
355
|
+
seekTimeSeconds: p.segmentTimeSeconds,
|
|
356
|
+
shouldResume: i
|
|
357
|
+
}
|
|
358
|
+
);
|
|
359
|
+
if (g) {
|
|
360
|
+
const J = s / 1e3;
|
|
361
|
+
return E.current !== g && (t.pause(), t.removeAttribute("src"), t.load(), E.current = g, U.current = "url", Z.current = "url", t.src = g, t.load()), S.current = J, x(s), t.readyState > 0 && (t.currentTime = J, S.current = null), i ? M("subtitle-seek-url") : (l.current = !1, t.pause(), d(!1), !0);
|
|
362
|
+
}
|
|
363
|
+
return !1;
|
|
283
364
|
},
|
|
284
365
|
[
|
|
366
|
+
o,
|
|
367
|
+
g,
|
|
368
|
+
T,
|
|
369
|
+
x,
|
|
370
|
+
v,
|
|
285
371
|
h,
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
372
|
+
M,
|
|
373
|
+
u,
|
|
374
|
+
B
|
|
375
|
+
]
|
|
376
|
+
), ae = r(
|
|
377
|
+
(e) => {
|
|
378
|
+
const t = le(
|
|
379
|
+
e,
|
|
380
|
+
be()
|
|
381
|
+
);
|
|
382
|
+
return t === null ? !1 : dt(t);
|
|
383
|
+
},
|
|
384
|
+
[
|
|
385
|
+
be,
|
|
386
|
+
le,
|
|
387
|
+
dt
|
|
388
|
+
]
|
|
389
|
+
), Q = r(
|
|
390
|
+
(e) => {
|
|
391
|
+
h(), l.current = !1, A.current = !1, C.current = !1, m(), d(!1), u(!1), k >= 0 && Ue?.(k);
|
|
392
|
+
},
|
|
393
|
+
[
|
|
394
|
+
k,
|
|
395
|
+
Ue,
|
|
396
|
+
h,
|
|
397
|
+
m,
|
|
289
398
|
u
|
|
290
399
|
]
|
|
291
|
-
),
|
|
400
|
+
), Se = r(
|
|
292
401
|
(e) => {
|
|
293
|
-
const
|
|
294
|
-
return !
|
|
295
|
-
currentTimeSeconds: Math.max(
|
|
296
|
-
durationSeconds:
|
|
297
|
-
}) ? !1 : (
|
|
402
|
+
const t = _.current;
|
|
403
|
+
return !t || U.current !== "url" || !Dt({
|
|
404
|
+
currentTimeSeconds: Math.max(t.currentTime, 0),
|
|
405
|
+
durationSeconds: t.duration
|
|
406
|
+
}) ? !1 : (l.current = !1, t.pause(), Q(e), !0);
|
|
298
407
|
},
|
|
299
|
-
[
|
|
300
|
-
),
|
|
301
|
-
const e =
|
|
302
|
-
if (
|
|
303
|
-
|
|
408
|
+
[Q]
|
|
409
|
+
), mt = r(() => {
|
|
410
|
+
const e = K.current + 1, t = j.current, s = t[e], i = de.current, p = t.some((J) => J.is_final);
|
|
411
|
+
if (s) {
|
|
412
|
+
v(e, "ended");
|
|
304
413
|
return;
|
|
305
414
|
}
|
|
306
|
-
if (
|
|
307
|
-
|
|
415
|
+
if (i?.isAudioStreaming || !p) {
|
|
416
|
+
K.current = e, f.current = e, A.current = !0, l.current = L, x(I(e)), d(!1), u(!0, "waitingForMoreAudio");
|
|
308
417
|
return;
|
|
309
418
|
}
|
|
310
|
-
|
|
419
|
+
Q("segments-completed");
|
|
311
420
|
}, [
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
421
|
+
L,
|
|
422
|
+
Q,
|
|
423
|
+
I,
|
|
424
|
+
x,
|
|
425
|
+
v,
|
|
317
426
|
u
|
|
318
427
|
]);
|
|
319
|
-
|
|
320
|
-
if (
|
|
428
|
+
y(() => {
|
|
429
|
+
if ($e.current === Le)
|
|
321
430
|
return;
|
|
322
|
-
|
|
323
|
-
const e =
|
|
324
|
-
e && (e.pause(), e.removeAttribute("src"), e.load(),
|
|
431
|
+
$e.current = Le, K.current = 0, f.current = null, A.current = !1, b.current = !1, ue.current = !1, l.current = !1, C.current = !1, U.current = null, Z.current = null, E.current = null, h(), x(0), u(!1);
|
|
432
|
+
const e = _.current;
|
|
433
|
+
e && (e.pause(), e.removeAttribute("src"), e.load(), d(!1));
|
|
325
434
|
}, [
|
|
435
|
+
k,
|
|
436
|
+
Le,
|
|
437
|
+
w.length,
|
|
438
|
+
g,
|
|
439
|
+
x,
|
|
326
440
|
h,
|
|
327
|
-
ge,
|
|
328
|
-
M.length,
|
|
329
|
-
H,
|
|
330
|
-
w,
|
|
331
|
-
p,
|
|
332
441
|
u
|
|
333
|
-
]),
|
|
334
|
-
const e =
|
|
442
|
+
]), y(() => {
|
|
443
|
+
const e = _.current;
|
|
335
444
|
if (e) {
|
|
336
|
-
if (
|
|
337
|
-
|
|
445
|
+
if (T) {
|
|
446
|
+
ue.current = !!(de.current && !b.current && (!e.paused || l.current || f.current !== null)), l.current = !1, u(!1), e.pause(), d(!1);
|
|
338
447
|
return;
|
|
339
448
|
}
|
|
340
|
-
if (!(!
|
|
341
|
-
if (
|
|
342
|
-
if (
|
|
343
|
-
|
|
449
|
+
if (!(!ue.current || !de.current || b.current)) {
|
|
450
|
+
if (ue.current = !1, f.current !== null) {
|
|
451
|
+
if (f.current < j.current.length) {
|
|
452
|
+
v(f.current, "external-resume");
|
|
344
453
|
return;
|
|
345
454
|
}
|
|
346
|
-
|
|
455
|
+
l.current = !0, u(!0, "waitingForMoreAudio");
|
|
347
456
|
return;
|
|
348
457
|
}
|
|
349
|
-
if (!
|
|
350
|
-
|
|
458
|
+
if (!E.current && j.current.length > 0) {
|
|
459
|
+
v(
|
|
351
460
|
Math.min(
|
|
352
|
-
|
|
353
|
-
|
|
461
|
+
K.current,
|
|
462
|
+
j.current.length - 1
|
|
354
463
|
),
|
|
355
464
|
"external-resume-init"
|
|
356
465
|
);
|
|
357
466
|
return;
|
|
358
467
|
}
|
|
359
|
-
e.paused && (
|
|
468
|
+
e.paused && (l.current = !0, M("external-resume"));
|
|
360
469
|
}
|
|
361
470
|
}
|
|
362
471
|
}, [
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
472
|
+
T,
|
|
473
|
+
v,
|
|
474
|
+
M,
|
|
366
475
|
u
|
|
367
|
-
]),
|
|
368
|
-
const e =
|
|
476
|
+
]), y(() => {
|
|
477
|
+
const e = _.current;
|
|
369
478
|
if (!e)
|
|
370
479
|
return;
|
|
371
|
-
if (!
|
|
372
|
-
|
|
480
|
+
if (!o) {
|
|
481
|
+
G();
|
|
373
482
|
return;
|
|
374
483
|
}
|
|
375
|
-
if (
|
|
376
|
-
|
|
484
|
+
if (T) {
|
|
485
|
+
l.current = !1, u(!1), e.pause(), d(!1);
|
|
377
486
|
return;
|
|
378
487
|
}
|
|
379
|
-
const
|
|
488
|
+
const t = nr({
|
|
380
489
|
activeSourceType: U.current,
|
|
381
|
-
hasAudioUrl: !!
|
|
382
|
-
segmentCount:
|
|
383
|
-
preferredSourceType:
|
|
384
|
-
waitingSegmentIndex:
|
|
490
|
+
hasAudioUrl: !!g,
|
|
491
|
+
segmentCount: w.length,
|
|
492
|
+
preferredSourceType: Z.current,
|
|
493
|
+
waitingSegmentIndex: f.current
|
|
385
494
|
});
|
|
386
|
-
if (
|
|
387
|
-
const
|
|
388
|
-
if (
|
|
389
|
-
const
|
|
390
|
-
e.pause(), e.removeAttribute("src"), e.load(),
|
|
495
|
+
if (t && Z.current !== t && (Z.current = t), t === "url" && g) {
|
|
496
|
+
const s = E.current !== g, i = V();
|
|
497
|
+
if (s) {
|
|
498
|
+
const p = f.current !== null ? ct() : 0;
|
|
499
|
+
e.pause(), e.removeAttribute("src"), e.load(), E.current = g, U.current = "url", e.src = g, e.load(), S.current = p, x(p * 1e3), e.readyState > 0 && (e.currentTime = p, S.current = null);
|
|
391
500
|
}
|
|
392
|
-
if (
|
|
393
|
-
|
|
501
|
+
if (l.current = i, A.current = !1, C.current = !1, u(!1), !i) {
|
|
502
|
+
l.current = !1, e.pause(), d(!1);
|
|
394
503
|
return;
|
|
395
504
|
}
|
|
396
|
-
|
|
505
|
+
M(s ? "sync-url-init" : "sync-url");
|
|
397
506
|
return;
|
|
398
507
|
}
|
|
399
|
-
if (
|
|
400
|
-
if (
|
|
508
|
+
if (t === "segment" && f.current !== null) {
|
|
509
|
+
if (f.current < w.length) {
|
|
401
510
|
if (b.current) {
|
|
402
|
-
|
|
511
|
+
d(!1), u(!1);
|
|
403
512
|
return;
|
|
404
513
|
}
|
|
405
|
-
|
|
514
|
+
v(f.current, "wait-resume");
|
|
406
515
|
return;
|
|
407
516
|
}
|
|
408
|
-
|
|
517
|
+
A.current = !0, l.current = V(), d(!1), u(V());
|
|
409
518
|
return;
|
|
410
519
|
}
|
|
411
|
-
if (
|
|
412
|
-
if (
|
|
413
|
-
|
|
520
|
+
if (t === "segment" && !w.length) {
|
|
521
|
+
if (o.isAudioStreaming) {
|
|
522
|
+
f.current = K.current, A.current = !0, l.current = V(), d(!1), u(V());
|
|
414
523
|
return;
|
|
415
524
|
}
|
|
416
|
-
|
|
525
|
+
G();
|
|
417
526
|
return;
|
|
418
527
|
}
|
|
419
|
-
if (
|
|
420
|
-
|
|
528
|
+
if (t === "segment" && !E.current) {
|
|
529
|
+
v(
|
|
421
530
|
Math.min(
|
|
422
|
-
|
|
423
|
-
|
|
531
|
+
K.current,
|
|
532
|
+
w.length - 1
|
|
424
533
|
),
|
|
425
534
|
"effect-init"
|
|
426
535
|
);
|
|
427
536
|
return;
|
|
428
537
|
}
|
|
429
|
-
if (
|
|
430
|
-
|
|
538
|
+
if (t !== "segment") {
|
|
539
|
+
G();
|
|
431
540
|
return;
|
|
432
541
|
}
|
|
433
|
-
if (!
|
|
434
|
-
|
|
542
|
+
if (!L || b.current) {
|
|
543
|
+
l.current = !1, e.pause(), d(!1);
|
|
435
544
|
return;
|
|
436
545
|
}
|
|
437
|
-
e.paused && (
|
|
546
|
+
e.paused && (l.current = !0, M("sync-paused-retry"));
|
|
438
547
|
}, [
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
M,
|
|
442
|
-
H,
|
|
443
|
-
g,
|
|
444
|
-
K,
|
|
445
|
-
W,
|
|
548
|
+
o,
|
|
549
|
+
k,
|
|
446
550
|
w,
|
|
447
|
-
|
|
448
|
-
C,
|
|
551
|
+
g,
|
|
449
552
|
L,
|
|
450
|
-
|
|
553
|
+
T,
|
|
554
|
+
V,
|
|
555
|
+
x,
|
|
556
|
+
G,
|
|
557
|
+
v,
|
|
558
|
+
M,
|
|
559
|
+
ct,
|
|
451
560
|
u
|
|
452
|
-
]),
|
|
453
|
-
const
|
|
454
|
-
|
|
561
|
+
]), y(() => G, [G]), y(() => h, [h]);
|
|
562
|
+
const Nt = r(() => {
|
|
563
|
+
m(), ft(), d(!0), u(!1), Ne?.();
|
|
455
564
|
}, [
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
565
|
+
Ne,
|
|
566
|
+
ft,
|
|
567
|
+
m,
|
|
459
568
|
u
|
|
460
|
-
]),
|
|
461
|
-
|
|
462
|
-
}, [
|
|
463
|
-
const e =
|
|
464
|
-
e && S.current !== null && (e.currentTime = S.current, S.current = null),
|
|
569
|
+
]), Et = r(() => {
|
|
570
|
+
A.current || C.current || (h(), m(), d(!1));
|
|
571
|
+
}, [k, h, m]), Kt = r(() => {
|
|
572
|
+
const e = _.current;
|
|
573
|
+
e && S.current !== null && (e.currentTime = S.current, S.current = null), m(), !Se("canplay-seek-finished") && (!l.current || !L || M("canplay"));
|
|
465
574
|
}, [
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
]),
|
|
472
|
-
const e =
|
|
473
|
-
e && S.current !== null && (e.currentTime = S.current, S.current = null),
|
|
474
|
-
}, [
|
|
475
|
-
|
|
476
|
-
}, [
|
|
477
|
-
|
|
478
|
-
}, [u]),
|
|
479
|
-
if (
|
|
575
|
+
k,
|
|
576
|
+
L,
|
|
577
|
+
Se,
|
|
578
|
+
m,
|
|
579
|
+
M
|
|
580
|
+
]), Ut = r(() => {
|
|
581
|
+
const e = _.current;
|
|
582
|
+
e && S.current !== null && (e.currentTime = S.current, S.current = null), m(), Se("metadata-seek-finished");
|
|
583
|
+
}, [k, Se, m]), Ft = r(() => {
|
|
584
|
+
m();
|
|
585
|
+
}, [m]), Wt = r(() => {
|
|
586
|
+
A.current || u(!0, "loadingAudio");
|
|
587
|
+
}, [u]), Pt = r(() => {
|
|
588
|
+
if (A.current) {
|
|
480
589
|
u(!0, "waitingForMoreAudio");
|
|
481
590
|
return;
|
|
482
591
|
}
|
|
483
592
|
u(!0, "loadingAudio");
|
|
484
|
-
}, [u]),
|
|
485
|
-
|
|
486
|
-
}, [
|
|
487
|
-
const e = U.current === "url" ||
|
|
488
|
-
if (
|
|
489
|
-
|
|
593
|
+
}, [u]), pt = r(() => {
|
|
594
|
+
m();
|
|
595
|
+
}, [m]), Bt = r(() => {
|
|
596
|
+
const e = U.current === "url" || j.current.length === 0;
|
|
597
|
+
if (h(), C.current = !1, e) {
|
|
598
|
+
Q("url-ended");
|
|
490
599
|
return;
|
|
491
600
|
}
|
|
492
|
-
|
|
493
|
-
}, [
|
|
494
|
-
|
|
495
|
-
}, [
|
|
601
|
+
mt();
|
|
602
|
+
}, [Q, mt, h]), Ot = r(() => {
|
|
603
|
+
h(), m(), d(!1), u(!1);
|
|
604
|
+
}, [h, m, u]), Vt = r(
|
|
496
605
|
(e) => {
|
|
497
|
-
|
|
606
|
+
Ke?.(e), D(!1);
|
|
498
607
|
},
|
|
499
|
-
[
|
|
500
|
-
),
|
|
501
|
-
if (
|
|
502
|
-
const
|
|
503
|
-
return
|
|
608
|
+
[Ke]
|
|
609
|
+
), Ae = r(() => {
|
|
610
|
+
if (F) {
|
|
611
|
+
const t = !$;
|
|
612
|
+
return B(t), Fe?.(t), !0;
|
|
504
613
|
}
|
|
505
|
-
const e =
|
|
506
|
-
return
|
|
614
|
+
const e = _.current;
|
|
615
|
+
return T || !e || !o ? !1 : f.current !== null ? he ? (B(!1), l.current = !1, b.current = !0, f.current = null, A.current = !1, d(!1), u(!1), e.pause(), !0) : (B(!0), W.current = "manual", b.current = !1, l.current = !0, u(!0, "waitingForMoreAudio"), !0) : !e.src && w.length > 0 ? (B(!0), W.current = "manual", b.current = !1, v(
|
|
507
616
|
Math.min(
|
|
508
|
-
|
|
509
|
-
|
|
617
|
+
K.current,
|
|
618
|
+
w.length - 1
|
|
510
619
|
),
|
|
511
620
|
"toggle"
|
|
512
|
-
), !0) : e.paused ? (
|
|
621
|
+
), !0) : e.paused ? (B(!0), W.current = "manual", b.current = !1, l.current = !0, M("toggle-resume"), !0) : (B(!1), l.current = !1, b.current = !0, e.pause(), !0);
|
|
513
622
|
}, [
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
O,
|
|
517
|
-
K,
|
|
518
|
-
oe,
|
|
519
|
-
Re,
|
|
520
|
-
C,
|
|
521
|
-
L,
|
|
522
|
-
u,
|
|
623
|
+
o,
|
|
624
|
+
w.length,
|
|
523
625
|
$,
|
|
524
|
-
|
|
626
|
+
T,
|
|
627
|
+
he,
|
|
628
|
+
Fe,
|
|
629
|
+
v,
|
|
630
|
+
M,
|
|
631
|
+
u,
|
|
632
|
+
B,
|
|
633
|
+
F
|
|
525
634
|
]);
|
|
526
|
-
|
|
527
|
-
if (
|
|
528
|
-
return
|
|
529
|
-
}, [
|
|
530
|
-
const
|
|
635
|
+
y(() => {
|
|
636
|
+
if (P)
|
|
637
|
+
return Qt(z);
|
|
638
|
+
}, [z, P]);
|
|
639
|
+
const ve = Y(
|
|
531
640
|
() => ({
|
|
532
|
-
fullscreen: () =>
|
|
533
|
-
interaction: () =>
|
|
534
|
-
next: () =>
|
|
535
|
-
|
|
641
|
+
fullscreen: () => te ? (te(), !0) : !1,
|
|
642
|
+
interaction: () => fe ? (_e && fe(), !0) : !1,
|
|
643
|
+
next: () => oe ? (we || oe(
|
|
644
|
+
St(se())
|
|
536
645
|
), !0) : !1,
|
|
537
|
-
|
|
538
|
-
|
|
646
|
+
nextSubtitle: () => X.next ? ae("next") : !0,
|
|
647
|
+
previous: () => ce ? (ke || ce(
|
|
648
|
+
St(se())
|
|
539
649
|
), !0) : !1,
|
|
540
|
-
|
|
541
|
-
|
|
650
|
+
previousSubtitle: () => X.previous ? ae("previous") : !0,
|
|
651
|
+
subtitle: () => ee ? (ee(), !0) : !1,
|
|
652
|
+
togglePlayback: () => (Ae(), !0)
|
|
542
653
|
}),
|
|
543
654
|
[
|
|
544
|
-
te,
|
|
545
|
-
me,
|
|
546
|
-
ye,
|
|
547
|
-
I,
|
|
548
655
|
se,
|
|
656
|
+
_e,
|
|
549
657
|
ae,
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
658
|
+
we,
|
|
659
|
+
te,
|
|
660
|
+
fe,
|
|
661
|
+
oe,
|
|
662
|
+
ce,
|
|
663
|
+
ee,
|
|
664
|
+
ke,
|
|
665
|
+
X.next,
|
|
666
|
+
X.previous,
|
|
667
|
+
Ae
|
|
554
668
|
]
|
|
555
|
-
),
|
|
556
|
-
return
|
|
557
|
-
|
|
558
|
-
}, [
|
|
559
|
-
if (!
|
|
669
|
+
), ht = c(ve);
|
|
670
|
+
return y(() => {
|
|
671
|
+
ht.current = ve;
|
|
672
|
+
}, [ve]), y(() => {
|
|
673
|
+
if (!P || typeof document > "u")
|
|
560
674
|
return;
|
|
561
|
-
const e = (
|
|
562
|
-
if (!
|
|
675
|
+
const e = (t) => {
|
|
676
|
+
if (!er(z))
|
|
563
677
|
return;
|
|
564
|
-
const
|
|
565
|
-
if (!
|
|
678
|
+
const s = tr(t);
|
|
679
|
+
if (!s || rr(t, s))
|
|
566
680
|
return;
|
|
567
|
-
let
|
|
568
|
-
const
|
|
569
|
-
|
|
681
|
+
let i = !1;
|
|
682
|
+
const p = ht.current[s];
|
|
683
|
+
i = p(), i && t.preventDefault();
|
|
570
684
|
};
|
|
571
685
|
return document.addEventListener("keydown", e), () => {
|
|
572
686
|
document.removeEventListener("keydown", e);
|
|
573
687
|
};
|
|
574
|
-
}, [
|
|
575
|
-
|
|
576
|
-
}, [
|
|
688
|
+
}, [z, P]), y(() => {
|
|
689
|
+
ie?.(me.current);
|
|
690
|
+
}, [ie]), /* @__PURE__ */ n.jsxs(
|
|
577
691
|
"div",
|
|
578
692
|
{
|
|
579
|
-
...
|
|
580
|
-
"data-slide-player-shortcut-owner":
|
|
581
|
-
className:
|
|
582
|
-
onFocusCapture:
|
|
583
|
-
onPointerDown:
|
|
693
|
+
...Lt,
|
|
694
|
+
"data-slide-player-shortcut-owner": z,
|
|
695
|
+
className: bt("slide-player", N),
|
|
696
|
+
onFocusCapture: Ct,
|
|
697
|
+
onPointerDown: jt,
|
|
584
698
|
children: [
|
|
585
699
|
/* @__PURE__ */ n.jsx(
|
|
586
700
|
"audio",
|
|
587
701
|
{
|
|
588
|
-
ref:
|
|
702
|
+
ref: _,
|
|
589
703
|
preload: "auto",
|
|
590
704
|
playsInline: !0,
|
|
591
|
-
onLoadStart:
|
|
592
|
-
onLoadedMetadata:
|
|
593
|
-
onCanPlay:
|
|
594
|
-
onPlay:
|
|
595
|
-
onPause:
|
|
596
|
-
onWaiting:
|
|
597
|
-
onSeeking:
|
|
598
|
-
onSeeked:
|
|
599
|
-
onTimeUpdate:
|
|
600
|
-
onEnded:
|
|
601
|
-
onError:
|
|
705
|
+
onLoadStart: Wt,
|
|
706
|
+
onLoadedMetadata: Ut,
|
|
707
|
+
onCanPlay: Kt,
|
|
708
|
+
onPlay: Nt,
|
|
709
|
+
onPause: Et,
|
|
710
|
+
onWaiting: Pt,
|
|
711
|
+
onSeeking: pt,
|
|
712
|
+
onSeeked: pt,
|
|
713
|
+
onTimeUpdate: Ft,
|
|
714
|
+
onEnded: Bt,
|
|
715
|
+
onError: Ot
|
|
602
716
|
}
|
|
603
717
|
),
|
|
604
|
-
|
|
718
|
+
Me ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
605
719
|
/* @__PURE__ */ n.jsx(
|
|
606
|
-
|
|
720
|
+
zt,
|
|
607
721
|
{
|
|
608
|
-
container:
|
|
722
|
+
container: wt,
|
|
609
723
|
labels: {
|
|
610
|
-
closeSettings:
|
|
611
|
-
fullscreen:
|
|
612
|
-
nonFullscreen:
|
|
613
|
-
screen:
|
|
614
|
-
screenMode:
|
|
615
|
-
subtitle:
|
|
616
|
-
subtitleToggle:
|
|
617
|
-
title:
|
|
724
|
+
closeSettings: a.closeSettingsLabel,
|
|
725
|
+
fullscreen: a.fullscreenLabel,
|
|
726
|
+
nonFullscreen: a.nonFullscreenLabel,
|
|
727
|
+
screen: a.screenLabel,
|
|
728
|
+
screenMode: a.screenModeLabel,
|
|
729
|
+
subtitle: a.subtitleLabel,
|
|
730
|
+
subtitleToggle: a.subtitleToggleAriaLabel,
|
|
731
|
+
title: a.settingsTitle
|
|
618
732
|
},
|
|
619
|
-
isSubtitleEnabled:
|
|
620
|
-
onClose: () =>
|
|
621
|
-
onOpenChange:
|
|
622
|
-
onSubtitleToggle:
|
|
733
|
+
isSubtitleEnabled: xe,
|
|
734
|
+
onClose: () => D(!1),
|
|
735
|
+
onOpenChange: D,
|
|
736
|
+
onSubtitleToggle: ee ?? (() => {
|
|
623
737
|
}),
|
|
624
|
-
onViewModeChange:
|
|
625
|
-
open:
|
|
626
|
-
viewMode:
|
|
738
|
+
onViewModeChange: Vt,
|
|
739
|
+
open: ze,
|
|
740
|
+
viewMode: kt
|
|
627
741
|
}
|
|
628
742
|
),
|
|
629
|
-
/* @__PURE__ */ n.jsxs("div", { className: "slide-player__controls", style:
|
|
743
|
+
/* @__PURE__ */ n.jsxs("div", { className: "slide-player__controls", style: vt, children: [
|
|
630
744
|
/* @__PURE__ */ n.jsxs("div", { className: "slide-player__group", children: [
|
|
631
745
|
/* @__PURE__ */ n.jsx(
|
|
632
746
|
"button",
|
|
633
747
|
{
|
|
634
|
-
"aria-expanded":
|
|
748
|
+
"aria-expanded": ze,
|
|
635
749
|
"aria-haspopup": "dialog",
|
|
636
|
-
"aria-label":
|
|
750
|
+
"aria-label": a.moreOptionsAriaLabel,
|
|
637
751
|
className: "slide-player__action slide-player__action--mobile-more",
|
|
638
752
|
onClick: () => {
|
|
639
|
-
|
|
753
|
+
D((e) => !e);
|
|
640
754
|
},
|
|
641
755
|
type: "button",
|
|
642
756
|
children: /* @__PURE__ */ n.jsx(
|
|
643
|
-
|
|
757
|
+
ir,
|
|
644
758
|
{
|
|
645
759
|
className: "slide-player__icon",
|
|
646
760
|
strokeWidth: 2.25
|
|
@@ -651,24 +765,24 @@ const sr = /* @__PURE__ */ new Map(), lr = (k) => {
|
|
|
651
765
|
/* @__PURE__ */ n.jsx(
|
|
652
766
|
"button",
|
|
653
767
|
{
|
|
654
|
-
"aria-label":
|
|
768
|
+
"aria-label": a.volumeAriaLabel,
|
|
655
769
|
className: "hidden",
|
|
656
770
|
type: "button",
|
|
657
|
-
children: /* @__PURE__ */ n.jsx(
|
|
771
|
+
children: /* @__PURE__ */ n.jsx(cr, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
658
772
|
}
|
|
659
773
|
),
|
|
660
774
|
/* @__PURE__ */ n.jsx(
|
|
661
775
|
"button",
|
|
662
776
|
{
|
|
663
|
-
"aria-label":
|
|
664
|
-
"aria-keyshortcuts":
|
|
665
|
-
"aria-pressed":
|
|
777
|
+
"aria-label": a.subtitleToggleAriaLabel,
|
|
778
|
+
"aria-keyshortcuts": Qe.ariaKeyShortcuts,
|
|
779
|
+
"aria-pressed": xe,
|
|
666
780
|
className: "slide-player__action slide-player__action--subtitle",
|
|
667
|
-
onClick:
|
|
668
|
-
title:
|
|
781
|
+
onClick: ee,
|
|
782
|
+
title: Qe.title,
|
|
669
783
|
type: "button",
|
|
670
|
-
children:
|
|
671
|
-
|
|
784
|
+
children: xe ? /* @__PURE__ */ n.jsx(or, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ n.jsx(
|
|
785
|
+
fr,
|
|
672
786
|
{
|
|
673
787
|
className: "slide-player__icon",
|
|
674
788
|
strokeWidth: 2.25
|
|
@@ -679,64 +793,100 @@ const sr = /* @__PURE__ */ new Map(), lr = (k) => {
|
|
|
679
793
|
/* @__PURE__ */ n.jsx(
|
|
680
794
|
"button",
|
|
681
795
|
{
|
|
682
|
-
"aria-keyshortcuts":
|
|
683
|
-
"aria-label":
|
|
796
|
+
"aria-keyshortcuts": tt.ariaKeyShortcuts,
|
|
797
|
+
"aria-label": a.previousSubtitleLabel,
|
|
798
|
+
className: "slide-player__action slide-player__action--prev-subtitle",
|
|
799
|
+
disabled: !X.previous,
|
|
800
|
+
onClick: () => {
|
|
801
|
+
ae("previous");
|
|
802
|
+
},
|
|
803
|
+
title: tt.title,
|
|
804
|
+
type: "button",
|
|
805
|
+
children: /* @__PURE__ */ n.jsx(dr, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
806
|
+
}
|
|
807
|
+
),
|
|
808
|
+
/* @__PURE__ */ n.jsx(
|
|
809
|
+
"button",
|
|
810
|
+
{
|
|
811
|
+
"aria-keyshortcuts": et.ariaKeyShortcuts,
|
|
812
|
+
"aria-label": a.previousLabel,
|
|
684
813
|
className: "slide-player__action slide-player__action--prev",
|
|
685
|
-
disabled:
|
|
814
|
+
disabled: ke,
|
|
686
815
|
onClick: () => {
|
|
687
|
-
|
|
816
|
+
ce?.(se());
|
|
688
817
|
},
|
|
689
|
-
title:
|
|
818
|
+
title: et.title,
|
|
690
819
|
type: "button",
|
|
691
|
-
children: /* @__PURE__ */ n.jsx(
|
|
820
|
+
children: /* @__PURE__ */ n.jsx(mr, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
692
821
|
}
|
|
693
822
|
),
|
|
694
823
|
/* @__PURE__ */ n.jsx(
|
|
695
824
|
"button",
|
|
696
825
|
{
|
|
697
|
-
"aria-label":
|
|
698
|
-
"aria-keyshortcuts":
|
|
826
|
+
"aria-label": Xe,
|
|
827
|
+
"aria-keyshortcuts": rt.ariaKeyShortcuts,
|
|
699
828
|
className: "slide-player__toggle slide-player__toggle--playback",
|
|
700
829
|
onClick: () => {
|
|
701
|
-
|
|
830
|
+
Ae();
|
|
702
831
|
},
|
|
703
|
-
title:
|
|
832
|
+
title: rt.title,
|
|
704
833
|
type: "button",
|
|
705
|
-
children:
|
|
834
|
+
children: Rt ? /* @__PURE__ */ n.jsx(gr, {}) : /* @__PURE__ */ n.jsx(_r, {})
|
|
706
835
|
}
|
|
707
836
|
),
|
|
708
837
|
/* @__PURE__ */ n.jsx(
|
|
709
838
|
"button",
|
|
710
839
|
{
|
|
711
|
-
"aria-keyshortcuts":
|
|
712
|
-
"aria-label":
|
|
840
|
+
"aria-keyshortcuts": nt.ariaKeyShortcuts,
|
|
841
|
+
"aria-label": a.nextLabel,
|
|
713
842
|
className: "slide-player__action slide-player__action--next",
|
|
714
|
-
disabled:
|
|
843
|
+
disabled: we,
|
|
715
844
|
onClick: () => {
|
|
716
|
-
|
|
845
|
+
oe?.(se());
|
|
717
846
|
},
|
|
718
|
-
title:
|
|
847
|
+
title: nt.title,
|
|
719
848
|
type: "button",
|
|
720
|
-
children: /* @__PURE__ */ n.jsx(
|
|
849
|
+
children: /* @__PURE__ */ n.jsx(pr, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
850
|
+
}
|
|
851
|
+
),
|
|
852
|
+
/* @__PURE__ */ n.jsx(
|
|
853
|
+
"button",
|
|
854
|
+
{
|
|
855
|
+
"aria-keyshortcuts": ut.ariaKeyShortcuts,
|
|
856
|
+
"aria-label": a.nextSubtitleLabel,
|
|
857
|
+
className: "slide-player__action slide-player__action--next-subtitle",
|
|
858
|
+
disabled: !X.next,
|
|
859
|
+
onClick: () => {
|
|
860
|
+
ae("next");
|
|
861
|
+
},
|
|
862
|
+
title: ut.title,
|
|
863
|
+
type: "button",
|
|
864
|
+
children: /* @__PURE__ */ n.jsx(
|
|
865
|
+
hr,
|
|
866
|
+
{
|
|
867
|
+
className: "slide-player__icon",
|
|
868
|
+
strokeWidth: 2.25
|
|
869
|
+
}
|
|
870
|
+
)
|
|
721
871
|
}
|
|
722
872
|
),
|
|
723
|
-
|
|
873
|
+
te ? /* @__PURE__ */ n.jsx(
|
|
724
874
|
"button",
|
|
725
875
|
{
|
|
726
|
-
"aria-label":
|
|
727
|
-
"aria-keyshortcuts":
|
|
876
|
+
"aria-label": Ge,
|
|
877
|
+
"aria-keyshortcuts": st.ariaKeyShortcuts,
|
|
728
878
|
className: "slide-player__action slide-player__action--fullscreen",
|
|
729
|
-
onClick:
|
|
730
|
-
title:
|
|
879
|
+
onClick: te,
|
|
880
|
+
title: st.title,
|
|
731
881
|
type: "button",
|
|
732
|
-
children:
|
|
733
|
-
|
|
882
|
+
children: Ee ? /* @__PURE__ */ n.jsx(
|
|
883
|
+
yr,
|
|
734
884
|
{
|
|
735
885
|
className: "slide-player__icon",
|
|
736
886
|
strokeWidth: 2.25
|
|
737
887
|
}
|
|
738
888
|
) : /* @__PURE__ */ n.jsx(
|
|
739
|
-
|
|
889
|
+
br,
|
|
740
890
|
{
|
|
741
891
|
className: "slide-player__icon",
|
|
742
892
|
strokeWidth: 2.25
|
|
@@ -747,22 +897,22 @@ const sr = /* @__PURE__ */ new Map(), lr = (k) => {
|
|
|
747
897
|
] }),
|
|
748
898
|
/* @__PURE__ */ n.jsx("div", { className: "slide-player__separator" }),
|
|
749
899
|
/* @__PURE__ */ n.jsxs("div", { className: "slide-player__group", children: [
|
|
750
|
-
|
|
900
|
+
Ye.map((e, t) => /* @__PURE__ */ n.jsx(Ht.Fragment, { children: e }, `custom-action-${t}`)),
|
|
751
901
|
/* @__PURE__ */ n.jsx(
|
|
752
902
|
"button",
|
|
753
903
|
{
|
|
754
|
-
"aria-label":
|
|
755
|
-
"aria-keyshortcuts":
|
|
756
|
-
className:
|
|
904
|
+
"aria-label": a.notesLabel,
|
|
905
|
+
"aria-keyshortcuts": lt.ariaKeyShortcuts,
|
|
906
|
+
className: bt(
|
|
757
907
|
"slide-player__action slide-player__action--notes",
|
|
758
|
-
|
|
908
|
+
re && "slide-player__action--active"
|
|
759
909
|
),
|
|
760
|
-
disabled: !
|
|
761
|
-
onClick:
|
|
762
|
-
title:
|
|
910
|
+
disabled: !_e,
|
|
911
|
+
onClick: fe,
|
|
912
|
+
title: lt.title,
|
|
763
913
|
type: "button",
|
|
764
914
|
children: /* @__PURE__ */ n.jsx(
|
|
765
|
-
|
|
915
|
+
Sr,
|
|
766
916
|
{
|
|
767
917
|
className: "slide-player__icon",
|
|
768
918
|
strokeWidth: 2.25
|
|
@@ -776,9 +926,9 @@ const sr = /* @__PURE__ */ new Map(), lr = (k) => {
|
|
|
776
926
|
]
|
|
777
927
|
}
|
|
778
928
|
);
|
|
779
|
-
},
|
|
780
|
-
|
|
929
|
+
}, Mr = $t(wr);
|
|
930
|
+
Mr.displayName = "Player";
|
|
781
931
|
export {
|
|
782
|
-
|
|
932
|
+
Mr as default
|
|
783
933
|
};
|
|
784
934
|
//# sourceMappingURL=Player.es.js.map
|