@glitchlab/react-video-player 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,24 +1,24 @@
1
1
  "use client";
2
- import { jsxs as v, jsx as t } from "react/jsx-runtime";
3
- import pe, { useState as k, useRef as V, useCallback as S, useEffect as x, useImperativeHandle as me, useMemo as U } from "react";
2
+ import { jsxs as g, jsx as t } from "react/jsx-runtime";
3
+ import we, { useState as k, useRef as H, useCallback as M, useEffect as P, useImperativeHandle as Le, useMemo as K } from "react";
4
4
  import $ from "hls.js";
5
- function Q(e) {
5
+ function ae(e) {
6
6
  var n, s, r = "";
7
7
  if (typeof e == "string" || typeof e == "number") r += e;
8
8
  else if (typeof e == "object") if (Array.isArray(e)) {
9
- var i = e.length;
10
- for (n = 0; n < i; n++) e[n] && (s = Q(e[n])) && (r && (r += " "), r += s);
9
+ var l = e.length;
10
+ for (n = 0; n < l; n++) e[n] && (s = ae(e[n])) && (r && (r += " "), r += s);
11
11
  } else for (s in e) e[s] && (r && (r += " "), r += s);
12
12
  return r;
13
13
  }
14
- function H() {
15
- for (var e, n, s = 0, r = "", i = arguments.length; s < i; s++) (e = arguments[s]) && (n = Q(e)) && (r && (r += " "), r += n);
14
+ function I() {
15
+ for (var e, n, s = 0, r = "", l = arguments.length; s < l; s++) (e = arguments[s]) && (n = ae(e)) && (r && (r += " "), r += n);
16
16
  return r;
17
17
  }
18
- const K = "gvp-icon", L = (e) => e ? `${K} ${e}` : K, fe = ({ className: e }) => /* @__PURE__ */ v(
18
+ const ne = "gvp-icon", x = (e) => e ? `${ne} ${e}` : ne, ye = ({ className: e }) => /* @__PURE__ */ g(
19
19
  "svg",
20
20
  {
21
- className: L(e),
21
+ className: x(e),
22
22
  width: "20",
23
23
  height: "20",
24
24
  viewBox: "0 0 24 24",
@@ -57,10 +57,10 @@ const K = "gvp-icon", L = (e) => e ? `${K} ${e}` : K, fe = ({ className: e }) =>
57
57
  /* @__PURE__ */ t("path", { d: "M7 22H17", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
58
58
  ]
59
59
  }
60
- ), ge = ({ className: e }) => /* @__PURE__ */ v(
60
+ ), Ee = ({ className: e }) => /* @__PURE__ */ g(
61
61
  "svg",
62
62
  {
63
- className: L(e),
63
+ className: x(e),
64
64
  width: "20",
65
65
  height: "20",
66
66
  viewBox: "0 0 24 24",
@@ -98,10 +98,10 @@ const K = "gvp-icon", L = (e) => e ? `${K} ${e}` : K, fe = ({ className: e }) =>
98
98
  )
99
99
  ]
100
100
  }
101
- ), ve = ({ className: e }) => /* @__PURE__ */ t(
101
+ ), xe = ({ className: e }) => /* @__PURE__ */ t(
102
102
  "svg",
103
103
  {
104
- className: L(e),
104
+ className: x(e),
105
105
  width: "14",
106
106
  height: "14",
107
107
  viewBox: "0 0 14 14",
@@ -116,10 +116,10 @@ const K = "gvp-icon", L = (e) => e ? `${K} ${e}` : K, fe = ({ className: e }) =>
116
116
  }
117
117
  )
118
118
  }
119
- ), ke = ({ className: e }) => /* @__PURE__ */ t(
119
+ ), Ne = ({ className: e }) => /* @__PURE__ */ t(
120
120
  "svg",
121
121
  {
122
- className: L(e),
122
+ className: x(e),
123
123
  width: "22",
124
124
  height: "22",
125
125
  viewBox: "0 0 16 16",
@@ -134,10 +134,10 @@ const K = "gvp-icon", L = (e) => e ? `${K} ${e}` : K, fe = ({ className: e }) =>
134
134
  }
135
135
  )
136
136
  }
137
- ), we = ({ className: e }) => /* @__PURE__ */ v(
137
+ ), Me = ({ className: e }) => /* @__PURE__ */ g(
138
138
  "svg",
139
139
  {
140
- className: L(e),
140
+ className: x(e),
141
141
  width: "16",
142
142
  height: "16",
143
143
  viewBox: "0 0 24 24",
@@ -165,10 +165,10 @@ const K = "gvp-icon", L = (e) => e ? `${K} ${e}` : K, fe = ({ className: e }) =>
165
165
  )
166
166
  ]
167
167
  }
168
- ), be = ({ className: e }) => /* @__PURE__ */ t(
168
+ ), Pe = ({ className: e }) => /* @__PURE__ */ t(
169
169
  "svg",
170
170
  {
171
- className: L(e),
171
+ className: x(e),
172
172
  width: "16",
173
173
  height: "16",
174
174
  viewBox: "0 0 24 24",
@@ -183,10 +183,10 @@ const K = "gvp-icon", L = (e) => e ? `${K} ${e}` : K, fe = ({ className: e }) =>
183
183
  }
184
184
  )
185
185
  }
186
- ), Ce = ({ className: e }) => /* @__PURE__ */ v(
186
+ ), Te = ({ className: e }) => /* @__PURE__ */ g(
187
187
  "svg",
188
188
  {
189
- className: L(e),
189
+ className: x(e),
190
190
  width: "16",
191
191
  height: "16",
192
192
  viewBox: "0 0 24 24",
@@ -198,10 +198,10 @@ const K = "gvp-icon", L = (e) => e ? `${K} ${e}` : K, fe = ({ className: e }) =>
198
198
  /* @__PURE__ */ t("rect", { x: "14", y: "5", width: "4", height: "14", rx: "1", fill: "currentColor" })
199
199
  ]
200
200
  }
201
- ), Le = ({ className: e }) => /* @__PURE__ */ v(
201
+ ), Ie = ({ className: e }) => /* @__PURE__ */ g(
202
202
  "svg",
203
203
  {
204
- className: L(e),
204
+ className: x(e),
205
205
  width: "18",
206
206
  height: "18",
207
207
  viewBox: "0 0 24 24",
@@ -229,10 +229,10 @@ const K = "gvp-icon", L = (e) => e ? `${K} ${e}` : K, fe = ({ className: e }) =>
229
229
  )
230
230
  ]
231
231
  }
232
- ), Ee = ({ className: e }) => /* @__PURE__ */ v(
232
+ ), Se = ({ className: e }) => /* @__PURE__ */ g(
233
233
  "svg",
234
234
  {
235
- className: L(e),
235
+ className: x(e),
236
236
  width: "18",
237
237
  height: "18",
238
238
  viewBox: "0 0 24 24",
@@ -260,10 +260,10 @@ const K = "gvp-icon", L = (e) => e ? `${K} ${e}` : K, fe = ({ className: e }) =>
260
260
  )
261
261
  ]
262
262
  }
263
- ), ye = ({ className: e }) => /* @__PURE__ */ v(
263
+ ), He = ({ className: e }) => /* @__PURE__ */ g(
264
264
  "svg",
265
265
  {
266
- className: L(e),
266
+ className: x(e),
267
267
  width: "18",
268
268
  height: "18",
269
269
  viewBox: "0 0 24 24",
@@ -291,10 +291,10 @@ const K = "gvp-icon", L = (e) => e ? `${K} ${e}` : K, fe = ({ className: e }) =>
291
291
  )
292
292
  ]
293
293
  }
294
- ), xe = ({ className: e }) => /* @__PURE__ */ t(
294
+ ), Ve = ({ className: e }) => /* @__PURE__ */ t(
295
295
  "svg",
296
296
  {
297
- className: L(e),
297
+ className: x(e),
298
298
  width: "18",
299
299
  height: "18",
300
300
  viewBox: "0 0 24 24",
@@ -312,10 +312,10 @@ const K = "gvp-icon", L = (e) => e ? `${K} ${e}` : K, fe = ({ className: e }) =>
312
312
  }
313
313
  )
314
314
  }
315
- ), Ne = ({ className: e }) => /* @__PURE__ */ t(
315
+ ), Ae = ({ className: e }) => /* @__PURE__ */ t(
316
316
  "svg",
317
317
  {
318
- className: L(e),
318
+ className: x(e),
319
319
  width: "18",
320
320
  height: "18",
321
321
  viewBox: "0 0 24 24",
@@ -333,10 +333,10 @@ const K = "gvp-icon", L = (e) => e ? `${K} ${e}` : K, fe = ({ className: e }) =>
333
333
  }
334
334
  )
335
335
  }
336
- ), Me = ({ className: e }) => /* @__PURE__ */ v(
336
+ ), De = ({ className: e }) => /* @__PURE__ */ g(
337
337
  "svg",
338
338
  {
339
- className: L(e),
339
+ className: x(e),
340
340
  width: "18",
341
341
  height: "18",
342
342
  viewBox: "0 0 24 24",
@@ -348,10 +348,10 @@ const K = "gvp-icon", L = (e) => e ? `${K} ${e}` : K, fe = ({ className: e }) =>
348
348
  /* @__PURE__ */ t("rect", { x: "12", y: "12", width: "8", height: "5", rx: "1", fill: "currentColor" })
349
349
  ]
350
350
  }
