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