@webitel/ui-sdk 25.10.51 → 25.10.52

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 (55) hide show
  1. package/dist/errors-DCJKAXTz.js +70 -0
  2. package/dist/img/sprite/index.js +4 -0
  3. package/dist/img/sprite/player-enter-fullscreen.svg +3 -0
  4. package/dist/img/sprite/player-exit-fullscreen.svg +4 -0
  5. package/dist/install-hlMLq0U3.js +111257 -0
  6. package/dist/prod-DTLJXtPo.js +994 -0
  7. package/dist/srt-parser-CWqahKwO.js +27 -0
  8. package/dist/ssa-parser-BqjjKy4M.js +209 -0
  9. package/dist/ui-sdk.css +1 -1
  10. package/dist/ui-sdk.js +2 -100294
  11. package/dist/ui-sdk.umd.cjs +1633 -1605
  12. package/dist/vidstack-54Jpr2Lq-B-3uagaf.js +142 -0
  13. package/dist/vidstack-BP-l85ST-cd089zs4.js +21 -0
  14. package/dist/vidstack-BTBUzdbF-BuhaE3ef.js +29 -0
  15. package/dist/vidstack-Ccp8mxka-Cyoe3N05.js +20 -0
  16. package/dist/vidstack-Dgd3Tj9x-D_ifpfX9.js +397 -0
  17. package/dist/vidstack-DscYSLiW-Dk1undJ-.js +33 -0
  18. package/dist/vidstack-HTyVv8Yq-DRdwbVZd.js +52 -0
  19. package/dist/vidstack-audio-CFFRqrJ3.js +26 -0
  20. package/dist/vidstack-dash-BDtu3f4j.js +405 -0
  21. package/dist/vidstack-google-cast-hKSzmdiF.js +405 -0
  22. package/dist/vidstack-hls-BLyFYePL.js +328 -0
  23. package/dist/vidstack-video-BlmYiw-x.js +149 -0
  24. package/dist/vidstack-vimeo-DhWdWK51.js +434 -0
  25. package/dist/vidstack-youtube-l9Si5Vl-.js +204 -0
  26. package/package.json +2 -1
  27. package/src/assets/icons/sprite/index.js +4 -0
  28. package/src/assets/icons/sprite/player-enter-fullscreen.svg +3 -0
  29. package/src/assets/icons/sprite/player-exit-fullscreen.svg +4 -0
  30. package/src/components/index.js +3 -0
  31. package/src/components/wt-loader/wt-loader.vue +1 -0
  32. package/src/components/wt-popup/_mixins.scss +31 -0
  33. package/src/components/wt-popup/wt-popup.vue +7 -21
  34. package/src/components/wt-table/wt-table.vue +5 -0
  35. package/src/components/wt-vidstack-player/components/layouts/video-layout.vue +112 -0
  36. package/src/components/wt-vidstack-player/components/panels/media-control-panel/components/buttons/fullscreen-button.vue +37 -0
  37. package/src/components/wt-vidstack-player/components/panels/media-control-panel/components/buttons/play-button.vue +21 -0
  38. package/src/components/wt-vidstack-player/components/panels/media-control-panel/components/sliders/time-slider.vue +31 -0
  39. package/src/components/wt-vidstack-player/components/panels/media-control-panel/components/time-group.vue +19 -0
  40. package/src/components/wt-vidstack-player/components/panels/media-control-panel/media-control-panel.vue +34 -0
  41. package/src/components/wt-vidstack-player/components/panels/video-display-panel/video-display-panel.vue +95 -0
  42. package/src/components/wt-vidstack-player/components/toggle-button.vue +54 -0
  43. package/src/components/wt-vidstack-player/wt-vidstack-player.vue +156 -0
  44. package/src/install.ts +1 -0
  45. package/types/components/index.d.ts +3 -1
  46. package/types/components/wt-vidstack-player/components/layouts/video-layout.vue.d.ts +11 -0
  47. package/types/components/wt-vidstack-player/components/panels/media-control-panel/components/buttons/fullscreen-button.vue.d.ts +6 -0
  48. package/types/components/wt-vidstack-player/components/panels/media-control-panel/components/buttons/play-button.vue.d.ts +2 -0
  49. package/types/components/wt-vidstack-player/components/panels/media-control-panel/components/sliders/time-slider.vue.d.ts +2 -0
  50. package/types/components/wt-vidstack-player/components/panels/media-control-panel/components/time-group.vue.d.ts +2 -0
  51. package/types/components/wt-vidstack-player/components/panels/media-control-panel/media-control-panel.vue.d.ts +2 -0
  52. package/types/components/wt-vidstack-player/components/panels/video-display-panel/video-display-panel.vue.d.ts +11 -0
  53. package/types/components/wt-vidstack-player/components/toggle-button.vue.d.ts +12 -0
  54. package/types/components/wt-vidstack-player/wt-vidstack-player.vue.d.ts +25 -0
  55. package/types/install.d.ts +1 -0
