@aigamo/nostalgic-diva 1.19.2 → 1.19.3
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/AudioPlayer-B3HUFxrt.cjs +2 -0
- package/dist/AudioPlayer-B3HUFxrt.cjs.map +1 -0
- package/dist/AudioPlayer-D3YsODf_.js +34 -0
- package/dist/AudioPlayer-D3YsODf_.js.map +1 -0
- package/dist/DailymotionPlayer-BbM7QPqY.js +64 -0
- package/dist/DailymotionPlayer-BbM7QPqY.js.map +1 -0
- package/dist/DailymotionPlayer-CUowHniC.cjs +2 -0
- package/dist/DailymotionPlayer-CUowHniC.cjs.map +1 -0
- package/dist/NiconicoPlayer-BQO6a8Vb.js +35 -0
- package/dist/NiconicoPlayer-BQO6a8Vb.js.map +1 -0
- package/dist/NiconicoPlayer-DpSXQj5m.cjs +2 -0
- package/dist/NiconicoPlayer-DpSXQj5m.cjs.map +1 -0
- package/dist/SoundCloudPlayer-B8jkHu8t.js +42 -0
- package/dist/SoundCloudPlayer-B8jkHu8t.js.map +1 -0
- package/dist/SoundCloudPlayer-BV22QlM7.cjs +2 -0
- package/dist/SoundCloudPlayer-BV22QlM7.cjs.map +1 -0
- package/dist/TwitchPlayer-C9mAN-zs.js +39 -0
- package/dist/TwitchPlayer-C9mAN-zs.js.map +1 -0
- package/dist/TwitchPlayer-CAtEBZ_D.cjs +2 -0
- package/dist/TwitchPlayer-CAtEBZ_D.cjs.map +1 -0
- package/dist/VimeoPlayer-BeD9InZ2.cjs +2 -0
- package/dist/VimeoPlayer-BeD9InZ2.cjs.map +1 -0
- package/dist/VimeoPlayer-Dj_TPJOD.js +42 -0
- package/dist/VimeoPlayer-Dj_TPJOD.js.map +1 -0
- package/dist/YouTubePlayer-DLqd36LF.cjs +2 -0
- package/dist/YouTubePlayer-DLqd36LF.cjs.map +1 -0
- package/dist/YouTubePlayer-DnM2aTnC.js +38 -0
- package/dist/YouTubePlayer-DnM2aTnC.js.map +1 -0
- package/dist/ensureScriptLoaded-Blm1fjMc.cjs +2 -0
- package/dist/ensureScriptLoaded-Blm1fjMc.cjs.map +1 -0
- package/dist/ensureScriptLoaded-Jw9e6HLc.js +24 -0
- package/dist/ensureScriptLoaded-Jw9e6HLc.js.map +1 -0
- package/dist/index-D5CazY1_.js +1848 -0
- package/dist/index-D5CazY1_.js.map +1 -0
- package/dist/index-DFsUhc9i.cjs +15 -0
- package/dist/index-DFsUhc9i.cjs.map +1 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +25 -772
- package/dist/index.es.js.map +1 -1
- package/package.json +4 -4
- package/dist/AudioPlayer-CWI95ZSf.cjs +0 -2
- package/dist/AudioPlayer-CWI95ZSf.cjs.map +0 -1
- package/dist/AudioPlayer-Rgj403rr.js +0 -30
- package/dist/AudioPlayer-Rgj403rr.js.map +0 -1
- package/dist/DailymotionPlayer-CqYR3YjJ.cjs +0 -2
- package/dist/DailymotionPlayer-CqYR3YjJ.cjs.map +0 -1
- package/dist/DailymotionPlayer-DKnJvBrE.js +0 -60
- package/dist/DailymotionPlayer-DKnJvBrE.js.map +0 -1
- package/dist/NiconicoPlayer-BWepjJRp.js +0 -34
- package/dist/NiconicoPlayer-BWepjJRp.js.map +0 -1
- package/dist/NiconicoPlayer-DK-XPLSb.cjs +0 -2
- package/dist/NiconicoPlayer-DK-XPLSb.cjs.map +0 -1
- package/dist/PlayerContainer-CxyDj9x4.js +0 -690
- package/dist/PlayerContainer-CxyDj9x4.js.map +0 -1
- package/dist/PlayerContainer-LUwekvvj.cjs +0 -17
- package/dist/PlayerContainer-LUwekvvj.cjs.map +0 -1
- package/dist/SoundCloudPlayer-CIo1SPsW.js +0 -32
- package/dist/SoundCloudPlayer-CIo1SPsW.js.map +0 -1
- package/dist/SoundCloudPlayer-D1-SE7fO.cjs +0 -2
- package/dist/SoundCloudPlayer-D1-SE7fO.cjs.map +0 -1
- package/dist/TwitchPlayer-C-Zg7RPI.cjs +0 -2
- package/dist/TwitchPlayer-C-Zg7RPI.cjs.map +0 -1
- package/dist/TwitchPlayer-CipxSXDX.js +0 -33
- package/dist/TwitchPlayer-CipxSXDX.js.map +0 -1
- package/dist/VimeoPlayer-B2ew922s.cjs +0 -2
- package/dist/VimeoPlayer-B2ew922s.cjs.map +0 -1
- package/dist/VimeoPlayer-C-0MryDy.js +0 -32
- package/dist/VimeoPlayer-C-0MryDy.js.map +0 -1
- package/dist/YouTubePlayer-DXq_8Mrm.js +0 -35
- package/dist/YouTubePlayer-DXq_8Mrm.js.map +0 -1
- package/dist/YouTubePlayer-RHJqDD5s.cjs +0 -2
- package/dist/YouTubePlayer-RHJqDD5s.cjs.map +0 -1
- package/dist/ensureScriptLoaded-Bd04DRhn.js +0 -26
- package/dist/ensureScriptLoaded-Bd04DRhn.js.map +0 -1
- package/dist/ensureScriptLoaded-TVFV277C.cjs +0 -2
- package/dist/ensureScriptLoaded-TVFV277C.cjs.map +0 -1
|
@@ -0,0 +1,1848 @@
|
|
|
1
|
+
import Je, { createContext as Mt, useContext as At, useRef as L, useCallback as T, useMemo as Ot, lazy as U, memo as Ke, Suspense as jt, useState as je, useEffect as ue } from "react";
|
|
2
|
+
import Ut from "react-dom";
|
|
3
|
+
var Z = { exports: {} }, H = {};
|
|
4
|
+
var Ue;
|
|
5
|
+
function Ft() {
|
|
6
|
+
if (Ue) return H;
|
|
7
|
+
Ue = 1;
|
|
8
|
+
var n = Je, e = /* @__PURE__ */ Symbol.for("react.element"), r = /* @__PURE__ */ Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, c = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
9
|
+
function R(w, f, C) {
|
|
10
|
+
var b, P = {}, k = null, I = null;
|
|
11
|
+
C !== void 0 && (k = "" + C), f.key !== void 0 && (k = "" + f.key), f.ref !== void 0 && (I = f.ref);
|
|
12
|
+
for (b in f) o.call(f, b) && !m.hasOwnProperty(b) && (P[b] = f[b]);
|
|
13
|
+
if (w && w.defaultProps) for (b in f = w.defaultProps, f) P[b] === void 0 && (P[b] = f[b]);
|
|
14
|
+
return { $$typeof: e, type: w, key: k, ref: I, props: P, _owner: c.current };
|
|
15
|
+
}
|
|
16
|
+
return H.Fragment = r, H.jsx = R, H.jsxs = R, H;
|
|
17
|
+
}
|
|
18
|
+
var q = {};
|
|
19
|
+
var Fe;
|
|
20
|
+
function Yt() {
|
|
21
|
+
return Fe || (Fe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
22
|
+
var n = Je, e = /* @__PURE__ */ Symbol.for("react.element"), r = /* @__PURE__ */ Symbol.for("react.portal"), o = /* @__PURE__ */ Symbol.for("react.fragment"), c = /* @__PURE__ */ Symbol.for("react.strict_mode"), m = /* @__PURE__ */ Symbol.for("react.profiler"), R = /* @__PURE__ */ Symbol.for("react.provider"), w = /* @__PURE__ */ Symbol.for("react.context"), f = /* @__PURE__ */ Symbol.for("react.forward_ref"), C = /* @__PURE__ */ Symbol.for("react.suspense"), b = /* @__PURE__ */ Symbol.for("react.suspense_list"), P = /* @__PURE__ */ Symbol.for("react.memo"), k = /* @__PURE__ */ Symbol.for("react.lazy"), I = /* @__PURE__ */ Symbol.for("react.offscreen"), M = Symbol.iterator, x = "@@iterator";
|
|
23
|
+
function A(t) {
|
|
24
|
+
if (t === null || typeof t != "object")
|
|
25
|
+
return null;
|
|
26
|
+
var a = M && t[M] || t[x];
|
|
27
|
+
return typeof a == "function" ? a : null;
|
|
28
|
+
}
|
|
29
|
+
var E = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
30
|
+
function d(t) {
|
|
31
|
+
{
|
|
32
|
+
for (var a = arguments.length, i = new Array(a > 1 ? a - 1 : 0), s = 1; s < a; s++)
|
|
33
|
+
i[s - 1] = arguments[s];
|
|
34
|
+
Qe("error", t, i);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function Qe(t, a, i) {
|
|
38
|
+
{
|
|
39
|
+
var s = E.ReactDebugCurrentFrame, h = s.getStackAddendum();
|
|
40
|
+
h !== "" && (a += "%s", i = i.concat([h]));
|
|
41
|
+
var y = i.map(function(l) {
|
|
42
|
+
return String(l);
|
|
43
|
+
});
|
|
44
|
+
y.unshift("Warning: " + a), Function.prototype.apply.call(console[t], console, y);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
var et = !1, tt = !1, rt = !1, at = !1, nt = !1, he;
|
|
48
|
+
he = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
49
|
+
function it(t) {
|
|
50
|
+
return !!(typeof t == "string" || typeof t == "function" || t === o || t === m || nt || t === c || t === C || t === b || at || t === I || et || tt || rt || typeof t == "object" && t !== null && (t.$$typeof === k || t.$$typeof === P || t.$$typeof === R || t.$$typeof === w || t.$$typeof === f || // This needs to include all possible module reference object
|
|
51
|
+
// types supported by any Flight configuration anywhere since
|
|
52
|
+
// we don't know which Flight build this will end up being used
|
|
53
|
+
// with.
|
|
54
|
+
t.$$typeof === he || t.getModuleId !== void 0));
|
|
55
|
+
}
|
|
56
|
+
function st(t, a, i) {
|
|
57
|
+
var s = t.displayName;
|
|
58
|
+
if (s)
|
|
59
|
+
return s;
|
|
60
|
+
var h = a.displayName || a.name || "";
|
|
61
|
+
return h !== "" ? i + "(" + h + ")" : i;
|
|
62
|
+
}
|
|
63
|
+
function pe(t) {
|
|
64
|
+
return t.displayName || "Context";
|
|
65
|
+
}
|
|
66
|
+
function N(t) {
|
|
67
|
+
if (t == null)
|
|
68
|
+
return null;
|
|
69
|
+
if (typeof t.tag == "number" && d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
|
|
70
|
+
return t.displayName || t.name || null;
|
|
71
|
+
if (typeof t == "string")
|
|
72
|
+
return t;
|
|
73
|
+
switch (t) {
|
|
74
|
+
case o:
|
|
75
|
+
return "Fragment";
|
|
76
|
+
case r:
|
|
77
|
+
return "Portal";
|
|
78
|
+
case m:
|
|
79
|
+
return "Profiler";
|
|
80
|
+
case c:
|
|
81
|
+
return "StrictMode";
|
|
82
|
+
case C:
|
|
83
|
+
return "Suspense";
|
|
84
|
+
case b:
|
|
85
|
+
return "SuspenseList";
|
|
86
|
+
}
|
|
87
|
+
if (typeof t == "object")
|
|
88
|
+
switch (t.$$typeof) {
|
|
89
|
+
case w:
|
|
90
|
+
var a = t;
|
|
91
|
+
return pe(a) + ".Consumer";
|
|
92
|
+
case R:
|
|
93
|
+
var i = t;
|
|
94
|
+
return pe(i._context) + ".Provider";
|
|
95
|
+
case f:
|
|
96
|
+
return st(t, t.render, "ForwardRef");
|
|
97
|
+
case P:
|
|
98
|
+
var s = t.displayName || null;
|
|
99
|
+
return s !== null ? s : N(t.type) || "Memo";
|
|
100
|
+
case k: {
|
|
101
|
+
var h = t, y = h._payload, l = h._init;
|
|
102
|
+
try {
|
|
103
|
+
return N(l(y));
|
|
104
|
+
} catch {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
var O = Object.assign, G = 0, ye, fe, me, ve, ge, be, Ee;
|
|
112
|
+
function we() {
|
|
113
|
+
}
|
|
114
|
+
we.__reactDisabledLog = !0;
|
|
115
|
+
function ot() {
|
|
116
|
+
{
|
|
117
|
+
if (G === 0) {
|
|
118
|
+
ye = console.log, fe = console.info, me = console.warn, ve = console.error, ge = console.group, be = console.groupCollapsed, Ee = console.groupEnd;
|
|
119
|
+
var t = {
|
|
120
|
+
configurable: !0,
|
|
121
|
+
enumerable: !0,
|
|
122
|
+
value: we,
|
|
123
|
+
writable: !0
|
|
124
|
+
};
|
|
125
|
+
Object.defineProperties(console, {
|
|
126
|
+
info: t,
|
|
127
|
+
log: t,
|
|
128
|
+
warn: t,
|
|
129
|
+
error: t,
|
|
130
|
+
group: t,
|
|
131
|
+
groupCollapsed: t,
|
|
132
|
+
groupEnd: t
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
G++;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function ut() {
|
|
139
|
+
{
|
|
140
|
+
if (G--, G === 0) {
|
|
141
|
+
var t = {
|
|
142
|
+
configurable: !0,
|
|
143
|
+
enumerable: !0,
|
|
144
|
+
writable: !0
|
|
145
|
+
};
|
|
146
|
+
Object.defineProperties(console, {
|
|
147
|
+
log: O({}, t, {
|
|
148
|
+
value: ye
|
|
149
|
+
}),
|
|
150
|
+
info: O({}, t, {
|
|
151
|
+
value: fe
|
|
152
|
+
}),
|
|
153
|
+
warn: O({}, t, {
|
|
154
|
+
value: me
|
|
155
|
+
}),
|
|
156
|
+
error: O({}, t, {
|
|
157
|
+
value: ve
|
|
158
|
+
}),
|
|
159
|
+
group: O({}, t, {
|
|
160
|
+
value: ge
|
|
161
|
+
}),
|
|
162
|
+
groupCollapsed: O({}, t, {
|
|
163
|
+
value: be
|
|
164
|
+
}),
|
|
165
|
+
groupEnd: O({}, t, {
|
|
166
|
+
value: Ee
|
|
167
|
+
})
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
G < 0 && d("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
var ee = E.ReactCurrentDispatcher, te;
|
|
174
|
+
function J(t, a, i) {
|
|
175
|
+
{
|
|
176
|
+
if (te === void 0)
|
|
177
|
+
try {
|
|
178
|
+
throw Error();
|
|
179
|
+
} catch (h) {
|
|
180
|
+
var s = h.stack.trim().match(/\n( *(at )?)/);
|
|
181
|
+
te = s && s[1] || "";
|
|
182
|
+
}
|
|
183
|
+
return `
|
|
184
|
+
` + te + t;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
var re = !1, K;
|
|
188
|
+
{
|
|
189
|
+
var lt = typeof WeakMap == "function" ? WeakMap : Map;
|
|
190
|
+
K = new lt();
|
|
191
|
+
}
|
|
192
|
+
function Ce(t, a) {
|
|
193
|
+
if (!t || re)
|
|
194
|
+
return "";
|
|
195
|
+
{
|
|
196
|
+
var i = K.get(t);
|
|
197
|
+
if (i !== void 0)
|
|
198
|
+
return i;
|
|
199
|
+
}
|
|
200
|
+
var s;
|
|
201
|
+
re = !0;
|
|
202
|
+
var h = Error.prepareStackTrace;
|
|
203
|
+
Error.prepareStackTrace = void 0;
|
|
204
|
+
var y;
|
|
205
|
+
y = ee.current, ee.current = null, ot();
|
|
206
|
+
try {
|
|
207
|
+
if (a) {
|
|
208
|
+
var l = function() {
|
|
209
|
+
throw Error();
|
|
210
|
+
};
|
|
211
|
+
if (Object.defineProperty(l.prototype, "props", {
|
|
212
|
+
set: function() {
|
|
213
|
+
throw Error();
|
|
214
|
+
}
|
|
215
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
216
|
+
try {
|
|
217
|
+
Reflect.construct(l, []);
|
|
218
|
+
} catch (_) {
|
|
219
|
+
s = _;
|
|
220
|
+
}
|
|
221
|
+
Reflect.construct(t, [], l);
|
|
222
|
+
} else {
|
|
223
|
+
try {
|
|
224
|
+
l.call();
|
|
225
|
+
} catch (_) {
|
|
226
|
+
s = _;
|
|
227
|
+
}
|
|
228
|
+
t.call(l.prototype);
|
|
229
|
+
}
|
|
230
|
+
} else {
|
|
231
|
+
try {
|
|
232
|
+
throw Error();
|
|
233
|
+
} catch (_) {
|
|
234
|
+
s = _;
|
|
235
|
+
}
|
|
236
|
+
t();
|
|
237
|
+
}
|
|
238
|
+
} catch (_) {
|
|
239
|
+
if (_ && s && typeof _.stack == "string") {
|
|
240
|
+
for (var u = _.stack.split(`
|
|
241
|
+
`), D = s.stack.split(`
|
|
242
|
+
`), v = u.length - 1, g = D.length - 1; v >= 1 && g >= 0 && u[v] !== D[g]; )
|
|
243
|
+
g--;
|
|
244
|
+
for (; v >= 1 && g >= 0; v--, g--)
|
|
245
|
+
if (u[v] !== D[g]) {
|
|
246
|
+
if (v !== 1 || g !== 1)
|
|
247
|
+
do
|
|
248
|
+
if (v--, g--, g < 0 || u[v] !== D[g]) {
|
|
249
|
+
var S = `
|
|
250
|
+
` + u[v].replace(" at new ", " at ");
|
|
251
|
+
return t.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", t.displayName)), typeof t == "function" && K.set(t, S), S;
|
|
252
|
+
}
|
|
253
|
+
while (v >= 1 && g >= 0);
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
} finally {
|
|
258
|
+
re = !1, ee.current = y, ut(), Error.prepareStackTrace = h;
|
|
259
|
+
}
|
|
260
|
+
var W = t ? t.displayName || t.name : "", j = W ? J(W) : "";
|
|
261
|
+
return typeof t == "function" && K.set(t, j), j;
|
|
262
|
+
}
|
|
263
|
+
function ct(t, a, i) {
|
|
264
|
+
return Ce(t, !1);
|
|
265
|
+
}
|
|
266
|
+
function dt(t) {
|
|
267
|
+
var a = t.prototype;
|
|
268
|
+
return !!(a && a.isReactComponent);
|
|
269
|
+
}
|
|
270
|
+
function z(t, a, i) {
|
|
271
|
+
if (t == null)
|
|
272
|
+
return "";
|
|
273
|
+
if (typeof t == "function")
|
|
274
|
+
return Ce(t, dt(t));
|
|
275
|
+
if (typeof t == "string")
|
|
276
|
+
return J(t);
|
|
277
|
+
switch (t) {
|
|
278
|
+
case C:
|
|
279
|
+
return J("Suspense");
|
|
280
|
+
case b:
|
|
281
|
+
return J("SuspenseList");
|
|
282
|
+
}
|
|
283
|
+
if (typeof t == "object")
|
|
284
|
+
switch (t.$$typeof) {
|
|
285
|
+
case f:
|
|
286
|
+
return ct(t.render);
|
|
287
|
+
case P:
|
|
288
|
+
return z(t.type, a, i);
|
|
289
|
+
case k: {
|
|
290
|
+
var s = t, h = s._payload, y = s._init;
|
|
291
|
+
try {
|
|
292
|
+
return z(y(h), a, i);
|
|
293
|
+
} catch {
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
return "";
|
|
298
|
+
}
|
|
299
|
+
var B = Object.prototype.hasOwnProperty, Pe = {}, Te = E.ReactDebugCurrentFrame;
|
|
300
|
+
function X(t) {
|
|
301
|
+
if (t) {
|
|
302
|
+
var a = t._owner, i = z(t.type, t._source, a ? a.type : null);
|
|
303
|
+
Te.setExtraStackFrame(i);
|
|
304
|
+
} else
|
|
305
|
+
Te.setExtraStackFrame(null);
|
|
306
|
+
}
|
|
307
|
+
function ht(t, a, i, s, h) {
|
|
308
|
+
{
|
|
309
|
+
var y = Function.call.bind(B);
|
|
310
|
+
for (var l in t)
|
|
311
|
+
if (y(t, l)) {
|
|
312
|
+
var u = void 0;
|
|
313
|
+
try {
|
|
314
|
+
if (typeof t[l] != "function") {
|
|
315
|
+
var D = Error((s || "React class") + ": " + i + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
316
|
+
throw D.name = "Invariant Violation", D;
|
|
317
|
+
}
|
|
318
|
+
u = t[l](a, l, s, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
319
|
+
} catch (v) {
|
|
320
|
+
u = v;
|
|
321
|
+
}
|
|
322
|
+
u && !(u instanceof Error) && (X(h), d("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", s || "React class", i, l, typeof u), X(null)), u instanceof Error && !(u.message in Pe) && (Pe[u.message] = !0, X(h), d("Failed %s type: %s", i, u.message), X(null));
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
var pt = Array.isArray;
|
|
327
|
+
function ae(t) {
|
|
328
|
+
return pt(t);
|
|
329
|
+
}
|
|
330
|
+
function yt(t) {
|
|
331
|
+
{
|
|
332
|
+
var a = typeof Symbol == "function" && Symbol.toStringTag, i = a && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
333
|
+
return i;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
function ft(t) {
|
|
337
|
+
try {
|
|
338
|
+
return Re(t), !1;
|
|
339
|
+
} catch {
|
|
340
|
+
return !0;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
function Re(t) {
|
|
344
|
+
return "" + t;
|
|
345
|
+
}
|
|
346
|
+
function De(t) {
|
|
347
|
+
if (ft(t))
|
|
348
|
+
return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", yt(t)), Re(t);
|
|
349
|
+
}
|
|
350
|
+
var _e = E.ReactCurrentOwner, mt = {
|
|
351
|
+
key: !0,
|
|
352
|
+
ref: !0,
|
|
353
|
+
__self: !0,
|
|
354
|
+
__source: !0
|
|
355
|
+
}, ke, Se;
|
|
356
|
+
function vt(t) {
|
|
357
|
+
if (B.call(t, "ref")) {
|
|
358
|
+
var a = Object.getOwnPropertyDescriptor(t, "ref").get;
|
|
359
|
+
if (a && a.isReactWarning)
|
|
360
|
+
return !1;
|
|
361
|
+
}
|
|
362
|
+
return t.ref !== void 0;
|
|
363
|
+
}
|
|
364
|
+
function gt(t) {
|
|
365
|
+
if (B.call(t, "key")) {
|
|
366
|
+
var a = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
367
|
+
if (a && a.isReactWarning)
|
|
368
|
+
return !1;
|
|
369
|
+
}
|
|
370
|
+
return t.key !== void 0;
|
|
371
|
+
}
|
|
372
|
+
function bt(t, a) {
|
|
373
|
+
typeof t.ref == "string" && _e.current;
|
|
374
|
+
}
|
|
375
|
+
function Et(t, a) {
|
|
376
|
+
{
|
|
377
|
+
var i = function() {
|
|
378
|
+
ke || (ke = !0, d("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
|
|
379
|
+
};
|
|
380
|
+
i.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
381
|
+
get: i,
|
|
382
|
+
configurable: !0
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
function wt(t, a) {
|
|
387
|
+
{
|
|
388
|
+
var i = function() {
|
|
389
|
+
Se || (Se = !0, d("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
|
|
390
|
+
};
|
|
391
|
+
i.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
392
|
+
get: i,
|
|
393
|
+
configurable: !0
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
var Ct = function(t, a, i, s, h, y, l) {
|
|
398
|
+
var u = {
|
|
399
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
400
|
+
$$typeof: e,
|
|
401
|
+
// Built-in properties that belong on the element
|
|
402
|
+
type: t,
|
|
403
|
+
key: a,
|
|
404
|
+
ref: i,
|
|
405
|
+
props: l,
|
|
406
|
+
// Record the component responsible for creating this element.
|
|
407
|
+
_owner: y
|
|
408
|
+
};
|
|
409
|
+
return u._store = {}, Object.defineProperty(u._store, "validated", {
|
|
410
|
+
configurable: !1,
|
|
411
|
+
enumerable: !1,
|
|
412
|
+
writable: !0,
|
|
413
|
+
value: !1
|
|
414
|
+
}), Object.defineProperty(u, "_self", {
|
|
415
|
+
configurable: !1,
|
|
416
|
+
enumerable: !1,
|
|
417
|
+
writable: !1,
|
|
418
|
+
value: s
|
|
419
|
+
}), Object.defineProperty(u, "_source", {
|
|
420
|
+
configurable: !1,
|
|
421
|
+
enumerable: !1,
|
|
422
|
+
writable: !1,
|
|
423
|
+
value: h
|
|
424
|
+
}), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
|
|
425
|
+
};
|
|
426
|
+
function Pt(t, a, i, s, h) {
|
|
427
|
+
{
|
|
428
|
+
var y, l = {}, u = null, D = null;
|
|
429
|
+
i !== void 0 && (De(i), u = "" + i), gt(a) && (De(a.key), u = "" + a.key), vt(a) && (D = a.ref, bt(a, h));
|
|
430
|
+
for (y in a)
|
|
431
|
+
B.call(a, y) && !mt.hasOwnProperty(y) && (l[y] = a[y]);
|
|
432
|
+
if (t && t.defaultProps) {
|
|
433
|
+
var v = t.defaultProps;
|
|
434
|
+
for (y in v)
|
|
435
|
+
l[y] === void 0 && (l[y] = v[y]);
|
|
436
|
+
}
|
|
437
|
+
if (u || D) {
|
|
438
|
+
var g = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
439
|
+
u && Et(l, g), D && wt(l, g);
|
|
440
|
+
}
|
|
441
|
+
return Ct(t, u, D, h, s, _e.current, l);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
var ne = E.ReactCurrentOwner, Ve = E.ReactDebugCurrentFrame;
|
|
445
|
+
function $(t) {
|
|
446
|
+
if (t) {
|
|
447
|
+
var a = t._owner, i = z(t.type, t._source, a ? a.type : null);
|
|
448
|
+
Ve.setExtraStackFrame(i);
|
|
449
|
+
} else
|
|
450
|
+
Ve.setExtraStackFrame(null);
|
|
451
|
+
}
|
|
452
|
+
var ie;
|
|
453
|
+
ie = !1;
|
|
454
|
+
function se(t) {
|
|
455
|
+
return typeof t == "object" && t !== null && t.$$typeof === e;
|
|
456
|
+
}
|
|
457
|
+
function Ie() {
|
|
458
|
+
{
|
|
459
|
+
if (ne.current) {
|
|
460
|
+
var t = N(ne.current.type);
|
|
461
|
+
if (t)
|
|
462
|
+
return `
|
|
463
|
+
|
|
464
|
+
Check the render method of \`` + t + "`.";
|
|
465
|
+
}
|
|
466
|
+
return "";
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
function Tt(t) {
|
|
470
|
+
return "";
|
|
471
|
+
}
|
|
472
|
+
var xe = {};
|
|
473
|
+
function Rt(t) {
|
|
474
|
+
{
|
|
475
|
+
var a = Ie();
|
|
476
|
+
if (!a) {
|
|
477
|
+
var i = typeof t == "string" ? t : t.displayName || t.name;
|
|
478
|
+
i && (a = `
|
|
479
|
+
|
|
480
|
+
Check the top-level render call using <` + i + ">.");
|
|
481
|
+
}
|
|
482
|
+
return a;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
function Ne(t, a) {
|
|
486
|
+
{
|
|
487
|
+
if (!t._store || t._store.validated || t.key != null)
|
|
488
|
+
return;
|
|
489
|
+
t._store.validated = !0;
|
|
490
|
+
var i = Rt(a);
|
|
491
|
+
if (xe[i])
|
|
492
|
+
return;
|
|
493
|
+
xe[i] = !0;
|
|
494
|
+
var s = "";
|
|
495
|
+
t && t._owner && t._owner !== ne.current && (s = " It was passed a child from " + N(t._owner.type) + "."), $(t), d('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, s), $(null);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
function Me(t, a) {
|
|
499
|
+
{
|
|
500
|
+
if (typeof t != "object")
|
|
501
|
+
return;
|
|
502
|
+
if (ae(t))
|
|
503
|
+
for (var i = 0; i < t.length; i++) {
|
|
504
|
+
var s = t[i];
|
|
505
|
+
se(s) && Ne(s, a);
|
|
506
|
+
}
|
|
507
|
+
else if (se(t))
|
|
508
|
+
t._store && (t._store.validated = !0);
|
|
509
|
+
else if (t) {
|
|
510
|
+
var h = A(t);
|
|
511
|
+
if (typeof h == "function" && h !== t.entries)
|
|
512
|
+
for (var y = h.call(t), l; !(l = y.next()).done; )
|
|
513
|
+
se(l.value) && Ne(l.value, a);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
function Dt(t) {
|
|
518
|
+
{
|
|
519
|
+
var a = t.type;
|
|
520
|
+
if (a == null || typeof a == "string")
|
|
521
|
+
return;
|
|
522
|
+
var i;
|
|
523
|
+
if (typeof a == "function")
|
|
524
|
+
i = a.propTypes;
|
|
525
|
+
else if (typeof a == "object" && (a.$$typeof === f || // Note: Memo only checks outer props here.
|
|
526
|
+
// Inner props are checked in the reconciler.
|
|
527
|
+
a.$$typeof === P))
|
|
528
|
+
i = a.propTypes;
|
|
529
|
+
else
|
|
530
|
+
return;
|
|
531
|
+
if (i) {
|
|
532
|
+
var s = N(a);
|
|
533
|
+
ht(i, t.props, "prop", s, t);
|
|
534
|
+
} else if (a.PropTypes !== void 0 && !ie) {
|
|
535
|
+
ie = !0;
|
|
536
|
+
var h = N(a);
|
|
537
|
+
d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", h || "Unknown");
|
|
538
|
+
}
|
|
539
|
+
typeof a.getDefaultProps == "function" && !a.getDefaultProps.isReactClassApproved && d("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
function _t(t) {
|
|
543
|
+
{
|
|
544
|
+
for (var a = Object.keys(t.props), i = 0; i < a.length; i++) {
|
|
545
|
+
var s = a[i];
|
|
546
|
+
if (s !== "children" && s !== "key") {
|
|
547
|
+
$(t), d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), $(null);
|
|
548
|
+
break;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
t.ref !== null && ($(t), d("Invalid attribute `ref` supplied to `React.Fragment`."), $(null));
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
var Ae = {};
|
|
555
|
+
function Oe(t, a, i, s, h, y) {
|
|
556
|
+
{
|
|
557
|
+
var l = it(t);
|
|
558
|
+
if (!l) {
|
|
559
|
+
var u = "";
|
|
560
|
+
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (u += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
561
|
+
var D = Tt();
|
|
562
|
+
D ? u += D : u += Ie();
|
|
563
|
+
var v;
|
|
564
|
+
t === null ? v = "null" : ae(t) ? v = "array" : t !== void 0 && t.$$typeof === e ? (v = "<" + (N(t.type) || "Unknown") + " />", u = " Did you accidentally export a JSX literal instead of a component?") : v = typeof t, d("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", v, u);
|
|
565
|
+
}
|
|
566
|
+
var g = Pt(t, a, i, h, y);
|
|
567
|
+
if (g == null)
|
|
568
|
+
return g;
|
|
569
|
+
if (l) {
|
|
570
|
+
var S = a.children;
|
|
571
|
+
if (S !== void 0)
|
|
572
|
+
if (s)
|
|
573
|
+
if (ae(S)) {
|
|
574
|
+
for (var W = 0; W < S.length; W++)
|
|
575
|
+
Me(S[W], t);
|
|
576
|
+
Object.freeze && Object.freeze(S);
|
|
577
|
+
} else
|
|
578
|
+
d("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
579
|
+
else
|
|
580
|
+
Me(S, t);
|
|
581
|
+
}
|
|
582
|
+
if (B.call(a, "key")) {
|
|
583
|
+
var j = N(t), _ = Object.keys(a).filter(function(Nt) {
|
|
584
|
+
return Nt !== "key";
|
|
585
|
+
}), oe = _.length > 0 ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
586
|
+
if (!Ae[j + oe]) {
|
|
587
|
+
var xt = _.length > 0 ? "{" + _.join(": ..., ") + ": ...}" : "{}";
|
|
588
|
+
d(`A props object containing a "key" prop is being spread into JSX:
|
|
589
|
+
let props = %s;
|
|
590
|
+
<%s {...props} />
|
|
591
|
+
React keys must be passed directly to JSX without using spread:
|
|
592
|
+
let props = %s;
|
|
593
|
+
<%s key={someKey} {...props} />`, oe, j, xt, j), Ae[j + oe] = !0;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
return t === o ? _t(g) : Dt(g), g;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
function kt(t, a, i) {
|
|
600
|
+
return Oe(t, a, i, !0);
|
|
601
|
+
}
|
|
602
|
+
function St(t, a, i) {
|
|
603
|
+
return Oe(t, a, i, !1);
|
|
604
|
+
}
|
|
605
|
+
var Vt = St, It = kt;
|
|
606
|
+
q.Fragment = o, q.jsx = Vt, q.jsxs = It;
|
|
607
|
+
})()), q;
|
|
608
|
+
}
|
|
609
|
+
var Ye;
|
|
610
|
+
function $t() {
|
|
611
|
+
return Ye || (Ye = 1, process.env.NODE_ENV === "production" ? Z.exports = Ft() : Z.exports = Yt()), Z.exports;
|
|
612
|
+
}
|
|
613
|
+
var V = $t(), p = /* @__PURE__ */ ((n) => (n[n.Trace = 0] = "Trace", n[n.Debug = 1] = "Debug", n[n.Information = 2] = "Information", n[n.Warning = 3] = "Warning", n[n.Error = 4] = "Error", n[n.Critical = 5] = "Critical", n[n.None = 6] = "None", n))(p || {});
|
|
614
|
+
class Wt {
|
|
615
|
+
title = "nostalgic-diva";
|
|
616
|
+
createMessage(e) {
|
|
617
|
+
return `[${this.title}] ${e}`;
|
|
618
|
+
}
|
|
619
|
+
debug(e, ...r) {
|
|
620
|
+
console.debug(this.createMessage(e), ...r);
|
|
621
|
+
}
|
|
622
|
+
error(e, ...r) {
|
|
623
|
+
console.error(this.createMessage(e), ...r);
|
|
624
|
+
}
|
|
625
|
+
warn(e, ...r) {
|
|
626
|
+
console.warn(this.createMessage(e), ...r);
|
|
627
|
+
}
|
|
628
|
+
isEnabled() {
|
|
629
|
+
return !0;
|
|
630
|
+
}
|
|
631
|
+
log(e, r, ...o) {
|
|
632
|
+
switch (e) {
|
|
633
|
+
case 1:
|
|
634
|
+
this.debug(r, ...o);
|
|
635
|
+
break;
|
|
636
|
+
case 3:
|
|
637
|
+
this.warn(r, ...o);
|
|
638
|
+
break;
|
|
639
|
+
case 4:
|
|
640
|
+
this.error(r, ...o);
|
|
641
|
+
break;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
const Lt = new Wt();
|
|
646
|
+
class Gt {
|
|
647
|
+
async attach() {
|
|
648
|
+
}
|
|
649
|
+
async detach() {
|
|
650
|
+
}
|
|
651
|
+
async loadVideo(e) {
|
|
652
|
+
}
|
|
653
|
+
async play() {
|
|
654
|
+
}
|
|
655
|
+
async pause() {
|
|
656
|
+
}
|
|
657
|
+
async setCurrentTime(e) {
|
|
658
|
+
}
|
|
659
|
+
async setVolume(e) {
|
|
660
|
+
}
|
|
661
|
+
async setMuted(e) {
|
|
662
|
+
}
|
|
663
|
+
async setPlaybackRate(e) {
|
|
664
|
+
}
|
|
665
|
+
async getDuration() {
|
|
666
|
+
return 0;
|
|
667
|
+
}
|
|
668
|
+
async getCurrentTime() {
|
|
669
|
+
return 0;
|
|
670
|
+
}
|
|
671
|
+
async getVolume() {
|
|
672
|
+
return 0;
|
|
673
|
+
}
|
|
674
|
+
async getMuted() {
|
|
675
|
+
return !1;
|
|
676
|
+
}
|
|
677
|
+
async getPlaybackRate() {
|
|
678
|
+
return 0;
|
|
679
|
+
}
|
|
680
|
+
supports(e) {
|
|
681
|
+
return !1;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
const Q = new Gt(), ze = Mt(
|
|
685
|
+
void 0
|
|
686
|
+
), Bt = ({
|
|
687
|
+
children: n,
|
|
688
|
+
logger: e = Lt
|
|
689
|
+
}) => {
|
|
690
|
+
const r = L(Q), o = T(
|
|
691
|
+
(d) => {
|
|
692
|
+
e.log(
|
|
693
|
+
p.Debug,
|
|
694
|
+
"NostalgicDivaProvider.handleControllerChange",
|
|
695
|
+
r.current,
|
|
696
|
+
d
|
|
697
|
+
), r.current = d;
|
|
698
|
+
},
|
|
699
|
+
[e]
|
|
700
|
+
), c = T(
|
|
701
|
+
async (d) => {
|
|
702
|
+
e.log(
|
|
703
|
+
p.Debug,
|
|
704
|
+
"NostalgicDivaProvider.loadVideo",
|
|
705
|
+
r.current
|
|
706
|
+
), await r.current.loadVideo(d);
|
|
707
|
+
},
|
|
708
|
+
[e]
|
|
709
|
+
), m = T(async () => {
|
|
710
|
+
e.log(
|
|
711
|
+
p.Debug,
|
|
712
|
+
"NostalgicDivaProvider.play",
|
|
713
|
+
r.current
|
|
714
|
+
), await r.current.play();
|
|
715
|
+
}, [e]), R = T(async () => {
|
|
716
|
+
e.log(
|
|
717
|
+
p.Debug,
|
|
718
|
+
"NostalgicDivaProvider.pause",
|
|
719
|
+
r.current
|
|
720
|
+
), await r.current.pause();
|
|
721
|
+
}, [e]), w = T(
|
|
722
|
+
async (d) => {
|
|
723
|
+
e.log(
|
|
724
|
+
p.Debug,
|
|
725
|
+
"NostalgicDivaProvider.setCurrentTime",
|
|
726
|
+
r.current
|
|
727
|
+
), await r.current.setCurrentTime(d), await r.current.play();
|
|
728
|
+
},
|
|
729
|
+
[e]
|
|
730
|
+
), f = T(
|
|
731
|
+
async (d) => {
|
|
732
|
+
e.log(
|
|
733
|
+
p.Debug,
|
|
734
|
+
"NostalgicDivaProvider.setVolume",
|
|
735
|
+
r.current
|
|
736
|
+
), await r.current.setVolume(d);
|
|
737
|
+
},
|
|
738
|
+
[e]
|
|
739
|
+
), C = T(
|
|
740
|
+
async (d) => {
|
|
741
|
+
e.log(
|
|
742
|
+
p.Debug,
|
|
743
|
+
"NostalgicDivaProvider.setMuted",
|
|
744
|
+
r.current
|
|
745
|
+
), await r.current.setMuted(d);
|
|
746
|
+
},
|
|
747
|
+
[e]
|
|
748
|
+
), b = T(
|
|
749
|
+
async (d) => {
|
|
750
|
+
e.log(
|
|
751
|
+
p.Debug,
|
|
752
|
+
"NostalgicDivaProvider.setPlaybackRate",
|
|
753
|
+
r.current
|
|
754
|
+
), await r.current.setPlaybackRate(d);
|
|
755
|
+
},
|
|
756
|
+
[e]
|
|
757
|
+
), P = T(async () => (e.log(
|
|
758
|
+
p.Debug,
|
|
759
|
+
"NostalgicDivaProvider.getDuration",
|
|
760
|
+
r.current
|
|
761
|
+
), await r.current.getDuration()), [e]), k = T(async () => (e.log(
|
|
762
|
+
p.Debug,
|
|
763
|
+
"NostalgicDivaProvider.getCurrentTime",
|
|
764
|
+
r.current
|
|
765
|
+
), await r.current.getCurrentTime()), [e]), I = T(async () => (e.log(
|
|
766
|
+
p.Debug,
|
|
767
|
+
"NostalgicDivaProvider.getVolume",
|
|
768
|
+
r.current
|
|
769
|
+
), await r.current.getVolume()), [e]), M = T(async () => (e.log(
|
|
770
|
+
p.Debug,
|
|
771
|
+
"NostalgicDivaProvider.getMuted",
|
|
772
|
+
r.current
|
|
773
|
+
), await r.current.getMuted()), [e]), x = T(async () => (e.log(
|
|
774
|
+
p.Debug,
|
|
775
|
+
"NostalgicDivaProvider.getPlaybackRate",
|
|
776
|
+
r.current
|
|
777
|
+
), await r.current.getPlaybackRate()), [e]), A = T(
|
|
778
|
+
(d) => r.current.supports(d),
|
|
779
|
+
[]
|
|
780
|
+
), E = Ot(
|
|
781
|
+
() => ({
|
|
782
|
+
logger: e,
|
|
783
|
+
handleControllerChange: o,
|
|
784
|
+
loadVideo: c,
|
|
785
|
+
play: m,
|
|
786
|
+
pause: R,
|
|
787
|
+
setCurrentTime: w,
|
|
788
|
+
setVolume: f,
|
|
789
|
+
setMuted: C,
|
|
790
|
+
setPlaybackRate: b,
|
|
791
|
+
getDuration: P,
|
|
792
|
+
getCurrentTime: k,
|
|
793
|
+
getVolume: I,
|
|
794
|
+
getMuted: M,
|
|
795
|
+
getPlaybackRate: x,
|
|
796
|
+
supports: A
|
|
797
|
+
}),
|
|
798
|
+
[
|
|
799
|
+
e,
|
|
800
|
+
o,
|
|
801
|
+
c,
|
|
802
|
+
m,
|
|
803
|
+
R,
|
|
804
|
+
w,
|
|
805
|
+
f,
|
|
806
|
+
C,
|
|
807
|
+
b,
|
|
808
|
+
P,
|
|
809
|
+
k,
|
|
810
|
+
I,
|
|
811
|
+
M,
|
|
812
|
+
x,
|
|
813
|
+
A
|
|
814
|
+
]
|
|
815
|
+
);
|
|
816
|
+
return /* @__PURE__ */ V.jsx(ze.Provider, { value: E, children: n });
|
|
817
|
+
}, Ht = () => At(ze);
|
|
818
|
+
class F {
|
|
819
|
+
constructor(e) {
|
|
820
|
+
this.type = e;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
const qt = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i, Jt = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i;
|
|
824
|
+
class Kt extends F {
|
|
825
|
+
constructor() {
|
|
826
|
+
super("Audio");
|
|
827
|
+
}
|
|
828
|
+
canPlay(e) {
|
|
829
|
+
return qt.test(e) || Jt.test(e);
|
|
830
|
+
}
|
|
831
|
+
extractVideoId(e) {
|
|
832
|
+
return e;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
const $e = /^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/;
|
|
836
|
+
class zt extends F {
|
|
837
|
+
constructor() {
|
|
838
|
+
super("Dailymotion");
|
|
839
|
+
}
|
|
840
|
+
canPlay(e) {
|
|
841
|
+
return $e.test(e);
|
|
842
|
+
}
|
|
843
|
+
extractVideoId(e) {
|
|
844
|
+
return $e.exec(e)?.[1];
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
const We = /(?:www\.|)?nicovideo\.jp\/watch\/(\w+)$/;
|
|
848
|
+
class Xt extends F {
|
|
849
|
+
constructor() {
|
|
850
|
+
super("Niconico");
|
|
851
|
+
}
|
|
852
|
+
canPlay(e) {
|
|
853
|
+
return We.test(e);
|
|
854
|
+
}
|
|
855
|
+
extractVideoId(e) {
|
|
856
|
+
return We.exec(e)?.[1];
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
const Zt = /(?:soundcloud\.com|snd\.sc)\/[^.]+$/;
|
|
860
|
+
class Qt extends F {
|
|
861
|
+
constructor() {
|
|
862
|
+
super("SoundCloud");
|
|
863
|
+
}
|
|
864
|
+
canPlay(e) {
|
|
865
|
+
return Zt.test(e);
|
|
866
|
+
}
|
|
867
|
+
extractVideoId(e) {
|
|
868
|
+
return e;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
const Le = /(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/;
|
|
872
|
+
class er extends F {
|
|
873
|
+
constructor() {
|
|
874
|
+
super("Twitch");
|
|
875
|
+
}
|
|
876
|
+
canPlay(e) {
|
|
877
|
+
return Le.test(e);
|
|
878
|
+
}
|
|
879
|
+
extractVideoId(e) {
|
|
880
|
+
return Le.exec(e)?.[1];
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
const Ge = /vimeo\.com\/(\d+)$/;
|
|
884
|
+
class tr extends F {
|
|
885
|
+
constructor() {
|
|
886
|
+
super("Vimeo");
|
|
887
|
+
}
|
|
888
|
+
canPlay(e) {
|
|
889
|
+
return Ge.test(e);
|
|
890
|
+
}
|
|
891
|
+
extractVideoId(e) {
|
|
892
|
+
return Ge.exec(e)?.[1];
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
const Be = /(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//;
|
|
896
|
+
class rr extends F {
|
|
897
|
+
constructor() {
|
|
898
|
+
super("YouTube");
|
|
899
|
+
}
|
|
900
|
+
canPlay(e) {
|
|
901
|
+
return Be.test(e);
|
|
902
|
+
}
|
|
903
|
+
extractVideoId(e) {
|
|
904
|
+
return Be.exec(e)?.[1];
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
const ar = [
|
|
908
|
+
new rr(),
|
|
909
|
+
new er(),
|
|
910
|
+
new tr(),
|
|
911
|
+
new zt(),
|
|
912
|
+
new Qt(),
|
|
913
|
+
new Kt(),
|
|
914
|
+
new Xt()
|
|
915
|
+
];
|
|
916
|
+
function nr(n) {
|
|
917
|
+
return ar.find((e) => e.canPlay(n));
|
|
918
|
+
}
|
|
919
|
+
const ir = new Map(
|
|
920
|
+
Object.entries({
|
|
921
|
+
Audio: U(() => import("./AudioPlayer-D3YsODf_.js")),
|
|
922
|
+
Dailymotion: U(() => import("./DailymotionPlayer-BbM7QPqY.js")),
|
|
923
|
+
Niconico: U(() => import("./NiconicoPlayer-BQO6a8Vb.js")),
|
|
924
|
+
SoundCloud: U(() => import("./SoundCloudPlayer-B8jkHu8t.js")),
|
|
925
|
+
Twitch: U(() => import("./TwitchPlayer-C9mAN-zs.js")),
|
|
926
|
+
Vimeo: U(() => import("./VimeoPlayer-Dj_TPJOD.js")),
|
|
927
|
+
YouTube: U(() => import("./YouTubePlayer-DnM2aTnC.js"))
|
|
928
|
+
})
|
|
929
|
+
);
|
|
930
|
+
function sr(n) {
|
|
931
|
+
const e = nr(n);
|
|
932
|
+
if (e === void 0)
|
|
933
|
+
return;
|
|
934
|
+
const { type: r, extractVideoId: o } = e, c = o(n);
|
|
935
|
+
if (c !== void 0)
|
|
936
|
+
return { type: r, videoId: c };
|
|
937
|
+
}
|
|
938
|
+
const He = Ke(() => /* @__PURE__ */ V.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ V.jsx(
|
|
939
|
+
"iframe",
|
|
940
|
+
{
|
|
941
|
+
src: "about:blank",
|
|
942
|
+
title: "about:blank",
|
|
943
|
+
style: {
|
|
944
|
+
width: "100%",
|
|
945
|
+
height: "100%",
|
|
946
|
+
border: 0
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
) })), or = Ke(
|
|
950
|
+
({
|
|
951
|
+
src: n,
|
|
952
|
+
options: e,
|
|
953
|
+
onControllerChange: r
|
|
954
|
+
}) => {
|
|
955
|
+
const o = Ht(), c = T(
|
|
956
|
+
(C) => {
|
|
957
|
+
o.handleControllerChange(C), r?.(C);
|
|
958
|
+
},
|
|
959
|
+
[o, r]
|
|
960
|
+
);
|
|
961
|
+
o.logger.log(p.Debug, "NostalgicDiva");
|
|
962
|
+
const m = sr(n);
|
|
963
|
+
if (m === void 0)
|
|
964
|
+
return o.logger.log(
|
|
965
|
+
p.Warning,
|
|
966
|
+
`Failed to extract type and videoId from src: "${n}". Returning EmptyPlayer.`
|
|
967
|
+
), /* @__PURE__ */ V.jsx(He, {});
|
|
968
|
+
const { type: R, videoId: w } = m, f = ir.get(R);
|
|
969
|
+
return f === void 0 ? (o.logger.log(
|
|
970
|
+
p.Warning,
|
|
971
|
+
`No player found for type "${R}" (videoId: "${w}"). Returning EmptyPlayer.`
|
|
972
|
+
), /* @__PURE__ */ V.jsx(He, {})) : /* @__PURE__ */ V.jsx(jt, { fallback: null, children: /* @__PURE__ */ V.jsx(
|
|
973
|
+
f,
|
|
974
|
+
{
|
|
975
|
+
logger: o.logger,
|
|
976
|
+
type: R,
|
|
977
|
+
onControllerChange: c,
|
|
978
|
+
videoId: w,
|
|
979
|
+
options: e
|
|
980
|
+
}
|
|
981
|
+
) });
|
|
982
|
+
}
|
|
983
|
+
);
|
|
984
|
+
class ur extends HTMLElement {
|
|
985
|
+
static observedAttributes = ["src"];
|
|
986
|
+
container;
|
|
987
|
+
controller = Q;
|
|
988
|
+
constructor() {
|
|
989
|
+
super(), this.container = this.attachShadow({ mode: "closed" });
|
|
990
|
+
}
|
|
991
|
+
get src() {
|
|
992
|
+
return this.getAttribute("src") ?? "";
|
|
993
|
+
}
|
|
994
|
+
set src(e) {
|
|
995
|
+
this.setAttribute("src", e);
|
|
996
|
+
}
|
|
997
|
+
#t = {
|
|
998
|
+
onError: (e) => this.dispatchEvent(new CustomEvent("error", { detail: e })),
|
|
999
|
+
onLoaded: (e) => this.dispatchEvent(new CustomEvent("loaded", { detail: e })),
|
|
1000
|
+
onPlay: () => this.dispatchEvent(new CustomEvent("play")),
|
|
1001
|
+
onPause: () => this.dispatchEvent(new CustomEvent("pause")),
|
|
1002
|
+
onEnded: () => this.dispatchEvent(new CustomEvent("ended")),
|
|
1003
|
+
onTimeUpdate: (e) => this.dispatchEvent(new CustomEvent("timeupdate", { detail: e }))
|
|
1004
|
+
};
|
|
1005
|
+
#r = (e) => {
|
|
1006
|
+
console.debug(
|
|
1007
|
+
"[@nostalgic-diva/web-components] handleControllerChange"
|
|
1008
|
+
), this.controller = e;
|
|
1009
|
+
};
|
|
1010
|
+
#e() {
|
|
1011
|
+
Ut.render(
|
|
1012
|
+
/* @__PURE__ */ V.jsx(Bt, { children: /* @__PURE__ */ V.jsx(
|
|
1013
|
+
or,
|
|
1014
|
+
{
|
|
1015
|
+
src: this.src,
|
|
1016
|
+
options: this.#t,
|
|
1017
|
+
onControllerChange: this.#r
|
|
1018
|
+
}
|
|
1019
|
+
) }),
|
|
1020
|
+
this.container
|
|
1021
|
+
);
|
|
1022
|
+
}
|
|
1023
|
+
connectedCallback() {
|
|
1024
|
+
console.debug("[@nostalgic-diva/web-components] connectedCallback"), this.#e();
|
|
1025
|
+
}
|
|
1026
|
+
disconnectedCallback() {
|
|
1027
|
+
console.debug("[@nostalgic-diva/web-components] disconnectedCallback");
|
|
1028
|
+
}
|
|
1029
|
+
attributeChangedCallback() {
|
|
1030
|
+
console.debug(
|
|
1031
|
+
"[@nostalgic-diva/web-components] attributeChangedCallback"
|
|
1032
|
+
), this.#e();
|
|
1033
|
+
}
|
|
1034
|
+
async loadVideo(e) {
|
|
1035
|
+
await this.controller.loadVideo(e);
|
|
1036
|
+
}
|
|
1037
|
+
async play() {
|
|
1038
|
+
await this.controller.play();
|
|
1039
|
+
}
|
|
1040
|
+
async pause() {
|
|
1041
|
+
await this.controller.pause();
|
|
1042
|
+
}
|
|
1043
|
+
async setCurrentTime(e) {
|
|
1044
|
+
await this.controller.setCurrentTime(e);
|
|
1045
|
+
}
|
|
1046
|
+
async setVolume(e) {
|
|
1047
|
+
await this.controller.setVolume(e);
|
|
1048
|
+
}
|
|
1049
|
+
async setMuted(e) {
|
|
1050
|
+
await this.controller.setMuted(e);
|
|
1051
|
+
}
|
|
1052
|
+
async setPlaybackRate(e) {
|
|
1053
|
+
await this.controller.setPlaybackRate(e);
|
|
1054
|
+
}
|
|
1055
|
+
async getDuration() {
|
|
1056
|
+
return await this.controller.getDuration();
|
|
1057
|
+
}
|
|
1058
|
+
async getCurrentTime() {
|
|
1059
|
+
return await this.controller.getCurrentTime();
|
|
1060
|
+
}
|
|
1061
|
+
async getVolume() {
|
|
1062
|
+
return await this.controller.getVolume();
|
|
1063
|
+
}
|
|
1064
|
+
async getMuted() {
|
|
1065
|
+
return await this.controller.getMuted();
|
|
1066
|
+
}
|
|
1067
|
+
async getPlaybackRate() {
|
|
1068
|
+
return await this.controller.getPlaybackRate();
|
|
1069
|
+
}
|
|
1070
|
+
supports(e) {
|
|
1071
|
+
return this.controller.supports(e);
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
function yr() {
|
|
1075
|
+
customElements.define("nostalgic-diva", ur);
|
|
1076
|
+
}
|
|
1077
|
+
function lr() {
|
|
1078
|
+
const n = L(!0);
|
|
1079
|
+
return n.current ? (n.current = !1, !0) : n.current;
|
|
1080
|
+
}
|
|
1081
|
+
const cr = (n, e) => n === e;
|
|
1082
|
+
function dr(n, e = cr) {
|
|
1083
|
+
const r = L(), o = L(n);
|
|
1084
|
+
return !lr() && !e(o.current, n) && (r.current = o.current, o.current = n), r.current;
|
|
1085
|
+
}
|
|
1086
|
+
class Y {
|
|
1087
|
+
constructor(e, r, o) {
|
|
1088
|
+
this.logger = e, this.player = r, this.options = o, this.logger.log(p.Debug, "ctor");
|
|
1089
|
+
}
|
|
1090
|
+
supports(e) {
|
|
1091
|
+
return this[e] !== void 0;
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
class de {
|
|
1095
|
+
constructor(e, r, o, c, m) {
|
|
1096
|
+
this.logger = e, this.type = r, this.player = o, this.options = c, this.controllerFactory = m, this.id = de.nextId++;
|
|
1097
|
+
}
|
|
1098
|
+
static nextId = 1;
|
|
1099
|
+
id;
|
|
1100
|
+
impl;
|
|
1101
|
+
createMessage(e) {
|
|
1102
|
+
return `${this.type}#${this.id} ${e}`;
|
|
1103
|
+
}
|
|
1104
|
+
debug(e, ...r) {
|
|
1105
|
+
this.logger.log(
|
|
1106
|
+
p.Debug,
|
|
1107
|
+
this.createMessage(e),
|
|
1108
|
+
...r
|
|
1109
|
+
);
|
|
1110
|
+
}
|
|
1111
|
+
error(e, ...r) {
|
|
1112
|
+
this.logger.log(
|
|
1113
|
+
p.Error,
|
|
1114
|
+
this.createMessage(e),
|
|
1115
|
+
...r
|
|
1116
|
+
);
|
|
1117
|
+
}
|
|
1118
|
+
async attach(e) {
|
|
1119
|
+
if (this.debug("attach", e), this.impl) {
|
|
1120
|
+
this.debug("player is already attached");
|
|
1121
|
+
return;
|
|
1122
|
+
}
|
|
1123
|
+
this.debug("Attaching player..."), this.impl = new this.controllerFactory(
|
|
1124
|
+
this.logger,
|
|
1125
|
+
this.player,
|
|
1126
|
+
this.options
|
|
1127
|
+
), await this.impl.attach(e), this.debug("player attached");
|
|
1128
|
+
}
|
|
1129
|
+
createPlayerNotAttachedError() {
|
|
1130
|
+
return this.error("player is not attached"), new Error("player is not attached");
|
|
1131
|
+
}
|
|
1132
|
+
createCommandNotSupportedError(e) {
|
|
1133
|
+
return new Error(`${e} is not supported`);
|
|
1134
|
+
}
|
|
1135
|
+
async detach() {
|
|
1136
|
+
if (this.debug("detach"), this.impl === void 0)
|
|
1137
|
+
throw this.createPlayerNotAttachedError();
|
|
1138
|
+
await this.impl.detach(), this.impl = void 0;
|
|
1139
|
+
}
|
|
1140
|
+
async loadVideo(e) {
|
|
1141
|
+
if (this.debug("loadVideo", e), this.impl === void 0)
|
|
1142
|
+
throw this.createPlayerNotAttachedError();
|
|
1143
|
+
if (this.impl.loadVideo === void 0)
|
|
1144
|
+
throw this.createCommandNotSupportedError("loadVideo");
|
|
1145
|
+
this.debug("Loading video..."), await this.impl.loadVideo(e), this.debug("video loaded", e);
|
|
1146
|
+
}
|
|
1147
|
+
play() {
|
|
1148
|
+
if (this.debug("play"), this.impl === void 0)
|
|
1149
|
+
throw this.createPlayerNotAttachedError();
|
|
1150
|
+
if (this.impl.play === void 0)
|
|
1151
|
+
throw this.createCommandNotSupportedError("play");
|
|
1152
|
+
return this.impl.play();
|
|
1153
|
+
}
|
|
1154
|
+
pause() {
|
|
1155
|
+
if (this.debug("pause"), this.impl === void 0)
|
|
1156
|
+
throw this.createPlayerNotAttachedError();
|
|
1157
|
+
if (this.impl.pause === void 0)
|
|
1158
|
+
throw this.createCommandNotSupportedError("pause");
|
|
1159
|
+
return this.impl.pause();
|
|
1160
|
+
}
|
|
1161
|
+
setCurrentTime(e) {
|
|
1162
|
+
if (this.debug("setCurrentTime", e), this.impl === void 0)
|
|
1163
|
+
throw this.createPlayerNotAttachedError();
|
|
1164
|
+
if (this.impl.setCurrentTime === void 0)
|
|
1165
|
+
throw this.createCommandNotSupportedError("setCurrentTime");
|
|
1166
|
+
return this.impl.setCurrentTime(e);
|
|
1167
|
+
}
|
|
1168
|
+
setVolume(e) {
|
|
1169
|
+
if (this.debug("setVolume", e), this.impl === void 0)
|
|
1170
|
+
throw this.createPlayerNotAttachedError();
|
|
1171
|
+
if (this.impl.setVolume === void 0)
|
|
1172
|
+
throw this.createCommandNotSupportedError("setVolume");
|
|
1173
|
+
return this.impl.setVolume(e);
|
|
1174
|
+
}
|
|
1175
|
+
setMuted(e) {
|
|
1176
|
+
if (this.debug("setMuted", e), this.impl === void 0)
|
|
1177
|
+
throw this.createPlayerNotAttachedError();
|
|
1178
|
+
if (this.impl.setMuted === void 0)
|
|
1179
|
+
throw this.createCommandNotSupportedError("setMuted");
|
|
1180
|
+
return this.impl.setMuted(e);
|
|
1181
|
+
}
|
|
1182
|
+
setPlaybackRate(e) {
|
|
1183
|
+
if (this.debug("setPlaybackRate", e), this.impl === void 0)
|
|
1184
|
+
throw this.createPlayerNotAttachedError();
|
|
1185
|
+
if (this.impl.setPlaybackRate === void 0)
|
|
1186
|
+
throw this.createCommandNotSupportedError("setPlaybackRate");
|
|
1187
|
+
return this.impl.setPlaybackRate(e);
|
|
1188
|
+
}
|
|
1189
|
+
getDuration() {
|
|
1190
|
+
if (this.debug("getDuration"), this.impl === void 0)
|
|
1191
|
+
throw this.createPlayerNotAttachedError();
|
|
1192
|
+
if (this.impl.getDuration === void 0)
|
|
1193
|
+
throw this.createCommandNotSupportedError("getDuration");
|
|
1194
|
+
return this.impl.getDuration();
|
|
1195
|
+
}
|
|
1196
|
+
getCurrentTime() {
|
|
1197
|
+
if (this.debug("getCurrentTime"), this.impl === void 0)
|
|
1198
|
+
throw this.createPlayerNotAttachedError();
|
|
1199
|
+
if (this.impl.getCurrentTime === void 0)
|
|
1200
|
+
throw this.createCommandNotSupportedError("getCurrentTime");
|
|
1201
|
+
return this.impl.getCurrentTime();
|
|
1202
|
+
}
|
|
1203
|
+
getVolume() {
|
|
1204
|
+
if (this.debug("getVolume"), this.impl === void 0)
|
|
1205
|
+
throw this.createPlayerNotAttachedError();
|
|
1206
|
+
if (this.impl.getVolume === void 0)
|
|
1207
|
+
throw this.createCommandNotSupportedError("getVolume");
|
|
1208
|
+
return this.impl.getVolume();
|
|
1209
|
+
}
|
|
1210
|
+
getMuted() {
|
|
1211
|
+
if (this.debug("getMuted"), this.impl === void 0)
|
|
1212
|
+
throw this.createPlayerNotAttachedError();
|
|
1213
|
+
if (this.impl.getMuted === void 0)
|
|
1214
|
+
throw this.createCommandNotSupportedError("getMuted");
|
|
1215
|
+
return this.impl.getMuted();
|
|
1216
|
+
}
|
|
1217
|
+
getPlaybackRate() {
|
|
1218
|
+
if (this.debug("getPlaybackRate"), this.impl === void 0)
|
|
1219
|
+
throw this.createPlayerNotAttachedError();
|
|
1220
|
+
if (this.impl.getPlaybackRate === void 0)
|
|
1221
|
+
throw this.createCommandNotSupportedError("getPlaybackRate");
|
|
1222
|
+
return this.impl.getPlaybackRate();
|
|
1223
|
+
}
|
|
1224
|
+
supports(e) {
|
|
1225
|
+
if (this.impl === void 0)
|
|
1226
|
+
throw this.createPlayerNotAttachedError();
|
|
1227
|
+
return this.impl.supports(e);
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
const fr = ({
|
|
1231
|
+
logger: n,
|
|
1232
|
+
type: e,
|
|
1233
|
+
loadScript: r,
|
|
1234
|
+
playerFactory: o,
|
|
1235
|
+
onControllerChange: c,
|
|
1236
|
+
videoId: m,
|
|
1237
|
+
options: R,
|
|
1238
|
+
controllerFactory: w,
|
|
1239
|
+
children: f
|
|
1240
|
+
}) => {
|
|
1241
|
+
n.log(p.Debug, "PlayerContainer");
|
|
1242
|
+
const C = L(m), b = L(void 0), [P, k] = je(), [I, M] = je(Q), x = T(
|
|
1243
|
+
(E) => {
|
|
1244
|
+
M(E), c?.(E);
|
|
1245
|
+
},
|
|
1246
|
+
[c]
|
|
1247
|
+
);
|
|
1248
|
+
ue(() => {
|
|
1249
|
+
(r?.() ?? Promise.resolve()).then(() => o(b.current, C.current)).then((E) => k(E));
|
|
1250
|
+
}, [r, o]), ue(() => {
|
|
1251
|
+
if (P === void 0)
|
|
1252
|
+
return;
|
|
1253
|
+
const E = new de(
|
|
1254
|
+
n,
|
|
1255
|
+
e,
|
|
1256
|
+
P,
|
|
1257
|
+
R,
|
|
1258
|
+
w
|
|
1259
|
+
);
|
|
1260
|
+
return E.attach(C.current).then(() => x(E)), () => {
|
|
1261
|
+
E.detach().finally(() => x(Q));
|
|
1262
|
+
};
|
|
1263
|
+
}, [
|
|
1264
|
+
n,
|
|
1265
|
+
e,
|
|
1266
|
+
r,
|
|
1267
|
+
P,
|
|
1268
|
+
R,
|
|
1269
|
+
w,
|
|
1270
|
+
x
|
|
1271
|
+
]);
|
|
1272
|
+
const A = dr(m);
|
|
1273
|
+
return ue(() => {
|
|
1274
|
+
A !== void 0 && I.loadVideo(m);
|
|
1275
|
+
}, [A, m, I]), /* @__PURE__ */ V.jsx(V.Fragment, { children: f(b, C.current) });
|
|
1276
|
+
};
|
|
1277
|
+
class mr extends Y {
|
|
1278
|
+
async attach() {
|
|
1279
|
+
this.player.onerror = (e) => this.options?.onError?.(e), this.player.onloadeddata = () => this.options?.onLoaded?.({ id: this.player.src }), this.player.onplay = () => this.options?.onPlay?.(), this.player.onpause = () => this.options?.onPause?.(), this.player.onended = () => this.options?.onEnded?.(), this.player.ontimeupdate = () => {
|
|
1280
|
+
this.options?.onTimeUpdate?.({
|
|
1281
|
+
duration: this.player.duration,
|
|
1282
|
+
percent: this.player.currentTime / this.player.duration,
|
|
1283
|
+
seconds: this.player.currentTime
|
|
1284
|
+
});
|
|
1285
|
+
};
|
|
1286
|
+
}
|
|
1287
|
+
async detach() {
|
|
1288
|
+
this.player.onerror = null, this.player.onloadeddata = null, this.player.onplay = null, this.player.onpause = null, this.player.onended = null, this.player.ontimeupdate = null;
|
|
1289
|
+
}
|
|
1290
|
+
async loadVideo(e) {
|
|
1291
|
+
this.player.src = e;
|
|
1292
|
+
}
|
|
1293
|
+
async play() {
|
|
1294
|
+
await this.player.play();
|
|
1295
|
+
}
|
|
1296
|
+
async pause() {
|
|
1297
|
+
this.player.pause();
|
|
1298
|
+
}
|
|
1299
|
+
async setCurrentTime(e) {
|
|
1300
|
+
this.player.currentTime = e;
|
|
1301
|
+
}
|
|
1302
|
+
async setVolume(e) {
|
|
1303
|
+
this.player.volume = e;
|
|
1304
|
+
}
|
|
1305
|
+
async setMuted(e) {
|
|
1306
|
+
this.player.muted = e;
|
|
1307
|
+
}
|
|
1308
|
+
async setPlaybackRate(e) {
|
|
1309
|
+
this.player.playbackRate = e;
|
|
1310
|
+
}
|
|
1311
|
+
async getDuration() {
|
|
1312
|
+
return this.player.duration;
|
|
1313
|
+
}
|
|
1314
|
+
async getCurrentTime() {
|
|
1315
|
+
return this.player.currentTime;
|
|
1316
|
+
}
|
|
1317
|
+
async getVolume() {
|
|
1318
|
+
return this.player.volume;
|
|
1319
|
+
}
|
|
1320
|
+
async getMuted() {
|
|
1321
|
+
return this.player.muted;
|
|
1322
|
+
}
|
|
1323
|
+
async getPlaybackRate() {
|
|
1324
|
+
return this.player.playbackRate;
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
const qe = [
|
|
1328
|
+
"apiready",
|
|
1329
|
+
"seeked",
|
|
1330
|
+
"video_end",
|
|
1331
|
+
"durationchange",
|
|
1332
|
+
"pause",
|
|
1333
|
+
"playing",
|
|
1334
|
+
"error"
|
|
1335
|
+
];
|
|
1336
|
+
class vr extends Y {
|
|
1337
|
+
handlePlayerEvents = (e) => {
|
|
1338
|
+
switch (e.type) {
|
|
1339
|
+
case "apiready":
|
|
1340
|
+
this.options?.onLoaded?.({ id: this.player.video.videoId });
|
|
1341
|
+
break;
|
|
1342
|
+
case "seeked":
|
|
1343
|
+
this.options?.onTimeUpdate?.({
|
|
1344
|
+
duration: this.player.duration,
|
|
1345
|
+
percent: this.player.currentTime / this.player.duration,
|
|
1346
|
+
seconds: this.player.currentTime
|
|
1347
|
+
});
|
|
1348
|
+
break;
|
|
1349
|
+
case "video_end":
|
|
1350
|
+
this.options?.onEnded?.();
|
|
1351
|
+
break;
|
|
1352
|
+
case "durationchange":
|
|
1353
|
+
break;
|
|
1354
|
+
case "pause":
|
|
1355
|
+
this.options?.onPause?.();
|
|
1356
|
+
break;
|
|
1357
|
+
case "playing":
|
|
1358
|
+
this.options?.onPlay?.();
|
|
1359
|
+
break;
|
|
1360
|
+
case "error":
|
|
1361
|
+
this.options?.onError?.(e);
|
|
1362
|
+
break;
|
|
1363
|
+
}
|
|
1364
|
+
};
|
|
1365
|
+
async attach(e) {
|
|
1366
|
+
for (const r of qe)
|
|
1367
|
+
this.player.addEventListener(r, this.handlePlayerEvents);
|
|
1368
|
+
}
|
|
1369
|
+
async detach() {
|
|
1370
|
+
for (const e of qe)
|
|
1371
|
+
this.player.removeEventListener(e, this.handlePlayerEvents);
|
|
1372
|
+
}
|
|
1373
|
+
async loadVideo(e) {
|
|
1374
|
+
this.player.load(e);
|
|
1375
|
+
}
|
|
1376
|
+
async play() {
|
|
1377
|
+
this.player.play();
|
|
1378
|
+
}
|
|
1379
|
+
async pause() {
|
|
1380
|
+
this.player.pause();
|
|
1381
|
+
}
|
|
1382
|
+
async setCurrentTime(e) {
|
|
1383
|
+
this.player.seek(e);
|
|
1384
|
+
}
|
|
1385
|
+
async setVolume(e) {
|
|
1386
|
+
this.player.setVolume(e);
|
|
1387
|
+
}
|
|
1388
|
+
async setMuted(e) {
|
|
1389
|
+
this.player.setMuted(e);
|
|
1390
|
+
}
|
|
1391
|
+
setPlaybackRate = void 0;
|
|
1392
|
+
async getDuration() {
|
|
1393
|
+
return this.player.duration;
|
|
1394
|
+
}
|
|
1395
|
+
async getCurrentTime() {
|
|
1396
|
+
return this.player.currentTime;
|
|
1397
|
+
}
|
|
1398
|
+
async getVolume() {
|
|
1399
|
+
return this.player.volume;
|
|
1400
|
+
}
|
|
1401
|
+
async getMuted() {
|
|
1402
|
+
return this.player.muted;
|
|
1403
|
+
}
|
|
1404
|
+
getPlaybackRate = void 0;
|
|
1405
|
+
}
|
|
1406
|
+
var le = /* @__PURE__ */ ((n) => (n[n.Play = 2] = "Play", n[n.Pause = 3] = "Pause", n[n.End = 4] = "End", n))(le || {});
|
|
1407
|
+
class ce extends Y {
|
|
1408
|
+
static origin = "https://embed.nicovideo.jp";
|
|
1409
|
+
duration = 0;
|
|
1410
|
+
currentTime = 0;
|
|
1411
|
+
volume = 0;
|
|
1412
|
+
muted = !1;
|
|
1413
|
+
handleMessage = (e) => {
|
|
1414
|
+
if (e.origin !== ce.origin) return;
|
|
1415
|
+
const r = e.data;
|
|
1416
|
+
switch (r.eventName) {
|
|
1417
|
+
case "playerStatusChange":
|
|
1418
|
+
this.logger.log(
|
|
1419
|
+
p.Debug,
|
|
1420
|
+
`player status changed: ${le[r.data.playerStatus] ?? r.data.playerStatus}`
|
|
1421
|
+
);
|
|
1422
|
+
break;
|
|
1423
|
+
case "statusChange":
|
|
1424
|
+
switch (this.logger.log(
|
|
1425
|
+
p.Debug,
|
|
1426
|
+
`status changed: ${le[r.data.playerStatus] ?? r.data.playerStatus}`
|
|
1427
|
+
), r.data.playerStatus) {
|
|
1428
|
+
case 2:
|
|
1429
|
+
this.options?.onPlay?.();
|
|
1430
|
+
break;
|
|
1431
|
+
case 3:
|
|
1432
|
+
this.options?.onPause?.();
|
|
1433
|
+
break;
|
|
1434
|
+
case 4:
|
|
1435
|
+
this.options?.onEnded?.();
|
|
1436
|
+
break;
|
|
1437
|
+
}
|
|
1438
|
+
break;
|
|
1439
|
+
case "playerMetadataChange":
|
|
1440
|
+
r.data.duration !== void 0 && (this.duration = r.data.duration / 1e3), this.currentTime = r.data.currentTime === void 0 ? 0 : r.data.currentTime / 1e3, this.volume = r.data.volume, this.muted = r.data.muted, this.options?.onTimeUpdate?.({
|
|
1441
|
+
duration: this.duration,
|
|
1442
|
+
percent: this.currentTime !== 0 && this.duration !== 0 ? this.currentTime / this.duration : 0,
|
|
1443
|
+
seconds: this.currentTime
|
|
1444
|
+
});
|
|
1445
|
+
break;
|
|
1446
|
+
case "loadComplete":
|
|
1447
|
+
this.logger.log(p.Debug, "load completed"), this.duration = r.data.videoInfo.lengthInSeconds, this.options?.onLoaded?.({ id: r.data.videoInfo.watchId });
|
|
1448
|
+
break;
|
|
1449
|
+
case "error":
|
|
1450
|
+
this.options?.onError?.(r);
|
|
1451
|
+
break;
|
|
1452
|
+
case "player-error:video:play":
|
|
1453
|
+
case "player-error:video:seek":
|
|
1454
|
+
this.options?.onError?.(r);
|
|
1455
|
+
break;
|
|
1456
|
+
default:
|
|
1457
|
+
this.logger.log(
|
|
1458
|
+
p.Debug,
|
|
1459
|
+
"message",
|
|
1460
|
+
r.eventName,
|
|
1461
|
+
r.data
|
|
1462
|
+
);
|
|
1463
|
+
break;
|
|
1464
|
+
}
|
|
1465
|
+
};
|
|
1466
|
+
async attach() {
|
|
1467
|
+
window.addEventListener("message", this.handleMessage);
|
|
1468
|
+
}
|
|
1469
|
+
async detach() {
|
|
1470
|
+
window.removeEventListener("message", this.handleMessage);
|
|
1471
|
+
}
|
|
1472
|
+
async loadVideo(e) {
|
|
1473
|
+
return new Promise((r, o) => {
|
|
1474
|
+
this.duration = 0, this.currentTime = 0, this.volume = 0, this.muted = !1, this.player.onload = () => {
|
|
1475
|
+
this.player.onload = null, r();
|
|
1476
|
+
}, this.player.src = `https://embed.nicovideo.jp/watch/${e}?jsapi=1&playerId=1`;
|
|
1477
|
+
});
|
|
1478
|
+
}
|
|
1479
|
+
// https://blog.hayu.io/web/create/nicovideo-embed-player-api/.
|
|
1480
|
+
postMessage(e) {
|
|
1481
|
+
this.player.contentWindow?.postMessage(
|
|
1482
|
+
{
|
|
1483
|
+
...e,
|
|
1484
|
+
playerId: "1",
|
|
1485
|
+
sourceConnectorType: 1
|
|
1486
|
+
},
|
|
1487
|
+
ce.origin
|
|
1488
|
+
);
|
|
1489
|
+
}
|
|
1490
|
+
async play() {
|
|
1491
|
+
this.postMessage({ eventName: "play" });
|
|
1492
|
+
}
|
|
1493
|
+
async pause() {
|
|
1494
|
+
this.postMessage({ eventName: "pause" });
|
|
1495
|
+
}
|
|
1496
|
+
async setCurrentTime(e) {
|
|
1497
|
+
this.postMessage({ eventName: "seek", data: { time: e * 1e3 } });
|
|
1498
|
+
}
|
|
1499
|
+
async setVolume(e) {
|
|
1500
|
+
this.postMessage({
|
|
1501
|
+
eventName: "volumeChange",
|
|
1502
|
+
data: { volume: e }
|
|
1503
|
+
});
|
|
1504
|
+
}
|
|
1505
|
+
async setMuted(e) {
|
|
1506
|
+
this.postMessage({
|
|
1507
|
+
eventName: "mute",
|
|
1508
|
+
data: { mute: e }
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
setPlaybackRate = void 0;
|
|
1512
|
+
async getDuration() {
|
|
1513
|
+
return this.duration;
|
|
1514
|
+
}
|
|
1515
|
+
async getCurrentTime() {
|
|
1516
|
+
return this.currentTime;
|
|
1517
|
+
}
|
|
1518
|
+
async getVolume() {
|
|
1519
|
+
return this.volume;
|
|
1520
|
+
}
|
|
1521
|
+
async getMuted() {
|
|
1522
|
+
return this.muted;
|
|
1523
|
+
}
|
|
1524
|
+
getPlaybackRate = void 0;
|
|
1525
|
+
}
|
|
1526
|
+
class Xe extends Y {
|
|
1527
|
+
getDurationCore() {
|
|
1528
|
+
return new Promise((e, r) => {
|
|
1529
|
+
this.player.getDuration(e);
|
|
1530
|
+
});
|
|
1531
|
+
}
|
|
1532
|
+
attach(e) {
|
|
1533
|
+
return new Promise((r, o) => {
|
|
1534
|
+
this.player.bind(SC.Widget.Events.READY, () => {
|
|
1535
|
+
this.player.bind(
|
|
1536
|
+
SC.Widget.Events.PLAY_PROGRESS,
|
|
1537
|
+
async (c) => {
|
|
1538
|
+
const m = await this.getDurationCore();
|
|
1539
|
+
this.options?.onTimeUpdate?.({
|
|
1540
|
+
duration: m / 1e3,
|
|
1541
|
+
percent: c.currentPosition / m,
|
|
1542
|
+
seconds: c.currentPosition / 1e3
|
|
1543
|
+
});
|
|
1544
|
+
}
|
|
1545
|
+
), this.player.bind(
|
|
1546
|
+
SC.Widget.Events.ERROR,
|
|
1547
|
+
(c) => this.options?.onError?.(c)
|
|
1548
|
+
), this.player.bind(
|
|
1549
|
+
SC.Widget.Events.PLAY,
|
|
1550
|
+
() => this.options?.onPlay?.()
|
|
1551
|
+
), this.player.bind(
|
|
1552
|
+
SC.Widget.Events.PAUSE,
|
|
1553
|
+
() => this.options?.onPause?.()
|
|
1554
|
+
), this.player.bind(
|
|
1555
|
+
SC.Widget.Events.FINISH,
|
|
1556
|
+
() => this.options?.onEnded?.()
|
|
1557
|
+
), this.options?.onLoaded?.({ id: e }), r();
|
|
1558
|
+
});
|
|
1559
|
+
});
|
|
1560
|
+
}
|
|
1561
|
+
async detach() {
|
|
1562
|
+
this.player.unbind(SC.Widget.Events.READY), this.player.unbind(SC.Widget.Events.PLAY_PROGRESS), this.player.unbind(SC.Widget.Events.ERROR), this.player.unbind(SC.Widget.Events.PLAY), this.player.unbind(SC.Widget.Events.PAUSE), this.player.unbind(SC.Widget.Events.FINISH);
|
|
1563
|
+
}
|
|
1564
|
+
static playerLoadAsync(e, r, o) {
|
|
1565
|
+
return new Promise((c, m) => {
|
|
1566
|
+
e.load(r, { ...o, callback: c });
|
|
1567
|
+
});
|
|
1568
|
+
}
|
|
1569
|
+
async loadVideo(e) {
|
|
1570
|
+
await Xe.playerLoadAsync(this.player, e, {
|
|
1571
|
+
auto_play: !0
|
|
1572
|
+
}), this.options?.onLoaded?.({ id: e });
|
|
1573
|
+
}
|
|
1574
|
+
async play() {
|
|
1575
|
+
this.player.play();
|
|
1576
|
+
}
|
|
1577
|
+
async pause() {
|
|
1578
|
+
this.player.pause();
|
|
1579
|
+
}
|
|
1580
|
+
async setCurrentTime(e) {
|
|
1581
|
+
this.player.seekTo(e * 1e3);
|
|
1582
|
+
}
|
|
1583
|
+
async setVolume(e) {
|
|
1584
|
+
this.player.setVolume(e * 100);
|
|
1585
|
+
}
|
|
1586
|
+
setMuted = void 0;
|
|
1587
|
+
setPlaybackRate = void 0;
|
|
1588
|
+
async getDuration() {
|
|
1589
|
+
return await this.getDurationCore() / 1e3;
|
|
1590
|
+
}
|
|
1591
|
+
getCurrentTimeCore() {
|
|
1592
|
+
return new Promise((e, r) => {
|
|
1593
|
+
this.player.getPosition(e);
|
|
1594
|
+
});
|
|
1595
|
+
}
|
|
1596
|
+
async getCurrentTime() {
|
|
1597
|
+
return await this.getCurrentTimeCore() / 1e3;
|
|
1598
|
+
}
|
|
1599
|
+
getVolumeCore() {
|
|
1600
|
+
return new Promise((e, r) => {
|
|
1601
|
+
this.player.getVolume(e);
|
|
1602
|
+
});
|
|
1603
|
+
}
|
|
1604
|
+
async getVolume() {
|
|
1605
|
+
return await this.getVolumeCore() / 100;
|
|
1606
|
+
}
|
|
1607
|
+
getMuted = void 0;
|
|
1608
|
+
getPlaybackRate = void 0;
|
|
1609
|
+
}
|
|
1610
|
+
class gr extends Y {
|
|
1611
|
+
handleReady = () => {
|
|
1612
|
+
this.options?.onLoaded?.({ id: this.player.getVideo() });
|
|
1613
|
+
};
|
|
1614
|
+
handlePlay = () => {
|
|
1615
|
+
this.options?.onPlay?.();
|
|
1616
|
+
};
|
|
1617
|
+
handlePause = () => {
|
|
1618
|
+
this.options?.onPause?.();
|
|
1619
|
+
};
|
|
1620
|
+
handleEnded = () => {
|
|
1621
|
+
this.options?.onEnded?.();
|
|
1622
|
+
};
|
|
1623
|
+
handleSeek = () => {
|
|
1624
|
+
this.options?.onTimeUpdate?.({
|
|
1625
|
+
duration: 0,
|
|
1626
|
+
percent: 0,
|
|
1627
|
+
seconds: 0
|
|
1628
|
+
});
|
|
1629
|
+
};
|
|
1630
|
+
async attach(e) {
|
|
1631
|
+
this.player.addEventListener(Twitch.Player.READY, this.handleReady), this.player.addEventListener(Twitch.Player.PLAYING, this.handlePlay), this.player.addEventListener(Twitch.Player.PAUSE, this.handlePause), this.player.addEventListener(Twitch.Player.ENDED, this.handleEnded), this.player.addEventListener(Twitch.Player.SEEK, this.handleSeek);
|
|
1632
|
+
}
|
|
1633
|
+
async detach() {
|
|
1634
|
+
}
|
|
1635
|
+
async loadVideo(e) {
|
|
1636
|
+
this.player.setVideo(e, 0);
|
|
1637
|
+
}
|
|
1638
|
+
async play() {
|
|
1639
|
+
this.player.play();
|
|
1640
|
+
}
|
|
1641
|
+
async pause() {
|
|
1642
|
+
this.player.pause();
|
|
1643
|
+
}
|
|
1644
|
+
async setCurrentTime(e) {
|
|
1645
|
+
this.player.seek(e);
|
|
1646
|
+
}
|
|
1647
|
+
async setVolume(e) {
|
|
1648
|
+
this.player.setVolume(e);
|
|
1649
|
+
}
|
|
1650
|
+
async setMuted(e) {
|
|
1651
|
+
this.player.setMuted(e);
|
|
1652
|
+
}
|
|
1653
|
+
setPlaybackRate = void 0;
|
|
1654
|
+
async getDuration() {
|
|
1655
|
+
return this.player.getDuration();
|
|
1656
|
+
}
|
|
1657
|
+
async getCurrentTime() {
|
|
1658
|
+
return this.player.getCurrentTime();
|
|
1659
|
+
}
|
|
1660
|
+
async getVolume() {
|
|
1661
|
+
return this.player.getVolume();
|
|
1662
|
+
}
|
|
1663
|
+
async getMuted() {
|
|
1664
|
+
return this.player.getMuted();
|
|
1665
|
+
}
|
|
1666
|
+
getPlaybackRate = void 0;
|
|
1667
|
+
}
|
|
1668
|
+
class br extends Y {
|
|
1669
|
+
async attach() {
|
|
1670
|
+
await this.player.ready(), this.player.on("error", (e) => this.options?.onError?.(e)), this.player.on(
|
|
1671
|
+
"loaded",
|
|
1672
|
+
(e) => this.options?.onLoaded?.({ id: e.id.toString() })
|
|
1673
|
+
), this.player.on("play", () => this.options?.onPlay?.()), this.player.on("pause", () => this.options?.onPause?.()), this.player.on("ended", () => this.options?.onEnded?.()), this.player.on("timeupdate", (e) => {
|
|
1674
|
+
this.options?.onTimeUpdate?.({
|
|
1675
|
+
duration: e.duration,
|
|
1676
|
+
percent: e.percent,
|
|
1677
|
+
seconds: e.seconds
|
|
1678
|
+
});
|
|
1679
|
+
});
|
|
1680
|
+
}
|
|
1681
|
+
async detach() {
|
|
1682
|
+
this.player.off("error"), this.player.off("loaded"), this.player.off("play"), this.player.off("pause"), this.player.off("ended"), this.player.off("timeupdate");
|
|
1683
|
+
}
|
|
1684
|
+
async loadVideo(e) {
|
|
1685
|
+
await this.player.loadVideo(e);
|
|
1686
|
+
}
|
|
1687
|
+
async play() {
|
|
1688
|
+
await this.player.play();
|
|
1689
|
+
}
|
|
1690
|
+
async pause() {
|
|
1691
|
+
await this.player.pause();
|
|
1692
|
+
}
|
|
1693
|
+
async setCurrentTime(e) {
|
|
1694
|
+
await this.player.setCurrentTime(e);
|
|
1695
|
+
}
|
|
1696
|
+
async setVolume(e) {
|
|
1697
|
+
await this.player.setVolume(e);
|
|
1698
|
+
}
|
|
1699
|
+
async setMuted(e) {
|
|
1700
|
+
await this.player.setMuted(e);
|
|
1701
|
+
}
|
|
1702
|
+
async setPlaybackRate(e) {
|
|
1703
|
+
await this.player.setPlaybackRate(e);
|
|
1704
|
+
}
|
|
1705
|
+
async getDuration() {
|
|
1706
|
+
return this.player.getDuration();
|
|
1707
|
+
}
|
|
1708
|
+
async getCurrentTime() {
|
|
1709
|
+
return this.player.getCurrentTime();
|
|
1710
|
+
}
|
|
1711
|
+
async getVolume() {
|
|
1712
|
+
return this.player.getVolume();
|
|
1713
|
+
}
|
|
1714
|
+
async getMuted() {
|
|
1715
|
+
return await this.player.getMuted();
|
|
1716
|
+
}
|
|
1717
|
+
async getPlaybackRate() {
|
|
1718
|
+
return this.player.getPlaybackRate();
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
var Ze = /* @__PURE__ */ ((n) => (n[n.UNSTARTED = -1] = "UNSTARTED", n[n.ENDED = 0] = "ENDED", n[n.PLAYING = 1] = "PLAYING", n[n.PAUSED = 2] = "PAUSED", n[n.BUFFERING = 3] = "BUFFERING", n[n.CUED = 5] = "CUED", n))(Ze || {});
|
|
1722
|
+
class Er extends Y {
|
|
1723
|
+
previousTime;
|
|
1724
|
+
timeUpdateIntervalId;
|
|
1725
|
+
clearTimeUpdateInterval() {
|
|
1726
|
+
this.logger.log(
|
|
1727
|
+
p.Debug,
|
|
1728
|
+
"clearTimeUpdateInterval",
|
|
1729
|
+
this.timeUpdateIntervalId
|
|
1730
|
+
), window.clearInterval(this.timeUpdateIntervalId), this.timeUpdateIntervalId = void 0;
|
|
1731
|
+
}
|
|
1732
|
+
invokeTimeUpdate(e) {
|
|
1733
|
+
const r = e.getCurrentTime();
|
|
1734
|
+
if (r === this.previousTime) return;
|
|
1735
|
+
const o = e.getDuration();
|
|
1736
|
+
this.options?.onTimeUpdate?.({
|
|
1737
|
+
duration: o,
|
|
1738
|
+
percent: r / o,
|
|
1739
|
+
seconds: r
|
|
1740
|
+
}), this.previousTime = r;
|
|
1741
|
+
}
|
|
1742
|
+
setTimeUpdateInterval() {
|
|
1743
|
+
this.logger.log(p.Debug, "setTimeUpdateInterval"), this.clearTimeUpdateInterval(), this.timeUpdateIntervalId = window.setInterval(
|
|
1744
|
+
() => this.invokeTimeUpdate(this.player),
|
|
1745
|
+
250
|
|
1746
|
+
), this.logger.log(
|
|
1747
|
+
p.Debug,
|
|
1748
|
+
"timeUpdateIntervalId",
|
|
1749
|
+
this.timeUpdateIntervalId
|
|
1750
|
+
), this.invokeTimeUpdate(this.player);
|
|
1751
|
+
}
|
|
1752
|
+
attach(e) {
|
|
1753
|
+
return new Promise((r, o) => {
|
|
1754
|
+
this.player.addEventListener("onReady", async () => {
|
|
1755
|
+
this.player.addEventListener(
|
|
1756
|
+
"onError",
|
|
1757
|
+
(c) => this.options?.onError?.(c.data)
|
|
1758
|
+
), this.player.addEventListener(
|
|
1759
|
+
"onStateChange",
|
|
1760
|
+
(c) => {
|
|
1761
|
+
switch (this.logger.log(
|
|
1762
|
+
p.Debug,
|
|
1763
|
+
`state changed: ${Ze[c.data]}`
|
|
1764
|
+
), c.data) {
|
|
1765
|
+
case YT.PlayerState.CUED:
|
|
1766
|
+
this.options?.onLoaded?.({ id: e });
|
|
1767
|
+
break;
|
|
1768
|
+
case YT.PlayerState.PLAYING:
|
|
1769
|
+
this.options?.onPlay?.(), this.setTimeUpdateInterval();
|
|
1770
|
+
break;
|
|
1771
|
+
case YT.PlayerState.PAUSED:
|
|
1772
|
+
this.options?.onPause?.(), this.clearTimeUpdateInterval();
|
|
1773
|
+
break;
|
|
1774
|
+
case YT.PlayerState.ENDED:
|
|
1775
|
+
this.options?.onEnded?.(), this.clearTimeUpdateInterval();
|
|
1776
|
+
break;
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
), await this.loadVideo(e), r();
|
|
1780
|
+
});
|
|
1781
|
+
});
|
|
1782
|
+
}
|
|
1783
|
+
async detach() {
|
|
1784
|
+
this.clearTimeUpdateInterval();
|
|
1785
|
+
}
|
|
1786
|
+
async loadVideo(e) {
|
|
1787
|
+
this.previousTime = void 0, this.player.cueVideoById(e);
|
|
1788
|
+
}
|
|
1789
|
+
async play() {
|
|
1790
|
+
this.player.playVideo();
|
|
1791
|
+
}
|
|
1792
|
+
async pause() {
|
|
1793
|
+
this.player.pauseVideo();
|
|
1794
|
+
}
|
|
1795
|
+
async setCurrentTime(e) {
|
|
1796
|
+
this.player.seekTo(e), this.invokeTimeUpdate(this.player);
|
|
1797
|
+
}
|
|
1798
|
+
async setVolume(e) {
|
|
1799
|
+
this.player.setVolume(e * 100);
|
|
1800
|
+
}
|
|
1801
|
+
async setMuted(e) {
|
|
1802
|
+
e ? this.player.mute() : this.player.unMute();
|
|
1803
|
+
}
|
|
1804
|
+
async setPlaybackRate(e) {
|
|
1805
|
+
this.player.setPlaybackRate(e);
|
|
1806
|
+
}
|
|
1807
|
+
async getDuration() {
|
|
1808
|
+
return this.player.getDuration();
|
|
1809
|
+
}
|
|
1810
|
+
async getCurrentTime() {
|
|
1811
|
+
return this.player.getCurrentTime();
|
|
1812
|
+
}
|
|
1813
|
+
async getVolume() {
|
|
1814
|
+
return this.player.getVolume() / 100;
|
|
1815
|
+
}
|
|
1816
|
+
async getMuted() {
|
|
1817
|
+
return this.player.isMuted();
|
|
1818
|
+
}
|
|
1819
|
+
async getPlaybackRate() {
|
|
1820
|
+
return this.player.getPlaybackRate();
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
export {
|
|
1824
|
+
mr as A,
|
|
1825
|
+
vr as D,
|
|
1826
|
+
p as L,
|
|
1827
|
+
ce as N,
|
|
1828
|
+
fr as P,
|
|
1829
|
+
Xe as S,
|
|
1830
|
+
gr as T,
|
|
1831
|
+
br as V,
|
|
1832
|
+
Er as Y,
|
|
1833
|
+
or as a,
|
|
1834
|
+
Bt as b,
|
|
1835
|
+
ur as c,
|
|
1836
|
+
yr as d,
|
|
1837
|
+
Lt as e,
|
|
1838
|
+
de as f,
|
|
1839
|
+
Y as g,
|
|
1840
|
+
nr as h,
|
|
1841
|
+
F as i,
|
|
1842
|
+
V as j,
|
|
1843
|
+
Q as n,
|
|
1844
|
+
ir as p,
|
|
1845
|
+
Ht as u,
|
|
1846
|
+
ar as v
|
|
1847
|
+
};
|
|
1848
|
+
//# sourceMappingURL=index-D5CazY1_.js.map
|