@glitchlab/vue-video-player 1.5.0 → 1.6.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.
Files changed (35) hide show
  1. package/README.md +112 -15
  2. package/dist/HLSPlayer.vue.d.ts +4 -0
  3. package/dist/HLSPlayer.vue.d.ts.map +1 -1
  4. package/dist/VideoPlayer.vue.d.ts +9 -0
  5. package/dist/VideoPlayer.vue.d.ts.map +1 -1
  6. package/dist/components/ControlBar.vue.d.ts +24 -0
  7. package/dist/components/ControlBar.vue.d.ts.map +1 -1
  8. package/dist/components/{IconQuality.vue.d.ts → IconAlert.vue.d.ts} +1 -1
  9. package/dist/components/IconAlert.vue.d.ts.map +1 -0
  10. package/dist/components/IconCheck.vue.d.ts +16 -0
  11. package/dist/components/IconCheck.vue.d.ts.map +1 -0
  12. package/dist/components/IconChevronRight.vue.d.ts +16 -0
  13. package/dist/components/IconChevronRight.vue.d.ts.map +1 -0
  14. package/dist/components/IconGear.vue.d.ts +16 -0
  15. package/dist/components/IconGear.vue.d.ts.map +1 -0
  16. package/dist/components/IconRefresh.vue.d.ts +16 -0
  17. package/dist/components/{IconQuality.vue.d.ts.map → IconRefresh.vue.d.ts.map} +1 -1
  18. package/dist/components/SettingsMenu.vue.d.ts +61 -0
  19. package/dist/components/SettingsMenu.vue.d.ts.map +1 -0
  20. package/dist/index.cjs +3 -3
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.ts +2 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.mjs +1767 -1276
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/style.css +1 -1
  27. package/dist/utils/caption-style.d.ts +17 -0
  28. package/dist/utils/caption-style.d.ts.map +1 -0
  29. package/dist/utils/preferences.d.ts +26 -0
  30. package/dist/utils/preferences.d.ts.map +1 -0
  31. package/dist/utils/theme.d.ts +15 -0
  32. package/dist/utils/theme.d.ts.map +1 -0
  33. package/dist/utils/types.d.ts +46 -0
  34. package/dist/utils/types.d.ts.map +1 -1
  35. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,27 +1,27 @@
