@validol4ik/uikit 0.15.1 → 0.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audio/audio.cjs +1 -1
- package/dist/audio/audio.es.js +1 -1
- package/dist/kl.woff +0 -0
- package/dist/playback-CNEes7Qp.cjs +1 -0
- package/dist/{playback-CTKx1SmL.js → playback-C_bPLFTz.js} +14 -13
- package/dist/style.css +1 -1
- package/dist/types/components/AppIcon/iconsList.d.ts +2 -2
- package/dist/types/components/media/AppVideo/types.d.ts +2 -0
- package/dist/video/video.cjs +2 -2
- package/dist/video/video.es.js +313 -287
- package/package.json +1 -1
- package/dist/playback-BIDV-_px.cjs +0 -1
package/dist/video/video.es.js
CHANGED
|
@@ -1,175 +1,175 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ae = (t) => {
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
import { ref as
|
|
7
|
-
import { D as
|
|
8
|
-
import { _ as
|
|
9
|
-
var
|
|
10
|
-
class
|
|
11
|
-
constructor(e,
|
|
4
|
+
var U = (t, s, e) => s.has(t) || ae("Cannot " + e);
|
|
5
|
+
var R = (t, s, e) => (U(t, s, "read from private field"), e ? e.call(t) : s.get(t)), D = (t, s, e) => s.has(t) ? ae("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), N = (t, s, e, n) => (U(t, s, "write to private field"), n ? n.call(t, e) : s.set(t, e), e), ne = (t, s, e) => (U(t, s, "access private method"), e);
|
|
6
|
+
import { ref as P, onBeforeUnmount as le, defineComponent as be, computed as Se, watch as j, onMounted as Re, createElementBlock as b, openBlock as S, unref as _, createCommentVNode as L, createElementVNode as q, Fragment as ge, normalizeClass as oe, toDisplayString as we, nextTick as _e } from "vue";
|
|
7
|
+
import { D as Te, p as Le, E as Pe, a as Oe, i as Ce, b as Ae, B as De, c as ie, P as Ve, d as Ie, V as B, r as ze, e as Ke, t as Ne, f as Be, H as He, W as Fe, g as Me, s as Ge } from "../playback-C_bPLFTz.js";
|
|
8
|
+
import { _ as We } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
|
+
var F, V, M, A, O, H, ce;
|
|
10
|
+
class Ye extends EventTarget {
|
|
11
|
+
constructor(e, n, c) {
|
|
12
12
|
super();
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
D(this, O);
|
|
14
|
+
D(this, F);
|
|
15
|
+
D(this, V);
|
|
16
|
+
D(this, M);
|
|
17
|
+
D(this, A, -1);
|
|
18
|
+
N(this, F, e), N(this, V, [...n].sort((l, o) => o.size - l.size)), N(this, M, c);
|
|
19
19
|
}
|
|
20
20
|
get selectedIndex() {
|
|
21
|
-
return
|
|
21
|
+
return R(this, A);
|
|
22
22
|
}
|
|
23
23
|
set selectedIndex(e) {
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const n = R(this, O, H);
|
|
25
|
+
N(this, A, e), R(this, O, H) !== n && ne(this, O, ce).call(this), this.dispatchEvent(new Event("change"));
|
|
26
26
|
}
|
|
27
27
|
*[Symbol.iterator]() {
|
|
28
|
-
for (const [e,
|
|
28
|
+
for (const [e, n] of R(this, V).entries())
|
|
29
29
|
yield {
|
|
30
|
-
id: String(
|
|
31
|
-
height:
|
|
32
|
-
selected: e ===
|
|
33
|
-
active:
|
|
30
|
+
id: String(n.size),
|
|
31
|
+
height: n.size,
|
|
32
|
+
selected: e === R(this, A),
|
|
33
|
+
active: n === R(this, O, H)
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
return
|
|
37
|
+
F = new WeakMap(), V = new WeakMap(), M = new WeakMap(), A = new WeakMap(), O = new WeakSet(), H = function() {
|
|
38
|
+
return R(this, V)[R(this, A)] ?? R(this, M);
|
|
39
39
|
}, // Loading a new src resets the position and speed
|
|
40
|
-
|
|
41
|
-
const e =
|
|
40
|
+
ce = function() {
|
|
41
|
+
const e = R(this, F), n = e.currentTime, c = e.playbackRate, l = !e.paused;
|
|
42
42
|
e.addEventListener(
|
|
43
43
|
"loadedmetadata",
|
|
44
44
|
() => {
|
|
45
|
-
|
|
45
|
+
n && (e.currentTime = n), e.playbackRate = c, l && e.play();
|
|
46
46
|
},
|
|
47
47
|
{ once: !0 }
|
|
48
|
-
),
|
|
48
|
+
), n && (e.preload = "metadata"), e.src = R(this, O, H).src;
|
|
49
49
|
};
|
|
50
|
-
const
|
|
50
|
+
const Ue = (t, s) => {
|
|
51
51
|
t.preload = "metadata", t.addEventListener(
|
|
52
52
|
"loadedmetadata",
|
|
53
53
|
() => {
|
|
54
|
-
|
|
54
|
+
s(), t.play().catch(() => {
|
|
55
55
|
});
|
|
56
56
|
},
|
|
57
57
|
{ once: !0 }
|
|
58
58
|
);
|
|
59
|
-
},
|
|
60
|
-
let t = 0,
|
|
59
|
+
}, ue = () => {
|
|
60
|
+
let t = 0, s = 0;
|
|
61
61
|
return (e) => {
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
const
|
|
65
|
-
return setTimeout(() => e(
|
|
62
|
+
const n = Date.now();
|
|
63
|
+
if (n - s > Ae && (t = 0), s = n, t >= Pe) return !1;
|
|
64
|
+
const c = t++;
|
|
65
|
+
return setTimeout(() => e(c), Oe * 2 ** c), !0;
|
|
66
66
|
};
|
|
67
|
-
},
|
|
68
|
-
const { currentTime: e, playbackRate:
|
|
67
|
+
}, de = (t, s) => {
|
|
68
|
+
const { currentTime: e, playbackRate: n, paused: c } = t;
|
|
69
69
|
return () => {
|
|
70
70
|
t.addEventListener(
|
|
71
71
|
"loadedmetadata",
|
|
72
72
|
() => {
|
|
73
|
-
t.currentTime = e, t.playbackRate =
|
|
73
|
+
t.currentTime = e, t.playbackRate = n, c || t.play().catch(() => {
|
|
74
74
|
});
|
|
75
75
|
},
|
|
76
76
|
{ once: !0 }
|
|
77
|
-
),
|
|
77
|
+
), s(e);
|
|
78
78
|
};
|
|
79
|
-
},
|
|
80
|
-
let
|
|
81
|
-
const
|
|
79
|
+
}, je = (t, s, e) => {
|
|
80
|
+
let n = null;
|
|
81
|
+
const c = ue();
|
|
82
82
|
t.addEventListener("loadstart", () => {
|
|
83
|
-
if (!t.engine || t.engine ===
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
const f = () => t.engine ===
|
|
87
|
-
|
|
83
|
+
if (!t.engine || t.engine === n) return;
|
|
84
|
+
const o = t.engine;
|
|
85
|
+
n = o;
|
|
86
|
+
const f = () => t.engine === o;
|
|
87
|
+
o.on(s.Events.ERROR, async (u, p) => {
|
|
88
88
|
var T;
|
|
89
89
|
if (!p.fatal) return;
|
|
90
|
-
const
|
|
91
|
-
var m,
|
|
90
|
+
const d = (a) => {
|
|
91
|
+
var m, k;
|
|
92
92
|
return e.report({
|
|
93
93
|
type: p.type,
|
|
94
94
|
details: p.details,
|
|
95
95
|
status: (m = p.response) == null ? void 0 : m.code,
|
|
96
|
-
url: ((
|
|
96
|
+
url: ((k = p.frag) == null ? void 0 : k.url) ?? p.url,
|
|
97
97
|
recovering: a
|
|
98
98
|
});
|
|
99
99
|
}, y = () => {
|
|
100
|
-
|
|
100
|
+
d(!0), e.dismissError();
|
|
101
101
|
};
|
|
102
|
-
if (p.type ===
|
|
102
|
+
if (p.type === s.ErrorTypes.NETWORK_ERROR) {
|
|
103
103
|
if (((T = p.response) == null ? void 0 : T.code) === 401 && await e.reauthorize()) {
|
|
104
|
-
y(),
|
|
104
|
+
y(), o.startLoad(t.currentTime);
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
|
-
if (e.hasLoaded() &&
|
|
107
|
+
if (e.hasLoaded() && c(() => f() && o.startLoad(t.currentTime))) {
|
|
108
108
|
y();
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
} else if (p.type ===
|
|
112
|
-
f() && (a > 0 &&
|
|
111
|
+
} else if (p.type === s.ErrorTypes.MEDIA_ERROR && e.hasLoaded() && c((a) => {
|
|
112
|
+
f() && (a > 0 && o.swapAudioCodec(), o.recoverMediaError());
|
|
113
113
|
})) {
|
|
114
114
|
y();
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
|
-
|
|
118
|
-
}),
|
|
117
|
+
d(!1), e.fail();
|
|
118
|
+
}), o.on(s.Events.FRAG_LOADED, e.loaded);
|
|
119
119
|
}), t.addEventListener("error", async () => {
|
|
120
120
|
if (t.engine) return;
|
|
121
|
-
const
|
|
122
|
-
var
|
|
121
|
+
const o = de(t, () => t.load()), f = (p) => {
|
|
122
|
+
var d;
|
|
123
123
|
return e.report({
|
|
124
124
|
type: "nativeError",
|
|
125
|
-
details: String(((
|
|
125
|
+
details: String(((d = t.error) == null ? void 0 : d.code) ?? ""),
|
|
126
126
|
recovering: p
|
|
127
127
|
});
|
|
128
128
|
};
|
|
129
|
-
if ((await e.reauthorize() || e.hasLoaded()) &&
|
|
129
|
+
if ((await e.reauthorize() || e.hasLoaded()) && c(() => t.isConnected && o())) {
|
|
130
130
|
f(!0), e.dismissError();
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
133
|
f(!1), e.fail();
|
|
134
134
|
}), t.addEventListener("loadeddata", e.loaded);
|
|
135
|
-
const l =
|
|
135
|
+
const l = Ce();
|
|
136
136
|
e.withCredentials && !l && (t.crossOrigin = "use-credentials"), t.source = {
|
|
137
137
|
src: e.src,
|
|
138
138
|
preferPlayback: l ? "native" : "mse"
|
|
139
139
|
};
|
|
140
|
-
},
|
|
140
|
+
}, qe = (t, s) => {
|
|
141
141
|
const e = t.engine;
|
|
142
|
-
e.setXHRWithCredentialsForType("default",
|
|
143
|
-
const
|
|
142
|
+
e.setXHRWithCredentialsForType("default", s.withCredentials);
|
|
143
|
+
const n = ue(), c = () => de(
|
|
144
144
|
t,
|
|
145
|
-
(l) => e.attachSource(
|
|
145
|
+
(l) => e.attachSource(s.src, l)
|
|
146
146
|
);
|
|
147
147
|
e.on("error", async (l) => {
|
|
148
|
-
var p,
|
|
149
|
-
const
|
|
148
|
+
var p, d;
|
|
149
|
+
const o = l.error, f = (d = (p = o.data) == null ? void 0 : p.response) == null ? void 0 : d.status, u = (y) => s.report({
|
|
150
150
|
type: "dashError",
|
|
151
|
-
details: String(
|
|
151
|
+
details: String(o.code ?? ""),
|
|
152
152
|
status: f,
|
|
153
153
|
recovering: y
|
|
154
154
|
});
|
|
155
155
|
if (f === 401) {
|
|
156
|
-
if (await
|
|
157
|
-
|
|
156
|
+
if (await s.reauthorize()) {
|
|
157
|
+
u(!0), c()();
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
|
-
} else if (!
|
|
160
|
+
} else if (!Te.includes(o.code ?? -1))
|
|
161
161
|
return;
|
|
162
|
-
|
|
163
|
-
}), e.on("fragmentLoadingCompleted",
|
|
162
|
+
u(!1), s.fail();
|
|
163
|
+
}), e.on("fragmentLoadingCompleted", s.loaded), t.addEventListener("error", () => {
|
|
164
164
|
var f;
|
|
165
|
-
const l =
|
|
166
|
-
|
|
165
|
+
const l = c(), o = s.hasLoaded() && n(() => t.isConnected && l());
|
|
166
|
+
s.report({
|
|
167
167
|
type: "mediaError",
|
|
168
168
|
details: String(((f = t.error) == null ? void 0 : f.code) ?? ""),
|
|
169
|
-
recovering:
|
|
170
|
-
}),
|
|
169
|
+
recovering: o
|
|
170
|
+
}), o ? s.dismissError() : s.fail();
|
|
171
171
|
}), t.source = {
|
|
172
|
-
src:
|
|
172
|
+
src: s.src,
|
|
173
173
|
engine: {
|
|
174
174
|
dashJs: {
|
|
175
175
|
streaming: {
|
|
@@ -180,42 +180,42 @@ const He = (t, r) => {
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
|
-
},
|
|
184
|
-
const e =
|
|
183
|
+
}, Je = (t, s) => {
|
|
184
|
+
const e = Le(s);
|
|
185
185
|
e && (Object.assign(t, {
|
|
186
|
-
videoRenditions: new
|
|
186
|
+
videoRenditions: new Ye(t, s, e)
|
|
187
187
|
}), t.src = e.src);
|
|
188
|
-
},
|
|
189
|
-
const
|
|
190
|
-
let e,
|
|
191
|
-
const
|
|
188
|
+
}, Xe = "media-controls-content, .media-popup, media-error-dialog", $e = (t) => t instanceof Element && t.matches(Xe), Qe = (t) => {
|
|
189
|
+
const s = P(!1);
|
|
190
|
+
let e, n = 1, c = !1, l = null;
|
|
191
|
+
const o = () => {
|
|
192
192
|
var a;
|
|
193
193
|
return (a = t.value) == null ? void 0 : a.store;
|
|
194
194
|
}, f = () => {
|
|
195
|
-
|
|
196
|
-
const a =
|
|
197
|
-
!a || a.paused || a.playbackRate >=
|
|
198
|
-
},
|
|
195
|
+
c = !0;
|
|
196
|
+
const a = o();
|
|
197
|
+
!a || a.paused || a.playbackRate >= ie || (n = a.playbackRate, a.setPlaybackRate(ie), s.value = !0);
|
|
198
|
+
}, u = () => {
|
|
199
199
|
var m;
|
|
200
200
|
clearTimeout(e), l == null || l(), l = null;
|
|
201
|
-
const a =
|
|
202
|
-
return
|
|
203
|
-
}, p = (a, m,
|
|
204
|
-
|
|
201
|
+
const a = c;
|
|
202
|
+
return c = !1, s.value && (s.value = !1, (m = o()) == null || m.setPlaybackRate(n)), a;
|
|
203
|
+
}, p = (a, m, k) => {
|
|
204
|
+
u(), m && (e = setTimeout(f, De));
|
|
205
205
|
const g = (h) => {
|
|
206
206
|
if (h instanceof KeyboardEvent) {
|
|
207
207
|
if (h.key !== " ") return;
|
|
208
208
|
h.preventDefault(), h.stopPropagation();
|
|
209
209
|
}
|
|
210
|
-
const
|
|
211
|
-
|
|
210
|
+
const w = u();
|
|
211
|
+
k == null || k(w);
|
|
212
212
|
};
|
|
213
|
-
a.forEach((h) => window.addEventListener(h, g, !0)), window.addEventListener("blur",
|
|
213
|
+
a.forEach((h) => window.addEventListener(h, g, !0)), window.addEventListener("blur", u), l = () => {
|
|
214
214
|
a.forEach(
|
|
215
215
|
(h) => window.removeEventListener(h, g, !0)
|
|
216
|
-
), window.removeEventListener("blur",
|
|
216
|
+
), window.removeEventListener("blur", u);
|
|
217
217
|
};
|
|
218
|
-
},
|
|
218
|
+
}, d = (a) => {
|
|
219
219
|
var h;
|
|
220
220
|
if (a.key !== " " || a.altKey || a.ctrlKey || a.metaKey)
|
|
221
221
|
return;
|
|
@@ -223,55 +223,55 @@ const He = (t, r) => {
|
|
|
223
223
|
l && (a.preventDefault(), a.stopPropagation());
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
|
-
const m =
|
|
227
|
-
if (!m || !
|
|
226
|
+
const m = o(), k = document.activeElement;
|
|
227
|
+
if (!m || !k || !((h = t.value) != null && h.contains(k))) return;
|
|
228
228
|
a.preventDefault(), a.stopPropagation();
|
|
229
229
|
const g = m.paused;
|
|
230
|
-
g && m.play(), p(["keyup"], !g, (
|
|
231
|
-
!g && !
|
|
230
|
+
g && m.play(), p(["keyup"], !g, (w) => {
|
|
231
|
+
!g && !w && m.pause();
|
|
232
232
|
});
|
|
233
233
|
}, y = (a) => {
|
|
234
|
-
const m =
|
|
235
|
-
!m || m.paused || a.button !== 0 || a.composedPath().some(
|
|
234
|
+
const m = o();
|
|
235
|
+
!m || m.paused || a.button !== 0 || a.composedPath().some($e) || p(["pointerup", "pointercancel"], !0);
|
|
236
236
|
}, T = (a) => {
|
|
237
|
-
|
|
237
|
+
s.value && a.preventDefault();
|
|
238
238
|
};
|
|
239
|
-
return
|
|
240
|
-
},
|
|
239
|
+
return le(u), { boosted: s, release: u, onKeyDown: d, onPointerDown: y, onContextMenu: T };
|
|
240
|
+
}, J = "app-video-player", pe = (t) => `linear-gradient(${t},
|
|
241
241
|
color-mix(in oklab, var(--media-backdrop) 25%, transparent),
|
|
242
242
|
color-mix(in oklab, var(--media-backdrop) 8%, transparent) 50%,
|
|
243
243
|
color-mix(in oklab, var(--media-backdrop) 1%, transparent) 75%,
|
|
244
|
-
transparent)`,
|
|
245
|
-
if (customElements.get(
|
|
246
|
-
const [{ createPlayer: t, definePlayerFeature:
|
|
244
|
+
transparent)`, Ze = pe("to top"), xe = pe("to bottom"), et = "rgb(0 0 0 / 0.4)", tt = async () => {
|
|
245
|
+
if (customElements.get(J)) return;
|
|
246
|
+
const [{ createPlayer: t, definePlayerFeature: s }, { videoFeatures: e }] = await Promise.all([
|
|
247
247
|
import("@videojs/html"),
|
|
248
248
|
import("@videojs/html/video")
|
|
249
|
-
]),
|
|
249
|
+
]), n = s({
|
|
250
250
|
name: "idleControls",
|
|
251
251
|
// the fields belong to the playback and controls features, this one only reads and sets them
|
|
252
252
|
state: () => ({}),
|
|
253
|
-
attach({ target: l, signal:
|
|
253
|
+
attach({ target: l, signal: o, store: f, get: u, set: p }) {
|
|
254
254
|
var a;
|
|
255
|
-
const
|
|
256
|
-
|
|
255
|
+
const d = (a = l.container) == null ? void 0 : a.style;
|
|
256
|
+
d == null || d.setProperty("--media-controls-gradient", Ze), d == null || d.setProperty(
|
|
257
257
|
"--media-controls-top-gradient",
|
|
258
|
-
|
|
259
|
-
),
|
|
258
|
+
xe
|
|
259
|
+
), d == null || d.setProperty("--media-popover", et);
|
|
260
260
|
const y = () => {
|
|
261
|
-
const { paused: m, started:
|
|
262
|
-
return m &&
|
|
261
|
+
const { paused: m, started: k, ended: g, userActive: h, controlsVisible: w } = u();
|
|
262
|
+
return m && k && !g && !h && w;
|
|
263
263
|
}, T = f.subscribe(() => {
|
|
264
264
|
y() && queueMicrotask(() => {
|
|
265
|
-
!
|
|
265
|
+
!o.aborted && y() && p({ controlsVisible: !1 });
|
|
266
266
|
});
|
|
267
267
|
});
|
|
268
|
-
|
|
268
|
+
o.addEventListener("abort", T, { once: !0 });
|
|
269
269
|
}
|
|
270
|
-
}), { PlayerElement:
|
|
271
|
-
features: [...e,
|
|
270
|
+
}), { PlayerElement: c } = t({
|
|
271
|
+
features: [...e, n]
|
|
272
272
|
});
|
|
273
|
-
customElements.get(
|
|
274
|
-
},
|
|
273
|
+
customElements.get(J) || customElements.define(J, c);
|
|
274
|
+
}, rt = ["lang"], st = ["poster", "default-playback-rates"], at = { class: "app-video__skin" }, nt = ["crossorigin"], ot = ["src"], it = ["src"], lt = ["crossorigin"], ct = ["src"], ut = ["src"], dt = ["crossorigin"], pt = ["src"], ft = ["src"], mt = /* @__PURE__ */ be({
|
|
275
275
|
__name: "AppVideo",
|
|
276
276
|
props: {
|
|
277
277
|
hlsSrc: {},
|
|
@@ -283,215 +283,241 @@ const He = (t, r) => {
|
|
|
283
283
|
withCredentials: { type: Boolean, default: !0 },
|
|
284
284
|
authorize: {},
|
|
285
285
|
resumeKey: {},
|
|
286
|
+
suspended: { type: Boolean },
|
|
286
287
|
watermark: {},
|
|
287
288
|
color: {}
|
|
288
289
|
},
|
|
289
290
|
emits: ["error", "progress", "ended"],
|
|
290
|
-
setup(t, { emit:
|
|
291
|
-
const e = t,
|
|
291
|
+
setup(t, { emit: s }) {
|
|
292
|
+
const e = t, n = s, c = P(null), l = P(null), o = P(null), f = P([]), u = P(null), p = P(!0), d = P(!1), y = P(!1), T = Se(() => {
|
|
292
293
|
if (!(!e.chaptersSrc && !e.thumbnailsSrc))
|
|
293
294
|
return e.withCredentials ? "use-credentials" : "anonymous";
|
|
294
|
-
}), { boosted:
|
|
295
|
-
let
|
|
296
|
-
const
|
|
297
|
-
var
|
|
298
|
-
if (
|
|
299
|
-
const v =
|
|
300
|
-
|
|
301
|
-
time: v ? v.currentTime : (
|
|
302
|
-
rate: v ? v.playbackRate : (
|
|
303
|
-
playing: !!(
|
|
304
|
-
}, f.value = [...f.value,
|
|
305
|
-
},
|
|
295
|
+
}), { boosted: a, release: m, onKeyDown: k, onPointerDown: g, onContextMenu: h } = Qe(c);
|
|
296
|
+
let w = null, G = !1, I = !1, z, X, $, W = 0, E = null;
|
|
297
|
+
const fe = (r) => {
|
|
298
|
+
var i;
|
|
299
|
+
if (u.value !== r) return;
|
|
300
|
+
const v = I ? l.value : null;
|
|
301
|
+
E = {
|
|
302
|
+
time: v ? v.currentTime : (E == null ? void 0 : E.time) ?? 0,
|
|
303
|
+
rate: v ? v.playbackRate : (E == null ? void 0 : E.rate) ?? 1,
|
|
304
|
+
playing: !!(E != null && E.playing) || ((i = c.value) == null ? void 0 : i.store.paused) === !1
|
|
305
|
+
}, f.value = [...f.value, r];
|
|
306
|
+
}, Q = async () => {
|
|
306
307
|
if (!e.authorize) return !0;
|
|
307
308
|
try {
|
|
308
309
|
return await e.authorize(), !0;
|
|
309
|
-
} catch (
|
|
310
|
-
return console.error("Video authorization failed",
|
|
310
|
+
} catch (r) {
|
|
311
|
+
return console.error("Video authorization failed", r), !1;
|
|
311
312
|
}
|
|
312
|
-
},
|
|
313
|
-
src:
|
|
313
|
+
}, Z = (r, v) => ({
|
|
314
|
+
src: r ?? "",
|
|
314
315
|
withCredentials: e.withCredentials,
|
|
315
|
-
reauthorize: async () =>
|
|
316
|
+
reauthorize: async () => G ? !1 : (G = !0, Q()),
|
|
316
317
|
loaded: () => {
|
|
317
|
-
|
|
318
|
+
G = !1, I = !0;
|
|
318
319
|
},
|
|
319
|
-
hasLoaded: () =>
|
|
320
|
-
fail: () =>
|
|
321
|
-
report: (
|
|
320
|
+
hasLoaded: () => I,
|
|
321
|
+
fail: () => fe(v),
|
|
322
|
+
report: (i) => {
|
|
322
323
|
var C;
|
|
323
|
-
return
|
|
324
|
-
...
|
|
324
|
+
return n("error", {
|
|
325
|
+
...i,
|
|
325
326
|
mode: v,
|
|
326
327
|
time: ((C = l.value) == null ? void 0 : C.currentTime) ?? 0
|
|
327
328
|
});
|
|
328
329
|
},
|
|
329
330
|
dismissError: () => queueMicrotask(() => {
|
|
330
|
-
var
|
|
331
|
-
return (
|
|
331
|
+
var i;
|
|
332
|
+
return (i = c.value) == null ? void 0 : i.store.dismissError();
|
|
332
333
|
})
|
|
333
|
-
}),
|
|
334
|
-
e.watermark && (
|
|
335
|
-
var
|
|
336
|
-
(((
|
|
337
|
-
|
|
338
|
-
},
|
|
339
|
-
},
|
|
340
|
-
},
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
334
|
+
}), me = () => {
|
|
335
|
+
e.watermark && (X = setInterval(() => {
|
|
336
|
+
var r;
|
|
337
|
+
(((r = c.value) == null ? void 0 : r.store.paused) ?? !0) || (d.value = !0, $ = setTimeout(() => {
|
|
338
|
+
d.value = !1;
|
|
339
|
+
}, Fe));
|
|
340
|
+
}, Me));
|
|
341
|
+
}, ve = (r, v) => {
|
|
342
|
+
const i = () => {
|
|
343
|
+
v === W && (y.value = !0);
|
|
344
|
+
};
|
|
345
|
+
r.addEventListener(
|
|
346
|
+
"seeked",
|
|
347
|
+
() => {
|
|
348
|
+
r.readyState >= He ? i() : r.addEventListener("canplay", i, { once: !0 });
|
|
349
|
+
},
|
|
350
|
+
{ once: !0 }
|
|
351
|
+
);
|
|
352
|
+
}, x = async (r) => {
|
|
353
|
+
var re;
|
|
354
|
+
const v = ++W;
|
|
355
|
+
await _e();
|
|
356
|
+
const i = l.value, C = (re = c.value) == null ? void 0 : re.store;
|
|
357
|
+
if (!(!i || !C) && (G = !1, I = !1, r !== B.Progressive && await Q(), v === W)) {
|
|
358
|
+
if (e.resumeKey && ze(i, e.resumeKey), Ke(i, () => a.value), Ne(
|
|
359
|
+
i,
|
|
360
|
+
(K) => n("progress", K),
|
|
361
|
+
() => n("ended")
|
|
362
|
+
), E) {
|
|
363
|
+
const { time: K, rate: Ee, playing: ke } = E, se = () => {
|
|
364
|
+
E = null, K && (i.currentTime = K), i.playbackRate = Ee;
|
|
353
365
|
};
|
|
354
|
-
|
|
366
|
+
ke ? Ue(i, se) : (i.preload = "auto", i.addEventListener("loadedmetadata", se, { once: !0 }), K && ve(i, v));
|
|
355
367
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
) :
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
) :
|
|
368
|
+
r === B.Hls && w ? je(
|
|
369
|
+
i,
|
|
370
|
+
w,
|
|
371
|
+
Z(e.hlsSrc, r)
|
|
372
|
+
) : r === B.Dash ? qe(
|
|
373
|
+
i,
|
|
374
|
+
Z(e.dashSrc, r)
|
|
375
|
+
) : Je(i, e.sources ?? []), p.value = C.controlsVisible, z = C.subscribe(() => {
|
|
364
376
|
p.value = C.controlsVisible;
|
|
365
|
-
}),
|
|
377
|
+
}), me();
|
|
366
378
|
}
|
|
367
|
-
},
|
|
368
|
-
|
|
369
|
-
},
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
379
|
+
}, Y = () => {
|
|
380
|
+
W++, m(), z == null || z(), z = void 0, clearInterval(X), clearTimeout($), d.value = !1;
|
|
381
|
+
}, he = () => {
|
|
382
|
+
const r = l.value;
|
|
383
|
+
r && I && (E = {
|
|
384
|
+
time: r.currentTime,
|
|
385
|
+
rate: r.playbackRate,
|
|
386
|
+
playing: !1
|
|
387
|
+
}), Y();
|
|
388
|
+
}, ee = () => {
|
|
389
|
+
if (!o.value) return;
|
|
390
|
+
const r = Be(e, o.value, f.value);
|
|
391
|
+
r !== u.value && (!r && u.value || (Y(), u.value = r, r && x(r)));
|
|
392
|
+
}, ye = async () => {
|
|
393
|
+
const [r] = await Promise.all([
|
|
375
394
|
e.hlsSrc ? import("@videojs/hlsjs-video") : null,
|
|
376
395
|
e.hlsSrc ? import("@videojs/html/media/hlsjs-video") : null,
|
|
377
396
|
e.dashSrc ? import("@videojs/html/media/dash-video") : null,
|
|
378
397
|
import("@videojs/html/i18n"),
|
|
379
398
|
import("@videojs/html/i18n/locales/uk/register"),
|
|
380
|
-
|
|
399
|
+
tt(),
|
|
381
400
|
import("@videojs/html/video/skin")
|
|
382
401
|
]);
|
|
383
|
-
return
|
|
384
|
-
hls: !!
|
|
385
|
-
dash: !!e.dashSrc &&
|
|
402
|
+
return w = (r == null ? void 0 : r.Hls) ?? null, {
|
|
403
|
+
hls: !!w && (w.isSupported() || !!document.createElement("video").canPlayType("application/vnd.apple.mpegurl")),
|
|
404
|
+
dash: !!e.dashSrc && Ge()
|
|
386
405
|
};
|
|
387
|
-
},
|
|
388
|
-
|
|
406
|
+
}, te = async () => {
|
|
407
|
+
o.value = await ye(), ee();
|
|
389
408
|
};
|
|
390
|
-
return
|
|
409
|
+
return j(f, ee), j(
|
|
410
|
+
() => e.suspended,
|
|
411
|
+
(r) => {
|
|
412
|
+
u.value && (y.value = !1, r ? he() : x(u.value));
|
|
413
|
+
}
|
|
414
|
+
), j(
|
|
391
415
|
() => JSON.stringify([e.hlsSrc, e.dashSrc, e.sources]),
|
|
392
416
|
() => {
|
|
393
|
-
|
|
417
|
+
Y(), E = null, y.value = !1, u.value = null, o.value = null, f.value = [], te();
|
|
394
418
|
}
|
|
395
|
-
),
|
|
419
|
+
), Re(te), le(Y), (r, v) => (S(), b("div", {
|
|
396
420
|
class: "app-video",
|
|
397
421
|
onKeydownCapture: v[0] || (v[0] = //@ts-ignore
|
|
398
|
-
(...
|
|
422
|
+
(...i) => _(k) && _(k)(...i)),
|
|
399
423
|
onPointerdownCapture: v[1] || (v[1] = //@ts-ignore
|
|
400
|
-
(...
|
|
424
|
+
(...i) => _(g) && _(g)(...i)),
|
|
401
425
|
onContextmenuCapture: v[2] || (v[2] = //@ts-ignore
|
|
402
|
-
(...
|
|
426
|
+
(...i) => _(h) && _(h)(...i))
|
|
403
427
|
}, [
|
|
404
|
-
|
|
405
|
-
key:
|
|
406
|
-
lang:
|
|
428
|
+
u.value ? (S(), b("media-i18n", {
|
|
429
|
+
key: u.value,
|
|
430
|
+
lang: _(Ve)
|
|
407
431
|
}, [
|
|
408
|
-
|
|
432
|
+
q("app-video-player", {
|
|
409
433
|
ref_key: "playerEl",
|
|
410
|
-
ref:
|
|
411
|
-
poster:
|
|
412
|
-
"default-playback-rates":
|
|
434
|
+
ref: c,
|
|
435
|
+
poster: y.value ? void 0 : r.poster,
|
|
436
|
+
"default-playback-rates": _(Ie)().join(" ")
|
|
413
437
|
}, [
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
438
|
+
q("video-skin", at, [
|
|
439
|
+
r.suspended ? L("", !0) : (S(), b(ge, { key: 0 }, [
|
|
440
|
+
u.value === _(B).Hls ? (S(), b("hlsjs-video", {
|
|
441
|
+
key: 0,
|
|
442
|
+
ref_key: "mediaEl",
|
|
443
|
+
ref: l,
|
|
444
|
+
crossorigin: T.value,
|
|
445
|
+
preload: "none",
|
|
446
|
+
playsinline: ""
|
|
447
|
+
}, [
|
|
448
|
+
r.chaptersSrc ? (S(), b("track", {
|
|
449
|
+
key: r.chaptersSrc,
|
|
450
|
+
kind: "chapters",
|
|
451
|
+
default: "",
|
|
452
|
+
src: r.chaptersSrc
|
|
453
|
+
}, null, 8, ot)) : L("", !0),
|
|
454
|
+
r.thumbnailsSrc ? (S(), b("track", {
|
|
455
|
+
key: r.thumbnailsSrc,
|
|
456
|
+
kind: "metadata",
|
|
457
|
+
label: "thumbnails",
|
|
458
|
+
default: "",
|
|
459
|
+
src: r.thumbnailsSrc
|
|
460
|
+
}, null, 8, it)) : L("", !0)
|
|
461
|
+
], 8, nt)) : u.value === _(B).Dash ? (S(), b("dash-video", {
|
|
462
|
+
key: 1,
|
|
463
|
+
ref_key: "mediaEl",
|
|
464
|
+
ref: l,
|
|
465
|
+
crossorigin: T.value,
|
|
466
|
+
preload: "none",
|
|
467
|
+
playsinline: ""
|
|
468
|
+
}, [
|
|
469
|
+
r.chaptersSrc ? (S(), b("track", {
|
|
470
|
+
key: r.chaptersSrc,
|
|
471
|
+
kind: "chapters",
|
|
472
|
+
default: "",
|
|
473
|
+
src: r.chaptersSrc
|
|
474
|
+
}, null, 8, ct)) : L("", !0),
|
|
475
|
+
r.thumbnailsSrc ? (S(), b("track", {
|
|
476
|
+
key: r.thumbnailsSrc,
|
|
477
|
+
kind: "metadata",
|
|
478
|
+
label: "thumbnails",
|
|
479
|
+
default: "",
|
|
480
|
+
src: r.thumbnailsSrc
|
|
481
|
+
}, null, 8, ut)) : L("", !0)
|
|
482
|
+
], 8, lt)) : (S(), b("video", {
|
|
483
|
+
key: 2,
|
|
484
|
+
ref_key: "mediaEl",
|
|
485
|
+
ref: l,
|
|
486
|
+
crossorigin: T.value,
|
|
487
|
+
preload: "none",
|
|
488
|
+
playsinline: ""
|
|
489
|
+
}, [
|
|
490
|
+
r.chaptersSrc ? (S(), b("track", {
|
|
491
|
+
key: r.chaptersSrc,
|
|
492
|
+
kind: "chapters",
|
|
493
|
+
default: "",
|
|
494
|
+
src: r.chaptersSrc
|
|
495
|
+
}, null, 8, pt)) : L("", !0),
|
|
496
|
+
r.thumbnailsSrc ? (S(), b("track", {
|
|
497
|
+
key: r.thumbnailsSrc,
|
|
498
|
+
kind: "metadata",
|
|
499
|
+
label: "thumbnails",
|
|
500
|
+
default: "",
|
|
501
|
+
src: r.thumbnailsSrc
|
|
502
|
+
}, null, 8, ft)) : L("", !0)
|
|
503
|
+
], 8, dt))
|
|
504
|
+
], 64)),
|
|
505
|
+
r.watermark ? (S(), b("div", {
|
|
437
506
|
key: 1,
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
crossorigin: y.value,
|
|
441
|
-
preload: "none",
|
|
442
|
-
playsinline: ""
|
|
443
|
-
}, [
|
|
444
|
-
s.chaptersSrc ? (R(), S("track", {
|
|
445
|
-
key: s.chaptersSrc,
|
|
446
|
-
kind: "chapters",
|
|
447
|
-
default: "",
|
|
448
|
-
src: s.chaptersSrc
|
|
449
|
-
}, null, 8, at)) : L("", !0),
|
|
450
|
-
s.thumbnailsSrc ? (R(), S("track", {
|
|
451
|
-
key: s.thumbnailsSrc,
|
|
452
|
-
kind: "metadata",
|
|
453
|
-
label: "thumbnails",
|
|
454
|
-
default: "",
|
|
455
|
-
src: s.thumbnailsSrc
|
|
456
|
-
}, null, 8, ot)) : L("", !0)
|
|
457
|
-
], 8, st)) : (R(), S("video", {
|
|
458
|
-
key: 2,
|
|
459
|
-
ref_key: "mediaEl",
|
|
460
|
-
ref: l,
|
|
461
|
-
crossorigin: y.value,
|
|
462
|
-
preload: "none",
|
|
463
|
-
playsinline: ""
|
|
464
|
-
}, [
|
|
465
|
-
s.chaptersSrc ? (R(), S("track", {
|
|
466
|
-
key: s.chaptersSrc,
|
|
467
|
-
kind: "chapters",
|
|
468
|
-
default: "",
|
|
469
|
-
src: s.chaptersSrc
|
|
470
|
-
}, null, 8, it)) : L("", !0),
|
|
471
|
-
s.thumbnailsSrc ? (R(), S("track", {
|
|
472
|
-
key: s.thumbnailsSrc,
|
|
473
|
-
kind: "metadata",
|
|
474
|
-
label: "thumbnails",
|
|
475
|
-
default: "",
|
|
476
|
-
src: s.thumbnailsSrc
|
|
477
|
-
}, null, 8, lt)) : L("", !0)
|
|
478
|
-
], 8, nt)),
|
|
479
|
-
s.watermark ? (R(), S("div", {
|
|
480
|
-
key: 3,
|
|
481
|
-
class: ae(["app-video__watermark", {
|
|
482
|
-
"app-video__watermark_visible": c.value,
|
|
507
|
+
class: oe(["app-video__watermark", {
|
|
508
|
+
"app-video__watermark_visible": d.value,
|
|
483
509
|
"app-video__watermark_raised": p.value
|
|
484
510
|
}])
|
|
485
|
-
},
|
|
486
|
-
|
|
487
|
-
class:
|
|
511
|
+
}, we(r.watermark), 3)) : L("", !0),
|
|
512
|
+
q("div", {
|
|
513
|
+
class: oe(["app-video__boost", { "app-video__boost_visible": _(a) }])
|
|
488
514
|
}, " 2× ", 2)
|
|
489
515
|
])
|
|
490
|
-
], 8,
|
|
491
|
-
], 8,
|
|
516
|
+
], 8, st)
|
|
517
|
+
], 8, rt)) : L("", !0)
|
|
492
518
|
], 32));
|
|
493
519
|
}
|
|
494
|
-
}),
|
|
520
|
+
}), kt = /* @__PURE__ */ We(mt, [["__scopeId", "data-v-2afe5d0a"]]);
|
|
495
521
|
export {
|
|
496
|
-
|
|
522
|
+
kt as AppVideo
|
|
497
523
|
};
|