351
- ), Pe = ({ className: e }) => /* @__PURE__ */ v(
351
+ ), Be = ({ className: e }) => /* @__PURE__ */ g(
352
352
  "svg",
353
353
  {
354
- className: L(e),
354
+ className: x(e),
355
355
  width: "18",
356
356
  height: "18",
357
357
  viewBox: "0 0 24 24",
@@ -363,10 +363,10 @@ const K = "gvp-icon", L = (e) => e ? `${K} ${e}` : K, fe = ({ className: e }) =>
363
363
  /* @__PURE__ */ t("path", { d: "M7 12H11M13 12H17M7 15H9M11 15H13M15 15H17", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
364
364
  ]
365
365
  }
366
- ), Te = ({ className: e }) => /* @__PURE__ */ v(
366
+ ), $e = ({ className: e }) => /* @__PURE__ */ g(
367
367
  "svg",
368
368
  {
369
- className: L(e),
369
+ className: x(e),
370
370
  width: "16",
371
371
  height: "16",
372
372
  viewBox: "0 0 24 24",
@@ -394,10 +394,40 @@ const K = "gvp-icon", L = (e) => e ? `${K} ${e}` : K, fe = ({ className: e }) =>
394
394
  )
395
395
  ]
396
396
  }
397
- ), Ie = ({ className: e }) => /* @__PURE__ */ t(
397
+ ), We = ({ className: e }) => /* @__PURE__ */ g(
398
+ "svg",
399
+ {
400
+ className: x(e),
401
+ width: "16",
402
+ height: "16",
403
+ viewBox: "0 0 24 24",
404
+ fill: "none",
405
+ xmlns: "http://www.w3.org/2000/svg",
406
+ "aria-hidden": "true",
407
+ children: [
408
+ /* @__PURE__ */ t(
409
+ "path",
410
+ {
411
+ d: "M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z",
412
+ stroke: "currentColor",
413
+ strokeWidth: "1.5"
414
+ }
415
+ ),
416
+ /* @__PURE__ */ t(
417
+ "path",
418
+ {
419
+ d: "M3 12C3 12.6 3.08 13.18 3.23 13.73L4.6 14.5C4.86 14.65 5.02 14.94 5 15.24C4.98 15.58 4.96 15.92 5.07 16.24C5.18 16.56 5.39 16.83 5.62 17.08C5.83 17.3 6.13 17.4 6.42 17.36L7.99 17.13C8.28 17.09 8.57 17.21 8.74 17.45C9.07 17.93 9.49 18.34 9.97 18.66C10.21 18.83 10.34 19.11 10.31 19.4L10.13 20.97C10.1 21.26 10.21 21.55 10.43 21.74C10.91 22.16 11.45 22 12 22C12.55 22 13.09 22.16 13.57 21.74C13.79 21.55 13.9 21.26 13.87 20.97L13.69 19.4C13.66 19.11 13.79 18.83 14.03 18.66",
420
+ stroke: "currentColor",
421
+ strokeWidth: "1.5",
422
+ strokeLinecap: "round"
423
+ }
424
+ )
425
+ ]
426
+ }
427
+ ), Re = ({ className: e }) => /* @__PURE__ */ t(
398
428
  "svg",
399
429
  {
400
- className: L(e),
430
+ className: x(e),
401
431
  width: "12",
402
432
  height: "12",
403
433
  viewBox: "0 0 24 24",
@@ -416,20 +446,26 @@ const K = "gvp-icon", L = (e) => e ? `${K} ${e}` : K, fe = ({ className: e }) =>
416
446
  )
417
447
  }
418
448
  );