1
- import { defineComponent as I, ref as y, onMounted as He, watch as R, onBeforeUnmount as ne, openBlock as d, createElementBlock as f, normalizeClass as w, renderSlot as Fe, createElementVNode as r, computed as T, createVNode as Z, toDisplayString as U, Fragment as ie, renderList as ue, createCommentVNode as M, createBlock as z, normalizeStyle as re, withDirectives as We, vShow as ze, unref as te, withCtx as Ye } from "vue";
2
- import ee from "hls.js";
3
- function Ve(t, a, n) {
4
- const e = t == null ? void 0 : t.trim();
5
- if (e) return e;
6
- if (a) {
1
+ import { defineComponent as N, ref as g, onMounted as He, watch as V, onBeforeUnmount as ae, openBlock as r, createElementBlock as c, normalizeClass as L, renderSlot as Ue, createElementVNode as a, computed as I, createVNode as O, toDisplayString as Z, Fragment as oe, renderList as pe, createCommentVNode as x, createBlock as J, unref as le, normalizeStyle as ce, withDirectives as at, vShow as rt, withCtx as it } from "vue";
2
+ import se from "hls.js";
3
+ function De(e, s, t) {
4
+ const n = e == null ? void 0 : e.trim();
5
+ if (n) return n;
6
+ if (s) {
7
7
  try {
8
- const o = new Intl.DisplayNames(void 0, { type: "language" }).of(a);
9
- if (o && o !== a) return o;
8
+ const v = new Intl.DisplayNames(void 0, { type: "language" }).of(s);
9
+ if (v && v !== s) return v;
10
10
  } catch {
11
11
  }
12
- return a;
12
+ return s;
13
13
  }
14
- return `Audio ${n + 1}`;
14
+ return `Audio ${t + 1}`;
15
15
  }
16
- const Ke = {
16
+ const ut = {
17
17
  index: -1,
18
18
  height: 0,
19
19
  label: "Auto"
20
20
  };
21
- function Xe(t, a) {
22
- return t > 0 ? `${t}p` : `Level ${a + 1}`;
21
+ function ct(e, s) {
22
+ return e > 0 ? `${e}p` : `Level ${s + 1}`;
23
23
  }
24
- const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "poster"], Ge = /* @__PURE__ */ I({
24
+ const dt = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "poster"], vt = /* @__PURE__ */ N({
25
25
  __name: "HLSPlayer",
26
26
  props: {
27
27
  src: {},
@@ -38,148 +38,153 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
38
38
  audioTrackIndex: { default: -1 },
39
39
  qualityLevelIndex: { default: -1 }
40
40
  },
41
- emits: ["play", "pause", "ended", "audio-tracks", "quality-levels", "current-level"],
42
- setup(t, { expose: a, emit: n }) {
43
- const e = t, c = n, o = y(null), h = y(null);
44
- let g, E;
45
- const _ = globalThis.window !== void 0 && ee.isSupported(), $ = (p) => !!e.isHls || _ && p.endsWith(".m3u8");
46
- function S() {
47
- E == null || E(), E = void 0, g == null || g(), g = void 0, h.value && (h.value.destroy(), h.value = null);
48
- const p = o.value;
49
- if (p) {
50
- for (p.pause(), p.removeAttribute("src"); p.firstChild; ) p.firstChild.remove();
51
- p.load(), c("audio-tracks", []), c("quality-levels", []), c("current-level", -1);
41
+ emits: ["play", "pause", "ended", "fatal-error", "live-change", "audio-tracks", "quality-levels", "current-level"],
42
+ setup(e, { expose: s, emit: t }) {
43
+ const n = e, o = t, v = g(null), d = g(null);
44
+ let h, E;
45
+ const A = globalThis.window !== void 0 && se.isSupported(), S = (f) => !!n.isHls || A && f.endsWith(".m3u8");
46
+ function P() {
47
+ E == null || E(), E = void 0, h == null || h(), h = void 0, d.value && (d.value.destroy(), d.value = null);
48
+ const f = v.value;
49
+ if (f) {
50
+ for (f.pause(), f.removeAttribute("src"); f.firstChild; ) f.firstChild.remove();
51
+ f.load(), o("audio-tracks", []), o("quality-levels", []), o("current-level", -1), o("live-change", !1);
52
52
  }
53
53
  }
54
- function b(p) {
55
- var Y, A, J;
56
- const x = o.value;
57
- if (!x || !p) return;
58
- S();
59
- const B = () => {
60
- e.autoPlay && x.play().catch(() => {
54
+ function w(f) {
55
+ var j, K, re;
56
+ const M = v.value;
57
+ if (!M || !f) return;
58
+ P();
59
+ const z = () => {
60
+ n.autoPlay && M.play().catch(() => {
61
61
  });
62
62
  };
63
- if ($(p)) {
64
- const k = new ee(e.hlsConfig);
65
- h.value = k;
66
- const N = () => {
67
- const H = k.audioTracks.map((V, O) => ({
68
- index: O,
69
- label: Ve(V.name, V.lang, O),
70
- lang: V.lang || void 0
63
+ if (S(f)) {
64
+ const C = new se(n.hlsConfig);
65
+ d.value = C;
66
+ const W = () => {
67
+ const F = C.audioTracks.map((H, R) => ({
68
+ index: R,
69
+ label: De(H.name, H.lang, R),
70
+ lang: H.lang || void 0
71
71
  }));
72
- c("audio-tracks", H);
73
- }, D = () => {
74
- const H = k.levels.map((V, O) => ({
75
- index: O,
76
- height: V.height || 0,
77
- label: Xe(V.height || 0, O)
72
+ o("audio-tracks", F);
73
+ }, B = () => {
74
+ const F = C.levels.map((H, R) => ({
75
+ index: R,
76
+ height: H.height || 0,
77
+ label: ct(H.height || 0, R)
78
78
  }));
79
- c("quality-levels", H);
79
+ o("quality-levels", F);
80
80
  };
81
- k.on(ee.Events.MANIFEST_PARSED, B), k.on(ee.Events.MANIFEST_PARSED, D), k.on(ee.Events.LEVELS_UPDATED, D), k.on(ee.Events.LEVEL_SWITCHED, (H, V) => {
82
- c("current-level", V.level);
83
- }), k.on(ee.Events.AUDIO_TRACKS_UPDATED, N), k.on(ee.Events.AUDIO_TRACK_SWITCHED, N), k.on(ee.Events.ERROR, (H, V) => {
84
- V.fatal && (k.destroy(), h.value = null);
85
- }), k.attachMedia(x), k.loadSource(p);
81
+ C.on(se.Events.MANIFEST_PARSED, z), C.on(se.Events.MANIFEST_PARSED, B), C.on(se.Events.LEVELS_UPDATED, B), C.on(se.Events.LEVEL_SWITCHED, (F, H) => {
82
+ o("current-level", H.level);
83
+ }), C.on(se.Events.AUDIO_TRACKS_UPDATED, W), C.on(se.Events.AUDIO_TRACK_SWITCHED, W), C.on(se.Events.LEVEL_LOADED, (F, H) => {
84
+ var R;
85
+ o("live-change", !!((R = H.details) != null && R.live));
86
+ });
87
+ let D = !1;
88
+ C.on(se.Events.ERROR, (F, H) => {
89
+ H.fatal && (H.type === se.ErrorTypes.NETWORK_ERROR && !D ? (D = !0, C.startLoad()) : H.type === se.ErrorTypes.MEDIA_ERROR && !D ? (D = !0, C.recoverMediaError()) : (C.destroy(), d.value = null, o("fatal-error")));
90
+ }), C.attachMedia(M), C.loadSource(f);
86
91
  } else {
87
- x.src = p, x.load(), x.addEventListener("loadedmetadata", B, { once: !0 }), E = () => {
88
- x.removeEventListener("loadedmetadata", B);
92
+ M.src = f, M.load(), M.addEventListener("loadedmetadata", z, { once: !0 }), E = () => {
93
+ M.removeEventListener("loadedmetadata", z);
89
94
  };
90
- const k = x.audioTracks;
91
- if (k) {
92
- const N = () => {
93
- const D = [];
94
- for (let H = 0; H < k.length; H++) {
95
- const V = k[H];
96
- D.push({
97
- index: H,
98
- label: Ve(V.label, V.language, H),
99
- lang: V.language || void 0
95
+ const C = M.audioTracks;
96
+ if (C) {
97
+ const W = () => {
98
+ const B = [];
99
+ for (let D = 0; D < C.length; D++) {
100
+ const F = C[D];
101
+ B.push({
102
+ index: D,
103
+ label: De(F.label, F.language, D),
104
+ lang: F.language || void 0
100
105
  });
101
106
  }
102
- c("audio-tracks", D);
107
+ o("audio-tracks", B);
103
108
  };
104
- (Y = k.addEventListener) == null || Y.call(k, "addtrack", N), (A = k.addEventListener) == null || A.call(k, "removetrack", N), (J = k.addEventListener) == null || J.call(k, "change", N), k.length > 0 && N(), g = () => {
105
- var D, H, V;
106
- (D = k.removeEventListener) == null || D.call(k, "addtrack", N), (H = k.removeEventListener) == null || H.call(k, "removetrack", N), (V = k.removeEventListener) == null || V.call(k, "change", N);
109
+ (j = C.addEventListener) == null || j.call(C, "addtrack", W), (K = C.addEventListener) == null || K.call(C, "removetrack", W), (re = C.addEventListener) == null || re.call(C, "change", W), C.length > 0 && W(), h = () => {
110
+ var B, D, F;
111
+ (B = C.removeEventListener) == null || B.call(C, "addtrack", W), (D = C.removeEventListener) == null || D.call(C, "removetrack", W), (F = C.removeEventListener) == null || F.call(C, "change", W);
107
112
  };
108
113
  }
109
114
  }
110
115
  }
111
- function m(p) {
112
- var Y;
113
- if (p == null || p < 0) return;
114
- const x = h.value;
115
- if (x) {
116
- x.audioTrack !== p && (x.audioTrack = p);
116
+ function $(f) {
117
+ var j;
118
+ if (f == null || f < 0) return;
119
+ const M = d.value;
120
+ if (M) {
121
+ M.audioTrack !== f && (M.audioTrack = f);
117
122
  return;
118
123
  }
119
- const B = (Y = o.value) == null ? void 0 : Y.audioTracks;
120
- if (B)
121
- for (let A = 0; A < B.length; A++)
122
- B[A].enabled = A === p;
124
+ const z = (j = v.value) == null ? void 0 : j.audioTracks;
125
+ if (z)
126
+ for (let K = 0; K < z.length; K++)
127
+ z[K].enabled = K === f;
123
128
  }
124
- function C(p) {
125
- if (p == null) return;
126
- const x = h.value;
127
- x && x.currentLevel !== p && (x.currentLevel = p);
129
+ function T(f) {
130
+ if (f == null) return;
131
+ const M = d.value;
132
+ M && M.currentLevel !== f && (M.currentLevel = f);
128
133
  }
129
134
  return He(() => {
130
- e.src && b(e.src);
131
- }), R(
132
- () => e.src,
133
- (p) => {
134
- p && b(p);
135
+ n.src && w(n.src);
136
+ }), V(
137
+ () => n.src,
138
+ (f) => {
139
+ f && w(f);
135
140
  }
136
- ), R(
137
- () => e.audioTrackIndex,
138
- (p) => m(p)
139
- ), R(
140
- () => e.qualityLevelIndex,
141
- (p) => C(p)
142
- ), ne(S), a({ videoEl: o }), (p, x) => (d(), f("video", {
141
+ ), V(
142
+ () => n.audioTrackIndex,
143
+ (f) => $(f)
144
+ ), V(
145
+ () => n.qualityLevelIndex,
146
+ (f) => T(f)
147
+ ), ae(P), s({ videoEl: v }), (f, M) => (r(), c("video", {
143
148
  ref_key: "videoEl",
144
- ref: o,
145
- muted: t.muted,
146
- loop: t.loop,
147
- controls: t.controls,
148
- autoplay: t.autoPlay,
149
- playsinline: t.playsInline,
150
- preload: t.preload,
151
- poster: t.poster,
152
- class: w(e.class),
153
- onPlay: x[0] || (x[0] = (B) => c("play")),
154
- onPause: x[1] || (x[1] = (B) => c("pause")),
155
- onEnded: x[2] || (x[2] = (B) => c("ended"))
149
+ ref: v,
150
+ muted: e.muted,
151
+ loop: e.loop,
152
+ controls: e.controls,
153
+ autoplay: e.autoPlay,
154
+ playsinline: e.playsInline,
155
+ preload: e.preload,
156
+ poster: e.poster,
157
+ class: L(n.class),
158
+ onPlay: M[0] || (M[0] = (z) => o("play")),
159
+ onPause: M[1] || (M[1] = (z) => o("pause")),
160
+ onEnded: M[2] || (M[2] = (z) => o("ended"))
156
161
  }, [
157
- Fe(p.$slots, "default")
158
- ], 42, Je));
162
+ Ue(f.$slots, "default")
163
+ ], 42, dt));
159
164
  }
160
- }), et = { name: "IconAudio" }, tt = /* @__PURE__ */ I({
161
- ...et,
165
+ }), pt = { name: "IconAudio" }, ft = /* @__PURE__ */ N({
166
+ ...pt,
162
167
  props: {
163
168
  class: {}
164
169
  },
165
- setup(t) {
166
- const a = t;
167
- return (n, e) => (d(), f("svg", {
168
- class: w(["gvp-icon", a.class]),
170
+ setup(e) {
171
+ const s = e;
172
+ return (t, n) => (r(), c("svg", {
173
+ class: L(["gvp-icon", s.class]),
169
174
  width: "16",
170
175
  height: "16",
171
176
  viewBox: "0 0 24 24",
172
177
  fill: "none",
173
178
  xmlns: "http://www.w3.org/2000/svg",
174
179
  "aria-hidden": "true"
175
- }, [...e[0] || (e[0] = [
176
- r("path", {
180
+ }, [...n[0] || (n[0] = [
181
+ a("path", {
177
182
  d: "M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",
178
183
  stroke: "currentColor",
179
184
  "stroke-width": "1.5",
180
185
  "stroke-linejoin": "round"
181
186
  }, null, -1),
182
- r("path", {
187
+ a("path", {
183
188
  d: "M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",
184
189
  stroke: "currentColor",
185
190
  "stroke-width": "1.5",
@@ -187,23 +192,23 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
187
192
  }, null, -1)
188
193
  ])], 2));
189
194
  }
190
- }), nt = { name: "IconChevron" }, Re = /* @__PURE__ */ I({
191
- ...nt,
195
+ }), mt = { name: "IconChevron" }, Ze = /* @__PURE__ */ N({
196
+ ...mt,
192
197
  props: {
193
198
  class: {}
194
199
  },
195
- setup(t) {
196
- const a = t;
197
- return (n, e) => (d(), f("svg", {
198
- class: w(["gvp-icon", a.class]),
200
+ setup(e) {
201
+ const s = e;
202
+ return (t, n) => (r(), c("svg", {
203
+ class: L(["gvp-icon", s.class]),
199
204
  width: "12",
200
205
  height: "12",
201
206
  viewBox: "0 0 24 24",
202
207
  fill: "none",
203
208
  xmlns: "http://www.w3.org/2000/svg",
204
209
  "aria-hidden": "true"
205
- }, [...e[0] || (e[0] = [
206
- r("path", {
210
+ }, [...n[0] || (n[0] = [
211
+ a("path", {
207
212
  d: "M6 9L12 15L18 9",
208
213
  stroke: "currentColor",
209
214
  "stroke-width": "2",
@@ -212,93 +217,93 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
212
217
  }, null, -1)
213
218
  ])], 2));
214
219
  }
215
- }), lt = ["aria-expanded"], at = { class: "gvp-audio-label" }, ot = {
220
+ }), gt = ["aria-expanded"], ht = { class: "gvp-audio-label" }, kt = {
216
221
  key: 0,
217
222
  class: "gvp-audio-menu",
218
223
  role: "listbox",
219
224
  "aria-label": "Audio tracks"
220
- }, st = ["aria-selected", "onClick"], rt = /* @__PURE__ */ I({
225
+ }, yt = ["aria-selected", "onClick"], bt = /* @__PURE__ */ N({
221
226
  __name: "AudioTrackSwitcher",
222
227
  props: {
223
228
  tracks: {},
224
229
  activeIndex: {}
225
230
  },
226
231
  emits: ["select"],
227
- setup(t, { emit: a }) {
228
- const n = t, e = a, c = y(!1), o = y(null), h = T(
229
- () => n.tracks.find(($) => $.index === n.activeIndex) ?? n.tracks[0]
232
+ setup(e, { emit: s }) {
233
+ const t = e, n = s, o = g(!1), v = g(null), d = I(
234
+ () => t.tracks.find((S) => S.index === t.activeIndex) ?? t.tracks[0]
230
235
  );
231
- function g($) {
232
- o.value && !o.value.contains($.target) && (c.value = !1);
236
+ function h(S) {
237
+ v.value && !v.value.contains(S.target) && (o.value = !1);
233
238
  }
234
- function E($) {
235
- $.key === "Escape" && (c.value = !1);
239
+ function E(S) {
240
+ S.key === "Escape" && (o.value = !1);
236
241
  }
237
- R(c, ($) => {
238
- $ ? (document.addEventListener("mousedown", g), document.addEventListener("keydown", E)) : (document.removeEventListener("mousedown", g), document.removeEventListener("keydown", E));
239
- }), ne(() => {
240
- document.removeEventListener("mousedown", g), document.removeEventListener("keydown", E);
242
+ V(o, (S) => {
243
+ S ? (document.addEventListener("mousedown", h), document.addEventListener("keydown", E)) : (document.removeEventListener("mousedown", h), document.removeEventListener("keydown", E));
244
+ }), ae(() => {
245
+ document.removeEventListener("mousedown", h), document.removeEventListener("keydown", E);
241
246
  });
242
- function _($) {
243
- e("select", $), c.value = !1;
247
+ function A(S) {
248
+ n("select", S), o.value = !1;
244
249
  }
245
- return ($, S) => {
246
- var b;
247
- return d(), f("div", {
250
+ return (S, P) => {
251
+ var w;
252
+ return r(), c("div", {
248
253
  ref_key: "rootEl",
249
- ref: o,
254
+ ref: v,
250
255
  class: "gvp-audio"
251
256
  }, [
252
- r("button", {
257
+ a("button", {
253
258
  type: "button",
254
259
  class: "gvp-audio-btn",
255
260
  "aria-haspopup": "listbox",
256
- "aria-expanded": c.value,
261
+ "aria-expanded": o.value,
257
262
  "aria-label": "Audio track",
258
- onClick: S[0] || (S[0] = (m) => c.value = !c.value)
263
+ onClick: P[0] || (P[0] = ($) => o.value = !o.value)
259
264
  }, [
260
- Z(tt),
261
- r("span", at, U((b = h.value) == null ? void 0 : b.label), 1),
262
- Z(Re)
263
- ], 8, lt),
264
- c.value ? (d(), f("ul", ot, [
265
- (d(!0), f(ie, null, ue(t.tracks, (m) => (d(), f("li", {
266
- key: m.index
265
+ O(ft),
266
+ a("span", ht, Z((w = d.value) == null ? void 0 : w.label), 1),
267
+ O(Ze)
268
+ ], 8, gt),
269
+ o.value ? (r(), c("ul", kt, [
270
+ (r(!0), c(oe, null, pe(e.tracks, ($) => (r(), c("li", {
271
+ key: $.index
267
272
  }, [
268
- r("button", {
273
+ a("button", {
269
274
  type: "button",
270
275
  role: "option",
271
- "aria-selected": m.index === t.activeIndex,
272
- class: w(["gvp-audio-menu-item", { "is-active": m.index === t.activeIndex }]),
273
- onClick: (C) => _(m.index)
274
- }, U(m.label), 11, st)
276
+ "aria-selected": $.index === e.activeIndex,
277
+ class: L(["gvp-audio-menu-item", { "is-active": $.index === e.activeIndex }]),
278
+ onClick: (T) => A($.index)
279
+ }, Z($.label), 11, yt)
275
280
  ]))), 128))
276
- ])) : M("", !0)
281
+ ])) : x("", !0)
277
282
  ], 512);
278
283
  };
279
284
  }
280
- }), it = { name: "IconSpeed" }, Oe = /* @__PURE__ */ I({
281
- ...it,
285
+ }), wt = { name: "IconSpeed" }, xt = /* @__PURE__ */ N({
286
+ ...wt,
282
287
  props: {
283
288
  class: {}
284
289
  },
285
- setup(t) {
286
- const a = t;
287
- return (n, e) => (d(), f("svg", {
288
- class: w(["gvp-icon", a.class]),
290
+ setup(e) {
291
+ const s = e;
292
+ return (t, n) => (r(), c("svg", {
293
+ class: L(["gvp-icon", s.class]),
289
294
  width: "16",
290
295
  height: "16",
291
296
  viewBox: "0 0 24 24",
292
297
  fill: "none",
293
298
  xmlns: "http://www.w3.org/2000/svg",
294
299
  "aria-hidden": "true"
295
- }, [...e[0] || (e[0] = [
296
- r("path", {
300
+ }, [...n[0] || (n[0] = [
301
+ a("path", {
297
302
  d: "M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z",
298
303
  stroke: "currentColor",
299
304
  "stroke-width": "1.5"
300
305
  }, null, -1),
301
- r("path", {
306
+ a("path", {
302
307
  d: "M12 8V12L14.5 14.5",
303
308
  stroke: "currentColor",
304
309
  "stroke-width": "1.5",
@@ -307,80 +312,80 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
307
312
  }, null, -1)
308
313
  ])], 2));
309
314
  }
310
- }), ut = ["aria-expanded"], ct = { class: "gvp-speed-label" }, dt = {
315
+ }), Ct = ["aria-expanded"], Lt = { class: "gvp-speed-label" }, $t = {
311
316
  key: 0,
312
317
  class: "gvp-speed-menu",
313
318
  role: "listbox",
314
319
  "aria-label": "Playback speed"
315
- }, vt = ["aria-selected", "onClick"], pt = /* @__PURE__ */ I({
320
+ }, Et = ["aria-selected", "onClick"], _t = /* @__PURE__ */ N({
316
321
  __name: "SpeedSwitcher",
317
322
  props: {
318
323
  speed: {}
319
324
  },
320
325
  emits: ["select"],
321
- setup(t, { emit: a }) {
322
- const n = [0.5, 0.75, 1, 1.25, 1.5, 2], e = a, c = y(!1), o = y(null);
323
- function h(_) {
324
- o.value && !o.value.contains(_.target) && (c.value = !1);
325
- }
326
- function g(_) {
327
- _.key === "Escape" && (c.value = !1);
328
- }
329
- R(c, (_) => {
330
- _ ? (document.addEventListener("mousedown", h), document.addEventListener("keydown", g)) : (document.removeEventListener("mousedown", h), document.removeEventListener("keydown", g));
331
- }), ne(() => {
332
- document.removeEventListener("mousedown", h), document.removeEventListener("keydown", g);
326
+ setup(e, { emit: s }) {
327
+ const t = [0.5, 0.75, 1, 1.25, 1.5, 2], n = s, o = g(!1), v = g(null);
328
+ function d(A) {
329
+ v.value && !v.value.contains(A.target) && (o.value = !1);
330
+ }
331
+ function h(A) {
332
+ A.key === "Escape" && (o.value = !1);
333
+ }
334
+ V(o, (A) => {
335
+ A ? (document.addEventListener("mousedown", d), document.addEventListener("keydown", h)) : (document.removeEventListener("mousedown", d), document.removeEventListener("keydown", h));
336
+ }), ae(() => {
337
+ document.removeEventListener("mousedown", d), document.removeEventListener("keydown", h);
333
338
  });
334
- function E(_) {
335
- e("select", _), c.value = !1;
339
+ function E(A) {
340
+ n("select", A), o.value = !1;
336
341
  }
337
- return (_, $) => (d(), f("div", {
342
+ return (A, S) => (r(), c("div", {
338
343
  ref_key: "rootEl",
339
- ref: o,
344
+ ref: v,
340
345
  class: "gvp-speed"
341
346
  }, [
342
- r("button", {
347
+ a("button", {
343
348
  type: "button",
344
349
  class: "gvp-speed-btn",
345
350
  "aria-haspopup": "listbox",
346
- "aria-expanded": c.value,
351
+ "aria-expanded": o.value,
347
352
  "aria-label": "`Playback speed: ${speed === 1 ? '1×' : speed + '×'}`",
348
- onClick: $[0] || ($[0] = (S) => c.value = !c.value)
353
+ onClick: S[0] || (S[0] = (P) => o.value = !o.value)
349
354
  }, [
350
- Z(Oe),
351
- r("span", ct, U(t.speed === 1 ? "1×" : `${t.speed}×`), 1),
352
- Z(Re)
353
- ], 8, ut),
354
- c.value ? (d(), f("ul", dt, [
355
- (d(), f(ie, null, ue(n, (S) => r("li", { key: S }, [
356
- r("button", {
355
+ O(xt),
356
+ a("span", Lt, Z(e.speed === 1 ? "1×" : `${e.speed}×`), 1),
357
+ O(Ze)
358
+ ], 8, Ct),
359
+ o.value ? (r(), c("ul", $t, [
360
+ (r(), c(oe, null, pe(t, (P) => a("li", { key: P }, [
361
+ a("button", {
357
362
  type: "button",
358
363
  role: "option",
359
- "aria-selected": S === t.speed,
360
- class: w(["gvp-speed-menu-item", { "is-active": S === t.speed }]),
361
- onClick: (b) => E(S)
362
- }, U(S === 1 ? "Normal" : `${S}×`), 11, vt)
364
+ "aria-selected": P === e.speed,
365
+ class: L(["gvp-speed-menu-item", { "is-active": P === e.speed }]),
366
+ onClick: (w) => E(P)
367
+ }, Z(P === 1 ? "Normal" : `${P}×`), 11, Et)
363
368
  ])), 64))
364
- ])) : M("", !0)
369
+ ])) : x("", !0)
365
370
  ], 512));
366
371
  }
367
- }), ft = { name: "IconCaptions" }, Ue = /* @__PURE__ */ I({
368
- ...ft,
372
+ }), Pt = { name: "IconCaptions" }, Tt = /* @__PURE__ */ N({
373
+ ...Pt,
369
374
  props: {
370
375
  class: {}
371
376
  },
372
- setup(t) {
373
- const a = t;
374
- return (n, e) => (d(), f("svg", {
375
- class: w(["gvp-icon", a.class]),
377
+ setup(e) {
378
+ const s = e;
379
+ return (t, n) => (r(), c("svg", {
380
+ class: L(["gvp-icon", s.class]),
376
381
  width: "18",
377
382
  height: "18",
378
383
  viewBox: "0 0 24 24",
379
384
  fill: "none",
380
385
  xmlns: "http://www.w3.org/2000/svg",
381
386
  "aria-hidden": "true"
382
- }, [...e[0] || (e[0] = [
383
- r("rect", {
387
+ }, [...n[0] || (n[0] = [
388
+ a("rect", {
384
389
  x: "2",
385
390
  y: "5",
386
391
  width: "20",
@@ -389,7 +394,7 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
389
394
  stroke: "currentColor",
390
395
  "stroke-width": "1.5"
391
396
  }, null, -1),
392
- r("path", {
397
+ a("path", {
393
398
  d: "M7 12H11M13 12H17M7 15H9M11 15H13M15 15H17",
394
399
  stroke: "currentColor",
395
400
  "stroke-width": "1.5",
@@ -397,128 +402,128 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
397
402
  }, null, -1)
398
403
  ])], 2));
399
404
  }
400
- }), mt = ["aria-expanded", "aria-pressed"], ht = {
405
+ }), Mt = ["aria-expanded", "aria-pressed"], It = {
401
406
  key: 0,
402
407
  class: "gvp-captions-menu",
403
408
  role: "listbox",
404
409
  "aria-label": "Captions"
405
- }, gt = ["aria-selected"], kt = ["aria-selected", "onClick"], yt = /* @__PURE__ */ I({
410
+ }, At = ["aria-selected"], St = ["aria-selected", "onClick"], Nt = /* @__PURE__ */ N({
406
411
  __name: "CaptionsSwitcher",
407
412
  props: {
408
413
  video: {}
409
414
  },
410
- setup(t) {
411
- const a = t, n = y([]), e = y(-1), c = y(!1), o = y(null);
412
- function h(b) {
413
- const m = [];
414
- for (let p = 0; p < b.length; p++) {
415
- const x = b[p];
416
- (x.kind === "subtitles" || x.kind === "captions") && m.push({ index: p, label: x.label || x.language || `Track ${p + 1}` });
415
+ setup(e) {
416
+ const s = e, t = g([]), n = g(-1), o = g(!1), v = g(null);
417
+ function d(w) {
418
+ const $ = [];
419
+ for (let f = 0; f < w.length; f++) {
420
+ const M = w[f];
421
+ (M.kind === "subtitles" || M.kind === "captions") && $.push({ index: f, label: M.label || M.language || `Track ${f + 1}` });
417
422
  }
418
- n.value = m;
419
- let C = -1;
420
- for (let p = 0; p < b.length; p++)
421
- if (b[p].mode === "showing") {
422
- C = p;
423
+ t.value = $;
424
+ let T = -1;
425
+ for (let f = 0; f < w.length; f++)
426
+ if (w[f].mode === "showing") {
427
+ T = f;
423
428
  break;
424
429
  }
425
- e.value = C;
430
+ n.value = T;
426
431
  }
427
- let g = null;
428
- R(() => a.video, (b) => {
429
- if (g == null || g(), g = null, !b) {
430
- n.value = [], e.value = -1;
432
+ let h = null;
433
+ V(() => s.video, (w) => {
434
+ if (h == null || h(), h = null, !w) {
435
+ t.value = [], n.value = -1;
431
436
  return;
432
437
  }
433
- const m = b.textTracks;
434
- h(m);
435
- const C = () => h(m);
436
- typeof m.addEventListener == "function" && (m.addEventListener("addtrack", C), m.addEventListener("removetrack", C), m.addEventListener("change", C), g = () => {
437
- m.removeEventListener("addtrack", C), m.removeEventListener("removetrack", C), m.removeEventListener("change", C);
438
+ const $ = w.textTracks;
439
+ d($);
440
+ const T = () => d($);
441
+ typeof $.addEventListener == "function" && ($.addEventListener("addtrack", T), $.addEventListener("removetrack", T), $.addEventListener("change", T), h = () => {
442
+ $.removeEventListener("addtrack", T), $.removeEventListener("removetrack", T), $.removeEventListener("change", T);
438
443
  });
439
- }, { immediate: !0 }), ne(() => {
440
- g == null || g(), document.removeEventListener("mousedown", E), document.removeEventListener("keydown", _);
444
+ }, { immediate: !0 }), ae(() => {
445
+ h == null || h(), document.removeEventListener("mousedown", E), document.removeEventListener("keydown", A);
441
446
  });
442
- function E(b) {
443
- o.value && !o.value.contains(b.target) && (c.value = !1);
447
+ function E(w) {
448
+ v.value && !v.value.contains(w.target) && (o.value = !1);
444
449
  }
445
- function _(b) {
446
- b.key === "Escape" && (c.value = !1);
450
+ function A(w) {
451
+ w.key === "Escape" && (o.value = !1);
447
452
  }
448
- R(c, (b) => {
449
- b ? (document.addEventListener("mousedown", E), document.addEventListener("keydown", _)) : (document.removeEventListener("mousedown", E), document.removeEventListener("keydown", _));
453
+ V(o, (w) => {
454
+ w ? (document.addEventListener("mousedown", E), document.addEventListener("keydown", A)) : (document.removeEventListener("mousedown", E), document.removeEventListener("keydown", A));
450
455
  });
451
- function $() {
452
- if (!a.video) return;
453
- const b = a.video.textTracks;
454
- for (let m = 0; m < b.length; m++) b[m].mode = "hidden";
455
- e.value = -1, c.value = !1;
456
- }
457
- function S(b) {
458
- if (!a.video) return;
459
- const m = a.video.textTracks;
460
- for (let C = 0; C < m.length; C++)
461
- m[C].mode = C === b ? "showing" : "hidden";
462
- e.value = b, c.value = !1;
463
- }
464
- return (b, m) => n.value.length > 0 ? (d(), f("div", {
456
+ function S() {
457
+ if (!s.video) return;
458
+ const w = s.video.textTracks;
459
+ for (let $ = 0; $ < w.length; $++) w[$].mode = "hidden";
460
+ n.value = -1, o.value = !1;
461
+ }
462
+ function P(w) {
463
+ if (!s.video) return;
464
+ const $ = s.video.textTracks;
465
+ for (let T = 0; T < $.length; T++)
466
+ $[T].mode = T === w ? "showing" : "hidden";
467
+ n.value = w, o.value = !1;
468
+ }
469
+ return (w, $) => t.value.length > 0 ? (r(), c("div", {
465
470
  key: 0,
466
471
  ref_key: "rootEl",
467
- ref: o,
472
+ ref: v,
468
473
  class: "gvp-captions"
469
474
  }, [
470
- r("button", {
475
+ a("button", {
471
476
  type: "button",
472
- class: w(["gvp-captions-btn", { "is-active": e.value >= 0 }]),
477
+ class: L(["gvp-captions-btn", { "is-active": n.value >= 0 }]),
473
478
  "aria-haspopup": "listbox",
474
- "aria-expanded": c.value,
475
- "aria-pressed": e.value >= 0,
479
+ "aria-expanded": o.value,
480
+ "aria-pressed": n.value >= 0,
476
481
  "aria-label": "Captions",
477
- onClick: m[0] || (m[0] = (C) => c.value = !c.value)
482
+ onClick: $[0] || ($[0] = (T) => o.value = !o.value)
478
483
  }, [
479
- Z(Ue)
480
- ], 10, mt),
481
- c.value ? (d(), f("ul", ht, [
482
- r("li", null, [
483
- r("button", {
484
+ O(Tt)
485
+ ], 10, Mt),
486
+ o.value ? (r(), c("ul", It, [
487
+ a("li", null, [
488
+ a("button", {
484
489
  type: "button",
485
490
  role: "option",
486
- "aria-selected": e.value === -1,
487
- class: w(["gvp-captions-menu-item", { "is-active": e.value === -1 }]),
488
- onClick: $
489
- }, " Off ", 10, gt)
491
+ "aria-selected": n.value === -1,
492
+ class: L(["gvp-captions-menu-item", { "is-active": n.value === -1 }]),
493
+ onClick: S
494
+ }, " Off ", 10, At)
490
495
  ]),
491
- (d(!0), f(ie, null, ue(n.value, (C) => (d(), f("li", {
492
- key: C.index
496
+ (r(!0), c(oe, null, pe(t.value, (T) => (r(), c("li", {
497
+ key: T.index
493
498
  }, [
494
- r("button", {
499
+ a("button", {
495
500
  type: "button",
496
501
  role: "option",
497
- "aria-selected": C.index === e.value,
498
- class: w(["gvp-captions-menu-item", { "is-active": C.index === e.value }]),
499
- onClick: (p) => S(C.index)
500
- }, U(C.label), 11, kt)
502
+ "aria-selected": T.index === n.value,
503
+ class: L(["gvp-captions-menu-item", { "is-active": T.index === n.value }]),
504
+ onClick: (f) => P(T.index)
505
+ }, Z(T.label), 11, St)
501
506
  ]))), 128))
502
- ])) : M("", !0)
503
- ], 512)) : M("", !0);
507
+ ])) : x("", !0)
508
+ ], 512)) : x("", !0);
504
509
  }
505
- }), wt = { name: "IconPause" }, bt = /* @__PURE__ */ I({
506
- ...wt,
510
+ }), Ht = { name: "IconPause" }, Vt = /* @__PURE__ */ N({
511
+ ...Ht,
507
512
  props: {
508
513
  class: {}
509
514
  },
510
- setup(t) {
511
- const a = t;
512
- return (n, e) => (d(), f("svg", {
513
- class: w(["gvp-icon", a.class]),
515
+ setup(e) {
516
+ const s = e;
517
+ return (t, n) => (r(), c("svg", {
518
+ class: L(["gvp-icon", s.class]),
514
519
  width: "16",
515
520
  height: "16",
516
521
  viewBox: "0 0 24 24",
517
522
  fill: "none",
518
523
  xmlns: "http://www.w3.org/2000/svg",
519
524
  "aria-hidden": "true"
520
- }, [...e[0] || (e[0] = [
521
- r("rect", {
525
+ }, [...n[0] || (n[0] = [
526
+ a("rect", {
522
527
  x: "6",
523
528
  y: "5",
524
529
  width: "4",
@@ -526,7 +531,7 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
526
531
  rx: "1",
527
532
  fill: "currentColor"
528
533
  }, null, -1),
529
- r("rect", {
534
+ a("rect", {
530
535
  x: "14",
531
536
  y: "5",
532
537
  width: "4",
@@ -536,49 +541,49 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
536
541
  }, null, -1)
537
542
  ])], 2));
538
543
  }
539
- }), Ct = { name: "IconPlaySolid" }, xt = /* @__PURE__ */ I({
540
- ...Ct,
544
+ }), Bt = { name: "IconPlaySolid" }, Rt = /* @__PURE__ */ N({
545
+ ...Bt,
541
546
  props: {
542
547
  class: {}
543
548
  },
544
- setup(t) {
545
- const a = t;
546
- return (n, e) => (d(), f("svg", {
547
- class: w(["gvp-icon", a.class]),
549
+ setup(e) {
550
+ const s = e;
551
+ return (t, n) => (r(), c("svg", {
552
+ class: L(["gvp-icon", s.class]),
548
553
  width: "16",
549
554
  height: "16",
550
555
  viewBox: "0 0 24 24",
551
556
  fill: "none",
552
557
  xmlns: "http://www.w3.org/2000/svg",
553
558
  "aria-hidden": "true"
554
- }, [...e[0] || (e[0] = [
555
- r("path", {
559
+ }, [...n[0] || (n[0] = [
560
+ a("path", {
556
561
  d: "M7 5.5V18.5C7 19.2659 7.84856 19.7261 8.4899 19.3071L19.0801 12.4014C19.6644 12.0204 19.6644 11.9796 19.0801 11.5986L8.4899 4.69288C7.84856 4.27388 7 4.73408 7 5.5Z",
557
562
  fill: "currentColor"
558
563
  }, null, -1)
559
564
  ])], 2));
560
565
  }
561
- }), Lt = { name: "IconPrev" }, Et = /* @__PURE__ */ I({
562
- ...Lt,
566
+ }), Dt = { name: "IconPrev" }, Ft = /* @__PURE__ */ N({
567
+ ...Dt,
563
568
  props: {
564
569
  class: {}
565
570
  },
566
- setup(t) {
567
- const a = t;
568
- return (n, e) => (d(), f("svg", {
569
- class: w(["gvp-icon", a.class]),
571
+ setup(e) {
572
+ const s = e;
573
+ return (t, n) => (r(), c("svg", {
574
+ class: L(["gvp-icon", s.class]),
570
575
  width: "16",
571
576
  height: "16",
572
577
  viewBox: "0 0 24 24",
573
578
  fill: "none",
574
579
  xmlns: "http://www.w3.org/2000/svg",
575
580
  "aria-hidden": "true"
576
- }, [...e[0] || (e[0] = [
577
- r("path", {
581
+ }, [...n[0] || (n[0] = [
582
+ a("path", {
578
583
  d: "M16.5 18.5V5.5C16.5 4.73408 15.6514 4.27388 15.0101 4.69288L6.91993 9.98432C6.33563 10.3653 6.33563 11.0347 6.91993 11.4157L15.0101 16.7071C15.6514 17.1261 16.5 16.6659 16.5 15.9V18.5Z",
579
584
  fill: "currentColor"
580
585
  }, null, -1),
581
- r("path", {
586
+ a("path", {
582
587
  d: "M6 5V19",
583
588
  stroke: "currentColor",
584
589
  "stroke-width": "2",
@@ -586,27 +591,27 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
586
591
  }, null, -1)
587
592
  ])], 2));
588
593
  }
589
- }), _t = { name: "IconNext" }, $t = /* @__PURE__ */ I({
590
- ..._t,
594
+ }), qt = { name: "IconNext" }, Ot = /* @__PURE__ */ N({
595
+ ...qt,
591
596
  props: {
592
597
  class: {}
593
598
  },
594
- setup(t) {
595
- const a = t;
596
- return (n, e) => (d(), f("svg", {
597
- class: w(["gvp-icon", a.class]),
599
+ setup(e) {
600
+ const s = e;
601
+ return (t, n) => (r(), c("svg", {
602
+ class: L(["gvp-icon", s.class]),
598
603
  width: "16",
599
604
  height: "16",
600
605
  viewBox: "0 0 24 24",
601
606
  fill: "none",
602
607
  xmlns: "http://www.w3.org/2000/svg",
603
608
  "aria-hidden": "true"
604
- }, [...e[0] || (e[0] = [
605
- r("path", {
609
+ }, [...n[0] || (n[0] = [
610
+ a("path", {
606
611
  d: "M7.5 5.5V18.5C7.5 19.2659 8.34856 19.7261 8.98990 19.3071L17.0801 14.0157C17.6644 13.6347 17.6644 12.9653 17.0801 12.5843L8.98990 7.29288C8.34856 6.87388 7.5 7.33408 7.5 8.1V5.5Z",
607
612
  fill: "currentColor"
608
613
  }, null, -1),
609
- r("path", {
614
+ a("path", {
610
615
  d: "M18 5V19",
611
616
  stroke: "currentColor",
612
617
  "stroke-width": "2",
@@ -614,29 +619,29 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
614
619
  }, null, -1)
615
620
  ])], 2));
616
621
  }
617
- }), Pt = { name: "IconVolumeHigh" }, Mt = /* @__PURE__ */ I({
618
- ...Pt,
622
+ }), jt = { name: "IconVolumeHigh" }, Ut = /* @__PURE__ */ N({
623
+ ...jt,
619
624
  props: {
620
625
  class: {}
621
626
  },
622
- setup(t) {
623
- const a = t;
624
- return (n, e) => (d(), f("svg", {
625
- class: w(["gvp-icon", a.class]),
627
+ setup(e) {
628
+ const s = e;
629
+ return (t, n) => (r(), c("svg", {
630
+ class: L(["gvp-icon", s.class]),
626
631
  width: "18",
627
632
  height: "18",
628
633
  viewBox: "0 0 24 24",
629
634
  fill: "none",
630
635
  xmlns: "http://www.w3.org/2000/svg",
631
636
  "aria-hidden": "true"
632
- }, [...e[0] || (e[0] = [
633
- r("path", {
637
+ }, [...n[0] || (n[0] = [
638
+ a("path", {
634
639
  d: "M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",
635
640
  stroke: "currentColor",
636
641
  "stroke-width": "1.5",
637
642
  "stroke-linejoin": "round"
638
643
  }, null, -1),
639
- r("path", {
644
+ a("path", {
640
645
  d: "M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16M19 5.5C20.5 7 21.5 9.5 21.5 12C21.5 14.5 20.5 17 19 18.5",
641
646
  stroke: "currentColor",
642
647
  "stroke-width": "1.5",
@@ -644,29 +649,29 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
644
649
  }, null, -1)
645
650
  ])], 2));
646
651
  }
647
- }), Tt = { name: "IconVolumeLow" }, It = /* @__PURE__ */ I({
648
- ...Tt,
652
+ }), Zt = { name: "IconVolumeLow" }, zt = /* @__PURE__ */ N({
653
+ ...Zt,
649
654
  props: {
650
655
  class: {}
651
656
  },
652
- setup(t) {
653
- const a = t;
654
- return (n, e) => (d(), f("svg", {
655
- class: w(["gvp-icon", a.class]),
657
+ setup(e) {
658
+ const s = e;
659
+ return (t, n) => (r(), c("svg", {
660
+ class: L(["gvp-icon", s.class]),
656
661
  width: "18",
657
662
  height: "18",
658
663
  viewBox: "0 0 24 24",
659
664
  fill: "none",
660
665
  xmlns: "http://www.w3.org/2000/svg",
661
666
  "aria-hidden": "true"
662
- }, [...e[0] || (e[0] = [
663
- r("path", {
667
+ }, [...n[0] || (n[0] = [
668
+ a("path", {
664
669
  d: "M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",
665
670
  stroke: "currentColor",
666
671
  "stroke-width": "1.5",
667
672
  "stroke-linejoin": "round"
668
673
  }, null, -1),
669
- r("path", {
674
+ a("path", {
670
675
  d: "M16.5 8C17.5 9 18 10.5 18 12C18 13.5 17.5 15 16.5 16",
671
676
  stroke: "currentColor",
672
677
  "stroke-width": "1.5",
@@ -674,29 +679,29 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
674
679
  }, null, -1)
675
680
  ])], 2));
676
681
  }
677
- }), St = { name: "IconVolumeMuted" }, Nt = /* @__PURE__ */ I({
678
- ...St,
682
+ }), Wt = { name: "IconVolumeMuted" }, Kt = /* @__PURE__ */ N({
683
+ ...Wt,
679
684
  props: {
680
685
  class: {}
681
686
  },
682
- setup(t) {
683
- const a = t;
684
- return (n, e) => (d(), f("svg", {
685
- class: w(["gvp-icon", a.class]),
687
+ setup(e) {
688
+ const s = e;
689
+ return (t, n) => (r(), c("svg", {
690
+ class: L(["gvp-icon", s.class]),
686
691
  width: "18",
687
692
  height: "18",
688
693
  viewBox: "0 0 24 24",
689
694
  fill: "none",
690
695
  xmlns: "http://www.w3.org/2000/svg",
691
696
  "aria-hidden": "true"
692
- }, [...e[0] || (e[0] = [
693
- r("path", {
697
+ }, [...n[0] || (n[0] = [
698
+ a("path", {
694
699
  d: "M3 14V10C3 9.44772 3.44772 9 4 9H6.58579C6.851 9 7.10536 8.89464 7.29289 8.70711L11.2929 4.70711C11.9229 4.07714 13 4.52331 13 5.41421V18.5858C13 19.4767 11.9229 19.9229 11.2929 19.2929L7.29289 15.2929C7.10536 15.1054 6.851 15 6.58579 15H4C3.44772 15 3 14.5523 3 14Z",
695
700
  stroke: "currentColor",
696
701
  "stroke-width": "1.5",
697
702
  "stroke-linejoin": "round"
698
703
  }, null, -1),
699
- r("path", {
704
+ a("path", {
700
705
  d: "M16 9L22 15M22 9L16 15",
701
706
  stroke: "currentColor",
702
707
  "stroke-width": "1.5",
@@ -704,52 +709,23 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
704
709
  }, null, -1)
705
710
  ])], 2));
706
711
  }
707
- }), At = { name: "IconQuality" }, Ht = /* @__PURE__ */ I({
708
- ...At,
709
- props: {
710
- class: {}
711
- },
712
- setup(t) {
713
- const a = t;
714
- return (n, e) => (d(), f("svg", {
715
- class: w(["gvp-icon", a.class]),
716
- width: "16",
717
- height: "16",
718
- viewBox: "0 0 24 24",
719
- fill: "none",
720
- xmlns: "http://www.w3.org/2000/svg",
721
- "aria-hidden": "true"
722
- }, [...e[0] || (e[0] = [
723
- r("path", {
724
- 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",
725
- stroke: "currentColor",
726
- "stroke-width": "1.5"
727
- }, null, -1),
728
- r("path", {
729
- 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",
730
- stroke: "currentColor",
731
- "stroke-width": "1.5",
732
- "stroke-linecap": "round"
733
- }, null, -1)
734
- ])], 2));
735
- }
736
- }), Bt = { name: "IconPiP" }, Ze = /* @__PURE__ */ I({
737
- ...Bt,
712
+ }), Qt = { name: "IconPiP" }, ze = /* @__PURE__ */ N({
713
+ ...Qt,
738
714
  props: {
739
715
  class: {}
740
716
  },
741
- setup(t) {
742
- const a = t;
743
- return (n, e) => (d(), f("svg", {
744
- class: w(["gvp-icon", a.class]),
717
+ setup(e) {
718
+ const s = e;
719
+ return (t, n) => (r(), c("svg", {
720
+ class: L(["gvp-icon", s.class]),
745
721
  width: "18",
746
722
  height: "18",
747
723
  viewBox: "0 0 24 24",
748
724
  fill: "none",
749
725
  xmlns: "http://www.w3.org/2000/svg",
750
726
  "aria-hidden": "true"
751
- }, [...e[0] || (e[0] = [
752
- r("rect", {
727
+ }, [...n[0] || (n[0] = [
728
+ a("rect", {
753
729
  x: "2",
754
730
  y: "4",
755
731
  width: "20",
@@ -758,7 +734,7 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
758
734
  stroke: "currentColor",
759
735
  "stroke-width": "1.5"
760
736
  }, null, -1),
761
- r("rect", {
737
+ a("rect", {
762
738
  x: "12",
763
739
  y: "12",
764
740
  width: "8",
@@ -768,23 +744,23 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
768
744
  }, null, -1)
769
745
  ])], 2));
770
746
  }
771
- }), Vt = { name: "IconFullscreen" }, qt = /* @__PURE__ */ I({
772
- ...Vt,
747
+ }), Yt = { name: "IconFullscreen" }, Gt = /* @__PURE__ */ N({
748
+ ...Yt,
773
749
  props: {
774
750
  class: {}
775
751
  },
776
- setup(t) {
777
- const a = t;
778
- return (n, e) => (d(), f("svg", {
779
- class: w(["gvp-icon", a.class]),
752
+ setup(e) {
753
+ const s = e;
754
+ return (t, n) => (r(), c("svg", {
755
+ class: L(["gvp-icon", s.class]),
780
756
  width: "18",
781
757
  height: "18",
782
758
  viewBox: "0 0 24 24",
783
759
  fill: "none",
784
760
  xmlns: "http://www.w3.org/2000/svg",
785
761
  "aria-hidden": "true"
786
- }, [...e[0] || (e[0] = [
787
- r("path", {
762
+ }, [...n[0] || (n[0] = [
763
+ a("path", {
788
764
  d: "M4 9V4H9M15 4H20V9M20 15V20H15M9 20H4V15",
789
765
  stroke: "currentColor",
790
766
  "stroke-width": "1.75",
@@ -793,23 +769,23 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
793
769
  }, null, -1)
794
770
  ])], 2));
795
771
  }
796
- }), Dt = { name: "IconFullscreenExit" }, Ft = /* @__PURE__ */ I({
797
- ...Dt,
772
+ }), Jt = { name: "IconFullscreenExit" }, Xt = /* @__PURE__ */ N({
773
+ ...Jt,
798
774
  props: {
799
775
  class: {}
800
776
  },
801
- setup(t) {
802
- const a = t;
803
- return (n, e) => (d(), f("svg", {
804
- class: w(["gvp-icon", a.class]),
777
+ setup(e) {
778
+ const s = e;
779
+ return (t, n) => (r(), c("svg", {
780
+ class: L(["gvp-icon", s.class]),
805
781
  width: "18",
806
782
  height: "18",
807
783
  viewBox: "0 0 24 24",
808
784
  fill: "none",
809
785
  xmlns: "http://www.w3.org/2000/svg",
810
786
  "aria-hidden": "true"
811
- }, [...e[0] || (e[0] = [
812
- r("path", {
787
+ }, [...n[0] || (n[0] = [
788
+ a("path", {
813
789
  d: "M9 4V9H4M15 9V4H20M15 20V15H20M9 15H4V20",
814
790
  stroke: "currentColor",
815
791
  "stroke-width": "1.75",
@@ -818,129 +794,458 @@ const Je = ["muted", "loop", "controls", "autoplay", "playsinline", "preload", "
818
794
  }, null, -1)
819
795
  ])], 2));
820
796
  }
797
+ }), en = { name: "IconGear" }, tn = /* @__PURE__ */ N({
798
+ ...en,
799
+ props: {
800
+ class: {}
801
+ },
802
+ setup(e) {
803
+ const s = e;
804
+ return (t, n) => (r(), c("svg", {
805
+ class: L(["gvp-icon", s.class]),
806
+ width: "16",
807
+ height: "16",
808
+ viewBox: "0 0 24 24",
809
+ fill: "none",
810
+ xmlns: "http://www.w3.org/2000/svg",
811
+ "aria-hidden": "true"
812
+ }, [...n[0] || (n[0] = [
813
+ a("path", {
814
+ d: "M12 15.5A3.5 3.5 0 1 0 12 8.5A3.5 3.5 0 0 0 12 15.5Z",
815
+ stroke: "currentColor",
816
+ "stroke-width": "2"
817
+ }, null, -1),
818
+ a("path", {
819
+ d: "M19.4 13A1.65 1.65 0 0 0 19.73 14.82L19.79 14.88A2 2 0 1 1 16.96 17.71L16.9 17.65A1.65 1.65 0 0 0 15.08 17.32A1.65 1.65 0 0 0 14 18.83V19A2 2 0 1 1 10 19V18.91A1.65 1.65 0 0 0 8.83 17.4A1.65 1.65 0 0 0 7.01 17.73L6.95 17.79A2 2 0 1 1 4.12 14.96L4.18 14.9A1.65 1.65 0 0 0 4.51 13.08A1.65 1.65 0 0 0 3 12H2.91A2 2 0 1 1 2.91 8H3A1.65 1.65 0 0 0 4.51 6.83A1.65 1.65 0 0 0 4.18 5.01L4.12 4.95A2 2 0 1 1 6.95 2.12L7.01 2.18A1.65 1.65 0 0 0 8.83 2.51H8.91A1.65 1.65 0 0 0 10 1V0.91A2 2 0 1 1 14 0.91V1A1.65 1.65 0 0 0 15.08 2.51A1.65 1.65 0 0 0 16.9 2.18L16.96 2.12A2 2 0 1 1 19.79 4.95L19.73 5.01A1.65 1.65 0 0 0 19.4 6.83V6.91A1.65 1.65 0 0 0 21 8H21.09A2 2 0 1 1 21.09 12H21A1.65 1.65 0 0 0 19.4 13Z",
820
+ stroke: "currentColor",
821
+ "stroke-width": "2",
822
+ "stroke-linecap": "round",
823
+ "stroke-linejoin": "round"
824
+ }, null, -1)
825
+ ])], 2));
826
+ }
827
+ }), nn = { name: "IconChevronRight" }, Ee = /* @__PURE__ */ N({
828
+ ...nn,
829
+ props: {
830
+ class: {}
831
+ },
832
+ setup(e) {
833
+ const s = e;
834
+ return (t, n) => (r(), c("svg", {
835
+ class: L(["gvp-icon", s.class]),
836
+ width: "14",
837
+ height: "14",
838
+ viewBox: "0 0 24 24",
839
+ fill: "none",
840
+ xmlns: "http://www.w3.org/2000/svg",
841
+ "aria-hidden": "true"
842
+ }, [...n[0] || (n[0] = [
843
+ a("path", {
844
+ d: "M9 6L15 12L9 18",
845
+ stroke: "currentColor",
846
+ "stroke-width": "2",
847
+ "stroke-linecap": "round",
848
+ "stroke-linejoin": "round"
849
+ }, null, -1)
850
+ ])], 2));
851
+ }
852
+ }), sn = { name: "IconCheck" }, we = /* @__PURE__ */ N({
853
+ ...sn,
854
+ props: {
855
+ class: {}
856
+ },
857
+ setup(e) {
858
+ const s = e;
859
+ return (t, n) => (r(), c("svg", {
860
+ class: L(["gvp-icon", s.class]),
861
+ width: "14",
862
+ height: "14",
863
+ viewBox: "0 0 24 24",
864
+ fill: "none",
865
+ xmlns: "http://www.w3.org/2000/svg",
866
+ "aria-hidden": "true"
867
+ }, [...n[0] || (n[0] = [
868
+ a("path", {
869
+ d: "M5 12L10 17L19 7",
870
+ stroke: "currentColor",
871
+ "stroke-width": "2.5",
872
+ "stroke-linecap": "round",
873
+ "stroke-linejoin": "round"
874
+ }, null, -1)
875
+ ])], 2));
876
+ }
877
+ }), ln = ["aria-expanded"], on = {
878
+ key: 0,
879
+ class: "gvp-settings-menu",
880
+ role: "menu"
881
+ }, an = { class: "gvp-settings-row-value" }, rn = { class: "gvp-settings-row-value" }, un = { class: "gvp-settings-row-value" }, cn = { class: "gvp-settings-row-value" }, dn = ["aria-checked", "onClick"], vn = { class: "gvp-settings-check" }, pn = ["aria-checked"], fn = { class: "gvp-settings-check" }, mn = ["aria-checked", "onClick"], gn = { class: "gvp-settings-check" }, hn = ["aria-checked"], kn = { class: "gvp-settings-check" }, yn = ["aria-checked", "onClick"], bn = { class: "gvp-settings-check" }, wn = ["aria-checked", "onClick"], xn = { class: "gvp-settings-check" }, Cn = { name: "SettingsMenu" }, Ln = /* @__PURE__ */ N({
882
+ ...Cn,
883
+ props: {
884
+ video: {},
885
+ qualityLevels: { default: () => [] },
886
+ currentLevel: { default: -1 },
887
+ selectedLevel: { default: -1 },
888
+ audioTracks: { default: () => [] },
889
+ audioTrackIndex: { default: -1 }
890
+ },
891
+ emits: ["select-level", "select-audio-track"],
892
+ setup(e, { emit: s }) {
893
+ const t = e, n = s, o = [0.5, 0.75, 1, 1.25, 1.5, 2], v = g(!1), d = g("root"), h = g(null), E = g(1);
894
+ V(() => t.video, (y) => {
895
+ if (!y) return;
896
+ const p = () => {
897
+ E.value = y.playbackRate;
898
+ };
899
+ p(), y.addEventListener("ratechange", p);
900
+ }, { immediate: !0 });
901
+ function A(y) {
902
+ t.video && (t.video.playbackRate = y), E.value = y, d.value = "root";
903
+ }
904
+ const S = g([]), P = g(-1);
905
+ function w(y) {
906
+ const p = [];
907
+ for (let m = 0; m < y.length; m++) {
908
+ const Q = y[m];
909
+ (Q.kind === "subtitles" || Q.kind === "captions") && p.push({ index: m, label: Q.label || Q.language || `Track ${m + 1}` });
910
+ }
911
+ S.value = p;
912
+ let ee = -1;
913
+ for (let m = 0; m < y.length; m++)
914
+ if (y[m].mode === "showing") {
915
+ ee = m;
916
+ break;
917
+ }
918
+ P.value = ee;
919
+ }
920
+ V(() => t.video, (y) => {
921
+ if (!y) {
922
+ S.value = [], P.value = -1;
923
+ return;
924
+ }
925
+ const p = y.textTracks;
926
+ w(p);
927
+ const ee = () => w(p);
928
+ typeof p.addEventListener == "function" && (p.addEventListener("addtrack", ee), p.addEventListener("removetrack", ee), p.addEventListener("change", ee));
929
+ }, { immediate: !0 });
930
+ function $(y) {
931
+ var ee;
932
+ const p = (ee = t.video) == null ? void 0 : ee.textTracks;
933
+ if (p)
934
+ for (let m = 0; m < p.length; m++)
935
+ p[m].mode = m === y ? "showing" : "hidden";
936
+ P.value = y, d.value = "root";
937
+ }
938
+ const T = I(
939
+ () => [...t.qualityLevels].sort((y, p) => p.height - y.height)
940
+ ), f = I(
941
+ () => t.qualityLevels.find((y) => y.index === t.currentLevel)
942
+ ), M = I(() => {
943
+ var y;
944
+ return t.selectedLevel < 0 ? f.value ? `Auto (${f.value.label})` : "Auto" : ((y = t.qualityLevels.find((p) => p.index === t.selectedLevel)) == null ? void 0 : y.label) ?? "Auto";
945
+ });
946
+ function z(y) {
947
+ n("select-level", y), d.value = "root";
948
+ }
949
+ const j = I(
950
+ () => t.audioTracks.find((y) => y.index === t.audioTrackIndex) ?? t.audioTracks[0]
951
+ );
952
+ function K(y) {
953
+ n("select-audio-track", y), d.value = "root";
954
+ }
955
+ const re = I(() => t.qualityLevels.length >= 2), C = I(() => S.value.length > 0), W = I(() => t.audioTracks.length > 1), B = I(() => E.value === 1 ? "Normal" : `${E.value}×`), D = I(
956
+ () => {
957
+ var y;
958
+ return P.value < 0 ? "Off" : ((y = S.value.find((p) => p.index === P.value)) == null ? void 0 : y.label) ?? "Off";
959
+ }
960
+ );
961
+ function F() {
962
+ v.value = !1, d.value = "root";
963
+ }
964
+ function H(y) {
965
+ h.value && !h.value.contains(y.target) && F();
966
+ }
967
+ function R(y) {
968
+ y.key === "Escape" && F();
969
+ }
970
+ V(v, (y) => {
971
+ y ? (document.addEventListener("mousedown", H), document.addEventListener("keydown", R)) : (document.removeEventListener("mousedown", H), document.removeEventListener("keydown", R));
972
+ }), ae(() => {
973
+ document.removeEventListener("mousedown", H), document.removeEventListener("keydown", R);
974
+ });
975
+ function fe() {
976
+ v.value = !v.value, d.value = "root";
977
+ }
978
+ return (y, p) => {
979
+ var ee;
980
+ return r(), c("div", {
981
+ ref_key: "rootEl",
982
+ ref: h,
983
+ class: "gvp-settings"
984
+ }, [
985
+ a("button", {
986
+ type: "button",
987
+ class: L(["gvp-ctrl-btn", { "is-active": v.value }]),
988
+ "aria-haspopup": "menu",
989
+ "aria-expanded": v.value,
990
+ "aria-label": "Settings",
991
+ onClick: fe
992
+ }, [
993
+ O(tn)
994
+ ], 10, ln),
995
+ v.value ? (r(), c("div", on, [
996
+ d.value === "root" ? (r(), c(oe, { key: 0 }, [
997
+ a("button", {
998
+ type: "button",
999
+ role: "menuitem",
1000
+ class: "gvp-settings-row",
1001
+ onClick: p[0] || (p[0] = (m) => d.value = "speed")
1002
+ }, [
1003
+ p[7] || (p[7] = a("span", { class: "gvp-settings-row-label" }, "Speed", -1)),
1004
+ a("span", an, Z(B.value), 1),
1005
+ O(Ee, { class: "gvp-settings-chevron" })
1006
+ ]),
1007
+ re.value ? (r(), c("button", {
1008
+ key: 0,
1009
+ type: "button",
1010
+ role: "menuitem",
1011
+ class: "gvp-settings-row",
1012
+ onClick: p[1] || (p[1] = (m) => d.value = "quality")
1013
+ }, [
1014
+ p[8] || (p[8] = a("span", { class: "gvp-settings-row-label" }, "Quality", -1)),
1015
+ a("span", rn, Z(M.value), 1),
1016
+ O(Ee, { class: "gvp-settings-chevron" })
1017
+ ])) : x("", !0),
1018
+ C.value ? (r(), c("button", {
1019
+ key: 1,
1020
+ type: "button",
1021
+ role: "menuitem",
1022
+ class: "gvp-settings-row",
1023
+ onClick: p[2] || (p[2] = (m) => d.value = "captions")
1024
+ }, [
1025
+ p[9] || (p[9] = a("span", { class: "gvp-settings-row-label" }, "Subtitles", -1)),
1026
+ a("span", un, Z(D.value), 1),
1027
+ O(Ee, { class: "gvp-settings-chevron" })
1028
+ ])) : x("", !0),
1029
+ W.value ? (r(), c("button", {
1030
+ key: 2,
1031
+ type: "button",
1032
+ role: "menuitem",
1033
+ class: "gvp-settings-row",
1034
+ onClick: p[3] || (p[3] = (m) => d.value = "audio")
1035
+ }, [
1036
+ p[10] || (p[10] = a("span", { class: "gvp-settings-row-label" }, "Audio", -1)),
1037
+ a("span", cn, Z((ee = j.value) == null ? void 0 : ee.label), 1),
1038
+ O(Ee, { class: "gvp-settings-chevron" })
1039
+ ])) : x("", !0)
1040
+ ], 64)) : x("", !0),
1041
+ d.value !== "root" ? (r(), c("button", {
1042
+ key: 1,
1043
+ type: "button",
1044
+ class: "gvp-settings-back",
1045
+ onClick: p[4] || (p[4] = (m) => d.value = "root")
1046
+ }, [
1047
+ O(Ee, { class: "gvp-settings-back-icon" }),
1048
+ a("span", null, Z(d.value === "speed" ? "Speed" : d.value === "quality" ? "Quality" : d.value === "captions" ? "Subtitles" : "Audio"), 1)
1049
+ ])) : x("", !0),
1050
+ d.value === "speed" ? (r(), c(oe, { key: 2 }, pe(o, (m) => a("button", {
1051
+ key: m,
1052
+ type: "button",
1053
+ role: "menuitemradio",
1054
+ "aria-checked": m === E.value,
1055
+ class: L(["gvp-settings-option", { "is-active": m === E.value }]),
1056
+ onClick: (Q) => A(m)
1057
+ }, [
1058
+ a("span", vn, [
1059
+ m === E.value ? (r(), J(we, { key: 0 })) : x("", !0)
1060
+ ]),
1061
+ a("span", null, Z(m === 1 ? "Normal" : `${m}×`), 1)
1062
+ ], 10, dn)), 64)) : x("", !0),
1063
+ d.value === "quality" ? (r(), c(oe, { key: 3 }, [
1064
+ a("button", {
1065
+ type: "button",
1066
+ role: "menuitemradio",
1067
+ "aria-checked": e.selectedLevel < 0,
1068
+ class: L(["gvp-settings-option", { "is-active": e.selectedLevel < 0 }]),
1069
+ onClick: p[5] || (p[5] = (m) => z(le(ut).index))
1070
+ }, [
1071
+ a("span", fn, [
1072
+ e.selectedLevel < 0 ? (r(), J(we, { key: 0 })) : x("", !0)
1073
+ ]),
1074
+ a("span", null, Z(f.value ? `Auto (${f.value.label})` : "Auto"), 1)
1075
+ ], 10, pn),
1076
+ (r(!0), c(oe, null, pe(T.value, (m) => (r(), c("button", {
1077
+ key: m.index,
1078
+ type: "button",
1079
+ role: "menuitemradio",
1080
+ "aria-checked": m.index === e.selectedLevel,
1081
+ class: L(["gvp-settings-option", { "is-active": m.index === e.selectedLevel }]),
1082
+ onClick: (Q) => z(m.index)
1083
+ }, [
1084
+ a("span", gn, [
1085
+ m.index === e.selectedLevel ? (r(), J(we, { key: 0 })) : x("", !0)
1086
+ ]),
1087
+ a("span", null, Z(m.label), 1)
1088
+ ], 10, mn))), 128))
1089
+ ], 64)) : x("", !0),
1090
+ d.value === "captions" ? (r(), c(oe, { key: 4 }, [
1091
+ a("button", {
1092
+ type: "button",
1093
+ role: "menuitemradio",
1094
+ "aria-checked": P.value === -1,
1095
+ class: L(["gvp-settings-option", { "is-active": P.value === -1 }]),
1096
+ onClick: p[6] || (p[6] = (m) => $(-1))
1097
+ }, [
1098
+ a("span", kn, [
1099
+ P.value === -1 ? (r(), J(we, { key: 0 })) : x("", !0)
1100
+ ]),
1101
+ p[11] || (p[11] = a("span", null, "Off", -1))
1102
+ ], 10, hn),
1103
+ (r(!0), c(oe, null, pe(S.value, (m) => (r(), c("button", {
1104
+ key: m.index,
1105
+ type: "button",
1106
+ role: "menuitemradio",
1107
+ "aria-checked": m.index === P.value,
1108
+ class: L(["gvp-settings-option", { "is-active": m.index === P.value }]),
1109
+ onClick: (Q) => $(m.index)
1110
+ }, [
1111
+ a("span", bn, [
1112
+ m.index === P.value ? (r(), J(we, { key: 0 })) : x("", !0)
1113
+ ]),
1114
+ a("span", null, Z(m.label), 1)
1115
+ ], 10, yn))), 128))
1116
+ ], 64)) : x("", !0),
1117
+ d.value === "audio" ? (r(!0), c(oe, { key: 5 }, pe(e.audioTracks, (m) => {
1118
+ var Q, Y, X;
1119
+ return r(), c("button", {
1120
+ key: m.index,
1121
+ type: "button",
1122
+ role: "menuitemradio",
1123
+ "aria-checked": m.index === (((Q = j.value) == null ? void 0 : Q.index) ?? -1),
1124
+ class: L([
1125
+ "gvp-settings-option",
1126
+ { "is-active": m.index === (((Y = j.value) == null ? void 0 : Y.index) ?? -1) }
1127
+ ]),
1128
+ onClick: (G) => K(m.index)
1129
+ }, [
1130
+ a("span", xn, [
1131
+ m.index === (((X = j.value) == null ? void 0 : X.index) ?? -1) ? (r(), J(we, { key: 0 })) : x("", !0)
1132
+ ]),
1133
+ a("span", null, Z(m.label), 1)
1134
+ ], 10, wn);
1135
+ }), 128)) : x("", !0)
1136
+ ])) : x("", !0)
1137
+ ], 512);
1138
+ };
1139
+ }
821
1140
  });
822
- function Ae(t) {
823
- if (!Number.isFinite(t) || t < 0) return "--:--";
824
- const a = Math.floor(t), n = Math.floor(a / 3600), e = Math.floor(a % 3600 / 60), o = (a % 60).toString().padStart(2, "0");
825
- if (n > 0) {
826
- const h = e.toString().padStart(2, "0");
827
- return `${n}:${h}:${o}`;
1141
+ function _e(e) {
1142
+ if (!Number.isFinite(e) || e < 0) return "--:--";
1143
+ const s = Math.floor(e), t = Math.floor(s / 3600), n = Math.floor(s % 3600 / 60), v = (s % 60).toString().padStart(2, "0");
1144
+ if (t > 0) {
1145
+ const d = n.toString().padStart(2, "0");
1146
+ return `${t}:${d}:${v}`;
828
1147
  }
829
- return `${e}:${o}`;
1148
+ return `${n}:${v}`;
830
1149
  }
831
- function qe(t) {
832
- const a = t.trim().split(":");
833
- if (a.length < 2 || a.length > 3) return NaN;
834
- const n = a.map(Number);
835
- return n.some((e) => !Number.isFinite(e)) ? NaN : n.length === 3 ? n[0] * 3600 + n[1] * 60 + n[2] : n[0] * 60 + n[1];
1150
+ function Fe(e) {
1151
+ const s = e.trim().split(":");
1152
+ if (s.length < 2 || s.length > 3) return NaN;
1153
+ const t = s.map(Number);
1154
+ return t.some((n) => !Number.isFinite(n)) ? NaN : t.length === 3 ? t[0] * 3600 + t[1] * 60 + t[2] : t[0] * 60 + t[1];
836
1155
  }
837
- function Rt(t, a) {
1156
+ function $n(e, s) {
838
1157
  try {
839
- return new URL(t, a).href;
1158
+ return new URL(e, s).href;
840
1159
  } catch {
841
- return t;
1160
+ return e;
842
1161
  }
843
1162
  }
844
- function Ot(t, a) {
845
- const n = [], e = t.replace(/\r/g, "").split(`
1163
+ function En(e, s) {
1164
+ const t = [], n = e.replace(/\r/g, "").split(`
846
1165
  `);
847
- for (let c = 0; c < e.length; c++) {
848
- const o = e[c].indexOf("-->");
849
- if (o === -1) continue;
850
- const h = qe(e[c].slice(0, o)), g = qe(e[c].slice(o + 3));
851
- if (!Number.isFinite(h) || !Number.isFinite(g)) continue;
852
- const E = (e[c + 1] ?? "").trim();
1166
+ for (let o = 0; o < n.length; o++) {
1167
+ const v = n[o].indexOf("-->");
1168
+ if (v === -1) continue;
1169
+ const d = Fe(n[o].slice(0, v)), h = Fe(n[o].slice(v + 3));
1170
+ if (!Number.isFinite(d) || !Number.isFinite(h)) continue;
1171
+ const E = (n[o + 1] ?? "").trim();
853
1172
  if (!E) continue;
854
- const _ = E.indexOf("#xywh=");
855
- let $ = E, S = 0, b = 0, m = 0, C = 0;
856
- if (_ !== -1) {
857
- $ = E.slice(0, _);
858
- const p = E.slice(_ + 6).split(",").map(Number);
859
- p.length === 4 && p.every(Number.isFinite) && ([S, b, m, C] = p);
860
- }
861
- n.push({ start: h, end: g, url: Rt($, a), x: S, y: b, w: m, h: C });
1173
+ const A = E.indexOf("#xywh=");
1174
+ let S = E, P = 0, w = 0, $ = 0, T = 0;
1175
+ if (A !== -1) {
1176
+ S = E.slice(0, A);
1177
+ const f = E.slice(A + 6).split(",").map(Number);
1178
+ f.length === 4 && f.every(Number.isFinite) && ([P, w, $, T] = f);
1179
+ }
1180
+ t.push({ start: d, end: h, url: $n(S, s), x: P, y: w, w: $, h: T });
862
1181
  }
863
- return n.sort((c, o) => c.start - o.start), n;
1182
+ return t.sort((o, v) => o.start - v.start), t;
864
1183
  }
865
- function Ut(t) {
1184
+ function _n(e) {
866
1185
  return {
867
- cues: t,
868
- cueAt(a) {
869
- if (t.length === 0) return null;
870
- let n = 0, e = t.length - 1, c = t[0];
871
- for (; n <= e; ) {
872
- const o = n + e >> 1, h = t[o];
873
- if (a < h.start)
874
- e = o - 1;
875
- else if (a > h.end)
876
- c = h, n = o + 1;
1186
+ cues: e,
1187
+ cueAt(s) {
1188
+ if (e.length === 0) return null;
1189
+ let t = 0, n = e.length - 1, o = e[0];
1190
+ for (; t <= n; ) {
1191
+ const v = t + n >> 1, d = e[v];
1192
+ if (s < d.start)
1193
+ n = v - 1;
1194
+ else if (s > d.end)
1195
+ o = d, t = v + 1;
877
1196
  else
878
- return h;
1197
+ return d;
879
1198
  }
880
- return c;
1199
+ return o;
881
1200
  }
882
1201
  };
883
1202
  }
884
- function De(t) {
885
- const a = t.trim().split(":");
886
- if (a.length < 2 || a.length > 3) return NaN;
887
- const n = a.map(Number);
888
- return n.some((e) => !Number.isFinite(e)) ? NaN : n.length === 3 ? n[0] * 3600 + n[1] * 60 + n[2] : n[0] * 60 + n[1];
1203
+ function qe(e) {
1204
+ const s = e.trim().split(":");
1205
+ if (s.length < 2 || s.length > 3) return NaN;
1206
+ const t = s.map(Number);
1207
+ return t.some((n) => !Number.isFinite(n)) ? NaN : t.length === 3 ? t[0] * 3600 + t[1] * 60 + t[2] : t[0] * 60 + t[1];
889
1208
  }
890
- function Zt(t) {
891
- const a = [], n = t.replace(/\r/g, "").split(`
1209
+ function Pn(e) {
1210
+ const s = [], t = e.replace(/\r/g, "").split(`
892
1211
  `);
893
- for (let e = 0; e < n.length; e++) {
894
- const c = n[e].indexOf("-->");
895
- if (c === -1) continue;
896
- const o = De(n[e].slice(0, c)), h = De(n[e].slice(c + 3));
897
- if (!Number.isFinite(o) || !Number.isFinite(h)) continue;
898
- const g = (n[e + 1] ?? "").trim();
899
- g && a.push({ start: o, end: h, title: g });
1212
+ for (let n = 0; n < t.length; n++) {
1213
+ const o = t[n].indexOf("-->");
1214
+ if (o === -1) continue;
1215
+ const v = qe(t[n].slice(0, o)), d = qe(t[n].slice(o + 3));
1216
+ if (!Number.isFinite(v) || !Number.isFinite(d)) continue;
1217
+ const h = (t[n + 1] ?? "").trim();
1218
+ h && s.push({ start: v, end: d, title: h });
900
1219
  }
901
- return a.sort((e, c) => e.start - c.start), a;
1220
+ return s.sort((n, o) => n.start - o.start), s;
902
1221
  }
903
- function jt(t, a) {
904
- const n = t.filter((e) => Number.isFinite(e.start) && e.start >= 0 && e.title).sort((e, c) => e.start - c.start);
905
- return n.map((e, c) => {
906
- var o;
1222
+ function Tn(e, s) {
1223
+ const t = e.filter((n) => Number.isFinite(n.start) && n.start >= 0 && n.title).sort((n, o) => n.start - o.start);
1224
+ return t.map((n, o) => {
1225
+ var v;
907
1226
  return {
908
- start: e.start,
909
- end: Number.isFinite(e.end) ? e.end : ((o = n[c + 1]) == null ? void 0 : o.start) ?? a,
910
- title: e.title
1227
+ start: n.start,
1228
+ end: Number.isFinite(n.end) ? n.end : ((v = t[o + 1]) == null ? void 0 : v.start) ?? s,
1229
+ title: n.title
911
1230
  };
912
1231
  });
913
1232
  }
914
- function Qt(t, a) {
915
- for (const n of t)
916
- if (a >= n.start && a < n.end) return n;
1233
+ function Mn(e, s) {
1234
+ for (const t of e)
1235
+ if (s >= t.start && s < t.end) return t;
917
1236
  return null;
918
1237
  }
919
- const Wt = { class: "gvp-controls-row" }, zt = ["disabled"], Yt = ["aria-label", "aria-pressed"], Kt = ["disabled"], Xt = {
1238
+ const In = { class: "gvp-controls-seek" }, An = {
920
1239
  key: 1,
921
1240
  class: "gvp-seek-preview-chapter"
922
- }, Jt = { class: "gvp-seek-preview-time" }, Gt = ["value", "disabled", "aria-valuemax", "aria-valuenow"], en = {
923
- class: "gvp-time",
924
- "aria-live": "off"
925
- }, tn = ["aria-expanded", "aria-label"], nn = { class: "gvp-speed-label" }, ln = {
926
- key: 0,
927
- class: "gvp-speed-menu",
928
- role: "listbox",
929
- "aria-label": "Playback speed"
930
- }, an = ["aria-selected", "onClick"], on = ["aria-expanded", "aria-label"], sn = { class: "gvp-quality-label" }, rn = {
931
- key: 0,
932
- class: "gvp-quality-menu",
933
- role: "listbox",
934
- "aria-label": "Quality"
935
- }, un = ["aria-selected"], cn = ["aria-selected", "onClick"], dn = ["aria-expanded", "aria-pressed"], vn = {
936
- key: 0,
937
- class: "gvp-captions-menu",
938
- role: "listbox",
939
- "aria-label": "Captions"
940
- }, pn = ["aria-selected"], fn = ["aria-selected", "onClick"], mn = ["aria-label", "aria-pressed"], hn = {
1241
+ }, Sn = { class: "gvp-seek-preview-time" }, Nn = ["value", "disabled", "aria-valuemax", "aria-valuenow", "aria-valuetext"], Hn = { class: "gvp-controls-row" }, Vn = { class: "gvp-controls-left" }, Bn = ["aria-label", "aria-pressed"], Rn = ["disabled"], Dn = ["disabled"], Fn = ["aria-label", "aria-pressed"], qn = {
941
1242
  key: 0,
942
1243
  class: "gvp-volume-slider-wrap"
943
- }, gn = { class: "gvp-volume-track" }, kn = ["value", "aria-valuenow"], yn = ["aria-label", "aria-pressed"], wn = ["aria-label", "aria-pressed"], bn = 3e3, Cn = /* @__PURE__ */ I({
1244
+ }, On = { class: "gvp-volume-track" }, jn = ["value", "aria-valuenow", "aria-valuetext"], Un = {
1245
+ key: 2,
1246
+ class: "gvp-time",
1247
+ "aria-live": "off"
1248
+ }, Zn = ["disabled", "aria-label"], zn = { class: "gvp-controls-right" }, Wn = ["aria-label", "aria-pressed"], Kn = ["aria-label", "aria-pressed"], Qn = 3e3, Yn = 10, Gn = /* @__PURE__ */ N({
944
1249
  __name: "ControlBar",
945
1250
  props: {
946
1251
  video: {},
@@ -953,554 +1258,408 @@ const Wt = { class: "gvp-controls-row" }, zt = ["disabled"], Yt = ["aria-label",
953
1258
  thumbnails: {},
954
1259
  chapters: {},
955
1260
  hasPrev: { type: Boolean, default: !1 },
956
- hasNext: { type: Boolean, default: !1 }
1261
+ hasNext: { type: Boolean, default: !1 },
1262
+ isLive: { type: Boolean, default: !1 },
1263
+ audioTracks: { default: () => [] },
1264
+ audioTrackIndex: { default: -1 }
957
1265
  },
958
- emits: ["select-level", "prev", "next"],
959
- setup(t, { emit: a }) {
960
- const n = (() => {
1266
+ emits: ["select-level", "select-audio-track", "prev", "next"],
1267
+ setup(e, { emit: s }) {
1268
+ const t = (() => {
961
1269
  if (typeof navigator > "u") return !1;
962
- const l = navigator.userAgent;
963
- return /iPad|iPhone|iPod/.test(l) || l.includes("Mac") && navigator.maxTouchPoints > 1;
964
- })(), e = typeof navigator > "u" ? !1 : /iPhone|iPod/.test(navigator.userAgent), c = [0.5, 0.75, 1, 1.25, 1.5, 2], o = t, h = a, g = y(!0);
965
- let E = null;
966
- function _() {
967
- E !== null && (clearTimeout(E), E = null);
968
- }
969
- function $() {
970
- _(), o.isPlaying && (E = setTimeout(() => {
971
- g.value = !1;
972
- }, bn));
1270
+ const u = navigator.userAgent;
1271
+ return /iPad|iPhone|iPod/.test(u) || u.includes("Mac") && navigator.maxTouchPoints > 1;
1272
+ })(), n = typeof navigator > "u" ? !1 : /iPhone|iPod/.test(navigator.userAgent), o = e, v = s, d = g(!0);
1273
+ let h = null;
1274
+ function E() {
1275
+ h !== null && (clearTimeout(h), h = null);
1276
+ }
1277
+ function A() {
1278
+ E(), o.isPlaying && (h = setTimeout(() => {
1279
+ d.value = !1;
1280
+ }, Qn));
973
1281
  }
974
1282
  function S() {
975
- g.value = !0, $();
1283
+ d.value = !0, A();
976
1284
  }
977
- R(() => o.isPlaying, (l) => {
978
- l ? $() : (_(), g.value = !0);
979
- }, { immediate: !0 }), R(() => o.container, (l) => {
980
- if (!l) return;
981
- const s = () => S();
982
- l.addEventListener("mousemove", s), l.addEventListener("touchstart", s), l.addEventListener("focusin", s);
1285
+ V(() => o.isPlaying, (u) => {
1286
+ u ? A() : (E(), d.value = !0);
1287
+ }, { immediate: !0 }), V(() => o.container, (u) => {
1288
+ if (!u) return;
1289
+ const b = () => S();
1290
+ u.addEventListener("mousemove", b), u.addEventListener("touchstart", b), u.addEventListener("focusin", b);
983
1291
  }, { immediate: !0 });
984
- const b = y(0), m = y(0), C = y(0);
985
- R(() => o.video, (l) => {
986
- if (!l) return;
987
- const s = () => {
988
- b.value = l.currentTime;
989
- }, i = () => {
990
- m.value = Number.isFinite(l.duration) ? l.duration : 0;
991
- }, L = () => {
992
- const F = l.buffered;
993
- if (!F || F.length === 0) {
994
- C.value = 0;
1292
+ const P = g(0), w = g(0), $ = g(0), T = g(!1), f = g(!0), M = I(() => o.isLive || T.value);
1293
+ V(() => o.video, (u) => {
1294
+ if (!u) return;
1295
+ const b = () => {
1296
+ P.value = u.currentTime;
1297
+ }, _ = () => {
1298
+ w.value = Number.isFinite(u.duration) ? u.duration : 0;
1299
+ }, te = () => {
1300
+ const q = u.buffered;
1301
+ if (!q || q.length === 0) {
1302
+ $.value = 0;
995
1303
  return;
996
1304
  }
997
- let Be = F.end(F.length - 1);
998
- for (let ye = 0; ye < F.length; ye++)
999
- if (F.start(ye) <= l.currentTime && l.currentTime <= F.end(ye)) {
1000
- Be = F.end(ye);
1305
+ let ke = q.end(q.length - 1);
1306
+ for (let ve = 0; ve < q.length; ve++)
1307
+ if (q.start(ve) <= u.currentTime && u.currentTime <= q.end(ve)) {
1308
+ ke = q.end(ve);
1001
1309
  break;
1002
1310
  }
1003
- C.value = Be;
1311
+ $.value = ke;
1312
+ }, he = () => {
1313
+ if (T.value = !Number.isFinite(u.duration) && u.duration > 0, M.value && u.seekable.length > 0) {
1314
+ const q = u.seekable.end(u.seekable.length - 1);
1315
+ f.value = q - u.currentTime <= Yn;
1316
+ }
1004
1317
  };
1005
- s(), i(), L(), l.addEventListener("timeupdate", s), l.addEventListener("durationchange", i), l.addEventListener("loadedmetadata", i), l.addEventListener("progress", L), l.addEventListener("timeupdate", L);
1318
+ b(), _(), te(), he(), u.addEventListener("timeupdate", b), u.addEventListener("durationchange", _), u.addEventListener("loadedmetadata", _), u.addEventListener("progress", te), u.addEventListener("timeupdate", te), u.addEventListener("durationchange", he), u.addEventListener("loadedmetadata", he), u.addEventListener("timeupdate", he);
1006
1319
  }, { immediate: !0 });
1007
- const p = () => m.value > 0, x = () => p() ? b.value / m.value * 100 : 0, B = () => p() ? C.value / m.value * 100 : 0;
1008
- function Y(l) {
1009
- const s = o.video;
1010
- if (!s || !p()) return;
1011
- const i = Number(l.target.value) / 100 * m.value;
1012
- s.currentTime = i, b.value = i;
1013
- }
1014
- const A = y(null), J = y(null), k = y(0), N = y(0), D = y(!1);
1015
- R(() => o.thumbnails, (l) => {
1016
- if (A.value = null, !l) return;
1017
- let s = !1;
1018
- fetch(l).then((i) => i.ok ? i.text() : Promise.reject(new Error("fetch failed"))).then((i) => {
1019
- if (s) return;
1020
- const L = Ot(i, new URL(l, location.href).href);
1021
- A.value = L.length > 0 ? Ut(L) : null;
1320
+ function z() {
1321
+ const u = o.video;
1322
+ !u || u.seekable.length === 0 || (u.currentTime = u.seekable.end(u.seekable.length - 1));
1323
+ }
1324
+ const j = () => w.value > 0, K = () => j() ? P.value / w.value * 100 : 0, re = () => j() ? $.value / w.value * 100 : 0;
1325
+ function C(u) {
1326
+ const b = o.video;
1327
+ if (!b || !j()) return;
1328
+ const _ = Number(u.target.value) / 100 * w.value;
1329
+ b.currentTime = _, P.value = _;
1330
+ }
1331
+ const W = g(null), B = g(null), D = g(0), F = g(0), H = g(!1);
1332
+ V(() => o.thumbnails, (u) => {
1333
+ if (W.value = null, !u) return;
1334
+ let b = !1;
1335
+ fetch(u).then((_) => _.ok ? _.text() : Promise.reject(new Error("fetch failed"))).then((_) => {
1336
+ if (b) return;
1337
+ const te = En(_, new URL(u, location.href).href);
1338
+ W.value = te.length > 0 ? _n(te) : null;
1022
1339
  }).catch(() => {
1023
- s || (A.value = null);
1024
- }), ne(() => {
1025
- s = !0;
1340
+ b || (W.value = null);
1341
+ }), ae(() => {
1342
+ b = !0;
1026
1343
  });
1027
1344
  }, { immediate: !0 });
1028
- function H(l) {
1029
- const s = J.value;
1030
- if (!s || !p()) return;
1031
- const i = s.getBoundingClientRect(), L = Math.min(Math.max(l.clientX - i.left, 0), i.width);
1032
- N.value = L, k.value = L / i.width * m.value, D.value = !0;
1345
+ function R(u) {
1346
+ const b = B.value;
1347
+ if (!b || !j()) return;
1348
+ const _ = b.getBoundingClientRect(), te = Math.min(Math.max(u.clientX - _.left, 0), _.width);
1349
+ F.value = te, D.value = te / _.width * w.value, H.value = !0;
1033
1350
  }
1034
- function V() {
1035
- D.value = !1;
1351
+ function fe() {
1352
+ H.value = !1;
1036
1353
  }
1037
- const O = T(
1354
+ const y = I(
1038
1355
  () => {
1039
- var l;
1040
- return D.value ? ((l = A.value) == null ? void 0 : l.cueAt(k.value)) ?? null : null;
1356
+ var u;
1357
+ return H.value ? ((u = W.value) == null ? void 0 : u.cueAt(D.value)) ?? null : null;
1041
1358
  }
1042
- ), me = T(() => {
1043
- const l = O.value;
1044
- return l !== null && l.w > 0 && l.h > 0;
1045
- }), Pe = T(() => {
1046
- var L;
1047
- const l = O.value, s = ((L = J.value) == null ? void 0 : L.clientWidth) ?? 0;
1048
- if (!me.value || !l || s === 0) return N.value;
1049
- const i = l.w / 2;
1050
- return Math.min(Math.max(N.value, i), s - i);
1051
- }), oe = y([]);
1052
- R(() => o.chapters, (l) => {
1053
- if (oe.value = [], typeof l != "string" || !l) return;
1054
- let s = !1;
1055
- fetch(l).then((i) => i.ok ? i.text() : Promise.reject(new Error("fetch failed"))).then((i) => {
1056
- s || (oe.value = Zt(i));
1359
+ ), p = I(() => {
1360
+ const u = y.value;
1361
+ return u !== null && u.w > 0 && u.h > 0;
1362
+ }), ee = I(() => {
1363
+ var te;
1364
+ const u = y.value, b = ((te = B.value) == null ? void 0 : te.clientWidth) ?? 0;
1365
+ if (!p.value || !u || b === 0) return F.value;
1366
+ const _ = u.w / 2;
1367
+ return Math.min(Math.max(F.value, _), b - _);
1368
+ }), m = g([]);
1369
+ V(() => o.chapters, (u) => {
1370
+ if (m.value = [], typeof u != "string" || !u) return;
1371
+ let b = !1;
1372
+ fetch(u).then((_) => _.ok ? _.text() : Promise.reject(new Error("fetch failed"))).then((_) => {
1373
+ b || (m.value = Pn(_));
1057
1374
  }).catch(() => {
1058
- s || (oe.value = []);
1059
- }), ne(() => {
1060
- s = !0;
1375
+ b || (m.value = []);
1376
+ }), ae(() => {
1377
+ b = !0;
1061
1378
  });
1062
1379
  }, { immediate: !0 });
1063
- const ce = T(() => typeof o.chapters == "string" ? oe.value : Array.isArray(o.chapters) ? jt(o.chapters, m.value) : []), de = T(
1064
- () => D.value ? Qt(ce.value, k.value) : null
1065
- ), K = y(1), q = y(!1);
1066
- R(() => o.video, (l) => {
1067
- if (!l) return;
1068
- const s = () => {
1069
- K.value = l.volume, q.value = l.muted;
1380
+ const Q = I(() => typeof o.chapters == "string" ? m.value : Array.isArray(o.chapters) ? Tn(o.chapters, w.value) : []), Y = I(
1381
+ () => H.value ? Mn(Q.value, D.value) : null
1382
+ ), X = g(1), G = g(!1);
1383
+ V(() => o.video, (u) => {
1384
+ if (!u) return;
1385
+ const b = () => {
1386
+ X.value = u.volume, G.value = u.muted;
1070
1387
  };
1071
- s(), l.addEventListener("volumechange", s);
1388
+ b(), u.addEventListener("volumechange", b);
1072
1389
  }, { immediate: !0 });
1073
- function Me() {
1390
+ function ge() {
1074
1391
  o.video && (o.video.muted = !o.video.muted);
1075
1392
  }
1076
- function Te(l) {
1077
- const s = o.video;
1078
- if (!s) return;
1079
- const i = Number(l.target.value) / 100;
1080
- s.volume = i, i > 0 && s.muted && (s.muted = !1);
1393
+ function ue(u) {
1394
+ const b = o.video;
1395
+ if (!b) return;
1396
+ const _ = Number(u.target.value) / 100;
1397
+ b.volume = _, _ > 0 && b.muted && (b.muted = !1);
1081
1398
  }
1082
- const X = y(1), le = y(!1), we = y(null);
1083
- R(() => o.video, (l) => {
1084
- if (!l) return;
1085
- const s = () => {
1086
- X.value = l.playbackRate;
1087
- };
1088
- s(), l.addEventListener("ratechange", s);
1089
- }, { immediate: !0 });
1090
- function Ie(l) {
1091
- o.video && (o.video.playbackRate = l), X.value = l, le.value = !1;
1092
- }
1093
- const ae = y(!1), Q = y(null), he = T(() => o.qualityLevels.length >= 2), be = T(
1094
- () => [...o.qualityLevels].sort((l, s) => s.height - l.height)
1095
- ), ve = T(
1096
- () => o.qualityLevels.find((l) => l.index === o.currentLevel)
1097
- ), Ce = T(() => {
1098
- if (o.selectedLevel < 0)
1099
- return ve.value ? `Auto (${ve.value.label})` : "Auto";
1100
- const l = o.qualityLevels.find((s) => s.index === o.selectedLevel);
1101
- return (l == null ? void 0 : l.label) ?? "Auto";
1102
- });
1103
- function se(l) {
1104
- h("select-level", l), ae.value = !1;
1105
- }
1106
- const pe = y([]), W = y(-1), G = y(!1), xe = y(null);
1107
- function ge(l) {
1108
- const s = [];
1109
- for (let L = 0; L < l.length; L++) {
1110
- const F = l[L];
1111
- (F.kind === "subtitles" || F.kind === "captions") && s.push({ index: L, label: F.label || F.language || `Track ${L + 1}` });
1112
- }
1113
- pe.value = s;
1114
- let i = -1;
1115
- for (let L = 0; L < l.length; L++)
1116
- if (l[L].mode === "showing") {
1117
- i = L;
1118
- break;
1119
- }
1120
- W.value = i;
1121
- }
1122
- R(() => o.video, (l) => {
1123
- if (!l) {
1124
- pe.value = [], W.value = -1;
1125
- return;
1126
- }
1127
- const s = l.textTracks;
1128
- ge(s);
1129
- const i = () => ge(s);
1130
- typeof s.addEventListener == "function" && (s.addEventListener("addtrack", i), s.addEventListener("removetrack", i), s.addEventListener("change", i));
1131
- }, { immediate: !0 });
1132
- function Le(l) {
1133
- var i;
1134
- const s = (i = o.video) == null ? void 0 : i.textTracks;
1135
- if (s) {
1136
- for (let L = 0; L < s.length; L++) s[L].mode = L === l ? "showing" : "hidden";
1137
- W.value = l, G.value = !1;
1138
- }
1139
- }
1140
- function u() {
1141
- var s;
1142
- const l = (s = o.video) == null ? void 0 : s.textTracks;
1143
- if (l) {
1144
- for (let i = 0; i < l.length; i++) l[i].mode = "hidden";
1145
- W.value = -1, G.value = !1;
1146
- }
1147
- }
1148
- const v = y(!1), P = typeof document < "u" && !!document.pictureInPictureEnabled;
1149
- R(() => o.video, (l) => {
1150
- l && (l.addEventListener("enterpictureinpicture", () => {
1151
- v.value = !0;
1152
- }), l.addEventListener("leavepictureinpicture", () => {
1153
- v.value = !1;
1399
+ const me = g(!1), Ie = typeof document < "u" && !!document.pictureInPictureEnabled;
1400
+ V(() => o.video, (u) => {
1401
+ u && (u.addEventListener("enterpictureinpicture", () => {
1402
+ me.value = !0;
1403
+ }), u.addEventListener("leavepictureinpicture", () => {
1404
+ me.value = !1;
1154
1405
  }));
1155
1406
  }, { immediate: !0 });
1156
- function fe() {
1407
+ function Ae() {
1157
1408
  o.video && (document.pictureInPictureElement ? document.exitPictureInPicture().catch(() => {
1158
1409
  }) : o.video.requestPictureInPicture().catch(() => {
1159
1410
  }));
1160
1411
  }
1161
- const j = y(!1), Ee = typeof document > "u" ? !1 : !!(document.fullscreenEnabled || document.webkitFullscreenEnabled);
1162
- function Se() {
1412
+ const de = g(!1), Pe = typeof document > "u" ? !1 : !!(document.fullscreenEnabled || document.webkitFullscreenEnabled);
1413
+ function xe() {
1163
1414
  return document.fullscreenElement ?? document.webkitFullscreenElement ?? null;
1164
1415
  }
1165
- function _e(l) {
1166
- const s = l.requestFullscreen ?? l.webkitRequestFullscreen;
1167
- return s ? s.call(l) : Promise.reject(new Error("unsupported"));
1416
+ function Ce(u) {
1417
+ const b = u.requestFullscreen ?? u.webkitRequestFullscreen;
1418
+ return b ? b.call(u) : Promise.reject(new Error("unsupported"));
1168
1419
  }
1169
- function ke() {
1170
- const l = document.exitFullscreen ?? document.webkitExitFullscreen;
1171
- return l ? l.call(document) : Promise.reject(new Error("unsupported"));
1420
+ function Le() {
1421
+ const u = document.exitFullscreen ?? document.webkitExitFullscreen;
1422
+ return u ? u.call(document) : Promise.reject(new Error("unsupported"));
1172
1423
  }
1173
- function $e() {
1174
- j.value = Se() === o.container;
1424
+ function U() {
1425
+ de.value = xe() === o.container;
1175
1426
  }
1176
1427
  He(() => {
1177
- document.addEventListener("fullscreenchange", $e), document.addEventListener("webkitfullscreenchange", $e);
1178
- }), ne(() => {
1179
- _(), document.removeEventListener("fullscreenchange", $e), document.removeEventListener("webkitfullscreenchange", $e);
1428
+ document.addEventListener("fullscreenchange", U), document.addEventListener("webkitfullscreenchange", U);
1429
+ }), ae(() => {
1430
+ E(), document.removeEventListener("fullscreenchange", U), document.removeEventListener("webkitfullscreenchange", U);
1180
1431
  });
1181
- function je() {
1182
- var l, s;
1183
- if (e) {
1184
- (s = (l = o.video) == null ? void 0 : l.webkitEnterFullscreen) == null || s.call(l);
1432
+ function Se() {
1433
+ var u, b;
1434
+ if (n) {
1435
+ (b = (u = o.video) == null ? void 0 : u.webkitEnterFullscreen) == null || b.call(u);
1185
1436
  return;
1186
1437
  }
1187
- j.value ? ke().catch(() => {
1188
- }) : o.container && _e(o.container).catch(() => {
1438
+ de.value ? Le().catch(() => {
1439
+ }) : o.container && Ce(o.container).catch(() => {
1189
1440
  });
1190
1441
  }
1191
- const Qe = Ee || e && o.video !== null && typeof o.video.webkitEnterFullscreen == "function";
1192
- function Ne(l, s) {
1193
- function i(F) {
1194
- s.value && !s.value.contains(F.target) && (l.value = !1);
1195
- }
1196
- function L(F) {
1197
- F.key === "Escape" && (l.value = !1);
1198
- }
1199
- R(l, (F) => {
1200
- F ? (document.addEventListener("mousedown", i), document.addEventListener("keydown", L)) : (document.removeEventListener("mousedown", i), document.removeEventListener("keydown", L));
1201
- }), ne(() => {
1202
- document.removeEventListener("mousedown", i), document.removeEventListener("keydown", L);
1203
- });
1204
- }
1205
- return Ne(le, we), Ne(G, xe), Ne(ae, Q), (l, s) => (d(), f("div", {
1442
+ const Ne = Pe || n && o.video !== null && typeof o.video.webkitEnterFullscreen == "function";
1443
+ return (u, b) => (r(), c("div", {
1206
1444
  role: "toolbar",
1207
1445
  "aria-label": "Video controls",
1208
- class: w(["gvp-controls", !g.value && "is-hidden"]),
1209
- onMouseenter: _,
1210
- onMouseleave: $
1446
+ class: L(["gvp-controls", !d.value && "is-hidden"]),
1447
+ onMouseenter: E,
1448
+ onMouseleave: A
1211
1449
  }, [
1212
- r("div", Wt, [
1213
- t.hasPrev || t.hasNext ? (d(), f("button", {
1214
- key: 0,
1215
- type: "button",
1216
- class: "gvp-ctrl-btn",
1217
- "aria-label": "Previous video",
1218
- disabled: !t.hasPrev,
1219
- onClick: s[0] || (s[0] = (i) => h("prev"))
1220
- }, [
1221
- Z(Et)
1222
- ], 8, zt)) : M("", !0),
1223
- r("button", {
1224
- type: "button",
1225
- class: "gvp-ctrl-btn",
1226
- "aria-label": t.isPlaying ? "Pause" : "Play",
1227
- "aria-pressed": t.isPlaying,
1228
- onClick: s[1] || (s[1] = //@ts-ignore
1229
- (...i) => t.onTogglePlay && t.onTogglePlay(...i))
1230
- }, [
1231
- t.isPlaying ? (d(), z(bt, { key: 0 })) : (d(), z(xt, { key: 1 }))
1232
- ], 8, Yt),
1233
- t.hasPrev || t.hasNext ? (d(), f("button", {
1234
- key: 1,
1235
- type: "button",
1236
- class: "gvp-ctrl-btn",
1237
- "aria-label": "Next video",
1238
- disabled: !t.hasNext,
1239
- onClick: s[2] || (s[2] = (i) => h("next"))
1240
- }, [
1241
- Z($t)
1242
- ], 8, Kt)) : M("", !0),
1243
- r("div", {
1450
+ a("div", In, [
1451
+ a("div", {
1244
1452
  class: "gvp-seek",
1245
- onPointermove: H,
1246
- onPointerleave: V
1453
+ onPointermove: R,
1454
+ onPointerleave: fe
1247
1455
  }, [
1248
- r("div", {
1456
+ a("div", {
1249
1457
  ref_key: "seekTrackEl",
1250
- ref: J,
1458
+ ref: B,
1251
1459
  class: "gvp-seek-track"
1252
1460
  }, [
1253
- r("div", {
1461
+ a("div", {
1254
1462
  class: "gvp-seek-buffered",
1255
- style: re({ width: `${B()}%` })
1463
+ style: ce({ width: `${re()}%` })
1256
1464
  }, null, 4),
1257
- r("div", {
1465
+ a("div", {
1258
1466
  class: "gvp-seek-progress",
1259
- style: re({ width: `${x()}%` })
1467
+ style: ce({ width: `${K()}%` })
1260
1468
  }, null, 4),
1261
- p() ? (d(!0), f(ie, { key: 0 }, ue(ce.value, (i) => We((d(), f("div", {
1262
- key: `${i.start}-${i.title}`,
1469
+ j() ? (r(!0), c(oe, { key: 0 }, pe(Q.value, (_) => at((r(), c("div", {
1470
+ key: `${_.start}-${_.title}`,
1263
1471
  class: "gvp-seek-chapter-tick",
1264
- style: re({ left: `${i.start / m.value * 100}%` })
1472
+ style: ce({ left: `${_.start / w.value * 100}%` })
1265
1473
  }, null, 4)), [
1266
- [ze, i.start > 0 && i.start < m.value]
1267
- ])), 128)) : M("", !0)
1474
+ [rt, _.start > 0 && _.start < w.value]
1475
+ ])), 128)) : x("", !0)
1268
1476
  ], 512),
1269
- D.value && p() ? (d(), f("div", {
1477
+ H.value && j() ? (r(), c("div", {
1270
1478
  key: 0,
1271
- class: w(["gvp-seek-preview", { "has-thumb": me.value }]),
1272
- style: re({ left: `${Pe.value}px` })
1479
+ class: L(["gvp-seek-preview", { "has-thumb": p.value }]),
1480
+ style: ce({ left: `${ee.value}px` })
1273
1481
  }, [
1274
- me.value && O.value ? (d(), f("div", {
1482
+ p.value && y.value ? (r(), c("div", {
1275
1483
  key: 0,
1276
1484
  class: "gvp-seek-preview-thumb",
1277
- style: re({
1278
- width: `${O.value.w}px`,
1279
- height: `${O.value.h}px`,
1280
- backgroundImage: `url(${JSON.stringify(O.value.url)})`,
1281
- backgroundPosition: `-${O.value.x}px -${O.value.y}px`
1485
+ style: ce({
1486
+ width: `${y.value.w}px`,
1487
+ height: `${y.value.h}px`,
1488
+ backgroundImage: `url(${JSON.stringify(y.value.url)})`,
1489
+ backgroundPosition: `-${y.value.x}px -${y.value.y}px`
1282
1490
  })
1283
- }, null, 4)) : M("", !0),
1284
- de.value ? (d(), f("span", Xt, U(de.value.title), 1)) : M("", !0),
1285
- r("span", Jt, U(te(Ae)(k.value)), 1)
1286
- ], 6)) : M("", !0),
1287
- r("input", {
1491
+ }, null, 4)) : x("", !0),
1492
+ Y.value ? (r(), c("span", An, Z(Y.value.title), 1)) : x("", !0),
1493
+ a("span", Sn, Z(le(_e)(D.value)), 1)
1494
+ ], 6)) : x("", !0),
1495
+ a("input", {
1288
1496
  type: "range",
1289
1497
  class: "gvp-seek-input",
1290
1498
  min: 0,
1291
1499
  max: 100,
1292
1500
  step: 0.1,
1293
- value: x(),
1294
- disabled: !p(),
1501
+ value: K(),
1502
+ disabled: !j(),
1295
1503
  "aria-label": "Seek",
1296
1504
  "aria-valuemin": 0,
1297
- "aria-valuemax": Math.floor(m.value),
1298
- "aria-valuenow": Math.floor(b.value),
1299
- onInput: Y
1300
- }, null, 40, Gt)
1301
- ], 32),
1302
- r("span", en, U(te(Ae)(b.value)) + " / " + U(te(Ae)(m.value)), 1),
1303
- r("div", {
1304
- ref_key: "speedRootEl",
1305
- ref: we,
1306
- class: "gvp-speed"
1307
- }, [
1308
- r("button", {
1505
+ "aria-valuemax": Math.floor(w.value),
1506
+ "aria-valuenow": Math.floor(P.value),
1507
+ "aria-valuetext": `${le(_e)(P.value)} of ${le(_e)(w.value)}`,
1508
+ onInput: C
1509
+ }, null, 40, Nn)
1510
+ ], 32)
1511
+ ]),
1512
+ a("div", Hn, [
1513
+ a("div", Vn, [
1514
+ a("button", {
1309
1515
  type: "button",
1310
- class: "gvp-ctrl-btn gvp-speed-btn",
1311
- "aria-haspopup": "listbox",
1312
- "aria-expanded": le.value,
1313
- "aria-label": `Playback speed: ${X.value === 1 ? "1×" : X.value + "×"}`,
1314
- onClick: s[3] || (s[3] = (i) => le.value = !le.value)
1516
+ class: "gvp-ctrl-btn",
1517
+ "aria-label": e.isPlaying ? "Pause" : "Play",
1518
+ "aria-pressed": e.isPlaying,
1519
+ onClick: b[0] || (b[0] = //@ts-ignore
1520
+ (..._) => e.onTogglePlay && e.onTogglePlay(..._))
1315
1521
  }, [
1316
- Z(Oe),
1317
- r("span", nn, U(X.value === 1 ? "1×" : `${X.value}×`), 1)
1318
- ], 8, tn),
1319
- le.value ? (d(), f("ul", ln, [
1320
- (d(), f(ie, null, ue(c, (i) => r("li", { key: i }, [
1321
- r("button", {
1322
- type: "button",
1323
- role: "option",
1324
- "aria-selected": i === X.value,
1325
- class: w(["gvp-speed-menu-item", { "is-active": i === X.value }]),
1326
- onClick: (L) => Ie(i)
1327
- }, U(i === 1 ? "Normal" : `${i}×`), 11, an)
1328
- ])), 64))
1329
- ])) : M("", !0)
1330
- ], 512),
1331
- he.value ? (d(), f("div", {
1332
- key: 2,
1333
- ref_key: "qualityRootEl",
1334
- ref: Q,
1335
- class: "gvp-quality"
1336
- }, [
1337
- r("button", {
1522
+ e.isPlaying ? (r(), J(Vt, { key: 0 })) : (r(), J(Rt, { key: 1 }))
1523
+ ], 8, Bn),
1524
+ e.hasPrev || e.hasNext ? (r(), c("button", {
1525
+ key: 0,
1338
1526
  type: "button",
1339
- class: "gvp-ctrl-btn gvp-quality-btn",
1340
- "aria-haspopup": "listbox",
1341
- "aria-expanded": ae.value,
1342
- "aria-label": `Quality: ${Ce.value}`,
1343
- onClick: s[4] || (s[4] = (i) => ae.value = !ae.value)
1527
+ class: "gvp-ctrl-btn",
1528
+ "aria-label": "Previous video",
1529
+ disabled: !e.hasPrev,
1530
+ onClick: b[1] || (b[1] = (_) => v("prev"))
1344
1531
  }, [
1345
- Z(Ht),
1346
- r("span", sn, U(Ce.value), 1)
1347
- ], 8, on),
1348
- ae.value ? (d(), f("ul", rn, [
1349
- r("li", null, [
1350
- r("button", {
1351
- type: "button",
1352
- role: "option",
1353
- "aria-selected": t.selectedLevel < 0,
1354
- class: w(["gvp-quality-menu-item", { "is-active": t.selectedLevel < 0 }]),
1355
- onClick: s[5] || (s[5] = (i) => se(te(Ke).index))
1356
- }, U(ve.value ? `Auto (${ve.value.label})` : "Auto"), 11, un)
1357
- ]),
1358
- (d(!0), f(ie, null, ue(be.value, (i) => (d(), f("li", {
1359
- key: i.index
1360
- }, [
1361
- r("button", {
1362
- type: "button",
1363
- role: "option",
1364
- "aria-selected": i.index === t.selectedLevel,
1365
- class: w(["gvp-quality-menu-item", { "is-active": i.index === t.selectedLevel }]),
1366
- onClick: (L) => se(i.index)
1367
- }, U(i.label), 11, cn)
1368
- ]))), 128))
1369
- ])) : M("", !0)
1370
- ], 512)) : M("", !0),
1371
- pe.value.length > 0 ? (d(), f("div", {
1372
- key: 3,
1373
- ref_key: "captionsRootEl",
1374
- ref: xe,
1375
- class: "gvp-captions"
1376
- }, [
1377
- r("button", {
1532
+ O(Ft)
1533
+ ], 8, Rn)) : x("", !0),
1534
+ e.hasPrev || e.hasNext ? (r(), c("button", {
1535
+ key: 1,
1378
1536
  type: "button",
1379
- class: w(["gvp-ctrl-btn", W.value >= 0 && "is-active"]),
1380
- "aria-haspopup": "listbox",
1381
- "aria-expanded": G.value,
1382
- "aria-label": "Captions",
1383
- "aria-pressed": W.value >= 0,
1384
- onClick: s[6] || (s[6] = (i) => G.value = !G.value)
1537
+ class: "gvp-ctrl-btn",
1538
+ "aria-label": "Next video",
1539
+ disabled: !e.hasNext,
1540
+ onClick: b[2] || (b[2] = (_) => v("next"))
1385
1541
  }, [
1386
- Z(Ue)
1387
- ], 10, dn),
1388
- G.value ? (d(), f("ul", vn, [
1389
- r("li", null, [
1390
- r("button", {
1391
- type: "button",
1392
- role: "option",
1393
- "aria-selected": W.value === -1,
1394
- class: w(["gvp-captions-menu-item", { "is-active": W.value === -1 }]),
1395
- onClick: u
1396
- }, "Off", 10, pn)
1397
- ]),
1398
- (d(!0), f(ie, null, ue(pe.value, (i) => (d(), f("li", {
1399
- key: i.index
1542
+ O(Ot)
1543
+ ], 8, Dn)) : x("", !0),
1544
+ a("div", {
1545
+ class: L(["gvp-volume", !le(t) && "is-expandable"])
1546
+ }, [
1547
+ a("button", {
1548
+ type: "button",
1549
+ class: "gvp-ctrl-btn",
1550
+ "aria-label": G.value ? "Unmute" : "Mute",
1551
+ "aria-pressed": G.value,
1552
+ onClick: ge
1400
1553
  }, [
1401
- r("button", {
1402
- type: "button",
1403
- role: "option",
1404
- "aria-selected": i.index === W.value,
1405
- class: w(["gvp-captions-menu-item", { "is-active": i.index === W.value }]),
1406
- onClick: (L) => Le(i.index)
1407
- }, U(i.label), 11, fn)
1408
- ]))), 128))
1409
- ])) : M("", !0)
1410
- ], 512)) : M("", !0),
1411
- r("div", {
1412
- class: w(["gvp-volume", !te(n) && "is-expandable"])
1413
- }, [
1414
- r("button", {
1554
+ G.value || X.value === 0 ? (r(), J(Kt, { key: 0 })) : X.value < 0.5 ? (r(), J(zt, { key: 1 })) : (r(), J(Ut, { key: 2 }))
1555
+ ], 8, Fn),
1556
+ le(t) ? x("", !0) : (r(), c("div", qn, [
1557
+ a("div", On, [
1558
+ a("div", {
1559
+ class: "gvp-volume-fill",
1560
+ style: ce({ width: `${G.value ? 0 : Math.round(X.value * 100)}%` })
1561
+ }, null, 4)
1562
+ ]),
1563
+ a("input", {
1564
+ type: "range",
1565
+ class: "gvp-volume-input",
1566
+ min: 0,
1567
+ max: 100,
1568
+ step: 1,
1569
+ value: G.value ? 0 : Math.round(X.value * 100),
1570
+ "aria-label": "Volume",
1571
+ "aria-valuemin": 0,
1572
+ "aria-valuemax": 100,
1573
+ "aria-valuenow": G.value ? 0 : Math.round(X.value * 100),
1574
+ "aria-valuetext": `${G.value ? 0 : Math.round(X.value * 100)}%`,
1575
+ onInput: ue
1576
+ }, null, 40, jn)
1577
+ ]))
1578
+ ], 2),
1579
+ M.value ? x("", !0) : (r(), c("span", Un, Z(le(_e)(P.value)) + " / " + Z(le(_e)(w.value)), 1)),
1580
+ M.value ? (r(), c("button", {
1581
+ key: 3,
1415
1582
  type: "button",
1416
- class: "gvp-ctrl-btn",
1417
- "aria-label": q.value ? "Unmute" : "Mute",
1418
- "aria-pressed": q.value,
1419
- onClick: Me
1583
+ class: L(["gvp-live", { "is-at-edge": f.value }]),
1584
+ disabled: f.value,
1585
+ "aria-label": f.value ? "Live" : "Go to live edge",
1586
+ onClick: z
1587
+ }, [...b[5] || (b[5] = [
1588
+ a("span", { class: "gvp-live-dot" }, null, -1),
1589
+ a("span", null, "LIVE", -1)
1590
+ ])], 10, Zn)) : x("", !0)
1591
+ ]),
1592
+ a("div", zn, [
1593
+ O(Ln, {
1594
+ video: e.video,
1595
+ "quality-levels": e.qualityLevels,
1596
+ "current-level": e.currentLevel,
1597
+ "selected-level": e.selectedLevel,
1598
+ "audio-tracks": e.audioTracks,
1599
+ "audio-track-index": e.audioTrackIndex,
1600
+ onSelectLevel: b[3] || (b[3] = (_) => v("select-level", _)),
1601
+ onSelectAudioTrack: b[4] || (b[4] = (_) => v("select-audio-track", _))
1602
+ }, null, 8, ["video", "quality-levels", "current-level", "selected-level", "audio-tracks", "audio-track-index"]),
1603
+ le(Ie) ? (r(), c("button", {
1604
+ key: 0,
1605
+ type: "button",
1606
+ class: L(["gvp-ctrl-btn", me.value && "is-active"]),
1607
+ "aria-label": me.value ? "Exit picture-in-picture" : "Picture-in-picture",
1608
+ "aria-pressed": me.value,
1609
+ onClick: Ae
1420
1610
  }, [
1421
- q.value || K.value === 0 ? (d(), z(Nt, { key: 0 })) : K.value < 0.5 ? (d(), z(It, { key: 1 })) : (d(), z(Mt, { key: 2 }))
1422
- ], 8, mn),
1423
- te(n) ? M("", !0) : (d(), f("div", hn, [
1424
- r("div", gn, [
1425
- r("div", {
1426
- class: "gvp-volume-fill",
1427
- style: re({ width: `${q.value ? 0 : Math.round(K.value * 100)}%` })
1428
- }, null, 4)
1429
- ]),
1430
- r("input", {
1431
- type: "range",
1432
- class: "gvp-volume-input",
1433
- min: 0,
1434
- max: 100,
1435
- step: 1,
1436
- value: q.value ? 0 : Math.round(K.value * 100),
1437
- "aria-label": "Volume",
1438
- "aria-valuemin": 0,
1439
- "aria-valuemax": 100,
1440
- "aria-valuenow": q.value ? 0 : Math.round(K.value * 100),
1441
- onInput: Te
1442
- }, null, 40, kn)
1443
- ]))
1444
- ], 2),
1445
- te(P) ? (d(), f("button", {
1446
- key: 4,
1447
- type: "button",
1448
- class: w(["gvp-ctrl-btn", v.value && "is-active"]),
1449
- "aria-label": v.value ? "Exit picture-in-picture" : "Picture-in-picture",
1450
- "aria-pressed": v.value,
1451
- onClick: fe
1452
- }, [
1453
- Z(Ze)
1454
- ], 10, yn)) : M("", !0),
1455
- te(Qe) ? (d(), f("button", {
1456
- key: 5,
1457
- type: "button",
1458
- class: w(["gvp-ctrl-btn", j.value && "is-active"]),
1459
- "aria-label": j.value ? "Exit fullscreen" : "Enter fullscreen",
1460
- "aria-pressed": j.value,
1461
- onClick: je
1462
- }, [
1463
- j.value ? (d(), z(Ft, { key: 0 })) : (d(), z(qt, { key: 1 }))
1464
- ], 10, wn)) : M("", !0)
1611
+ O(ze)
1612
+ ], 10, Wn)) : x("", !0),
1613
+ le(Ne) ? (r(), c("button", {
1614
+ key: 1,
1615
+ type: "button",
1616
+ class: L(["gvp-ctrl-btn", de.value && "is-active"]),
1617
+ "aria-label": de.value ? "Exit fullscreen" : "Enter fullscreen",
1618
+ "aria-pressed": de.value,
1619
+ onClick: Se
1620
+ }, [
1621
+ de.value ? (r(), J(Xt, { key: 0 })) : (r(), J(Gt, { key: 1 }))
1622
+ ], 10, Kn)) : x("", !0)
1623
+ ])
1465
1624
  ])
1466
1625
  ], 34));
1467
1626
  }
1468
- }), xn = { name: "IconDesktop" }, Ln = /* @__PURE__ */ I({
1469
- ...xn,
1627
+ }), Jn = { name: "IconDesktop" }, Xn = /* @__PURE__ */ N({
1628
+ ...Jn,
1470
1629
  props: {
1471
1630
  class: {}
1472
1631
  },
1473
- setup(t) {
1474
- const a = t;
1475
- return (n, e) => (d(), f("svg", {
1476
- class: w(["gvp-icon", a.class]),
1632
+ setup(e) {
1633
+ const s = e;
1634
+ return (t, n) => (r(), c("svg", {
1635
+ class: L(["gvp-icon", s.class]),
1477
1636
  width: "20",
1478
1637
  height: "20",
1479
1638
  viewBox: "0 0 24 24",
1480
1639
  fill: "none",
1481
1640
  xmlns: "http://www.w3.org/2000/svg",
1482
1641
  "aria-hidden": "true"
1483
- }, [...e[0] || (e[0] = [
1484
- r("path", {
1642
+ }, [...n[0] || (n[0] = [
1643
+ a("path", {
1485
1644
  d: "M14 2H10C6.72077 2 5.08116 2 3.91891 2.81382C3.48891 3.1149 3.1149 3.48891 2.81382 3.91891C2 5.08116 2 6.72077 2 10C2 13.2792 2 14.9188 2.81382 16.0811C3.1149 16.5111 3.48891 16.8851 3.91891 17.1862C5.08116 18 6.72077 18 10 18H14C17.2792 18 18.9188 18 20.0811 17.1862C20.5111 16.8851 20.8851 16.5111 21.1862 16.0811C22 14.9188 22 13.2792 22 10C22 6.72077 22 5.08116 21.1862 3.91891C20.8851 3.48891 20.5111 3.1149 20.0811 2.81382C18.9188 2 17.2792 2 14 2Z",
1486
1645
  stroke: "currentColor",
1487
1646
  "stroke-width": "1.5",
1488
1647
  "stroke-linecap": "round"
1489
1648
  }, null, -1),
1490
- r("path", {
1649
+ a("path", {
1491
1650
  d: "M11 15H13",
1492
1651
  stroke: "currentColor",
1493
1652
  "stroke-width": "1.5",
1494
1653
  "stroke-linecap": "round",
1495
1654
  "stroke-linejoin": "round"
1496
1655
  }, null, -1),
1497
- r("path", {
1656
+ a("path", {
1498
1657
  d: "M14.5 22L14.1845 21.5811C13.4733 20.6369 13.2969 19.1944 13.7468 18M9.5 22L9.8155 21.5811C10.5267 20.6369 10.7031 19.1944 10.2532 18",
1499
1658
  stroke: "currentColor",
1500
1659
  "stroke-width": "1.5",
1501
1660
  "stroke-linecap": "round"
1502
1661
  }, null, -1),
1503
- r("path", {
1662
+ a("path", {
1504
1663
  d: "M7 22H17",
1505
1664
  stroke: "currentColor",
1506
1665
  "stroke-width": "1.5",
@@ -1508,36 +1667,36 @@ const Wt = { class: "gvp-controls-row" }, zt = ["disabled"], Yt = ["aria-label",
1508
1667
  }, null, -1)
1509
1668
  ])], 2));
1510
1669
  }
1511
- }), En = { name: "IconMobile" }, _n = /* @__PURE__ */ I({
1512
- ...En,
1670
+ }), es = { name: "IconMobile" }, ts = /* @__PURE__ */ N({
1671
+ ...es,
1513
1672
  props: {
1514
1673
  class: {}
1515
1674
  },
1516
- setup(t) {
1517
- const a = t;
1518
- return (n, e) => (d(), f("svg", {
1519
- class: w(["gvp-icon", a.class]),
1675
+ setup(e) {
1676
+ const s = e;
1677
+ return (t, n) => (r(), c("svg", {
1678
+ class: L(["gvp-icon", s.class]),
1520
1679
  width: "20",
1521
1680
  height: "20",
1522
1681
  viewBox: "0 0 24 24",
1523
1682
  fill: "none",
1524
1683
  xmlns: "http://www.w3.org/2000/svg",
1525
1684
  "aria-hidden": "true"
1526
- }, [...e[0] || (e[0] = [
1527
- r("path", {
1685
+ }, [...n[0] || (n[0] = [
1686
+ a("path", {
1528
1687
  d: "M5 9C5 5.70017 5 4.05025 6.02513 3.02513C7.05025 2 8.70017 2 12 2C15.2998 2 16.9497 2 17.9749 3.02513C19 4.05025 19 5.70017 19 9V15C19 18.2998 19 19.9497 17.9749 20.9749C16.9497 22 15.2998 22 12 22C8.70017 22 7.05025 22 6.02513 20.9749C5 19.9497 5 18.2998 5 15V9Z",
1529
1688
  stroke: "currentColor",
1530
1689
  "stroke-width": "2",
1531
1690
  "stroke-linecap": "round"
1532
1691
  }, null, -1),
1533
- r("path", {
1692
+ a("path", {
1534
1693
  d: "M11 19H13",
1535
1694
  stroke: "currentColor",
1536
1695
  "stroke-width": "2",
1537
1696
  "stroke-linecap": "round",
1538
1697
  "stroke-linejoin": "round"
1539
1698
  }, null, -1),
1540
- r("path", {
1699
+ a("path", {
1541
1700
  d: "M9 2L9.089 2.53402C9.28188 3.69129 9.37832 4.26993 9.77519 4.62204C10.1892 4.98934 10.7761 5 12 5C13.2239 5 13.8108 4.98934 14.2248 4.62204C14.6217 4.26993 14.7181 3.69129 14.911 2.53402L15 2",
1542
1701
  stroke: "currentColor",
1543
1702
  "stroke-width": "2",
@@ -1545,121 +1704,270 @@ const Wt = { class: "gvp-controls-row" }, zt = ["disabled"], Yt = ["aria-label",
1545
1704
  }, null, -1)
1546
1705
  ])], 2));
1547
1706
  }
1548
- }), $n = { name: "IconPlay" }, Pn = /* @__PURE__ */ I({
1549
- ...$n,
1707
+ }), ns = { name: "IconPlay" }, ss = /* @__PURE__ */ N({
1708
+ ...ns,
1550
1709
  props: {
1551
1710
  class: {}
1552
1711
  },
1553
- setup(t) {
1554
- const a = t;
1555
- return (n, e) => (d(), f("svg", {
1556
- class: w(["gvp-icon", a.class]),
1712
+ setup(e) {
1713
+ const s = e;
1714
+ return (t, n) => (r(), c("svg", {
1715
+ class: L(["gvp-icon", s.class]),
1557
1716
  width: "22",
1558
1717
  height: "22",
1559
1718
  viewBox: "0 0 16 16",
1560
1719
  fill: "none",
1561
1720
  xmlns: "http://www.w3.org/2000/svg",
1562
1721
  "aria-hidden": "true"
1563
- }, [...e[0] || (e[0] = [
1564
- r("path", {
1722
+ }, [...n[0] || (n[0] = [
1723
+ a("path", {
1565
1724
  d: "M5.3335 11.45V4.54997C5.3335 4.36108 5.40016 4.20275 5.5335 4.07497C5.66683 3.94719 5.82238 3.8833 6.00016 3.8833C6.05572 3.8833 6.11405 3.89163 6.17516 3.9083C6.23627 3.92497 6.29461 3.94997 6.35016 3.9833L11.7835 7.4333C11.8835 7.49997 11.9585 7.5833 12.0085 7.6833C12.0585 7.7833 12.0835 7.88886 12.0835 7.99997C12.0835 8.11108 12.0585 8.21663 12.0085 8.31663C11.9585 8.41663 11.8835 8.49997 11.7835 8.56663L6.35016 12.0166C6.29461 12.05 6.23627 12.075 6.17516 12.0916C6.11405 12.1083 6.05572 12.1166 6.00016 12.1166C5.82238 12.1166 5.66683 12.0527 5.5335 11.925C5.40016 11.7972 5.3335 11.6389 5.3335 11.45Z",
1566
1725
  fill: "currentColor"
1567
1726
  }, null, -1)
1568
1727
  ])], 2));
1569
1728
  }
1570
- }), Mn = { name: "IconX" }, Tn = /* @__PURE__ */ I({
1571
- ...Mn,
1729
+ }), ls = { name: "IconX" }, Oe = /* @__PURE__ */ N({
1730
+ ...ls,
1572
1731
  props: {
1573
1732
  class: {}
1574
1733
  },
1575
- setup(t) {
1576
- const a = t;
1577
- return (n, e) => (d(), f("svg", {
1578
- class: w(["gvp-icon", a.class]),
1734
+ setup(e) {
1735
+ const s = e;
1736
+ return (t, n) => (r(), c("svg", {
1737
+ class: L(["gvp-icon", s.class]),
1579
1738
  width: "14",
1580
1739
  height: "14",
1581
1740
  viewBox: "0 0 14 14",
1582
1741
  fill: "none",
1583
1742
  xmlns: "http://www.w3.org/2000/svg",
1584
1743
  "aria-hidden": "true"
1585
- }, [...e[0] || (e[0] = [
1586
- r("path", {
1744
+ }, [...n[0] || (n[0] = [
1745
+ a("path", {
1587
1746
  d: "M6.94994 5.53594L12.1929 0.292938C12.5834 -0.0975275 13.2165 -0.0975279 13.6069 0.292938C13.9974 0.683403 13.9974 1.31647 13.6069 1.70694L8.36394 6.94994L13.6069 12.1929C13.9974 12.5834 13.9974 13.2165 13.6069 13.6069C13.2165 13.9974 12.5834 13.9974 12.1929 13.6069L6.94994 8.36394L1.70694 13.6069C1.31647 13.9974 0.683403 13.9974 0.292938 13.6069C-0.0975279 13.2165 -0.0975277 12.5834 0.292938 12.1929L5.53594 6.94994L0.292938 1.70694C-0.0975279 1.31647 -0.0975279 0.683403 0.292938 0.292938C0.683403 -0.0975279 1.31647 -0.0975277 1.70694 0.292938L6.94994 5.53594Z",
1588
1747
  fill: "currentColor"
1589
1748
  }, null, -1)
1590
1749
  ])], 2));
1591
1750
  }
1751
+ }), os = { name: "IconAlert" }, as = /* @__PURE__ */ N({
1752
+ ...os,
1753
+ props: {
1754
+ class: {}
1755
+ },
1756
+ setup(e) {
1757
+ const s = e;
1758
+ return (t, n) => (r(), c("svg", {
1759
+ class: L(["gvp-icon", s.class]),
1760
+ width: "32",
1761
+ height: "32",
1762
+ viewBox: "0 0 24 24",
1763
+ fill: "none",
1764
+ xmlns: "http://www.w3.org/2000/svg",
1765
+ "aria-hidden": "true"
1766
+ }, [...n[0] || (n[0] = [
1767
+ a("path", {
1768
+ d: "M12 9V13M12 17H12.01M10.29 3.86L1.82 18A2 2 0 0 0 3.53 21H20.47A2 2 0 0 0 22.18 18L13.71 3.86A2 2 0 0 0 10.29 3.86Z",
1769
+ stroke: "currentColor",
1770
+ "stroke-width": "2",
1771
+ "stroke-linecap": "round",
1772
+ "stroke-linejoin": "round"
1773
+ }, null, -1)
1774
+ ])], 2));
1775
+ }
1776
+ }), rs = { name: "IconRefresh" }, is = /* @__PURE__ */ N({
1777
+ ...rs,
1778
+ props: {
1779
+ class: {}
1780
+ },
1781
+ setup(e) {
1782
+ const s = e;
1783
+ return (t, n) => (r(), c("svg", {
1784
+ class: L(["gvp-icon", s.class]),
1785
+ width: "16",
1786
+ height: "16",
1787
+ viewBox: "0 0 24 24",
1788
+ fill: "none",
1789
+ xmlns: "http://www.w3.org/2000/svg",
1790
+ "aria-hidden": "true"
1791
+ }, [...n[0] || (n[0] = [
1792
+ a("path", {
1793
+ d: "M21 12A9 9 0 1 1 18.36 5.64M21 3V9H15",
1794
+ stroke: "currentColor",
1795
+ "stroke-width": "2",
1796
+ "stroke-linecap": "round",
1797
+ "stroke-linejoin": "round"
1798
+ }, null, -1)
1799
+ ])], 2));
1800
+ }
1592
1801
  });
1593
- function In(t) {
1594
- if (!t) return null;
1595
- if (/^[A-Za-z0-9_-]{11}$/.test(t)) return t;
1596
- let a;
1802
+ function us(e) {
1803
+ if (!e) return null;
1804
+ if (/^[A-Za-z0-9_-]{11}$/.test(e)) return e;
1805
+ let s;
1597
1806
  try {
1598
- a = new URL(t);
1807
+ s = new URL(e);
1599
1808
  } catch {
1600
1809
  return null;
1601
1810
  }
1602
- const n = a.hostname.replace(/^www\./, "");
1603
- if (n === "youtu.be") {
1604
- const e = a.pathname.slice(1).split("/")[0];
1605
- return /^[A-Za-z0-9_-]{11}$/.test(e) ? e : null;
1811
+ const t = s.hostname.replace(/^www\./, "");
1812
+ if (t === "youtu.be") {
1813
+ const n = s.pathname.slice(1).split("/")[0];
1814
+ return /^[A-Za-z0-9_-]{11}$/.test(n) ? n : null;
1606
1815
  }
1607
- if (n === "youtube.com" || n === "m.youtube.com" || n === "music.youtube.com" || n === "youtube-nocookie.com") {
1608
- const e = a.searchParams.get("v");
1609
- if (e && /^[A-Za-z0-9_-]{11}$/.test(e)) return e;
1610
- const c = /^\/(?:embed|shorts|v|live)\/([A-Za-z0-9_-]{11})/.exec(
1611
- a.pathname
1816
+ if (t === "youtube.com" || t === "m.youtube.com" || t === "music.youtube.com" || t === "youtube-nocookie.com") {
1817
+ const n = s.searchParams.get("v");
1818
+ if (n && /^[A-Za-z0-9_-]{11}$/.test(n)) return n;
1819
+ const o = /^\/(?:embed|shorts|v|live)\/([A-Za-z0-9_-]{11})/.exec(
1820
+ s.pathname
1612
1821
  );
1613
- if (c) return c[1];
1822
+ if (o) return o[1];
1614
1823
  }
1615
1824
  return null;
1616
1825
  }
1617
- function Sn(t) {
1826
+ function cs(e) {
1618
1827
  try {
1619
- const a = new URL(t), n = a.searchParams.get("t") ?? a.searchParams.get("start");
1620
- if (!n) return null;
1621
- if (/^\d+s?$/.test(n)) return Number.parseInt(n, 10);
1622
- const e = /^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/.exec(n);
1623
- if (e) {
1624
- const c = Number.parseInt(e[1] ?? "0", 10), o = Number.parseInt(e[2] ?? "0", 10), h = Number.parseInt(e[3] ?? "0", 10), g = c * 3600 + o * 60 + h;
1625
- return g > 0 ? g : null;
1828
+ const s = new URL(e), t = s.searchParams.get("t") ?? s.searchParams.get("start");
1829
+ if (!t) return null;
1830
+ if (/^\d+s?$/.test(t)) return Number.parseInt(t, 10);
1831
+ const n = /^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/.exec(t);
1832
+ if (n) {
1833
+ const o = Number.parseInt(n[1] ?? "0", 10), v = Number.parseInt(n[2] ?? "0", 10), d = Number.parseInt(n[3] ?? "0", 10), h = o * 3600 + v * 60 + d;
1834
+ return h > 0 ? h : null;
1626
1835
  }
1627
1836
  } catch {
1628
1837
  }
1629
1838
  return null;
1630
1839
  }
1631
- function Nn(t, a = {}) {
1840
+ function ds(e, s = {}) {
1632
1841
  const {
1633
- autoPlay: n = !1,
1634
- muted: e = !0,
1635
- loop: c = !1,
1636
- controls: o = !0,
1637
- startSeconds: h
1638
- } = a, g = new URLSearchParams({
1842
+ autoPlay: t = !1,
1843
+ muted: n = !0,
1844
+ loop: o = !1,
1845
+ controls: v = !0,
1846
+ startSeconds: d
1847
+ } = s, h = new URLSearchParams({
1639
1848
  rel: "0",
1640
1849
  modestbranding: "1",
1641
1850
  playsinline: "1",
1642
- controls: o ? "1" : "0"
1851
+ controls: v ? "1" : "0"
1643
1852
  });
1644
- return n ? (g.set("autoplay", "1"), g.set("mute", "1")) : e && g.set("mute", "1"), c && (g.set("loop", "1"), g.set("playlist", t)), h && h > 0 && g.set("start", String(h)), `https://www.youtube-nocookie.com/embed/${t}?${g.toString()}`;
1853
+ return t ? (h.set("autoplay", "1"), h.set("mute", "1")) : n && h.set("mute", "1"), o && (h.set("loop", "1"), h.set("playlist", e)), d && d > 0 && h.set("start", String(d)), `https://www.youtube-nocookie.com/embed/${e}?${h.toString()}`;
1645
1854
  }
1646
- const An = ["src"], Hn = {
1647
- key: 2,
1648
- class: "gvp-vignette"
1649
- }, Bn = {
1855
+ const vs = "gvp:prefs:";
1856
+ function We(e) {
1857
+ return vs + e;
1858
+ }
1859
+ function Me(e) {
1860
+ if (typeof localStorage > "u") return {};
1861
+ try {
1862
+ const s = localStorage.getItem(We(e));
1863
+ if (!s) return {};
1864
+ const t = JSON.parse(s);
1865
+ return typeof t == "object" && t !== null ? t : {};
1866
+ } catch {
1867
+ return {};
1868
+ }
1869
+ }
1870
+ function Ke(e, s) {
1871
+ if (!(typeof localStorage > "u"))
1872
+ try {
1873
+ const n = { ...Me(e), ...s };
1874
+ localStorage.setItem(We(e), JSON.stringify(n));
1875
+ } catch {
1876
+ }
1877
+ }
1878
+ function je(e, s, t) {
1879
+ if (typeof localStorage > "u" || !s) return;
1880
+ const o = { ...Me(e).positions };
1881
+ t > 0 ? o[s] = t : delete o[s], Ke(e, { positions: o });
1882
+ }
1883
+ function ps(e, s) {
1884
+ var o;
1885
+ const n = (o = Me(e).positions) == null ? void 0 : o[s];
1886
+ return typeof n == "number" && n > 0 ? n : 0;
1887
+ }
1888
+ function fs(e) {
1889
+ const s = e.trim().replace(/^#/, "");
1890
+ if (/^[0-9a-f]{3}$/i.test(s))
1891
+ return [
1892
+ parseInt(s[0] + s[0], 16),
1893
+ parseInt(s[1] + s[1], 16),
1894
+ parseInt(s[2] + s[2], 16)
1895
+ ];
1896
+ if (/^[0-9a-f]{6}$/i.test(s))
1897
+ return [
1898
+ parseInt(s.slice(0, 2), 16),
1899
+ parseInt(s.slice(2, 4), 16),
1900
+ parseInt(s.slice(4, 6), 16)
1901
+ ];
1902
+ const t = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(e);
1903
+ return t ? [Number(t[1]), Number(t[2]), Number(t[3])] : null;
1904
+ }
1905
+ function ms(e, s) {
1906
+ const t = fs(e);
1907
+ return t ? `rgba(${t[0]}, ${t[1]}, ${t[2]}, ${s})` : e;
1908
+ }
1909
+ function gs(e, s) {
1910
+ if (!s) return "";
1911
+ const t = [];
1912
+ if (s.fontSize && t.push(`font-size: ${s.fontSize};`), s.textColor && t.push(`color: ${s.textColor};`), s.backgroundColor) {
1913
+ const n = typeof s.backgroundOpacity == "number" ? ms(s.backgroundColor, s.backgroundOpacity) : s.backgroundColor;
1914
+ t.push(`background-color: ${n};`);
1915
+ } else typeof s.backgroundOpacity == "number" && t.push(`background-color: rgba(0, 0, 0, ${s.backgroundOpacity});`);
1916
+ return t.length === 0 ? "" : `.${e}::cue { ${t.join(" ")} }`;
1917
+ }
1918
+ function hs(e) {
1919
+ const s = e.trim().replace(/^#/, "");
1920
+ if (/^[0-9a-f]{3}$/i.test(s)) {
1921
+ const n = parseInt(s[0] + s[0], 16), o = parseInt(s[1] + s[1], 16), v = parseInt(s[2] + s[2], 16);
1922
+ return `${n} ${o} ${v}`;
1923
+ }
1924
+ if (/^[0-9a-f]{6}$/i.test(s)) {
1925
+ const n = parseInt(s.slice(0, 2), 16), o = parseInt(s.slice(2, 4), 16), v = parseInt(s.slice(4, 6), 16);
1926
+ return `${n} ${o} ${v}`;
1927
+ }
1928
+ const t = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(e);
1929
+ return t ? `${t[1]} ${t[2]} ${t[3]}` : null;
1930
+ }
1931
+ function ks(e) {
1932
+ if (!e) return {};
1933
+ const s = {};
1934
+ if (e.accent) {
1935
+ const t = hs(e.accent);
1936
+ t ? s["--gvp-accent-rgb"] = t : s["--gvp-accent"] = e.accent;
1937
+ }
1938
+ return e.radius && (s["--gvp-radius"] = e.radius), s;
1939
+ }
1940
+ const ys = ["src"], bs = {
1650
1941
  key: 3,
1942
+ class: "gvp-vignette"
1943
+ }, ws = {
1944
+ key: 4,
1945
+ class: "gvp-sr-only",
1946
+ role: "status",
1947
+ "aria-live": "polite"
1948
+ }, xs = {
1949
+ key: 5,
1950
+ class: "gvp-loading",
1951
+ role: "status",
1952
+ "aria-live": "polite"
1953
+ }, Cs = {
1954
+ key: 6,
1955
+ class: "gvp-error",
1956
+ role: "alert"
1957
+ }, Ls = {
1958
+ key: 7,
1651
1959
  class: "gvp-toggle"
1652
- }, Vn = { class: "gvp-toggle-pill" }, qn = ["aria-pressed"], Dn = ["aria-pressed"], Fn = ["aria-label", "aria-pressed"], Rn = ["aria-label"], On = {
1653
- key: 10,
1960
+ }, $s = { class: "gvp-toggle-pill" }, Es = ["aria-pressed"], _s = ["aria-pressed"], Ps = ["aria-label", "aria-pressed"], Ts = ["aria-label"], Ms = {
1961
+ key: 14,
1654
1962
  class: "gvp-play-wrap"
1655
- }, Un = {
1963
+ }, Is = {
1656
1964
  key: 0,
1657
1965
  class: "gvp-tooltip",
1658
1966
  role: "tooltip"
1659
- }, Zn = {
1660
- key: 12,
1967
+ }, As = {
1968
+ key: 16,
1661
1969
  class: "gvp-bottom-fade"
1662
- }, Wn = /* @__PURE__ */ I({
1970
+ }, Hs = /* @__PURE__ */ N({
1663
1971
  __name: "VideoPlayer",
1664
1972
  props: {
1665
1973
  src: {},
@@ -1681,358 +1989,541 @@ const An = ["src"], Hn = {
1681
1989
  isHls: { type: Boolean },
1682
1990
  thumbnails: {},
1683
1991
  chapters: {},
1992
+ persistKey: {},
1993
+ captionStyle: {},
1994
+ theme: {},
1995
+ miniPlayer: { type: Boolean, default: !1 },
1996
+ miniPlayerPosition: { default: "bottom-right" },
1997
+ ambientMode: { type: Boolean, default: !1 },
1684
1998
  class: { default: "" },
1685
1999
  closable: { type: Boolean, default: !1 }
1686
2000
  },
1687
2001
  emits: ["close", "play", "pause", "ended", "time-update", "seeked", "volume-change", "milestone", "error", "playlist-change"],
1688
- setup(t, { emit: a }) {
1689
- const n = t, e = a, c = y(null), o = y(n.defaultDevice), h = y(!1), g = y(!1), E = y(null), _ = y([]), $ = y(-1), S = y([]), b = y(-1), m = y(-1), C = y(1), p = y(!1), x = y(!1), B = y(null), Y = typeof document < "u" && !!document.pictureInPictureEnabled, A = T(
1690
- () => n.controls === !0 || n.controls === "custom"
1691
- ), J = T(() => n.controls === "native"), k = T(
1692
- () => Array.isArray(n.playlist) && n.playlist.length > 0
1693
- ), N = y(
1694
- k.value ? Math.min(Math.max(n.defaultIndex, 0), n.playlist.length - 1) : 0
1695
- ), D = T(
1696
- () => k.value ? n.playlist[Math.min(N.value, n.playlist.length - 1)] : null
1697
- ), H = T(() => {
1698
- var u;
1699
- return ((u = D.value) == null ? void 0 : u.src) ?? n.src ?? "";
1700
- }), V = T(() => {
1701
- var u;
1702
- return ((u = D.value) == null ? void 0 : u.poster) ?? n.poster;
1703
- }), O = T(
2002
+ setup(e, { emit: s }) {
2003
+ const t = e, n = s, o = g(null), v = g(t.defaultDevice), d = g(!1), h = g(!1), E = g(!1), A = g(!1), S = g(!1), P = g(0), w = g(null), $ = g([]), T = g(-1), f = g([]), M = g(-1), z = g(-1), j = g(1), K = g(!1), re = g(!1), C = g(null), W = typeof document < "u" && !!document.pictureInPictureEnabled, B = I(
2004
+ () => t.controls === !0 || t.controls === "custom"
2005
+ ), D = I(() => t.controls === "native"), F = `gvp-video-${Math.random().toString(36).slice(2, 10)}`, H = I(() => ks(t.theme)), R = g(!1), fe = g(!1), y = g(null);
2006
+ let p = null;
2007
+ V(y, (l) => {
2008
+ p == null || p.disconnect(), p = null, !(!t.miniPlayer || !l || typeof IntersectionObserver > "u") && (p = new IntersectionObserver(
2009
+ ([i]) => {
2010
+ i.isIntersecting ? (R.value = !1, fe.value = !1) : d.value && !fe.value && (R.value = !0);
2011
+ },
2012
+ { threshold: 0 }
2013
+ ), p.observe(l));
2014
+ }), V(d, (l) => {
2015
+ l || (R.value = !1);
2016
+ });
2017
+ function ee() {
2018
+ R.value = !1, fe.value = !0;
2019
+ }
2020
+ const m = g(null);
2021
+ let Q = 0;
2022
+ ae(() => {
2023
+ p == null || p.disconnect(), p = null, cancelAnimationFrame(Q);
2024
+ });
2025
+ let Y = null;
2026
+ V(
2027
+ () => t.captionStyle,
2028
+ (l) => {
2029
+ if (typeof document > "u") return;
2030
+ const i = gs(F, l);
2031
+ if (!i) {
2032
+ Y == null || Y.remove(), Y = null;
2033
+ return;
2034
+ }
2035
+ Y || (Y = document.createElement("style"), document.head.appendChild(Y)), Y.textContent = i;
2036
+ },
2037
+ { immediate: !0, deep: !0 }
2038
+ ), ae(() => {
2039
+ Y == null || Y.remove(), Y = null;
2040
+ });
2041
+ const X = I(
2042
+ () => Array.isArray(t.playlist) && t.playlist.length > 0
2043
+ ), G = g(
2044
+ X.value ? Math.min(Math.max(t.defaultIndex, 0), t.playlist.length - 1) : 0
2045
+ ), ge = I(
2046
+ () => X.value ? t.playlist[Math.min(G.value, t.playlist.length - 1)] : null
2047
+ ), ue = I(() => {
2048
+ var l;
2049
+ return ((l = ge.value) == null ? void 0 : l.src) ?? t.src ?? "";
2050
+ }), me = I(() => {
2051
+ var l;
2052
+ return ((l = ge.value) == null ? void 0 : l.poster) ?? t.poster;
2053
+ }), Ie = I(
1704
2054
  () => {
1705
- var u;
1706
- return ((u = D.value) == null ? void 0 : u.thumbnails) ?? n.thumbnails;
2055
+ var l;
2056
+ return ((l = ge.value) == null ? void 0 : l.thumbnails) ?? t.thumbnails;
1707
2057
  }
1708
- ), me = T(
2058
+ ), Ae = I(
1709
2059
  () => {
1710
- var u;
1711
- return ((u = D.value) == null ? void 0 : u.chapters) ?? n.chapters;
2060
+ var l;
2061
+ return ((l = ge.value) == null ? void 0 : l.chapters) ?? t.chapters;
1712
2062
  }
1713
- ), Pe = T(() => k.value && N.value > 0), oe = T(
1714
- () => k.value && N.value < n.playlist.length - 1
2063
+ ), de = I(() => X.value && G.value > 0), Pe = I(
2064
+ () => X.value && G.value < t.playlist.length - 1
1715
2065
  );
1716
- let ce = !1;
1717
- function de(u, v = !1) {
1718
- if (!k.value) return;
1719
- const P = Math.min(Math.max(u, 0), n.playlist.length - 1);
1720
- P !== N.value && (ce = v, N.value = P, e("playlist-change", P, n.playlist[P]));
1721
- }
1722
- const K = T(() => In(H.value)), q = T(() => K.value !== null), Me = T(
1723
- () => K.value ? Nn(K.value, {
1724
- autoPlay: n.autoPlay,
1725
- muted: n.muted,
1726
- loop: n.loop,
1727
- controls: A.value ? !0 : J.value,
1728
- startSeconds: Sn(H.value)
2066
+ let xe = !1;
2067
+ function Ce(l, i = !1) {
2068
+ if (!X.value) return;
2069
+ const k = Math.min(Math.max(l, 0), t.playlist.length - 1);
2070
+ k !== G.value && (xe = i, G.value = k, n("playlist-change", k, t.playlist[k]));
2071
+ }
2072
+ const Le = I(() => us(ue.value)), U = I(() => Le.value !== null), Se = I(
2073
+ () => Le.value ? ds(Le.value, {
2074
+ autoPlay: t.autoPlay,
2075
+ muted: t.muted,
2076
+ loop: t.loop,
2077
+ controls: B.value ? !0 : D.value,
2078
+ startSeconds: cs(ue.value)
1729
2079
  }) : null
1730
2080
  );
1731
- function Te(u) {
1732
- _.value = u, $.value = -1;
2081
+ function Ne(l) {
2082
+ $.value = l, T.value = -1;
1733
2083
  }
1734
- function X(u) {
1735
- S.value = u, m.value = -1;
2084
+ function u(l) {
2085
+ f.value = l, z.value = -1;
1736
2086
  }
1737
- const le = T(
1738
- () => !q.value && _.value.length > 1
1739
- ), we = T(
2087
+ const b = I(
2088
+ () => !U.value && $.value.length > 1
2089
+ ), _ = I(
1740
2090
  () => {
1741
- var u;
1742
- return $.value >= 0 ? $.value : ((u = _.value[0]) == null ? void 0 : u.index) ?? -1;
2091
+ var l;
2092
+ return T.value >= 0 ? T.value : ((l = $.value[0]) == null ? void 0 : l.index) ?? -1;
1743
2093
  }
1744
- ), Ie = T(
2094
+ ), te = I(
1745
2095
  () => {
1746
- var u, v;
1747
- return o.value === "mobile" ? ((u = n.aspectRatio) == null ? void 0 : u.mobile) ?? "9/16" : ((v = n.aspectRatio) == null ? void 0 : v.desktop) ?? "16/9";
2096
+ var l, i;
2097
+ return v.value === "mobile" ? ((l = t.aspectRatio) == null ? void 0 : l.mobile) ?? "9/16" : ((i = t.aspectRatio) == null ? void 0 : i.desktop) ?? "16/9";
1748
2098
  }
1749
- ), ae = T(
2099
+ ), he = I(
1750
2100
  () => {
1751
- var u, v;
1752
- return o.value === "mobile" ? ((u = n.frameMaxWidth) == null ? void 0 : u.mobile) ?? "420px" : ((v = n.frameMaxWidth) == null ? void 0 : v.desktop) ?? "960px";
2101
+ var l, i;
2102
+ return v.value === "mobile" ? ((l = t.frameMaxWidth) == null ? void 0 : l.mobile) ?? "420px" : ((i = t.frameMaxWidth) == null ? void 0 : i.desktop) ?? "960px";
1753
2103
  }
1754
- ), Q = T(() => {
1755
- var u;
1756
- return ((u = c.value) == null ? void 0 : u.videoEl) ?? null;
2104
+ ), q = I(() => {
2105
+ var l;
2106
+ return ((l = o.value) == null ? void 0 : l.videoEl) ?? null;
2107
+ });
2108
+ V([m, q], ([l, i]) => {
2109
+ if (cancelAnimationFrame(Q), !t.ambientMode || !l || !i || U.value) return;
2110
+ const k = l.getContext("2d");
2111
+ if (!k) return;
2112
+ let ne = 0;
2113
+ const ie = ($e) => {
2114
+ if (Q = requestAnimationFrame(ie), !($e - ne < 250) && (ne = $e, !(i.readyState < 2 || i.paused)))
2115
+ try {
2116
+ k.drawImage(i, 0, 0, l.width, l.height);
2117
+ } catch {
2118
+ }
2119
+ };
2120
+ Q = requestAnimationFrame(ie);
1757
2121
  });
1758
- async function he() {
1759
- const u = Q.value;
1760
- if (u)
2122
+ async function ke() {
2123
+ const l = q.value;
2124
+ if (l)
1761
2125
  try {
1762
- u.readyState < 2 && u.load();
1763
- const v = u.play();
1764
- E.value = v, await v, h.value = !0;
2126
+ l.readyState < 2 && l.load();
2127
+ const i = l.play();
2128
+ w.value = i, await i, d.value = !0;
1765
2129
  } catch {
1766
- h.value = !1;
2130
+ d.value = !1;
1767
2131
  } finally {
1768
- E.value = null;
2132
+ w.value = null;
1769
2133
  }
1770
2134
  }
1771
- async function be() {
1772
- const u = Q.value;
1773
- if (u) {
1774
- if (E.value)
2135
+ async function ve() {
2136
+ const l = q.value;
2137
+ if (l) {
2138
+ if (w.value)
1775
2139
  try {
1776
- await E.value;
2140
+ await w.value;
1777
2141
  } catch {
1778
2142
  }
1779
- u.pause();
2143
+ l.pause();
1780
2144
  }
1781
2145
  }
1782
- async function ve() {
1783
- !n.hoverPlay || q.value || await he();
2146
+ async function Qe() {
2147
+ !t.hoverPlay || U.value || await ke();
2148
+ }
2149
+ async function Ye() {
2150
+ !t.hoverPlay || U.value || (await ve(), d.value = !1);
2151
+ }
2152
+ async function Te() {
2153
+ const l = q.value;
2154
+ l && (l.paused ? await ke() : (await ve(), d.value = !1));
2155
+ }
2156
+ function Ve() {
2157
+ const l = C.value;
2158
+ if (!l) return;
2159
+ if ((document.fullscreenElement ?? document.webkitFullscreenElement ?? null) === l) {
2160
+ const k = document.exitFullscreen ?? document.webkitExitFullscreen;
2161
+ k == null || k.call(document).catch(() => {
2162
+ });
2163
+ } else {
2164
+ const k = l.requestFullscreen ?? l.webkitRequestFullscreen;
2165
+ k == null || k.call(l).catch(() => {
2166
+ });
2167
+ }
1784
2168
  }
1785
- async function Ce() {
1786
- !n.hoverPlay || q.value || (await be(), h.value = !1);
2169
+ let ye = null;
2170
+ function Ge() {
2171
+ ye === null && (ye = setTimeout(() => {
2172
+ ye = null, Te();
2173
+ }, 250));
1787
2174
  }
1788
- async function se() {
1789
- const u = Q.value;
1790
- u && (u.paused ? await he() : (await be(), h.value = !1));
2175
+ function Je() {
2176
+ ye !== null && (clearTimeout(ye), ye = null), Ve();
1791
2177
  }
1792
- function pe() {
1793
- h.value = !1, e("ended"), k.value && n.autoAdvance && oe.value && de(N.value + 1, !0);
2178
+ function Xe() {
2179
+ d.value = !1, n("ended"), X.value && t.autoAdvance && Pe.value && Ce(G.value + 1, !0);
1794
2180
  }
1795
- R(H, () => {
1796
- ce && (ce = !1, he());
2181
+ V(ue, () => {
2182
+ xe && (xe = !1, ke());
1797
2183
  });
1798
- function W() {
1799
- g.value = !0, ve();
2184
+ function et() {
2185
+ h.value = !0, Qe();
1800
2186
  }
1801
- function G() {
1802
- g.value = !1, Ce();
2187
+ function tt() {
2188
+ h.value = !1, Ye();
1803
2189
  }
1804
- function xe(u) {
1805
- C.value = u;
1806
- const v = Q.value;
1807
- v && (v.playbackRate = u);
2190
+ function nt(l) {
2191
+ j.value = l;
2192
+ const i = q.value;
2193
+ i && (i.playbackRate = l);
1808
2194
  }
1809
- R(Q, (u) => {
1810
- if (!u) return;
1811
- u.addEventListener("ratechange", () => {
1812
- C.value = u.playbackRate;
1813
- }), u.addEventListener("enterpictureinpicture", () => {
1814
- p.value = !0;
1815
- }), u.addEventListener("leavepictureinpicture", () => {
1816
- p.value = !1;
2195
+ V(q, (l) => {
2196
+ if (!l) return;
2197
+ l.addEventListener("ratechange", () => {
2198
+ j.value = l.playbackRate;
2199
+ }), l.addEventListener("enterpictureinpicture", () => {
2200
+ K.value = !0;
2201
+ }), l.addEventListener("leavepictureinpicture", () => {
2202
+ K.value = !1;
1817
2203
  });
1818
- const v = /* @__PURE__ */ new Set();
1819
- u.addEventListener("timeupdate", () => {
1820
- const P = u.duration;
1821
- if (e("time-update", u.currentTime, Number.isFinite(P) ? P : 0), !Number.isFinite(P) || P <= 0) return;
1822
- const fe = u.currentTime / P * 100;
1823
- for (const j of [25, 50, 75, 100])
1824
- fe >= j && !v.has(j) && (v.add(j), e("milestone", j));
1825
- }), u.addEventListener("seeked", () => {
1826
- e("seeked", u.currentTime);
1827
- }), u.addEventListener("volumechange", () => {
1828
- e("volume-change", u.volume, u.muted);
1829
- }), u.addEventListener("error", () => {
1830
- e("error");
2204
+ const i = /* @__PURE__ */ new Set();
2205
+ l.addEventListener("timeupdate", () => {
2206
+ const k = l.duration;
2207
+ if (n("time-update", l.currentTime, Number.isFinite(k) ? k : 0), !Number.isFinite(k) || k <= 0) return;
2208
+ const ne = l.currentTime / k * 100;
2209
+ for (const ie of [25, 50, 75, 100])
2210
+ ne >= ie && !i.has(ie) && (i.add(ie), n("milestone", ie));
2211
+ }), l.addEventListener("seeked", () => {
2212
+ n("seeked", l.currentTime);
2213
+ }), l.addEventListener("volumechange", () => {
2214
+ n("volume-change", l.volume, l.muted);
2215
+ }), l.addEventListener("error", () => {
2216
+ A.value = !0, E.value = !1, n("error");
2217
+ }), l.addEventListener("waiting", () => {
2218
+ E.value = !0;
2219
+ }), l.addEventListener("stalled", () => {
2220
+ E.value = !0;
2221
+ }), l.addEventListener("playing", () => {
2222
+ E.value = !1;
2223
+ }), l.addEventListener("canplay", () => {
2224
+ E.value = !1;
2225
+ }), l.addEventListener("seeked", () => {
2226
+ E.value = !1;
1831
2227
  });
2228
+ }), V(ue, () => {
2229
+ A.value = !1, E.value = !1;
1832
2230
  });
1833
- function ge() {
1834
- const u = Q.value;
1835
- u && (document.pictureInPictureElement ? document.exitPictureInPicture().catch(() => {
1836
- }) : u.requestPictureInPicture().catch(() => {
2231
+ function st() {
2232
+ A.value = !0, E.value = !1, n("error");
2233
+ }
2234
+ const lt = I(() => A.value ? "Video failed to load" : E.value ? "Loading" : d.value ? "Playing" : "Paused");
2235
+ function ot() {
2236
+ A.value = !1, E.value = !1, P.value += 1;
2237
+ }
2238
+ V(q, (l) => {
2239
+ if (!l || !t.persistKey) return;
2240
+ const i = t.persistKey, k = Me(i);
2241
+ typeof k.volume == "number" && (l.volume = k.volume), typeof k.muted == "boolean" && (l.muted = k.muted), typeof k.speed == "number" && (l.playbackRate = k.speed);
2242
+ const ne = () => {
2243
+ Ke(i, {
2244
+ volume: l.volume,
2245
+ muted: l.muted,
2246
+ speed: l.playbackRate
2247
+ });
2248
+ };
2249
+ l.addEventListener("volumechange", ne), l.addEventListener("ratechange", ne);
2250
+ }), V([q, ue], ([l, i]) => {
2251
+ if (!l || !t.persistKey || !i) return;
2252
+ const k = t.persistKey, ne = () => {
2253
+ const be = ps(k, i);
2254
+ be > 0 && (!Number.isFinite(l.duration) || be < l.duration - 1) && (l.currentTime = be);
2255
+ };
2256
+ l.readyState >= 1 ? ne() : l.addEventListener("loadedmetadata", ne, { once: !0 });
2257
+ let ie = 0;
2258
+ const $e = () => {
2259
+ const be = Date.now();
2260
+ be - ie < 1e3 || (ie = be, je(k, i, l.currentTime));
2261
+ };
2262
+ l.addEventListener("timeupdate", $e), l.addEventListener("pause", $e), l.addEventListener("ended", () => je(k, i, 0));
2263
+ }, { immediate: !0 });
2264
+ function Be() {
2265
+ const l = q.value;
2266
+ l && (document.pictureInPictureElement ? document.exitPictureInPicture().catch(() => {
2267
+ }) : l.requestPictureInPicture().catch(() => {
1837
2268
  }));
1838
2269
  }
1839
- function Le(u) {
1840
- var fe, j, Ee;
1841
- const v = Q.value;
1842
- if (!(!v || !x.value && !((fe = B.value) != null && fe.contains(document.activeElement)) || u.target.tagName === "INPUT" && u.key !== " "))
1843
- switch (u.key) {
2270
+ function Re(l) {
2271
+ var ne;
2272
+ const i = q.value;
2273
+ if (!(!i || !re.value && !((ne = C.value) != null && ne.contains(document.activeElement)) || l.target.tagName === "INPUT" && l.key !== " "))
2274
+ switch (l.key) {
1844
2275
  case " ":
1845
2276
  case "k":
1846
- u.preventDefault(), se();
2277
+ l.preventDefault(), Te();
1847
2278
  break;
1848
2279
  case "ArrowLeft":
1849
- u.preventDefault(), v.currentTime = Math.max(0, v.currentTime - 5);
2280
+ l.preventDefault(), i.currentTime = Math.max(0, i.currentTime - 5);
1850
2281
  break;
1851
2282
  case "ArrowRight":
1852
- u.preventDefault(), v.currentTime = Math.min(v.duration || 0, v.currentTime + 5);
2283
+ l.preventDefault(), i.currentTime = Math.min(i.duration || 0, i.currentTime + 5);
1853
2284
  break;
1854
2285
  case "ArrowUp":
1855
- u.preventDefault(), v.volume = Math.min(1, v.volume + 0.1), v.muted && (v.muted = !1);
2286
+ l.preventDefault(), i.volume = Math.min(1, i.volume + 0.1), i.muted && (i.muted = !1);
1856
2287
  break;
1857
2288
  case "ArrowDown":
1858
- u.preventDefault(), v.volume = Math.max(0, v.volume - 0.1);
2289
+ l.preventDefault(), i.volume = Math.max(0, i.volume - 0.1);
1859
2290
  break;
1860
2291
  case "m":
1861
- v.muted = !v.muted;
2292
+ i.muted = !i.muted;
1862
2293
  break;
1863
- case "f": {
1864
- const Se = document.fullscreenElement ?? document.webkitFullscreenElement ?? null, _e = ((j = B.value) == null ? void 0 : j.requestFullscreen) ?? ((Ee = B.value) == null ? void 0 : Ee.webkitRequestFullscreen), ke = document.exitFullscreen ?? document.webkitExitFullscreen;
1865
- Se === B.value ? ke == null || ke.call(document).catch(() => {
1866
- }) : _e && B.value && _e.call(B.value).catch(() => {
1867
- });
2294
+ case "f":
2295
+ Ve();
1868
2296
  break;
1869
- }
1870
2297
  case "p":
1871
- Y && ge();
2298
+ W && Be();
1872
2299
  break;
1873
2300
  }
1874
2301
  }
1875
2302
  return He(() => {
1876
- document.addEventListener("keydown", Le);
1877
- }), ne(() => {
1878
- document.removeEventListener("keydown", Le);
1879
- }), (u, v) => (d(), f("div", {
1880
- ref_key: "rootEl",
1881
- ref: B,
1882
- class: w(["gvp-root", n.class]),
1883
- style: re({ width: ae.value, aspectRatio: Ie.value }),
1884
- onMouseenter: v[12] || (v[12] = (P) => {
1885
- x.value = !0, W();
1886
- }),
1887
- onMouseleave: v[13] || (v[13] = (P) => {
1888
- x.value = !1, G();
1889
- })
2303
+ document.addEventListener("keydown", Re);
2304
+ }), ae(() => {
2305
+ document.removeEventListener("keydown", Re);
2306
+ }), (l, i) => (r(), c("div", {
2307
+ class: L(["gvp-ambient-wrap", { "is-ambient": e.ambientMode }]),
2308
+ style: ce({ width: he.value })
1890
2309
  }, [
1891
- q.value ? (d(), f("iframe", {
2310
+ e.miniPlayer ? (r(), c("div", {
1892
2311
  key: 0,
1893
- class: "gvp-video gvp-youtube",
1894
- src: Me.value ?? void 0,
1895
- title: "YouTube video player",
1896
- allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
1897
- allowfullscreen: "",
1898
- referrerpolicy: "strict-origin-when-cross-origin"
1899
- }, null, 8, An)) : (d(), z(Ge, {
1900
- ref_key: "hlsPlayerRef",
1901
- ref: c,
1902
- key: H.value,
1903
- controls: J.value,
1904
- "hls-config": t.hlsConfig,
1905
- "is-hls": t.isHls,
1906
- loop: t.loop,
1907
- muted: t.muted,
1908
- "auto-play": t.autoPlay,
1909
- "audio-track-index": $.value,
1910
- "quality-level-index": m.value,
1911
- "plays-inline": !0,
1912
- poster: V.value,
1913
- src: H.value,
1914
- class: "gvp-video",
1915
- preload: "metadata",
1916
- onAudioTracks: Te,
1917
- onQualityLevels: X,
1918
- onCurrentLevel: v[0] || (v[0] = (P) => b.value = P),
1919
- onEnded: pe,
1920
- onPause: v[1] || (v[1] = (P) => {
1921
- h.value = !1, e("pause");
2312
+ ref_key: "miniSentinelEl",
2313
+ ref: y,
2314
+ class: "gvp-mini-sentinel",
2315
+ "aria-hidden": "true"
2316
+ }, null, 512)) : x("", !0),
2317
+ e.ambientMode && !U.value && !R.value ? (r(), c("canvas", {
2318
+ key: 1,
2319
+ ref_key: "ambientCanvasEl",
2320
+ ref: m,
2321
+ class: "gvp-ambient-canvas",
2322
+ width: "32",
2323
+ height: "18"
2324
+ }, null, 512)) : x("", !0),
2325
+ R.value ? (r(), c("div", {
2326
+ key: 2,
2327
+ class: "gvp-mini-placeholder",
2328
+ style: ce({ width: "100%", aspectRatio: te.value }),
2329
+ "aria-hidden": "true"
2330
+ }, null, 4)) : x("", !0),
2331
+ a("div", {
2332
+ ref_key: "rootEl",
2333
+ ref: C,
2334
+ class: L([
2335
+ "gvp-root",
2336
+ t.class,
2337
+ { "gvp-mini": R.value },
2338
+ R.value ? `gvp-mini-${e.miniPlayerPosition}` : ""
2339
+ ]),
2340
+ style: ce({ width: "100%", aspectRatio: te.value, ...H.value }),
2341
+ onMouseenter: i[14] || (i[14] = (k) => {
2342
+ re.value = !0, et();
1922
2343
  }),
1923
- onPlay: v[2] || (v[2] = (P) => {
1924
- h.value = !0, e("play");
2344
+ onMouseleave: i[15] || (i[15] = (k) => {
2345
+ re.value = !1, tt();
1925
2346
  })
1926
- }, {
1927
- default: Ye(() => [
1928
- Fe(u.$slots, "default")
1929
- ]),
1930
- _: 3
1931
- }, 8, ["controls", "hls-config", "is-hls", "loop", "muted", "auto-play", "audio-track-index", "quality-level-index", "poster", "src"])),
1932
- q.value ? M("", !0) : (d(), f("div", Hn)),
1933
- t.showDeviceToggle ? (d(), f("div", Bn, [
1934
- r("div", Vn, [
1935
- r("button", {
1936
- "aria-pressed": o.value === "desktop",
1937
- class: w(["gvp-toggle-btn", { "is-active": o.value === "desktop" }]),
1938
- "aria-label": "Desktop view",
1939
- type: "button",
1940
- onClick: v[3] || (v[3] = (P) => o.value = "desktop")
1941
- }, [
1942
- Z(Ln)
1943
- ], 10, qn),
1944
- v[14] || (v[14] = r("div", { class: "gvp-toggle-divider" }, null, -1)),
1945
- r("button", {
1946
- "aria-pressed": o.value === "mobile",
1947
- class: w(["gvp-toggle-btn", { "is-active": o.value === "mobile" }]),
1948
- "aria-label": "Mobile view",
2347
+ }, [
2348
+ R.value ? (r(), c("button", {
2349
+ key: 0,
2350
+ type: "button",
2351
+ class: "gvp-mini-close",
2352
+ "aria-label": "Close mini player",
2353
+ onClick: ee
2354
+ }, [
2355
+ O(Oe)
2356
+ ])) : x("", !0),
2357
+ U.value ? (r(), c("iframe", {
2358
+ key: 1,
2359
+ class: "gvp-video gvp-youtube",
2360
+ src: Se.value ?? void 0,
2361
+ title: "YouTube video player",
2362
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
2363
+ allowfullscreen: "",
2364
+ referrerpolicy: "strict-origin-when-cross-origin"
2365
+ }, null, 8, ys)) : (r(), J(vt, {
2366
+ ref_key: "hlsPlayerRef",
2367
+ ref: o,
2368
+ key: `${ue.value}#${P.value}`,
2369
+ controls: D.value,
2370
+ "hls-config": e.hlsConfig,
2371
+ "is-hls": e.isHls,
2372
+ loop: e.loop,
2373
+ muted: e.muted,
2374
+ "auto-play": e.autoPlay,
2375
+ "audio-track-index": T.value,
2376
+ "quality-level-index": z.value,
2377
+ "plays-inline": !0,
2378
+ poster: me.value,
2379
+ src: ue.value,
2380
+ class: L(["gvp-video", F]),
2381
+ preload: "metadata",
2382
+ onAudioTracks: Ne,
2383
+ onQualityLevels: u,
2384
+ onCurrentLevel: i[0] || (i[0] = (k) => M.value = k),
2385
+ onEnded: Xe,
2386
+ onFatalError: st,
2387
+ onLiveChange: i[1] || (i[1] = (k) => S.value = k),
2388
+ onPause: i[2] || (i[2] = (k) => {
2389
+ d.value = !1, n("pause");
2390
+ }),
2391
+ onPlay: i[3] || (i[3] = (k) => {
2392
+ d.value = !0, n("play");
2393
+ })
2394
+ }, {
2395
+ default: it(() => [
2396
+ Ue(l.$slots, "default")
2397
+ ]),
2398
+ _: 3
2399
+ }, 8, ["controls", "hls-config", "is-hls", "loop", "muted", "auto-play", "audio-track-index", "quality-level-index", "poster", "src", "class"])),
2400
+ U.value ? x("", !0) : (r(), c("div", bs)),
2401
+ U.value ? x("", !0) : (r(), c("span", ws, Z(lt.value), 1)),
2402
+ !U.value && E.value && !A.value ? (r(), c("div", xs, [...i[16] || (i[16] = [
2403
+ a("div", { class: "gvp-spinner" }, null, -1),
2404
+ a("span", { class: "gvp-sr-only" }, "Loading…", -1)
2405
+ ])])) : x("", !0),
2406
+ !U.value && A.value ? (r(), c("div", Cs, [
2407
+ O(as, { class: "gvp-error-icon" }),
2408
+ i[18] || (i[18] = a("p", { class: "gvp-error-text" }, "This video couldn't be played.", -1)),
2409
+ a("button", {
1949
2410
  type: "button",
1950
- onClick: v[4] || (v[4] = (P) => o.value = "mobile")
2411
+ class: "gvp-error-retry",
2412
+ onClick: ot
1951
2413
  }, [
1952
- Z(_n)
1953
- ], 10, Dn)
1954
- ])
1955
- ])) : M("", !0),
1956
- t.closable ? (d(), f("button", {
1957
- key: 4,
1958
- "aria-label": "Close",
1959
- class: "gvp-close",
1960
- type: "button",
1961
- onClick: v[5] || (v[5] = (P) => e("close"))
1962
- }, [
1963
- Z(Tn)
1964
- ])) : M("", !0),
1965
- le.value && !A.value ? (d(), z(rt, {
1966
- key: 5,
1967
- tracks: _.value,
1968
- "active-index": we.value,
1969
- onSelect: v[6] || (v[6] = (P) => $.value = P)
1970
- }, null, 8, ["tracks", "active-index"])) : M("", !0),
1971
- !q.value && !A.value ? (d(), z(pt, {
1972
- key: 6,
1973
- speed: C.value,
1974
- onSelect: xe
1975
- }, null, 8, ["speed"])) : M("", !0),
1976
- !q.value && !A.value ? (d(), z(yt, {
1977
- key: 7,
1978
- video: Q.value
1979
- }, null, 8, ["video"])) : M("", !0),
1980
- !q.value && te(Y) && !A.value ? (d(), f("button", {
1981
- key: 8,
1982
- type: "button",
1983
- class: w(["gvp-pip-btn", { "is-active": p.value }]),
1984
- "aria-label": p.value ? "Exit picture-in-picture" : "Picture-in-picture",
1985
- "aria-pressed": p.value,
1986
- onClick: ge
1987
- }, [
1988
- Z(Ze)
1989
- ], 10, Fn)) : M("", !0),
1990
- !q.value && A.value ? (d(), f("button", {
1991
- key: 9,
1992
- type: "button",
1993
- class: "gvp-click-layer",
1994
- "aria-label": h.value ? "Pause" : "Play",
1995
- onClick: se
1996
- }, null, 8, Rn)) : M("", !0),
1997
- !q.value && !A.value && !h.value ? (d(), f("div", On, [
1998
- r("button", {
1999
- "aria-label": "Play",
2000
- class: "gvp-play",
2414
+ O(is),
2415
+ i[17] || (i[17] = a("span", null, "Retry", -1))
2416
+ ])
2417
+ ])) : x("", !0),
2418
+ e.showDeviceToggle ? (r(), c("div", Ls, [
2419
+ a("div", $s, [
2420
+ a("button", {
2421
+ "aria-pressed": v.value === "desktop",
2422
+ class: L(["gvp-toggle-btn", { "is-active": v.value === "desktop" }]),
2423
+ "aria-label": "Desktop view",
2424
+ type: "button",
2425
+ onClick: i[4] || (i[4] = (k) => v.value = "desktop")
2426
+ }, [
2427
+ O(Xn)
2428
+ ], 10, Es),
2429
+ i[19] || (i[19] = a("div", { class: "gvp-toggle-divider" }, null, -1)),
2430
+ a("button", {
2431
+ "aria-pressed": v.value === "mobile",
2432
+ class: L(["gvp-toggle-btn", { "is-active": v.value === "mobile" }]),
2433
+ "aria-label": "Mobile view",
2434
+ type: "button",
2435
+ onClick: i[5] || (i[5] = (k) => v.value = "mobile")
2436
+ }, [
2437
+ O(ts)
2438
+ ], 10, _s)
2439
+ ])
2440
+ ])) : x("", !0),
2441
+ e.closable ? (r(), c("button", {
2442
+ key: 8,
2443
+ "aria-label": "Close",
2444
+ class: "gvp-close",
2001
2445
  type: "button",
2002
- onClick: se,
2003
- onMouseenter: v[7] || (v[7] = (P) => g.value = !0),
2004
- onMouseleave: v[8] || (v[8] = (P) => g.value = !1)
2446
+ onClick: i[6] || (i[6] = (k) => n("close"))
2005
2447
  }, [
2006
- Z(Pn),
2007
- t.tooltipText && g.value ? (d(), f("span", Un, U(t.tooltipText), 1)) : M("", !0)
2008
- ], 32)
2009
- ])) : M("", !0),
2010
- !q.value && A.value ? (d(), z(Cn, {
2011
- key: 11,
2012
- video: Q.value,
2013
- "is-playing": h.value,
2014
- container: B.value,
2015
- "on-toggle-play": se,
2016
- "quality-levels": S.value,
2017
- "current-level": b.value,
2018
- "selected-level": m.value,
2019
- thumbnails: O.value,
2020
- chapters: me.value,
2021
- "has-prev": Pe.value,
2022
- "has-next": oe.value,
2023
- onSelectLevel: v[9] || (v[9] = (P) => m.value = P),
2024
- onPrev: v[10] || (v[10] = (P) => de(N.value - 1, !0)),
2025
- onNext: v[11] || (v[11] = (P) => de(N.value + 1, !0))
2026
- }, null, 8, ["video", "is-playing", "container", "quality-levels", "current-level", "selected-level", "thumbnails", "chapters", "has-prev", "has-next"])) : M("", !0),
2027
- !q.value && !A.value ? (d(), f("div", Zn)) : M("", !0)
2028
- ], 38));
2448
+ O(Oe)
2449
+ ])) : x("", !0),
2450
+ b.value && !B.value ? (r(), J(bt, {
2451
+ key: 9,
2452
+ tracks: $.value,
2453
+ "active-index": _.value,
2454
+ onSelect: i[7] || (i[7] = (k) => T.value = k)
2455
+ }, null, 8, ["tracks", "active-index"])) : x("", !0),
2456
+ !U.value && !B.value ? (r(), J(_t, {
2457
+ key: 10,
2458
+ speed: j.value,
2459
+ onSelect: nt
2460
+ }, null, 8, ["speed"])) : x("", !0),
2461
+ !U.value && !B.value ? (r(), J(Nt, {
2462
+ key: 11,
2463
+ video: q.value
2464
+ }, null, 8, ["video"])) : x("", !0),
2465
+ !U.value && le(W) && !B.value ? (r(), c("button", {
2466
+ key: 12,
2467
+ type: "button",
2468
+ class: L(["gvp-pip-btn", { "is-active": K.value }]),
2469
+ "aria-label": K.value ? "Exit picture-in-picture" : "Picture-in-picture",
2470
+ "aria-pressed": K.value,
2471
+ onClick: Be
2472
+ }, [
2473
+ O(ze)
2474
+ ], 10, Ps)) : x("", !0),
2475
+ !U.value && B.value ? (r(), c("button", {
2476
+ key: 13,
2477
+ type: "button",
2478
+ class: "gvp-click-layer",
2479
+ "aria-label": d.value ? "Pause" : "Play",
2480
+ onClick: Ge,
2481
+ onDblclick: Je
2482
+ }, null, 40, Ts)) : x("", !0),
2483
+ !U.value && !B.value && !d.value ? (r(), c("div", Ms, [
2484
+ a("button", {
2485
+ "aria-label": "Play",
2486
+ class: "gvp-play",
2487
+ type: "button",
2488
+ onClick: Te,
2489
+ onMouseenter: i[8] || (i[8] = (k) => h.value = !0),
2490
+ onMouseleave: i[9] || (i[9] = (k) => h.value = !1)
2491
+ }, [
2492
+ O(ss),
2493
+ e.tooltipText && h.value ? (r(), c("span", Is, Z(e.tooltipText), 1)) : x("", !0)
2494
+ ], 32)
2495
+ ])) : x("", !0),
2496
+ !U.value && B.value ? (r(), J(Gn, {
2497
+ key: 15,
2498
+ video: q.value,
2499
+ "is-playing": d.value,
2500
+ container: C.value,
2501
+ "on-toggle-play": Te,
2502
+ "quality-levels": f.value,
2503
+ "current-level": M.value,
2504
+ "selected-level": z.value,
2505
+ thumbnails: Ie.value,
2506
+ chapters: Ae.value,
2507
+ "has-prev": de.value,
2508
+ "has-next": Pe.value,
2509
+ "is-live": S.value,
2510
+ "audio-tracks": $.value,
2511
+ "audio-track-index": _.value,
2512
+ onSelectLevel: i[10] || (i[10] = (k) => z.value = k),
2513
+ onSelectAudioTrack: i[11] || (i[11] = (k) => T.value = k),
2514
+ onPrev: i[12] || (i[12] = (k) => Ce(G.value - 1, !0)),
2515
+ onNext: i[13] || (i[13] = (k) => Ce(G.value + 1, !0))
2516
+ }, null, 8, ["video", "is-playing", "container", "quality-levels", "current-level", "selected-level", "thumbnails", "chapters", "has-prev", "has-next", "is-live", "audio-tracks", "audio-track-index"])) : x("", !0),
2517
+ !U.value && !B.value ? (r(), c("div", As)) : x("", !0)
2518
+ ], 38)
2519
+ ], 6));
2029
2520
  }
2030
2521
  });
2031
2522
  export {
2032
- Ge as HLSPlayer,
2033
- Wn as VueVideoPlayer,
2034
- In as parseYouTubeId,
2035
- Sn as parseYouTubeStart,
2036
- Nn as youTubeEmbedUrl
2523
+ vt as HLSPlayer,
2524
+ Hs as VueVideoPlayer,
2525
+ us as parseYouTubeId,
2526
+ cs as parseYouTubeStart,
2527
+ ds as youTubeEmbedUrl
2037
2528
  };
2038
2529
  //# sourceMappingURL=index.mjs.map