mulmocast-viewer 0.2.0 → 0.2.2
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/index.d.ts +58 -20
- package/dist/mulmocast-viewer.css +1 -1
- package/dist/mulmocast-viewer.es.js +408 -392
- package/dist/mulmocast-viewer.umd.js +1 -1
- package/package.json +10 -7
|
@@ -1,493 +1,509 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
return new Promise((
|
|
5
|
-
if (
|
|
6
|
-
p(
|
|
1
|
+
import { defineComponent as R, ref as $, watch as _, onMounted as ae, computed as B, onUnmounted as ve, openBlock as i, createElementBlock as r, createElementVNode as e, normalizeClass as ne, createCommentVNode as k, toDisplayString as L, Fragment as D, renderList as Z, renderSlot as q, normalizeProps as oe, guardReactiveProps as me, createVNode as z, mergeProps as le, unref as fe, withDirectives as ge, createBlock as I, vShow as pe, withModifiers as he, resolveDynamicComponent as se, withCtx as ie } from "vue";
|
|
2
|
+
const X = async (a) => await new Promise((d) => setTimeout(d, a)), ye = (a, d) => {
|
|
3
|
+
const o = (l) => l instanceof Error ? l : new Error("Aborted");
|
|
4
|
+
return new Promise((l, p) => {
|
|
5
|
+
if (d.aborted) {
|
|
6
|
+
p(o(d.reason));
|
|
7
7
|
return;
|
|
8
8
|
}
|
|
9
9
|
const g = () => {
|
|
10
|
-
clearTimeout(
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
|
|
10
|
+
clearTimeout(t), p(o(d.reason));
|
|
11
|
+
}, t = setTimeout(() => {
|
|
12
|
+
d.removeEventListener("abort", g), l();
|
|
13
|
+
}, a);
|
|
14
|
+
d.addEventListener("abort", g, { once: !0 });
|
|
15
15
|
});
|
|
16
|
-
},
|
|
16
|
+
}, xe = { class: "items-center justify-center w-full" }, be = {
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "group relative"
|
|
19
|
-
},
|
|
19
|
+
}, ke = ["src"], we = { class: "play-overlay absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none" }, Se = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "w-8 h-8 text-white ml-1",
|
|
22
22
|
fill: "currentColor",
|
|
23
23
|
viewBox: "0 0 24 24"
|
|
24
|
-
},
|
|
24
|
+
}, $e = {
|
|
25
25
|
key: 1,
|
|
26
26
|
class: "w-8 h-8 text-white",
|
|
27
27
|
fill: "currentColor",
|
|
28
28
|
viewBox: "0 0 24 24"
|
|
29
|
-
},
|
|
29
|
+
}, Le = {
|
|
30
30
|
key: 1,
|
|
31
31
|
class: "group relative inline-block"
|
|
32
|
-
},
|
|
32
|
+
}, Pe = ["src", "controls"], Ce = ["src"], Ee = { class: "play-overlay absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none" }, Be = {
|
|
33
33
|
key: 0,
|
|
34
34
|
class: "w-8 h-8 text-white ml-1",
|
|
35
35
|
fill: "currentColor",
|
|
36
36
|
viewBox: "0 0 24 24"
|
|
37
|
-
},
|
|
37
|
+
}, Te = {
|
|
38
38
|
key: 1,
|
|
39
39
|
class: "w-8 h-8 text-white",
|
|
40
40
|
fill: "currentColor",
|
|
41
41
|
viewBox: "0 0 24 24"
|
|
42
|
-
},
|
|
42
|
+
}, Me = {
|
|
43
43
|
key: 2,
|
|
44
44
|
class: "group relative inline-block"
|
|
45
|
-
},
|
|
45
|
+
}, _e = ["src"], Ve = ["src"], Ae = { class: "play-overlay absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none" }, je = {
|
|
46
46
|
key: 0,
|
|
47
47
|
class: "w-8 h-8 text-white ml-1",
|
|
48
48
|
fill: "currentColor",
|
|
49
49
|
viewBox: "0 0 24 24"
|
|
50
|
-
},
|
|
50
|
+
}, Ue = {
|
|
51
51
|
key: 1,
|
|
52
52
|
class: "w-8 h-8 text-white",
|
|
53
53
|
fill: "currentColor",
|
|
54
54
|
viewBox: "0 0 24 24"
|
|
55
|
-
},
|
|
55
|
+
}, De = {
|
|
56
56
|
key: 3,
|
|
57
57
|
class: "group relative inline-block"
|
|
58
|
-
},
|
|
58
|
+
}, Re = ["src"], ze = { class: "play-overlay absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none" }, Ne = {
|
|
59
59
|
key: 0,
|
|
60
60
|
class: "w-8 h-8 text-white ml-1",
|
|
61
61
|
fill: "currentColor",
|
|
62
62
|
viewBox: "0 0 24 24"
|
|
63
|
-
},
|
|
63
|
+
}, We = {
|
|
64
64
|
key: 1,
|
|
65
65
|
class: "w-8 h-8 text-white",
|
|
66
66
|
fill: "currentColor",
|
|
67
67
|
viewBox: "0 0 24 24"
|
|
68
|
-
},
|
|
68
|
+
}, He = { key: 4 }, Fe = {
|
|
69
69
|
key: 5,
|
|
70
70
|
class: "mt-4 px-6 py-4 text-left"
|
|
71
|
-
},
|
|
71
|
+
}, Ge = { class: "text-lg leading-relaxed font-sans text-gray-800" }, Oe = {
|
|
72
72
|
key: 0,
|
|
73
73
|
class: "text-base leading-relaxed font-sans text-gray-400 mt-3 italic"
|
|
74
|
-
},
|
|
74
|
+
}, qe = "https://github.com/receptron/mulmocast-cli/blob/main/assets/images/mulmocast_credit.png?raw=true", Je = /* @__PURE__ */ R({
|
|
75
75
|
__name: "mulmo_player",
|
|
76
76
|
props: {
|
|
77
77
|
index: {},
|
|
78
|
-
videoWithAudioSource: {},
|
|
79
|
-
soundEffectSource: {},
|
|
80
|
-
videoSource: {},
|
|
81
|
-
imageSource: {},
|
|
82
|
-
audioSource: {},
|
|
83
|
-
text: {},
|
|
84
|
-
originalText: {},
|
|
85
|
-
duration: {},
|
|
86
|
-
defaultLang: {},
|
|
87
|
-
currentLang: {},
|
|
78
|
+
videoWithAudioSource: { default: void 0 },
|
|
79
|
+
soundEffectSource: { default: void 0 },
|
|
80
|
+
videoSource: { default: void 0 },
|
|
81
|
+
imageSource: { default: void 0 },
|
|
82
|
+
audioSource: { default: void 0 },
|
|
83
|
+
text: { default: void 0 },
|
|
84
|
+
originalText: { default: void 0 },
|
|
85
|
+
duration: { default: void 0 },
|
|
86
|
+
defaultLang: { default: void 0 },
|
|
87
|
+
currentLang: { default: void 0 },
|
|
88
88
|
playbackSpeed: { default: 1 }
|
|
89
89
|
},
|
|
90
90
|
emits: ["play", "pause", "ended"],
|
|
91
|
-
setup(
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
setup(a, { expose: d, emit: o }) {
|
|
92
|
+
const l = a, p = o, g = $(), t = $(), u = $(), n = $(), f = $(!1), h = () => {
|
|
93
|
+
t.value && u.value && !isNaN(t.value.duration) && !isNaN(u.value.duration) && (f.value = u.value.duration > t.value.duration + 1);
|
|
94
|
+
}, v = () => {
|
|
95
|
+
if (t.value) {
|
|
96
|
+
if (l.soundEffectSource) {
|
|
97
|
+
t.value.volume = 1;
|
|
96
98
|
return;
|
|
97
99
|
}
|
|
98
|
-
|
|
100
|
+
l.videoSource && (l.audioSource && l.currentLang && l.defaultLang && l.currentLang !== l.defaultLang ? t.value.volume = 0.2 : t.value.volume = 0);
|
|
99
101
|
}
|
|
100
|
-
},
|
|
101
|
-
const
|
|
102
|
-
g.value && (g.value.playbackRate =
|
|
102
|
+
}, x = () => {
|
|
103
|
+
const y = l.playbackSpeed ?? 1;
|
|
104
|
+
g.value && (g.value.playbackRate = y), t.value && (t.value.playbackRate = y), u.value && (u.value.playbackRate = y), n.value && (n.value.playbackRate = y);
|
|
103
105
|
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}),
|
|
107
|
-
() =>
|
|
106
|
+
_([() => l.currentLang, () => l.defaultLang, () => l.videoSource, () => l.audioSource], () => {
|
|
107
|
+
v();
|
|
108
|
+
}), _(
|
|
109
|
+
() => l.playbackSpeed,
|
|
108
110
|
() => {
|
|
109
|
-
|
|
111
|
+
x();
|
|
110
112
|
}
|
|
111
|
-
),
|
|
112
|
-
|
|
113
|
-
}),
|
|
114
|
-
|
|
115
|
-
}),
|
|
116
|
-
|
|
113
|
+
), _(t, (y) => {
|
|
114
|
+
y && (v(), x());
|
|
115
|
+
}), _([g, u, n], () => {
|
|
116
|
+
x();
|
|
117
|
+
}), ae(() => {
|
|
118
|
+
v(), x();
|
|
117
119
|
});
|
|
118
|
-
const
|
|
119
|
-
let
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
},
|
|
123
|
-
|
|
120
|
+
const C = $(!1), b = $(!1), P = B(() => m.value || b.value);
|
|
121
|
+
let w = null;
|
|
122
|
+
const V = () => {
|
|
123
|
+
w && (w.abort(), w = null);
|
|
124
|
+
}, W = () => {
|
|
125
|
+
m.value = !0, u.value && t.value && !u.value.ended && (u.value.currentTime = t.value.currentTime, u.value.play().catch(() => {
|
|
124
126
|
})), p("play");
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
+
}, J = (y) => {
|
|
128
|
+
b.value || t.value?.ended && u.value && !u.value.ended || (document.hidden || (m.value = !1), !t.value?.ended && u?.value && u.value?.pause(), j(y));
|
|
129
|
+
}, H = () => {
|
|
130
|
+
if (C.value) return;
|
|
131
|
+
(!u.value || u.value.ended) && U();
|
|
132
|
+
}, A = () => {
|
|
133
|
+
if (C.value) return;
|
|
134
|
+
(!t.value || t.value.ended) && U();
|
|
127
135
|
}, F = () => {
|
|
128
|
-
if (
|
|
129
|
-
(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
if (!t.value || !u.value) return;
|
|
137
|
+
const y = Math.min(u.value.currentTime, t.value.duration);
|
|
138
|
+
Math.abs(t.value.currentTime - y) > 0.5 && (t.value.currentTime = y);
|
|
139
|
+
}, K = () => {
|
|
140
|
+
m.value = !0, t.value && !t.value.ended && t.value.play().catch(() => {
|
|
141
|
+
}), p("play");
|
|
142
|
+
}, E = () => {
|
|
143
|
+
b.value || u.value?.ended || (document.hidden || (m.value = !1), t.value && !t.value.ended && t.value.pause(), p("pause"));
|
|
144
|
+
}, G = () => {
|
|
145
|
+
m.value = !0, p("play");
|
|
146
|
+
}, j = (y) => {
|
|
147
|
+
if (b.value) return;
|
|
148
|
+
document.hidden || (m.value = !1);
|
|
149
|
+
const c = y.target;
|
|
150
|
+
c.duration !== c.currentTime && p("pause");
|
|
142
151
|
}, U = () => {
|
|
143
|
-
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}))
|
|
151
|
-
})
|
|
152
|
+
C.value || (C.value = !0, m.value = !1, p("ended"));
|
|
153
|
+
}, s = () => {
|
|
154
|
+
g.value?.pause(), t.value?.pause(), u.value?.pause(), n.value?.pause();
|
|
155
|
+
}, m = $(!1);
|
|
156
|
+
let S = null;
|
|
157
|
+
const M = async () => {
|
|
158
|
+
if (b.value = !1, C.value = !1, m.value = !0, g.value && (x(), g.value.play().catch(() => {
|
|
159
|
+
})), t.value && (v(), x(), t.value.play().catch(() => {
|
|
160
|
+
}), u.value && (u.value.currentTime = t.value.currentTime, u.value.play().catch(() => {
|
|
161
|
+
}))), n.value && (x(), n.value.play().catch(() => {
|
|
162
|
+
})), !g.value && !t.value && !n.value)
|
|
152
163
|
try {
|
|
153
|
-
|
|
164
|
+
V(), w = new AbortController(), await ye((l.duration ?? 0) * 1e3, w.signal), w = null, C.value || (m.value = !1, C.value = !0, p("ended"));
|
|
154
165
|
} catch {
|
|
155
166
|
}
|
|
156
|
-
},
|
|
157
|
-
|
|
158
|
-
},
|
|
159
|
-
|
|
160
|
-
},
|
|
161
|
-
|
|
167
|
+
}, re = () => {
|
|
168
|
+
b.value = !0, m.value = !1, C.value = !0, V(), g.value?.pause(), t.value?.pause(), u.value?.pause(), n.value?.pause();
|
|
169
|
+
}, de = () => {
|
|
170
|
+
!u.value || !t.value || u.value.ended || Math.abs(u.value.currentTime - t.value.currentTime) > 0.5 && (u.value.currentTime = t.value.currentTime);
|
|
171
|
+
}, O = (y) => {
|
|
172
|
+
y?.paused && !y.ended && y.play().catch(() => {
|
|
162
173
|
});
|
|
163
|
-
},
|
|
164
|
-
|
|
174
|
+
}, ce = (y, c) => {
|
|
175
|
+
c.paused && !c.ended && (y.ended || (c.currentTime = y.currentTime), c.play().catch(() => {
|
|
165
176
|
}));
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
},
|
|
169
|
-
document.hidden &&
|
|
170
|
-
},
|
|
171
|
-
document.hidden &&
|
|
177
|
+
}, ee = () => {
|
|
178
|
+
m.value && (O(g.value), t.value && u.value ? (O(t.value), ce(t.value, u.value)) : O(t.value), O(n.value));
|
|
179
|
+
}, te = () => {
|
|
180
|
+
document.hidden && m.value ? S || (S = setInterval(ee, 500)) : document.hidden || S && (clearInterval(S), S = null);
|
|
181
|
+
}, T = () => {
|
|
182
|
+
document.hidden && m.value && setTimeout(ee, 50);
|
|
172
183
|
};
|
|
173
|
-
return
|
|
174
|
-
document.addEventListener("visibilitychange",
|
|
175
|
-
}),
|
|
176
|
-
document.removeEventListener("visibilitychange",
|
|
177
|
-
}),
|
|
178
|
-
play:
|
|
179
|
-
stop:
|
|
180
|
-
}), (
|
|
181
|
-
|
|
184
|
+
return ae(() => {
|
|
185
|
+
document.addEventListener("visibilitychange", te), g.value?.addEventListener("pause", T), t.value?.addEventListener("pause", T), n.value?.addEventListener("pause", T), u.value?.addEventListener("pause", T);
|
|
186
|
+
}), ve(() => {
|
|
187
|
+
document.removeEventListener("visibilitychange", te), g.value?.removeEventListener("pause", T), t.value?.removeEventListener("pause", T), n.value?.removeEventListener("pause", T), u.value?.removeEventListener("pause", T), S && (clearInterval(S), S = null), V();
|
|
188
|
+
}), d({
|
|
189
|
+
play: M,
|
|
190
|
+
stop: re
|
|
191
|
+
}), (y, c) => (i(), r("div", xe, [
|
|
192
|
+
a.videoWithAudioSource ? (i(), r("div", be, [
|
|
182
193
|
e("video", {
|
|
183
194
|
ref_key: "videoWithAudioRef",
|
|
184
195
|
ref: g,
|
|
185
|
-
src:
|
|
196
|
+
src: a.videoWithAudioSource,
|
|
186
197
|
class: "mulmocast-video mx-auto h-auto max-h-[80vh] w-auto object-contain",
|
|
187
198
|
controls: !0,
|
|
188
199
|
playsinline: "true",
|
|
189
|
-
onPlay:
|
|
190
|
-
onPause:
|
|
191
|
-
onEnded:
|
|
192
|
-
}, null, 40,
|
|
193
|
-
e("div",
|
|
200
|
+
onPlay: G,
|
|
201
|
+
onPause: j,
|
|
202
|
+
onEnded: U
|
|
203
|
+
}, null, 40, ke),
|
|
204
|
+
e("div", we, [
|
|
194
205
|
e("button", {
|
|
195
206
|
class: "pointer-events-auto w-16 h-16 bg-black/50 hover:bg-black/70 rounded-full flex items-center justify-center transition-colors cursor-pointer",
|
|
196
|
-
onClick:
|
|
207
|
+
onClick: c[0] || (c[0] = (Q) => P.value ? s() : M())
|
|
197
208
|
}, [
|
|
198
|
-
|
|
209
|
+
P.value ? (i(), r("svg", $e, [...c[5] || (c[5] = [
|
|
199
210
|
e("path", { d: "M6 19h4V5H6v14zm8-14v14h4V5h-4z" }, null, -1)
|
|
200
|
-
])])) : (i(),
|
|
211
|
+
])])) : (i(), r("svg", Se, [...c[4] || (c[4] = [
|
|
201
212
|
e("path", { d: "M8 5v14l11-7z" }, null, -1)
|
|
202
213
|
])]))
|
|
203
214
|
])
|
|
204
215
|
])
|
|
205
|
-
])) :
|
|
216
|
+
])) : a.soundEffectSource || a.videoSource ? (i(), r("div", Le, [
|
|
206
217
|
e("video", {
|
|
207
218
|
ref_key: "videoRef",
|
|
208
|
-
ref:
|
|
219
|
+
ref: t,
|
|
209
220
|
class: "mulmocast-video mx-auto h-auto max-h-[80vh] w-auto object-contain",
|
|
210
|
-
src:
|
|
211
|
-
controls: !
|
|
221
|
+
src: a.soundEffectSource || a.videoSource,
|
|
222
|
+
controls: !f.value,
|
|
212
223
|
playsinline: "true",
|
|
213
|
-
onPlay:
|
|
214
|
-
onPause:
|
|
215
|
-
onEnded:
|
|
216
|
-
onSeeked:
|
|
217
|
-
|
|
218
|
-
|
|
224
|
+
onPlay: W,
|
|
225
|
+
onPause: J,
|
|
226
|
+
onEnded: H,
|
|
227
|
+
onSeeked: de,
|
|
228
|
+
onLoadedmetadata: h
|
|
229
|
+
}, null, 40, Pe),
|
|
230
|
+
a.audioSource ? (i(), r("audio", {
|
|
219
231
|
key: 0,
|
|
220
232
|
ref_key: "audioSyncRef",
|
|
221
|
-
ref:
|
|
222
|
-
src:
|
|
233
|
+
ref: u,
|
|
234
|
+
src: a.audioSource,
|
|
223
235
|
controls: !0,
|
|
224
|
-
class: "hidden",
|
|
225
|
-
onEnded:
|
|
226
|
-
|
|
227
|
-
|
|
236
|
+
class: ne(f.value ? "mulmocast-audio absolute bottom-0 left-0 w-full" : "hidden"),
|
|
237
|
+
onEnded: A,
|
|
238
|
+
onSeeked: F,
|
|
239
|
+
onPlay: K,
|
|
240
|
+
onPause: E,
|
|
241
|
+
onLoadedmetadata: h
|
|
242
|
+
}, null, 42, Ce)) : k("", !0),
|
|
243
|
+
e("div", Ee, [
|
|
228
244
|
e("button", {
|
|
229
245
|
class: "pointer-events-auto w-16 h-16 bg-black/50 hover:bg-black/70 rounded-full flex items-center justify-center transition-colors cursor-pointer",
|
|
230
|
-
onClick:
|
|
246
|
+
onClick: c[1] || (c[1] = (Q) => P.value ? s() : M())
|
|
231
247
|
}, [
|
|
232
|
-
|
|
248
|
+
P.value ? (i(), r("svg", Te, [...c[7] || (c[7] = [
|
|
233
249
|
e("path", { d: "M6 19h4V5H6v14zm8-14v14h4V5h-4z" }, null, -1)
|
|
234
|
-
])])) : (i(),
|
|
250
|
+
])])) : (i(), r("svg", Be, [...c[6] || (c[6] = [
|
|
235
251
|
e("path", { d: "M8 5v14l11-7z" }, null, -1)
|
|
236
252
|
])]))
|
|
237
253
|
])
|
|
238
254
|
])
|
|
239
|
-
])) :
|
|
240
|
-
|
|
255
|
+
])) : a.audioSource ? (i(), r("div", Me, [
|
|
256
|
+
a.imageSource ? (i(), r("img", {
|
|
241
257
|
key: 0,
|
|
242
|
-
src:
|
|
258
|
+
src: a.imageSource,
|
|
243
259
|
class: "mx-auto h-auto max-h-[80vh] w-auto object-contain",
|
|
244
260
|
alt: "Background"
|
|
245
|
-
}, null, 8,
|
|
261
|
+
}, null, 8, _e)) : (i(), r("img", {
|
|
246
262
|
key: 1,
|
|
247
|
-
src:
|
|
263
|
+
src: qe,
|
|
248
264
|
class: "mx-auto h-auto max-h-[80vh] w-auto object-contain",
|
|
249
265
|
alt: "Background"
|
|
250
266
|
})),
|
|
251
267
|
e("audio", {
|
|
252
268
|
ref_key: "audioRef",
|
|
253
|
-
ref:
|
|
269
|
+
ref: n,
|
|
254
270
|
class: "mulmocast-audio absolute inset-0 w-full h-full",
|
|
255
|
-
src:
|
|
271
|
+
src: a.audioSource,
|
|
256
272
|
controls: !0,
|
|
257
|
-
onPlay:
|
|
258
|
-
onPause:
|
|
259
|
-
onEnded:
|
|
260
|
-
}, null, 40,
|
|
261
|
-
e("div",
|
|
273
|
+
onPlay: G,
|
|
274
|
+
onPause: j,
|
|
275
|
+
onEnded: U
|
|
276
|
+
}, null, 40, Ve),
|
|
277
|
+
e("div", Ae, [
|
|
262
278
|
e("button", {
|
|
263
279
|
class: "pointer-events-auto w-16 h-16 bg-black/50 hover:bg-black/70 rounded-full flex items-center justify-center transition-colors cursor-pointer",
|
|
264
|
-
onClick:
|
|
280
|
+
onClick: c[2] || (c[2] = (Q) => P.value ? s() : M())
|
|
265
281
|
}, [
|
|
266
|
-
|
|
282
|
+
P.value ? (i(), r("svg", Ue, [...c[9] || (c[9] = [
|
|
267
283
|
e("path", { d: "M6 19h4V5H6v14zm8-14v14h4V5h-4z" }, null, -1)
|
|
268
|
-
])])) : (i(),
|
|
284
|
+
])])) : (i(), r("svg", je, [...c[8] || (c[8] = [
|
|
269
285
|
e("path", { d: "M8 5v14l11-7z" }, null, -1)
|
|
270
286
|
])]))
|
|
271
287
|
])
|
|
272
288
|
])
|
|
273
|
-
])) :
|
|
289
|
+
])) : a.imageSource ? (i(), r("div", De, [
|
|
274
290
|
e("img", {
|
|
275
|
-
src:
|
|
291
|
+
src: a.imageSource,
|
|
276
292
|
class: "max-w-full max-h-full object-contain"
|
|
277
|
-
}, null, 8,
|
|
278
|
-
e("div",
|
|
293
|
+
}, null, 8, Re),
|
|
294
|
+
e("div", ze, [
|
|
279
295
|
e("button", {
|
|
280
296
|
class: "pointer-events-auto w-16 h-16 bg-black/50 hover:bg-black/70 rounded-full flex items-center justify-center transition-colors cursor-pointer",
|
|
281
|
-
onClick:
|
|
297
|
+
onClick: c[3] || (c[3] = (Q) => P.value ? s() : M())
|
|
282
298
|
}, [
|
|
283
|
-
|
|
299
|
+
P.value ? (i(), r("svg", We, [...c[11] || (c[11] = [
|
|
284
300
|
e("path", { d: "M6 19h4V5H6v14zm8-14v14h4V5h-4z" }, null, -1)
|
|
285
|
-
])])) : (i(),
|
|
301
|
+
])])) : (i(), r("svg", Ne, [...c[10] || (c[10] = [
|
|
286
302
|
e("path", { d: "M8 5v14l11-7z" }, null, -1)
|
|
287
303
|
])]))
|
|
288
304
|
])
|
|
289
305
|
])
|
|
290
|
-
])) : (i(),
|
|
291
|
-
|
|
292
|
-
e("p",
|
|
293
|
-
|
|
306
|
+
])) : (i(), r("div", He, "No media available")),
|
|
307
|
+
a.text ? (i(), r("div", Fe, [
|
|
308
|
+
e("p", Ge, L(a.text), 1),
|
|
309
|
+
a.originalText && a.originalText !== a.text ? (i(), r("p", Oe, L(a.originalText), 1)) : k("", !0)
|
|
294
310
|
])) : k("", !0)
|
|
295
311
|
]));
|
|
296
312
|
}
|
|
297
|
-
}),
|
|
298
|
-
const
|
|
299
|
-
for (const [
|
|
300
|
-
|
|
301
|
-
return
|
|
302
|
-
},
|
|
313
|
+
}), ue = (a, d) => {
|
|
314
|
+
const o = a.__vccOpts || a;
|
|
315
|
+
for (const [l, p] of d)
|
|
316
|
+
o[l] = p;
|
|
317
|
+
return o;
|
|
318
|
+
}, Y = /* @__PURE__ */ ue(Je, [["__scopeId", "data-v-843621f0"]]), Ke = ["value"], Qe = ["value"], N = /* @__PURE__ */ R({
|
|
303
319
|
__name: "select_language",
|
|
304
320
|
props: {
|
|
305
321
|
modelValue: {}
|
|
306
322
|
},
|
|
307
323
|
emits: ["update:modelValue"],
|
|
308
|
-
setup(
|
|
309
|
-
const
|
|
324
|
+
setup(a, { emit: d }) {
|
|
325
|
+
const o = ["en", "ja"], l = {
|
|
310
326
|
en: "English",
|
|
311
327
|
ja: "日本語"
|
|
312
|
-
}, p =
|
|
313
|
-
const
|
|
314
|
-
p("update:modelValue",
|
|
328
|
+
}, p = d, g = (t) => {
|
|
329
|
+
const u = t.target;
|
|
330
|
+
p("update:modelValue", u.value);
|
|
315
331
|
};
|
|
316
|
-
return (
|
|
317
|
-
value:
|
|
332
|
+
return (t, u) => (i(), r("select", {
|
|
333
|
+
value: a.modelValue,
|
|
318
334
|
class: "px-4 py-2 bg-white border-2 border-gray-300 rounded-lg shadow-sm hover:border-indigo-400 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-200 focus:outline-none transition-colors cursor-pointer text-base font-medium text-gray-700",
|
|
319
335
|
onChange: g
|
|
320
336
|
}, [
|
|
321
|
-
(i(),
|
|
322
|
-
key:
|
|
323
|
-
value:
|
|
324
|
-
},
|
|
325
|
-
], 40,
|
|
337
|
+
(i(), r(D, null, Z(o, (n) => e("option", {
|
|
338
|
+
key: n,
|
|
339
|
+
value: n
|
|
340
|
+
}, L(l[n] || n), 9, Qe)), 64))
|
|
341
|
+
], 40, Ke));
|
|
326
342
|
}
|
|
327
|
-
}),
|
|
343
|
+
}), Xe = { class: "w-full overflow-hidden" }, Ye = { class: "max-w-7xl mx-auto px-4" }, Ze = { class: "grid grid-cols-[auto,1fr,auto] gap-x-4 gap-y-4 max-sm:grid-cols-2" }, Ie = ["disabled"], et = { class: "col-start-2 row-start-1 min-w-0 max-sm:col-span-2 max-sm:col-start-1" }, tt = ["disabled"], at = {
|
|
328
344
|
key: 0,
|
|
329
345
|
class: "mulmo-text-box col-start-2 row-start-2 min-w-0 mt-1 rounded-lg px-6 py-4 text-left max-sm:col-span-2 max-sm:col-start-1 max-sm:row-start-3"
|
|
330
|
-
},
|
|
346
|
+
}, ot = { class: "mulmo-text-primary text-lg leading-relaxed font-sans" }, lt = {
|
|
331
347
|
key: 0,
|
|
332
348
|
class: "mulmo-text-secondary text-base leading-relaxed font-sans mt-3 italic"
|
|
333
|
-
},
|
|
349
|
+
}, nt = ["src"], st = /* @__PURE__ */ R({
|
|
334
350
|
__name: "mulmo_viewer",
|
|
335
351
|
props: {
|
|
336
|
-
dataSet: {},
|
|
352
|
+
dataSet: { default: void 0 },
|
|
337
353
|
basePath: {},
|
|
338
|
-
initPage: {},
|
|
354
|
+
initPage: { default: void 0 },
|
|
339
355
|
audioLang: { default: "en" },
|
|
340
356
|
textLang: { default: "en" },
|
|
341
357
|
playbackSpeed: { default: 1 }
|
|
342
358
|
},
|
|
343
359
|
emits: ["updatedPage", "update:audioLang", "update:textLang", "allCompleted"],
|
|
344
|
-
setup(
|
|
345
|
-
const
|
|
346
|
-
get: () =>
|
|
360
|
+
setup(a, { expose: d, emit: o }) {
|
|
361
|
+
const l = a, p = o, g = l.dataSet?.beats?.length ?? 0, t = $(l.initPage ?? 0), u = $(!0), n = $(), f = $(), h = B({
|
|
362
|
+
get: () => l.audioLang,
|
|
347
363
|
set: (s) => p("update:audioLang", s || "en")
|
|
348
|
-
}),
|
|
349
|
-
get: () =>
|
|
364
|
+
}), v = B({
|
|
365
|
+
get: () => l.textLang,
|
|
350
366
|
set: (s) => p("update:textLang", s || "en")
|
|
351
367
|
});
|
|
352
|
-
let
|
|
353
|
-
|
|
354
|
-
() =>
|
|
355
|
-
async (s,
|
|
356
|
-
if (s !==
|
|
357
|
-
|
|
358
|
-
const
|
|
359
|
-
if (
|
|
360
|
-
|
|
368
|
+
let x = 0;
|
|
369
|
+
_(
|
|
370
|
+
() => l.audioLang,
|
|
371
|
+
async (s, m) => {
|
|
372
|
+
if (s !== m && w.value) {
|
|
373
|
+
x++;
|
|
374
|
+
const S = x;
|
|
375
|
+
if (n.value?.stop(), await X(500), S !== x) return;
|
|
376
|
+
n.value && (w.value = !0, await n.value.play());
|
|
361
377
|
}
|
|
362
378
|
}
|
|
363
|
-
),
|
|
364
|
-
() =>
|
|
365
|
-
async (s,
|
|
366
|
-
s !==
|
|
379
|
+
), _(
|
|
380
|
+
() => l.textLang,
|
|
381
|
+
async (s, m) => {
|
|
382
|
+
s !== m && w.value && (await X(100), n.value && await n.value.play());
|
|
367
383
|
}
|
|
368
|
-
),
|
|
384
|
+
), _(f, (s) => {
|
|
369
385
|
s && (s.volume = 0.3);
|
|
370
386
|
});
|
|
371
|
-
const
|
|
372
|
-
|
|
387
|
+
const C = B(() => l.dataSet?.beats[t.value]), b = (s) => s ? l.basePath + "/" + s : "", P = B(() => b(l.dataSet?.bgmSource)), w = $(!1), V = () => {
|
|
388
|
+
w.value = !0, f.value && (f.value.volume = 0.3, f.value.play());
|
|
389
|
+
}, W = () => {
|
|
390
|
+
w.value = !1, f.value && f.value.pause();
|
|
391
|
+
}, J = async () => {
|
|
392
|
+
x++;
|
|
393
|
+
const s = x;
|
|
394
|
+
n.value?.stop(), await X(500), s === x && n.value && n.value.play();
|
|
395
|
+
}, H = (s) => {
|
|
396
|
+
t.value !== s && (t.value = s, w.value && u.value && J());
|
|
397
|
+
}, A = (s) => {
|
|
398
|
+
const m = t.value + s;
|
|
399
|
+
return m > -1 && m < g ? (H(m), p("updatedPage", m), !0) : !1;
|
|
373
400
|
}, F = () => {
|
|
374
|
-
|
|
375
|
-
},
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
},
|
|
380
|
-
|
|
381
|
-
}, B = (s) => {
|
|
382
|
-
const h = n.value + s;
|
|
383
|
-
return h > -1 && h < g ? (D(h), p("updatedPage", h), !0) : !1;
|
|
384
|
-
}, V = () => {
|
|
385
|
-
d.value && B(1) || (P.value = !1, f.value && f.value.pause(), p("allCompleted"));
|
|
386
|
-
}, U = {
|
|
387
|
-
onPlay: H,
|
|
388
|
-
onPause: F,
|
|
389
|
-
onEnded: V
|
|
390
|
-
}, y = E(() => {
|
|
391
|
-
const s = L.value, h = s?.audioSources?.[m.value], M = s?.multiLinguals?.[r.value] ?? s?.text ?? "", G = o.dataSet?.lang ? s?.multiLinguals?.[o.dataSet.lang] ?? s?.text ?? "" : "";
|
|
401
|
+
u.value && A(1) || (w.value = !1, f.value && f.value.pause(), p("allCompleted"));
|
|
402
|
+
}, K = {
|
|
403
|
+
onPlay: V,
|
|
404
|
+
onPause: W,
|
|
405
|
+
onEnded: F
|
|
406
|
+
}, E = B(() => {
|
|
407
|
+
const s = C.value, m = s?.audioSources?.[h.value], S = s?.multiLinguals?.[v.value] ?? s?.text ?? "", M = l.dataSet?.lang ? s?.multiLinguals?.[l.dataSet.lang] ?? s?.text ?? "" : "";
|
|
392
408
|
return {
|
|
393
409
|
videoWithAudioSource: b(s?.videoWithAudioSource),
|
|
394
410
|
videoSource: b(s?.videoSource),
|
|
395
411
|
soundEffectSource: b(s?.soundEffectSource),
|
|
396
|
-
audioSource: b(
|
|
412
|
+
audioSource: b(m),
|
|
397
413
|
imageSource: b(s?.imageSource),
|
|
398
|
-
index:
|
|
399
|
-
text:
|
|
400
|
-
originalText:
|
|
414
|
+
index: t.value,
|
|
415
|
+
text: S,
|
|
416
|
+
originalText: M,
|
|
401
417
|
duration: s?.duration,
|
|
402
|
-
defaultLang:
|
|
403
|
-
currentLang:
|
|
404
|
-
playbackSpeed:
|
|
405
|
-
...
|
|
418
|
+
defaultLang: l.dataSet?.lang,
|
|
419
|
+
currentLang: h.value,
|
|
420
|
+
playbackSpeed: l.playbackSpeed,
|
|
421
|
+
...K
|
|
406
422
|
};
|
|
407
|
-
}),
|
|
408
|
-
if (
|
|
409
|
-
const s =
|
|
423
|
+
}), G = B(() => l.dataSet?.beats[t.value + 1]), j = B(() => {
|
|
424
|
+
if (t.value + 1 >= g) return null;
|
|
425
|
+
const s = G.value;
|
|
410
426
|
return {
|
|
411
427
|
videoWithAudioSource: b(s?.videoWithAudioSource),
|
|
412
428
|
videoSource: b(s?.videoSource),
|
|
413
429
|
soundEffectSource: b(s?.soundEffectSource),
|
|
414
|
-
audioSource: b(s?.audioSources?.[
|
|
430
|
+
audioSource: b(s?.audioSources?.[h.value]),
|
|
415
431
|
imageSource: b(s?.imageSource),
|
|
416
|
-
index:
|
|
417
|
-
text: s?.multiLinguals?.[
|
|
432
|
+
index: t.value + 1,
|
|
433
|
+
text: s?.multiLinguals?.[v.value] ?? s?.text ?? "",
|
|
418
434
|
duration: s?.duration
|
|
419
435
|
};
|
|
420
|
-
}),
|
|
421
|
-
MulmoPlayer:
|
|
422
|
-
pageProps:
|
|
423
|
-
currentPage:
|
|
436
|
+
}), U = B(() => ({
|
|
437
|
+
MulmoPlayer: Y,
|
|
438
|
+
pageProps: E.value,
|
|
439
|
+
currentPage: t.value,
|
|
424
440
|
pageCount: g,
|
|
425
|
-
pageMove:
|
|
426
|
-
isPlaying:
|
|
427
|
-
audioLang:
|
|
428
|
-
textLang:
|
|
429
|
-
SelectLanguage:
|
|
430
|
-
mediaPlayerRef:
|
|
441
|
+
pageMove: A,
|
|
442
|
+
isPlaying: w.value,
|
|
443
|
+
audioLang: h,
|
|
444
|
+
textLang: v,
|
|
445
|
+
SelectLanguage: N,
|
|
446
|
+
mediaPlayerRef: n,
|
|
431
447
|
// Event handlers for direct access
|
|
432
|
-
handlePlay:
|
|
433
|
-
handlePause:
|
|
434
|
-
handleEnded:
|
|
448
|
+
handlePlay: V,
|
|
449
|
+
handlePause: W,
|
|
450
|
+
handleEnded: F
|
|
435
451
|
}));
|
|
436
|
-
return
|
|
437
|
-
updatePage:
|
|
438
|
-
}), (s,
|
|
439
|
-
|
|
440
|
-
e("div",
|
|
441
|
-
e("div",
|
|
442
|
-
e("div",
|
|
452
|
+
return d({
|
|
453
|
+
updatePage: H
|
|
454
|
+
}), (s, m) => (i(), r(D, null, [
|
|
455
|
+
q(s.$slots, "default", oe(me(U.value)), () => [
|
|
456
|
+
e("div", Xe, [
|
|
457
|
+
e("div", Ye, [
|
|
458
|
+
e("div", Ze, [
|
|
443
459
|
e("button", {
|
|
444
460
|
class: "col-start-1 row-start-1 justify-self-start w-auto px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600 disabled:opacity-50 self-center max-sm:row-start-2",
|
|
445
|
-
disabled:
|
|
446
|
-
onClick:
|
|
447
|
-
}, " Prev ", 8,
|
|
448
|
-
e("div",
|
|
449
|
-
|
|
461
|
+
disabled: t.value === 0,
|
|
462
|
+
onClick: m[0] || (m[0] = (S) => A(-1))
|
|
463
|
+
}, " Prev ", 8, Ie),
|
|
464
|
+
e("div", et, [
|
|
465
|
+
z(Y, le({
|
|
450
466
|
ref_key: "mediaPlayer",
|
|
451
|
-
ref:
|
|
452
|
-
}, { ...
|
|
467
|
+
ref: n
|
|
468
|
+
}, { ...E.value, text: "", originalText: "" }), null, 16)
|
|
453
469
|
]),
|
|
454
470
|
e("button", {
|
|
455
471
|
class: "col-start-3 row-start-1 justify-self-end w-auto px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600 disabled:opacity-50 self-center max-sm:col-start-2 max-sm:row-start-2",
|
|
456
|
-
disabled:
|
|
457
|
-
onClick:
|
|
458
|
-
}, " Next ", 8,
|
|
459
|
-
|
|
460
|
-
e("p",
|
|
461
|
-
|
|
472
|
+
disabled: t.value >= fe(g) - 1,
|
|
473
|
+
onClick: m[1] || (m[1] = (S) => A(1))
|
|
474
|
+
}, " Next ", 8, tt),
|
|
475
|
+
E.value.text ? (i(), r("div", at, [
|
|
476
|
+
e("p", ot, L(E.value.text), 1),
|
|
477
|
+
E.value.originalText && E.value.originalText !== E.value.text ? (i(), r("p", lt, L(E.value.originalText), 1)) : k("", !0)
|
|
462
478
|
])) : k("", !0)
|
|
463
479
|
])
|
|
464
480
|
])
|
|
465
481
|
])
|
|
466
482
|
], !0),
|
|
467
|
-
|
|
468
|
-
[
|
|
483
|
+
j.value ? ge((i(), I(Y, oe(le({ key: 0 }, j.value)), null, 16)), [
|
|
484
|
+
[pe, !1]
|
|
469
485
|
]) : k("", !0),
|
|
470
|
-
|
|
486
|
+
P.value ? (i(), r("audio", {
|
|
471
487
|
key: 1,
|
|
472
488
|
ref_key: "bgmRef",
|
|
473
489
|
ref: f,
|
|
474
|
-
src:
|
|
475
|
-
}, null, 8,
|
|
490
|
+
src: P.value
|
|
491
|
+
}, null, 8, nt)) : k("", !0)
|
|
476
492
|
], 64));
|
|
477
493
|
}
|
|
478
|
-
}),
|
|
494
|
+
}), Rt = /* @__PURE__ */ ue(st, [["__scopeId", "data-v-fdffe885"]]), it = { class: "container mx-auto px-4 py-2 sm:py-4" }, ut = { class: "flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2 sm:gap-4" }, rt = { class: "flex items-center gap-4 flex-wrap" }, dt = { class: "flex items-center gap-2 sm:gap-4 flex-wrap w-full sm:w-auto" }, ct = {
|
|
479
495
|
key: 0,
|
|
480
496
|
class: "hidden sm:flex items-center gap-3"
|
|
481
|
-
},
|
|
497
|
+
}, vt = ["value"], mt = {
|
|
482
498
|
key: 1,
|
|
483
499
|
class: "hidden sm:flex items-center gap-3"
|
|
484
|
-
},
|
|
500
|
+
}, ft = { class: "hidden sm:flex items-center gap-3" }, gt = { class: "flex items-center justify-between mb-4" }, pt = {
|
|
485
501
|
key: 0,
|
|
486
502
|
class: "space-y-2"
|
|
487
|
-
},
|
|
503
|
+
}, ht = ["value"], yt = {
|
|
488
504
|
key: 1,
|
|
489
505
|
class: "space-y-2"
|
|
490
|
-
},
|
|
506
|
+
}, xt = { class: "space-y-2" }, zt = /* @__PURE__ */ R({
|
|
491
507
|
__name: "mulmo_viewer_header",
|
|
492
508
|
props: {
|
|
493
509
|
audioLang: {},
|
|
@@ -500,147 +516,147 @@ const Q = async (t) => await new Promise((c) => setTimeout(c, t)), me = (t, c) =
|
|
|
500
516
|
sticky: { type: Boolean, default: !1 }
|
|
501
517
|
},
|
|
502
518
|
emits: ["update:audioLang", "update:textLang", "update:playbackSpeed", "update:showMobileSettings"],
|
|
503
|
-
setup(
|
|
504
|
-
return (
|
|
519
|
+
setup(a) {
|
|
520
|
+
return (d, o) => (i(), r(D, null, [
|
|
505
521
|
e("div", {
|
|
506
|
-
class:
|
|
522
|
+
class: ne(["bg-white shadow-md border-b border-gray-200", { "sticky top-0 z-50": a.sticky }])
|
|
507
523
|
}, [
|
|
508
|
-
e("div",
|
|
509
|
-
e("div",
|
|
510
|
-
e("div",
|
|
511
|
-
|
|
524
|
+
e("div", it, [
|
|
525
|
+
e("div", ut, [
|
|
526
|
+
e("div", rt, [
|
|
527
|
+
q(d.$slots, "left")
|
|
512
528
|
]),
|
|
513
|
-
e("div",
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
529
|
+
e("div", dt, [
|
|
530
|
+
q(d.$slots, "actions"),
|
|
531
|
+
a.hideDesktopControls ? k("", !0) : (i(), r(D, { key: 0 }, [
|
|
532
|
+
a.showSpeedControl ? (i(), r("div", ct, [
|
|
533
|
+
o[11] || (o[11] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide" }, "Speed:", -1)),
|
|
518
534
|
e("select", {
|
|
519
|
-
value:
|
|
535
|
+
value: a.playbackSpeed,
|
|
520
536
|
class: "px-3 py-2 border border-gray-300 rounded-lg bg-white text-gray-700 font-medium shadow-sm hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 transition-colors",
|
|
521
|
-
onChange:
|
|
522
|
-
}, [...
|
|
537
|
+
onChange: o[0] || (o[0] = (l) => d.$emit("update:playbackSpeed", Number(l.target.value)))
|
|
538
|
+
}, [...o[10] || (o[10] = [
|
|
523
539
|
e("option", { value: 1 }, "1x", -1),
|
|
524
540
|
e("option", { value: 1.25 }, "1.25x", -1),
|
|
525
541
|
e("option", { value: 1.5 }, "1.5x", -1),
|
|
526
542
|
e("option", { value: 1.75 }, "1.75x", -1),
|
|
527
543
|
e("option", { value: 2 }, "2x", -1)
|
|
528
|
-
])], 40,
|
|
544
|
+
])], 40, vt)
|
|
529
545
|
])) : k("", !0),
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
N
|
|
533
|
-
"model-value":
|
|
534
|
-
"onUpdate:modelValue":
|
|
546
|
+
a.showAudioLang ? (i(), r("div", mt, [
|
|
547
|
+
o[12] || (o[12] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide" }, "Audio:", -1)),
|
|
548
|
+
z(N, {
|
|
549
|
+
"model-value": a.audioLang,
|
|
550
|
+
"onUpdate:modelValue": o[1] || (o[1] = (l) => d.$emit("update:audioLang", l))
|
|
535
551
|
}, null, 8, ["model-value"])
|
|
536
552
|
])) : k("", !0),
|
|
537
|
-
e("div",
|
|
538
|
-
|
|
539
|
-
N
|
|
540
|
-
"model-value":
|
|
541
|
-
"onUpdate:modelValue":
|
|
553
|
+
e("div", ft, [
|
|
554
|
+
o[13] || (o[13] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide" }, "Text:", -1)),
|
|
555
|
+
z(N, {
|
|
556
|
+
"model-value": a.textLang,
|
|
557
|
+
"onUpdate:modelValue": o[2] || (o[2] = (l) => d.$emit("update:textLang", l))
|
|
542
558
|
}, null, 8, ["model-value"])
|
|
543
559
|
])
|
|
544
560
|
], 64)),
|
|
545
|
-
|
|
561
|
+
q(d.$slots, "mobile-actions")
|
|
546
562
|
])
|
|
547
563
|
])
|
|
548
564
|
])
|
|
549
565
|
], 2),
|
|
550
|
-
|
|
566
|
+
a.showMobileSettings ? (i(), r("div", {
|
|
551
567
|
key: 0,
|
|
552
568
|
class: "fixed inset-0 bg-black bg-opacity-50 z-50 sm:hidden",
|
|
553
|
-
onClick:
|
|
569
|
+
onClick: o[9] || (o[9] = (l) => d.$emit("update:showMobileSettings", !1))
|
|
554
570
|
}, [
|
|
555
571
|
e("div", {
|
|
556
572
|
class: "absolute bottom-0 left-0 right-0 bg-white rounded-t-2xl shadow-xl p-6 space-y-4",
|
|
557
|
-
onClick:
|
|
573
|
+
onClick: o[8] || (o[8] = he(() => {
|
|
558
574
|
}, ["stop"]))
|
|
559
575
|
}, [
|
|
560
|
-
e("div",
|
|
561
|
-
|
|
576
|
+
e("div", gt, [
|
|
577
|
+
o[14] || (o[14] = e("h2", { class: "text-xl font-bold text-gray-800" }, "Settings", -1)),
|
|
562
578
|
e("button", {
|
|
563
579
|
class: "text-gray-500 hover:text-gray-700 text-2xl",
|
|
564
|
-
onClick:
|
|
580
|
+
onClick: o[3] || (o[3] = (l) => d.$emit("update:showMobileSettings", !1))
|
|
565
581
|
}, " × ")
|
|
566
582
|
]),
|
|
567
|
-
|
|
568
|
-
|
|
583
|
+
a.showSpeedControl ? (i(), r("div", pt, [
|
|
584
|
+
o[16] || (o[16] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide block" }, "Playback Speed", -1)),
|
|
569
585
|
e("select", {
|
|
570
|
-
value:
|
|
586
|
+
value: a.playbackSpeed,
|
|
571
587
|
class: "w-full px-4 py-3 border border-gray-300 rounded-lg bg-white text-gray-700 font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500",
|
|
572
|
-
onChange:
|
|
573
|
-
}, [...
|
|
588
|
+
onChange: o[4] || (o[4] = (l) => d.$emit("update:playbackSpeed", Number(l.target.value)))
|
|
589
|
+
}, [...o[15] || (o[15] = [
|
|
574
590
|
e("option", { value: 1 }, "1x (Normal)", -1),
|
|
575
591
|
e("option", { value: 1.25 }, "1.25x", -1),
|
|
576
592
|
e("option", { value: 1.5 }, "1.5x", -1),
|
|
577
593
|
e("option", { value: 1.75 }, "1.75x", -1),
|
|
578
594
|
e("option", { value: 2 }, "2x (Double)", -1)
|
|
579
|
-
])], 40,
|
|
595
|
+
])], 40, ht)
|
|
580
596
|
])) : k("", !0),
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
N
|
|
584
|
-
"model-value":
|
|
597
|
+
a.showAudioLang ? (i(), r("div", yt, [
|
|
598
|
+
o[17] || (o[17] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide block" }, "Audio Language", -1)),
|
|
599
|
+
z(N, {
|
|
600
|
+
"model-value": a.audioLang,
|
|
585
601
|
class: "w-full",
|
|
586
|
-
"onUpdate:modelValue":
|
|
602
|
+
"onUpdate:modelValue": o[5] || (o[5] = (l) => d.$emit("update:audioLang", l))
|
|
587
603
|
}, null, 8, ["model-value"])
|
|
588
604
|
])) : k("", !0),
|
|
589
|
-
e("div",
|
|
590
|
-
|
|
591
|
-
N
|
|
592
|
-
"model-value":
|
|
605
|
+
e("div", xt, [
|
|
606
|
+
o[18] || (o[18] = e("label", { class: "text-sm font-semibold text-gray-700 uppercase tracking-wide block" }, "Text Language", -1)),
|
|
607
|
+
z(N, {
|
|
608
|
+
"model-value": a.textLang,
|
|
593
609
|
class: "w-full",
|
|
594
|
-
"onUpdate:modelValue":
|
|
610
|
+
"onUpdate:modelValue": o[6] || (o[6] = (l) => d.$emit("update:textLang", l))
|
|
595
611
|
}, null, 8, ["model-value"])
|
|
596
612
|
]),
|
|
597
613
|
e("button", {
|
|
598
614
|
class: "w-full px-4 py-3 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 font-medium shadow-sm transition-colors mt-4",
|
|
599
|
-
onClick:
|
|
615
|
+
onClick: o[7] || (o[7] = (l) => d.$emit("update:showMobileSettings", !1))
|
|
600
616
|
}, " Done ")
|
|
601
617
|
])
|
|
602
618
|
])) : k("", !0)
|
|
603
619
|
], 64));
|
|
604
620
|
}
|
|
605
|
-
}),
|
|
621
|
+
}), bt = { class: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6" }, kt = { class: "relative aspect-video bg-gray-200" }, wt = ["src", "alt"], St = { class: "absolute top-2 left-2 bg-black bg-opacity-70 text-white px-3 py-1 rounded-full text-sm font-semibold" }, $t = { class: "p-4" }, Lt = { class: "text-gray-700 text-sm line-clamp-3 group-hover:text-indigo-600 transition-colors" }, Pt = { class: "text-gray-500 text-xs mt-2 space-y-1" }, Ct = { key: 0 }, Et = { key: 1 }, Nt = /* @__PURE__ */ R({
|
|
606
622
|
__name: "beat_grid_view",
|
|
607
623
|
props: {
|
|
608
624
|
beats: {},
|
|
609
625
|
basePath: { default: "" },
|
|
610
626
|
textLang: { default: "en" },
|
|
611
|
-
linkUrlBuilder: {},
|
|
627
|
+
linkUrlBuilder: { type: Function, default: void 0 },
|
|
612
628
|
linkComponent: { default: "a" }
|
|
613
629
|
},
|
|
614
630
|
emits: ["beat-click"],
|
|
615
|
-
setup(
|
|
616
|
-
const
|
|
617
|
-
const f = Math.floor(
|
|
618
|
-
return f > 0 ? `${f}:${
|
|
619
|
-
}, g = (
|
|
620
|
-
|
|
631
|
+
setup(a, { emit: d }) {
|
|
632
|
+
const o = a, l = d, p = (n) => {
|
|
633
|
+
const f = Math.floor(n / 3600), h = Math.floor(n % 3600 / 60), v = Math.floor(n % 60);
|
|
634
|
+
return f > 0 ? `${f}:${h.toString().padStart(2, "0")}:${v.toString().padStart(2, "0")}` : `${h}:${v.toString().padStart(2, "0")}`;
|
|
635
|
+
}, g = (n) => n.multiLinguals?.[o.textLang] || n.text || "No text available", t = (n) => `${o.basePath}/${n + 1}.jpg`, u = (n, f) => {
|
|
636
|
+
o.linkComponent === "a" && o.linkUrlBuilder && f.preventDefault(), l("beat-click", n);
|
|
621
637
|
};
|
|
622
|
-
return (
|
|
623
|
-
(i(!0),
|
|
624
|
-
key:
|
|
625
|
-
to:
|
|
626
|
-
href:
|
|
638
|
+
return (n, f) => (i(), r("div", bt, [
|
|
639
|
+
(i(!0), r(D, null, Z(a.beats, ({ beat: h, originalIndex: v }) => (i(), I(se(a.linkComponent), {
|
|
640
|
+
key: v,
|
|
641
|
+
to: a.linkUrlBuilder ? a.linkUrlBuilder(v) : void 0,
|
|
642
|
+
href: a.linkUrlBuilder ? a.linkUrlBuilder(v) : void 0,
|
|
627
643
|
class: "group block bg-white rounded-lg shadow-md hover:shadow-xl transition-shadow duration-300 overflow-hidden",
|
|
628
|
-
onClick: (
|
|
644
|
+
onClick: (x) => u(v, x)
|
|
629
645
|
}, {
|
|
630
|
-
default:
|
|
631
|
-
e("div",
|
|
646
|
+
default: ie(() => [
|
|
647
|
+
e("div", kt, [
|
|
632
648
|
e("img", {
|
|
633
|
-
src:
|
|
634
|
-
alt: `Beat ${
|
|
649
|
+
src: t(v),
|
|
650
|
+
alt: `Beat ${v + 1}`,
|
|
635
651
|
class: "w-full h-full object-cover"
|
|
636
|
-
}, null, 8,
|
|
637
|
-
e("div",
|
|
652
|
+
}, null, 8, wt),
|
|
653
|
+
e("div", St, L(v + 1), 1)
|
|
638
654
|
]),
|
|
639
|
-
e("div",
|
|
640
|
-
e("p",
|
|
641
|
-
e("div",
|
|
642
|
-
|
|
643
|
-
|
|
655
|
+
e("div", $t, [
|
|
656
|
+
e("p", Lt, L(g(h)), 1),
|
|
657
|
+
e("div", Pt, [
|
|
658
|
+
h.startTime !== void 0 ? (i(), r("p", Ct, "Start: " + L(p(h.startTime)), 1)) : k("", !0),
|
|
659
|
+
h.duration ? (i(), r("p", Et, "Duration: " + L(p(h.duration)), 1)) : k("", !0)
|
|
644
660
|
])
|
|
645
661
|
])
|
|
646
662
|
]),
|
|
@@ -648,65 +664,65 @@ const Q = async (t) => await new Promise((c) => setTimeout(c, t)), me = (t, c) =
|
|
|
648
664
|
}, 1032, ["to", "href", "onClick"]))), 128))
|
|
649
665
|
]));
|
|
650
666
|
}
|
|
651
|
-
}),
|
|
667
|
+
}), Bt = { class: "space-y-6" }, Tt = ["id"], Mt = { class: "flex items-center gap-3 mb-2 flex-wrap" }, _t = { class: "bg-indigo-600 text-white px-4 py-1 rounded-full text-sm font-semibold" }, Vt = {
|
|
652
668
|
key: 0,
|
|
653
669
|
class: "text-gray-500 text-sm"
|
|
654
|
-
},
|
|
670
|
+
}, At = {
|
|
655
671
|
key: 1,
|
|
656
672
|
class: "text-gray-500 text-sm"
|
|
657
|
-
},
|
|
673
|
+
}, jt = ["src", "alt"], Ut = { class: "text-gray-800 text-base leading-relaxed font-sans" }, Wt = /* @__PURE__ */ R({
|
|
658
674
|
__name: "beat_list_view",
|
|
659
675
|
props: {
|
|
660
676
|
beats: {},
|
|
661
677
|
basePath: { default: "" },
|
|
662
678
|
textLang: { default: "en" },
|
|
663
|
-
linkUrlBuilder: {},
|
|
679
|
+
linkUrlBuilder: { type: Function, default: void 0 },
|
|
664
680
|
linkComponent: { default: "a" }
|
|
665
681
|
},
|
|
666
682
|
emits: ["beat-click"],
|
|
667
|
-
setup(
|
|
668
|
-
const
|
|
669
|
-
const f = Math.floor(
|
|
670
|
-
return f > 0 ? `${f}:${
|
|
671
|
-
}, g = (
|
|
672
|
-
|
|
683
|
+
setup(a, { emit: d }) {
|
|
684
|
+
const o = a, l = d, p = (n) => {
|
|
685
|
+
const f = Math.floor(n / 3600), h = Math.floor(n % 3600 / 60), v = Math.floor(n % 60);
|
|
686
|
+
return f > 0 ? `${f}:${h.toString().padStart(2, "0")}:${v.toString().padStart(2, "0")}` : `${h}:${v.toString().padStart(2, "0")}`;
|
|
687
|
+
}, g = (n) => n.multiLinguals?.[o.textLang] || n.text || "No text available", t = (n) => `${o.basePath}/${n + 1}.jpg`, u = (n, f) => {
|
|
688
|
+
o.linkComponent === "a" && o.linkUrlBuilder && f.preventDefault(), l("beat-click", n);
|
|
673
689
|
};
|
|
674
|
-
return (
|
|
675
|
-
(i(!0),
|
|
676
|
-
id: `beat-${
|
|
677
|
-
key:
|
|
690
|
+
return (n, f) => (i(), r("div", Bt, [
|
|
691
|
+
(i(!0), r(D, null, Z(a.beats, ({ beat: h, originalIndex: v }) => (i(), r("div", {
|
|
692
|
+
id: `beat-${v}`,
|
|
693
|
+
key: v,
|
|
678
694
|
class: "bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow"
|
|
679
695
|
}, [
|
|
680
|
-
(i(),
|
|
681
|
-
to:
|
|
682
|
-
href:
|
|
696
|
+
(i(), I(se(a.linkComponent), {
|
|
697
|
+
to: a.linkUrlBuilder ? a.linkUrlBuilder(v) : void 0,
|
|
698
|
+
href: a.linkUrlBuilder ? a.linkUrlBuilder(v) : void 0,
|
|
683
699
|
class: "float-left mr-4 mb-2 w-64 flex-shrink-0",
|
|
684
|
-
onClick: (
|
|
700
|
+
onClick: (x) => u(v, x)
|
|
685
701
|
}, {
|
|
686
|
-
default:
|
|
687
|
-
e("div",
|
|
688
|
-
e("span",
|
|
689
|
-
|
|
690
|
-
|
|
702
|
+
default: ie(() => [
|
|
703
|
+
e("div", Mt, [
|
|
704
|
+
e("span", _t, " #" + L(v + 1), 1),
|
|
705
|
+
h.startTime !== void 0 ? (i(), r("span", Vt, " Start: " + L(p(h.startTime)), 1)) : k("", !0),
|
|
706
|
+
h.duration ? (i(), r("span", At, " Duration: " + L(p(h.duration)), 1)) : k("", !0)
|
|
691
707
|
]),
|
|
692
708
|
e("img", {
|
|
693
|
-
src:
|
|
694
|
-
alt: `Beat ${
|
|
709
|
+
src: t(v),
|
|
710
|
+
alt: `Beat ${v + 1}`,
|
|
695
711
|
class: "w-full h-auto object-cover rounded-lg hover:opacity-80 transition-opacity shadow-sm"
|
|
696
|
-
}, null, 8,
|
|
712
|
+
}, null, 8, jt)
|
|
697
713
|
]),
|
|
698
714
|
_: 2
|
|
699
715
|
}, 1032, ["to", "href", "onClick"])),
|
|
700
|
-
e("p",
|
|
716
|
+
e("p", Ut, L(g(h)), 1),
|
|
701
717
|
f[0] || (f[0] = e("div", { class: "clear-both" }, null, -1))
|
|
702
|
-
], 8,
|
|
718
|
+
], 8, Tt))), 128))
|
|
703
719
|
]));
|
|
704
720
|
}
|
|
705
721
|
});
|
|
706
722
|
export {
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
723
|
+
Nt as BeatGridView,
|
|
724
|
+
Wt as BeatListView,
|
|
725
|
+
Rt as MulmoViewer,
|
|
726
|
+
zt as MulmoViewerHeader,
|
|
727
|
+
N as SelectLanguage
|
|
712
728
|
};
|