@@ -0,0 +1,142 @@
1
+ import { R as g, I as p, S as u, B as C, d as f, o as h } from "./install-hlMLq0U3.js";
2
+ function m() {
3
+ return "https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";
4
+ }
5
+ function w() {
6
+ var a;
7
+ return !!((a = window.cast) != null && a.framework);
8
+ }
9
+ function E() {
10
+ var a, e;
11
+ return !!((e = (a = window.chrome) == null ? void 0 : a.cast) != null && e.isAvailable);
12
+ }
13
+ function l() {
14
+ return s().getCastState() === cast.framework.CastState.CONNECTED;
15
+ }
16
+ function s() {
17
+ return window.cast.framework.CastContext.getInstance();
18
+ }
19
+ function d() {
20
+ return s().getCurrentSession();
21
+ }
22
+ function v() {
23
+ var a;
24
+ return (a = d()) == null ? void 0 : a.getSessionObj().media[0];
25
+ }
26
+ function k(a) {
27
+ var t;
28
+ return ((t = v()) == null ? void 0 : t.media.contentId) === (a == null ? void 0 : a.src);
29
+ }
30
+ function y() {
31
+ return {
32
+ language: "en-US",
33
+ autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,
34
+ receiverApplicationId: chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,
35
+ resumeSavedSession: !0,
36
+ androidReceiverCompatible: !0
37
+ };
38
+ }
39
+ function S(a) {
40
+ return `Google Cast Error Code: ${a}`;
41
+ }
42
+ function b(a, e) {
43
+ return g(s(), a, e);
44
+ }
45
+ class I {
46
+ constructor() {
47
+ this.name = "google-cast";
48
+ }
49
+ /**
50
+ * @see {@link https://developers.google.com/cast/docs/reference/web_sender/cast.framework.CastContext}
51
+ */
52
+ get cast() {
53
+ return s();
54
+ }
55
+ mediaType() {
56
+ return "video";
57
+ }
58
+ canPlay(e) {
59
+ return p && !C && u(e);
60
+ }
61
+ async prompt(e) {
62
+ var i;
63
+ let t, o, r;
64
+ try {
65
+ t = await this.Ej(e), this.f || (this.f = new cast.framework.RemotePlayer(), new cast.framework.RemotePlayerController(this.f)), o = e.player.createEvent("google-cast-prompt-open", {
66
+ trigger: t
67
+ }), e.player.dispatchEvent(o), this.Ce(e, "connecting", o), await this.Fj(f(e.$props.googleCast)), e.$state.remotePlaybackInfo.set({
68
+ deviceName: (i = d()) == null ? void 0 : i.getCastDevice().friendlyName
69
+ }), l() && this.Ce(e, "connected", o);
70
+ } catch (n) {
71
+ const c = n instanceof Error ? n : this.De(
72
+ (n + "").toUpperCase(),
73
+ "Prompt failed."
74
+ );
75
+ throw r = e.player.createEvent("google-cast-prompt-error", {
76
+ detail: c,
77
+ trigger: o ?? t,
78
+ cancelable: !0
79
+ }), e.player.dispatch(r), this.Ce(
80
+ e,
81
+ l() ? "connected" : "disconnected",
82
+ r
83
+ ), c;
84
+ } finally {
85
+ e.player.dispatch("google-cast-prompt-close", {
86
+ trigger: r ?? o ?? t
87
+ });
88
+ }
89
+ }
90
+ async load(e) {
91
+ if (!this.f)
92
+ throw Error("[vidstack] google cast player was not initialized");
93
+ return new (await import("./vidstack-google-cast-hKSzmdiF.js")).GoogleCastProvider(this.f, e);
94
+ }
95
+ async Ej(e) {
96
+ if (w())
97
+ return;
98
+ const t = e.player.createEvent("google-cast-load-start");
99
+ e.player.dispatch(t), await h(m()), await customElements.whenDefined("google-cast-launcher");
100
+ const o = e.player.createEvent("google-cast-loaded", { trigger: t });
101
+ if (e.player.dispatch(o), !E())
102
+ throw this.De("CAST_NOT_AVAILABLE", "Google Cast not available on this platform.");
103
+ return o;
104
+ }
105
+ async Fj(e) {
106
+ this.Gj(e);
107
+ const t = await this.cast.requestSession();
108
+ if (t)
109
+ throw this.De(
110
+ t.toUpperCase(),
111
+ S(t)
112
+ );
113
+ }
114
+ Gj(e) {
115
+ var t;
116
+ (t = this.cast) == null || t.setOptions({
117
+ ...y(),
118
+ ...e
119
+ });
120
+ }
121
+ Ce(e, t, o) {
122
+ const r = { type: "google-cast", state: t };
123
+ e.delegate.c("remote-playback-change", r, o);
124
+ }
125
+ De(e, t) {
126
+ const o = Error(t);
127
+ return o.code = e, o;
128
+ }
129
+ }
130
+ const A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
131
+ __proto__: null,
132
+ GoogleCastLoader: I
133
+ }, Symbol.toStringTag, { value: "Module" }));
134
+ export {
135
+ d as a,
136
+ v as b,
137
+ S as c,
138
+ s as g,
139
+ k as h,
140
+ b as l,
141
+ A as v
142
+ };
@@ -0,0 +1,21 @@
1
+ import { c, a as s, e as r } from "./install-hlMLq0U3.js";
2
+ var d = '<path fill-rule="evenodd" clip-rule="evenodd" d="M6 7C5.63181 7 5.33333 7.29848 5.33333 7.66667V14.8667C5.33333 14.9403 5.39361 14.9999 5.46724 15.0009C10.8844 15.0719 15.2614 19.449 15.3325 24.8661C15.3334 24.9397 15.393 25 15.4667 25H26C26.3682 25 26.6667 24.7015 26.6667 24.3333V7.66667C26.6667 7.29848 26.3682 7 26 7H6ZM17.0119 22.2294C17.0263 22.29 17.0802 22.3333 17.1425 22.3333H23.3333C23.7015 22.3333 24 22.0349 24 21.6667V10.3333C24 9.96514 23.7015 9.66667 23.3333 9.66667H8.66667C8.29848 9.66667 8 9.96514 8 10.3333V13.1909C8 13.2531 8.04332 13.3071 8.10392 13.3214C12.5063 14.3618 15.9715 17.827 17.0119 22.2294Z" fill="currentColor"/> <path d="M13.2 25C13.2736 25 13.3334 24.9398 13.3322 24.8661C13.2615 20.5544 9.77889 17.0718 5.46718 17.0011C5.39356 16.9999 5.33333 17.0597 5.33333 17.1333V18.8667C5.33333 18.9403 5.39348 18.9999 5.4671 19.0015C8.67465 19.0716 11.2617 21.6587 11.3319 24.8662C11.3335 24.9399 11.393 25 11.4667 25H13.2Z" fill="currentColor"/> <path d="M5.33333 21.1333C5.33333 21.0597 5.39332 20.9998 5.46692 21.0022C7.57033 21.0712 9.26217 22.763 9.33114 24.8664C9.33356 24.94 9.27364 25 9.2 25H6C5.63181 25 5.33333 24.7015 5.33333 24.3333V21.1333Z" fill="currentColor"/>';
3
+ const i = /* @__PURE__ */ s(
4
+ '<svg viewBox="0 0 32 32" fill="none" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"></svg>'
5
+ );
6
+ function m(o, C) {
7
+ const a = c(i);
8
+ a.innerHTML = d, o.append(a);
9
+ const e = document.createElement("span");
10
+ e.classList.add("vds-google-cast-info"), o.append(e);
11
+ const n = document.createElement("span");
12
+ n.classList.add("vds-google-cast-device-name"), r(() => {
13
+ const { remotePlaybackInfo: l } = C, t = l();
14
+ return t != null && t.deviceName && (n.textContent = t.deviceName, e.append("Google Cast on ", n)), () => {
15
+ e.textContent = "";
16
+ };
17
+ });
18
+ }
19
+ export {
20
+ m as insertContent
21
+ };
@@ -0,0 +1,29 @@
1
+ const f = /(?:https:\/\/)?(?:player\.)?vimeo(?:\.com)?\/(?:video\/)?(\d+)(?:\?hash=(.*))?/, t = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
2
+ function g(n) {
3
+ const o = n.match(f);
4
+ return { videoId: o == null ? void 0 : o[1], hash: o == null ? void 0 : o[2] };
5
+ }
6
+ async function b(n, o) {
7
+ if (t.has(n))
8
+ return t.get(n);
9
+ if (i.has(n))
10
+ return i.get(n);
11
+ const p = `https://vimeo.com/api/oembed.json?url=https://player.vimeo.com/video/${n}`, c = window.fetch(p, {
12
+ mode: "cors",
13
+ signal: o.signal
14
+ }).then((e) => e.json()).then((e) => {
15
+ var m, h;
16
+ const l = /vimeocdn.com\/video\/(.*)?_/, s = (h = (m = e == null ? void 0 : e.thumbnail_url) == null ? void 0 : m.match(l)) == null ? void 0 : h[1], u = s ? `https://i.vimeocdn.com/video/${s}_1920x1080.webp` : "", r = {
17
+ title: (e == null ? void 0 : e.title) ?? "",
18
+ duration: (e == null ? void 0 : e.duration) ?? 0,
19
+ poster: u,
20
+ pro: e.account_type !== "basic"
21
+ };
22
+ return t.set(n, r), r;
23
+ }).finally(() => i.delete(n));
24
+ return i.set(n, c), c;
25
+ }
26
+ export {
27
+ b as getVimeoVideoInfo,
28
+ g as resolveVimeoVideoId
29
+ };
@@ -0,0 +1,20 @@
1
+ import { m as i, k as t } from "./install-hlMLq0U3.js";
2
+ class n {
3
+ constructor(s) {
4
+ this.La = s;
5
+ }
6
+ Xa() {
7
+ i(this.ya) && this.fg();
8
+ }
9
+ $() {
10
+ t(this.ya) && window.cancelAnimationFrame(this.ya), this.ya = void 0;
11
+ }
12
+ fg() {
13
+ this.ya = window.requestAnimationFrame(() => {
14
+ i(this.ya) || (this.La(), this.fg());
15
+ });
16
+ }
17
+ }
18
+ export {
19
+ n as R
20
+ };
@@ -0,0 +1,397 @@
1
+ import { x as m, w as f, y as n, z as y, b as k, A as v, e as p, l as h, B as T, C as S, E as F, d as x, F as w, G as b, D as A, L as u, H as $ } from "./install-hlMLq0U3.js";
2
+ import { R as E } from "./vidstack-Ccp8mxka-Cyoe3N05.js";
3
+ let c = null, o = [], d = [];
4
+ function l() {
5
+ return c ?? (c = new AudioContext());
6
+ }
7
+ function C() {
8
+ const s = l(), t = s.createGain();
9
+ return t.connect(s.destination), o.push(t), t;
10
+ }
11
+ function G(s, t) {
12
+ const i = l(), e = i.createMediaElementSource(s);
13
+ return t && e.connect(t), d.push(e), e;
14
+ }
15
+ function M(s) {
16
+ const t = o.indexOf(s);
17
+ t !== -1 && (o.splice(t, 1), s.disconnect(), g());
18
+ }
19
+ function K(s) {
20
+ const t = d.indexOf(s);
21
+ t !== -1 && (d.splice(t, 1), s.disconnect(), g());
22
+ }
23
+ function g() {
24
+ c && o.length === 0 && d.length === 0 && c.close().then(() => {
25
+ c = null;
26
+ });
27
+ }
28
+ class j {
29
+ constructor(t, i) {
30
+ this.a = t, this.E = i, this.xa = null, this.Ka = null;
31
+ }
32
+ get currentGain() {
33
+ var t, i;
34
+ return ((i = (t = this.xa) == null ? void 0 : t.gain) == null ? void 0 : i.value) ?? null;
35
+ }
36
+ get supported() {
37
+ return !0;
38
+ }
39
+ setGain(t) {
40
+ const i = this.currentGain;
41
+ if (t !== this.currentGain) {
42
+ if (t === 1 && i !== 1) {
43
+ this.removeGain();
44
+ return;
45
+ }
46
+ this.xa || (this.xa = C(), this.Ka && this.Ka.connect(this.xa)), this.Ka || (this.Ka = G(this.a, this.xa)), this.xa.gain.value = t, this.E(t);
47
+ }
48
+ }
49
+ removeGain() {
50
+ this.xa && (this.Ka && this.Ka.connect(l().destination), this.eg(), this.E(null));
51
+ }
52
+ destroy() {
53
+ this.li(), this.eg();
54
+ }
55
+ li() {
56
+ if (this.Ka)
57
+ try {
58
+ K(this.Ka);
59
+ } catch {
60
+ } finally {
61
+ this.Ka = null;
62
+ }
63
+ }
64
+ eg() {
65
+ if (this.xa)
66
+ try {
67
+ M(this.xa);
68
+ } catch {
69
+ } finally {
70
+ this.xa = null;
71
+ }
72
+ }
73
+ }
74
+ class P {
75
+ constructor(t, i) {
76
+ this.p = t, this.b = i, this.Ya = v(), this.jc = !1, this.ae = !1, this.be = !1, this.fa = new E(this.kc.bind(this)), this.hg = void 0, this.zi = void 0, this.mi(), p(this.ni.bind(this)), f(this.ce.bind(this));
77
+ }
78
+ get a() {
79
+ return this.p.media;
80
+ }
81
+ get c() {
82
+ return this.b.delegate.c;
83
+ }
84
+ ce() {
85
+ this.ae = !1, this.be = !1, this.fa.$(), this.Ya.empty();
86
+ }
87
+ /**
88
+ * The `timeupdate` event fires surprisingly infrequently during playback, meaning your progress
89
+ * bar (or whatever else is synced to the currentTime) moves in a choppy fashion. This helps
90
+ * resolve that by retrieving time updates in a request animation frame loop.
91
+ */
92
+ kc() {
93
+ const t = this.a.currentTime;
94
+ this.b.$state.realCurrentTime() !== t && this.Jb(t);
95
+ }
96
+ mi() {
97
+ this.F("loadstart", this.Ma), this.F("abort", this.gg), this.F("emptied", this.oi), this.F("error", this.Q), this.F("volumechange", this.Na);
98
+ }
99
+ pi() {
100
+ this.ae || (this.Ya.add(
101
+ this.F("loadeddata", this.qi),
102
+ this.F("loadedmetadata", this.ri),
103
+ this.F("canplay", this.ed),
104
+ this.F("canplaythrough", this.si),
105
+ this.F("durationchange", this.de),
106
+ this.F("play", this.gc),
107
+ this.F("progress", this.nb),
108
+ this.F("stalled", this.ti),
109
+ this.F("suspend", this.ui),
110
+ this.F("ratechange", this.vi)
111
+ ), this.ae = !0);
112
+ }
113
+ wi() {
114
+ this.be || (this.Ya.add(
115
+ this.F("pause", this.ib),
116
+ this.F("playing", this.xi),
117
+ this.F("seeked", this.ob),
118
+ this.F("seeking", this.yi),
119
+ this.F("ended", this.lc),
120
+ this.F("waiting", this.ee)
121
+ ), this.be = !0);
122
+ }
123
+ F(t, i) {
124
+ return h(
125
+ this.a,
126
+ t,
127
+ i.bind(this)
128
+ );
129
+ }
130
+ Ai(t) {
131
+ }
132
+ Jb(t, i) {
133
+ const e = {
134
+ // Avoid errors where `currentTime` can have higher precision.
135
+ currentTime: Math.min(t, this.b.$state.seekableEnd()),
136
+ played: this.a.played
137
+ };
138
+ this.c("time-update", e, i);
139
+ }
140
+ Ma(t) {
141
+ if (this.a.networkState === 3) {
142
+ this.gg(t);
143
+ return;
144
+ }
145
+ this.pi(), this.c("load-start", void 0, t);
146
+ }
147
+ gg(t) {
148
+ this.c("abort", void 0, t);
149
+ }
150
+ oi() {
151
+ this.c("emptied", void 0, event);
152
+ }
153
+ qi(t) {
154
+ this.c("loaded-data", void 0, t);
155
+ }
156
+ ri(t) {
157
+ this.wi(), this.c("loaded-metadata", void 0, t), (T || S && F(this.b.$state.source())) && this.b.delegate.Ga(this.fe(), t);
158
+ }
159
+ fe() {
160
+ return {
161
+ provider: x(this.b.$provider),
162
+ duration: this.a.duration,
163
+ buffered: this.a.buffered,
164
+ seekable: this.a.seekable
165
+ };
166
+ }
167
+ gc(t) {
168
+ this.b.$state.canPlay && this.c("play", void 0, t);
169
+ }
170
+ ib(t) {
171
+ this.a.readyState === 1 && !this.jc || (this.jc = !1, this.fa.$(), this.c("pause", void 0, t));
172
+ }
173
+ ed(t) {
174
+ this.b.delegate.Ga(this.fe(), t);
175
+ }
176
+ si(t) {
177
+ this.b.$state.started() || this.c("can-play-through", this.fe(), t);
178
+ }
179
+ xi(t) {
180
+ this.jc = !1, this.c("playing", void 0, t), this.fa.Xa();
181
+ }
182
+ ti(t) {
183
+ this.c("stalled", void 0, t), this.a.readyState < 3 && (this.jc = !0, this.c("waiting", void 0, t));
184
+ }
185
+ ee(t) {
186
+ this.a.readyState < 3 && (this.jc = !0, this.c("waiting", void 0, t));
187
+ }
188
+ lc(t) {
189
+ this.fa.$(), this.Jb(this.a.duration, t), this.c("end", void 0, t), this.b.$state.loop() && w(this.a.controls) && (this.a.controls = !1);
190
+ }
191
+ ni() {
192
+ this.b.$state.paused() && h(this.a, "timeupdate", this.mc.bind(this));
193
+ }
194
+ mc(t) {
195
+ this.Jb(this.a.currentTime, t);
196
+ }
197
+ de(t) {
198
+ this.b.$state.ended() && this.Jb(this.a.duration, t), this.c("duration-change", this.a.duration, t);
199
+ }
200
+ Na(t) {
201
+ const i = {
202
+ volume: this.a.volume,
203
+ muted: this.a.muted
204
+ };
205
+ this.c("volume-change", i, t);
206
+ }
207
+ ob(t) {
208
+ this.Jb(this.a.currentTime, t), this.c("seeked", this.a.currentTime, t), Math.trunc(this.a.currentTime) === Math.trunc(this.a.duration) && b(this.a.duration) > b(this.a.currentTime) && (this.Jb(this.a.duration, t), this.a.ended || this.b.player.dispatch(
209
+ new A("media-play-request", {
210
+ trigger: t
211
+ })
212
+ ));
213
+ }
214
+ yi(t) {
215
+ this.c("seeking", this.a.currentTime, t);
216
+ }
217
+ nb(t) {
218
+ const i = {
219
+ buffered: this.a.buffered,
220
+ seekable: this.a.seekable
221
+ };
222
+ this.c("progress", i, t);
223
+ }
224
+ ui(t) {
225
+ this.c("suspend", void 0, t);
226
+ }
227
+ vi(t) {
228
+ this.c("rate-change", this.a.playbackRate, t);
229
+ }
230
+ Q(t) {
231
+ const i = this.a.error;
232
+ if (!i)
233
+ return;
234
+ const e = {
235
+ message: i.message,
236
+ code: i.code,
237
+ mediaError: i
238
+ };
239
+ this.c("error", e, t);
240
+ }
241
+ }
242
+ class L {
243
+ constructor(t, i) {
244
+ this.p = t, this.b = i, this.nc.onaddtrack = this.Bi.bind(this), this.nc.onremovetrack = this.Ci.bind(this), this.nc.onchange = this.Di.bind(this), h(this.b.audioTracks, "change", this.Ei.bind(this));
245
+ }
246
+ get nc() {
247
+ return this.p.media.audioTracks;
248
+ }
249
+ Bi(t) {
250
+ const i = t.track;
251
+ if (i.label === "")
252
+ return;
253
+ const e = i.id.toString() || `native-audio-${this.b.audioTracks.length}`, a = {
254
+ id: e,
255
+ label: i.label,
256
+ language: i.language,
257
+ kind: i.kind,
258
+ selected: !1
259
+ };
260
+ this.b.audioTracks[u.da](a, t), i.enabled && (a.selected = !0);
261
+ }
262
+ Ci(t) {
263
+ const i = this.b.audioTracks.getById(t.track.id);
264
+ i && this.b.audioTracks[u.cc](i, t);
265
+ }
266
+ Di(t) {
267
+ let i = this.ig();
268
+ if (!i)
269
+ return;
270
+ const e = this.b.audioTracks.getById(i.id);
271
+ e && this.b.audioTracks[u.ea](e, !0, t);
272
+ }
273
+ ig() {
274
+ return Array.from(this.nc).find((t) => t.enabled);
275
+ }
276
+ Ei(t) {
277
+ const { current: i } = t.detail;
278
+ if (!i)
279
+ return;
280
+ const e = this.nc.getTrackById(i.id);
281
+ if (e) {
282
+ const a = this.ig();
283
+ a && (a.enabled = !1), e.enabled = !0;
284
+ }
285
+ }
286
+ }
287
+ class I {
288
+ constructor(t, i) {
289
+ this.a = t, this.b = i, this.scope = m(), this.K = null, this.audioGain = new j(this.a, (e) => {
290
+ this.b.delegate.c("audio-gain-change", e);
291
+ });
292
+ }
293
+ setup() {
294
+ new P(this, this.b), "audioTracks" in this.media && new L(this, this.b), f(() => {
295
+ this.audioGain.destroy(), this.a.srcObject = null, this.a.removeAttribute("src");
296
+ for (const t of this.a.querySelectorAll("source"))
297
+ t.remove();
298
+ this.a.load();
299
+ });
300
+ }
301
+ get type() {
302
+ return "";
303
+ }
304
+ get media() {
305
+ return this.a;
306
+ }
307
+ get currentSrc() {
308
+ return this.K;
309
+ }
310
+ setPlaybackRate(t) {
311
+ this.a.playbackRate = t;
312
+ }
313
+ async play() {
314
+ return this.a.play();
315
+ }
316
+ async pause() {
317
+ return this.a.pause();
318
+ }
319
+ setMuted(t) {
320
+ this.a.muted = t;
321
+ }
322
+ setVolume(t) {
323
+ this.a.volume = t;
324
+ }
325
+ setCurrentTime(t) {
326
+ this.a.currentTime = t;
327
+ }
328
+ setPlaysInline(t) {
329
+ n(this.a, "playsinline", t);
330
+ }
331
+ async loadSource({ src: t, type: i }, e) {
332
+ this.a.preload = e || "", y(t) ? (this.oc(), this.a.srcObject = t) : (this.a.srcObject = null, k(t) ? i !== "?" ? this.ge({ src: t, type: i }) : (this.oc(), this.a.src = this.jg(t)) : (this.oc(), this.a.src = window.URL.createObjectURL(t))), this.a.load(), this.K = { src: t, type: i };
333
+ }
334
+ /**
335
+ * Append source so it works when requesting AirPlay since hls.js will remove it.
336
+ */
337
+ ge(t, i) {
338
+ const e = this.a.querySelector("source[data-vds]"), a = e ?? document.createElement("source");
339
+ n(a, "src", this.jg(t.src)), n(a, "type", t.type !== "?" ? t.type : i), n(a, "data-vds", ""), e || this.a.append(a);
340
+ }
341
+ oc() {
342
+ var t;
343
+ (t = this.a.querySelector("source[data-vds]")) == null || t.remove();
344
+ }
345
+ jg(t) {
346
+ const { clipStartTime: i, clipEndTime: e } = this.b.$state, a = i(), r = e();
347
+ return a > 0 && r > 0 ? `${t}#t=${a},${r}` : a > 0 ? `${t}#t=${a}` : r > 0 ? `${t}#t=0,${r}` : t;
348
+ }
349
+ }
350
+ class O {
351
+ constructor(t, i) {
352
+ this.a = t, this.b = i, this.pb = $(!1), this.he();
353
+ }
354
+ get supported() {
355
+ return this.pb();
356
+ }
357
+ he() {
358
+ var t;
359
+ !((t = this.a) != null && t.remote) || !this.kg || (this.a.remote.watchAvailability((i) => {
360
+ this.pb.set(i);
361
+ }).catch(() => {
362
+ this.pb.set(!1);
363
+ }), p(this.Fi.bind(this)));
364
+ }
365
+ Fi() {
366
+ if (!this.pb())
367
+ return;
368
+ const t = ["connecting", "connect", "disconnect"], i = this.ie.bind(this);
369
+ i(), h(this.a, "playing", i);
370
+ for (const e of t)
371
+ h(this.a.remote, e, i);
372
+ }
373
+ async prompt() {
374
+ if (!this.supported)
375
+ throw Error("Not supported on this platform.");
376
+ return this.la === "airplay" && this.a.webkitShowPlaybackTargetPicker ? this.a.webkitShowPlaybackTargetPicker() : this.a.remote.prompt();
377
+ }
378
+ ie(t) {
379
+ const i = this.a.remote.state;
380
+ if (i === this.za)
381
+ return;
382
+ const e = { type: this.la, state: i };
383
+ this.b.delegate.c("remote-playback-change", e, t), this.za = i;
384
+ }
385
+ }
386
+ class B extends O {
387
+ constructor() {
388
+ super(...arguments), this.la = "airplay";
389
+ }
390
+ get kg() {
391
+ return "WebKitPlaybackTargetAvailabilityEvent" in window;
392
+ }
393
+ }
394
+ export {
395
+ I as H,
396
+ B as a
397
+ };
@@ -0,0 +1,33 @@
1
+ const i = /(?:youtu\.be|youtube|youtube\.com|youtube-nocookie\.com)\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|)((?:\w|-){11})/, u = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
2
+ function h(e) {
3
+ var t;
4
+ return (t = e.match(i)) == null ? void 0 : t[1];
5
+ }
6
+ async function b(e, t) {
7
+ if (u.has(e))
8
+ return u.get(e);
9
+ if (s.has(e))
10
+ return s.get(e);
11
+ const n = new Promise(async (c) => {
12
+ const r = ["maxresdefault", "sddefault", "hqdefault"];
13
+ for (const a of r)
14
+ for (const f of [!0, !1]) {
15
+ const o = p(e, a, f);
16
+ if ((await fetch(o, {
17
+ mode: "no-cors",
18
+ signal: t.signal
19
+ })).status < 400) {
20
+ u.set(e, o), c(o);
21
+ return;
22
+ }
23
+ }
24
+ }).catch(() => "").finally(() => s.delete(e));
25
+ return s.set(e, n), n;
26
+ }
27
+ function p(e, t, n) {
28
+ return `https://i.ytimg.com/${n ? "vi_webp" : "vi"}/${e}/${t}.${n ? "webp" : "jpg"}`;
29
+ }
30
+ export {
31
+ b as findYouTubePoster,
32
+ h as resolveYouTubeVideoId
33
+ };
@@ -0,0 +1,52 @@
1
+ import { H as n, l as c, e as a, d as h, P as u, b as d, K as l } from "./install-hlMLq0U3.js";
2
+ function p(r, t = 3e3) {
3
+ const s = l();
4
+ return setTimeout(() => {
5
+ const i = r();
6
+ i && s.reject(i);
7
+ }, t), s;
8
+ }
9
+ class f {
10
+ constructor(t) {
11
+ this.Lb = t, this.sc = n(""), this.referrerPolicy = null, t.setAttribute("frameBorder", "0"), t.setAttribute("aria-hidden", "true"), t.setAttribute(
12
+ "allow",
13
+ "autoplay; fullscreen; encrypted-media; picture-in-picture; accelerometer; gyroscope"
14
+ ), this.referrerPolicy !== null && t.setAttribute("referrerpolicy", this.referrerPolicy);
15
+ }
16
+ get iframe() {
17
+ return this.Lb;
18
+ }
19
+ setup() {
20
+ c(window, "message", this.Xi.bind(this)), c(this.Lb, "load", this.gd.bind(this)), a(this.Mb.bind(this));
21
+ }
22
+ Mb() {
23
+ const t = this.sc();
24
+ if (!t.length) {
25
+ this.Lb.setAttribute("src", "");
26
+ return;
27
+ }
28
+ const s = h(() => this.mg());
29
+ this.Lb.setAttribute("src", u(t, s));
30
+ }
31
+ se(t, s) {
32
+ var i;
33
+ (i = this.Lb.contentWindow) == null || i.postMessage(JSON.stringify(t), s ?? "*");
34
+ }
35
+ Xi(t) {
36
+ var o;
37
+ const s = this.Nb();
38
+ if ((t.source === null || t.source === ((o = this.Lb) == null ? void 0 : o.contentWindow)) && (!d(s) || s === t.origin)) {
39
+ try {
40
+ const e = JSON.parse(t.data);
41
+ e && this.te(e, t);
42
+ return;
43
+ } catch {
44
+ }
45
+ t.data && this.te(t.data, t);
46
+ }
47
+ }
48
+ }
49
+ export {
50
+ f as E,
51
+ p as t
52
+ };