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