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