419
- function J(e) {
449
+ function re(e) {
420
450
  if (!Number.isFinite(e) || e < 0) return "--:--";
421
- const n = Math.floor(e), s = Math.floor(n / 3600), r = Math.floor(n % 3600 / 60), u = (n % 60).toString().padStart(2, "0");
451
+ const n = Math.floor(e), s = Math.floor(n / 3600), r = Math.floor(n % 3600 / 60), i = (n % 60).toString().padStart(2, "0");
422
452
  if (s > 0) {
423
- const c = r.toString().padStart(2, "0");
424
- return `${s}:${c}:${u}`;
453
+ const u = r.toString().padStart(2, "0");
454
+ return `${s}:${u}:${i}`;
425
455
  }
426
- return `${r}:${u}`;
456
+ return `${r}:${i}`;
457
+ }
458
+ const _e = {
459
+ index: -1
460
+ };
461
+ function je(e, n) {
462
+ return e > 0 ? `${e}p` : `Level ${n + 1}`;
427
463
  }
428
- const X = (() => {
464
+ const se = (() => {
429
465
  if (typeof navigator > "u") return !1;
430
466
  const e = navigator.userAgent;
431
467
  return /iPad|iPhone|iPod/.test(e) || e.includes("Mac") && navigator.maxTouchPoints > 1;
432
- })(), q = typeof navigator > "u" ? !1 : /iPhone|iPod/.test(navigator.userAgent), Se = 3e3, B = {
468
+ })(), G = typeof navigator > "u" ? !1 : /iPhone|iPod/.test(navigator.userAgent), Ue = 3e3, j = {
433
469
  isSupported() {
434
470
  return typeof document > "u" ? !1 : !!(document.fullscreenEnabled || document.webkitFullscreenEnabled);
435
471
  },
@@ -449,89 +485,116 @@ const X = (() => {
449
485
  document.removeEventListener("fullscreenchange", e), document.removeEventListener("webkitfullscreenchange", e);
450
486
  };
451
487
  }
452
- }, He = ({
488
+ }, Ze = ({
453
489
  video: e,
454
490
  isPlaying: n,
455
491
  container: s,
456
- onTogglePlay: r
492
+ onTogglePlay: r,
493
+ qualityLevels: l = [],
494
+ currentLevel: i = -1,
495
+ selectedLevel: u = -1,
496
+ onSelectLevel: c
457
497
  }) => {
458
- const [i, u] = k(!0), c = V(null), a = S(() => {
459
- c.current !== null && (clearTimeout(c.current), c.current = null);
460
- }, []), l = S(() => {
461
- a(), n && (c.current = setTimeout(() => u(!1), Se));
462
- }, [a, n]), m = S(() => {
463
- u(!0), l();
464
- }, [l]);
465
- return x(() => {
498
+ const [p, d] = k(!0), C = H(null), b = M(() => {
499
+ C.current !== null && (clearTimeout(C.current), C.current = null);
500
+ }, []), o = M(() => {
501
+ b(), n && (C.current = setTimeout(() => d(!1), Ue));
502
+ }, [b, n]), a = M(() => {
503
+ d(!0), o();
504
+ }, [o]);
505
+ return P(() => {
466
506
  if (!n) {
467
- a(), u(!0);
507
+ b(), d(!0);
468
508
  return;
469
509
  }
470
- return l(), a;
471
- }, [n, l, a]), x(() => {
510
+ return o(), b;
511
+ }, [n, o, b]), P(() => {
472
512
  if (!s) return;
473
- const f = () => m();
474
- return s.addEventListener("mousemove", f), s.addEventListener("touchstart", f), s.addEventListener("focusin", f), () => {
475
- s.removeEventListener("mousemove", f), s.removeEventListener("touchstart", f), s.removeEventListener("focusin", f);
513
+ const m = () => a();
514
+ return s.addEventListener("mousemove", m), s.addEventListener("touchstart", m), s.addEventListener("focusin", m), () => {
515
+ s.removeEventListener("mousemove", m), s.removeEventListener("touchstart", m), s.removeEventListener("focusin", m);
476
516
  };
477
- }, [s, m]), x(() => {
517
+ }, [s, a]), P(() => {
478
518
  if (!s || !e) return;
479
- const f = (o) => {
480
- if (!(!s.contains(document.activeElement) || o.target.tagName === "INPUT" && o.key !== " "))
481
- switch (o.key) {
519
+ const m = (f) => {
520
+ if (!(!s.contains(document.activeElement) || f.target.tagName === "INPUT" && f.key !== " "))
521
+ switch (f.key) {
482
522
  case " ":
483
523
  case "k":
484
- o.preventDefault(), r(), m();
524
+ f.preventDefault(), r(), a();
485
525
  break;
486
526
  case "ArrowLeft":
487
- o.preventDefault(), e.currentTime = Math.max(0, e.currentTime - 5), m();
527
+ f.preventDefault(), e.currentTime = Math.max(0, e.currentTime - 5), a();
488
528
  break;
489
529
  case "ArrowRight":
490
- o.preventDefault(), e.currentTime = Math.min(e.duration || 0, e.currentTime + 5), m();
530
+ f.preventDefault(), e.currentTime = Math.min(e.duration || 0, e.currentTime + 5), a();
491
531
  break;
492
532
  case "ArrowUp":
493
- o.preventDefault(), e.volume = Math.min(1, e.volume + 0.1), e.muted && (e.muted = !1), m();
533
+ f.preventDefault(), e.volume = Math.min(1, e.volume + 0.1), e.muted && (e.muted = !1), a();
494
534
  break;
495
535
  case "ArrowDown":
496
- o.preventDefault(), e.volume = Math.max(0, e.volume - 0.1), m();
536
+ f.preventDefault(), e.volume = Math.max(0, e.volume - 0.1), a();
497
537
  break;
498
538
  case "m":
499
- e.muted = !e.muted, m();
539
+ e.muted = !e.muted, a();
500
540
  break;
501
541
  case "f":
502
- B.element() === s ? B.exit().catch(() => {
503
- }) : B.request(s).catch(() => {
504
- }), m();
542
+ j.element() === s ? j.exit().catch(() => {
543
+ }) : j.request(s).catch(() => {
544
+ }), a();
505
545
  break;
506
546
  case "p":
507
547
  document.pictureInPictureElement ? document.exitPictureInPicture().catch(() => {
508
548
  }) : document.pictureInPictureEnabled && e.requestPictureInPicture().catch(() => {
509
- }), m();
549
+ }), a();
510
550
  break;
511
551
  }
512
552
  };
513
- return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
514
- }, [s, e, r, m]), /* @__PURE__ */ t(
553
+ return document.addEventListener("keydown", m), () => document.removeEventListener("keydown", m);
554
+ }, [s, e, r, a]), /* @__PURE__ */ t(
515
555
  "div",
516
556
  {
517
557
  role: "toolbar",
518
558
  "aria-label": "Video controls",
519
- className: H("gvp-controls", !i && "is-hidden"),
520
- onMouseEnter: a,
521
- onMouseLeave: l,
522
- children: /* @__PURE__ */ v("div", { className: "gvp-controls-row", children: [
523
- /* @__PURE__ */ t(Ve, { isPlaying: n, onToggle: r }),
524
- /* @__PURE__ */ t(Be, { video: e }),
525
- /* @__PURE__ */ t(De, { video: e }),
526
- /* @__PURE__ */ t(Re, { video: e }),
527
- /* @__PURE__ */ t(We, { video: e }),
528
- /* @__PURE__ */ t(Ae, { video: e }),
529
- /* @__PURE__ */ t(je, { video: e }),
530
- /* @__PURE__ */ t(Ze, { container: s, video: e })
559
+ className: I("gvp-controls", !p && "is-hidden"),
560
+ onMouseEnter: b,
561
+ onMouseLeave: o,
562
+ children: /* @__PURE__ */ g("div", { className: "gvp-controls-row", children: [
563
+ /* @__PURE__ */ t(Oe, { isPlaying: n, onToggle: r }),
564
+ /* @__PURE__ */ t(qe, { video: e }),
565
+ /* @__PURE__ */ t(Fe, { video: e }),
566
+ /* @__PURE__ */ t(ze, { video: e }),
567
+ /* @__PURE__ */ t(
568
+ Ke,
569
+ {
570
+ levels: l,
571
+ currentLevel: i,
572
+ selectedLevel: u,
573
+ onSelect: c
574
+ }
575
+ ),
576
+ /* @__PURE__ */ t(Je, { video: e }),
577
+ /* @__PURE__ */ t(Qe, { video: e }),
578
+ /* @__PURE__ */ t(Xe, { video: e }),
579
+ /* @__PURE__ */ t(Ge, { container: s, video: e })
531
580
  ] })
532
581
  }
533
582
  );
534
- }, Ve = ({
583
+ };
584
+ function ee(e, n, s) {
585
+ P(() => {
586
+ if (!e) return;
587
+ const r = (i) => {
588
+ n.current && !n.current.contains(i.target) && s();
589
+ }, l = (i) => {
590
+ i.key === "Escape" && s();
591
+ };
592
+ return document.addEventListener("mousedown", r), document.addEventListener("keydown", l), () => {
593
+ document.removeEventListener("mousedown", r), document.removeEventListener("keydown", l);
594
+ };
595
+ }, [e, n, s]);
596
+ }
597
+ const Oe = ({
535
598
  isPlaying: e,
536
599
  onToggle: n
537
600
  }) => /* @__PURE__ */ t(
@@ -542,49 +605,49 @@ const X = (() => {
542
605
  "aria-label": e ? "Pause" : "Play",
543
606
  "aria-pressed": e,
544
607
  onClick: n,
545
- children: e ? /* @__PURE__ */ t(Ce, {}) : /* @__PURE__ */ t(be, {})
608
+ children: e ? /* @__PURE__ */ t(Te, {}) : /* @__PURE__ */ t(Pe, {})
546
609
  }
547
- ), Be = ({ video: e }) => {
548
- const [n, s] = k(0), [r, i] = k(0), [u, c] = k(0);
549
- x(() => {
610
+ ), qe = ({ video: e }) => {
611
+ const [n, s] = k(0), [r, l] = k(0), [i, u] = k(0);
612
+ P(() => {
550
613
  if (!e) return;
551
- const o = () => s(e.currentTime), p = () => i(Number.isFinite(e.duration) ? e.duration : 0), g = () => {
552
- const d = e.buffered;
553
- if (!d || d.length === 0) {
554
- c(0);
614
+ const b = () => s(e.currentTime), o = () => l(Number.isFinite(e.duration) ? e.duration : 0), a = () => {
615
+ const m = e.buffered;
616
+ if (!m || m.length === 0) {
617
+ u(0);
555
618
  return;
556
619
  }
557
- let w = d.end(d.length - 1);
558
- for (let C = 0; C < d.length; C++)
559
- if (d.start(C) <= e.currentTime && e.currentTime <= d.end(C)) {
560
- w = d.end(C);
620
+ let f = m.end(m.length - 1);
621
+ for (let w = 0; w < m.length; w++)
622
+ if (m.start(w) <= e.currentTime && e.currentTime <= m.end(w)) {
623
+ f = m.end(w);
561
624
  break;
562
625
  }
563
- c(w);
626
+ u(f);
564
627
  };
565
- return o(), p(), g(), e.addEventListener("timeupdate", o), e.addEventListener("durationchange", p), e.addEventListener("loadedmetadata", p), e.addEventListener("progress", g), e.addEventListener("timeupdate", g), () => {
566
- e.removeEventListener("timeupdate", o), e.removeEventListener("durationchange", p), e.removeEventListener("loadedmetadata", p), e.removeEventListener("progress", g), e.removeEventListener("timeupdate", g);
628
+ return b(), o(), a(), e.addEventListener("timeupdate", b), e.addEventListener("durationchange", o), e.addEventListener("loadedmetadata", o), e.addEventListener("progress", a), e.addEventListener("timeupdate", a), () => {
629
+ e.removeEventListener("timeupdate", b), e.removeEventListener("durationchange", o), e.removeEventListener("loadedmetadata", o), e.removeEventListener("progress", a), e.removeEventListener("timeupdate", a);
567
630
  };
568
631
  }, [e]);
569
- const a = r > 0, l = a ? n / r * 100 : 0, m = a ? u / r * 100 : 0, f = (o) => {
570
- if (!e || !a) return;
571
- const p = Number(o.target.value) / 100 * r;
572
- e.currentTime = p, s(p);
632
+ const c = r > 0, p = c ? n / r * 100 : 0, d = c ? i / r * 100 : 0, C = (b) => {
633
+ if (!e || !c) return;
634
+ const o = Number(b.target.value) / 100 * r;
635
+ e.currentTime = o, s(o);
573
636
  };
574
- return /* @__PURE__ */ v("div", { className: "gvp-seek", children: [
575
- /* @__PURE__ */ v("div", { className: "gvp-seek-track", children: [
637
+ return /* @__PURE__ */ g("div", { className: "gvp-seek", children: [
638
+ /* @__PURE__ */ g("div", { className: "gvp-seek-track", children: [
576
639
  /* @__PURE__ */ t(
577
640
  "div",
578
641
  {
579
642
  className: "gvp-seek-buffered",
580
- style: { width: `${m}%` }
643
+ style: { width: `${d}%` }
581
644
  }
582
645
  ),
583
646
  /* @__PURE__ */ t(
584
647
  "div",
585
648
  {
586
649
  className: "gvp-seek-progress",
587
- style: { width: `${l}%` }
650
+ style: { width: `${p}%` }
588
651
  }
589
652
  )
590
653
  ] }),
@@ -596,9 +659,9 @@ const X = (() => {
596
659
  min: 0,
597
660
  max: 100,
598
661
  step: 0.1,
599
- value: l,
600
- onChange: f,
601
- disabled: !a,
662
+ value: p,
663
+ onChange: C,
664
+ disabled: !c,
602
665
  "aria-label": "Seek",
603
666
  "aria-valuemin": 0,
604
667
  "aria-valuemax": Math.floor(r),
@@ -606,39 +669,39 @@ const X = (() => {
606
669
  }
607
670
  )
608
671
  ] });
609
- }, De = ({ video: e }) => {
610
- const [n, s] = k(0), [r, i] = k(0);
611
- return x(() => {
672
+ }, Fe = ({ video: e }) => {
673
+ const [n, s] = k(0), [r, l] = k(0);
674
+ return P(() => {
612
675
  if (!e) return;
613
- const u = () => s(e.currentTime), c = () => i(Number.isFinite(e.duration) ? e.duration : 0);
614
- return u(), c(), e.addEventListener("timeupdate", u), e.addEventListener("durationchange", c), e.addEventListener("loadedmetadata", c), () => {
615
- e.removeEventListener("timeupdate", u), e.removeEventListener("durationchange", c), e.removeEventListener("loadedmetadata", c);
676
+ const i = () => s(e.currentTime), u = () => l(Number.isFinite(e.duration) ? e.duration : 0);
677
+ return i(), u(), e.addEventListener("timeupdate", i), e.addEventListener("durationchange", u), e.addEventListener("loadedmetadata", u), () => {
678
+ e.removeEventListener("timeupdate", i), e.removeEventListener("durationchange", u), e.removeEventListener("loadedmetadata", u);
616
679
  };
617
- }, [e]), /* @__PURE__ */ v("span", { className: "gvp-time", "aria-live": "off", children: [
618
- J(n),
680
+ }, [e]), /* @__PURE__ */ g("span", { className: "gvp-time", "aria-live": "off", children: [
681
+ re(n),
619
682
  " / ",
620
- J(r)
683
+ re(r)
621
684
  ] });
622
- }, Ae = ({ video: e }) => {
623
- const [n, s] = k(1), [r, i] = k(!1);
624
- x(() => {
685
+ }, Qe = ({ video: e }) => {
686
+ const [n, s] = k(1), [r, l] = k(!1);
687
+ P(() => {
625
688
  if (!e) return;
626
- const m = () => {
627
- s(e.volume), i(e.muted);
689
+ const d = () => {
690
+ s(e.volume), l(e.muted);
628
691
  };
629
- return m(), e.addEventListener("volumechange", m), () => e.removeEventListener("volumechange", m);
692
+ return d(), e.addEventListener("volumechange", d), () => e.removeEventListener("volumechange", d);
630
693
  }, [e]);
631
- const u = () => {
694
+ const i = () => {
632
695
  e && (e.muted = !e.muted);
633
- }, c = (m) => {
696
+ }, u = (d) => {
634
697
  if (!e) return;
635
- const f = Number(m.target.value) / 100;
636
- e.volume = f, f > 0 && e.muted && (e.muted = !1);
698
+ const C = Number(d.target.value) / 100;
699
+ e.volume = C, C > 0 && e.muted && (e.muted = !1);
637
700
  };
638
- let a = Le;
639
- r || n === 0 ? a = ye : n < 0.5 && (a = Ee);
640
- const l = r ? 0 : Math.round(n * 100);
641
- return /* @__PURE__ */ v("div", { className: H("gvp-volume", !X && "is-expandable"), children: [
701
+ let c = Ie;
702
+ r || n === 0 ? c = He : n < 0.5 && (c = Se);
703
+ const p = r ? 0 : Math.round(n * 100);
704
+ return /* @__PURE__ */ g("div", { className: I("gvp-volume", !se && "is-expandable"), children: [
642
705
  /* @__PURE__ */ t(
643
706
  "button",
644
707
  {
@@ -646,16 +709,16 @@ const X = (() => {
646
709
  className: "gvp-ctrl-btn",
647
710
  "aria-label": r ? "Unmute" : "Mute",
648
711
  "aria-pressed": r,
649
- onClick: u,
650
- children: /* @__PURE__ */ t(a, {})
712
+ onClick: i,
713
+ children: /* @__PURE__ */ t(c, {})
651
714
  }
652
715
  ),
653
- !X && /* @__PURE__ */ v("div", { className: "gvp-volume-slider-wrap", children: [
716
+ !se && /* @__PURE__ */ g("div", { className: "gvp-volume-slider-wrap", children: [
654
717
  /* @__PURE__ */ t("div", { className: "gvp-volume-track", children: /* @__PURE__ */ t(
655
718
  "div",
656
719
  {
657
720
  className: "gvp-volume-fill",
658
- style: { width: `${l}%` }
721
+ style: { width: `${p}%` }
659
722
  }
660
723
  ) }),
661
724
  /* @__PURE__ */ t(
@@ -666,139 +729,185 @@ const X = (() => {
666
729
  min: 0,
667
730
  max: 100,
668
731
  step: 1,
669
- value: l,
670
- onChange: c,
732
+ value: p,
733
+ onChange: u,
671
734
  "aria-label": "Volume",
672
735
  "aria-valuemin": 0,
673
736
  "aria-valuemax": 100,
674
- "aria-valuenow": l
737
+ "aria-valuenow": p
675
738
  }
676
739
  )
677
740
  ] })
678
741
  ] });
679
- }, $e = [0.5, 0.75, 1, 1.25, 1.5, 2], Re = ({ video: e }) => {
680
- const [n, s] = k(1), [r, i] = k(!1), u = V(null);
681
- x(() => {
742
+ }, Ye = [0.5, 0.75, 1, 1.25, 1.5, 2], ze = ({ video: e }) => {
743
+ const [n, s] = k(1), [r, l] = k(!1), i = H(null);
744
+ P(() => {
682
745
  if (!e) return;
683
- const l = () => s(e.playbackRate);
684
- return l(), e.addEventListener("ratechange", l), () => e.removeEventListener("ratechange", l);
685
- }, [e]), x(() => {
686
- if (!r) return;
687
- const l = (f) => {
688
- u.current && !u.current.contains(f.target) && i(!1);
689
- }, m = (f) => {
690
- f.key === "Escape" && i(!1);
691
- };
692
- return document.addEventListener("mousedown", l), document.addEventListener("keydown", m), () => {
693
- document.removeEventListener("mousedown", l), document.removeEventListener("keydown", m);
694
- };
695
- }, [r]);
696
- const c = (l) => {
697
- e && (e.playbackRate = l), s(l), i(!1);
698
- }, a = n === 1 ? "1×" : `${n}×`;
699
- return /* @__PURE__ */ v("div", { className: "gvp-speed", ref: u, children: [
700
- /* @__PURE__ */ v(
746
+ const d = () => s(e.playbackRate);
747
+ return d(), e.addEventListener("ratechange", d), () => e.removeEventListener("ratechange", d);
748
+ }, [e]);
749
+ const u = M(() => l(!1), []);
750
+ ee(r, i, u);
751
+ const c = (d) => {
752
+ e && (e.playbackRate = d), s(d), l(!1);
753
+ }, p = n === 1 ? "" : `${n}×`;
754
+ return /* @__PURE__ */ g("div", { className: "gvp-speed", ref: i, children: [
755
+ /* @__PURE__ */ g(
701
756
  "button",
702
757
  {
703
758
  type: "button",
704
759
  className: "gvp-ctrl-btn gvp-speed-btn",
705
760
  "aria-haspopup": "listbox",
706
761
  "aria-expanded": r,
707
- "aria-label": `Playback speed: ${a}`,
708
- onClick: () => i((l) => !l),
762
+ "aria-label": `Playback speed: ${p}`,
763
+ onClick: () => l((d) => !d),
709
764
  children: [
710
- /* @__PURE__ */ t(Te, {}),
711
- /* @__PURE__ */ t("span", { className: "gvp-speed-label", children: a })
765
+ /* @__PURE__ */ t($e, {}),
766
+ /* @__PURE__ */ t("span", { className: "gvp-speed-label", children: p })
712
767
  ]
713
768
  }
714
769
  ),
715
770
  r && // NOSONAR: typescript:S6819
716
- /* @__PURE__ */ t("ul", { className: "gvp-speed-menu", role: "listbox", "aria-label": "Playback speed", children: $e.map((l) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
771
+ /* @__PURE__ */ t("ul", { className: "gvp-speed-menu", role: "listbox", "aria-label": "Playback speed", children: Ye.map((d) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
717
772
  "button",
718
773
  {
719
774
  type: "button",
720
775
  role: "option",
721
- "aria-selected": l === n,
722
- className: H("gvp-speed-menu-item", l === n && "is-active"),
723
- onClick: () => c(l),
724
- children: l === 1 ? "Normal" : `${l}×`
776
+ "aria-selected": d === n,
777
+ className: I("gvp-speed-menu-item", d === n && "is-active"),
778
+ onClick: () => c(d),
779
+ children: d === 1 ? "Normal" : `${d}×`
725
780
  }
726
- ) }, l)) })
781
+ ) }, d)) })
727
782
  ] });
728
- }, We = ({ video: e }) => {
729
- const [n, s] = k([]), [r, i] = k(-1), [u, c] = k(!1), a = V(null), l = S((o) => {
730
- const p = [];
731
- for (let d = 0; d < o.length; d++) {
732
- const w = o[d];
733
- (w.kind === "subtitles" || w.kind === "captions") && p.push({ index: d, label: w.label || w.language || `Track ${d + 1}`, language: w.language });
783
+ }, Ke = ({ levels: e, currentLevel: n, selectedLevel: s, onSelect: r }) => {
784
+ const [l, i] = k(!1), u = H(null), c = M(() => i(!1), []);
785
+ if (ee(l, u, c), e.length < 2) return null;
786
+ const p = (o) => {
787
+ r == null || r(o), i(!1);
788
+ }, d = [...e].sort((o, a) => a.height - o.height), C = e.find((o) => o.index === n);
789
+ let b;
790
+ if (s < 0)
791
+ b = C ? `Auto (${C.label})` : "Auto";
792
+ else {
793
+ const o = e.find((a) => a.index === s);
794
+ b = (o == null ? void 0 : o.label) ?? "Auto";
795
+ }
796
+ return /* @__PURE__ */ g("div", { className: "gvp-quality", ref: u, children: [
797
+ /* @__PURE__ */ g(
798
+ "button",
799
+ {
800
+ type: "button",
801
+ className: "gvp-ctrl-btn gvp-quality-btn",
802
+ "aria-haspopup": "listbox",
803
+ "aria-expanded": l,
804
+ "aria-label": `Quality: ${b}`,
805
+ onClick: () => i((o) => !o),
806
+ children: [
807
+ /* @__PURE__ */ t(We, {}),
808
+ /* @__PURE__ */ t("span", { className: "gvp-quality-label", children: b })
809
+ ]
810
+ }
811
+ ),
812
+ l && // NOSONAR: typescript:S6819
813
+ /* @__PURE__ */ g("ul", { className: "gvp-quality-menu", role: "listbox", "aria-label": "Quality", children: [
814
+ /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
815
+ "button",
816
+ {
817
+ type: "button",
818
+ role: "option",
819
+ "aria-selected": s < 0,
820
+ className: I(
821
+ "gvp-quality-menu-item",
822
+ s < 0 && "is-active"
823
+ ),
824
+ onClick: () => p(_e.index),
825
+ children: C ? `Auto (${C.label})` : "Auto"
826
+ }
827
+ ) }),
828
+ d.map((o) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
829
+ "button",
830
+ {
831
+ type: "button",
832
+ role: "option",
833
+ "aria-selected": o.index === s,
834
+ className: I(
835
+ "gvp-quality-menu-item",
836
+ o.index === s && "is-active"
837
+ ),
838
+ onClick: () => p(o.index),
839
+ children: o.label
840
+ }
841
+ ) }, o.index))
842
+ ] })
843
+ ] });
844
+ }, Je = ({ video: e }) => {
845
+ const [n, s] = k([]), [r, l] = k(-1), [i, u] = k(!1), c = H(null), p = M((o) => {
846
+ const a = [];
847
+ for (let f = 0; f < o.length; f++) {
848
+ const w = o[f];
849
+ (w.kind === "subtitles" || w.kind === "captions") && a.push({ index: f, label: w.label || w.language || `Track ${f + 1}`, language: w.language });
734
850
  }
735
- s(p);
736
- let g = -1;
737
- for (let d = 0; d < o.length; d++)
738
- if (o[d].mode === "showing") {
739
- g = d;
851
+ s(a);
852
+ let m = -1;
853
+ for (let f = 0; f < o.length; f++)
854
+ if (o[f].mode === "showing") {
855
+ m = f;
740
856
  break;
741
857
  }
742
- i(g);
858
+ l(m);
743
859
  }, []);
744
- x(() => {
860
+ P(() => {
745
861
  if (!e) {
746
- s([]), i(-1);
862
+ s([]), l(-1);
747
863
  return;
748
864
  }
749
865
  const o = e.textTracks;
750
- l(o);
751
- const p = () => l(o);
752
- return o.addEventListener("addtrack", p), o.addEventListener("removetrack", p), o.addEventListener("change", p), () => {
753
- o.removeEventListener("addtrack", p), o.removeEventListener("removetrack", p), o.removeEventListener("change", p);
754
- };
755
- }, [e, l]), x(() => {
756
- if (!u) return;
757
- const o = (g) => {
758
- a.current && !a.current.contains(g.target) && c(!1);
759
- }, p = (g) => {
760
- g.key === "Escape" && c(!1);
761
- };
762
- return document.addEventListener("mousedown", o), document.addEventListener("keydown", p), () => {
763
- document.removeEventListener("mousedown", o), document.removeEventListener("keydown", p);
764
- };
765
- }, [u]);
766
- const m = (o) => {
866
+ p(o);
867
+ const a = () => p(o);
868
+ if (typeof o.addEventListener == "function")
869
+ return o.addEventListener("addtrack", a), o.addEventListener("removetrack", a), o.addEventListener("change", a), () => {
870
+ o.removeEventListener("addtrack", a), o.removeEventListener("removetrack", a), o.removeEventListener("change", a);
871
+ };
872
+ }, [e, p]);
873
+ const d = M(() => u(!1), []);
874
+ ee(i, c, d);
875
+ const C = (o) => {
767
876
  if (!e) return;
768
- const p = e.textTracks;
769
- for (let g = 0; g < p.length; g++)
770
- p[g].mode = g === o ? "showing" : "hidden";
771
- i(o), c(!1);
772
- }, f = () => {
877
+ const a = e.textTracks;
878
+ for (let m = 0; m < a.length; m++)
879
+ a[m].mode = m === o ? "showing" : "hidden";
880
+ l(o), u(!1);
881
+ }, b = () => {
773
882
  if (!e) return;
774
883
  const o = e.textTracks;
775
- for (let p = 0; p < o.length; p++) o[p].mode = "hidden";
776
- i(-1), c(!1);
884
+ for (let a = 0; a < o.length; a++) o[a].mode = "hidden";
885
+ l(-1), u(!1);
777
886
  };
778
- return n.length === 0 ? null : /* @__PURE__ */ v("div", { className: "gvp-captions", ref: a, children: [
887
+ return n.length === 0 ? null : /* @__PURE__ */ g("div", { className: "gvp-captions", ref: c, children: [
779
888
  /* @__PURE__ */ t(
780
889
  "button",
781
890
  {
782
891
  type: "button",
783
- className: H("gvp-ctrl-btn", r >= 0 && "is-active"),
892
+ className: I("gvp-ctrl-btn", r >= 0 && "is-active"),
784
893
  "aria-haspopup": "listbox",
785
- "aria-expanded": u,
894
+ "aria-expanded": i,
786
895
  "aria-label": "Captions",
787
896
  "aria-pressed": r >= 0,
788
- onClick: () => c((o) => !o),
789
- children: /* @__PURE__ */ t(Pe, {})
897
+ onClick: () => u((o) => !o),
898
+ children: /* @__PURE__ */ t(Be, {})
790
899
  }
791
900
  ),
792
- u && // NOSONAR: typescript:S6819
793
- /* @__PURE__ */ v("ul", { className: "gvp-captions-menu", role: "listbox", "aria-label": "Captions", children: [
901
+ i && // NOSONAR: typescript:S6819
902
+ /* @__PURE__ */ g("ul", { className: "gvp-captions-menu", role: "listbox", "aria-label": "Captions", children: [
794
903
  /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
795
904
  "button",
796
905
  {
797
906
  type: "button",
798
907
  role: "option",
799
908
  "aria-selected": r === -1,
800
- className: H("gvp-captions-menu-item", r === -1 && "is-active"),
801
- onClick: f,
909
+ className: I("gvp-captions-menu-item", r === -1 && "is-active"),
910
+ onClick: b,
802
911
  children: "Off"
803
912
  }
804
913
  ) }),
@@ -808,20 +917,20 @@ const X = (() => {
808
917
  type: "button",
809
918
  role: "option",
810
919
  "aria-selected": o.index === r,
811
- className: H("gvp-captions-menu-item", o.index === r && "is-active"),
812
- onClick: () => m(o.index),
920
+ className: I("gvp-captions-menu-item", o.index === r && "is-active"),
921
+ onClick: () => C(o.index),
813
922
  children: o.label
814
923
  }
815
924
  ) }, o.index))
816
925
  ] })
817
926
  ] });
818
- }, je = ({ video: e }) => {
927
+ }, Xe = ({ video: e }) => {
819
928
  const [n, s] = k(!1);
820
- if (x(() => {
929
+ if (P(() => {
821
930
  if (!e) return;
822
- const i = () => s(!0), u = () => s(!1);
823
- return e.addEventListener("enterpictureinpicture", i), e.addEventListener("leavepictureinpicture", u), () => {
824
- e.removeEventListener("enterpictureinpicture", i), e.removeEventListener("leavepictureinpicture", u);
931
+ const l = () => s(!0), i = () => s(!1);
932
+ return e.addEventListener("enterpictureinpicture", l), e.addEventListener("leavepictureinpicture", i), () => {
933
+ e.removeEventListener("enterpictureinpicture", l), e.removeEventListener("leavepictureinpicture", i);
825
934
  };
826
935
  }, [e]), !document.pictureInPictureEnabled) return null;
827
936
  const r = () => {
@@ -833,20 +942,20 @@ const X = (() => {
833
942
  "button",
834
943
  {
835
944
  type: "button",
836
- className: H("gvp-ctrl-btn", n && "is-active"),
945
+ className: I("gvp-ctrl-btn", n && "is-active"),
837
946
  "aria-label": n ? "Exit picture-in-picture" : "Picture-in-picture",
838
947
  "aria-pressed": n,
839
948
  onClick: r,
840
- children: /* @__PURE__ */ t(Me, {})
949
+ children: /* @__PURE__ */ t(De, {})
841
950
  }
842
951
  );
843
- }, Ze = ({ container: e, video: n }) => {
952
+ }, Ge = ({ container: e, video: n }) => {
844
953
  const [s, r] = k(!1);
845
- return x(() => {
846
- if (q) return;
847
- const l = () => r(B.element() === e);
848
- return l(), B.onChange(l);
849
- }, [e]), B.isSupported() || q && n !== null && typeof n.webkitEnterFullscreen == "function" ? /* @__PURE__ */ t(
954
+ return P(() => {
955
+ if (G) return;
956
+ const p = () => r(j.element() === e);
957
+ return p(), j.onChange(p);
958
+ }, [e]), j.isSupported() || G && n !== null && typeof n.webkitEnterFullscreen == "function" ? /* @__PURE__ */ t(
850
959
  "button",
851
960
  {
852
961
  type: "button",
@@ -854,120 +963,146 @@ const X = (() => {
854
963
  "aria-label": s ? "Exit fullscreen" : "Enter fullscreen",
855
964
  "aria-pressed": s,
856
965
  onClick: () => {
857
- var l;
858
- if (q) {
859
- (l = n == null ? void 0 : n.webkitEnterFullscreen) == null || l.call(n);
966
+ var p;
967
+ if (G) {
968
+ (p = n == null ? void 0 : n.webkitEnterFullscreen) == null || p.call(n);
860
969
  return;
861
970
  }
862
- s ? B.exit().catch(() => {
863
- }) : e && B.request(e).catch(() => {
971
+ s ? j.exit().catch(() => {
972
+ }) : e && j.request(e).catch(() => {
864
973
  });
865
974
  },
866
- children: /* @__PURE__ */ t(s ? Ne : xe, {})
975
+ children: /* @__PURE__ */ t(s ? Ae : Ve, {})
867
976
  }
868
977
  ) : null;
869
978
  };
870
- function G(e, n, s) {
979
+ function oe(e, n, s) {
871
980
  const r = e == null ? void 0 : e.trim();
872
981
  if (r) return r;
873
982
  if (n) {
874
983
  try {
875
- const u = new Intl.DisplayNames(void 0, { type: "language" }).of(n);
876
- if (u && u !== n) return u;
984
+ const i = new Intl.DisplayNames(void 0, { type: "language" }).of(n);
985
+ if (i && i !== n) return i;
877
986
  } catch {
878
987
  }
879
988
  return n;
880
989
  }
881
990
  return `Audio ${s + 1}`;
882
991
  }
883
- const ee = pe.forwardRef(
992
+ const le = we.forwardRef(
884
993
  ({
885
994
  src: e,
886
995
  hlsConfig: n,
887
996
  isHls: s,
888
997
  autoPlay: r,
889
- children: i,
890
- onAudioTracks: u,
891
- audioTrackIndex: c,
892
- ...a
893
- }, l) => {
894
- const m = V(null), f = V(null), o = V(u);
895
- o.current = u, me(l, () => m.current);
896
- const p = globalThis.window !== void 0 && $.isSupported(), g = !!s || p && typeof e == "string" && e.endsWith(".m3u8");
897
- return x(() => {
898
- var P, R, D;
998
+ children: l,
999
+ onAudioTracks: i,
1000
+ audioTrackIndex: u,
1001
+ onQualityLevels: c,
1002
+ onCurrentLevel: p,
1003
+ qualityLevelIndex: d,
1004
+ ...C
1005
+ }, b) => {
1006
+ const o = H(null), a = H(null), m = H(i);
1007
+ m.current = i;
1008
+ const f = H(c);
1009
+ f.current = c;
1010
+ const w = H(p);
1011
+ w.current = p, Le(b, () => o.current);
1012
+ const U = globalThis.window !== void 0 && $.isSupported(), V = !!s || U && typeof e == "string" && e.endsWith(".m3u8");
1013
+ return P(() => {
1014
+ var F, Z, q;
899
1015
  if (!e) return;
900
- const d = m.current;
901
- if (!d) return;
902
- const w = (h) => {
903
- var E;
904
- (E = o.current) == null || E.call(o, h);
905
- }, C = () => {
906
- r && d.play().catch(() => {
1016
+ const v = o.current;
1017
+ if (!v) return;
1018
+ const S = (h) => {
1019
+ var L;
1020
+ (L = m.current) == null || L.call(m, h);
1021
+ }, T = (h) => {
1022
+ var L;
1023
+ (L = f.current) == null || L.call(f, h);
1024
+ }, D = (h) => {
1025
+ var L;
1026
+ (L = w.current) == null || L.call(w, h);
1027
+ }, W = () => {
1028
+ r && v.play().catch(() => {
907
1029
  });
908
1030
  };
909
- for (f.current && (f.current.destroy(), f.current = null), d.pause(), d.removeAttribute("src"); d.firstChild; ) d.firstChild.remove();
910
- w([]);
911
- let N;
912
- if (g) {
1031
+ for (a.current && (a.current.destroy(), a.current = null), v.pause(), v.removeAttribute("src"); v.firstChild; ) v.firstChild.remove();
1032
+ S([]), T([]), D(-1);
1033
+ let R;
1034
+ if (V) {
913
1035
  const h = new $(n);
914
- f.current = h;
915
- const E = () => {
916
- const M = h.audioTracks.map((b, T) => ({
917
- index: T,
918
- label: G(b.name, b.lang, T),
919
- lang: b.lang || void 0
1036
+ a.current = h;
1037
+ const L = () => {
1038
+ const N = h.audioTracks.map((y, _) => ({
1039
+ index: _,
1040
+ label: oe(y.name, y.lang, _),
1041
+ lang: y.lang || void 0
1042
+ }));
1043
+ S(N);
1044
+ }, B = () => {
1045
+ const N = h.levels.map((y, _) => ({
1046
+ index: _,
1047
+ height: y.height || 0,
1048
+ label: je(y.height || 0, _)
920
1049
  }));
921
- w(M);
1050
+ T(N);
922
1051
  };
923
- h.on($.Events.MANIFEST_PARSED, C), h.on($.Events.AUDIO_TRACKS_UPDATED, E), h.on($.Events.AUDIO_TRACK_SWITCHED, E), h.on($.Events.ERROR, (M, b) => {
924
- b.fatal && (h.destroy(), f.current = null);
925
- }), h.attachMedia(d), h.loadSource(e);
1052
+ h.on($.Events.MANIFEST_PARSED, W), h.on($.Events.MANIFEST_PARSED, B), h.on($.Events.LEVELS_UPDATED, B), h.on($.Events.LEVEL_SWITCHED, (N, y) => {
1053
+ D(y.level);
1054
+ }), h.on($.Events.AUDIO_TRACKS_UPDATED, L), h.on($.Events.AUDIO_TRACK_SWITCHED, L), h.on($.Events.ERROR, (N, y) => {
1055
+ y.fatal && (h.destroy(), a.current = null);
1056
+ }), h.attachMedia(v), h.loadSource(e);
926
1057
  } else {
927
- d.src = e, d.load(), d.addEventListener("loadedmetadata", C, { once: !0 });
928
- const h = d.audioTracks;
1058
+ v.src = e, v.load(), v.addEventListener("loadedmetadata", W, { once: !0 });
1059
+ const h = v.audioTracks;
929
1060
  if (h) {
930
- const E = () => {
931
- const M = [];
932
- for (let b = 0; b < h.length; b++) {
933
- const T = h[b];
934
- M.push({
935
- index: b,
936
- label: G(T.label, T.language, b),
937
- lang: T.language || void 0
1061
+ const L = () => {
1062
+ const B = [];
1063
+ for (let N = 0; N < h.length; N++) {
1064
+ const y = h[N];
1065
+ B.push({
1066
+ index: N,
1067
+ label: oe(y.label, y.language, N),
1068
+ lang: y.language || void 0
938
1069
  });
939
1070
  }
940
- w(M);
1071
+ S(B);
941
1072
  };
942
- (P = h.addEventListener) == null || P.call(h, "addtrack", E), (R = h.addEventListener) == null || R.call(h, "removetrack", E), (D = h.addEventListener) == null || D.call(h, "change", E), h.length > 0 && E(), N = () => {
943
- var M, b, T;
944
- (M = h.removeEventListener) == null || M.call(h, "addtrack", E), (b = h.removeEventListener) == null || b.call(h, "removetrack", E), (T = h.removeEventListener) == null || T.call(h, "change", E);
1073
+ (F = h.addEventListener) == null || F.call(h, "addtrack", L), (Z = h.addEventListener) == null || Z.call(h, "removetrack", L), (q = h.addEventListener) == null || q.call(h, "change", L), h.length > 0 && L(), R = () => {
1074
+ var B, N, y;
1075
+ (B = h.removeEventListener) == null || B.call(h, "addtrack", L), (N = h.removeEventListener) == null || N.call(h, "removetrack", L), (y = h.removeEventListener) == null || y.call(h, "change", L);
945
1076
  };
946
1077
  }
947
1078
  }
948
1079
  return () => {
949
- for (d.removeEventListener("loadedmetadata", C), N == null || N(), f.current && (f.current.destroy(), f.current = null), d.pause(), d.removeAttribute("src"); d.firstChild; ) d.firstChild.remove();
950
- d.load(), w([]);
1080
+ for (v.removeEventListener("loadedmetadata", W), R == null || R(), a.current && (a.current.destroy(), a.current = null), v.pause(), v.removeAttribute("src"); v.firstChild; ) v.firstChild.remove();
1081
+ v.load(), S([]), T([]), D(-1);
951
1082
  };
952
- }, [e, g, n, r]), x(() => {
953
- var C;
954
- if (c == null || c < 0) return;
955
- const d = f.current;
956
- if (d) {
957
- d.audioTrack !== c && (d.audioTrack = c);
1083
+ }, [e, V, n, r]), P(() => {
1084
+ if (d == null) return;
1085
+ const v = a.current;
1086
+ v && v.currentLevel !== d && (v.currentLevel = d);
1087
+ }, [d]), P(() => {
1088
+ var T;
1089
+ if (u == null || u < 0) return;
1090
+ const v = a.current;
1091
+ if (v) {
1092
+ v.audioTrack !== u && (v.audioTrack = u);
958
1093
  return;
959
1094
  }
960
- const w = (C = m.current) == null ? void 0 : C.audioTracks;
961
- if (w)
962
- for (let N = 0; N < w.length; N++)
963
- w[N].enabled = N === c;
964
- }, [c]), // Captions are the consumer's responsibility — pass <track> elements as children.
1095
+ const S = (T = o.current) == null ? void 0 : T.audioTracks;
1096
+ if (S)
1097
+ for (let D = 0; D < S.length; D++)
1098
+ S[D].enabled = D === u;
1099
+ }, [u]), // Captions are the consumer's responsibility — pass <track> elements as children.
965
1100
  // NOSONAR: typescript:S4084
966
- /* @__PURE__ */ t("video", { ref: m, ...a, children: i });
1101
+ /* @__PURE__ */ t("video", { ref: o, ...C, children: l });
967
1102
  }
968
1103
  );
969
- ee.displayName = "HLSPlayer";
970
- function Ue(e) {
1104
+ le.displayName = "HLSPlayer";
1105
+ function et(e) {
971
1106
  if (!e) return null;
972
1107
  if (/^[A-Za-z0-9_-]{11}$/.test(e)) return e;
973
1108
  let n;
@@ -984,56 +1119,56 @@ function Ue(e) {
984
1119
  if (s === "youtube.com" || s === "m.youtube.com" || s === "music.youtube.com" || s === "youtube-nocookie.com") {
985
1120
  const r = n.searchParams.get("v");
986
1121
  if (r && /^[A-Za-z0-9_-]{11}$/.test(r)) return r;
987
- const i = /^\/(?:embed|shorts|v|live)\/([A-Za-z0-9_-]{11})/.exec(
1122
+ const l = /^\/(?:embed|shorts|v|live)\/([A-Za-z0-9_-]{11})/.exec(
988
1123
  n.pathname
989
1124
  );
990
- if (i) return i[1];
1125
+ if (l) return l[1];
991
1126
  }
992
1127
  return null;
993
1128
  }
994
- function _e(e) {
1129
+ function tt(e) {
995
1130
  try {
996
1131
  const n = new URL(e), s = n.searchParams.get("t") ?? n.searchParams.get("start");
997
1132
  if (!s) return null;
998
1133
  if (/^\d+s?$/.test(s)) return Number.parseInt(s, 10);
999
1134
  const r = /^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/.exec(s);
1000
1135
  if (r) {
1001
- const i = Number.parseInt(r[1] ?? "0", 10), u = Number.parseInt(r[2] ?? "0", 10), c = Number.parseInt(r[3] ?? "0", 10), a = i * 3600 + u * 60 + c;
1002
- return a > 0 ? a : null;
1136
+ const l = Number.parseInt(r[1] ?? "0", 10), i = Number.parseInt(r[2] ?? "0", 10), u = Number.parseInt(r[3] ?? "0", 10), c = l * 3600 + i * 60 + u;
1137
+ return c > 0 ? c : null;
1003
1138
  }
1004
1139
  } catch {
1005
1140
  }
1006
1141
  return null;
1007
1142
  }
1008
- function Oe(e, n = {}) {
1009
- const { autoPlay: s = !1, muted: r = !0, loop: i = !1, controls: u = !0, startSeconds: c } = n, a = new URLSearchParams({
1143
+ function nt(e, n = {}) {
1144
+ const { autoPlay: s = !1, muted: r = !0, loop: l = !1, controls: i = !0, startSeconds: u } = n, c = new URLSearchParams({
1010
1145
  rel: "0",
1011
1146
  modestbranding: "1",
1012
1147
  playsinline: "1",
1013
- controls: u ? "1" : "0"
1148
+ controls: i ? "1" : "0"
1014
1149
  });
1015
- return s ? (a.set("autoplay", "1"), a.set("mute", "1")) : r && a.set("mute", "1"), i && (a.set("loop", "1"), a.set("playlist", e)), c && c > 0 && a.set("start", String(c)), `https://www.youtube-nocookie.com/embed/${e}?${a.toString()}`;
1150
+ return s ? (c.set("autoplay", "1"), c.set("mute", "1")) : r && c.set("mute", "1"), l && (c.set("loop", "1"), c.set("playlist", e)), u && u > 0 && c.set("start", String(u)), `https://www.youtube-nocookie.com/embed/${e}?${c.toString()}`;
1016
1151
  }
1017
- const Fe = ({
1152
+ const rt = ({
1018
1153
  tracks: e,
1019
1154
  activeIndex: n,
1020
1155
  onSelect: s
1021
1156
  }) => {
1022
- const [r, i] = k(!1), u = V(null);
1023
- x(() => {
1157
+ const [r, l] = k(!1), i = H(null);
1158
+ P(() => {
1024
1159
  if (!r) return;
1025
- const a = (m) => {
1026
- u.current && !u.current.contains(m.target) && i(!1);
1027
- }, l = (m) => {
1028
- m.key === "Escape" && i(!1);
1160
+ const c = (d) => {
1161
+ i.current && !i.current.contains(d.target) && l(!1);
1162
+ }, p = (d) => {
1163
+ d.key === "Escape" && l(!1);
1029
1164
  };
1030
- return document.addEventListener("mousedown", a), document.addEventListener("keydown", l), () => {
1031
- document.removeEventListener("mousedown", a), document.removeEventListener("keydown", l);
1165
+ return document.addEventListener("mousedown", c), document.addEventListener("keydown", p), () => {
1166
+ document.removeEventListener("mousedown", c), document.removeEventListener("keydown", p);
1032
1167
  };
1033
1168
  }, [r]);
1034
- const c = e.find((a) => a.index === n) ?? e[0];
1035
- return /* @__PURE__ */ v("div", { className: "gvp-audio", ref: u, children: [
1036
- /* @__PURE__ */ v(
1169
+ const u = e.find((c) => c.index === n) ?? e[0];
1170
+ return /* @__PURE__ */ g("div", { className: "gvp-audio", ref: i, children: [
1171
+ /* @__PURE__ */ g(
1037
1172
  "button",
1038
1173
  {
1039
1174
  type: "button",
@@ -1041,11 +1176,11 @@ const Fe = ({
1041
1176
  "aria-haspopup": "listbox",
1042
1177
  "aria-expanded": r,
1043
1178
  "aria-label": "Audio track",
1044
- onClick: () => i((a) => !a),
1179
+ onClick: () => l((c) => !c),
1045
1180
  children: [
1046
- /* @__PURE__ */ t(we, {}),
1047
- /* @__PURE__ */ t("span", { className: "gvp-audio-label", children: c == null ? void 0 : c.label }),
1048
- /* @__PURE__ */ t(Ie, {})
1181
+ /* @__PURE__ */ t(Me, {}),
1182
+ /* @__PURE__ */ t("span", { className: "gvp-audio-label", children: u == null ? void 0 : u.label }),
1183
+ /* @__PURE__ */ t(Re, {})
1049
1184
  ]
1050
1185
  }
1051
1186
  ),
@@ -1053,149 +1188,154 @@ const Fe = ({
1053
1188
  // (it renders the OS dropdown chrome), so this is a custom listbox with
1054
1189
  // full keyboard + ARIA support.
1055
1190
  // NOSONAR: typescript:S6819
1056
- /* @__PURE__ */ t("ul", { className: "gvp-audio-menu", role: "listbox", "aria-label": "Audio tracks", children: e.map((a) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
1191
+ /* @__PURE__ */ t("ul", { className: "gvp-audio-menu", role: "listbox", "aria-label": "Audio tracks", children: e.map((c) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
1057
1192
  "button",
1058
1193
  {
1059
1194
  type: "button",
1060
1195
  role: "option",
1061
- "aria-selected": a.index === n,
1062
- className: H(
1196
+ "aria-selected": c.index === n,
1197
+ className: I(
1063
1198
  "gvp-audio-menu-item",
1064
- a.index === n && "is-active"
1199
+ c.index === n && "is-active"
1065
1200
  ),
1066
1201
  onClick: () => {
1067
- s(a.index), i(!1);
1202
+ s(c.index), l(!1);
1068
1203
  },
1069
- children: a.label
1204
+ children: c.label
1070
1205
  }
1071
- ) }, a.index)) })
1206
+ ) }, c.index)) })
1072
1207
  ] });
1073
- }, Ke = ({
1208
+ }, lt = ({
1074
1209
  src: e,
1075
1210
  poster: n,
1076
1211
  showDeviceToggle: s = !0,
1077
1212
  defaultDevice: r = "desktop",
1078
- hoverPlay: i = !1,
1079
- tooltipText: u,
1080
- onClose: c,
1081
- className: a = "",
1082
- muted: l = !0,
1083
- loop: m = !1,
1084
- controls: f = !1,
1085
- autoPlay: o = !1,
1086
- frameMaxWidth: p,
1087
- aspectRatio: g,
1088
- hlsConfig: d,
1089
- children: w
1213
+ hoverPlay: l = !1,
1214
+ tooltipText: i,
1215
+ onClose: u,
1216
+ className: c = "",
1217
+ muted: p = !0,
1218
+ loop: d = !1,
1219
+ controls: C = !0,
1220
+ autoPlay: b = !1,
1221
+ frameMaxWidth: o,
1222
+ aspectRatio: a,
1223
+ hlsConfig: m,
1224
+ children: f
1090
1225
  }) => {
1091
- const C = V(null), N = V(null), [P, R] = k(r), [D, h] = k(!1), [E, M] = k(!1), [b, T] = k([]), [_, z] = k(-1), [te, ne] = k(null), [re, se] = k(null), oe = S((y) => {
1092
- C.current = y, se(y);
1093
- }, []), A = f === "custom", O = f === !0, W = U(() => Ue(e), [e]), I = W !== null, ae = U(() => P === "mobile" ? (g == null ? void 0 : g.mobile) ?? "9/16" : (g == null ? void 0 : g.desktop) ?? "16/9", [P, g]), le = U(() => P === "mobile" ? (p == null ? void 0 : p.mobile) ?? "420px" : (p == null ? void 0 : p.desktop) ?? "960px", [P, p]), ie = U(
1094
- () => W ? Oe(W, {
1095
- autoPlay: o,
1096
- muted: l,
1097
- loop: m,
1226
+ const w = H(null), U = H(null), [V, v] = k(r), [S, T] = k(!1), [D, W] = k(!1), [R, F] = k([]), [Z, q] = k(-1), [h, L] = k([]), [B, N] = k(-1), [y, _] = k(-1), [ie, ce] = k(null), [ue, de] = k(null), he = M((E) => {
1227
+ w.current = E, de(E);
1228
+ }, []), O = C === !0 || C === "custom", J = C === "native", Q = K(() => et(e), [e]), A = Q !== null, pe = K(() => V === "mobile" ? (a == null ? void 0 : a.mobile) ?? "9/16" : (a == null ? void 0 : a.desktop) ?? "16/9", [V, a]), me = K(() => V === "mobile" ? (o == null ? void 0 : o.mobile) ?? "420px" : (o == null ? void 0 : o.desktop) ?? "960px", [V, o]), fe = K(
1229
+ () => Q ? nt(Q, {
1230
+ autoPlay: b,
1231
+ muted: p,
1232
+ loop: d,
1098
1233
  // Custom controls can't drive an iframe, so YouTube falls
1099
1234
  // back to its own controls in that mode.
1100
- controls: A ? !0 : O,
1101
- startSeconds: _e(e)
1235
+ controls: O ? !0 : J,
1236
+ startSeconds: tt(e)
1102
1237
  }) : null,
1103
- [W, e, o, l, m, A, O]
1104
- ), ce = S((y) => {
1105
- T(y), z(-1);
1106
- }, []), j = S(async () => {
1107
- const y = C.current;
1108
- if (y) {
1109
- if (N.current)
1238
+ [Q, e, b, p, d, O, J]
1239
+ ), ge = M((E) => {
1240
+ F(E), q(-1);
1241
+ }, []), ve = M((E) => {
1242
+ L(E), _(-1);
1243
+ }, []), Y = M(async () => {
1244
+ const E = w.current;
1245
+ if (E) {
1246
+ if (U.current)
1110
1247
  try {
1111
- await N.current;
1248
+ await U.current;
1112
1249
  } catch {
1113
1250
  }
1114
- y.pause();
1251
+ E.pause();
1115
1252
  }
1116
- }, []), Z = S(async () => {
1117
- const y = C.current;
1118
- if (y)
1253
+ }, []), z = M(async () => {
1254
+ const E = w.current;
1255
+ if (E)
1119
1256
  try {
1120
- y.readyState < 2 && y.load();
1121
- const Y = y.play();
1122
- N.current = Y, await Y, h(!0);
1257
+ E.readyState < 2 && E.load();
1258
+ const te = E.play();
1259
+ U.current = te, await te, T(!0);
1123
1260
  } catch {
1124
- h(!1);
1261
+ T(!1);
1125
1262
  } finally {
1126
- N.current = null;
1263
+ U.current = null;
1127
1264
  }
1128
- }, []), ue = S(() => {
1129
- !i || I || Z();
1130
- }, [i, I, Z]), de = S(() => {
1131
- !i || I || j().then(() => h(!1));
1132
- }, [i, I, j]), F = S(async () => {
1133
- const y = C.current;
1134
- y && (y.paused ? await Z() : (await j(), h(!1)));
1135
- }, [Z, j]), he = !I && b.length > 1;
1265
+ }, []), ke = M(() => {
1266
+ !l || A || z();
1267
+ }, [l, A, z]), be = M(() => {
1268
+ !l || A || Y().then(() => T(!1));
1269
+ }, [l, A, Y]), X = M(async () => {
1270
+ const E = w.current;
1271
+ E && (E.paused ? await z() : (await Y(), T(!1)));
1272
+ }, [z, Y]), Ce = !A && R.length > 1;
1136
1273
  return (
1137
1274
  // The mouse handlers are a progressive enhancement (hoverPlay + tooltip).
1138
1275
  // Keyboard/click users reach the same actions via the inner <button> elements,
1139
1276
  // so the outer container is intentionally non-interactive at the role level.
1140
1277
  // NOSONAR: typescript:S6848
1141
- /* @__PURE__ */ v(
1278
+ /* @__PURE__ */ g(
1142
1279
  "div",
1143
1280
  {
1144
- ref: ne,
1145
- className: H("gvp-root", a),
1146
- style: { width: le, aspectRatio: ae },
1281
+ ref: ce,
1282
+ className: I("gvp-root", c),
1283
+ style: { width: me, aspectRatio: pe },
1147
1284
  onMouseEnter: () => {
1148
- M(!0), ue();
1285
+ W(!0), ke();
1149
1286
  },
1150
1287
  onMouseLeave: () => {
1151
- M(!1), de();
1288
+ W(!1), be();
1152
1289
  },
1153
1290
  children: [
1154
- I ? /* @__PURE__ */ t(
1291
+ A ? /* @__PURE__ */ t(
1155
1292
  "iframe",
1156
1293
  {
1157
1294
  className: "gvp-video gvp-youtube",
1158
- src: ie ?? void 0,
1295
+ src: fe ?? void 0,
1159
1296
  title: "YouTube video player",
1160
1297
  allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
1161
1298
  allowFullScreen: !0,
1162
1299
  referrerPolicy: "strict-origin-when-cross-origin"
1163
1300
  }
1164
1301
  ) : /* @__PURE__ */ t(
1165
- ee,
1302
+ le,
1166
1303
  {
1167
- ref: oe,
1304
+ ref: he,
1168
1305
  src: e,
1169
1306
  poster: n,
1170
- muted: l,
1171
- loop: m,
1307
+ muted: p,
1308
+ loop: d,
1172
1309
  playsInline: !0,
1173
1310
  preload: "metadata",
1174
- controls: O,
1175
- autoPlay: o,
1176
- hlsConfig: d,
1311
+ controls: J,
1312
+ autoPlay: b,
1313
+ hlsConfig: m,
1177
1314
  className: "gvp-video",
1178
- onPlay: () => h(!0),
1179
- onPause: () => h(!1),
1180
- onAudioTracks: ce,
1181
- audioTrackIndex: _,
1182
- children: w
1315
+ onPlay: () => T(!0),
1316
+ onPause: () => T(!1),
1317
+ onAudioTracks: ge,
1318
+ audioTrackIndex: Z,
1319
+ onQualityLevels: ve,
1320
+ onCurrentLevel: N,
1321
+ qualityLevelIndex: y,
1322
+ children: f
1183
1323
  }
1184
1324
  ),
1185
- !I && /* @__PURE__ */ t("div", { className: "gvp-vignette" }),
1186
- s && /* @__PURE__ */ t("div", { className: "gvp-toggle", children: /* @__PURE__ */ v("div", { className: "gvp-toggle-pill", children: [
1325
+ !A && /* @__PURE__ */ t("div", { className: "gvp-vignette" }),
1326
+ s && /* @__PURE__ */ t("div", { className: "gvp-toggle", children: /* @__PURE__ */ g("div", { className: "gvp-toggle-pill", children: [
1187
1327
  /* @__PURE__ */ t(
1188
1328
  "button",
1189
1329
  {
1190
1330
  type: "button",
1191
- onClick: () => R("desktop"),
1192
- className: H(
1331
+ onClick: () => v("desktop"),
1332
+ className: I(
1193
1333
  "gvp-toggle-btn",
1194
- P === "desktop" && "is-active"
1334
+ V === "desktop" && "is-active"
1195
1335
  ),
1196
1336
  "aria-label": "Desktop view",
1197
- "aria-pressed": P === "desktop",
1198
- children: /* @__PURE__ */ t(fe, {})
1337
+ "aria-pressed": V === "desktop",
1338
+ children: /* @__PURE__ */ t(ye, {})
1199
1339
  }
1200
1340
  ),
1201
1341
  /* @__PURE__ */ t("div", { className: "gvp-toggle-divider" }),
@@ -1203,78 +1343,82 @@ const Fe = ({
1203
1343
  "button",
1204
1344
  {
1205
1345
  type: "button",
1206
- onClick: () => R("mobile"),
1207
- className: H(
1346
+ onClick: () => v("mobile"),
1347
+ className: I(
1208
1348
  "gvp-toggle-btn",
1209
- P === "mobile" && "is-active"
1349
+ V === "mobile" && "is-active"
1210
1350
  ),
1211
1351
  "aria-label": "Mobile view",
1212
- "aria-pressed": P === "mobile",
1213
- children: /* @__PURE__ */ t(ge, {})
1352
+ "aria-pressed": V === "mobile",
1353
+ children: /* @__PURE__ */ t(Ee, {})
1214
1354
  }
1215
1355
  )
1216
1356
  ] }) }),
1217
- c && /* @__PURE__ */ t(
1357
+ u && /* @__PURE__ */ t(
1218
1358
  "button",
1219
1359
  {
1220
1360
  type: "button",
1221
- onClick: c,
1361
+ onClick: u,
1222
1362
  className: "gvp-close",
1223
1363
  "aria-label": "Close",
1224
- children: /* @__PURE__ */ t(ve, {})
1364
+ children: /* @__PURE__ */ t(xe, {})
1225
1365
  }
1226
1366
  ),
1227
- he && /* @__PURE__ */ t(
1228
- Fe,
1367
+ Ce && /* @__PURE__ */ t(
1368
+ rt,
1229
1369
  {
1230
- tracks: b,
1231
- activeIndex: _ >= 0 ? _ : b[0].index,
1232
- onSelect: z
1370
+ tracks: R,
1371
+ activeIndex: Z >= 0 ? Z : R[0].index,
1372
+ onSelect: q
1233
1373
  }
1234
1374
  ),
1235
- !I && A && /* @__PURE__ */ t(
1375
+ !A && O && /* @__PURE__ */ t(
1236
1376
  "button",
1237
1377
  {
1238
1378
  type: "button",
1239
1379
  className: "gvp-click-layer",
1240
- onClick: () => void F(),
1241
- "aria-label": D ? "Pause" : "Play"
1380
+ onClick: () => void X(),
1381
+ "aria-label": S ? "Pause" : "Play"
1242
1382
  }
1243
1383
  ),
1244
- !I && !A && !D && /* @__PURE__ */ t("div", { className: "gvp-play-wrap", children: /* @__PURE__ */ v(
1384
+ !A && !O && !S && /* @__PURE__ */ t("div", { className: "gvp-play-wrap", children: /* @__PURE__ */ g(
1245
1385
  "button",
1246
1386
  {
1247
1387
  type: "button",
1248
- onClick: () => void F(),
1249
- onMouseEnter: () => M(!0),
1250
- onMouseLeave: () => M(!1),
1388
+ onClick: () => void X(),
1389
+ onMouseEnter: () => W(!0),
1390
+ onMouseLeave: () => W(!1),
1251
1391
  className: "gvp-play",
1252
1392
  "aria-label": "Play",
1253
1393
  children: [
1254
- /* @__PURE__ */ t(ke, {}),
1255
- u && E && /* @__PURE__ */ t("span", { className: "gvp-tooltip", role: "tooltip", children: u })
1394
+ /* @__PURE__ */ t(Ne, {}),
1395
+ i && D && /* @__PURE__ */ t("span", { className: "gvp-tooltip", role: "tooltip", children: i })
1256
1396
  ]
1257
1397
  }
1258
1398
  ) }),
1259
- !I && A && /* @__PURE__ */ t(
1260
- He,
1399
+ !A && O && /* @__PURE__ */ t(
1400
+ Ze,
1261
1401
  {
1262
- video: re,
1263
- isPlaying: D,
1264
- container: te,
1265
- onTogglePlay: () => void F()
1402
+ video: ue,
1403
+ isPlaying: S,
1404
+ container: ie,
1405
+ onTogglePlay: () => void X(),
1406
+ qualityLevels: h,
1407
+ currentLevel: B,
1408
+ selectedLevel: y,
1409
+ onSelectLevel: _
1266
1410
  }
1267
1411
  ),
1268
- !I && !A && /* @__PURE__ */ t("div", { className: "gvp-bottom-fade" })
1412
+ !A && !O && /* @__PURE__ */ t("div", { className: "gvp-bottom-fade" })
1269
1413
  ]
1270
1414
  }
1271
1415
  )
1272
1416
  );
1273
1417
  };
1274
1418
  export {
1275
- Ke as ReactVideoPlayer,
1276
- Ue as parseYouTubeId,
1277
- _e as parseYouTubeStart,
1278
- Oe as youTubeEmbedUrl
1419
+ lt as ReactVideoPlayer,
1420
+ et as parseYouTubeId,
1421
+ tt as parseYouTubeStart,
1422
+ nt as youTubeEmbedUrl
1279
1423
  };
1280
1424
  //# sourceMappingURL=index.mjs.map