boss-web-player-sdk 1.1.12 → 1.1.13
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/README.md +18 -18
- package/dist/boss-web-player-sdk.css +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +14 -0
- package/dist/core.js +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +14 -0
- package/dist/index.js +832 -768
- package/dist/index.js.map +1 -1
- package/dist/{src-DF41hY2C.js → src-CcXy_WIu.js} +17 -11
- package/dist/{src-DF41hY2C.js.map → src-CcXy_WIu.js.map} +1 -1
- package/dist/{src-CZenCGCL.cjs → src-ynqyJ4on.cjs} +5 -5
- package/dist/{src-CZenCGCL.cjs.map → src-ynqyJ4on.cjs.map} +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as e, t, u as n } from "./src-
|
|
1
|
+
import { c as e, t, u as n } from "./src-CcXy_WIu.js";
|
|
2
2
|
import { createContext as r, createElement as i, forwardRef as a, useCallback as o, useContext as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
3
3
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
4
4
|
import { createRoot as ee } from "react-dom/client";
|
|
@@ -179,13 +179,26 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
179
179
|
}]]), pe = g("chevron-left", [["path", {
|
|
180
180
|
d: "m15 18-6-6 6-6",
|
|
181
181
|
key: "1wnfg3"
|
|
182
|
-
}]]), me = g("
|
|
182
|
+
}]]), me = g("external-link", [
|
|
183
|
+
["path", {
|
|
184
|
+
d: "M15 3h6v6",
|
|
185
|
+
key: "1q9fwt"
|
|
186
|
+
}],
|
|
187
|
+
["path", {
|
|
188
|
+
d: "M10 14 21 3",
|
|
189
|
+
key: "gplh6r"
|
|
190
|
+
}],
|
|
191
|
+
["path", {
|
|
192
|
+
d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",
|
|
193
|
+
key: "a6xqqp"
|
|
194
|
+
}]
|
|
195
|
+
]), he = g("gauge", [["path", {
|
|
183
196
|
d: "m12 14 4-4",
|
|
184
197
|
key: "9kzdfg"
|
|
185
198
|
}], ["path", {
|
|
186
199
|
d: "M3.34 19a10 10 0 1 1 17.32 0",
|
|
187
200
|
key: "19p75a"
|
|
188
|
-
}]]),
|
|
201
|
+
}]]), ge = g("languages", [
|
|
189
202
|
["path", {
|
|
190
203
|
d: "m5 8 6 6",
|
|
191
204
|
key: "1wu5hv"
|
|
@@ -210,7 +223,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
210
223
|
d: "M14 18h6",
|
|
211
224
|
key: "1m8k6r"
|
|
212
225
|
}]
|
|
213
|
-
]),
|
|
226
|
+
]), _e = g("list-video", [
|
|
214
227
|
["path", {
|
|
215
228
|
d: "M21 5H3",
|
|
216
229
|
key: "1fi0y6"
|
|
@@ -227,7 +240,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
227
240
|
d: "M15 12.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997a1 1 0 0 1-1.517-.86z",
|
|
228
241
|
key: "ms4nik"
|
|
229
242
|
}]
|
|
230
|
-
]),
|
|
243
|
+
]), ve = g("maximize", [
|
|
231
244
|
["path", {
|
|
232
245
|
d: "M8 3H5a2 2 0 0 0-2 2v3",
|
|
233
246
|
key: "1dcmit"
|
|
@@ -244,7 +257,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
244
257
|
d: "M16 21h3a2 2 0 0 0 2-2v-3",
|
|
245
258
|
key: "18trek"
|
|
246
259
|
}]
|
|
247
|
-
]),
|
|
260
|
+
]), ye = g("minimize", [
|
|
248
261
|
["path", {
|
|
249
262
|
d: "M8 3v3a2 2 0 0 1-2 2H3",
|
|
250
263
|
key: "hohbtr"
|
|
@@ -261,7 +274,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
261
274
|
d: "M16 21v-3a2 2 0 0 1 2-2h3",
|
|
262
275
|
key: "ph8mxp"
|
|
263
276
|
}]
|
|
264
|
-
]),
|
|
277
|
+
]), v = g("pause", [["rect", {
|
|
265
278
|
x: "14",
|
|
266
279
|
y: "3",
|
|
267
280
|
width: "5",
|
|
@@ -275,7 +288,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
275
288
|
height: "18",
|
|
276
289
|
rx: "1",
|
|
277
290
|
key: "1wsw3u"
|
|
278
|
-
}]]),
|
|
291
|
+
}]]), be = g("picture-in-picture", [
|
|
279
292
|
["path", {
|
|
280
293
|
d: "M2 10h6V4",
|
|
281
294
|
key: "zwrco"
|
|
@@ -300,28 +313,28 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
300
313
|
rx: "1",
|
|
301
314
|
key: "1wjs3o"
|
|
302
315
|
}]
|
|
303
|
-
]),
|
|
316
|
+
]), xe = g("play", [["path", {
|
|
304
317
|
d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
|
|
305
318
|
key: "10ikf1"
|
|
306
|
-
}]]),
|
|
319
|
+
}]]), Se = g("rotate-ccw", [["path", {
|
|
307
320
|
d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",
|
|
308
321
|
key: "1357e3"
|
|
309
322
|
}], ["path", {
|
|
310
323
|
d: "M3 3v5h5",
|
|
311
324
|
key: "1xhq8a"
|
|
312
|
-
}]]),
|
|
325
|
+
}]]), Ce = g("rotate-cw", [["path", {
|
|
313
326
|
d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",
|
|
314
327
|
key: "1p45f6"
|
|
315
328
|
}], ["path", {
|
|
316
329
|
d: "M21 3v5h-5",
|
|
317
330
|
key: "1q7to0"
|
|
318
|
-
}]]),
|
|
331
|
+
}]]), we = g("volume-1", [["path", {
|
|
319
332
|
d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
|
|
320
333
|
key: "uqj9uw"
|
|
321
334
|
}], ["path", {
|
|
322
335
|
d: "M16 9a5 5 0 0 1 0 6",
|
|
323
336
|
key: "1q6k2b"
|
|
324
|
-
}]]),
|
|
337
|
+
}]]), Te = g("volume-2", [
|
|
325
338
|
["path", {
|
|
326
339
|
d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
|
|
327
340
|
key: "uqj9uw"
|
|
@@ -334,7 +347,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
334
347
|
d: "M19.364 18.364a9 9 0 0 0 0-12.728",
|
|
335
348
|
key: "ijwkga"
|
|
336
349
|
}]
|
|
337
|
-
]),
|
|
350
|
+
]), Ee = g("volume-x", [
|
|
338
351
|
["path", {
|
|
339
352
|
d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
|
|
340
353
|
key: "uqj9uw"
|
|
@@ -353,15 +366,15 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
353
366
|
y2: "15",
|
|
354
367
|
key: "5ykzw1"
|
|
355
368
|
}]
|
|
356
|
-
]),
|
|
369
|
+
]), De = g("volume", [["path", {
|
|
357
370
|
d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
|
|
358
371
|
key: "uqj9uw"
|
|
359
|
-
}]]),
|
|
372
|
+
}]]), Oe = 1e4, ke = !1, Ae = (e) => {
|
|
360
373
|
let t = e.match(/#EXT-X-TITLE:(.+)/);
|
|
361
374
|
if (t?.[1]?.trim()) return t[1].trim();
|
|
362
375
|
let n = e.match(/#EXT-X-SESSION-DATA:[^\n]*DATA-ID="[^"]*title[^"]*"[^\n]*VALUE="([^"]+)"/i);
|
|
363
376
|
return n?.[1]?.trim() ? n[1].trim() : null;
|
|
364
|
-
},
|
|
377
|
+
}, je = (e) => {
|
|
365
378
|
if (!e || e.length < 10 || e[0] !== 73 || e[1] !== 68 || e[2] !== 51) return null;
|
|
366
379
|
let t = e[3], n = (e[6] & 127) << 21 | (e[7] & 127) << 14 | (e[8] & 127) << 7 | e[9] & 127, r = Math.min(10 + n, e.length), i = 10;
|
|
367
380
|
for (; i + 10 <= r;) {
|
|
@@ -374,7 +387,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
374
387
|
i += 10 + a;
|
|
375
388
|
}
|
|
376
389
|
return null;
|
|
377
|
-
},
|
|
390
|
+
}, y = ({ size: e = 20 }) => /* @__PURE__ */ m("svg", {
|
|
378
391
|
width: e,
|
|
379
392
|
height: e,
|
|
380
393
|
viewBox: "0 0 24 24",
|
|
@@ -394,7 +407,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
394
407
|
/* @__PURE__ */ p("path", { d: "M7 9v6M7 12h3M10 9v6" }),
|
|
395
408
|
/* @__PURE__ */ p("path", { d: "M14 9h1.5a3 3 0 0 1 0 6H14z" })
|
|
396
409
|
]
|
|
397
|
-
}),
|
|
410
|
+
}), Me = ({ size: e = 20 }) => /* @__PURE__ */ m("svg", {
|
|
398
411
|
width: e,
|
|
399
412
|
height: e,
|
|
400
413
|
viewBox: "0 0 24 24",
|
|
@@ -414,10 +427,10 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
414
427
|
/* @__PURE__ */ p("path", { d: "M7 9v6M7 12h3M10 9v6" }),
|
|
415
428
|
/* @__PURE__ */ p("path", { d: "M14 9h1.5a3 3 0 0 1 0 6H14z" })
|
|
416
429
|
]
|
|
417
|
-
}),
|
|
430
|
+
}), Ne = (e) => {
|
|
418
431
|
let t = e.replace("#", "");
|
|
419
432
|
return t.length === 6 ? `${parseInt(t.substring(0, 2), 16)}, ${parseInt(t.substring(2, 4), 16)}, ${parseInt(t.substring(4, 6), 16)}` : t.length === 3 ? `${parseInt(t[0] + t[0], 16)}, ${parseInt(t[1] + t[1], 16)}, ${parseInt(t[2] + t[2], 16)}` : "99, 102, 241";
|
|
420
|
-
},
|
|
433
|
+
}, Pe = {
|
|
421
434
|
en: "English",
|
|
422
435
|
eng: "English",
|
|
423
436
|
fr: "French",
|
|
@@ -440,73 +453,73 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
440
453
|
hi: "Hindi",
|
|
441
454
|
ta: "Tamil",
|
|
442
455
|
tam: "Tamil"
|
|
443
|
-
},
|
|
456
|
+
}, Fe = (e) => {
|
|
444
457
|
if (!e) return null;
|
|
445
458
|
let t = e.trim().toLowerCase(), n = t.match(/^(en|eng|fr|fre|fra|es|spa|de|ger|deu|it|ita|pt|por|ja|zh|ko|ru|ar|hi|ta|tam)/);
|
|
446
|
-
if (n &&
|
|
447
|
-
for (let [e, n] of Object.entries(
|
|
459
|
+
if (n && Pe[n[0]]) return Pe[n[0]];
|
|
460
|
+
for (let [e, n] of Object.entries(Pe)) if (t.includes(e)) return n;
|
|
448
461
|
return /english|anglais|ingles/i.test(t) ? "English" : /french|français/i.test(t) ? "French" : /spanish|español/i.test(t) ? "Spanish" : /german|deutsch/i.test(t) ? "German" : /italian|italiano/i.test(t) ? "Italian" : /portuguese|português/i.test(t) ? "Portuguese" : /japanese|nihongo/i.test(t) ? "Japanese" : /chinese|中文/i.test(t) ? "Chinese" : /korean|한국어/i.test(t) ? "Korean" : /tamil|தமிழ்/i.test(t) ? "Tamil" : /russian|русский/i.test(t) ? "Russian" : /arabic|العربية/i.test(t) ? "Arabic" : /hindi|हिन्दी/i.test(t) ? "Hindi" : null;
|
|
449
462
|
}, b = (e) => {
|
|
450
463
|
if (e.lang) {
|
|
451
|
-
let t =
|
|
464
|
+
let t = Fe(e.lang);
|
|
452
465
|
if (t) return t;
|
|
453
466
|
}
|
|
454
467
|
if (e.label) {
|
|
455
468
|
let t = e.label.trim(), n = t.split(/[#\d\.\s\-_/|:]+/).filter(Boolean);
|
|
456
469
|
for (let e = n.length - 1; e >= 0; --e) {
|
|
457
|
-
let t =
|
|
470
|
+
let t = Fe(n[e]);
|
|
458
471
|
if (t) return t;
|
|
459
472
|
}
|
|
460
473
|
let r = t.replace(/^[#\d\.\s]+/, "").trim();
|
|
461
|
-
return
|
|
474
|
+
return Fe(r) || r;
|
|
462
475
|
}
|
|
463
476
|
return "Unknown";
|
|
464
|
-
},
|
|
477
|
+
}, Ie = (e) => {
|
|
465
478
|
let t = /* @__PURE__ */ new Set();
|
|
466
479
|
return e.filter((e) => {
|
|
467
480
|
let n = `${b(e).toLowerCase()}|${(e.lang || "").trim().toLowerCase()}`;
|
|
468
481
|
return t.has(n) ? !1 : (t.add(n), !0);
|
|
469
482
|
});
|
|
470
|
-
},
|
|
483
|
+
}, Le = (e) => {
|
|
471
484
|
let t = (e ?? "").split(":").map(Number);
|
|
472
485
|
return (t[0] || 0) * 3600 + (t[1] || 0) * 60 + (t[2] || 0);
|
|
473
|
-
},
|
|
474
|
-
let
|
|
475
|
-
!e ||
|
|
476
|
-
},
|
|
477
|
-
|
|
478
|
-
},
|
|
486
|
+
}, Re = ({ src: r, autoplay: i = !1, muted: a = !1, chapters: s = [], keyMoments: ee, subtitles: ne = [], watermark: re, themeColor: h = "#6366f1", drmConfig: ie, firebaseConfig: ae, onAnalyticsEvent: oe, onAdBreakChange: se, onKeyMomentsLoaded: ce, enableControls: le = !0, enableChromecast: g, enableKeyMoments: Pe, enableSubtitles: Fe, enableQuality: Re, enablePlaybackSpeed: ze, enablePiP: Be, enableFullscreen: Ve = !0, autoFullscreen: He = !1, watchProgressInterval: Ue = 30, subtitleStyle: We = {}, resolvedEntitlement: Ge, licenseKey: Ke, title: x, chaptersDisplayMode: qe = "strip", volumeControlType: Je = "slider", urlTransformer: Ye, pauseAdOnTabSwitch: Xe = !0, enableSkipAd: Ze = !1, skipAdAfterSeconds: Qe = 5, overlayAdUrl: $e, adTrackingUrl: et, sources: S, activeSourceIndex: C = 0, onSourceChange: tt, initialTime: w, onTimeUpdate: nt }) => {
|
|
487
|
+
let rt = Ye ?? ((e) => e), T = u(null), it = u(null), at = u(!1), E = u(null), ot = u(0), st = u(null), D = u(null), ct = u(null), lt = u(null), ut = u(!1), O = u(!1), k = u(null), A = u(null), j = u(null), dt = u(null), ft = u(() => {}), M = u(null), pt = u(null), mt = (e) => {
|
|
488
|
+
!e || pt.current !== null || (pt.current = e.muted, e.muted = !0);
|
|
489
|
+
}, ht = (e) => {
|
|
490
|
+
pt.current !== null && (e && (e.muted = pt.current), pt.current = null);
|
|
491
|
+
}, gt = u(null), _t = u(null), vt = u(null), yt = u(null), N = u(null), bt = u(null), xt = u(S), St = u(tt), Ct = u(!1), P = u(null), F = u(null), I = u(null), wt = u(0), [Tt, Et] = d(!1), Dt = u(!1), Ot = u(null), [kt, At] = d(null);
|
|
479
492
|
c(() => {
|
|
480
|
-
if (typeof window > "u" ||
|
|
493
|
+
if (typeof window > "u" || ke) return;
|
|
481
494
|
let e = window.requestAnimationFrame(() => {
|
|
482
|
-
let e =
|
|
495
|
+
let e = T.current;
|
|
483
496
|
if (!e) return;
|
|
484
497
|
let t = window.getComputedStyle(e);
|
|
485
|
-
t.overflow !== "hidden" && t.borderTopLeftRadius === "0px" && (
|
|
498
|
+
t.overflow !== "hidden" && t.borderTopLeftRadius === "0px" && (ke = !0, console.warn("[boss-web-player-sdk] Player styles appear to be missing — the player will look broken/unstyled.\nImport the stylesheet once at your app entry point:\n import 'boss-web-player-sdk/css';"));
|
|
486
499
|
});
|
|
487
500
|
return () => window.cancelAnimationFrame(e);
|
|
488
501
|
}, []), c(() => {
|
|
489
|
-
let e =
|
|
502
|
+
let e = T.current;
|
|
490
503
|
if (!e) return;
|
|
491
504
|
let t = new ResizeObserver((e) => {
|
|
492
|
-
for (let t of e)
|
|
505
|
+
for (let t of e) Et(t.contentRect.width <= 768);
|
|
493
506
|
});
|
|
494
|
-
return t.observe(e),
|
|
507
|
+
return t.observe(e), Et(e.getBoundingClientRect().width <= 768), () => t.disconnect();
|
|
495
508
|
}, []);
|
|
496
|
-
let [L,
|
|
497
|
-
enableSubtitles:
|
|
498
|
-
enableChromecast:
|
|
499
|
-
enableKeyMoments:
|
|
500
|
-
enableQuality:
|
|
501
|
-
enablePlaybackSpeed:
|
|
502
|
-
enablePiP:
|
|
503
|
-
allowAirplay:
|
|
504
|
-
allowMultipleAudio:
|
|
505
|
-
m3u8_playback:
|
|
506
|
-
drm_protection:
|
|
507
|
-
}, [
|
|
508
|
-
|
|
509
|
-
let
|
|
509
|
+
let [L, jt] = d(null), Mt = Ge ?? null, Nt = Mt != null, Pt = Mt?.features ?? {}, Ft = Nt ? !!(Pt.drm_protection && !Ke) : !1, R = {
|
|
510
|
+
enableSubtitles: Nt ? !!Pt.subtitle_support : typeof Fe == "boolean" ? Fe : !0,
|
|
511
|
+
enableChromecast: Nt ? !!Pt.chromecast : typeof g == "boolean" ? g : !0,
|
|
512
|
+
enableKeyMoments: Nt ? !!Pt.key_moments : typeof Pe == "boolean" ? Pe : !0,
|
|
513
|
+
enableQuality: Nt ? !!Pt.multiple_resolution : typeof Re == "boolean" ? Re : !0,
|
|
514
|
+
enablePlaybackSpeed: Nt ? !!Pt.playback_speed : typeof ze == "boolean" ? ze : !0,
|
|
515
|
+
enablePiP: Nt ? !!Pt.picture_in_picture : typeof Be == "boolean" ? Be : !0,
|
|
516
|
+
allowAirplay: Nt ? !!Pt.airplay : !1,
|
|
517
|
+
allowMultipleAudio: Nt ? !!Pt.multiple_audio : !0,
|
|
518
|
+
m3u8_playback: Nt ? !!Pt.m3u8_playback : !0,
|
|
519
|
+
drm_protection: Nt ? !!Pt.drm_protection : !1
|
|
520
|
+
}, [It, Lt] = d(!1), [Rt, zt] = d(0), [Bt, Vt] = d(!1), [z, Ht] = d(0), [Ut, Wt] = d(0), [Gt, Kt] = d(1), [qt, Jt] = d(!1), [Yt, Xt] = d(!1), [Zt, Qt] = d(!1), [$t, en] = d(!1), [tn, nn] = d(!1), rn = Tt || (Zt || $t) && tn, [an, on] = d(!1), [sn, cn] = d(!1), [B, ln] = d([]), V = u([]), un = u(/* @__PURE__ */ new Set()), dn = S && S.length > 0 ? S.map((e) => e.url).join("|") : r, [fn, pn] = d(/* @__PURE__ */ new Set()), [mn, hn] = d(dn), gn = u(null), _n = u(!1), vn = u(null);
|
|
521
|
+
mn !== dn && (hn(dn), pn(/* @__PURE__ */ new Set()), un.current = /* @__PURE__ */ new Set(), gn.current = null, _n.current = !1);
|
|
522
|
+
let yn = u(null), bn = u(!1), [xn, Sn] = d([]), [Cn, wn] = d(null), Tn = u([]), En = u(null), Dn = u(/* @__PURE__ */ new Set()), [On, kn] = d([]), An = u([]), jn = l(() => B.reduce((e, t) => e + (t.endTime - t.startTime), 0), [B]), Mn = Ut > 0 ? Math.max(0, Ut - jn) : 0, H = B.length > 0 && Mn > 0 ? Mn : Ut, U = o((e) => {
|
|
510
523
|
let t = e;
|
|
511
524
|
for (let n of B) e >= n.endTime ? t -= n.endTime - n.startTime : e >= n.startTime && (t -= e - n.startTime);
|
|
512
525
|
return Math.max(0, t);
|
|
@@ -514,31 +527,31 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
514
527
|
let t = e;
|
|
515
528
|
for (let e of B) t >= e.startTime && (t += e.endTime - e.startTime);
|
|
516
529
|
return t;
|
|
517
|
-
}, [B]), [
|
|
530
|
+
}, [B]), [Nn, Pn] = d([]), [Fn, In] = d({
|
|
518
531
|
id: -1,
|
|
519
532
|
height: 0,
|
|
520
533
|
width: 0,
|
|
521
534
|
bitrate: 0,
|
|
522
535
|
label: "Auto"
|
|
523
|
-
}), [
|
|
536
|
+
}), [Ln, Rn] = d(""), [G, zn] = d("off"), [Bn, Vn] = d(Ie(ne)), [Hn, Un] = d([]), [Wn, Gn] = d(0);
|
|
524
537
|
c(() => {
|
|
525
538
|
if (L) {
|
|
526
539
|
let e = L.subtitles.getTracks();
|
|
527
|
-
|
|
528
|
-
} else
|
|
540
|
+
Vn(Ie([...ne, ...e.filter((e) => !ne.some((t) => t.id === e.id))]));
|
|
541
|
+
} else Vn(Ie(ne));
|
|
529
542
|
}, [ne.map((e) => e.id).join(","), L]);
|
|
530
|
-
let [
|
|
543
|
+
let [Kn, qn] = d({
|
|
531
544
|
chapter: null,
|
|
532
545
|
index: -1
|
|
533
|
-
}), [K,
|
|
546
|
+
}), [K, Jn] = d(ee || s || []), [q, J] = d("none"), [Yn, Xn] = d(1), [Zn, Qn] = d(!1), [$n, er] = d({}), [tr, nr] = d(""), [rr, ir] = d(null), ar = u(!1), or = JSON.stringify(K.map((e) => ({
|
|
534
547
|
title: e.title,
|
|
535
548
|
startTime: e.startTime
|
|
536
549
|
})));
|
|
537
550
|
c(() => {
|
|
538
|
-
|
|
551
|
+
Jn(ee || s || []);
|
|
539
552
|
}, [(ee || s || []).map((e) => `${e.startTime}:${e.title}`).join(",")]), c(() => {
|
|
540
553
|
if (!r || !K || K.length === 0) return;
|
|
541
|
-
|
|
554
|
+
er({});
|
|
542
555
|
let e = document.createElement("video");
|
|
543
556
|
e.muted = !0, e.preload = "metadata", e.crossOrigin = "anonymous", e.style.cssText = "position:fixed;top:0;left:0;width:10px;height:10px;opacity:0.01;pointer-events:none;z-index:-9999;", document.body.appendChild(e);
|
|
544
557
|
let t = null, i = r.includes(".m3u8"), a = document.createElement("canvas");
|
|
@@ -554,7 +567,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
554
567
|
if (o && e.readyState >= 2) {
|
|
555
568
|
o.drawImage(e, 0, 0, a.width, a.height);
|
|
556
569
|
let t = a.toDataURL("image/jpeg", .8);
|
|
557
|
-
|
|
570
|
+
er((e) => ({
|
|
558
571
|
...e,
|
|
559
572
|
[s]: t
|
|
560
573
|
})), s++, l();
|
|
@@ -568,32 +581,32 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
568
581
|
xhrSetup: (e, t) => {
|
|
569
582
|
let n = ie?.authToken;
|
|
570
583
|
try {
|
|
571
|
-
let r =
|
|
584
|
+
let r = rt(t), i = new URL(r, window.location.origin);
|
|
572
585
|
n && i.searchParams.set("token", n), e.open("GET", i.toString(), !0);
|
|
573
586
|
} catch (e) {
|
|
574
587
|
console.error("[WebVideoPlayer tempHls] xhrSetup error:", e);
|
|
575
588
|
}
|
|
576
589
|
}
|
|
577
|
-
}), t.loadSource(
|
|
590
|
+
}), t.loadSource(rt(r)), t.attachMedia(e)) : e.src = r, e.readyState >= 2 && d();
|
|
578
591
|
let f = () => {
|
|
579
592
|
e.removeEventListener("seeked", u), e.removeEventListener("canplay", d), t && t.destroy(), document.body.contains(e) && document.body.removeChild(e);
|
|
580
593
|
};
|
|
581
594
|
return f;
|
|
582
|
-
}, [r,
|
|
583
|
-
let [Y,
|
|
595
|
+
}, [r, or]);
|
|
596
|
+
let [Y, sr] = d(null), [cr, lr] = d(null), ur = u(!1), [dr, fr] = d(!1), [pr, mr] = d(!1), [hr, gr] = d(null), [_r, vr] = d(null), [yr, br] = d(0), [xr, Sr] = d(0), [Cr, wr] = d(null), [Tr, Er] = d(null), [X, Dr] = d(null);
|
|
584
597
|
c(() => {
|
|
585
|
-
if (
|
|
598
|
+
if (dt.current && !dt.current.querySelector("google-cast-launcher")) {
|
|
586
599
|
let e = document.createElement("google-cast-launcher");
|
|
587
|
-
e.style.cursor = "pointer", e.style.width = "100%", e.style.height = "100%", e.style.display = "block",
|
|
600
|
+
e.style.cursor = "pointer", e.style.width = "100%", e.style.height = "100%", e.style.display = "block", dt.current.appendChild(e);
|
|
588
601
|
}
|
|
589
602
|
}, []), c(() => {
|
|
590
603
|
if (!L) {
|
|
591
|
-
|
|
604
|
+
fr(!1), mr(!1), gr(null);
|
|
592
605
|
return;
|
|
593
606
|
}
|
|
594
|
-
let e = (e) =>
|
|
607
|
+
let e = (e) => fr(e), t = () => {
|
|
595
608
|
let e = L.getVideoElement(), t = !!e?.webkitCurrentPlaybackTargetIsWireless;
|
|
596
|
-
|
|
609
|
+
mr(t), gr(t ? e.webkitCurrentPlaybackTargetName || "AirPlay device" : null);
|
|
597
610
|
};
|
|
598
611
|
e(L.casting.isAirPlayAvailable()), t();
|
|
599
612
|
let n = L.getVideoElement(), r = (t) => {
|
|
@@ -605,21 +618,21 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
605
618
|
"webkitShowPlaybackTargetPicker" in n && (n.removeEventListener("webkitplaybacktargetavailabilitychanged", r), n.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged", i));
|
|
606
619
|
};
|
|
607
620
|
}, [L]);
|
|
608
|
-
let [
|
|
609
|
-
|
|
610
|
-
let e =
|
|
611
|
-
|
|
612
|
-
|
|
621
|
+
let [Or, kr] = d(""), [Ar, jr] = d(!0), [Z, Mr] = d(!1), Nr = u(null), Pr = u(!1), Fr = u(!1), Ir = u("none"), Lr = u(ne), Rr = () => {
|
|
622
|
+
jr(!0), Nr.current && window.clearTimeout(Nr.current);
|
|
623
|
+
let e = Dt.current ? 3500 : 1e4;
|
|
624
|
+
Nr.current = window.setTimeout(() => {
|
|
625
|
+
Pr.current && Ir.current === "none" && jr(!1);
|
|
613
626
|
}, e);
|
|
614
|
-
},
|
|
627
|
+
}, zr = o((e) => {
|
|
615
628
|
N.current &&= (clearTimeout(N.current), null);
|
|
616
|
-
let t =
|
|
617
|
-
|
|
629
|
+
let t = xt.current, n = t?.[e]?.label ?? "This format", r = t?.[0]?.label ?? "default";
|
|
630
|
+
bt.current = null, ir(`${n} isn't supported on this device. Switched to ${r}.`), window.setTimeout(() => ir(null), 4e3), St.current?.(0);
|
|
618
631
|
}, []);
|
|
619
632
|
c(() => {
|
|
620
|
-
if (!
|
|
633
|
+
if (!T.current) return;
|
|
621
634
|
let o = document.createElement("video");
|
|
622
|
-
o.muted = !0, o.preload = "metadata", o.crossOrigin = "anonymous", o.style.cssText = "display:none;position:absolute;pointer-events:none;", document.body.appendChild(o),
|
|
635
|
+
o.muted = !0, o.preload = "metadata", o.crossOrigin = "anonymous", o.style.cssText = "display:none;position:absolute;pointer-events:none;", document.body.appendChild(o), D.current = o;
|
|
623
636
|
let s = r.includes(".m3u8");
|
|
624
637
|
if (s && n.isSupported()) {
|
|
625
638
|
let e = new n({
|
|
@@ -628,41 +641,41 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
628
641
|
xhrSetup: (e, t) => {
|
|
629
642
|
let n = ie?.authToken;
|
|
630
643
|
try {
|
|
631
|
-
let r =
|
|
644
|
+
let r = rt(t), i = new URL(r, window.location.origin);
|
|
632
645
|
n && i.searchParams.set("token", n), e.open("GET", i.toString(), !0);
|
|
633
646
|
} catch (e) {
|
|
634
647
|
console.error("[WebVideoPlayer hiddenHls] xhrSetup error:", e);
|
|
635
648
|
}
|
|
636
649
|
}
|
|
637
650
|
});
|
|
638
|
-
e.loadSource(
|
|
639
|
-
if (
|
|
640
|
-
let n =
|
|
641
|
-
n &&
|
|
651
|
+
e.loadSource(rt(r)), e.attachMedia(o), ct.current = e, e.on(n.Events.MANIFEST_LOADED, (e, t) => {
|
|
652
|
+
if (x) return;
|
|
653
|
+
let n = Ae(t?.networkDetails?.responseText ?? "");
|
|
654
|
+
n && kr(n);
|
|
642
655
|
}), e.on(n.Events.FRAG_PARSING_METADATA, (e, t) => {
|
|
643
|
-
if (!(
|
|
644
|
-
let t =
|
|
656
|
+
if (!(x || Or)) for (let e of t?.samples ?? []) {
|
|
657
|
+
let t = je(e.data);
|
|
645
658
|
if (t) {
|
|
646
|
-
|
|
659
|
+
kr(t);
|
|
647
660
|
break;
|
|
648
661
|
}
|
|
649
662
|
}
|
|
650
663
|
});
|
|
651
664
|
} else s && o.canPlayType("application/vnd.apple.mpegurl"), o.src = r;
|
|
652
665
|
o.addEventListener("seeked", () => {
|
|
653
|
-
let e =
|
|
666
|
+
let e = st.current;
|
|
654
667
|
if (!e) return;
|
|
655
668
|
let t = e.getContext("2d");
|
|
656
|
-
t && o.readyState >= 2 && (t.drawImage(o, 0, 0, e.width, e.height),
|
|
669
|
+
t && o.readyState >= 2 && (t.drawImage(o, 0, 0, e.width, e.height), wr(e.toDataURL("image/jpeg", .82)));
|
|
657
670
|
});
|
|
658
671
|
let c;
|
|
659
672
|
if (ae) {
|
|
660
673
|
let t = new e(ae);
|
|
661
|
-
|
|
674
|
+
it.current = t, c = t.createCallback();
|
|
662
675
|
}
|
|
663
|
-
if (
|
|
676
|
+
if (Ft) return;
|
|
664
677
|
let l = new t({
|
|
665
|
-
container:
|
|
678
|
+
container: T.current,
|
|
666
679
|
src: r,
|
|
667
680
|
autoplay: i,
|
|
668
681
|
muted: a,
|
|
@@ -678,190 +691,198 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
678
691
|
...ie
|
|
679
692
|
},
|
|
680
693
|
analyticsCallback: (e) => {
|
|
681
|
-
if (e.sessionId && (
|
|
694
|
+
if (e.sessionId && (gn.current === null ? gn.current = e.sessionId : e.sessionId !== gn.current && (e = {
|
|
682
695
|
...e,
|
|
683
|
-
sessionId:
|
|
696
|
+
sessionId: gn.current
|
|
684
697
|
})), e.eventType === "session_start") {
|
|
685
|
-
if (
|
|
686
|
-
|
|
698
|
+
if (_n.current) return;
|
|
699
|
+
_n.current = !0;
|
|
687
700
|
}
|
|
688
701
|
c?.(e), oe && oe(e);
|
|
689
702
|
},
|
|
690
|
-
analyticsSessionSeed:
|
|
691
|
-
watchProgressInterval:
|
|
703
|
+
analyticsSessionSeed: vn.current?.key === dn ? vn.current.snapshot : void 0,
|
|
704
|
+
watchProgressInterval: Ue * 1e3,
|
|
692
705
|
themeColor: h,
|
|
693
|
-
urlTransformer:
|
|
706
|
+
urlTransformer: Ye
|
|
694
707
|
});
|
|
695
708
|
l.on("keymomentsloaded", (e) => {
|
|
696
|
-
|
|
709
|
+
Jn(e), ce && ce(e);
|
|
697
710
|
}), l.on("chaptersloaded", (e) => {
|
|
698
|
-
|
|
711
|
+
Jn(e), ce && ce(e);
|
|
699
712
|
}), l.on("play", () => {
|
|
700
|
-
|
|
701
|
-
}), l.on("pause", () =>
|
|
702
|
-
|
|
713
|
+
Vt(!0), cn(!1), p(l.getCurrentTime(), 1);
|
|
714
|
+
}), l.on("pause", () => {
|
|
715
|
+
Vt(!1), p(l.getCurrentTime(), 0);
|
|
716
|
+
}), l.on("ended", () => {
|
|
717
|
+
Vt(!1), cn(!0);
|
|
703
718
|
});
|
|
704
719
|
let u = () => {
|
|
705
|
-
M.current && (M.current.style.opacity = "1"),
|
|
720
|
+
M.current && (M.current.style.opacity = "1"), mt(l.getVideoElement());
|
|
706
721
|
}, d = () => {
|
|
707
722
|
requestAnimationFrame(() => {
|
|
708
723
|
requestAnimationFrame(() => {
|
|
709
|
-
M.current && (M.current.style.opacity = "0"),
|
|
724
|
+
M.current && (M.current.style.opacity = "0"), ht(l.getVideoElement());
|
|
710
725
|
});
|
|
711
726
|
});
|
|
712
727
|
}, f = (e) => {
|
|
713
|
-
|
|
714
|
-
let t =
|
|
715
|
-
|
|
716
|
-
|
|
728
|
+
O.current = !0;
|
|
729
|
+
let t = _t.current ?? e + .5;
|
|
730
|
+
_t.current = null, k.current = t, A.current = l.getCurrentTime(), u(), l.seek(t), j.current && window.clearTimeout(j.current), j.current = window.setTimeout(() => {
|
|
731
|
+
O.current = !1, k.current = null, A.current = null, j.current = null, d();
|
|
717
732
|
}, 3e3);
|
|
718
733
|
};
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
734
|
+
gt.current = f;
|
|
735
|
+
let p = (e, t) => {
|
|
736
|
+
if (!("mediaSession" in navigator) || !navigator.mediaSession.setPositionState) return;
|
|
737
|
+
let n = l.getDuration(), r = V.current.find((t) => e >= t.startTime && e < t.endTime);
|
|
738
|
+
if (r) {
|
|
739
|
+
let n = r.endTime - r.startTime, i = Math.max(0, e - r.startTime);
|
|
740
|
+
if (n > 0) try {
|
|
741
|
+
navigator.mediaSession.setPositionState({
|
|
742
|
+
duration: n,
|
|
743
|
+
playbackRate: t,
|
|
744
|
+
position: Math.min(i, n)
|
|
745
|
+
});
|
|
746
|
+
} catch {}
|
|
747
|
+
} else {
|
|
748
|
+
let r = V.current.reduce((e, t) => e + (t.endTime - t.startTime), 0), i = n > 0 ? Math.max(0, n - r) : 0, a = e;
|
|
749
|
+
for (let t of V.current) e >= t.endTime ? a -= t.endTime - t.startTime : e >= t.startTime && (a -= e - t.startTime);
|
|
750
|
+
a = Math.max(0, a);
|
|
751
|
+
let o = V.current.length > 0 && i > 0 ? i : n;
|
|
752
|
+
if (o > 0) try {
|
|
753
|
+
navigator.mediaSession.setPositionState({
|
|
754
|
+
duration: o,
|
|
755
|
+
playbackRate: t,
|
|
756
|
+
position: Math.min(a, o)
|
|
757
|
+
});
|
|
758
|
+
} catch {}
|
|
759
|
+
}
|
|
760
|
+
};
|
|
761
|
+
if (l.on("timeupdate", (e) => {
|
|
762
|
+
if (!O.current && F.current === null) {
|
|
763
|
+
let t = V.current.find((t) => un.current.has(t.startTime) && e >= t.startTime - .5 && e < t.endTime);
|
|
722
764
|
if (t) {
|
|
723
765
|
f(t.endTime);
|
|
724
766
|
return;
|
|
725
767
|
}
|
|
726
|
-
|
|
768
|
+
_t.current !== null && V.current.find((t) => e >= t.endTime - .5 && e < t.endTime) && u();
|
|
727
769
|
}
|
|
728
|
-
if (
|
|
729
|
-
|
|
730
|
-
|
|
770
|
+
if (O.current && k.current !== null) {
|
|
771
|
+
let t = k.current;
|
|
772
|
+
if (A.current !== null && t < A.current ? e <= t + 2 && e >= t - 2 : e >= t - 2) O.current = !1, k.current = null, A.current = null, j.current &&= (window.clearTimeout(j.current), null), !V.current.some((t) => e >= t.startTime && e < t.endTime) && _t.current === null && d();
|
|
773
|
+
else return;
|
|
774
|
+
}
|
|
775
|
+
Ht(e), wt.current = e;
|
|
731
776
|
let t = l.getDuration();
|
|
732
|
-
if (
|
|
777
|
+
if (Wt(t), F.current !== null && e >= F.current - 2) {
|
|
733
778
|
F.current = null, I.current &&= (window.clearTimeout(I.current), null);
|
|
734
|
-
let t = V.current.find((t) =>
|
|
779
|
+
let t = V.current.find((t) => un.current.has(t.startTime) && e >= t.startTime && e < t.endTime);
|
|
735
780
|
t && f(t.endTime), requestAnimationFrame(() => {
|
|
736
781
|
requestAnimationFrame(() => {
|
|
737
782
|
P.current && (P.current.style.opacity = "0");
|
|
738
783
|
});
|
|
739
784
|
});
|
|
740
785
|
}
|
|
741
|
-
if (!
|
|
786
|
+
if (!Ct.current && yt.current === null && w && w > 0 && t > 0 && w < t && (Ct.current = !0, F.current = w, l.seek(w), I.current && window.clearTimeout(I.current), I.current = window.setTimeout(() => {
|
|
742
787
|
F.current = null, I.current = null, P.current && (P.current.style.opacity = "0");
|
|
743
|
-
}, 4e3)),
|
|
744
|
-
let t =
|
|
745
|
-
(e >= t.startTimeSeconds + t.durationSeconds || e < t.startTimeSeconds) && (
|
|
788
|
+
}, 4e3)), nt?.(e), Tn.current.length > 0) if (En.current) {
|
|
789
|
+
let t = En.current;
|
|
790
|
+
(e >= t.startTimeSeconds + t.durationSeconds || e < t.startTimeSeconds) && (wn(null), En.current = null);
|
|
746
791
|
} else {
|
|
747
|
-
let t =
|
|
748
|
-
t && (
|
|
792
|
+
let t = Tn.current.find((t) => e >= t.startTimeSeconds && e < t.startTimeSeconds + t.durationSeconds && !Dn.current.has(t.availId));
|
|
793
|
+
t && (wn(t), En.current = t, t.impressionBeacons.forEach((e) => {
|
|
749
794
|
fetch(e, { mode: "no-cors" }).catch(() => {});
|
|
750
795
|
}));
|
|
751
796
|
}
|
|
752
797
|
let n = l.keyMoments.getCurrentMoment(e);
|
|
753
|
-
|
|
798
|
+
qn({
|
|
754
799
|
chapter: n.keyMoment,
|
|
755
800
|
index: n.index
|
|
756
|
-
}),
|
|
757
|
-
let t = l.getDuration(), n = V.current.find((t) => e >= t.startTime && e < t.endTime);
|
|
758
|
-
if (n) {
|
|
759
|
-
let t = n.endTime - n.startTime, r = Math.max(0, e - n.startTime);
|
|
760
|
-
if (t > 0) try {
|
|
761
|
-
navigator.mediaSession.setPositionState({
|
|
762
|
-
duration: t,
|
|
763
|
-
playbackRate: 1,
|
|
764
|
-
position: Math.min(r, t)
|
|
765
|
-
});
|
|
766
|
-
} catch {}
|
|
767
|
-
} else {
|
|
768
|
-
let n = V.current.reduce((e, t) => e + (t.endTime - t.startTime), 0), r = t > 0 ? Math.max(0, t - n) : 0, i = e;
|
|
769
|
-
for (let t of V.current) e >= t.endTime ? i -= t.endTime - t.startTime : e >= t.startTime && (i -= e - t.startTime);
|
|
770
|
-
i = Math.max(0, i);
|
|
771
|
-
let a = V.current.length > 0 && r > 0 ? r : t;
|
|
772
|
-
if (a > 0) try {
|
|
773
|
-
navigator.mediaSession.setPositionState({
|
|
774
|
-
duration: a,
|
|
775
|
-
playbackRate: 1,
|
|
776
|
-
position: Math.min(i, a)
|
|
777
|
-
});
|
|
778
|
-
} catch {}
|
|
779
|
-
}
|
|
780
|
-
}
|
|
801
|
+
}), p(e, +!l.getVideoElement().paused);
|
|
781
802
|
}), l.on("qualitylevels", (e) => {
|
|
782
|
-
Mn(e);
|
|
783
|
-
}), l.on("qualitychange", (e) => {
|
|
784
803
|
Pn(e);
|
|
804
|
+
}), l.on("qualitychange", (e) => {
|
|
805
|
+
In(e);
|
|
785
806
|
}), l.on("buffering", (e) => {
|
|
786
|
-
if (
|
|
787
|
-
let e =
|
|
788
|
-
|
|
807
|
+
if (Xt(e), !e && (N.current &&= (clearTimeout(N.current), null), bt.current = null, yt.current !== null)) {
|
|
808
|
+
let e = yt.current;
|
|
809
|
+
yt.current = null, Ct.current = !0, F.current = e, I.current && window.clearTimeout(I.current), I.current = window.setTimeout(() => {
|
|
789
810
|
F.current = null, I.current = null, P.current && (P.current.style.opacity = "0");
|
|
790
811
|
}, 4e3), l.seek(e);
|
|
791
812
|
}
|
|
792
813
|
}), l.on("adbreakchange", (e) => {
|
|
793
814
|
if (l.analytics.setAdBreak(e, l.getVideoElement()), se && se(e), e) {
|
|
794
815
|
let e = l.getCurrentTime(), t = V.current.find((t) => e >= t.startTime && e < t.endTime);
|
|
795
|
-
if (t &&
|
|
796
|
-
u(),
|
|
816
|
+
if (t && un.current.has(t.startTime)) {
|
|
817
|
+
u(), O.current || f(t.endTime);
|
|
797
818
|
return;
|
|
798
819
|
}
|
|
799
|
-
t && (
|
|
800
|
-
} else if (
|
|
801
|
-
let e =
|
|
802
|
-
|
|
803
|
-
|
|
820
|
+
t && (yn.current = t.startTime), Mr(!0), J("none"), d();
|
|
821
|
+
} else if (yn.current !== null && (un.current.add(yn.current), pn(new Set(un.current)), yn.current = null), Mr(!1), _t.current !== null) {
|
|
822
|
+
let e = _t.current;
|
|
823
|
+
_t.current = null, O.current = !0, k.current = e, A.current = l.getCurrentTime(), u(), l.seek(e), j.current && window.clearTimeout(j.current), j.current = window.setTimeout(() => {
|
|
824
|
+
O.current = !1, k.current = null, A.current = null, j.current = null, d();
|
|
804
825
|
}, 3e3);
|
|
805
826
|
}
|
|
806
827
|
}), l.on("adbreaksloaded", (e) => {
|
|
807
|
-
V.current = e,
|
|
828
|
+
V.current = e, ln(e);
|
|
808
829
|
}), l.on("volumechange", (e) => {
|
|
809
|
-
|
|
830
|
+
Kt(e.volume), pt.current === null && Jt(e.muted);
|
|
810
831
|
}), l.on("pipchange", (e) => {
|
|
811
|
-
|
|
832
|
+
on(e);
|
|
812
833
|
}), l.on("error", () => {
|
|
813
|
-
|
|
834
|
+
Lt(!0), Xt(!1), F.current = null, I.current &&= (window.clearTimeout(I.current), null), P.current && (P.current.style.opacity = "0");
|
|
814
835
|
}), l.on("unsupportedcodec", () => {
|
|
815
|
-
let e =
|
|
816
|
-
e && e.targetIdx !== 0 && (
|
|
836
|
+
let e = bt.current;
|
|
837
|
+
e && e.targetIdx !== 0 && (xt.current?.length ?? 0) > 1 && zr(e.targetIdx);
|
|
817
838
|
}), l.subtitles.onSubtitleChange((e) => {
|
|
818
|
-
|
|
839
|
+
Rn(e);
|
|
819
840
|
}), l.on("subtitlesloaded", (e) => {
|
|
820
841
|
if (!R.enableSubtitles) return;
|
|
821
|
-
|
|
842
|
+
Vn(Ie([...e]));
|
|
822
843
|
let t = e.find((e) => e.isDefault);
|
|
823
|
-
t && (l.subtitles.setActiveTrack(t.id),
|
|
844
|
+
t && (l.subtitles.setActiveTrack(t.id), zn(t.id));
|
|
824
845
|
}), l.on("audiotracksloaded", (e) => {
|
|
825
|
-
|
|
846
|
+
Un(e), Gn(e[0]?.id ?? 0);
|
|
826
847
|
}), l.on("audiotrackchange", (e) => {
|
|
827
|
-
|
|
848
|
+
Gn(e);
|
|
828
849
|
}), l.casting.onCastStateChange((e, t) => {
|
|
829
850
|
if (e) {
|
|
830
|
-
|
|
851
|
+
ur.current = l.isMuted(), l.pause();
|
|
831
852
|
let e = l.getVideoElement();
|
|
832
|
-
e.muted = !0,
|
|
853
|
+
e.muted = !0, sr(t);
|
|
833
854
|
} else {
|
|
834
855
|
let e = l.casting.getRemoteState();
|
|
835
|
-
e && e.currentTime > 0 && (
|
|
836
|
-
|
|
856
|
+
e && e.currentTime > 0 && (O.current = !0, k.current = e.currentTime, A.current = l.getCurrentTime(), l.seek(e.currentTime), j.current && window.clearTimeout(j.current), j.current = window.setTimeout(() => {
|
|
857
|
+
O.current = !1, k.current = null, A.current = null, j.current = null;
|
|
837
858
|
}, 3e3));
|
|
838
859
|
let t = l.getVideoElement();
|
|
839
|
-
t.muted =
|
|
860
|
+
t.muted = ur.current, sr(null), lr(null);
|
|
840
861
|
}
|
|
841
862
|
}), l.casting.onRemoteStateChange((e) => {
|
|
842
|
-
|
|
843
|
-
}),
|
|
863
|
+
lr(e);
|
|
864
|
+
}), Kt(l.getVolume()), Jt(l.isMuted()), "mediaSession" in navigator) try {
|
|
844
865
|
navigator.mediaSession.setActionHandler("seekto", (e) => {
|
|
845
|
-
if (e.seekTime == null ||
|
|
866
|
+
if (e.seekTime == null || Fr.current) return;
|
|
846
867
|
let t = e.seekTime;
|
|
847
868
|
for (let e of V.current) t >= e.startTime && (t += e.endTime - e.startTime);
|
|
848
|
-
|
|
869
|
+
vt.current?.(t);
|
|
849
870
|
});
|
|
850
871
|
let e = (e, t) => {
|
|
851
|
-
if (
|
|
872
|
+
if (Fr.current) return;
|
|
852
873
|
let n = t && t > 0 ? t : 10, r = l.getCurrentTime(), i = r;
|
|
853
874
|
for (let e of V.current) r >= e.endTime ? i -= e.endTime - e.startTime : r >= e.startTime && (i -= r - e.startTime);
|
|
854
875
|
if (e) {
|
|
855
876
|
let e = V.current.reduce((e, t) => e + (t.endTime - t.startTime), 0), t = Math.max(0, l.getDuration() - e), r = Math.min(t, i + n);
|
|
856
877
|
for (let e of V.current) r >= e.startTime && (r += e.endTime - e.startTime);
|
|
857
|
-
|
|
878
|
+
vt.current?.(r, {
|
|
858
879
|
eventType: "fast_forward",
|
|
859
880
|
skipSeconds: n
|
|
860
881
|
});
|
|
861
882
|
} else {
|
|
862
883
|
let e = Math.max(0, i - n);
|
|
863
884
|
for (let t of V.current) e >= t.startTime && (e += t.endTime - t.startTime);
|
|
864
|
-
|
|
885
|
+
vt.current?.(e, {
|
|
865
886
|
eventType: "fast_backward",
|
|
866
887
|
skipSeconds: n
|
|
867
888
|
});
|
|
@@ -869,34 +890,34 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
869
890
|
};
|
|
870
891
|
navigator.mediaSession.setActionHandler("seekforward", (t) => e(!0, t.seekOffset ?? void 0)), navigator.mediaSession.setActionHandler("seekbackward", (t) => e(!1, t.seekOffset ?? void 0));
|
|
871
892
|
} catch {}
|
|
872
|
-
let
|
|
873
|
-
if (!(document.pictureInPictureElement ===
|
|
874
|
-
let e =
|
|
893
|
+
let m = l.getVideoElement(), ee = () => {
|
|
894
|
+
if (!(document.pictureInPictureElement === m || m.webkitPresentationMode === "picture-in-picture") || O.current || F.current !== null || yt.current !== null) return;
|
|
895
|
+
let e = m.currentTime, t = wt.current;
|
|
875
896
|
if (!(Math.abs(e - t) < .5)) {
|
|
876
|
-
if (
|
|
877
|
-
|
|
897
|
+
if (Fr.current) {
|
|
898
|
+
m.currentTime = t;
|
|
878
899
|
return;
|
|
879
900
|
}
|
|
880
|
-
|
|
901
|
+
m.currentTime = t, vt.current?.(e);
|
|
881
902
|
}
|
|
882
903
|
};
|
|
883
|
-
|
|
884
|
-
let
|
|
885
|
-
|
|
886
|
-
N.current = null, !l.getBufferedRanges().some((e) => e.end > e.start) &&
|
|
887
|
-
},
|
|
888
|
-
I.current = null, F.current = null, P.current && (P.current.style.opacity = "0"),
|
|
889
|
-
}, 12e3)),
|
|
890
|
-
|
|
904
|
+
m.addEventListener("seeking", ee), jt(l);
|
|
905
|
+
let te = bt.current;
|
|
906
|
+
te && te.targetIdx !== 0 && (N.current && clearTimeout(N.current), N.current = setTimeout(() => {
|
|
907
|
+
N.current = null, !l.getBufferedRanges().some((e) => e.end > e.start) && zr(te.targetIdx);
|
|
908
|
+
}, Oe)), yt.current !== null && (I.current && window.clearTimeout(I.current), I.current = window.setTimeout(() => {
|
|
909
|
+
I.current = null, F.current = null, P.current && (P.current.style.opacity = "0"), Xt(!1);
|
|
910
|
+
}, 12e3)), He && T.current && (at.current = !0, T.current.requestFullscreen().catch(() => {
|
|
911
|
+
at.current = !1;
|
|
891
912
|
}));
|
|
892
|
-
let
|
|
913
|
+
let le = () => {
|
|
893
914
|
let e = document, t = !!(document.fullscreenElement || e.webkitFullscreenElement);
|
|
894
|
-
|
|
915
|
+
Qt(t), t || en(!1);
|
|
895
916
|
let n = l.getVideoElement();
|
|
896
917
|
l.analytics.track(t ? "fullscreen_enter" : "fullscreen_exit", n);
|
|
897
918
|
};
|
|
898
|
-
document.addEventListener("fullscreenchange",
|
|
899
|
-
let
|
|
919
|
+
document.addEventListener("fullscreenchange", le), document.addEventListener("webkitfullscreenchange", le);
|
|
920
|
+
let g = (e) => {
|
|
900
921
|
let t = document.activeElement;
|
|
901
922
|
if (!(t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.getAttribute("contenteditable") === "true" || t.getAttribute("role") === "slider"))) {
|
|
902
923
|
switch (e.key.toLowerCase()) {
|
|
@@ -909,19 +930,19 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
909
930
|
let e = l.getVideoElement();
|
|
910
931
|
e && !e.paused && e.pause();
|
|
911
932
|
} catch {}
|
|
912
|
-
if (
|
|
913
|
-
|
|
933
|
+
if (D.current && !D.current.paused) try {
|
|
934
|
+
D.current.pause();
|
|
914
935
|
} catch {}
|
|
915
936
|
}
|
|
916
937
|
break;
|
|
917
938
|
case "arrowleft":
|
|
918
939
|
case "j":
|
|
919
|
-
if (e.preventDefault(), !
|
|
940
|
+
if (e.preventDefault(), !Fr.current) {
|
|
920
941
|
let e = l.getCurrentTime(), t = e;
|
|
921
942
|
for (let n of V.current) e >= n.endTime ? t -= n.endTime - n.startTime : e >= n.startTime && (t -= e - n.startTime);
|
|
922
943
|
let n = Math.max(0, t - 10);
|
|
923
944
|
for (let e of V.current) n >= e.startTime && (n += e.endTime - e.startTime);
|
|
924
|
-
|
|
945
|
+
vt.current?.(n, {
|
|
925
946
|
eventType: "fast_backward",
|
|
926
947
|
skipSeconds: 10
|
|
927
948
|
});
|
|
@@ -929,12 +950,12 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
929
950
|
break;
|
|
930
951
|
case "arrowright":
|
|
931
952
|
case "l":
|
|
932
|
-
if (e.preventDefault(), !
|
|
953
|
+
if (e.preventDefault(), !Fr.current) {
|
|
933
954
|
let e = l.getCurrentTime(), t = V.current.reduce((e, t) => e + (t.endTime - t.startTime), 0), n = Math.max(0, l.getDuration() - t), r = e;
|
|
934
955
|
for (let t of V.current) e >= t.endTime ? r -= t.endTime - t.startTime : e >= t.startTime && (r -= e - t.startTime);
|
|
935
956
|
let i = Math.min(n, r + 10);
|
|
936
957
|
for (let e of V.current) i >= e.startTime && (i += e.endTime - e.startTime);
|
|
937
|
-
|
|
958
|
+
vt.current?.(i, {
|
|
938
959
|
eventType: "fast_forward",
|
|
939
960
|
skipSeconds: 10
|
|
940
961
|
});
|
|
@@ -950,28 +971,28 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
950
971
|
e.preventDefault(), l.setMute(!l.isMuted());
|
|
951
972
|
break;
|
|
952
973
|
case "f":
|
|
953
|
-
e.preventDefault(),
|
|
974
|
+
e.preventDefault(), ft.current();
|
|
954
975
|
break;
|
|
955
976
|
case "p":
|
|
956
|
-
e.preventDefault(),
|
|
977
|
+
e.preventDefault(), Fr.current || l.togglePictureInPicture();
|
|
957
978
|
break;
|
|
958
979
|
case "c":
|
|
959
|
-
if (e.preventDefault(), R.enableSubtitles && !
|
|
980
|
+
if (e.preventDefault(), R.enableSubtitles && !Fr.current) if (l.subtitles.getActiveTrackId() !== "off") l.subtitles.setActiveTrack("off"), zn("off");
|
|
960
981
|
else {
|
|
961
|
-
let e =
|
|
962
|
-
e && e.length > 0 && (l.subtitles.setActiveTrack(e[0].id),
|
|
982
|
+
let e = Lr.current;
|
|
983
|
+
e && e.length > 0 && (l.subtitles.setActiveTrack(e[0].id), zn(e[0].id));
|
|
963
984
|
}
|
|
964
985
|
break;
|
|
965
986
|
default: return;
|
|
966
987
|
}
|
|
967
|
-
|
|
988
|
+
Rr();
|
|
968
989
|
}
|
|
969
990
|
};
|
|
970
|
-
return document.addEventListener("keydown",
|
|
971
|
-
if (
|
|
972
|
-
key:
|
|
991
|
+
return document.addEventListener("keydown", g), Rr(), () => {
|
|
992
|
+
if (vn.current = {
|
|
993
|
+
key: dn,
|
|
973
994
|
snapshot: l.analytics.getSessionSnapshot()
|
|
974
|
-
}, l.destroy(),
|
|
995
|
+
}, l.destroy(), it.current?.destroy(), it.current = null, document.body.style.overflow = "", document.body.style.touchAction = "", document.removeEventListener("fullscreenchange", le), document.removeEventListener("webkitfullscreenchange", le), document.removeEventListener("keydown", g), Nr.current && window.clearTimeout(Nr.current), j.current &&= (window.clearTimeout(j.current), null), N.current &&= (clearTimeout(N.current), null), M.current && (M.current.style.opacity = "0"), m.removeEventListener("seeking", ee), "mediaSession" in navigator) {
|
|
975
996
|
try {
|
|
976
997
|
navigator.mediaSession.setActionHandler("seekto", null);
|
|
977
998
|
} catch {}
|
|
@@ -982,25 +1003,25 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
982
1003
|
navigator.mediaSession.setActionHandler("seekbackward", null);
|
|
983
1004
|
} catch {}
|
|
984
1005
|
}
|
|
985
|
-
|
|
1006
|
+
ct.current &&= (ct.current.destroy(), null), D.current &&= (document.body.removeChild(D.current), null), Ct.current = !1, F.current = null, I.current &&= (window.clearTimeout(I.current), null);
|
|
986
1007
|
};
|
|
987
1008
|
}, [
|
|
988
1009
|
r,
|
|
989
1010
|
re,
|
|
990
|
-
|
|
1011
|
+
Rt
|
|
991
1012
|
]), c(() => {
|
|
992
1013
|
if (L) {
|
|
993
1014
|
L.keyMoments.setKeyMoments(K);
|
|
994
|
-
let e =
|
|
1015
|
+
let e = T.current?.querySelector("video");
|
|
995
1016
|
if (e) {
|
|
996
1017
|
let t = L.keyMoments.getCurrentMoment(e.currentTime);
|
|
997
|
-
|
|
1018
|
+
qn({
|
|
998
1019
|
chapter: t.keyMoment,
|
|
999
1020
|
index: t.index
|
|
1000
1021
|
});
|
|
1001
1022
|
}
|
|
1002
1023
|
}
|
|
1003
|
-
}, [
|
|
1024
|
+
}, [or, L]), c(() => {
|
|
1004
1025
|
let e = (e) => {
|
|
1005
1026
|
q !== "none" && (e.target.closest(".sdk-menu-container") || J("none"));
|
|
1006
1027
|
};
|
|
@@ -1008,11 +1029,11 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1008
1029
|
document.removeEventListener("click", e);
|
|
1009
1030
|
};
|
|
1010
1031
|
}, [q]), c(() => {
|
|
1011
|
-
|
|
1012
|
-
}, [
|
|
1013
|
-
|
|
1032
|
+
Pr.current = Bt;
|
|
1033
|
+
}, [Bt]), c(() => {
|
|
1034
|
+
Fr.current = Z;
|
|
1014
1035
|
}, [Z]), c(() => {
|
|
1015
|
-
|
|
1036
|
+
Ir.current = q;
|
|
1016
1037
|
}, [q]), c(() => {
|
|
1017
1038
|
if (!Z || !L) return;
|
|
1018
1039
|
let e = 0, t = L.getCurrentTime(), n = performance.now(), r = () => {
|
|
@@ -1025,7 +1046,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1025
1046
|
let c = V.current.find((e) => a >= e.startTime && a < e.endTime);
|
|
1026
1047
|
if (c) {
|
|
1027
1048
|
let e = Math.min(s, a + .4, c.endTime), t = Math.min(100, Math.max(0, (e - c.startTime) / (c.endTime - c.startTime) * 100));
|
|
1028
|
-
(
|
|
1049
|
+
(T.current?.querySelectorAll(".sdk-ad-progress-fill"))?.forEach((e) => {
|
|
1029
1050
|
e.style.width = `${t}%`;
|
|
1030
1051
|
});
|
|
1031
1052
|
}
|
|
@@ -1033,25 +1054,25 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1033
1054
|
};
|
|
1034
1055
|
return e = requestAnimationFrame(r), () => cancelAnimationFrame(e);
|
|
1035
1056
|
}, [Z, L]), c(() => {
|
|
1036
|
-
|
|
1037
|
-
}, [
|
|
1038
|
-
|
|
1039
|
-
}, [
|
|
1057
|
+
Lr.current = Bn;
|
|
1058
|
+
}, [Bn]), c(() => {
|
|
1059
|
+
Dt.current = Tt;
|
|
1060
|
+
}, [Tt]), c(() => {
|
|
1040
1061
|
V.current = B;
|
|
1041
1062
|
}, [B]), c(() => {
|
|
1042
|
-
|
|
1043
|
-
}, [yn]), c(() => {
|
|
1044
|
-
wn.current = xn;
|
|
1063
|
+
Tn.current = xn;
|
|
1045
1064
|
}, [xn]), c(() => {
|
|
1046
|
-
|
|
1047
|
-
}, [
|
|
1048
|
-
|
|
1049
|
-
}, [
|
|
1050
|
-
|
|
1051
|
-
}, [
|
|
1052
|
-
|
|
1065
|
+
En.current = Cn;
|
|
1066
|
+
}, [Cn]), c(() => {
|
|
1067
|
+
An.current = On;
|
|
1068
|
+
}, [On]), c(() => {
|
|
1069
|
+
xt.current = S;
|
|
1070
|
+
}, [S]), c(() => {
|
|
1071
|
+
St.current = tt;
|
|
1072
|
+
}, [tt]), c(() => {
|
|
1073
|
+
yn.current = null, bn.current = !1, _t.current = null, wn(null), En.current = null, Dn.current = /* @__PURE__ */ new Set(), Lt(!1);
|
|
1053
1074
|
}, [r]), c(() => {
|
|
1054
|
-
|
|
1075
|
+
Sn([]), $e && fetch($e).then((e) => e.json()).then((e) => {
|
|
1055
1076
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
1056
1077
|
for (let r of e.nonLinearAvails ?? []) {
|
|
1057
1078
|
if (t.has(r.availId)) continue;
|
|
@@ -1065,8 +1086,8 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1065
1086
|
let s = o.position ?? "bottom_center";
|
|
1066
1087
|
n.push({
|
|
1067
1088
|
availId: r.availId,
|
|
1068
|
-
startTimeSeconds:
|
|
1069
|
-
durationSeconds:
|
|
1089
|
+
startTimeSeconds: Le(r.startTime ?? ""),
|
|
1090
|
+
durationSeconds: Le(i.minSuggestedDuration ?? "00:00:15"),
|
|
1070
1091
|
imageUrl: i.staticResource,
|
|
1071
1092
|
imageWidth: parseInt(i.width ?? "320", 10),
|
|
1072
1093
|
imageHeight: parseInt(i.height ?? "50", 10),
|
|
@@ -1078,80 +1099,90 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1078
1099
|
dismissible: o.dismissible === !0
|
|
1079
1100
|
});
|
|
1080
1101
|
}
|
|
1081
|
-
|
|
1102
|
+
Sn(n);
|
|
1082
1103
|
}).catch(() => {});
|
|
1083
|
-
}, [
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
let t = e.ads?.[0]?.skipOffset ?? null, n =
|
|
1104
|
+
}, [$e, r]), c(() => {
|
|
1105
|
+
kn([]), et && fetch(et).then((e) => e.json()).then((e) => {
|
|
1106
|
+
kn((e.avails ?? []).map((e) => {
|
|
1107
|
+
let t = e.ads?.[0], n = t?.skipOffset ?? null, r = !!n, i = {};
|
|
1108
|
+
try {
|
|
1109
|
+
i = JSON.parse(t?.adParameters ?? "{}");
|
|
1110
|
+
} catch {}
|
|
1111
|
+
let a = i.ctaText && i.redirectUrl ? {
|
|
1112
|
+
text: i.ctaText,
|
|
1113
|
+
url: i.redirectUrl,
|
|
1114
|
+
title: i.title || void 0,
|
|
1115
|
+
description: i.description || void 0
|
|
1116
|
+
} : null;
|
|
1087
1117
|
return {
|
|
1088
1118
|
startTimeSeconds: e.startTimeInSeconds ?? 0,
|
|
1089
1119
|
durationSeconds: e.durationInSeconds ?? 0,
|
|
1090
|
-
skippable:
|
|
1091
|
-
skipOffsetSeconds:
|
|
1120
|
+
skippable: r,
|
|
1121
|
+
skipOffsetSeconds: r ? Le(n) : 0,
|
|
1122
|
+
cta: a
|
|
1092
1123
|
};
|
|
1093
1124
|
}));
|
|
1094
1125
|
}).catch(() => {});
|
|
1095
|
-
}, [
|
|
1096
|
-
if (!L ||
|
|
1097
|
-
let e =
|
|
1126
|
+
}, [et, r]), c(() => {
|
|
1127
|
+
if (!L || On.length === 0) return;
|
|
1128
|
+
let e = On.map((e) => ({
|
|
1098
1129
|
startTime: e.startTimeSeconds,
|
|
1099
1130
|
endTime: e.startTimeSeconds + e.durationSeconds
|
|
1100
1131
|
}));
|
|
1101
1132
|
L.setAdBreaks(e);
|
|
1102
|
-
}, [L,
|
|
1133
|
+
}, [L, On]), c(() => {
|
|
1103
1134
|
if (!L) return;
|
|
1104
1135
|
let e = () => {
|
|
1105
|
-
document.hidden ?
|
|
1136
|
+
document.hidden ? Xe && Fr.current && Pr.current && (L.pause(), bn.current = !0) : bn.current &&= (L.play(), !1);
|
|
1106
1137
|
};
|
|
1107
1138
|
return document.addEventListener("visibilitychange", e), () => {
|
|
1108
1139
|
document.removeEventListener("visibilitychange", e);
|
|
1109
1140
|
};
|
|
1110
|
-
}, [L,
|
|
1111
|
-
let
|
|
1112
|
-
|
|
1113
|
-
},
|
|
1114
|
-
|
|
1115
|
-
},
|
|
1141
|
+
}, [L, Xe]);
|
|
1142
|
+
let Br = () => {
|
|
1143
|
+
Rr();
|
|
1144
|
+
}, Vr = () => {
|
|
1145
|
+
He && !at.current && T.current && (at.current = !0, T.current.requestFullscreen().catch(() => {}));
|
|
1146
|
+
}, Hr = () => {
|
|
1116
1147
|
if (L) {
|
|
1117
1148
|
if (Y) {
|
|
1118
|
-
L.casting.remotePlayPause(),
|
|
1149
|
+
L.casting.remotePlayPause(), Rr();
|
|
1119
1150
|
return;
|
|
1120
1151
|
}
|
|
1121
|
-
if (
|
|
1122
|
-
else if (
|
|
1152
|
+
if (sn) Q(0), Vr(), L.play(), cn(!1);
|
|
1153
|
+
else if (Bt) {
|
|
1123
1154
|
L.pause();
|
|
1124
1155
|
try {
|
|
1125
1156
|
let e = L.getVideoElement?.();
|
|
1126
1157
|
e && !e.paused && e.pause();
|
|
1127
1158
|
} catch {}
|
|
1128
|
-
if (
|
|
1159
|
+
if (T.current && T.current.querySelectorAll("video").forEach((e) => {
|
|
1129
1160
|
try {
|
|
1130
1161
|
e.pause();
|
|
1131
1162
|
} catch {}
|
|
1132
|
-
}),
|
|
1133
|
-
|
|
1163
|
+
}), D.current && !D.current.paused) try {
|
|
1164
|
+
D.current.pause();
|
|
1134
1165
|
} catch {}
|
|
1135
|
-
} else
|
|
1136
|
-
|
|
1166
|
+
} else Vr(), L.play();
|
|
1167
|
+
Rr();
|
|
1137
1168
|
}
|
|
1138
|
-
},
|
|
1139
|
-
if (!
|
|
1140
|
-
let t =
|
|
1169
|
+
}, Ur = (e) => {
|
|
1170
|
+
if (!E.current || !L || H === 0) return 0;
|
|
1171
|
+
let t = E.current.getBoundingClientRect();
|
|
1141
1172
|
return W(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * H);
|
|
1142
|
-
},
|
|
1173
|
+
}, Wr = (e) => {
|
|
1143
1174
|
if (!L || Z) return;
|
|
1144
|
-
|
|
1175
|
+
ut.current = !0, Dr(Ur(e));
|
|
1145
1176
|
let t = (e) => {
|
|
1146
|
-
if (!
|
|
1147
|
-
let t =
|
|
1148
|
-
|
|
1177
|
+
if (!ut.current || !E.current) return;
|
|
1178
|
+
let t = E.current.getBoundingClientRect(), n = W(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * H);
|
|
1179
|
+
Dr(n), vr(e.clientX - t.left), Sr(n), D.current && (D.current.currentTime = n), Rr();
|
|
1149
1180
|
}, n = (e) => {
|
|
1150
|
-
if (
|
|
1151
|
-
let t =
|
|
1181
|
+
if (ut.current = !1, E.current) {
|
|
1182
|
+
let t = E.current.getBoundingClientRect();
|
|
1152
1183
|
Q(W(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * H));
|
|
1153
1184
|
}
|
|
1154
|
-
|
|
1185
|
+
Dr(null), vr(null), wr(null), Er(null), document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
|
|
1155
1186
|
};
|
|
1156
1187
|
document.addEventListener("mousemove", t), document.addEventListener("mouseup", n);
|
|
1157
1188
|
}, Q = (e, t) => {
|
|
@@ -1160,198 +1191,202 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1160
1191
|
L.casting.remoteSeek(e);
|
|
1161
1192
|
return;
|
|
1162
1193
|
}
|
|
1163
|
-
let n = Math.max(0,
|
|
1194
|
+
let n = Math.max(0, Ut > 0 ? Math.min(e, Ut) : e);
|
|
1164
1195
|
if (t) {
|
|
1165
1196
|
let { eventType: e, ...n } = t;
|
|
1166
1197
|
L.attributeNextSeek(e, n);
|
|
1167
1198
|
}
|
|
1168
1199
|
let r = L.getCurrentTime();
|
|
1169
1200
|
if (n > r && V.current.length > 0) {
|
|
1170
|
-
let e = V.current.filter((e) => e.startTime > r && e.startTime < n && !
|
|
1201
|
+
let e = V.current.filter((e) => e.startTime > r && e.startTime < n && !un.current.has(e.startTime)).sort((e, t) => e.startTime - t.startTime);
|
|
1171
1202
|
if (e.length > 0) {
|
|
1172
|
-
|
|
1203
|
+
_t.current = n;
|
|
1173
1204
|
let t = e[e.length - 1].startTime;
|
|
1174
|
-
|
|
1175
|
-
|
|
1205
|
+
O.current = !0, k.current = t, A.current = r, Ht(t), M.current && (M.current.style.opacity = "1"), mt(L.getVideoElement()), L.seek(t), j.current && window.clearTimeout(j.current), j.current = window.setTimeout(() => {
|
|
1206
|
+
O.current = !1, k.current = null, A.current = null, j.current = null, M.current && (M.current.style.opacity = "0"), ht(L.getVideoElement());
|
|
1176
1207
|
}, 3e3);
|
|
1177
1208
|
return;
|
|
1178
1209
|
}
|
|
1179
1210
|
}
|
|
1180
|
-
|
|
1181
|
-
|
|
1211
|
+
_t.current = null;
|
|
1212
|
+
let i = V.current.find((e) => un.current.has(e.startTime) && n >= e.startTime - .5 && n < e.endTime + 2), a = i ? Math.max(n, i.endTime + .5) : n;
|
|
1213
|
+
O.current = !0, k.current = a, A.current = r, Ht(a), M.current && (M.current.style.opacity = "0"), ht(L.getVideoElement()), L.seek(a), j.current && window.clearTimeout(j.current), j.current = window.setTimeout(() => {
|
|
1214
|
+
O.current = !1, k.current = null, A.current = null, j.current = null, M.current && (M.current.style.opacity = "0");
|
|
1182
1215
|
}, 3e3);
|
|
1183
1216
|
};
|
|
1184
|
-
|
|
1185
|
-
let
|
|
1217
|
+
vt.current = Q;
|
|
1218
|
+
let Gr = () => {
|
|
1186
1219
|
if (!L) return;
|
|
1187
1220
|
if (Y) {
|
|
1188
|
-
L.casting.remoteSetMute(!(
|
|
1221
|
+
L.casting.remoteSetMute(!(cr?.isMuted ?? !1));
|
|
1189
1222
|
return;
|
|
1190
1223
|
}
|
|
1191
|
-
let e = !
|
|
1192
|
-
L.setMute(e),
|
|
1193
|
-
},
|
|
1194
|
-
L && (L.setPlaybackRate(e),
|
|
1195
|
-
},
|
|
1224
|
+
let e = !qt;
|
|
1225
|
+
L.setMute(e), Jt(e);
|
|
1226
|
+
}, Kr = (e) => {
|
|
1227
|
+
L && (L.setPlaybackRate(e), Xn(e), J("none"), nr(`Playback speed: ${e === 1 ? "Normal" : `${e}x`}`));
|
|
1228
|
+
}, qr = (e) => {
|
|
1196
1229
|
if (!L) return;
|
|
1197
1230
|
L.setQuality(e);
|
|
1198
|
-
let t =
|
|
1199
|
-
t && (
|
|
1200
|
-
},
|
|
1201
|
-
if (L) if (L.subtitles.setActiveTrack(e),
|
|
1231
|
+
let t = Nn.find((t) => t.id === e);
|
|
1232
|
+
t && (In(t), nr(`Quality: ${t.label}`)), J("none");
|
|
1233
|
+
}, Jr = (e) => {
|
|
1234
|
+
if (L) if (L.subtitles.setActiveTrack(e), zn(e), J("none"), e === "off") nr("Captions off");
|
|
1202
1235
|
else {
|
|
1203
|
-
let t =
|
|
1204
|
-
|
|
1236
|
+
let t = Bn.find((t) => t.id === e);
|
|
1237
|
+
nr(`Captions: ${t ? b(t) : "on"}`);
|
|
1205
1238
|
}
|
|
1206
|
-
},
|
|
1207
|
-
L && (N.current &&= (clearTimeout(N.current), null),
|
|
1208
|
-
},
|
|
1239
|
+
}, Yr = (e) => {
|
|
1240
|
+
L && (N.current &&= (clearTimeout(N.current), null), ir(null), P.current && (P.current.style.opacity = "1"), Xt(!0), bt.current === null && (yt.current = L.getCurrentTime()), bt.current = { targetIdx: e }, J("none"), nr(`Source: ${S?.[e]?.label ?? ""}`), tt?.(e));
|
|
1241
|
+
}, Xr = (e, t) => {
|
|
1209
1242
|
Q(e, {
|
|
1210
1243
|
eventType: "key_moments",
|
|
1211
1244
|
momentTitle: t?.title ?? "",
|
|
1212
1245
|
momentTime: e
|
|
1213
1246
|
}), J("none");
|
|
1214
|
-
},
|
|
1247
|
+
}, Zr = () => {
|
|
1215
1248
|
L && L.togglePictureInPicture();
|
|
1216
|
-
},
|
|
1217
|
-
if (!
|
|
1218
|
-
let e =
|
|
1219
|
-
|
|
1249
|
+
}, Qr = () => {
|
|
1250
|
+
if (!T.current) return;
|
|
1251
|
+
let e = T.current, t = document, n = e, r = !!(document.fullscreenElement || t.webkitFullscreenElement), i = () => {
|
|
1252
|
+
en(!0), Qt(!0), document.body.style.overflow = "hidden", document.body.style.touchAction = "none", L?.analytics.track("fullscreen_enter", L.getVideoElement());
|
|
1220
1253
|
}, a = () => {
|
|
1221
|
-
|
|
1254
|
+
en(!1), Qt(!1), document.body.style.overflow = "", document.body.style.touchAction = "", L?.analytics.track("fullscreen_exit", L.getVideoElement());
|
|
1222
1255
|
};
|
|
1223
|
-
if (r ||
|
|
1256
|
+
if (r || $t) nn(!1), document.fullscreenElement ? document.exitFullscreen() : t.webkitFullscreenElement ? t.webkitExitFullscreen?.() : a();
|
|
1224
1257
|
else {
|
|
1225
|
-
|
|
1258
|
+
nn(Dt.current);
|
|
1226
1259
|
let t = e.requestFullscreen?.bind(e) ?? n.webkitRequestFullscreen?.bind(n);
|
|
1227
1260
|
t ? t().catch(i) : i();
|
|
1228
1261
|
}
|
|
1229
1262
|
};
|
|
1230
1263
|
c(() => {
|
|
1231
|
-
|
|
1264
|
+
ft.current = Qr;
|
|
1232
1265
|
});
|
|
1233
|
-
let
|
|
1266
|
+
let $r = () => {
|
|
1234
1267
|
if (!Z) return;
|
|
1235
1268
|
let e = B.find((e) => z >= e.startTime && z < e.endTime);
|
|
1236
|
-
e &&
|
|
1237
|
-
}, Qr = () => {
|
|
1238
|
-
wn.current && Tn.current.add(wn.current.availId), Sn(null), wn.current = null;
|
|
1239
|
-
}, $r = (e) => {
|
|
1240
|
-
e.clickTrackingUrl && fetch(e.clickTrackingUrl, { mode: "no-cors" }).catch(() => {}), e.clickThrough && window.open(e.clickThrough, "_blank", "noopener,noreferrer");
|
|
1269
|
+
e && gt.current?.(e.endTime);
|
|
1241
1270
|
}, ei = () => {
|
|
1271
|
+
En.current && Dn.current.add(En.current.availId), wn(null), En.current = null;
|
|
1272
|
+
}, ti = (e) => {
|
|
1273
|
+
e.clickTrackingUrl && fetch(e.clickTrackingUrl, { mode: "no-cors" }).catch(() => {}), e.clickThrough && window.open(e.clickThrough, "_blank", "noopener,noreferrer");
|
|
1274
|
+
}, ni = (e) => {
|
|
1275
|
+
window.open(e.url, "_blank", "noopener,noreferrer");
|
|
1276
|
+
}, ri = () => {
|
|
1242
1277
|
L && (Y ? L.casting.stopCasting() : L.casting.requestSession(r, z));
|
|
1243
|
-
},
|
|
1278
|
+
}, ii = () => {
|
|
1244
1279
|
if (!L) return;
|
|
1245
1280
|
let e = L.getVideoElement();
|
|
1246
|
-
if (
|
|
1281
|
+
if (pr) {
|
|
1247
1282
|
L.casting.stopAirPlay(e);
|
|
1248
1283
|
return;
|
|
1249
1284
|
}
|
|
1250
1285
|
typeof e.webkitShowPlaybackTargetPicker == "function" || L.casting.isAirPlayAvailable() ? L.casting.requestAirPlaySession(e) : console.warn("[PlayerSDK AirPlay] AirPlay is not available on this device.");
|
|
1251
|
-
},
|
|
1252
|
-
if (!
|
|
1253
|
-
let t =
|
|
1254
|
-
|
|
1286
|
+
}, ai = (e) => {
|
|
1287
|
+
if (!E.current || H === 0 || !L || Z) return;
|
|
1288
|
+
let t = E.current.getBoundingClientRect();
|
|
1289
|
+
ot.current = t.width, br(Math.max(192 / 2, Math.min(e.clientX - t.left, t.width - 192 / 2)));
|
|
1255
1290
|
let n = W(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * H);
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
}, 100),
|
|
1259
|
-
},
|
|
1260
|
-
if (!
|
|
1261
|
-
let t =
|
|
1291
|
+
vr(e.clientX - t.left), Sr(n), lt.current && window.clearTimeout(lt.current), lt.current = window.setTimeout(() => {
|
|
1292
|
+
D.current && (D.current.currentTime = n);
|
|
1293
|
+
}, 100), Er(L.keyMoments.getCurrentMoment(n).keyMoment);
|
|
1294
|
+
}, oi = (e) => {
|
|
1295
|
+
if (!E.current || H === 0) return 0;
|
|
1296
|
+
let t = E.current.getBoundingClientRect();
|
|
1262
1297
|
return W(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * H);
|
|
1263
|
-
},
|
|
1298
|
+
}, si = (e) => {
|
|
1264
1299
|
if (!L || Z || H === 0) return;
|
|
1265
|
-
e.preventDefault(),
|
|
1300
|
+
e.preventDefault(), ut.current = !0, Dr(oi(e.touches[0]));
|
|
1266
1301
|
let t = (e) => {
|
|
1267
|
-
if (!
|
|
1268
|
-
let t = e.touches[0], n =
|
|
1269
|
-
|
|
1302
|
+
if (!ut.current || !E.current) return;
|
|
1303
|
+
let t = e.touches[0], n = E.current.getBoundingClientRect(), r = W(Math.max(0, Math.min(1, (t.clientX - n.left) / n.width)) * H);
|
|
1304
|
+
Dr(r), Sr(r), Rr();
|
|
1270
1305
|
}, n = (e) => {
|
|
1271
|
-
if (
|
|
1272
|
-
let t = e.changedTouches[0], n =
|
|
1306
|
+
if (ut.current = !1, E.current && e.changedTouches[0]) {
|
|
1307
|
+
let t = e.changedTouches[0], n = E.current.getBoundingClientRect();
|
|
1273
1308
|
Q(W(Math.max(0, Math.min(1, (t.clientX - n.left) / n.width)) * H));
|
|
1274
1309
|
}
|
|
1275
|
-
|
|
1310
|
+
Dr(null), document.removeEventListener("touchmove", t), document.removeEventListener("touchend", n);
|
|
1276
1311
|
};
|
|
1277
1312
|
document.addEventListener("touchmove", t, { passive: !1 }), document.addEventListener("touchend", n);
|
|
1278
|
-
},
|
|
1279
|
-
|
|
1313
|
+
}, ci = () => {
|
|
1314
|
+
vr(null), wr(null), Er(null), lt.current && window.clearTimeout(lt.current);
|
|
1280
1315
|
}, $ = (e) => {
|
|
1281
1316
|
if (isNaN(e) || e < 0) return "00:00";
|
|
1282
1317
|
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60, a = (e) => String(e).padStart(2, "0");
|
|
1283
1318
|
return n > 0 ? `${a(n)}:${a(r)}:${a(i)}` : `${a(r)}:${a(i)}`;
|
|
1284
1319
|
};
|
|
1285
1320
|
c(() => {
|
|
1286
|
-
|
|
1287
|
-
}, [
|
|
1288
|
-
|
|
1289
|
-
}, [
|
|
1290
|
-
|
|
1321
|
+
ar.current && nr(Bt ? "Playing" : "Paused");
|
|
1322
|
+
}, [Bt]), c(() => {
|
|
1323
|
+
ar.current && nr(qt ? "Muted" : "Unmuted");
|
|
1324
|
+
}, [qt]), c(() => {
|
|
1325
|
+
ar.current = !0;
|
|
1291
1326
|
}, []), c(() => {
|
|
1292
1327
|
let e = (e) => {
|
|
1293
|
-
e.key === "Escape" &&
|
|
1328
|
+
e.key === "Escape" && Ir.current !== "none" && (e.preventDefault(), J("none"));
|
|
1294
1329
|
};
|
|
1295
1330
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1296
1331
|
}, []);
|
|
1297
|
-
let
|
|
1332
|
+
let li = Y ? !(cr?.isPaused ?? !0) : Bt, ui = Y ? cr?.currentTime ?? 0 : z, di = Y ? cr?.duration ?? 0 : H, fi = Y ? cr?.volumeLevel ?? 1 : Gt, pi = Y ? cr?.isMuted ?? !1 : qt, mi = o((e) => {
|
|
1298
1333
|
if (Z || e.target.closest(".sdk-mobile-ctrl")) return;
|
|
1299
|
-
let t = Date.now(), n =
|
|
1334
|
+
let t = Date.now(), n = T.current?.getBoundingClientRect(), r = e.clientX - (n?.left ?? 0), i = Ot.current;
|
|
1300
1335
|
if (i && t - i.time < 300) {
|
|
1301
|
-
|
|
1336
|
+
Ot.current = null;
|
|
1302
1337
|
let e = r < (n?.width ?? 0) / 2, t = e ? -10 : 10;
|
|
1303
|
-
Q(W(Math.max(0, Math.min(H, U(
|
|
1338
|
+
Q(W(Math.max(0, Math.min(H, U(ui) + t))), {
|
|
1304
1339
|
eventType: e ? "fast_backward" : "fast_forward",
|
|
1305
1340
|
skipSeconds: 10
|
|
1306
|
-
}),
|
|
1307
|
-
} else
|
|
1341
|
+
}), At(e ? "left" : "right"), window.setTimeout(() => At(null), 700), Rr();
|
|
1342
|
+
} else Ot.current = {
|
|
1308
1343
|
time: t,
|
|
1309
1344
|
x: r
|
|
1310
|
-
},
|
|
1345
|
+
}, Ar ? (jr(!1), Nr.current && window.clearTimeout(Nr.current)) : Rr();
|
|
1311
1346
|
}, [
|
|
1312
1347
|
Z,
|
|
1313
1348
|
H,
|
|
1314
1349
|
U,
|
|
1315
|
-
|
|
1350
|
+
ui,
|
|
1316
1351
|
W,
|
|
1317
1352
|
Q,
|
|
1318
|
-
|
|
1319
|
-
]),
|
|
1353
|
+
Ar
|
|
1354
|
+
]), hi = () => p(pi || fi === 0 ? Ee : fi < .3 ? De : fi < .7 ? we : Te, { size: 18 }), gi = (e) => (t) => {
|
|
1320
1355
|
t.key === "Enter" || t.key === " " ? (t.preventDefault(), e()) : t.key === "Escape" && (t.preventDefault(), J("none"));
|
|
1321
|
-
},
|
|
1356
|
+
}, _i = (e) => (t) => {
|
|
1322
1357
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), e());
|
|
1323
|
-
},
|
|
1358
|
+
}, vi = (e) => {
|
|
1324
1359
|
if (!Z) if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
1325
1360
|
e.preventDefault();
|
|
1326
1361
|
let t = e.key === "ArrowLeft" ? -5 : 5;
|
|
1327
|
-
Q(W(Math.max(0, Math.min(H, U(
|
|
1362
|
+
Q(W(Math.max(0, Math.min(H, U(ui) + t))));
|
|
1328
1363
|
} else e.key === "Home" ? (e.preventDefault(), Q(W(0))) : e.key === "End" && (e.preventDefault(), Q(W(H)));
|
|
1329
|
-
},
|
|
1364
|
+
}, yi = (e) => {
|
|
1330
1365
|
J(q === e ? "none" : e);
|
|
1331
|
-
},
|
|
1366
|
+
}, bi = o((e) => {
|
|
1332
1367
|
if (!e) return;
|
|
1333
1368
|
e.style.left = "";
|
|
1334
|
-
let t =
|
|
1369
|
+
let t = T.current;
|
|
1335
1370
|
if (!t) return;
|
|
1336
1371
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = n.right - (r.right - 8), a = r.left + 8 - n.left;
|
|
1337
1372
|
i > 0 ? e.style.left = `calc(50% - ${Math.ceil(i)}px)` : a > 0 && (e.style.left = `calc(50% + ${Math.ceil(a)}px)`);
|
|
1338
1373
|
}, []);
|
|
1339
1374
|
return /* @__PURE__ */ m("div", {
|
|
1340
|
-
ref:
|
|
1375
|
+
ref: T,
|
|
1341
1376
|
role: "region",
|
|
1342
|
-
"aria-label":
|
|
1343
|
-
className: `sdk-player-container ${
|
|
1344
|
-
onMouseMove:
|
|
1345
|
-
onTouchStart:
|
|
1377
|
+
"aria-label": x || Or ? `${x || Or} video player` : "Video player",
|
|
1378
|
+
className: `sdk-player-container ${Ar ? "controls-active" : ""} ${$t ? "sdk-fs-simulated" : ""}`,
|
|
1379
|
+
onMouseMove: Br,
|
|
1380
|
+
onTouchStart: rn ? void 0 : Rr,
|
|
1346
1381
|
onMouseLeave: () => {},
|
|
1347
1382
|
style: {
|
|
1348
|
-
border:
|
|
1383
|
+
border: $t ? "none" : "1px solid rgba(255, 255, 255, 0.08)",
|
|
1349
1384
|
"--sdk-theme-color": h,
|
|
1350
|
-
"--sdk-theme-color-rgb":
|
|
1385
|
+
"--sdk-theme-color-rgb": Ne(h)
|
|
1351
1386
|
},
|
|
1352
1387
|
children: [
|
|
1353
1388
|
/* @__PURE__ */ p("canvas", {
|
|
1354
|
-
ref:
|
|
1389
|
+
ref: st,
|
|
1355
1390
|
width: 160,
|
|
1356
1391
|
height: 90,
|
|
1357
1392
|
style: {
|
|
@@ -1366,7 +1401,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1366
1401
|
"aria-live": "polite",
|
|
1367
1402
|
"aria-atomic": "true",
|
|
1368
1403
|
className: "sdk-sr-only",
|
|
1369
|
-
children:
|
|
1404
|
+
children: tr
|
|
1370
1405
|
}),
|
|
1371
1406
|
/* @__PURE__ */ p("div", {
|
|
1372
1407
|
ref: M,
|
|
@@ -1384,7 +1419,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1384
1419
|
/* @__PURE__ */ p("div", {
|
|
1385
1420
|
ref: P,
|
|
1386
1421
|
style: {
|
|
1387
|
-
opacity:
|
|
1422
|
+
opacity: w && w > 0 ? 1 : 0,
|
|
1388
1423
|
position: "absolute",
|
|
1389
1424
|
inset: 0,
|
|
1390
1425
|
background: "#000",
|
|
@@ -1395,11 +1430,11 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1395
1430
|
"aria-hidden": "true"
|
|
1396
1431
|
}),
|
|
1397
1432
|
/* @__PURE__ */ p("div", {
|
|
1398
|
-
className: `sdk-spinner-overlay ${
|
|
1433
|
+
className: `sdk-spinner-overlay ${Yt ? "active" : ""}`,
|
|
1399
1434
|
"aria-hidden": "true",
|
|
1400
1435
|
children: /* @__PURE__ */ p("div", { className: "sdk-spinner" })
|
|
1401
1436
|
}),
|
|
1402
|
-
|
|
1437
|
+
It && /* @__PURE__ */ p("div", {
|
|
1403
1438
|
style: {
|
|
1404
1439
|
position: "absolute",
|
|
1405
1440
|
inset: 0,
|
|
@@ -1413,10 +1448,10 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1413
1448
|
padding: "0 24px"
|
|
1414
1449
|
},
|
|
1415
1450
|
children: /* @__PURE__ */ p(te, { onRetry: () => {
|
|
1416
|
-
|
|
1451
|
+
Lt(!1), zt((e) => e + 1);
|
|
1417
1452
|
} })
|
|
1418
1453
|
}),
|
|
1419
|
-
|
|
1454
|
+
rr && /* @__PURE__ */ p("div", {
|
|
1420
1455
|
style: {
|
|
1421
1456
|
position: "absolute",
|
|
1422
1457
|
top: "50%",
|
|
@@ -1435,24 +1470,24 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1435
1470
|
backdropFilter: "blur(8px)",
|
|
1436
1471
|
border: "1px solid rgba(255,255,255,0.12)"
|
|
1437
1472
|
},
|
|
1438
|
-
children:
|
|
1473
|
+
children: rr
|
|
1439
1474
|
}),
|
|
1440
|
-
R.enableSubtitles && !Z &&
|
|
1475
|
+
R.enableSubtitles && !Z && Ln && G !== "off" && /* @__PURE__ */ p("div", {
|
|
1441
1476
|
className: "sdk-subtitles-overlay",
|
|
1442
1477
|
children: /* @__PURE__ */ p("span", {
|
|
1443
1478
|
className: "sdk-subtitles-text",
|
|
1444
1479
|
style: {
|
|
1445
|
-
fontSize:
|
|
1446
|
-
color:
|
|
1447
|
-
background:
|
|
1448
|
-
border:
|
|
1449
|
-
backdropFilter:
|
|
1480
|
+
fontSize: We.size === "small" ? "14px" : We.size === "large" ? "24px" : "18px",
|
|
1481
|
+
color: We.color ?? "#ffffff",
|
|
1482
|
+
background: We.background === "none" ? "transparent" : We.background === "solid" ? "rgba(0, 0, 0, 0.92)" : "rgba(15, 23, 42, 0.78)",
|
|
1483
|
+
border: We.background === "none" ? "none" : "1px solid rgba(255,255,255,0.08)",
|
|
1484
|
+
backdropFilter: We.background === "none" ? "none" : "blur(8px)"
|
|
1450
1485
|
},
|
|
1451
|
-
dangerouslySetInnerHTML: { __html:
|
|
1486
|
+
dangerouslySetInnerHTML: { __html: Ln }
|
|
1452
1487
|
})
|
|
1453
1488
|
}),
|
|
1454
|
-
|
|
1455
|
-
className: `sdk-overlay-ad sdk-overlay-ad--${
|
|
1489
|
+
Cn && /* @__PURE__ */ m("div", {
|
|
1490
|
+
className: `sdk-overlay-ad sdk-overlay-ad--${Cn.position}`,
|
|
1456
1491
|
role: "complementary",
|
|
1457
1492
|
"aria-label": "Advertisement",
|
|
1458
1493
|
children: [/* @__PURE__ */ m("div", {
|
|
@@ -1460,55 +1495,90 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1460
1495
|
children: [/* @__PURE__ */ p("span", {
|
|
1461
1496
|
className: "sdk-overlay-ad-label",
|
|
1462
1497
|
children: "Ad"
|
|
1463
|
-
}),
|
|
1498
|
+
}), Cn.dismissible && /* @__PURE__ */ p("button", {
|
|
1464
1499
|
className: "sdk-overlay-ad-close",
|
|
1465
|
-
onClick:
|
|
1500
|
+
onClick: ei,
|
|
1466
1501
|
"aria-label": "Close advertisement",
|
|
1467
1502
|
children: "✕"
|
|
1468
1503
|
})]
|
|
1469
1504
|
}), /* @__PURE__ */ p("img", {
|
|
1470
|
-
src:
|
|
1471
|
-
width:
|
|
1472
|
-
height:
|
|
1473
|
-
alt:
|
|
1505
|
+
src: Cn.imageUrl,
|
|
1506
|
+
width: Cn.imageWidth,
|
|
1507
|
+
height: Cn.imageHeight,
|
|
1508
|
+
alt: Cn.title || "Advertisement",
|
|
1474
1509
|
className: "sdk-overlay-ad-img",
|
|
1475
|
-
onClick: () =>
|
|
1510
|
+
onClick: () => ti(Cn)
|
|
1476
1511
|
})]
|
|
1477
1512
|
}),
|
|
1478
1513
|
Z && (() => {
|
|
1479
|
-
let e = B.find((e) => z >= e.startTime && z < e.endTime), t = e ? Math.max(0, e.endTime - z) : 0, n = e ? z - e.startTime : 0, r =
|
|
1480
|
-
return /* @__PURE__ */ m(f, { children: [
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1514
|
+
let e = B.find((e) => z >= e.startTime && z < e.endTime), t = e ? Math.max(0, e.endTime - z) : 0, n = e ? z - e.startTime : 0, r = On.find((e) => z >= e.startTimeSeconds && z < e.startTimeSeconds + e.durationSeconds), i = r ? r.skippable : Ze, a = r ? r.skipOffsetSeconds : Qe, o = i && n >= a, s = Math.ceil(a - n);
|
|
1515
|
+
return /* @__PURE__ */ m(f, { children: [
|
|
1516
|
+
/* @__PURE__ */ m("div", {
|
|
1517
|
+
className: "sdk-ad-countdown",
|
|
1518
|
+
role: "timer",
|
|
1519
|
+
"aria-label": `Advertisement — ${$(t)} remaining`,
|
|
1520
|
+
"aria-live": "off",
|
|
1521
|
+
children: [
|
|
1522
|
+
/* @__PURE__ */ p("span", {
|
|
1523
|
+
className: "sdk-ad-countdown-label",
|
|
1524
|
+
"aria-hidden": "true",
|
|
1525
|
+
children: "Ad"
|
|
1526
|
+
}),
|
|
1527
|
+
/* @__PURE__ */ p("span", {
|
|
1528
|
+
className: "sdk-ad-countdown-sep",
|
|
1529
|
+
"aria-hidden": "true",
|
|
1530
|
+
children: "·"
|
|
1531
|
+
}),
|
|
1532
|
+
/* @__PURE__ */ p("span", {
|
|
1533
|
+
className: "sdk-ad-countdown-time",
|
|
1534
|
+
"aria-hidden": "true",
|
|
1535
|
+
children: $(t)
|
|
1536
|
+
})
|
|
1537
|
+
]
|
|
1538
|
+
}),
|
|
1539
|
+
i && /* @__PURE__ */ p("button", {
|
|
1540
|
+
className: `sdk-skip-ad-btn ${o ? "sdk-skip-ad-btn--ready" : ""}`,
|
|
1541
|
+
onClick: o ? $r : void 0,
|
|
1542
|
+
disabled: !o,
|
|
1543
|
+
"aria-label": o ? "Skip advertisement" : `Skip advertisement available in ${s} seconds`,
|
|
1544
|
+
"aria-disabled": !o,
|
|
1545
|
+
children: o ? "Skip Ad ›" : `Skip in ${s}s`
|
|
1546
|
+
}),
|
|
1547
|
+
r?.cta && (() => {
|
|
1548
|
+
let e = r.cta, t = /* @__PURE__ */ m("button", {
|
|
1549
|
+
className: "sdk-ad-cta-btn",
|
|
1550
|
+
onClick: () => ni(e),
|
|
1551
|
+
"aria-label": `${e.text} — opens advertiser site in a new tab`,
|
|
1552
|
+
children: [/* @__PURE__ */ p("span", {
|
|
1553
|
+
className: "sdk-ad-cta-btn-text",
|
|
1554
|
+
children: e.text
|
|
1555
|
+
}), /* @__PURE__ */ p(me, {
|
|
1556
|
+
size: 15,
|
|
1557
|
+
"aria-hidden": "true"
|
|
1558
|
+
})]
|
|
1559
|
+
});
|
|
1560
|
+
return /* @__PURE__ */ p("div", {
|
|
1561
|
+
className: "sdk-ad-cta",
|
|
1562
|
+
role: "complementary",
|
|
1563
|
+
"aria-label": "Advertisement call to action",
|
|
1564
|
+
children: e.title ? /* @__PURE__ */ m("div", {
|
|
1565
|
+
className: "sdk-ad-cta-card",
|
|
1566
|
+
children: [/* @__PURE__ */ m("div", {
|
|
1567
|
+
className: "sdk-ad-cta-info",
|
|
1568
|
+
children: [/* @__PURE__ */ p("div", {
|
|
1569
|
+
className: "sdk-ad-cta-title",
|
|
1570
|
+
children: e.title
|
|
1571
|
+
}), e.description && /* @__PURE__ */ p("div", {
|
|
1572
|
+
className: "sdk-ad-cta-desc",
|
|
1573
|
+
children: e.description
|
|
1574
|
+
})]
|
|
1575
|
+
}), t]
|
|
1576
|
+
}) : t
|
|
1577
|
+
});
|
|
1578
|
+
})()
|
|
1579
|
+
] });
|
|
1510
1580
|
})(),
|
|
1511
|
-
|
|
1581
|
+
Ft && /* @__PURE__ */ p("div", {
|
|
1512
1582
|
style: {
|
|
1513
1583
|
position: "absolute",
|
|
1514
1584
|
inset: 0,
|
|
@@ -1534,15 +1604,15 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1534
1604
|
})]
|
|
1535
1605
|
})
|
|
1536
1606
|
}),
|
|
1537
|
-
(Y ||
|
|
1538
|
-
|
|
1539
|
-
className: `sdk-mobile-overlay ${
|
|
1540
|
-
onClick:
|
|
1541
|
-
children: [
|
|
1542
|
-
className: `sdk-mobile-doubletap ${
|
|
1607
|
+
(Y || pr) && /* @__PURE__ */ p("div", { className: "sdk-cast-bg" }),
|
|
1608
|
+
rn && /* @__PURE__ */ m("div", {
|
|
1609
|
+
className: `sdk-mobile-overlay ${Ar ? "active" : ""}`,
|
|
1610
|
+
onClick: mi,
|
|
1611
|
+
children: [kt && /* @__PURE__ */ p("div", {
|
|
1612
|
+
className: `sdk-mobile-doubletap ${kt}`,
|
|
1543
1613
|
children: /* @__PURE__ */ m("div", {
|
|
1544
1614
|
className: "sdk-mobile-doubletap-icon",
|
|
1545
|
-
children: [p(
|
|
1615
|
+
children: [p(kt === "left" ? Se : Ce, { size: 26 }), /* @__PURE__ */ p("span", {
|
|
1546
1616
|
className: "sdk-mobile-doubletap-label",
|
|
1547
1617
|
children: "10s"
|
|
1548
1618
|
})]
|
|
@@ -1552,17 +1622,17 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1552
1622
|
className: "sdk-mobile-header sdk-mobile-ctrl",
|
|
1553
1623
|
children: [/* @__PURE__ */ m("div", {
|
|
1554
1624
|
className: "sdk-mobile-header-left",
|
|
1555
|
-
children: [(
|
|
1625
|
+
children: [(Zt || $t) && /* @__PURE__ */ p("button", {
|
|
1556
1626
|
className: "sdk-mobile-back-btn",
|
|
1557
|
-
onClick:
|
|
1627
|
+
onClick: Qr,
|
|
1558
1628
|
"aria-label": "Exit fullscreen",
|
|
1559
1629
|
children: /* @__PURE__ */ p(pe, {
|
|
1560
1630
|
size: 22,
|
|
1561
1631
|
"aria-hidden": "true"
|
|
1562
1632
|
})
|
|
1563
|
-
}), (
|
|
1633
|
+
}), (x || Or) && /* @__PURE__ */ p("div", {
|
|
1564
1634
|
className: "sdk-mobile-title",
|
|
1565
|
-
children:
|
|
1635
|
+
children: x || Or
|
|
1566
1636
|
})]
|
|
1567
1637
|
}), /* @__PURE__ */ m("div", {
|
|
1568
1638
|
className: "sdk-mobile-header-actions",
|
|
@@ -1570,19 +1640,19 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1570
1640
|
R.enablePiP && /* @__PURE__ */ p("button", {
|
|
1571
1641
|
className: "sdk-mobile-hdr-btn",
|
|
1572
1642
|
onClick: () => {
|
|
1573
|
-
Z ||
|
|
1643
|
+
Z || Zr();
|
|
1574
1644
|
},
|
|
1575
|
-
style: { color:
|
|
1576
|
-
"aria-label":
|
|
1577
|
-
"aria-pressed":
|
|
1578
|
-
children: /* @__PURE__ */ p(
|
|
1645
|
+
style: { color: an ? h : "" },
|
|
1646
|
+
"aria-label": an ? "Exit picture-in-picture" : "Enter picture-in-picture",
|
|
1647
|
+
"aria-pressed": an,
|
|
1648
|
+
children: /* @__PURE__ */ p(be, {
|
|
1579
1649
|
size: 20,
|
|
1580
1650
|
"aria-hidden": "true"
|
|
1581
1651
|
})
|
|
1582
1652
|
}),
|
|
1583
1653
|
R.enableChromecast && !Z && /* @__PURE__ */ p("button", {
|
|
1584
1654
|
className: "sdk-mobile-hdr-btn",
|
|
1585
|
-
onClick:
|
|
1655
|
+
onClick: ri,
|
|
1586
1656
|
title: Y ? `Casting to ${Y} — tap to disconnect` : "Cast to device",
|
|
1587
1657
|
"aria-label": Y ? `Stop casting to ${Y}` : "Cast to device",
|
|
1588
1658
|
"aria-pressed": !!Y,
|
|
@@ -1593,12 +1663,12 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1593
1663
|
"aria-hidden": "true"
|
|
1594
1664
|
})
|
|
1595
1665
|
}),
|
|
1596
|
-
R.allowAirplay &&
|
|
1666
|
+
R.allowAirplay && dr && /* @__PURE__ */ p("button", {
|
|
1597
1667
|
className: "sdk-mobile-hdr-btn",
|
|
1598
|
-
onClick:
|
|
1599
|
-
"aria-label":
|
|
1600
|
-
"aria-pressed":
|
|
1601
|
-
style: { color:
|
|
1668
|
+
onClick: ii,
|
|
1669
|
+
"aria-label": pr ? `Stop AirPlay to ${hr || "device"}` : "AirPlay to device",
|
|
1670
|
+
"aria-pressed": pr,
|
|
1671
|
+
style: { color: pr ? h : "" },
|
|
1602
1672
|
children: /* @__PURE__ */ p(ue, {
|
|
1603
1673
|
size: 20,
|
|
1604
1674
|
"aria-hidden": "true"
|
|
@@ -1612,12 +1682,12 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1612
1682
|
children: [
|
|
1613
1683
|
!Z && /* @__PURE__ */ m("button", {
|
|
1614
1684
|
className: "sdk-mobile-seek-btn",
|
|
1615
|
-
onClick: () => Q(W(Math.max(0, U(
|
|
1685
|
+
onClick: () => Q(W(Math.max(0, U(ui) - 10)), {
|
|
1616
1686
|
eventType: "fast_backward",
|
|
1617
1687
|
skipSeconds: 10
|
|
1618
1688
|
}),
|
|
1619
1689
|
"aria-label": "Rewind 10 seconds",
|
|
1620
|
-
children: [/* @__PURE__ */ p(
|
|
1690
|
+
children: [/* @__PURE__ */ p(Se, {
|
|
1621
1691
|
size: 22,
|
|
1622
1692
|
"aria-hidden": "true"
|
|
1623
1693
|
}), /* @__PURE__ */ p("span", {
|
|
@@ -1628,16 +1698,16 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1628
1698
|
}),
|
|
1629
1699
|
/* @__PURE__ */ p("button", {
|
|
1630
1700
|
className: "sdk-mobile-play-btn",
|
|
1631
|
-
onClick:
|
|
1632
|
-
"aria-label":
|
|
1633
|
-
children:
|
|
1701
|
+
onClick: Hr,
|
|
1702
|
+
"aria-label": sn ? "Replay" : li ? "Pause" : "Play",
|
|
1703
|
+
children: sn ? /* @__PURE__ */ p(Se, {
|
|
1634
1704
|
size: 38,
|
|
1635
1705
|
"aria-hidden": "true"
|
|
1636
|
-
}) :
|
|
1706
|
+
}) : li ? /* @__PURE__ */ p(v, {
|
|
1637
1707
|
size: 38,
|
|
1638
1708
|
fill: "currentColor",
|
|
1639
1709
|
"aria-hidden": "true"
|
|
1640
|
-
}) : /* @__PURE__ */ p(
|
|
1710
|
+
}) : /* @__PURE__ */ p(xe, {
|
|
1641
1711
|
size: 38,
|
|
1642
1712
|
fill: "currentColor",
|
|
1643
1713
|
style: { marginLeft: "3px" },
|
|
@@ -1646,12 +1716,12 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1646
1716
|
}),
|
|
1647
1717
|
!Z && /* @__PURE__ */ m("button", {
|
|
1648
1718
|
className: "sdk-mobile-seek-btn",
|
|
1649
|
-
onClick: () => Q(W(Math.min(H, U(
|
|
1719
|
+
onClick: () => Q(W(Math.min(H, U(ui) + 10)), {
|
|
1650
1720
|
eventType: "fast_forward",
|
|
1651
1721
|
skipSeconds: 10
|
|
1652
1722
|
}),
|
|
1653
1723
|
"aria-label": "Skip forward 10 seconds",
|
|
1654
|
-
children: [/* @__PURE__ */ p(
|
|
1724
|
+
children: [/* @__PURE__ */ p(Ce, {
|
|
1655
1725
|
size: 22,
|
|
1656
1726
|
"aria-hidden": "true"
|
|
1657
1727
|
}), /* @__PURE__ */ p("span", {
|
|
@@ -1665,10 +1735,10 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1665
1735
|
/* @__PURE__ */ m("div", {
|
|
1666
1736
|
className: "sdk-mobile-bottom-bar sdk-mobile-ctrl",
|
|
1667
1737
|
children: [
|
|
1668
|
-
R.enableKeyMoments &&
|
|
1738
|
+
R.enableKeyMoments && Zn && K.length > 0 && /* @__PURE__ */ p("div", {
|
|
1669
1739
|
className: "sdk-mobile-chapters-scroll",
|
|
1670
1740
|
children: K.map((e, t) => {
|
|
1671
|
-
let n =
|
|
1741
|
+
let n = Kn.index === t;
|
|
1672
1742
|
return /* @__PURE__ */ m("div", {
|
|
1673
1743
|
role: "button",
|
|
1674
1744
|
tabIndex: 0,
|
|
@@ -1677,13 +1747,13 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1677
1747
|
"aria-label": `${e.title}, ${$(e.startTime)}${n ? ", current chapter" : ""}`,
|
|
1678
1748
|
"aria-current": n ? "true" : void 0,
|
|
1679
1749
|
onClick: () => {
|
|
1680
|
-
|
|
1750
|
+
Xr(e.startTime, e);
|
|
1681
1751
|
},
|
|
1682
|
-
onKeyDown:
|
|
1752
|
+
onKeyDown: _i(() => Xr(e.startTime, e)),
|
|
1683
1753
|
children: [/* @__PURE__ */ m("div", {
|
|
1684
1754
|
className: "sdk-mobile-chapter-thumb",
|
|
1685
|
-
children: [
|
|
1686
|
-
src:
|
|
1755
|
+
children: [$n[t] || e.thumbnail ? /* @__PURE__ */ p("img", {
|
|
1756
|
+
src: $n[t] || e.thumbnail,
|
|
1687
1757
|
alt: "",
|
|
1688
1758
|
"aria-hidden": "true",
|
|
1689
1759
|
style: {
|
|
@@ -1692,7 +1762,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1692
1762
|
objectFit: "cover",
|
|
1693
1763
|
display: "block"
|
|
1694
1764
|
}
|
|
1695
|
-
}) : /* @__PURE__ */ p(
|
|
1765
|
+
}) : /* @__PURE__ */ p(_e, {
|
|
1696
1766
|
size: 16,
|
|
1697
1767
|
"aria-hidden": "true",
|
|
1698
1768
|
style: { color: n ? h : "rgba(255,255,255,0.3)" }
|
|
@@ -1710,7 +1780,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1710
1780
|
})
|
|
1711
1781
|
}),
|
|
1712
1782
|
/* @__PURE__ */ p("div", {
|
|
1713
|
-
ref:
|
|
1783
|
+
ref: E,
|
|
1714
1784
|
role: Z ? void 0 : "slider",
|
|
1715
1785
|
"aria-label": Z ? void 0 : "Seek",
|
|
1716
1786
|
"aria-valuemin": Z ? void 0 : 0,
|
|
@@ -1719,11 +1789,11 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1719
1789
|
"aria-valuetext": Z ? void 0 : `${$(U(X === null ? z : X))} of ${$(H)}`,
|
|
1720
1790
|
tabIndex: Z ? void 0 : 0,
|
|
1721
1791
|
className: `sdk-seekbar-container sdk-mobile-seekbar${Z ? " sdk-ad-mode" : ""}`,
|
|
1722
|
-
onMouseDown: Z ? void 0 :
|
|
1723
|
-
onMouseMove: Z ? void 0 :
|
|
1724
|
-
onMouseLeave: Z ? void 0 :
|
|
1725
|
-
onTouchStart: Z ? void 0 :
|
|
1726
|
-
onKeyDown: Z ? void 0 :
|
|
1792
|
+
onMouseDown: Z ? void 0 : Wr,
|
|
1793
|
+
onMouseMove: Z ? void 0 : ai,
|
|
1794
|
+
onMouseLeave: Z ? void 0 : ci,
|
|
1795
|
+
onTouchStart: Z ? void 0 : si,
|
|
1796
|
+
onKeyDown: Z ? void 0 : vi,
|
|
1727
1797
|
style: {
|
|
1728
1798
|
pointerEvents: Z ? "none" : void 0,
|
|
1729
1799
|
touchAction: "none"
|
|
@@ -1737,9 +1807,9 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1737
1807
|
}) : /* @__PURE__ */ m(f, { children: [
|
|
1738
1808
|
/* @__PURE__ */ p("div", {
|
|
1739
1809
|
className: "sdk-seekbar-buffered",
|
|
1740
|
-
style: { width: `${
|
|
1810
|
+
style: { width: `${Ut ? (L && L.getBufferedRanges()[0]?.end || 0) / Ut * 100 : 0}%` }
|
|
1741
1811
|
}),
|
|
1742
|
-
H > 0 && B.filter((e) => !
|
|
1812
|
+
H > 0 && B.filter((e) => !fn.has(e.startTime)).map((e, t) => /* @__PURE__ */ p("div", {
|
|
1743
1813
|
className: "sdk-seekbar-adbreak",
|
|
1744
1814
|
style: {
|
|
1745
1815
|
left: `${U(e.startTime) / H * 100}%`,
|
|
@@ -1749,7 +1819,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1749
1819
|
/* @__PURE__ */ p("div", {
|
|
1750
1820
|
className: "sdk-seekbar-progress",
|
|
1751
1821
|
style: {
|
|
1752
|
-
width: Y ? `${
|
|
1822
|
+
width: Y ? `${di > 0 ? ui / di * 100 : 0}%` : `${H ? U(X === null ? z : X) / H * 100 : 0}%`,
|
|
1753
1823
|
background: "#ffffff",
|
|
1754
1824
|
boxShadow: "none"
|
|
1755
1825
|
},
|
|
@@ -1771,28 +1841,28 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1771
1841
|
className: "sdk-mobile-controls-row",
|
|
1772
1842
|
children: [!Z && /* @__PURE__ */ p("span", {
|
|
1773
1843
|
className: "sdk-time-display",
|
|
1774
|
-
children: Y ? `${$(
|
|
1844
|
+
children: Y ? `${$(ui)} / ${$(di)}` : `${$(U(X === null ? z : X))} / ${$(H)}`
|
|
1775
1845
|
}), /* @__PURE__ */ m("div", {
|
|
1776
1846
|
className: "sdk-mobile-bottom-icons",
|
|
1777
1847
|
children: [
|
|
1778
1848
|
R.enableKeyMoments && K.length > 0 && !Z && /* @__PURE__ */ p("button", {
|
|
1779
|
-
className: `sdk-mobile-icon-btn${
|
|
1849
|
+
className: `sdk-mobile-icon-btn${Zn ? " active" : ""}`,
|
|
1780
1850
|
onClick: () => {
|
|
1781
|
-
|
|
1851
|
+
Qn(!Zn);
|
|
1782
1852
|
},
|
|
1783
|
-
"aria-label":
|
|
1784
|
-
"aria-pressed":
|
|
1785
|
-
children: /* @__PURE__ */ p(
|
|
1853
|
+
"aria-label": Zn ? "Hide chapters" : "Show chapters",
|
|
1854
|
+
"aria-pressed": Zn,
|
|
1855
|
+
children: /* @__PURE__ */ p(_e, {
|
|
1786
1856
|
size: 18,
|
|
1787
1857
|
"aria-hidden": "true"
|
|
1788
1858
|
})
|
|
1789
1859
|
}),
|
|
1790
|
-
R.enableSubtitles && !Z &&
|
|
1860
|
+
R.enableSubtitles && !Z && Bn.some((e) => !e.isNative) && /* @__PURE__ */ m("div", {
|
|
1791
1861
|
className: "sdk-menu-container",
|
|
1792
1862
|
children: [/* @__PURE__ */ p("button", {
|
|
1793
1863
|
className: `sdk-mobile-icon-btn${G === "off" ? "" : " active"}`,
|
|
1794
1864
|
onClick: () => {
|
|
1795
|
-
|
|
1865
|
+
yi("subtitles");
|
|
1796
1866
|
},
|
|
1797
1867
|
"aria-label": "Captions",
|
|
1798
1868
|
"aria-haspopup": "listbox",
|
|
@@ -1802,7 +1872,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1802
1872
|
"aria-hidden": "true"
|
|
1803
1873
|
})
|
|
1804
1874
|
}), q === "subtitles" && /* @__PURE__ */ m("div", {
|
|
1805
|
-
ref:
|
|
1875
|
+
ref: bi,
|
|
1806
1876
|
className: "sdk-dropup-menu",
|
|
1807
1877
|
role: "listbox",
|
|
1808
1878
|
"aria-label": "Captions",
|
|
@@ -1817,20 +1887,20 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1817
1887
|
"aria-selected": G === "off",
|
|
1818
1888
|
tabIndex: 0,
|
|
1819
1889
|
className: `sdk-dropup-item ${G === "off" ? "active" : ""}`,
|
|
1820
|
-
onClick: () =>
|
|
1821
|
-
onKeyDown:
|
|
1890
|
+
onClick: () => Jr("off"),
|
|
1891
|
+
onKeyDown: gi(() => Jr("off")),
|
|
1822
1892
|
children: [/* @__PURE__ */ p("span", { children: "Off" }), G === "off" && /* @__PURE__ */ p(_, {
|
|
1823
1893
|
size: 12,
|
|
1824
1894
|
"aria-hidden": "true"
|
|
1825
1895
|
})]
|
|
1826
1896
|
}),
|
|
1827
|
-
|
|
1897
|
+
Bn.map((e) => /* @__PURE__ */ m("div", {
|
|
1828
1898
|
role: "option",
|
|
1829
1899
|
"aria-selected": G === e.id,
|
|
1830
1900
|
tabIndex: 0,
|
|
1831
1901
|
className: `sdk-dropup-item ${G === e.id ? "active" : ""}`,
|
|
1832
|
-
onClick: () =>
|
|
1833
|
-
onKeyDown:
|
|
1902
|
+
onClick: () => Jr(e.id),
|
|
1903
|
+
onKeyDown: gi(() => Jr(e.id)),
|
|
1834
1904
|
children: [/* @__PURE__ */ p("span", { children: b(e) }), G === e.id && /* @__PURE__ */ p(_, {
|
|
1835
1905
|
size: 12,
|
|
1836
1906
|
"aria-hidden": "true"
|
|
@@ -1839,22 +1909,22 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1839
1909
|
]
|
|
1840
1910
|
})]
|
|
1841
1911
|
}),
|
|
1842
|
-
R.allowMultipleAudio &&
|
|
1912
|
+
R.allowMultipleAudio && Hn.length > 1 && !Z && /* @__PURE__ */ m("div", {
|
|
1843
1913
|
className: "sdk-menu-container",
|
|
1844
1914
|
children: [/* @__PURE__ */ p("button", {
|
|
1845
1915
|
className: `sdk-mobile-icon-btn${q === "audio" ? " active" : ""}`,
|
|
1846
1916
|
onClick: () => {
|
|
1847
|
-
|
|
1917
|
+
yi("audio");
|
|
1848
1918
|
},
|
|
1849
1919
|
"aria-label": "Audio track",
|
|
1850
1920
|
"aria-haspopup": "listbox",
|
|
1851
1921
|
"aria-expanded": q === "audio",
|
|
1852
|
-
children: /* @__PURE__ */ p(
|
|
1922
|
+
children: /* @__PURE__ */ p(ge, {
|
|
1853
1923
|
size: 18,
|
|
1854
1924
|
"aria-hidden": "true"
|
|
1855
1925
|
})
|
|
1856
1926
|
}), q === "audio" && /* @__PURE__ */ m("div", {
|
|
1857
|
-
ref:
|
|
1927
|
+
ref: bi,
|
|
1858
1928
|
className: "sdk-dropup-menu",
|
|
1859
1929
|
role: "listbox",
|
|
1860
1930
|
"aria-label": "Audio track",
|
|
@@ -1862,18 +1932,18 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1862
1932
|
className: "sdk-dropup-header",
|
|
1863
1933
|
"aria-hidden": "true",
|
|
1864
1934
|
children: "Audio Track"
|
|
1865
|
-
}),
|
|
1935
|
+
}), Hn.map((e) => /* @__PURE__ */ m("div", {
|
|
1866
1936
|
role: "option",
|
|
1867
|
-
"aria-selected":
|
|
1937
|
+
"aria-selected": Wn === e.id,
|
|
1868
1938
|
tabIndex: 0,
|
|
1869
|
-
className: `sdk-dropup-item ${
|
|
1939
|
+
className: `sdk-dropup-item ${Wn === e.id ? "active" : ""}`,
|
|
1870
1940
|
onClick: () => {
|
|
1871
|
-
L?.setAudioTrack(e.id),
|
|
1941
|
+
L?.setAudioTrack(e.id), Gn(e.id), J("none"), nr(`Audio: ${b(e)}`);
|
|
1872
1942
|
},
|
|
1873
|
-
onKeyDown:
|
|
1874
|
-
L?.setAudioTrack(e.id),
|
|
1943
|
+
onKeyDown: gi(() => {
|
|
1944
|
+
L?.setAudioTrack(e.id), Gn(e.id), J("none"), nr(`Audio: ${b(e)}`);
|
|
1875
1945
|
}),
|
|
1876
|
-
children: [/* @__PURE__ */ p("span", { children: b(e) }),
|
|
1946
|
+
children: [/* @__PURE__ */ p("span", { children: b(e) }), Wn === e.id && /* @__PURE__ */ p(_, {
|
|
1877
1947
|
size: 12,
|
|
1878
1948
|
"aria-hidden": "true"
|
|
1879
1949
|
})]
|
|
@@ -1885,17 +1955,17 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1885
1955
|
children: [/* @__PURE__ */ p("button", {
|
|
1886
1956
|
className: `sdk-mobile-icon-btn${q === "speed" ? " active" : ""}`,
|
|
1887
1957
|
onClick: () => {
|
|
1888
|
-
|
|
1958
|
+
yi("speed");
|
|
1889
1959
|
},
|
|
1890
1960
|
"aria-label": "Playback speed",
|
|
1891
1961
|
"aria-haspopup": "listbox",
|
|
1892
1962
|
"aria-expanded": q === "speed",
|
|
1893
|
-
children: /* @__PURE__ */ p(
|
|
1963
|
+
children: /* @__PURE__ */ p(he, {
|
|
1894
1964
|
size: 18,
|
|
1895
1965
|
"aria-hidden": "true"
|
|
1896
1966
|
})
|
|
1897
1967
|
}), q === "speed" && /* @__PURE__ */ m("div", {
|
|
1898
|
-
ref:
|
|
1968
|
+
ref: bi,
|
|
1899
1969
|
className: "sdk-dropup-menu",
|
|
1900
1970
|
role: "listbox",
|
|
1901
1971
|
"aria-label": "Playback speed",
|
|
@@ -1912,12 +1982,12 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1912
1982
|
2
|
|
1913
1983
|
].map((e) => /* @__PURE__ */ m("div", {
|
|
1914
1984
|
role: "option",
|
|
1915
|
-
"aria-selected":
|
|
1985
|
+
"aria-selected": Yn === e,
|
|
1916
1986
|
tabIndex: 0,
|
|
1917
|
-
className: `sdk-dropup-item ${
|
|
1918
|
-
onClick: () =>
|
|
1919
|
-
onKeyDown:
|
|
1920
|
-
children: [/* @__PURE__ */ p("span", { children: e === 1 ? "Normal" : `${e}x` }),
|
|
1987
|
+
className: `sdk-dropup-item ${Yn === e ? "active" : ""}`,
|
|
1988
|
+
onClick: () => Kr(e),
|
|
1989
|
+
onKeyDown: gi(() => Kr(e)),
|
|
1990
|
+
children: [/* @__PURE__ */ p("span", { children: e === 1 ? "Normal" : `${e}x` }), Yn === e && /* @__PURE__ */ p(_, {
|
|
1921
1991
|
size: 12,
|
|
1922
1992
|
"aria-hidden": "true"
|
|
1923
1993
|
})]
|
|
@@ -1927,19 +1997,19 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1927
1997
|
R.enableQuality && !Z && /* @__PURE__ */ m("div", {
|
|
1928
1998
|
className: "sdk-menu-container",
|
|
1929
1999
|
children: [/* @__PURE__ */ p("button", {
|
|
1930
|
-
className: `sdk-mobile-icon-btn${
|
|
2000
|
+
className: `sdk-mobile-icon-btn${Fn.id === -1 ? "" : " active"}`,
|
|
1931
2001
|
onClick: () => {
|
|
1932
|
-
|
|
2002
|
+
yi("quality");
|
|
1933
2003
|
},
|
|
1934
2004
|
"aria-label": "Video quality",
|
|
1935
2005
|
"aria-haspopup": "listbox",
|
|
1936
2006
|
"aria-expanded": q === "quality",
|
|
1937
|
-
children: /* @__PURE__ */ p(
|
|
2007
|
+
children: /* @__PURE__ */ p(y, {
|
|
1938
2008
|
size: 18,
|
|
1939
2009
|
"aria-hidden": "true"
|
|
1940
2010
|
})
|
|
1941
2011
|
}), q === "quality" && /* @__PURE__ */ m("div", {
|
|
1942
|
-
ref:
|
|
2012
|
+
ref: bi,
|
|
1943
2013
|
className: "sdk-dropup-menu large",
|
|
1944
2014
|
role: "listbox",
|
|
1945
2015
|
"aria-label": "Video quality",
|
|
@@ -1947,36 +2017,36 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1947
2017
|
className: "sdk-dropup-header",
|
|
1948
2018
|
"aria-hidden": "true",
|
|
1949
2019
|
children: "Quality"
|
|
1950
|
-
}),
|
|
2020
|
+
}), Nn.map((e) => /* @__PURE__ */ m("div", {
|
|
1951
2021
|
role: "option",
|
|
1952
|
-
"aria-selected":
|
|
2022
|
+
"aria-selected": Fn.id === e.id,
|
|
1953
2023
|
tabIndex: 0,
|
|
1954
|
-
className: `sdk-dropup-item ${
|
|
1955
|
-
onClick: () =>
|
|
1956
|
-
onKeyDown:
|
|
1957
|
-
children: [/* @__PURE__ */ p("span", { children: e.label }),
|
|
2024
|
+
className: `sdk-dropup-item ${Fn.id === e.id ? "active" : ""}`,
|
|
2025
|
+
onClick: () => qr(e.id),
|
|
2026
|
+
onKeyDown: gi(() => qr(e.id)),
|
|
2027
|
+
children: [/* @__PURE__ */ p("span", { children: e.label }), Fn.id === e.id && /* @__PURE__ */ p(_, {
|
|
1958
2028
|
size: 12,
|
|
1959
2029
|
"aria-hidden": "true"
|
|
1960
2030
|
})]
|
|
1961
2031
|
}, e.id))]
|
|
1962
2032
|
})]
|
|
1963
2033
|
}),
|
|
1964
|
-
|
|
2034
|
+
S && S.length > 1 && !Z && /* @__PURE__ */ m("div", {
|
|
1965
2035
|
className: "sdk-menu-container",
|
|
1966
2036
|
children: [/* @__PURE__ */ p("button", {
|
|
1967
2037
|
className: `sdk-mobile-icon-btn${q === "sources" ? " active" : ""}`,
|
|
1968
2038
|
onClick: () => {
|
|
1969
|
-
|
|
2039
|
+
yi("sources");
|
|
1970
2040
|
},
|
|
1971
2041
|
"aria-label": "Select source",
|
|
1972
2042
|
"aria-haspopup": "listbox",
|
|
1973
2043
|
"aria-expanded": q === "sources",
|
|
1974
|
-
children: /* @__PURE__ */ p(
|
|
2044
|
+
children: /* @__PURE__ */ p(Me, {
|
|
1975
2045
|
size: 18,
|
|
1976
2046
|
"aria-hidden": "true"
|
|
1977
2047
|
})
|
|
1978
2048
|
}), q === "sources" && /* @__PURE__ */ m("div", {
|
|
1979
|
-
ref:
|
|
2049
|
+
ref: bi,
|
|
1980
2050
|
className: "sdk-dropup-menu",
|
|
1981
2051
|
role: "listbox",
|
|
1982
2052
|
"aria-label": "Select source",
|
|
@@ -1984,14 +2054,14 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
1984
2054
|
className: "sdk-dropup-header",
|
|
1985
2055
|
"aria-hidden": "true",
|
|
1986
2056
|
children: "Source"
|
|
1987
|
-
}),
|
|
2057
|
+
}), S.map((e, t) => /* @__PURE__ */ m("div", {
|
|
1988
2058
|
role: "option",
|
|
1989
|
-
"aria-selected":
|
|
2059
|
+
"aria-selected": C === t,
|
|
1990
2060
|
tabIndex: 0,
|
|
1991
|
-
className: `sdk-dropup-item ${
|
|
1992
|
-
onClick: () =>
|
|
1993
|
-
onKeyDown:
|
|
1994
|
-
children: [/* @__PURE__ */ p("span", { children: e.label }),
|
|
2061
|
+
className: `sdk-dropup-item ${C === t ? "active" : ""}`,
|
|
2062
|
+
onClick: () => Yr(t),
|
|
2063
|
+
onKeyDown: gi(() => Yr(t)),
|
|
2064
|
+
children: [/* @__PURE__ */ p("span", { children: e.label }), C === t && /* @__PURE__ */ p(_, {
|
|
1995
2065
|
size: 12,
|
|
1996
2066
|
"aria-hidden": "true"
|
|
1997
2067
|
})]
|
|
@@ -2000,10 +2070,10 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2000
2070
|
}),
|
|
2001
2071
|
/* @__PURE__ */ p("button", {
|
|
2002
2072
|
className: "sdk-mobile-icon-btn",
|
|
2003
|
-
onClick:
|
|
2004
|
-
"aria-label":
|
|
2005
|
-
"aria-pressed":
|
|
2006
|
-
children: p(
|
|
2073
|
+
onClick: Qr,
|
|
2074
|
+
"aria-label": Zt || $t ? "Exit fullscreen" : "Enter fullscreen",
|
|
2075
|
+
"aria-pressed": Zt || $t,
|
|
2076
|
+
children: p(Zt ? ye : ve, {
|
|
2007
2077
|
size: 18,
|
|
2008
2078
|
"aria-hidden": "true"
|
|
2009
2079
|
})
|
|
@@ -2015,28 +2085,28 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2015
2085
|
})
|
|
2016
2086
|
] })]
|
|
2017
2087
|
}),
|
|
2018
|
-
!
|
|
2088
|
+
!rn && /* @__PURE__ */ m("div", {
|
|
2019
2089
|
className: "sdk-controls-overlay",
|
|
2020
2090
|
onClick: (e) => {
|
|
2021
|
-
Z || e.target.closest(".sdk-desktop-header") || e.target.closest(".sdk-desktop-center-controls") || e.target.closest(".sdk-desktop-bottom") ||
|
|
2091
|
+
Z || e.target.closest(".sdk-desktop-header") || e.target.closest(".sdk-desktop-center-controls") || e.target.closest(".sdk-desktop-bottom") || Hr();
|
|
2022
2092
|
},
|
|
2023
2093
|
children: [/* @__PURE__ */ m("div", {
|
|
2024
2094
|
className: "sdk-desktop-header",
|
|
2025
2095
|
children: [/* @__PURE__ */ m("div", {
|
|
2026
2096
|
className: "sdk-desktop-header-left",
|
|
2027
|
-
children: [(
|
|
2097
|
+
children: [(Zt || $t) && /* @__PURE__ */ p("button", {
|
|
2028
2098
|
className: "sdk-desktop-back-btn",
|
|
2029
2099
|
onClick: (e) => {
|
|
2030
|
-
e.stopPropagation(),
|
|
2100
|
+
e.stopPropagation(), Qr();
|
|
2031
2101
|
},
|
|
2032
2102
|
"aria-label": "Exit fullscreen",
|
|
2033
2103
|
children: /* @__PURE__ */ p(pe, {
|
|
2034
2104
|
size: 22,
|
|
2035
2105
|
"aria-hidden": "true"
|
|
2036
2106
|
})
|
|
2037
|
-
}), (
|
|
2107
|
+
}), (x || Or) && /* @__PURE__ */ p("span", {
|
|
2038
2108
|
className: "sdk-desktop-title",
|
|
2039
|
-
children:
|
|
2109
|
+
children: x || Or
|
|
2040
2110
|
})]
|
|
2041
2111
|
}), /* @__PURE__ */ m("div", {
|
|
2042
2112
|
className: "sdk-desktop-header-right",
|
|
@@ -2044,7 +2114,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2044
2114
|
R.enableChromecast && !Z && /* @__PURE__ */ p("button", {
|
|
2045
2115
|
className: "sdk-desktop-hdr-btn",
|
|
2046
2116
|
onClick: (e) => {
|
|
2047
|
-
e.stopPropagation(),
|
|
2117
|
+
e.stopPropagation(), ri();
|
|
2048
2118
|
},
|
|
2049
2119
|
title: Y ? `Casting to ${Y} — click to disconnect` : "Cast to device",
|
|
2050
2120
|
"aria-label": Y ? `Stop casting to ${Y}` : "Cast to device",
|
|
@@ -2065,15 +2135,15 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2065
2135
|
"aria-hidden": "true"
|
|
2066
2136
|
}), Y]
|
|
2067
2137
|
}),
|
|
2068
|
-
R.allowAirplay &&
|
|
2138
|
+
R.allowAirplay && dr && /* @__PURE__ */ p("button", {
|
|
2069
2139
|
className: "sdk-desktop-hdr-btn",
|
|
2070
2140
|
onClick: (e) => {
|
|
2071
|
-
e.stopPropagation(),
|
|
2141
|
+
e.stopPropagation(), ii();
|
|
2072
2142
|
},
|
|
2073
|
-
title:
|
|
2074
|
-
"aria-label":
|
|
2075
|
-
"aria-pressed":
|
|
2076
|
-
style: { color:
|
|
2143
|
+
title: pr ? `AirPlay to ${hr || "device"} — click to disconnect` : "AirPlay to device",
|
|
2144
|
+
"aria-label": pr ? `Stop AirPlay to ${hr || "device"}` : "AirPlay to device",
|
|
2145
|
+
"aria-pressed": pr,
|
|
2146
|
+
style: { color: pr ? h : "" },
|
|
2077
2147
|
children: /* @__PURE__ */ p(ue, {
|
|
2078
2148
|
size: 20,
|
|
2079
2149
|
"aria-hidden": "true"
|
|
@@ -2090,7 +2160,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2090
2160
|
className: "sdk-desktop-seek-btn",
|
|
2091
2161
|
style: { pointerEvents: "auto" },
|
|
2092
2162
|
onClick: (e) => {
|
|
2093
|
-
e.stopPropagation(), Q(W(Math.max(0, U(
|
|
2163
|
+
e.stopPropagation(), Q(W(Math.max(0, U(ui) - 10)), {
|
|
2094
2164
|
eventType: "fast_backward",
|
|
2095
2165
|
skipSeconds: 10
|
|
2096
2166
|
});
|
|
@@ -2104,7 +2174,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2104
2174
|
alignItems: "center",
|
|
2105
2175
|
justifyContent: "center"
|
|
2106
2176
|
},
|
|
2107
|
-
children: [/* @__PURE__ */ p(
|
|
2177
|
+
children: [/* @__PURE__ */ p(Se, {
|
|
2108
2178
|
size: 30,
|
|
2109
2179
|
"aria-hidden": "true"
|
|
2110
2180
|
}), /* @__PURE__ */ p("span", {
|
|
@@ -2118,18 +2188,18 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2118
2188
|
className: "sdk-desktop-play-btn",
|
|
2119
2189
|
style: { pointerEvents: "auto" },
|
|
2120
2190
|
onClick: (e) => {
|
|
2121
|
-
e.stopPropagation(),
|
|
2191
|
+
e.stopPropagation(), Hr();
|
|
2122
2192
|
},
|
|
2123
|
-
title:
|
|
2124
|
-
"aria-label":
|
|
2125
|
-
children:
|
|
2193
|
+
title: sn ? "Replay" : li ? "Pause" : "Play",
|
|
2194
|
+
"aria-label": sn ? "Replay" : li ? "Pause" : "Play",
|
|
2195
|
+
children: sn ? /* @__PURE__ */ p(Se, {
|
|
2126
2196
|
size: 38,
|
|
2127
2197
|
"aria-hidden": "true"
|
|
2128
|
-
}) :
|
|
2198
|
+
}) : li ? /* @__PURE__ */ p(v, {
|
|
2129
2199
|
size: 38,
|
|
2130
2200
|
fill: "currentColor",
|
|
2131
2201
|
"aria-hidden": "true"
|
|
2132
|
-
}) : /* @__PURE__ */ p(
|
|
2202
|
+
}) : /* @__PURE__ */ p(xe, {
|
|
2133
2203
|
size: 38,
|
|
2134
2204
|
fill: "currentColor",
|
|
2135
2205
|
style: { marginLeft: "4px" },
|
|
@@ -2140,7 +2210,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2140
2210
|
className: "sdk-desktop-seek-btn",
|
|
2141
2211
|
style: { pointerEvents: "auto" },
|
|
2142
2212
|
onClick: (e) => {
|
|
2143
|
-
e.stopPropagation(), Q(W(Math.min(H, U(
|
|
2213
|
+
e.stopPropagation(), Q(W(Math.min(H, U(ui) + 10)), {
|
|
2144
2214
|
eventType: "fast_forward",
|
|
2145
2215
|
skipSeconds: 10
|
|
2146
2216
|
});
|
|
@@ -2154,7 +2224,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2154
2224
|
alignItems: "center",
|
|
2155
2225
|
justifyContent: "center"
|
|
2156
2226
|
},
|
|
2157
|
-
children: [/* @__PURE__ */ p(
|
|
2227
|
+
children: [/* @__PURE__ */ p(Ce, {
|
|
2158
2228
|
size: 30,
|
|
2159
2229
|
"aria-hidden": "true"
|
|
2160
2230
|
}), /* @__PURE__ */ p("span", {
|
|
@@ -2166,7 +2236,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2166
2236
|
})
|
|
2167
2237
|
]
|
|
2168
2238
|
}),
|
|
2169
|
-
R.enableKeyMoments &&
|
|
2239
|
+
R.enableKeyMoments && Zn && K.length > 0 && qe === "panel" && /* @__PURE__ */ m("div", {
|
|
2170
2240
|
className: "sdk-chapters-panel",
|
|
2171
2241
|
onClick: (e) => e.stopPropagation(),
|
|
2172
2242
|
children: [/* @__PURE__ */ p("div", {
|
|
@@ -2178,19 +2248,19 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2178
2248
|
}), /* @__PURE__ */ p("div", {
|
|
2179
2249
|
className: "sdk-chapters-panel-list",
|
|
2180
2250
|
children: K.map((e, t) => {
|
|
2181
|
-
let n =
|
|
2251
|
+
let n = Kn.index === t;
|
|
2182
2252
|
return /* @__PURE__ */ m("div", {
|
|
2183
2253
|
role: "button",
|
|
2184
2254
|
tabIndex: 0,
|
|
2185
2255
|
className: `sdk-chapters-panel-item${n ? " active" : ""}`,
|
|
2186
2256
|
"aria-label": `${e.title}, ${$(e.startTime)}${n ? ", current chapter" : ""}`,
|
|
2187
2257
|
"aria-current": n ? "true" : void 0,
|
|
2188
|
-
onClick: () =>
|
|
2189
|
-
onKeyDown:
|
|
2258
|
+
onClick: () => Xr(e.startTime, e),
|
|
2259
|
+
onKeyDown: _i(() => Xr(e.startTime, e)),
|
|
2190
2260
|
children: [/* @__PURE__ */ p("div", {
|
|
2191
2261
|
className: "sdk-chapters-panel-thumb",
|
|
2192
|
-
children:
|
|
2193
|
-
src:
|
|
2262
|
+
children: $n[t] || e.thumbnail ? /* @__PURE__ */ p("img", {
|
|
2263
|
+
src: $n[t] || e.thumbnail,
|
|
2194
2264
|
alt: "",
|
|
2195
2265
|
"aria-hidden": "true",
|
|
2196
2266
|
style: {
|
|
@@ -2199,7 +2269,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2199
2269
|
objectFit: "cover",
|
|
2200
2270
|
display: "block"
|
|
2201
2271
|
}
|
|
2202
|
-
}) : /* @__PURE__ */ p(
|
|
2272
|
+
}) : /* @__PURE__ */ p(_e, {
|
|
2203
2273
|
size: 18,
|
|
2204
2274
|
"aria-hidden": "true",
|
|
2205
2275
|
style: { color: "rgba(255,255,255,0.3)" }
|
|
@@ -2229,10 +2299,10 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2229
2299
|
/* @__PURE__ */ m("div", {
|
|
2230
2300
|
className: "sdk-desktop-bottom",
|
|
2231
2301
|
children: [
|
|
2232
|
-
R.enableKeyMoments &&
|
|
2302
|
+
R.enableKeyMoments && Zn && K.length > 0 && qe === "strip" && /* @__PURE__ */ p("div", {
|
|
2233
2303
|
className: "sdk-desktop-chapters-strip",
|
|
2234
2304
|
children: K.map((e, t) => {
|
|
2235
|
-
let n =
|
|
2305
|
+
let n = Kn.index === t;
|
|
2236
2306
|
return /* @__PURE__ */ m("div", {
|
|
2237
2307
|
role: "button",
|
|
2238
2308
|
tabIndex: 0,
|
|
@@ -2240,14 +2310,14 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2240
2310
|
"aria-label": `${e.title}, ${$(e.startTime)}${n ? ", current chapter" : ""}`,
|
|
2241
2311
|
"aria-current": n ? "true" : void 0,
|
|
2242
2312
|
onClick: (t) => {
|
|
2243
|
-
t.stopPropagation(),
|
|
2313
|
+
t.stopPropagation(), Xr(e.startTime, e);
|
|
2244
2314
|
},
|
|
2245
|
-
onKeyDown:
|
|
2315
|
+
onKeyDown: _i(() => Xr(e.startTime, e)),
|
|
2246
2316
|
children: [
|
|
2247
2317
|
/* @__PURE__ */ p("div", {
|
|
2248
2318
|
className: "sdk-desktop-chapter-thumb",
|
|
2249
|
-
children:
|
|
2250
|
-
src:
|
|
2319
|
+
children: $n[t] || e.thumbnail ? /* @__PURE__ */ p("img", {
|
|
2320
|
+
src: $n[t] || e.thumbnail,
|
|
2251
2321
|
alt: "",
|
|
2252
2322
|
"aria-hidden": "true",
|
|
2253
2323
|
style: {
|
|
@@ -2256,7 +2326,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2256
2326
|
objectFit: "cover",
|
|
2257
2327
|
display: "block"
|
|
2258
2328
|
}
|
|
2259
|
-
}) : /* @__PURE__ */ p(
|
|
2329
|
+
}) : /* @__PURE__ */ p(_e, {
|
|
2260
2330
|
size: 18,
|
|
2261
2331
|
"aria-hidden": "true",
|
|
2262
2332
|
style: { color: "rgba(255,255,255,0.35)" }
|
|
@@ -2276,7 +2346,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2276
2346
|
})
|
|
2277
2347
|
}),
|
|
2278
2348
|
/* @__PURE__ */ p("div", {
|
|
2279
|
-
ref:
|
|
2349
|
+
ref: E,
|
|
2280
2350
|
role: Z ? void 0 : "slider",
|
|
2281
2351
|
"aria-label": Z ? void 0 : "Seek",
|
|
2282
2352
|
"aria-valuemin": Z ? void 0 : 0,
|
|
@@ -2285,11 +2355,11 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2285
2355
|
"aria-valuetext": Z ? void 0 : `${$(U(X === null ? z : X))} of ${$(H)}`,
|
|
2286
2356
|
tabIndex: Z ? void 0 : 0,
|
|
2287
2357
|
className: `sdk-seekbar-container sdk-desktop-seekbar${Z ? " sdk-ad-mode" : ""}`,
|
|
2288
|
-
onMouseDown: Z ? void 0 :
|
|
2289
|
-
onMouseMove: Z ? void 0 :
|
|
2290
|
-
onMouseLeave: Z ? void 0 :
|
|
2291
|
-
onTouchStart: Z ? void 0 :
|
|
2292
|
-
onKeyDown: Z ? void 0 :
|
|
2358
|
+
onMouseDown: Z ? void 0 : Wr,
|
|
2359
|
+
onMouseMove: Z ? void 0 : ai,
|
|
2360
|
+
onMouseLeave: Z ? void 0 : ci,
|
|
2361
|
+
onTouchStart: Z ? void 0 : si,
|
|
2362
|
+
onKeyDown: Z ? void 0 : vi,
|
|
2293
2363
|
style: { pointerEvents: Z ? "none" : void 0 },
|
|
2294
2364
|
children: Z ? /* @__PURE__ */ p("div", {
|
|
2295
2365
|
className: "sdk-ad-progress-fill",
|
|
@@ -2300,9 +2370,9 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2300
2370
|
}) : /* @__PURE__ */ m(f, { children: [
|
|
2301
2371
|
/* @__PURE__ */ p("div", {
|
|
2302
2372
|
className: "sdk-seekbar-buffered",
|
|
2303
|
-
style: { width: `${
|
|
2373
|
+
style: { width: `${Ut ? (L && L.getBufferedRanges()[0]?.end || 0) / Ut * 100 : 0}%` }
|
|
2304
2374
|
}),
|
|
2305
|
-
H > 0 && B.filter((e) => !
|
|
2375
|
+
H > 0 && B.filter((e) => !fn.has(e.startTime)).map((e, t) => /* @__PURE__ */ p("div", {
|
|
2306
2376
|
className: "sdk-seekbar-adbreak",
|
|
2307
2377
|
style: {
|
|
2308
2378
|
left: `${U(e.startTime) / H * 100}%`,
|
|
@@ -2312,7 +2382,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2312
2382
|
/* @__PURE__ */ p("div", {
|
|
2313
2383
|
className: "sdk-seekbar-progress",
|
|
2314
2384
|
style: {
|
|
2315
|
-
width: Y ? `${
|
|
2385
|
+
width: Y ? `${di > 0 ? ui / di * 100 : 0}%` : `${H ? U(X === null ? z : X) / H * 100 : 0}%`,
|
|
2316
2386
|
background: "#ffffff",
|
|
2317
2387
|
boxShadow: "none"
|
|
2318
2388
|
},
|
|
@@ -2322,14 +2392,14 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2322
2392
|
className: "sdk-seekbar-chapter-marker sdk-desktop-chapter-dot",
|
|
2323
2393
|
style: { left: `${U(e.startTime) / H * 100}%` }
|
|
2324
2394
|
}, t)),
|
|
2325
|
-
|
|
2395
|
+
_r !== null && Cr && /* @__PURE__ */ m("div", {
|
|
2326
2396
|
className: "sdk-thumbnail-tooltip",
|
|
2327
|
-
style: { left: `${
|
|
2397
|
+
style: { left: `${yr}px` },
|
|
2328
2398
|
children: [
|
|
2329
2399
|
/* @__PURE__ */ p("div", {
|
|
2330
2400
|
className: "sdk-thumbnail-preview",
|
|
2331
2401
|
children: /* @__PURE__ */ p("img", {
|
|
2332
|
-
src:
|
|
2402
|
+
src: Cr,
|
|
2333
2403
|
alt: "preview",
|
|
2334
2404
|
style: {
|
|
2335
2405
|
width: "100%",
|
|
@@ -2340,13 +2410,13 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2340
2410
|
}
|
|
2341
2411
|
})
|
|
2342
2412
|
}),
|
|
2343
|
-
|
|
2413
|
+
Tr && /* @__PURE__ */ p("div", {
|
|
2344
2414
|
className: "sdk-thumbnail-chapter-name",
|
|
2345
|
-
children:
|
|
2415
|
+
children: Tr.title
|
|
2346
2416
|
}),
|
|
2347
2417
|
/* @__PURE__ */ p("div", {
|
|
2348
2418
|
className: "sdk-thumbnail-time-label",
|
|
2349
|
-
children: $(U(
|
|
2419
|
+
children: $(U(xr))
|
|
2350
2420
|
})
|
|
2351
2421
|
]
|
|
2352
2422
|
})
|
|
@@ -2358,31 +2428,31 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2358
2428
|
className: "sdk-desktop-left-controls",
|
|
2359
2429
|
children: [!Z && /* @__PURE__ */ p("div", {
|
|
2360
2430
|
className: "sdk-time-display",
|
|
2361
|
-
children: Y ? `${$(
|
|
2362
|
-
}),
|
|
2431
|
+
children: Y ? `${$(ui)} / ${$(di)}` : `${$(U(X === null ? z : X))} / ${$(H)}`
|
|
2432
|
+
}), Je === "slider" && /* @__PURE__ */ m("div", {
|
|
2363
2433
|
className: "sdk-volume-control",
|
|
2364
2434
|
children: [/* @__PURE__ */ p("button", {
|
|
2365
2435
|
className: "sdk-desktop-icon-btn",
|
|
2366
2436
|
onClick: (e) => {
|
|
2367
|
-
e.stopPropagation(),
|
|
2437
|
+
e.stopPropagation(), Gr();
|
|
2368
2438
|
},
|
|
2369
|
-
title:
|
|
2370
|
-
"aria-label":
|
|
2371
|
-
"aria-pressed":
|
|
2372
|
-
children:
|
|
2439
|
+
title: pi ? "Unmute" : "Mute",
|
|
2440
|
+
"aria-label": pi ? "Unmute" : "Mute",
|
|
2441
|
+
"aria-pressed": pi,
|
|
2442
|
+
children: hi()
|
|
2373
2443
|
}), /* @__PURE__ */ p("input", {
|
|
2374
2444
|
type: "range",
|
|
2375
2445
|
className: "sdk-volume-slider",
|
|
2376
2446
|
min: 0,
|
|
2377
2447
|
max: 1,
|
|
2378
2448
|
step: .02,
|
|
2379
|
-
value:
|
|
2449
|
+
value: pi ? 0 : fi,
|
|
2380
2450
|
"aria-label": "Volume",
|
|
2381
|
-
"aria-valuetext":
|
|
2382
|
-
style: { "--vol-pct": Math.round((
|
|
2451
|
+
"aria-valuetext": pi ? "Muted" : `${Math.round(fi * 100)}%`,
|
|
2452
|
+
style: { "--vol-pct": Math.round((pi ? 0 : fi) * 100) },
|
|
2383
2453
|
onChange: (e) => {
|
|
2384
2454
|
let t = parseFloat(e.target.value);
|
|
2385
|
-
Y ? (L?.casting.remoteSetVolume(t), t > 0 && L?.casting.remoteSetMute(!1)) : (L?.setVolume(t), t > 0 &&
|
|
2455
|
+
Y ? (L?.casting.remoteSetVolume(t), t > 0 && L?.casting.remoteSetMute(!1)) : (L?.setVolume(t), t > 0 && qt && L?.setMute(!1));
|
|
2386
2456
|
},
|
|
2387
2457
|
onClick: (e) => e.stopPropagation()
|
|
2388
2458
|
})]
|
|
@@ -2391,24 +2461,24 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2391
2461
|
className: "sdk-desktop-right-icons",
|
|
2392
2462
|
children: [
|
|
2393
2463
|
R.enableKeyMoments && K.length > 0 && !Z && /* @__PURE__ */ p("button", {
|
|
2394
|
-
className: `sdk-desktop-icon-btn${
|
|
2464
|
+
className: `sdk-desktop-icon-btn${Zn ? " active" : ""}`,
|
|
2395
2465
|
onClick: (e) => {
|
|
2396
|
-
e.stopPropagation(),
|
|
2466
|
+
e.stopPropagation(), Qn(!Zn);
|
|
2397
2467
|
},
|
|
2398
2468
|
title: "Key Moments",
|
|
2399
|
-
"aria-label":
|
|
2400
|
-
"aria-pressed":
|
|
2401
|
-
children: /* @__PURE__ */ p(
|
|
2469
|
+
"aria-label": Zn ? "Hide chapters" : "Show chapters",
|
|
2470
|
+
"aria-pressed": Zn,
|
|
2471
|
+
children: /* @__PURE__ */ p(_e, {
|
|
2402
2472
|
size: 20,
|
|
2403
2473
|
"aria-hidden": "true"
|
|
2404
2474
|
})
|
|
2405
2475
|
}),
|
|
2406
|
-
R.enableSubtitles && !Z &&
|
|
2476
|
+
R.enableSubtitles && !Z && Bn.some((e) => !e.isNative) && /* @__PURE__ */ m("div", {
|
|
2407
2477
|
className: "sdk-menu-container",
|
|
2408
2478
|
children: [/* @__PURE__ */ p("button", {
|
|
2409
2479
|
className: `sdk-desktop-icon-btn${G === "off" ? "" : " active"}`,
|
|
2410
2480
|
onClick: (e) => {
|
|
2411
|
-
e.stopPropagation(),
|
|
2481
|
+
e.stopPropagation(), yi("subtitles");
|
|
2412
2482
|
},
|
|
2413
2483
|
title: "Captions",
|
|
2414
2484
|
"aria-label": "Captions",
|
|
@@ -2419,7 +2489,7 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2419
2489
|
"aria-hidden": "true"
|
|
2420
2490
|
})
|
|
2421
2491
|
}), q === "subtitles" && /* @__PURE__ */ m("div", {
|
|
2422
|
-
ref:
|
|
2492
|
+
ref: bi,
|
|
2423
2493
|
className: "sdk-dropup-menu",
|
|
2424
2494
|
role: "listbox",
|
|
2425
2495
|
"aria-label": "Captions",
|
|
@@ -2434,20 +2504,20 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2434
2504
|
"aria-selected": G === "off",
|
|
2435
2505
|
tabIndex: 0,
|
|
2436
2506
|
className: `sdk-dropup-item ${G === "off" ? "active" : ""}`,
|
|
2437
|
-
onClick: () =>
|
|
2438
|
-
onKeyDown:
|
|
2507
|
+
onClick: () => Jr("off"),
|
|
2508
|
+
onKeyDown: gi(() => Jr("off")),
|
|
2439
2509
|
children: [/* @__PURE__ */ p("span", { children: "Off" }), G === "off" && /* @__PURE__ */ p(_, {
|
|
2440
2510
|
size: 12,
|
|
2441
2511
|
"aria-hidden": "true"
|
|
2442
2512
|
})]
|
|
2443
2513
|
}),
|
|
2444
|
-
|
|
2514
|
+
Bn.map((e) => /* @__PURE__ */ m("div", {
|
|
2445
2515
|
role: "option",
|
|
2446
2516
|
"aria-selected": G === e.id,
|
|
2447
2517
|
tabIndex: 0,
|
|
2448
2518
|
className: `sdk-dropup-item ${G === e.id ? "active" : ""}`,
|
|
2449
|
-
onClick: () =>
|
|
2450
|
-
onKeyDown:
|
|
2519
|
+
onClick: () => Jr(e.id),
|
|
2520
|
+
onKeyDown: gi(() => Jr(e.id)),
|
|
2451
2521
|
children: [/* @__PURE__ */ p("span", { children: b(e) }), G === e.id && /* @__PURE__ */ p(_, {
|
|
2452
2522
|
size: 12,
|
|
2453
2523
|
"aria-hidden": "true"
|
|
@@ -2456,23 +2526,23 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2456
2526
|
]
|
|
2457
2527
|
})]
|
|
2458
2528
|
}),
|
|
2459
|
-
R.allowMultipleAudio &&
|
|
2529
|
+
R.allowMultipleAudio && Hn.length > 1 && !Z && /* @__PURE__ */ m("div", {
|
|
2460
2530
|
className: "sdk-menu-container",
|
|
2461
2531
|
children: [/* @__PURE__ */ p("button", {
|
|
2462
2532
|
className: `sdk-desktop-icon-btn${q === "audio" ? " active" : ""}`,
|
|
2463
2533
|
onClick: (e) => {
|
|
2464
|
-
e.stopPropagation(),
|
|
2534
|
+
e.stopPropagation(), yi("audio");
|
|
2465
2535
|
},
|
|
2466
2536
|
title: "Audio Track",
|
|
2467
2537
|
"aria-label": "Audio track",
|
|
2468
2538
|
"aria-haspopup": "listbox",
|
|
2469
2539
|
"aria-expanded": q === "audio",
|
|
2470
|
-
children: /* @__PURE__ */ p(
|
|
2540
|
+
children: /* @__PURE__ */ p(ge, {
|
|
2471
2541
|
size: 20,
|
|
2472
2542
|
"aria-hidden": "true"
|
|
2473
2543
|
})
|
|
2474
2544
|
}), q === "audio" && /* @__PURE__ */ m("div", {
|
|
2475
|
-
ref:
|
|
2545
|
+
ref: bi,
|
|
2476
2546
|
className: "sdk-dropup-menu",
|
|
2477
2547
|
role: "listbox",
|
|
2478
2548
|
"aria-label": "Audio track",
|
|
@@ -2480,18 +2550,18 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2480
2550
|
className: "sdk-dropup-header",
|
|
2481
2551
|
"aria-hidden": "true",
|
|
2482
2552
|
children: "Audio Track"
|
|
2483
|
-
}),
|
|
2553
|
+
}), Hn.map((e) => /* @__PURE__ */ m("div", {
|
|
2484
2554
|
role: "option",
|
|
2485
|
-
"aria-selected":
|
|
2555
|
+
"aria-selected": Wn === e.id,
|
|
2486
2556
|
tabIndex: 0,
|
|
2487
|
-
className: `sdk-dropup-item ${
|
|
2557
|
+
className: `sdk-dropup-item ${Wn === e.id ? "active" : ""}`,
|
|
2488
2558
|
onClick: () => {
|
|
2489
|
-
L?.setAudioTrack(e.id),
|
|
2559
|
+
L?.setAudioTrack(e.id), Gn(e.id), J("none"), nr(`Audio: ${b(e)}`);
|
|
2490
2560
|
},
|
|
2491
|
-
onKeyDown:
|
|
2492
|
-
L?.setAudioTrack(e.id),
|
|
2561
|
+
onKeyDown: gi(() => {
|
|
2562
|
+
L?.setAudioTrack(e.id), Gn(e.id), J("none"), nr(`Audio: ${b(e)}`);
|
|
2493
2563
|
}),
|
|
2494
|
-
children: [/* @__PURE__ */ p("span", { children: b(e) }),
|
|
2564
|
+
children: [/* @__PURE__ */ p("span", { children: b(e) }), Wn === e.id && /* @__PURE__ */ p(_, {
|
|
2495
2565
|
size: 12,
|
|
2496
2566
|
"aria-hidden": "true"
|
|
2497
2567
|
})]
|
|
@@ -2503,18 +2573,18 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2503
2573
|
children: [/* @__PURE__ */ p("button", {
|
|
2504
2574
|
className: `sdk-desktop-icon-btn${q === "speed" ? " active" : ""}`,
|
|
2505
2575
|
onClick: (e) => {
|
|
2506
|
-
e.stopPropagation(),
|
|
2576
|
+
e.stopPropagation(), yi("speed");
|
|
2507
2577
|
},
|
|
2508
2578
|
title: "Playback Speed",
|
|
2509
2579
|
"aria-label": "Playback speed",
|
|
2510
2580
|
"aria-haspopup": "listbox",
|
|
2511
2581
|
"aria-expanded": q === "speed",
|
|
2512
|
-
children: /* @__PURE__ */ p(
|
|
2582
|
+
children: /* @__PURE__ */ p(he, {
|
|
2513
2583
|
size: 20,
|
|
2514
2584
|
"aria-hidden": "true"
|
|
2515
2585
|
})
|
|
2516
2586
|
}), q === "speed" && /* @__PURE__ */ m("div", {
|
|
2517
|
-
ref:
|
|
2587
|
+
ref: bi,
|
|
2518
2588
|
className: "sdk-dropup-menu",
|
|
2519
2589
|
role: "listbox",
|
|
2520
2590
|
"aria-label": "Playback speed",
|
|
@@ -2531,12 +2601,12 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2531
2601
|
2
|
|
2532
2602
|
].map((e) => /* @__PURE__ */ m("div", {
|
|
2533
2603
|
role: "option",
|
|
2534
|
-
"aria-selected":
|
|
2604
|
+
"aria-selected": Yn === e,
|
|
2535
2605
|
tabIndex: 0,
|
|
2536
|
-
className: `sdk-dropup-item ${
|
|
2537
|
-
onClick: () =>
|
|
2538
|
-
onKeyDown:
|
|
2539
|
-
children: [/* @__PURE__ */ p("span", { children: e === 1 ? "Normal" : `${e}x` }),
|
|
2606
|
+
className: `sdk-dropup-item ${Yn === e ? "active" : ""}`,
|
|
2607
|
+
onClick: () => Kr(e),
|
|
2608
|
+
onKeyDown: gi(() => Kr(e)),
|
|
2609
|
+
children: [/* @__PURE__ */ p("span", { children: e === 1 ? "Normal" : `${e}x` }), Yn === e && /* @__PURE__ */ p(_, {
|
|
2540
2610
|
size: 12,
|
|
2541
2611
|
"aria-hidden": "true"
|
|
2542
2612
|
})]
|
|
@@ -2546,20 +2616,20 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2546
2616
|
R.enableQuality && !Z && /* @__PURE__ */ m("div", {
|
|
2547
2617
|
className: "sdk-menu-container",
|
|
2548
2618
|
children: [/* @__PURE__ */ p("button", {
|
|
2549
|
-
className: `sdk-desktop-icon-btn${
|
|
2619
|
+
className: `sdk-desktop-icon-btn${Fn.id === -1 ? "" : " active"}`,
|
|
2550
2620
|
onClick: (e) => {
|
|
2551
|
-
e.stopPropagation(),
|
|
2621
|
+
e.stopPropagation(), yi("quality");
|
|
2552
2622
|
},
|
|
2553
2623
|
title: "Quality",
|
|
2554
2624
|
"aria-label": "Video quality",
|
|
2555
2625
|
"aria-haspopup": "listbox",
|
|
2556
2626
|
"aria-expanded": q === "quality",
|
|
2557
|
-
children: /* @__PURE__ */ p(
|
|
2627
|
+
children: /* @__PURE__ */ p(y, {
|
|
2558
2628
|
size: 20,
|
|
2559
2629
|
"aria-hidden": "true"
|
|
2560
2630
|
})
|
|
2561
2631
|
}), q === "quality" && /* @__PURE__ */ m("div", {
|
|
2562
|
-
ref:
|
|
2632
|
+
ref: bi,
|
|
2563
2633
|
className: "sdk-dropup-menu large",
|
|
2564
2634
|
role: "listbox",
|
|
2565
2635
|
"aria-label": "Video quality",
|
|
@@ -2567,37 +2637,37 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2567
2637
|
className: "sdk-dropup-header",
|
|
2568
2638
|
"aria-hidden": "true",
|
|
2569
2639
|
children: "Quality"
|
|
2570
|
-
}),
|
|
2640
|
+
}), Nn.map((e) => /* @__PURE__ */ m("div", {
|
|
2571
2641
|
role: "option",
|
|
2572
|
-
"aria-selected":
|
|
2642
|
+
"aria-selected": Fn.id === e.id,
|
|
2573
2643
|
tabIndex: 0,
|
|
2574
|
-
className: `sdk-dropup-item ${
|
|
2575
|
-
onClick: () =>
|
|
2576
|
-
onKeyDown:
|
|
2577
|
-
children: [/* @__PURE__ */ p("span", { children: e.label }),
|
|
2644
|
+
className: `sdk-dropup-item ${Fn.id === e.id ? "active" : ""}`,
|
|
2645
|
+
onClick: () => qr(e.id),
|
|
2646
|
+
onKeyDown: gi(() => qr(e.id)),
|
|
2647
|
+
children: [/* @__PURE__ */ p("span", { children: e.label }), Fn.id === e.id && /* @__PURE__ */ p(_, {
|
|
2578
2648
|
size: 12,
|
|
2579
2649
|
"aria-hidden": "true"
|
|
2580
2650
|
})]
|
|
2581
2651
|
}, e.id))]
|
|
2582
2652
|
})]
|
|
2583
2653
|
}),
|
|
2584
|
-
|
|
2654
|
+
S && S.length > 1 && !Z && /* @__PURE__ */ m("div", {
|
|
2585
2655
|
className: "sdk-menu-container",
|
|
2586
2656
|
children: [/* @__PURE__ */ p("button", {
|
|
2587
2657
|
className: `sdk-desktop-icon-btn${q === "sources" ? " active" : ""}`,
|
|
2588
2658
|
onClick: (e) => {
|
|
2589
|
-
e.stopPropagation(),
|
|
2659
|
+
e.stopPropagation(), yi("sources");
|
|
2590
2660
|
},
|
|
2591
2661
|
title: "Select Source",
|
|
2592
2662
|
"aria-label": "Select source",
|
|
2593
2663
|
"aria-haspopup": "listbox",
|
|
2594
2664
|
"aria-expanded": q === "sources",
|
|
2595
|
-
children: /* @__PURE__ */ p(
|
|
2665
|
+
children: /* @__PURE__ */ p(Me, {
|
|
2596
2666
|
size: 20,
|
|
2597
2667
|
"aria-hidden": "true"
|
|
2598
2668
|
})
|
|
2599
2669
|
}), q === "sources" && /* @__PURE__ */ m("div", {
|
|
2600
|
-
ref:
|
|
2670
|
+
ref: bi,
|
|
2601
2671
|
className: "sdk-dropup-menu",
|
|
2602
2672
|
role: "listbox",
|
|
2603
2673
|
"aria-label": "Select source",
|
|
@@ -2605,14 +2675,14 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2605
2675
|
className: "sdk-dropup-header",
|
|
2606
2676
|
"aria-hidden": "true",
|
|
2607
2677
|
children: "Source"
|
|
2608
|
-
}),
|
|
2678
|
+
}), S.map((e, t) => /* @__PURE__ */ m("div", {
|
|
2609
2679
|
role: "option",
|
|
2610
|
-
"aria-selected":
|
|
2680
|
+
"aria-selected": C === t,
|
|
2611
2681
|
tabIndex: 0,
|
|
2612
|
-
className: `sdk-dropup-item ${
|
|
2613
|
-
onClick: () =>
|
|
2614
|
-
onKeyDown:
|
|
2615
|
-
children: [/* @__PURE__ */ p("span", { children: e.label }),
|
|
2682
|
+
className: `sdk-dropup-item ${C === t ? "active" : ""}`,
|
|
2683
|
+
onClick: () => Yr(t),
|
|
2684
|
+
onKeyDown: gi(() => Yr(t)),
|
|
2685
|
+
children: [/* @__PURE__ */ p("span", { children: e.label }), C === t && /* @__PURE__ */ p(_, {
|
|
2616
2686
|
size: 12,
|
|
2617
2687
|
"aria-hidden": "true"
|
|
2618
2688
|
})]
|
|
@@ -2620,37 +2690,37 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2620
2690
|
})]
|
|
2621
2691
|
}),
|
|
2622
2692
|
R.enablePiP && !Z && /* @__PURE__ */ p("button", {
|
|
2623
|
-
className: `sdk-desktop-icon-btn${
|
|
2693
|
+
className: `sdk-desktop-icon-btn${an ? " active" : ""}`,
|
|
2624
2694
|
onClick: (e) => {
|
|
2625
|
-
e.stopPropagation(),
|
|
2695
|
+
e.stopPropagation(), Zr();
|
|
2626
2696
|
},
|
|
2627
2697
|
title: "Picture-in-Picture",
|
|
2628
|
-
"aria-label":
|
|
2629
|
-
"aria-pressed":
|
|
2630
|
-
children: /* @__PURE__ */ p(
|
|
2698
|
+
"aria-label": an ? "Exit picture-in-picture" : "Enter picture-in-picture",
|
|
2699
|
+
"aria-pressed": an,
|
|
2700
|
+
children: /* @__PURE__ */ p(be, {
|
|
2631
2701
|
size: 20,
|
|
2632
2702
|
"aria-hidden": "true"
|
|
2633
2703
|
})
|
|
2634
2704
|
}),
|
|
2635
|
-
|
|
2705
|
+
Je === "button" && /* @__PURE__ */ p("button", {
|
|
2636
2706
|
className: "sdk-desktop-icon-btn",
|
|
2637
2707
|
onClick: (e) => {
|
|
2638
|
-
e.stopPropagation(),
|
|
2708
|
+
e.stopPropagation(), Gr();
|
|
2639
2709
|
},
|
|
2640
|
-
title:
|
|
2641
|
-
"aria-label":
|
|
2642
|
-
"aria-pressed":
|
|
2643
|
-
children:
|
|
2710
|
+
title: pi ? "Unmute" : "Mute",
|
|
2711
|
+
"aria-label": pi ? "Unmute" : "Mute",
|
|
2712
|
+
"aria-pressed": pi,
|
|
2713
|
+
children: hi()
|
|
2644
2714
|
}),
|
|
2645
|
-
|
|
2715
|
+
Ve && /* @__PURE__ */ p("button", {
|
|
2646
2716
|
className: "sdk-desktop-icon-btn",
|
|
2647
2717
|
onClick: (e) => {
|
|
2648
|
-
e.stopPropagation(),
|
|
2718
|
+
e.stopPropagation(), Qr();
|
|
2649
2719
|
},
|
|
2650
|
-
title:
|
|
2651
|
-
"aria-label":
|
|
2652
|
-
"aria-pressed":
|
|
2653
|
-
children: p(
|
|
2720
|
+
title: Zt || $t ? "Exit fullscreen" : "Fullscreen",
|
|
2721
|
+
"aria-label": Zt || $t ? "Exit fullscreen" : "Enter fullscreen",
|
|
2722
|
+
"aria-pressed": Zt || $t,
|
|
2723
|
+
children: p(Zt ? ye : ve, {
|
|
2654
2724
|
size: 20,
|
|
2655
2725
|
"aria-hidden": "true"
|
|
2656
2726
|
})
|
|
@@ -2664,85 +2734,75 @@ var ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
|
|
|
2664
2734
|
})
|
|
2665
2735
|
]
|
|
2666
2736
|
});
|
|
2667
|
-
},
|
|
2668
|
-
function
|
|
2737
|
+
}, ze = "https://dev-api.go-boss.com";
|
|
2738
|
+
function Be(e) {
|
|
2669
2739
|
return {
|
|
2670
2740
|
"x-player-key": e,
|
|
2671
2741
|
"Content-Type": "application/json"
|
|
2672
2742
|
};
|
|
2673
2743
|
}
|
|
2674
|
-
async function
|
|
2744
|
+
async function Ve(e, t = ze) {
|
|
2675
2745
|
let n = await fetch(`${t}/api/player/sdk/init`, {
|
|
2676
2746
|
method: "POST",
|
|
2677
|
-
headers:
|
|
2747
|
+
headers: Be(e),
|
|
2678
2748
|
body: JSON.stringify({})
|
|
2679
2749
|
});
|
|
2680
2750
|
if (!n.ok) throw Error(`SDK init failed: ${n.status}`);
|
|
2681
|
-
|
|
2682
|
-
return console.log("[SDK] Init response:", r), r;
|
|
2751
|
+
return await n.json();
|
|
2683
2752
|
}
|
|
2684
|
-
async function
|
|
2753
|
+
async function He(e, t, n, r = ze) {
|
|
2685
2754
|
let i = await fetch(`${r}/api/player/sdk/session/start`, {
|
|
2686
2755
|
method: "POST",
|
|
2687
|
-
headers:
|
|
2756
|
+
headers: Be(e),
|
|
2688
2757
|
body: JSON.stringify({
|
|
2689
2758
|
sessionId: t,
|
|
2690
2759
|
videoId: n
|
|
2691
2760
|
})
|
|
2692
2761
|
});
|
|
2693
2762
|
if (!i.ok) throw Error(`Session start failed: ${i.status}`);
|
|
2694
|
-
let a = await i.json().catch(() => null);
|
|
2695
|
-
console.log("[SDK] Session start response:", a);
|
|
2696
2763
|
}
|
|
2697
|
-
async function
|
|
2764
|
+
async function Ue(e, t, n, r, i = ze) {
|
|
2698
2765
|
let a = {
|
|
2699
2766
|
sessionId: t,
|
|
2700
2767
|
currentTime: n,
|
|
2701
2768
|
duration: r
|
|
2702
|
-
}
|
|
2703
|
-
console.log("[SDK] Heartbeat request:", a);
|
|
2704
|
-
let o = await fetch(`${i}/api/player/sdk/session/heartbeat`, {
|
|
2769
|
+
}, o = await fetch(`${i}/api/player/sdk/session/heartbeat`, {
|
|
2705
2770
|
method: "POST",
|
|
2706
|
-
headers:
|
|
2771
|
+
headers: Be(e),
|
|
2707
2772
|
body: JSON.stringify(a)
|
|
2708
2773
|
});
|
|
2709
2774
|
if (!o.ok) throw Error(`Heartbeat failed: ${o.status}`);
|
|
2710
|
-
let s = await o.json().catch(() => null);
|
|
2711
|
-
console.log("[SDK] Heartbeat response:", s);
|
|
2712
2775
|
}
|
|
2713
|
-
async function
|
|
2776
|
+
async function We(e, t, n = ze) {
|
|
2714
2777
|
let r = await fetch(`${n}/api/player/sdk/session/end`, {
|
|
2715
2778
|
method: "POST",
|
|
2716
|
-
headers:
|
|
2779
|
+
headers: Be(e),
|
|
2717
2780
|
body: JSON.stringify({ sessionId: t })
|
|
2718
2781
|
});
|
|
2719
2782
|
if (!r.ok) throw Error(`Session end failed: ${r.status}`);
|
|
2720
|
-
let i = await r.json().catch(() => null);
|
|
2721
|
-
console.log("[SDK] Session end response:", i);
|
|
2722
2783
|
}
|
|
2723
|
-
async function
|
|
2724
|
-
console.log("[SDK] Event request:", t);
|
|
2784
|
+
async function Ge(e, t, n = ze) {
|
|
2725
2785
|
let r = await fetch(`${n}/api/player/sdk/events`, {
|
|
2726
2786
|
method: "POST",
|
|
2727
|
-
headers:
|
|
2787
|
+
headers: Be(e),
|
|
2728
2788
|
body: JSON.stringify(t)
|
|
2729
2789
|
});
|
|
2730
2790
|
if (!r.ok) throw Error(`Event ${t.eventType} failed: ${r.status}`);
|
|
2731
2791
|
}
|
|
2732
|
-
function
|
|
2792
|
+
function Ke(e, t, n = ze) {
|
|
2733
2793
|
fetch(`${n}/api/player/sdk/session/end`, {
|
|
2734
2794
|
method: "POST",
|
|
2735
|
-
headers:
|
|
2795
|
+
headers: Be(e),
|
|
2736
2796
|
body: JSON.stringify({ sessionId: t }),
|
|
2737
2797
|
keepalive: !0
|
|
2738
2798
|
});
|
|
2739
2799
|
}
|
|
2740
2800
|
//#endregion
|
|
2741
2801
|
//#region src/delegate.ts
|
|
2742
|
-
function
|
|
2802
|
+
function x() {
|
|
2743
2803
|
if (!(typeof screen > "u")) return screen.orientation?.type ?? void 0;
|
|
2744
2804
|
}
|
|
2745
|
-
var
|
|
2805
|
+
var qe = class {
|
|
2746
2806
|
constructor() {
|
|
2747
2807
|
this.autoplay = !1, this.keyMoments = [], this.isPlaybackActive = !1, this.hasFinished = !1, this.hasDismissed = !1, this.lastCurrentTime = 0, this.lastDuration = 0, this.lastWatchDuration = 0, this.prevSpeed = 1, this.pendingSeek = null;
|
|
2748
2808
|
}
|
|
@@ -2756,7 +2816,7 @@ var We = class {
|
|
|
2756
2816
|
this.keyMoments = e;
|
|
2757
2817
|
}
|
|
2758
2818
|
handleAnalyticsEvent(e) {
|
|
2759
|
-
switch (typeof e.currentTime == "number" && !Number.isNaN(e.currentTime) && (this.lastCurrentTime = e.currentTime), e.duration && (this.lastDuration = e.duration), typeof e.totalWatchTime == "number" && (this.lastWatchDuration = e.totalWatchTime), e.eventType) {
|
|
2819
|
+
switch (typeof e.currentTime == "number" && !Number.isNaN(e.currentTime) && (this.lastCurrentTime = e.currentTime), typeof e.duration == "number" && !Number.isNaN(e.duration) && (this.lastDuration = e.duration), typeof e.totalWatchTime == "number" && (this.lastWatchDuration = e.totalWatchTime), e.eventType) {
|
|
2760
2820
|
case "play":
|
|
2761
2821
|
this.isPlaybackActive ? this.call("playerDidResumePlaying", e.currentTime) : (this.isPlaybackActive = !0, this.hasFinished = !1, this.call("playerDidStartPlaying", e.currentTime, this.autoplay));
|
|
2762
2822
|
break;
|
|
@@ -2804,10 +2864,10 @@ var We = class {
|
|
|
2804
2864
|
break;
|
|
2805
2865
|
}
|
|
2806
2866
|
case "fullscreen_enter":
|
|
2807
|
-
this.call("playerDidEnterFullscreen",
|
|
2867
|
+
this.call("playerDidEnterFullscreen", x());
|
|
2808
2868
|
break;
|
|
2809
2869
|
case "fullscreen_exit":
|
|
2810
|
-
this.call("playerDidExitFullscreen",
|
|
2870
|
+
this.call("playerDidExitFullscreen", x());
|
|
2811
2871
|
break;
|
|
2812
2872
|
case "key_moments": {
|
|
2813
2873
|
let t = e.momentTitle ?? "", n = e.momentTime ?? e.currentTime, r = this.keyMoments, i = r.findIndex((e) => t && e.title === t || e.startTime === n), a = i >= 0 ? r[i] : void 0;
|
|
@@ -2854,7 +2914,7 @@ var We = class {
|
|
|
2854
2914
|
console.error(`[PlayerSDK Delegate] ${String(e)} callback failed:`, t);
|
|
2855
2915
|
}
|
|
2856
2916
|
}
|
|
2857
|
-
},
|
|
2917
|
+
}, Je = {
|
|
2858
2918
|
subtitles: "subtitle_support",
|
|
2859
2919
|
ads: "ad_support",
|
|
2860
2920
|
chapterMarkers: "key_moments",
|
|
@@ -2868,7 +2928,7 @@ var We = class {
|
|
|
2868
2928
|
screenRecordingPrevention: "screen_recording_prevention",
|
|
2869
2929
|
signalStrength: "signal_strength"
|
|
2870
2930
|
};
|
|
2871
|
-
function
|
|
2931
|
+
function Ye(e) {
|
|
2872
2932
|
let t = {
|
|
2873
2933
|
m3u8_playback: !0,
|
|
2874
2934
|
subtitle_support: !1,
|
|
@@ -2884,10 +2944,10 @@ function Ke(e) {
|
|
|
2884
2944
|
signal_strength: !1,
|
|
2885
2945
|
ad_support: !1
|
|
2886
2946
|
};
|
|
2887
|
-
for (let [n, r] of Object.entries(
|
|
2947
|
+
for (let [n, r] of Object.entries(Je)) n in e && (t[r] = e[n]);
|
|
2888
2948
|
return t;
|
|
2889
2949
|
}
|
|
2890
|
-
function
|
|
2950
|
+
function Xe(e) {
|
|
2891
2951
|
if (!e) return (e) => e;
|
|
2892
2952
|
let t = [];
|
|
2893
2953
|
for (let n of e.split(",")) {
|
|
@@ -2907,8 +2967,12 @@ function qe(e) {
|
|
|
2907
2967
|
return e;
|
|
2908
2968
|
};
|
|
2909
2969
|
}
|
|
2910
|
-
|
|
2911
|
-
|
|
2970
|
+
function Ze(e) {
|
|
2971
|
+
let t = e.replace("#", "");
|
|
2972
|
+
return t.length === 6 ? `${parseInt(t.substring(0, 2), 16)}, ${parseInt(t.substring(2, 4), 16)}, ${parseInt(t.substring(4, 6), 16)}` : "99, 102, 241";
|
|
2973
|
+
}
|
|
2974
|
+
var Qe = 3e4;
|
|
2975
|
+
function $e(e, t) {
|
|
2912
2976
|
switch (e.eventType) {
|
|
2913
2977
|
case "pause": return {
|
|
2914
2978
|
eventType: "pause",
|
|
@@ -3002,8 +3066,8 @@ function Ye(e, t) {
|
|
|
3002
3066
|
default: return null;
|
|
3003
3067
|
}
|
|
3004
3068
|
}
|
|
3005
|
-
function
|
|
3006
|
-
let [ge, _e] = d([]), [ve, ye] = d(0), [v] = d(() => new
|
|
3069
|
+
function et({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i = "#6366f1", firebaseConfig: a, proxyDomains: s, apiBaseUrl: l, adTrackingUrl: f, overlayAdUrl: ee, title: ne, watermark: re, autoplay: h = !1, muted: ie = !1, autoFullscreen: ae = !1, enableControls: oe = !0, enableSkipAd: se, skipAdAfterSeconds: ce, chaptersDisplayMode: le = "strip", volumeControlType: g = "slider", subtitleStyle: ue, drmConfig: de, onAnalyticsEvent: fe, delegate: _, onKeyMomentsLoaded: pe, initialTime: me, onTimeUpdate: he }) {
|
|
3070
|
+
let [ge, _e] = d([]), [ve, ye] = d(0), [v] = d(() => new qe());
|
|
3007
3071
|
c(() => {
|
|
3008
3072
|
v.setDelegate(_), v.setAutoplay(h);
|
|
3009
3073
|
}, [
|
|
@@ -3014,23 +3078,21 @@ function Xe({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i =
|
|
|
3014
3078
|
let be = Array.isArray(t) ? t : [{
|
|
3015
3079
|
label: "Default",
|
|
3016
3080
|
url: t
|
|
3017
|
-
}], xe = be[ve]?.url ?? be[0]?.url ?? "", [Se, Ce] = d("loading"), [we, Te] = d(null), [Ee, De] = d(0), [Oe, ke] = d("network"), Ae = u(null), je = u(!1), y = u(""), Me = u(!1), Ne = u(!1), Pe = u(void 0),
|
|
3081
|
+
}], xe = be[ve]?.url ?? be[0]?.url ?? "", [Se, Ce] = d("loading"), [we, Te] = d(null), [Ee, De] = d(0), [Oe, ke] = d("network"), Ae = u(null), je = u(!1), y = u(""), Me = u(!1), Ne = u(!1), Pe = u(void 0), Fe = u(!1), b = u(null), Ie = u(0), Le = u(null), ze = u({
|
|
3018
3082
|
currentTime: 0,
|
|
3019
3083
|
duration: 0
|
|
3020
|
-
}),
|
|
3084
|
+
}), Be = u(() => {}), x = xe.split("/").filter(Boolean), Je = (x[x.length - 1] ?? "").replace(/\.m3u8.*$/, "") || "video", et = o(() => Xe(s), [s])(), S = Ze(i);
|
|
3021
3085
|
c(() => {
|
|
3022
|
-
document.documentElement.style.setProperty("--accent-indigo", i);
|
|
3023
|
-
|
|
3024
|
-
e.length === 6 && (t = `${parseInt(e.substring(0, 2), 16)}, ${parseInt(e.substring(2, 4), 16)}, ${parseInt(e.substring(4, 6), 16)}`), document.documentElement.style.setProperty("--accent-indigo-rgb", t);
|
|
3025
|
-
}, [i]), c(() => {
|
|
3086
|
+
document.documentElement.style.setProperty("--accent-indigo", i), document.documentElement.style.setProperty("--accent-indigo-rgb", S);
|
|
3087
|
+
}, [i, S]), c(() => {
|
|
3026
3088
|
let t = !1;
|
|
3027
|
-
return
|
|
3089
|
+
return Ve(e, l).then((e) => {
|
|
3028
3090
|
if (t) return;
|
|
3029
3091
|
Ae.current = e;
|
|
3030
3092
|
let { features: n, planTier: r } = e.result.data, i = {
|
|
3031
3093
|
package: r,
|
|
3032
3094
|
is_active: !0,
|
|
3033
|
-
features:
|
|
3095
|
+
features: Ye(n),
|
|
3034
3096
|
limits: { streaming_minutes: 0 }
|
|
3035
3097
|
};
|
|
3036
3098
|
console.log("[SDK] Player key validated. Features:", i.features), Te(i), Ce("ready");
|
|
@@ -3040,62 +3102,62 @@ function Xe({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i =
|
|
|
3040
3102
|
let n = e.message ?? "";
|
|
3041
3103
|
ke(/init failed: 4\d\d/.test(n) ? "auth" : "network"), Ce("error");
|
|
3042
3104
|
}), () => {
|
|
3043
|
-
t = !0,
|
|
3105
|
+
t = !0, b.current &&= (clearTimeout(b.current), null), Ie.current = 0, Le.current = null, Ce("loading"), Te(null), Me.current = !1, y.current = "", Ne.current = !1, Pe.current = void 0;
|
|
3044
3106
|
};
|
|
3045
3107
|
}, [
|
|
3046
3108
|
e,
|
|
3047
3109
|
l,
|
|
3048
3110
|
Ee
|
|
3049
3111
|
]);
|
|
3050
|
-
let
|
|
3051
|
-
|
|
3052
|
-
}, []),
|
|
3053
|
-
|
|
3054
|
-
}, []),
|
|
3055
|
-
if (
|
|
3056
|
-
|
|
3057
|
-
let t =
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
let { currentTime: t, duration: n } =
|
|
3061
|
-
console.log("[SDK] Heartbeat timer fired — 30s of real content elapsed"),
|
|
3112
|
+
let C = o(() => {
|
|
3113
|
+
b.current && (clearTimeout(b.current), b.current = null, Le.current !== null && (Ie.current += Date.now() - Le.current, Le.current = null));
|
|
3114
|
+
}, []), tt = o(() => {
|
|
3115
|
+
b.current &&= (clearTimeout(b.current), null), Ie.current = 0, Le.current = null;
|
|
3116
|
+
}, []), w = o(() => {
|
|
3117
|
+
if (b.current || !y.current) return;
|
|
3118
|
+
Le.current = Date.now();
|
|
3119
|
+
let t = Qe - Ie.current;
|
|
3120
|
+
b.current = setTimeout(() => {
|
|
3121
|
+
b.current = null, Ie.current = 0, Le.current = null;
|
|
3122
|
+
let { currentTime: t, duration: n } = ze.current;
|
|
3123
|
+
console.log("[SDK] Heartbeat timer fired — 30s of real content elapsed"), Ue(e, y.current, t, n, l).catch((e) => console.warn("[SDK] Heartbeat failed:", e.message)), Be.current();
|
|
3062
3124
|
}, t);
|
|
3063
3125
|
}, [e, l]);
|
|
3064
3126
|
c(() => {
|
|
3065
|
-
|
|
3066
|
-
}, [
|
|
3067
|
-
let
|
|
3127
|
+
Be.current = w;
|
|
3128
|
+
}, [w]);
|
|
3129
|
+
let nt = u(!0);
|
|
3068
3130
|
c(() => {
|
|
3069
|
-
if (
|
|
3070
|
-
|
|
3131
|
+
if (nt.current) {
|
|
3132
|
+
nt.current = !1;
|
|
3071
3133
|
return;
|
|
3072
3134
|
}
|
|
3073
|
-
|
|
3074
|
-
}, [ve,
|
|
3135
|
+
Fe.current = !0, Pe.current = void 0, C();
|
|
3136
|
+
}, [ve, C]), c(() => {
|
|
3075
3137
|
let t = () => {
|
|
3076
|
-
v.notifyDismissed(), y.current && (Ne.current = !0,
|
|
3138
|
+
v.notifyDismissed(), y.current && (Ne.current = !0, tt(), Ke(e, y.current, l));
|
|
3077
3139
|
};
|
|
3078
3140
|
return window.addEventListener("beforeunload", t), () => {
|
|
3079
|
-
window.removeEventListener("beforeunload", t),
|
|
3141
|
+
window.removeEventListener("beforeunload", t), tt();
|
|
3080
3142
|
};
|
|
3081
3143
|
}, [
|
|
3082
3144
|
e,
|
|
3083
3145
|
l,
|
|
3084
|
-
|
|
3146
|
+
tt,
|
|
3085
3147
|
v
|
|
3086
3148
|
]);
|
|
3087
|
-
let
|
|
3149
|
+
let rt = o((t) => {
|
|
3088
3150
|
let n = t;
|
|
3089
|
-
if (t.currentTime !== void 0 && (
|
|
3151
|
+
if (t.currentTime !== void 0 && (ze.current = {
|
|
3090
3152
|
currentTime: t.currentTime,
|
|
3091
3153
|
duration: t.duration
|
|
3092
|
-
}), t.eventType === "session_start" && !Me.current && (Me.current = !0, Ne.current = !1, y.current = typeof n.sessionId == "string" ? n.sessionId : "",
|
|
3093
|
-
let n =
|
|
3094
|
-
n &&
|
|
3154
|
+
}), t.eventType === "session_start" && !Me.current && (Me.current = !0, Ne.current = !1, y.current = typeof n.sessionId == "string" ? n.sessionId : "", He(e, y.current, Je, l).catch((e) => console.warn("[SDK] Session start failed:", e.message)), je.current || w()), t.eventType === "play" && Me.current && !je.current && !Fe.current && w(), t.eventType === "pause" && C(), t.eventType === "buffering_start" && C(), t.eventType === "buffering_end" && Me.current && !je.current && (Fe.current = !1, w()), t.eventType === "ended" && (tt(), y.current && (Ne.current = !0, We(e, y.current, l).catch((e) => console.warn("[SDK] Session end failed:", e.message)))), Me.current && y.current && !Ne.current) {
|
|
3155
|
+
let n = $e(t, Pe.current);
|
|
3156
|
+
n && Ge(e, {
|
|
3095
3157
|
eventType: n.eventType,
|
|
3096
3158
|
sessionId: y.current,
|
|
3097
3159
|
currentTime: t.currentTime ?? 0,
|
|
3098
|
-
videoId:
|
|
3160
|
+
videoId: Je,
|
|
3099
3161
|
...n.extras
|
|
3100
3162
|
}, l).catch((e) => console.warn(`[SDK] Event ${n.eventType} failed:`, e.message));
|
|
3101
3163
|
}
|
|
@@ -3103,17 +3165,17 @@ function Xe({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i =
|
|
|
3103
3165
|
}, [
|
|
3104
3166
|
e,
|
|
3105
3167
|
l,
|
|
3106
|
-
|
|
3107
|
-
T,
|
|
3168
|
+
Je,
|
|
3108
3169
|
w,
|
|
3109
|
-
|
|
3170
|
+
C,
|
|
3171
|
+
tt,
|
|
3110
3172
|
fe,
|
|
3111
3173
|
v
|
|
3112
|
-
]),
|
|
3113
|
-
je.current = e, e ? (
|
|
3114
|
-
}, [
|
|
3174
|
+
]), T = o((e) => {
|
|
3175
|
+
je.current = e, e ? (C(), console.log("[SDK] Ad break started — heartbeat timer paused")) : (Me.current && w(), console.log("[SDK] Ad break ended — heartbeat timer resumed"));
|
|
3176
|
+
}, [C, w]), it = o((e) => {
|
|
3115
3177
|
v.setKeyMoments(e), _e(e), pe?.(e);
|
|
3116
|
-
}, [pe, v]),
|
|
3178
|
+
}, [pe, v]), at = o((e) => {
|
|
3117
3179
|
v.handleTimeUpdate(e), he?.(e);
|
|
3118
3180
|
}, [he, v]);
|
|
3119
3181
|
if (Se === "loading") return /* @__PURE__ */ m("div", {
|
|
@@ -3127,12 +3189,14 @@ function Xe({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i =
|
|
|
3127
3189
|
justifyContent: "center"
|
|
3128
3190
|
},
|
|
3129
3191
|
children: [/* @__PURE__ */ p("style", { children: "@keyframes boss-sdk-spin{to{transform:rotate(360deg)}}" }), /* @__PURE__ */ p("div", { style: {
|
|
3130
|
-
width:
|
|
3131
|
-
height:
|
|
3192
|
+
width: 60,
|
|
3193
|
+
height: 60,
|
|
3132
3194
|
borderRadius: "50%",
|
|
3133
|
-
border:
|
|
3134
|
-
|
|
3135
|
-
|
|
3195
|
+
border: `4px solid rgba(${S}, 0.1)`,
|
|
3196
|
+
borderLeftColor: i,
|
|
3197
|
+
borderRightColor: `rgba(${S}, 0.2)`,
|
|
3198
|
+
filter: `drop-shadow(0 0 10px rgba(${S}, 0.5))`,
|
|
3199
|
+
animation: "boss-sdk-spin 1s linear infinite"
|
|
3136
3200
|
} })]
|
|
3137
3201
|
});
|
|
3138
3202
|
if (Se === "error") {
|
|
@@ -3156,7 +3220,7 @@ function Xe({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i =
|
|
|
3156
3220
|
})
|
|
3157
3221
|
});
|
|
3158
3222
|
}
|
|
3159
|
-
return /* @__PURE__ */ p(
|
|
3223
|
+
return /* @__PURE__ */ p(Re, {
|
|
3160
3224
|
src: xe,
|
|
3161
3225
|
sources: be,
|
|
3162
3226
|
activeSourceIndex: ve,
|
|
@@ -3181,24 +3245,24 @@ function Xe({ playerKey: e, src: t, subtitles: n, licenseKey: r, themeColor: i =
|
|
|
3181
3245
|
drmConfig: de,
|
|
3182
3246
|
overlayAdUrl: ee,
|
|
3183
3247
|
adTrackingUrl: f,
|
|
3184
|
-
urlTransformer:
|
|
3185
|
-
onAnalyticsEvent:
|
|
3186
|
-
onAdBreakChange:
|
|
3187
|
-
onKeyMomentsLoaded:
|
|
3248
|
+
urlTransformer: et,
|
|
3249
|
+
onAnalyticsEvent: rt,
|
|
3250
|
+
onAdBreakChange: T,
|
|
3251
|
+
onKeyMomentsLoaded: it,
|
|
3188
3252
|
initialTime: me,
|
|
3189
|
-
onTimeUpdate:
|
|
3253
|
+
onTimeUpdate: at
|
|
3190
3254
|
});
|
|
3191
3255
|
}
|
|
3192
3256
|
//#endregion
|
|
3193
3257
|
//#region src/create-player.ts
|
|
3194
|
-
function
|
|
3258
|
+
function S(e, t) {
|
|
3195
3259
|
let n = ee(e), r = t;
|
|
3196
|
-
return n.render(i(
|
|
3260
|
+
return n.render(i(et, r)), {
|
|
3197
3261
|
update(e) {
|
|
3198
3262
|
r = {
|
|
3199
3263
|
...r,
|
|
3200
3264
|
...e
|
|
3201
|
-
}, n.render(i(
|
|
3265
|
+
}, n.render(i(et, r));
|
|
3202
3266
|
},
|
|
3203
3267
|
destroy() {
|
|
3204
3268
|
n.unmount();
|
|
@@ -3206,6 +3270,6 @@ function Ze(e, t) {
|
|
|
3206
3270
|
};
|
|
3207
3271
|
}
|
|
3208
3272
|
//#endregion
|
|
3209
|
-
export {
|
|
3273
|
+
export { et as BossVideoPlayer, e as FirebaseAnalyticsProvider, t as VideoPlayerSDK, Re as WebVideoPlayer, S as createPlayer, We as endSession, Ve as initSdk, Ge as sendEvent, Ue as sendHeartbeat, He as startSession };
|
|
3210
3274
|
|
|
3211
3275
|
//# sourceMappingURL=index.js.map
|