@validol4ik/uikit 0.13.0 → 0.14.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 -0
- package/dist/audio/audio.es.js +49 -0
- package/dist/style.css +1 -1
- package/dist/types/audio.d.ts +3 -0
- package/dist/types/components/media/AppAudio/AppAudio.vue.d.ts +5 -0
- package/dist/types/components/media/AppAudio/types.d.ts +8 -0
- package/dist/types/components/media/AppVideo/AppVideo.vue.d.ts +2 -3
- package/dist/types/components/media/AppVideo/engines.d.ts +15 -0
- package/dist/types/components/media/AppVideo/types.d.ts +3 -14
- package/dist/types/components/media/AppVideo/useBoost.d.ts +9 -0
- package/dist/types/components/media/AppVideo/videoMode.d.ts +2 -1
- package/dist/types/video.d.ts +2 -2
- package/dist/types-BV_HhKbt.cjs +1 -0
- package/dist/types-DDZ99CuH.js +14 -0
- package/dist/video/video.cjs +1 -1
- package/dist/video/video.es.js +264 -295
- package/package.json +18 -10
package/dist/video/video.es.js
CHANGED
|
@@ -1,31 +1,134 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
1
|
+
import { ref as w, onBeforeUnmount as x, defineComponent as X, watch as N, onMounted as $, createElementBlock as k, openBlock as T, unref as E, normalizeStyle as Z, createCommentVNode as H, createElementVNode as A, normalizeClass as W, toDisplayString as ee, nextTick as te } from "vue";
|
|
2
|
+
import U from "quasar/src/plugins/storage/LocalStorage.js";
|
|
3
|
+
import { V as y, S as re, D as q, a as se, B as ne, b as ae, P as oe, R as ie, W as le, c as ue } from "../types-DDZ99CuH.js";
|
|
4
|
+
import { _ as ce } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
const de = (t, e, s) => {
|
|
6
|
+
var l;
|
|
7
|
+
const i = (u) => !s.includes(u);
|
|
8
|
+
return t.hlsSrc && e.hls && i(y.Hls) ? y.Hls : t.dashSrc && e.dash && i(y.Dash) ? y.Dash : (l = t.sources) != null && l.length && i(y.Progressive) ? y.Progressive : null;
|
|
9
|
+
}, fe = (t) => re.filter((e) => t.includes(e)), pe = (t) => {
|
|
10
|
+
const e = fe(t.map(({ size: i }) => i)), s = e.includes(q) ? q : e[0];
|
|
11
|
+
return t.find((i) => i.size === s) ?? t[0] ?? null;
|
|
12
|
+
}, F = () => /iPhone|iPod/.test(navigator.userAgent), ve = () => F() || /iPad/.test(navigator.userAgent) || /Macintosh/.test(navigator.userAgent) && navigator.maxTouchPoints > 1, me = (t, e, s) => {
|
|
13
|
+
let i = null, l = !1;
|
|
14
|
+
t.addEventListener("loadstart", () => {
|
|
15
|
+
if (!t.engine || t.engine === i) return;
|
|
16
|
+
const o = t.engine;
|
|
17
|
+
i = o, o.on(e.Events.ERROR, async (d, m) => {
|
|
18
|
+
var h;
|
|
19
|
+
if (m.fatal) {
|
|
20
|
+
if (m.type === e.ErrorTypes.NETWORK_ERROR) {
|
|
21
|
+
if (((h = m.response) == null ? void 0 : h.code) === 401 && await s.reauthorize()) {
|
|
22
|
+
s.dismissError(), o.startLoad(t.currentTime);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
} else if (m.type === e.ErrorTypes.MEDIA_ERROR && !l) {
|
|
26
|
+
l = !0, s.dismissError(), o.recoverMediaError();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
s.fail();
|
|
30
|
+
}
|
|
31
|
+
}), o.on(e.Events.FRAG_LOADED, s.loaded);
|
|
32
|
+
}), t.addEventListener("error", async () => {
|
|
33
|
+
if (t.engine) return;
|
|
34
|
+
if (!await s.reauthorize()) {
|
|
35
|
+
s.fail();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
s.dismissError();
|
|
39
|
+
const o = t.currentTime, d = !t.paused;
|
|
40
|
+
t.addEventListener(
|
|
41
|
+
"loadedmetadata",
|
|
42
|
+
() => {
|
|
43
|
+
t.currentTime = o, d && t.play();
|
|
44
|
+
},
|
|
45
|
+
{ once: !0 }
|
|
46
|
+
), t.load();
|
|
47
|
+
}), t.addEventListener("loadeddata", s.loaded);
|
|
48
|
+
const u = ve();
|
|
49
|
+
s.withCredentials && !u && (t.crossOrigin = "use-credentials"), t.source = {
|
|
50
|
+
src: s.src,
|
|
51
|
+
preferPlayback: u ? "native" : "mse"
|
|
52
|
+
};
|
|
53
|
+
}, ye = (t, e) => {
|
|
54
|
+
const s = t.engine;
|
|
55
|
+
s.setXHRWithCredentialsForType("default", e.withCredentials), s.on("error", async (i) => {
|
|
56
|
+
var u, o;
|
|
57
|
+
const l = i.error;
|
|
58
|
+
if (((o = (u = l.data) == null ? void 0 : u.response) == null ? void 0 : o.status) === 401) {
|
|
59
|
+
if (await e.reauthorize()) {
|
|
60
|
+
s.attachSource(e.src, s.time());
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
} else if (!se.includes(l.code ?? -1))
|
|
64
|
+
return;
|
|
65
|
+
e.fail();
|
|
66
|
+
}), s.on("fragmentLoadingCompleted", e.loaded), t.source = {
|
|
67
|
+
src: e.src,
|
|
68
|
+
engine: {
|
|
69
|
+
dashJs: {
|
|
70
|
+
streaming: {
|
|
71
|
+
cacheInitSegments: !1,
|
|
72
|
+
abr: { autoSwitchBitrate: { video: !0 } },
|
|
73
|
+
buffer: { fastSwitchEnabled: !0 }
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}, Ee = (t, e) => {
|
|
79
|
+
const s = pe(e);
|
|
80
|
+
s && (t.src = s.src);
|
|
81
|
+
}, he = "media-controls-content, .media-popup, media-error-dialog", _e = (t) => t instanceof Element && t.matches(he), we = (t) => {
|
|
82
|
+
const e = w(!1);
|
|
83
|
+
let s, i = 1, l = null;
|
|
84
|
+
const u = () => {
|
|
85
|
+
var n;
|
|
86
|
+
return (n = t.value) == null ? void 0 : n.store;
|
|
87
|
+
}, o = () => {
|
|
88
|
+
const n = u();
|
|
89
|
+
!n || n.paused || (i = n.playbackRate, n.setPlaybackRate(ae), e.value = !0);
|
|
90
|
+
}, d = () => {
|
|
91
|
+
var n;
|
|
92
|
+
return clearTimeout(s), l == null || l(), l = null, e.value ? (e.value = !1, (n = u()) == null || n.setPlaybackRate(i), !0) : !1;
|
|
93
|
+
}, m = (n, p, _) => {
|
|
94
|
+
d(), p && (s = setTimeout(o, ne));
|
|
95
|
+
const v = (c) => {
|
|
96
|
+
if (c instanceof KeyboardEvent) {
|
|
97
|
+
if (c.key !== " ") return;
|
|
98
|
+
c.preventDefault(), c.stopPropagation();
|
|
99
|
+
}
|
|
100
|
+
_ == null || _(d());
|
|
101
|
+
};
|
|
102
|
+
n.forEach((c) => window.addEventListener(c, v, !0)), window.addEventListener("blur", d), l = () => {
|
|
103
|
+
n.forEach(
|
|
104
|
+
(c) => window.removeEventListener(c, v, !0)
|
|
105
|
+
), window.removeEventListener("blur", d);
|
|
106
|
+
};
|
|
107
|
+
}, h = (n) => {
|
|
108
|
+
var c;
|
|
109
|
+
if (n.key !== " " || n.altKey || n.ctrlKey || n.metaKey)
|
|
110
|
+
return;
|
|
111
|
+
if (n.repeat) {
|
|
112
|
+
l && (n.preventDefault(), n.stopPropagation());
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const p = u(), _ = document.activeElement;
|
|
116
|
+
if (!p || !_ || !((c = t.value) != null && c.contains(_))) return;
|
|
117
|
+
n.preventDefault(), n.stopPropagation();
|
|
118
|
+
const v = p.paused;
|
|
119
|
+
v && p.play(), m(["keyup"], !v, (S) => {
|
|
120
|
+
!v && !S && p.pause();
|
|
121
|
+
});
|
|
122
|
+
}, R = (n) => {
|
|
123
|
+
const p = u();
|
|
124
|
+
!p || p.paused || n.button !== 0 || n.composedPath().some(_e) || m(["pointerup", "pointercancel"], !0);
|
|
125
|
+
}, b = (n) => {
|
|
126
|
+
e.value && n.preventDefault();
|
|
127
|
+
};
|
|
128
|
+
return x(d), { boosted: e, release: d, onKeyDown: h, onPointerDown: R, onContextMenu: b };
|
|
129
|
+
}, Se = ["lang"], ge = ["poster"], ke = { class: "app-video__skin" }, Te = ["playsinline"], Re = ["playsinline"], be = ["playsinline"], Pe = /* @__PURE__ */ X({
|
|
26
130
|
__name: "AppVideo",
|
|
27
131
|
props: {
|
|
28
|
-
controls: { default: () => be },
|
|
29
132
|
hlsSrc: {},
|
|
30
133
|
dashSrc: {},
|
|
31
134
|
sources: {},
|
|
@@ -36,288 +139,154 @@ const be = [
|
|
|
36
139
|
watermark: {},
|
|
37
140
|
color: {}
|
|
38
141
|
},
|
|
39
|
-
setup(
|
|
40
|
-
const
|
|
41
|
-
let
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
if (!
|
|
142
|
+
setup(t) {
|
|
143
|
+
const e = t, s = w(null), i = w(null), l = w(null), u = w([]), o = w(null), d = w(!0), m = w(!0), h = w(!1), { boosted: R, release: b, onKeyDown: n, onPointerDown: p, onContextMenu: _ } = we(s);
|
|
144
|
+
let v = null, c = !1, S, L, O, P = 0;
|
|
145
|
+
const Y = (r) => {
|
|
146
|
+
o.value === r && (u.value = [...u.value, r]);
|
|
147
|
+
}, C = async () => {
|
|
148
|
+
if (!e.authorize) return !0;
|
|
46
149
|
try {
|
|
47
|
-
return await
|
|
48
|
-
} catch (
|
|
49
|
-
return console.error("Video authorization failed",
|
|
150
|
+
return await e.authorize(), !0;
|
|
151
|
+
} catch (r) {
|
|
152
|
+
return console.error("Video authorization failed", r), !1;
|
|
50
153
|
}
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (((p = o.response) == null ? void 0 : p.code) === 401 && await M()) {
|
|
73
|
-
r.startLoad(e.currentTime || s);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
} else if (o.type === t.ErrorTypes.MEDIA_ERROR && !b) {
|
|
77
|
-
b = !0, r.recoverMediaError();
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
u(null), B(i.Hls);
|
|
81
|
-
}
|
|
82
|
-
}), r.on(t.Events.FRAG_LOADED, () => {
|
|
83
|
-
_ = !1;
|
|
84
|
-
}), r.loadSource(a.hlsSrc), r.attachMedia(e);
|
|
85
|
-
});
|
|
86
|
-
return e.addEventListener("play", () => c == null ? void 0 : c.startLoad(s), {
|
|
87
|
-
once: !0
|
|
88
|
-
}), {
|
|
89
|
-
heights: f,
|
|
90
|
-
onQualityChange: (u) => {
|
|
91
|
-
c && (c.currentLevel = u === D ? -1 : c.levels.findIndex((g) => g.height === u));
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
}, ue = (e, s) => {
|
|
95
|
-
e.addEventListener("error", async () => {
|
|
96
|
-
if (!await M()) {
|
|
97
|
-
B(i.NativeHls);
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
const t = !e.paused;
|
|
101
|
-
K(e, e.currentTime), t && e.addEventListener("loadedmetadata", () => e.play(), {
|
|
102
|
-
once: !0
|
|
103
|
-
}), e.load();
|
|
104
|
-
}), e.addEventListener("loadeddata", () => _ = !1), K(e, s), e.src = a.hlsSrc;
|
|
105
|
-
}, ce = async (e, s) => {
|
|
106
|
-
const { MediaPlayer: t } = await import("dashjs"), r = t().create();
|
|
107
|
-
m = r, r.updateSettings({
|
|
108
|
-
streaming: {
|
|
109
|
-
cacheInitSegments: !1,
|
|
110
|
-
abr: { autoSwitchBitrate: { video: !0 } },
|
|
111
|
-
buffer: { fastSwitchEnabled: !0 }
|
|
112
|
-
}
|
|
113
|
-
}), r.setXHRWithCredentialsForType("default", a.withCredentials);
|
|
114
|
-
const f = (o) => r.updateSettings({
|
|
115
|
-
streaming: { abr: { autoSwitchBitrate: { video: o } } }
|
|
116
|
-
});
|
|
117
|
-
let u = !1;
|
|
118
|
-
return {
|
|
119
|
-
heights: await new Promise((o) => {
|
|
120
|
-
r.on(t.events.STREAM_INITIALIZED, () => {
|
|
121
|
-
u || (u = !0, s && r.seek(s), o(
|
|
122
|
-
r.getRepresentationsByType("video").map((p) => p.height)
|
|
123
|
-
));
|
|
124
|
-
}), r.on(t.events.ERROR, async (p) => {
|
|
125
|
-
var Z, $;
|
|
126
|
-
const S = p.error;
|
|
127
|
-
if ((($ = (Z = S.data) == null ? void 0 : Z.response) == null ? void 0 : $.status) === 401) {
|
|
128
|
-
if (await M()) {
|
|
129
|
-
r.attachSource(a.dashSrc, r.time());
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
} else if (S.code !== t.errors.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE && S.code !== t.errors.CAPABILITY_MEDIASOURCE_ERROR_CODE && S.code !== t.errors.MEDIASOURCE_TYPE_UNSUPPORTED_CODE)
|
|
133
|
-
return;
|
|
134
|
-
o(null), B(i.Dash);
|
|
135
|
-
}), r.on(t.events.FRAGMENT_LOADING_COMPLETED, () => {
|
|
136
|
-
_ = !1;
|
|
137
|
-
}), r.initialize(e, a.dashSrc, !1);
|
|
138
|
-
}),
|
|
139
|
-
onQualityChange: (o) => {
|
|
140
|
-
if (!m) return;
|
|
141
|
-
if (o === D) {
|
|
142
|
-
f(!0);
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
const p = m.getRepresentationsByType("video").find((S) => S.height === o);
|
|
146
|
-
p && (f(!1), m.setRepresentationForTypeById("video", p.id));
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
}, de = (e, s) => {
|
|
150
|
-
const t = re(e);
|
|
151
|
-
return t.length ? {
|
|
152
|
-
settings: ["quality", "speed"],
|
|
153
|
-
quality: {
|
|
154
|
-
default: D,
|
|
155
|
-
options: [D, ...t],
|
|
156
|
-
forced: !0,
|
|
157
|
-
onChange: s
|
|
158
|
-
},
|
|
159
|
-
i18n: { qualityLabel: { [D]: He } }
|
|
160
|
-
} : { settings: ["speed"] };
|
|
161
|
-
}, pe = () => {
|
|
162
|
-
var s;
|
|
163
|
-
const e = re(((s = a.sources) == null ? void 0 : s.map(({ size: t }) => t)) ?? []);
|
|
164
|
-
return e.length ? {
|
|
165
|
-
quality: {
|
|
166
|
-
default: e.includes(se) ? se : e[0],
|
|
167
|
-
options: e
|
|
168
|
-
}
|
|
169
|
-
} : {};
|
|
170
|
-
}, fe = (e) => {
|
|
171
|
-
a.watermark && (e.setAttribute("data-watermark", a.watermark), Q = setInterval(() => {
|
|
172
|
-
n != null && n.paused || (e.classList.add("app-video__watermark_visible"), x = setTimeout(() => {
|
|
173
|
-
e.classList.remove("app-video__watermark_visible");
|
|
174
|
-
}, Ke));
|
|
175
|
-
}, Me));
|
|
176
|
-
}, me = (e) => {
|
|
177
|
-
e.tabIndex = 0, n == null || n.on("play", () => {
|
|
178
|
-
const s = document.activeElement;
|
|
179
|
-
(!s || s === document.body || s.matches(".plyr__control--overlaid")) && e.focus({ preventScroll: !0 });
|
|
180
|
-
});
|
|
181
|
-
}, q = () => {
|
|
182
|
-
!n || n.paused || (Y = n.speed, n.speed = Fe, w = !0, d == null || d.classList.add("app-video__boost_visible"));
|
|
183
|
-
}, z = () => {
|
|
184
|
-
clearTimeout(H), w && (w = !1, d == null || d.classList.remove("app-video__boost_visible"), n && (n.speed = Y));
|
|
185
|
-
}, ve = (e) => {
|
|
186
|
-
d = document.createElement("div"), d.className = "app-video__boost", d.textContent = Qe, e.appendChild(d);
|
|
187
|
-
}, Ee = () => {
|
|
188
|
-
const e = document.activeElement, s = n == null ? void 0 : n.elements.container;
|
|
189
|
-
return !!e && !!(s != null && s.contains(e));
|
|
190
|
-
}, he = (e) => {
|
|
191
|
-
if (!(e.key !== " " || e.altKey || e.ctrlKey || e.metaKey)) {
|
|
192
|
-
if (e.repeat) {
|
|
193
|
-
I && (e.preventDefault(), e.stopPropagation());
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
!n || !Ee() || (e.preventDefault(), e.stopPropagation(), I = !0, U = n.paused, U ? n.play() : H = setTimeout(q, ne), window.addEventListener("keyup", G, !0), window.addEventListener("blur", O));
|
|
154
|
+
}, I = (r, f) => ({
|
|
155
|
+
src: r ?? "",
|
|
156
|
+
withCredentials: e.withCredentials,
|
|
157
|
+
reauthorize: async () => c ? !1 : (c = !0, C()),
|
|
158
|
+
loaded: () => c = !1,
|
|
159
|
+
fail: () => Y(f),
|
|
160
|
+
dismissError: () => queueMicrotask(() => {
|
|
161
|
+
var a;
|
|
162
|
+
return (a = s.value) == null ? void 0 : a.store.dismissError();
|
|
163
|
+
})
|
|
164
|
+
}), G = (r) => {
|
|
165
|
+
if (!e.resumeKey) return;
|
|
166
|
+
const f = e.resumeKey;
|
|
167
|
+
let a = Number(U.getItem(f)) || 0;
|
|
168
|
+
if (a) {
|
|
169
|
+
const g = a;
|
|
170
|
+
r.addEventListener(
|
|
171
|
+
"loadedmetadata",
|
|
172
|
+
() => r.currentTime = g,
|
|
173
|
+
{ once: !0 }
|
|
174
|
+
);
|
|
197
175
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}, G = (e) => {
|
|
201
|
-
if (e.key !== " " || !I) return;
|
|
202
|
-
e.preventDefault(), e.stopPropagation();
|
|
203
|
-
const s = !U && !w;
|
|
204
|
-
O(), s && (n == null || n.pause());
|
|
205
|
-
}, A = () => {
|
|
206
|
-
window.removeEventListener("pointerup", A), window.removeEventListener("pointercancel", A), w && (P = !0), z();
|
|
207
|
-
}, ye = (e) => {
|
|
208
|
-
const s = n == null ? void 0 : n.elements.container, t = e.target;
|
|
209
|
-
P = !1, !(!n || n.paused || e.button !== 0 || !s || t !== s && !t.closest(".plyr__video-wrapper")) && (H = setTimeout(q, ne), window.addEventListener("pointerup", A), window.addEventListener("pointercancel", A));
|
|
210
|
-
}, _e = (e) => {
|
|
211
|
-
P && (P = !1, e.preventDefault(), e.stopPropagation());
|
|
212
|
-
}, we = (e) => {
|
|
213
|
-
w && e.preventDefault();
|
|
214
|
-
}, ge = (e) => {
|
|
215
|
-
if (!a.resumeKey || !n) return;
|
|
216
|
-
const s = a.resumeKey;
|
|
217
|
-
let t = e;
|
|
218
|
-
n.on("timeupdate", () => {
|
|
219
|
-
const r = (n == null ? void 0 : n.currentTime) ?? 0;
|
|
220
|
-
Math.abs(r - t) >= ze && (t = r, te.setItem(s, t));
|
|
176
|
+
r.addEventListener("timeupdate", () => {
|
|
177
|
+
Math.abs(r.currentTime - a) >= ie && (a = r.currentTime, U.setItem(f, a));
|
|
221
178
|
});
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
179
|
+
}, J = () => {
|
|
180
|
+
e.watermark && (L = setInterval(() => {
|
|
181
|
+
var r;
|
|
182
|
+
(((r = s.value) == null ? void 0 : r.store.paused) ?? !0) || (h.value = !0, O = setTimeout(() => {
|
|
183
|
+
h.value = !1;
|
|
184
|
+
}, le));
|
|
185
|
+
}, ue));
|
|
186
|
+
}, Q = async (r) => {
|
|
187
|
+
var M, B;
|
|
188
|
+
const f = ++P;
|
|
189
|
+
await te();
|
|
190
|
+
const a = i.value, g = (M = s.value) == null ? void 0 : M.store;
|
|
191
|
+
if (!a || !g || (c = !1, r !== y.Progressive && await C(), f !== P)) return;
|
|
192
|
+
G(a), r === y.Hls && v ? me(
|
|
193
|
+
a,
|
|
194
|
+
v,
|
|
195
|
+
I(e.hlsSrc, r)
|
|
196
|
+
) : r === y.Dash ? ye(
|
|
197
|
+
a,
|
|
198
|
+
I(e.dashSrc, r)
|
|
199
|
+
) : Ee(a, e.sources ?? []);
|
|
200
|
+
const K = ((B = a.shadowRoot) == null ? void 0 : B.querySelector("video")) ?? a;
|
|
201
|
+
K.addEventListener("webkitendfullscreen", () => {
|
|
202
|
+
K.controls = !1;
|
|
203
|
+
}), m.value = g.controlsVisible, S = g.subscribe(() => {
|
|
204
|
+
m.value = g.controlsVisible;
|
|
205
|
+
}), J();
|
|
206
|
+
}, D = () => {
|
|
207
|
+
P++, b(), S == null || S(), S = void 0, clearInterval(L), clearTimeout(O), h.value = !1;
|
|
208
|
+
}, V = () => {
|
|
209
|
+
if (!l.value) return;
|
|
210
|
+
const r = de(e, l.value, u.value);
|
|
211
|
+
r !== o.value && (D(), o.value = r, r && Q(r));
|
|
212
|
+
}, j = async () => {
|
|
213
|
+
const [r] = await Promise.all([
|
|
214
|
+
e.hlsSrc ? import("@videojs/hlsjs-video") : null,
|
|
215
|
+
e.hlsSrc ? import("@videojs/html/media/hlsjs-video") : null,
|
|
216
|
+
e.dashSrc ? import("@videojs/html/media/dash-video") : null,
|
|
217
|
+
import("@videojs/html/i18n"),
|
|
218
|
+
import("@videojs/html/i18n/locales/uk/register"),
|
|
219
|
+
import("@videojs/html/video/player"),
|
|
220
|
+
import("@videojs/html/video/skin")
|
|
256
221
|
]);
|
|
257
|
-
return {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
dash: !!(s != null && s.supportsMediaSource())
|
|
222
|
+
return v = (r == null ? void 0 : r.Hls) ?? null, {
|
|
223
|
+
hls: !!v && (v.isSupported() || !!document.createElement("video").canPlayType("application/vnd.apple.mpegurl")),
|
|
224
|
+
// the same check as dash.js's supportsMediaSource()
|
|
225
|
+
dash: !!e.dashSrc && ("MediaSource" in window || "WebKitMediaSource" in window)
|
|
262
226
|
};
|
|
263
|
-
},
|
|
264
|
-
|
|
227
|
+
}, z = async () => {
|
|
228
|
+
d.value = !F(), l.value = await j(), V();
|
|
265
229
|
};
|
|
266
|
-
|
|
267
|
-
() => JSON.stringify([
|
|
230
|
+
return N(u, V), N(
|
|
231
|
+
() => JSON.stringify([e.hlsSrc, e.dashSrc, e.sources]),
|
|
268
232
|
() => {
|
|
269
|
-
|
|
233
|
+
D(), o.value = null, l.value = null, u.value = [], z();
|
|
270
234
|
}
|
|
271
|
-
)
|
|
272
|
-
const X = [
|
|
273
|
-
["keydown", he],
|
|
274
|
-
["pointerdown", ye],
|
|
275
|
-
["click", _e],
|
|
276
|
-
["contextmenu", we]
|
|
277
|
-
];
|
|
278
|
-
return Te(() => {
|
|
279
|
-
X.forEach(
|
|
280
|
-
([e, s]) => {
|
|
281
|
-
var t;
|
|
282
|
-
return (t = R.value) == null ? void 0 : t.addEventListener(e, s, !0);
|
|
283
|
-
}
|
|
284
|
-
), J();
|
|
285
|
-
}), Ae(() => {
|
|
286
|
-
X.forEach(
|
|
287
|
-
([e, s]) => {
|
|
288
|
-
var t;
|
|
289
|
-
return (t = R.value) == null ? void 0 : t.removeEventListener(e, s, !0);
|
|
290
|
-
}
|
|
291
|
-
), A(), O(), F();
|
|
292
|
-
}), (e, s) => (C(), k("div", {
|
|
293
|
-
ref_key: "rootEl",
|
|
294
|
-
ref: R,
|
|
235
|
+
), $(z), x(D), (r, f) => (T(), k("div", {
|
|
295
236
|
class: "app-video",
|
|
296
|
-
style:
|
|
237
|
+
style: Z(r.color ? { "--media-accent-color": `var(--q-${r.color})` } : void 0),
|
|
238
|
+
onKeydownCapture: f[0] || (f[0] = //@ts-ignore
|
|
239
|
+
(...a) => E(n) && E(n)(...a)),
|
|
240
|
+
onPointerdownCapture: f[1] || (f[1] = //@ts-ignore
|
|
241
|
+
(...a) => E(p) && E(p)(...a)),
|
|
242
|
+
onContextmenuCapture: f[2] || (f[2] = //@ts-ignore
|
|
243
|
+
(...a) => E(_) && E(_)(...a))
|
|
297
244
|
}, [
|
|
298
|
-
|
|
299
|
-
key:
|
|
300
|
-
|
|
245
|
+
o.value ? (T(), k("media-i18n", {
|
|
246
|
+
key: o.value,
|
|
247
|
+
lang: E(oe)
|
|
301
248
|
}, [
|
|
302
|
-
|
|
303
|
-
ref_key: "
|
|
304
|
-
ref:
|
|
305
|
-
poster:
|
|
306
|
-
preload: "none",
|
|
307
|
-
playsinline: N.value || void 0
|
|
249
|
+
A("video-player", {
|
|
250
|
+
ref_key: "playerEl",
|
|
251
|
+
ref: s,
|
|
252
|
+
poster: r.poster
|
|
308
253
|
}, [
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
254
|
+
A("video-skin", ke, [
|
|
255
|
+
o.value === E(y).Hls ? (T(), k("hlsjs-video", {
|
|
256
|
+
key: 0,
|
|
257
|
+
ref_key: "mediaEl",
|
|
258
|
+
ref: i,
|
|
259
|
+
preload: "none",
|
|
260
|
+
playsinline: d.value || void 0
|
|
261
|
+
}, null, 8, Te)) : o.value === E(y).Dash ? (T(), k("dash-video", {
|
|
262
|
+
key: 1,
|
|
263
|
+
ref_key: "mediaEl",
|
|
264
|
+
ref: i,
|
|
265
|
+
preload: "none",
|
|
266
|
+
playsinline: d.value || void 0
|
|
267
|
+
}, null, 8, Re)) : (T(), k("video", {
|
|
268
|
+
key: 2,
|
|
269
|
+
ref_key: "mediaEl",
|
|
270
|
+
ref: i,
|
|
271
|
+
preload: "none",
|
|
272
|
+
playsinline: d.value || void 0
|
|
273
|
+
}, null, 8, be)),
|
|
274
|
+
r.watermark ? (T(), k("div", {
|
|
275
|
+
key: 3,
|
|
276
|
+
class: W(["app-video__watermark", {
|
|
277
|
+
"app-video__watermark_visible": h.value,
|
|
278
|
+
"app-video__watermark_raised": m.value
|
|
279
|
+
}])
|
|
280
|
+
}, ee(r.watermark), 3)) : H("", !0),
|
|
281
|
+
A("div", {
|
|
282
|
+
class: W(["app-video__boost", { "app-video__boost_visible": E(R) }])
|
|
283
|
+
}, " 2× ", 2)
|
|
284
|
+
])
|
|
285
|
+
], 8, ge)
|
|
286
|
+
], 8, Se)) : H("", !0)
|
|
287
|
+
], 36));
|
|
318
288
|
}
|
|
319
|
-
}),
|
|
289
|
+
}), Ce = /* @__PURE__ */ ce(Pe, [["__scopeId", "data-v-7bf80510"]]);
|
|
320
290
|
export {
|
|
321
|
-
|
|
322
|
-
be as DEFAULT_CONTROLS
|
|
291
|
+
Ce as AppVideo
|
|
323
292
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@validol4ik/uikit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/uikit.cjs",
|
|
6
6
|
"module": "./dist/uikit.es.js",
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
"video": [
|
|
11
11
|
"./dist/types/video.d.ts"
|
|
12
12
|
],
|
|
13
|
+
"audio": [
|
|
14
|
+
"./dist/types/audio.d.ts"
|
|
15
|
+
],
|
|
13
16
|
"pdf": [
|
|
14
17
|
"./dist/types/pdf.d.ts"
|
|
15
18
|
]
|
|
@@ -36,6 +39,11 @@
|
|
|
36
39
|
"import": "./dist/video/video.es.js",
|
|
37
40
|
"require": "./dist/video/video.cjs"
|
|
38
41
|
},
|
|
42
|
+
"./audio": {
|
|
43
|
+
"types": "./dist/types/audio.d.ts",
|
|
44
|
+
"import": "./dist/audio/audio.es.js",
|
|
45
|
+
"require": "./dist/audio/audio.cjs"
|
|
46
|
+
},
|
|
39
47
|
"./pdf": {
|
|
40
48
|
"types": "./dist/types/pdf.d.ts",
|
|
41
49
|
"import": "./dist/pdf/pdf.es.js",
|
|
@@ -67,13 +75,13 @@
|
|
|
67
75
|
"@storybook/vue3": "^8.4.4",
|
|
68
76
|
"@storybook/vue3-vite": "^8.4.4",
|
|
69
77
|
"@types/node": "^22.9.0",
|
|
78
|
+
"@videojs/dash-video": "10.2.0",
|
|
79
|
+
"@videojs/hlsjs-video": "10.2.0",
|
|
80
|
+
"@videojs/html": "10.2.0",
|
|
70
81
|
"@vitejs/plugin-vue": "^5.2.0",
|
|
71
82
|
"@vue/test-utils": "^2.4.6",
|
|
72
|
-
"dashjs": "^5.2.1",
|
|
73
83
|
"happy-dom": "^15.11.6",
|
|
74
|
-
"hls.js": "^1.7.3",
|
|
75
84
|
"pdfjs-dist": "3.11.174",
|
|
76
|
-
"plyr": "3.8.3",
|
|
77
85
|
"quasar": "^2.17.2",
|
|
78
86
|
"sass": "^1.81.0",
|
|
79
87
|
"storybook": "^8.4.4",
|
|
@@ -84,21 +92,21 @@
|
|
|
84
92
|
"vue-tsc": "^2.1.10"
|
|
85
93
|
},
|
|
86
94
|
"peerDependencies": {
|
|
87
|
-
"
|
|
88
|
-
"
|
|
95
|
+
"@videojs/dash-video": "^10.2.0",
|
|
96
|
+
"@videojs/hlsjs-video": "^10.2.0",
|
|
97
|
+
"@videojs/html": "^10.2.0",
|
|
89
98
|
"pdfjs-dist": "^3.11.174",
|
|
90
|
-
"plyr": "^3.8.3",
|
|
91
99
|
"quasar": "^2.17.2",
|
|
92
100
|
"vue": ">=3"
|
|
93
101
|
},
|
|
94
102
|
"peerDependenciesMeta": {
|
|
95
|
-
"
|
|
103
|
+
"@videojs/dash-video": {
|
|
96
104
|
"optional": true
|
|
97
105
|
},
|
|
98
|
-
"
|
|
106
|
+
"@videojs/hlsjs-video": {
|
|
99
107
|
"optional": true
|
|
100
108
|
},
|
|
101
|
-
"
|
|
109
|
+
"@videojs/html": {
|
|
102
110
|
"optional": true
|
|
103
111
|
},
|
|
104
112
|
"pdfjs-dist": {
|