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