@webitel/ui-sdk 26.2.69 → 26.2.71
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/{errors-DCJKAXTz.js → errors-CTL-RV3B.js} +1 -1
- package/dist/{index-cVwBpL1P.js → index-CLhoKzki.js} +1 -1
- package/dist/{index-B71drQtj.js → index-x2Djqp3W.js} +4 -4
- package/dist/{install-BEn6vjFW.js → install-Cp4KnSCI.js} +1102 -1220
- package/dist/{isObject-DB0eH0MA.js → isObject-C_1aA257.js} +1 -1
- package/dist/prod-BoQuiIB3.js +973 -0
- package/dist/srt-parser-CsN7bp5E.js +26 -0
- package/dist/ssa-parser-BJOOPeQF.js +200 -0
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +1 -1
- package/dist/ui-sdk.umd.cjs +464 -482
- package/dist/vidstack-Bq6c3Bam-CeA9TvJ4.js +425 -0
- package/dist/vidstack-D2pY00kU-hPWR401d.js +135 -0
- package/dist/vidstack-DDXt6fpN-DEjXPjHx.js +50 -0
- package/dist/vidstack-D_-9AA6_-Bh2Pn0IA.js +20 -0
- package/dist/{vidstack-Dm1xEU9Q-qSXq3AI-.js → vidstack-Dm1xEU9Q-CXHNvShT.js} +10 -11
- package/dist/vidstack-DqAw8m9J-BSNVCj3S.js +22 -0
- package/dist/vidstack-audio-C3of4Q-I.js +28 -0
- package/dist/vidstack-dash-BD3CNy0Z.js +392 -0
- package/dist/vidstack-google-cast-DXLqBW30.js +382 -0
- package/dist/vidstack-hls-C6Az6tgn.js +309 -0
- package/dist/vidstack-krOAtKMi-C50BTxmn.js +28 -0
- package/dist/vidstack-video-CtScgimr.js +163 -0
- package/dist/vidstack-vimeo-dFXp7_Vx.js +451 -0
- package/dist/vidstack-youtube-BF0J2izd.js +232 -0
- package/dist/{vuex.esm-bundler-tZVctzTj.js → vuex.esm-bundler-D5BkZi23.js} +1 -1
- package/dist/{wt-action-bar-ColV1kXE.js → wt-action-bar-BrFf9y4i.js} +1 -1
- package/dist/{wt-button-select-CfoSEYMj.js → wt-button-select-BQOYl5Z5.js} +1 -1
- package/dist/{wt-chat-emoji-Bgv9Viz-.js → wt-chat-emoji-D9rZ4xfn.js} +6 -11
- package/dist/{wt-confirm-dialog-bVhuyR-Q.js → wt-confirm-dialog-DdRFwuNQ.js} +1 -1
- package/dist/{wt-context-menu-Cd8pgBRV.js → wt-context-menu-Dx-K-ACK.js} +1 -1
- package/dist/{wt-copy-action-jjp1mO2h.js → wt-copy-action-BPMZsUtG.js} +1 -1
- package/dist/wt-datepicker-PK3BgSmp.js +5660 -0
- package/dist/wt-display-chip-items-CAO8OLhX.js +46 -0
- package/dist/{wt-dual-panel-DJsiR6RF.js → wt-dual-panel-CAh5CMKO.js} +1 -1
- package/dist/{wt-dummy-O94iGdZS.js → wt-dummy-DMXuDlcb.js} +1 -1
- package/dist/{wt-error-page-xgSWJ65z.js → wt-error-page-UoX8GV8V.js} +1 -1
- package/dist/{wt-expansion-panel-vzG02b62.js → wt-expansion-panel-G7G1803j.js} +1 -1
- package/dist/{wt-filters-panel-wrapper-h-UaAMuF.js → wt-filters-panel-wrapper-GI9X-SaD.js} +1 -1
- package/dist/wt-galleria-DtJgf7Db.js +322 -0
- package/dist/{wt-navigation-menu-Cu5Y9kua.js → wt-navigation-menu-CrDo7Vpq.js} +2 -5
- package/dist/wt-notifications-bar-CmUZpffK.js +79 -0
- package/dist/{wt-page-header-DlRrRzG7.js → wt-page-header-C7JiNmsy.js} +1 -1
- package/dist/{wt-pagination-CW46I4u2.js → wt-pagination-CaOk680t.js} +1 -1
- package/dist/{wt-player-3qh_Jzm2.js → wt-player-Cs2dAT3H.js} +1 -1
- package/dist/{wt-popover-BTG5bUP0.js → wt-popover-U7JE0uoX.js} +19 -22
- package/dist/{wt-search-bar-CTsNf7bp.js → wt-search-bar-f1yQguL2.js} +25 -28
- package/dist/{wt-selection-popup-DvaUvY4O.js → wt-selection-popup-CwjvQZ77.js} +1 -1
- package/dist/{wt-start-page-CcN7JC_u.js → wt-start-page-CMGnK33r.js} +7 -7
- package/dist/{wt-status-select-C8t0cgTg.js → wt-status-select-C5RigMIl.js} +1 -1
- package/dist/{wt-stepper-BLb42q2I.js → wt-stepper-1gbY9rv5.js} +1 -1
- package/dist/{wt-table-9gmsV0Y9.js → wt-table-D6d0dRYQ.js} +111 -114
- package/dist/{wt-table-actions-BB7AH7sR.js → wt-table-actions-BsjrniPP.js} +1 -1
- package/dist/{wt-table-column-select-B3lrCEaV.js → wt-table-column-select-JiD5kd7i.js} +28 -31
- package/dist/{wt-tabs-CCHi_E1a.js → wt-tabs-DpxPfuRj.js} +1 -1
- package/dist/{wt-tags-input-DLicKjv3.js → wt-tags-input-CJpT_4mw.js} +56 -57
- package/dist/{wt-timepicker-B9ONDzNQ.js → wt-timepicker-CtH8MdN-.js} +1 -1
- package/dist/{wt-tree-cQlvJmh5.js → wt-tree-C99Qwdwn.js} +4 -5
- package/dist/{wt-tree-table-B89YKiMf.js → wt-tree-table-3qAoEJ7m.js} +5 -5
- package/dist/{wt-type-extension-value-input-Da8FXLDs.js → wt-type-extension-value-input-CfiVBG5u.js} +214 -218
- package/dist/wt-vidstack-player-B8Ilx2ml.js +10229 -0
- package/package.json +5 -5
- package/src/modules/Userinfo/classes/ApplicationsAccess.ts +36 -3
- package/src/modules/Userinfo/scripts/utils.ts +2 -22
- package/src/modules/Userinfo/stores/accessStore.ts +20 -5
- package/src/modules/Userinfo/stores/userinfoStore.ts +1 -0
- package/src/modules/Userinfo/types/UserAccess.d.ts +11 -3
- package/types/modules/Userinfo/classes/ApplicationsAccess.d.ts +34 -243
- package/types/modules/Userinfo/scripts/utils.d.ts +1 -2
- package/types/modules/Userinfo/stores/accessStore.d.ts +1 -1
- package/types/modules/Userinfo/stores/userinfoStore.d.ts +21 -9
- package/dist/prod-DTLJXtPo.js +0 -994
- package/dist/srt-parser-CWqahKwO.js +0 -27
- package/dist/ssa-parser-BqjjKy4M.js +0 -209
- package/dist/vidstack-Bq6c3Bam-w5y-QQDX.js +0 -413
- package/dist/vidstack-D2pY00kU-BI5rYx7p.js +0 -138
- package/dist/vidstack-DDXt6fpN-QZPrP2dy.js +0 -60
- package/dist/vidstack-D_-9AA6_-Bo1xPN-G.js +0 -20
- package/dist/vidstack-DqAw8m9J-DL7LzrFt.js +0 -29
- package/dist/vidstack-audio-lX1O0fza.js +0 -32
- package/dist/vidstack-dash-BQkRGWe_.js +0 -403
- package/dist/vidstack-google-cast-C39n-PU1.js +0 -377
- package/dist/vidstack-hls-BCLhCuNJ.js +0 -324
- package/dist/vidstack-krOAtKMi-B4IZWKdc.js +0 -29
- package/dist/vidstack-video-BgayrEIC.js +0 -181
- package/dist/vidstack-vimeo-Lpe7iySs.js +0 -437
- package/dist/vidstack-youtube-Dmcz0xVm.js +0 -236
- package/dist/wt-datepicker-Cs3xDzVq.js +0 -5789
- package/dist/wt-display-chip-items-IqNMxa_X.js +0 -52
- package/dist/wt-galleria-cDjsiOcp.js +0 -324
- package/dist/wt-notifications-bar-KNH47kZ7.js +0 -80
- package/dist/wt-vidstack-player-BzFbIwCa.js +0 -10250
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { s as t } from "./wt-vidstack-player-B8Ilx2ml.js";
|
|
2
|
+
import { H as r, a as s } from "./vidstack-Bq6c3Bam-CeA9TvJ4.js";
|
|
3
|
+
class d extends r {
|
|
4
|
+
$$PROVIDER_TYPE = "AUDIO";
|
|
5
|
+
get type() {
|
|
6
|
+
return "audio";
|
|
7
|
+
}
|
|
8
|
+
airPlay;
|
|
9
|
+
constructor(i, e) {
|
|
10
|
+
super(i, e), t(() => {
|
|
11
|
+
this.airPlay = new s(this.media, e);
|
|
12
|
+
}, this.scope);
|
|
13
|
+
}
|
|
14
|
+
setup() {
|
|
15
|
+
super.setup(), this.type === "audio" && this.ctx.notify("provider-setup", this);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The native HTML `<audio>` element.
|
|
19
|
+
*
|
|
20
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement}
|
|
21
|
+
*/
|
|
22
|
+
get audio() {
|
|
23
|
+
return this.media;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
d as AudioProvider
|
|
28
|
+
};
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { G as x, f as p, y as k, p as M, Q as S, l as v, e as C, D as l, z as N, w as g, T as F, L as u, H as R, J as I, r as P, A as q, q as E, B as _, C as $, F as H } from "./wt-vidstack-player-B8Ilx2ml.js";
|
|
2
|
+
import { VideoProvider as j } from "./vidstack-video-CtScgimr.js";
|
|
3
|
+
import { R as O } from "./vidstack-DqAw8m9J-BSNVCj3S.js";
|
|
4
|
+
function b(n) {
|
|
5
|
+
try {
|
|
6
|
+
return new Intl.DisplayNames(navigator.languages, { type: "language" }).of(n) ?? null;
|
|
7
|
+
} catch {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
const Q = (n) => `dash-${N(n)}`;
|
|
12
|
+
class G {
|
|
13
|
+
#e;
|
|
14
|
+
#i;
|
|
15
|
+
#t = null;
|
|
16
|
+
#a = /* @__PURE__ */ new Set();
|
|
17
|
+
#r = null;
|
|
18
|
+
config = {};
|
|
19
|
+
get instance() {
|
|
20
|
+
return this.#t;
|
|
21
|
+
}
|
|
22
|
+
constructor(t, i) {
|
|
23
|
+
this.#e = t, this.#i = i;
|
|
24
|
+
}
|
|
25
|
+
setup(t) {
|
|
26
|
+
this.#t = t().create();
|
|
27
|
+
const i = this.#g.bind(this);
|
|
28
|
+
for (const s of Object.values(t.events)) this.#t.on(s, i);
|
|
29
|
+
this.#t.on(t.events.ERROR, this.#b.bind(this));
|
|
30
|
+
for (const s of this.#a) s(this.#t);
|
|
31
|
+
this.#i.player.dispatch("dash-instance", {
|
|
32
|
+
detail: this.#t
|
|
33
|
+
}), this.#t.initialize(this.#e, void 0, !1), this.#t.updateSettings({
|
|
34
|
+
streaming: {
|
|
35
|
+
text: {
|
|
36
|
+
// Disabling text rendering by dash.
|
|
37
|
+
defaultEnabled: !1,
|
|
38
|
+
dispatchForManualRendering: !0
|
|
39
|
+
},
|
|
40
|
+
buffer: {
|
|
41
|
+
/// Enables buffer replacement when switching bitrates for faster switching.
|
|
42
|
+
fastSwitchEnabled: !0
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
...this.config
|
|
46
|
+
}), this.#t.on(t.events.FRAGMENT_LOADING_STARTED, this.#w.bind(this)), this.#t.on(
|
|
47
|
+
t.events.FRAGMENT_LOADING_COMPLETED,
|
|
48
|
+
this.#E.bind(this)
|
|
49
|
+
), this.#t.on(t.events.MANIFEST_LOADED, this.#v.bind(this)), this.#t.on(t.events.QUALITY_CHANGE_RENDERED, this.#S.bind(this)), this.#t.on(t.events.TEXT_TRACKS_ADDED, this.#m.bind(this)), this.#t.on(t.events.TRACK_CHANGE_RENDERED, this.#T.bind(this)), this.#i.qualities[S.enableAuto] = this.#A.bind(this), v(this.#i.qualities, "change", this.#D.bind(this)), v(this.#i.audioTracks, "change", this.#x.bind(this)), this.#r = C(this.#d.bind(this));
|
|
50
|
+
}
|
|
51
|
+
#s(t) {
|
|
52
|
+
return new l(Q(t.type), { detail: t });
|
|
53
|
+
}
|
|
54
|
+
#d() {
|
|
55
|
+
if (!this.#i.$state.live()) return;
|
|
56
|
+
const t = new O(this.#f.bind(this));
|
|
57
|
+
return t.start(), t.stop.bind(t);
|
|
58
|
+
}
|
|
59
|
+
#f() {
|
|
60
|
+
if (!this.#t) return;
|
|
61
|
+
const t = this.#t.duration() - this.#t.time();
|
|
62
|
+
this.#i.$state.liveSyncPosition.set(isNaN(t) ? 1 / 0 : t);
|
|
63
|
+
}
|
|
64
|
+
#g(t) {
|
|
65
|
+
this.#i.player?.dispatch(this.#s(t));
|
|
66
|
+
}
|
|
67
|
+
#n = null;
|
|
68
|
+
#h = {};
|
|
69
|
+
#y(t) {
|
|
70
|
+
const i = this.#n?.[g.native], s = (i?.track).cues;
|
|
71
|
+
if (!i || !s) return;
|
|
72
|
+
const r = this.#n.id, a = this.#h[r] ?? 0, o = this.#s(t);
|
|
73
|
+
for (let c = a; c < s.length; c++) {
|
|
74
|
+
const h = s[c];
|
|
75
|
+
h.positionAlign || (h.positionAlign = "auto"), this.#n.addCue(h, o);
|
|
76
|
+
}
|
|
77
|
+
this.#h[r] = s.length;
|
|
78
|
+
}
|
|
79
|
+
#m(t) {
|
|
80
|
+
if (!this.#t) return;
|
|
81
|
+
const i = t.tracks, s = [...this.#e.textTracks].filter((a) => "manualMode" in a), r = this.#s(t);
|
|
82
|
+
for (let a = 0; a < s.length; a++) {
|
|
83
|
+
const o = i[a], c = s[a], h = `dash-${o.kind}-${a}`, d = new F({
|
|
84
|
+
id: h,
|
|
85
|
+
label: o?.label ?? o.labels.find((y) => y.text)?.text ?? (o?.lang && b(o.lang)) ?? o?.lang ?? void 0,
|
|
86
|
+
language: o.lang ?? void 0,
|
|
87
|
+
kind: o.kind,
|
|
88
|
+
default: o.defaultTrack
|
|
89
|
+
});
|
|
90
|
+
d[g.native] = {
|
|
91
|
+
managed: !0,
|
|
92
|
+
track: c
|
|
93
|
+
}, d[g.readyState] = 2, d[g.onModeChange] = () => {
|
|
94
|
+
this.#t && (d.mode === "showing" ? (this.#t.setTextTrack(a), this.#n = d) : (this.#t.setTextTrack(-1), this.#n = null));
|
|
95
|
+
}, this.#i.textTracks.add(d, r);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
#T(t) {
|
|
99
|
+
const { mediaType: i, newMediaInfo: s } = t;
|
|
100
|
+
if (i === "audio") {
|
|
101
|
+
const r = this.#i.audioTracks.getById(`dash-audio-${s.index}`);
|
|
102
|
+
if (r) {
|
|
103
|
+
const a = this.#s(t);
|
|
104
|
+
this.#i.audioTracks[u.select](r, !0, a);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
#S(t) {
|
|
109
|
+
if (t.mediaType !== "video") return;
|
|
110
|
+
const i = this.#i.qualities[t.newQuality];
|
|
111
|
+
if (i) {
|
|
112
|
+
const s = this.#s(t);
|
|
113
|
+
this.#i.qualities[u.select](i, !0, s);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
#v(t) {
|
|
117
|
+
if (this.#i.$state.canPlay() || !this.#t) return;
|
|
118
|
+
const { type: i, mediaPresentationDuration: s } = t.data, r = this.#s(t);
|
|
119
|
+
this.#i.notify("stream-type-change", i !== "static" ? "live" : "on-demand", r), this.#i.notify("duration-change", s, r), this.#i.qualities[S.setAuto](!0, r);
|
|
120
|
+
const a = this.#t.getVideoElement(), o = this.#t.getTracksForTypeFromManifest(
|
|
121
|
+
"video",
|
|
122
|
+
t.data
|
|
123
|
+
), c = [...new Set(o.map((e) => e.mimeType))].find(
|
|
124
|
+
(e) => e && R(a, e)
|
|
125
|
+
), h = o.filter(
|
|
126
|
+
(e) => c === e.mimeType
|
|
127
|
+
)[0];
|
|
128
|
+
let d = this.#t.getTracksForTypeFromManifest(
|
|
129
|
+
"audio",
|
|
130
|
+
t.data
|
|
131
|
+
);
|
|
132
|
+
const y = [...new Set(d.map((e) => e.mimeType))].find(
|
|
133
|
+
(e) => e && I(a, e)
|
|
134
|
+
);
|
|
135
|
+
if (d = d.filter((e) => y === e.mimeType), h.bitrateList.forEach((e, f) => {
|
|
136
|
+
const m = {
|
|
137
|
+
id: e.id?.toString() ?? `dash-bitrate-${f}`,
|
|
138
|
+
width: e.width ?? 0,
|
|
139
|
+
height: e.height ?? 0,
|
|
140
|
+
bitrate: e.bandwidth ?? 0,
|
|
141
|
+
codec: h.codec,
|
|
142
|
+
index: f
|
|
143
|
+
};
|
|
144
|
+
this.#i.qualities[u.add](m, r);
|
|
145
|
+
}), P(h.index)) {
|
|
146
|
+
const e = this.#i.qualities[h.index];
|
|
147
|
+
e && this.#i.qualities[u.select](e, !0, r);
|
|
148
|
+
}
|
|
149
|
+
d.forEach((e, f) => {
|
|
150
|
+
const L = e.labels.find((T) => navigator.languages.some((D) => T.lang && D.toLowerCase().startsWith(T.lang.toLowerCase()))) || e.labels[0], A = {
|
|
151
|
+
id: `dash-audio-${e?.index}`,
|
|
152
|
+
label: L?.text ?? (e.lang && b(e.lang)) ?? e.lang ?? "",
|
|
153
|
+
language: e.lang ?? "",
|
|
154
|
+
kind: "main",
|
|
155
|
+
mimeType: e.mimeType,
|
|
156
|
+
codec: e.codec,
|
|
157
|
+
index: f
|
|
158
|
+
};
|
|
159
|
+
this.#i.audioTracks[u.add](A, r);
|
|
160
|
+
}), a.dispatchEvent(new l("canplay", { trigger: r }));
|
|
161
|
+
}
|
|
162
|
+
#b(t) {
|
|
163
|
+
const { type: i, error: s } = t;
|
|
164
|
+
s.code === 27 ? this.#L(s) : this.#l(s);
|
|
165
|
+
}
|
|
166
|
+
#w() {
|
|
167
|
+
this.#o >= 0 && this.#c();
|
|
168
|
+
}
|
|
169
|
+
#E(t) {
|
|
170
|
+
t.mediaType === "text" && requestAnimationFrame(this.#y.bind(this, t));
|
|
171
|
+
}
|
|
172
|
+
#o = -1;
|
|
173
|
+
#L(t) {
|
|
174
|
+
this.#c(), this.#t?.play(), this.#o = window.setTimeout(() => {
|
|
175
|
+
this.#o = -1, this.#l(t);
|
|
176
|
+
}, 5e3);
|
|
177
|
+
}
|
|
178
|
+
#c() {
|
|
179
|
+
clearTimeout(this.#o), this.#o = -1;
|
|
180
|
+
}
|
|
181
|
+
#l(t) {
|
|
182
|
+
this.#i.notify("error", {
|
|
183
|
+
message: t.message ?? "",
|
|
184
|
+
code: 1,
|
|
185
|
+
error: t
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
#A() {
|
|
189
|
+
this.#u("video", !0);
|
|
190
|
+
const { qualities: t } = this.#i;
|
|
191
|
+
this.#t?.setQualityFor("video", t.selectedIndex, !0);
|
|
192
|
+
}
|
|
193
|
+
#u(t, i) {
|
|
194
|
+
this.#t?.updateSettings({
|
|
195
|
+
streaming: { abr: { autoSwitchBitrate: { [t]: i } } }
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
#D() {
|
|
199
|
+
const { qualities: t } = this.#i;
|
|
200
|
+
!this.#t || t.auto || !t.selected || (this.#u("video", !1), this.#t.setQualityFor("video", t.selectedIndex, t.switch === "current"), q && (this.#e.currentTime = this.#e.currentTime));
|
|
201
|
+
}
|
|
202
|
+
#x() {
|
|
203
|
+
if (!this.#t) return;
|
|
204
|
+
const { audioTracks: t } = this.#i, i = this.#t.getTracksFor("audio").find(
|
|
205
|
+
(s) => t.selected && t.selected.id === `dash-audio-${s.index}`
|
|
206
|
+
);
|
|
207
|
+
i && this.#t.setCurrentTrack(i);
|
|
208
|
+
}
|
|
209
|
+
#p() {
|
|
210
|
+
this.#c(), this.#n = null, this.#h = {};
|
|
211
|
+
}
|
|
212
|
+
onInstance(t) {
|
|
213
|
+
return this.#a.add(t), () => this.#a.delete(t);
|
|
214
|
+
}
|
|
215
|
+
loadSource(t) {
|
|
216
|
+
this.#p(), p(t.src) && this.#t?.attachSource(t.src);
|
|
217
|
+
}
|
|
218
|
+
destroy() {
|
|
219
|
+
this.#p(), this.#t?.destroy(), this.#t = null, this.#r?.(), this.#r = null;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
class V {
|
|
223
|
+
#e;
|
|
224
|
+
#i;
|
|
225
|
+
#t;
|
|
226
|
+
constructor(t, i, s) {
|
|
227
|
+
this.#e = t, this.#i = i, this.#t = s, this.#a();
|
|
228
|
+
}
|
|
229
|
+
async #a() {
|
|
230
|
+
const t = {
|
|
231
|
+
onLoadStart: this.#r.bind(this),
|
|
232
|
+
onLoaded: this.#s.bind(this),
|
|
233
|
+
onLoadError: this.#d.bind(this)
|
|
234
|
+
};
|
|
235
|
+
let i = await U(this.#e, t);
|
|
236
|
+
if (E(i) && !p(this.#e) && (i = await B(this.#e, t)), !i) return null;
|
|
237
|
+
if (!window.dashjs.supportsMediaSource()) {
|
|
238
|
+
const s = "[vidstack] `dash.js` is not supported in this environment";
|
|
239
|
+
return this.#i.player.dispatch(new l("dash-unsupported")), this.#i.notify("error", { message: s, code: 4 }), null;
|
|
240
|
+
}
|
|
241
|
+
return i;
|
|
242
|
+
}
|
|
243
|
+
#r() {
|
|
244
|
+
this.#i.player.dispatch(new l("dash-lib-load-start"));
|
|
245
|
+
}
|
|
246
|
+
#s(t) {
|
|
247
|
+
this.#i.player.dispatch(
|
|
248
|
+
new l("dash-lib-loaded", {
|
|
249
|
+
detail: t
|
|
250
|
+
})
|
|
251
|
+
), this.#t(t);
|
|
252
|
+
}
|
|
253
|
+
#d(t) {
|
|
254
|
+
const i = _(t);
|
|
255
|
+
this.#i.player.dispatch(
|
|
256
|
+
new l("dash-lib-load-error", {
|
|
257
|
+
detail: i
|
|
258
|
+
})
|
|
259
|
+
), this.#i.notify("error", {
|
|
260
|
+
message: i.message,
|
|
261
|
+
code: 4,
|
|
262
|
+
error: i
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
async function B(n, t = {}) {
|
|
267
|
+
if (!E(n)) {
|
|
268
|
+
if (t.onLoadStart?.(), K(n))
|
|
269
|
+
return t.onLoaded?.(n), n;
|
|
270
|
+
if (w(n)) {
|
|
271
|
+
const i = n.MediaPlayer;
|
|
272
|
+
return t.onLoaded?.(i), i;
|
|
273
|
+
}
|
|
274
|
+
try {
|
|
275
|
+
const i = (await n())?.default;
|
|
276
|
+
if (w(i))
|
|
277
|
+
return t.onLoaded?.(i.MediaPlayer), i.MediaPlayer;
|
|
278
|
+
if (i)
|
|
279
|
+
t.onLoaded?.(i);
|
|
280
|
+
else
|
|
281
|
+
throw Error(
|
|
282
|
+
""
|
|
283
|
+
);
|
|
284
|
+
return i;
|
|
285
|
+
} catch (i) {
|
|
286
|
+
t.onLoadError?.(i);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
async function U(n, t = {}) {
|
|
291
|
+
if (p(n)) {
|
|
292
|
+
t.onLoadStart?.();
|
|
293
|
+
try {
|
|
294
|
+
if (await $(n), !H(window.dashjs.MediaPlayer))
|
|
295
|
+
throw Error(
|
|
296
|
+
""
|
|
297
|
+
);
|
|
298
|
+
const i = window.dashjs.MediaPlayer;
|
|
299
|
+
return t.onLoaded?.(i), i;
|
|
300
|
+
} catch (i) {
|
|
301
|
+
t.onLoadError?.(i);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
function K(n) {
|
|
306
|
+
return n && n.prototype && n.prototype !== Function;
|
|
307
|
+
}
|
|
308
|
+
function w(n) {
|
|
309
|
+
return n && "MediaPlayer" in n;
|
|
310
|
+
}
|
|
311
|
+
const z = "https://cdn.jsdelivr.net";
|
|
312
|
+
class X extends j {
|
|
313
|
+
$$PROVIDER_TYPE = "DASH";
|
|
314
|
+
#e = null;
|
|
315
|
+
#i = new G(this.video, this.ctx);
|
|
316
|
+
/**
|
|
317
|
+
* The `dash.js` constructor.
|
|
318
|
+
*/
|
|
319
|
+
get ctor() {
|
|
320
|
+
return this.#e;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* The current `dash.js` instance.
|
|
324
|
+
*/
|
|
325
|
+
get instance() {
|
|
326
|
+
return this.#i.instance;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Whether `dash.js` is supported in this environment.
|
|
330
|
+
*/
|
|
331
|
+
static supported = x();
|
|
332
|
+
get type() {
|
|
333
|
+
return "dash";
|
|
334
|
+
}
|
|
335
|
+
get canLiveSync() {
|
|
336
|
+
return !0;
|
|
337
|
+
}
|
|
338
|
+
#t = `${z}/npm/dashjs@4.7.4/dist/dash.all.min.js`;
|
|
339
|
+
/**
|
|
340
|
+
* The `dash.js` configuration object.
|
|
341
|
+
*
|
|
342
|
+
* @see {@link https://cdn.dashjs.org/latest/jsdoc/module-Settings.html}
|
|
343
|
+
*/
|
|
344
|
+
get config() {
|
|
345
|
+
return this.#i.config;
|
|
346
|
+
}
|
|
347
|
+
set config(t) {
|
|
348
|
+
this.#i.config = t;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* The `dash.js` constructor (supports dynamic imports) or a URL of where it can be found.
|
|
352
|
+
*
|
|
353
|
+
* @defaultValue `https://cdn.jsdelivr.net/npm/dashjs@4.7.4/dist/dash.all.min.js`
|
|
354
|
+
*/
|
|
355
|
+
get library() {
|
|
356
|
+
return this.#t;
|
|
357
|
+
}
|
|
358
|
+
set library(t) {
|
|
359
|
+
this.#t = t;
|
|
360
|
+
}
|
|
361
|
+
preconnect() {
|
|
362
|
+
p(this.#t) && k(this.#t);
|
|
363
|
+
}
|
|
364
|
+
setup() {
|
|
365
|
+
super.setup(), new V(this.#t, this.ctx, (t) => {
|
|
366
|
+
this.#e = t, this.#i.setup(t), this.ctx.notify("provider-setup", this);
|
|
367
|
+
const i = M(this.ctx.$state.source);
|
|
368
|
+
i && this.loadSource(i);
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
async loadSource(t, i) {
|
|
372
|
+
if (!p(t.src)) {
|
|
373
|
+
this.removeSource();
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
this.media.preload = i || "", this.appendSource(t, "application/x-mpegurl"), this.#i.loadSource(t), this.currentSrc = t;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* The given callback is invoked when a new `dash.js` instance is created and right before it's
|
|
380
|
+
* attached to media.
|
|
381
|
+
*/
|
|
382
|
+
onInstance(t) {
|
|
383
|
+
const i = this.#i.instance;
|
|
384
|
+
return i && t(i), this.#i.onInstance(t);
|
|
385
|
+
}
|
|
386
|
+
destroy() {
|
|
387
|
+
this.#i.destroy();
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
export {
|
|
391
|
+
X as DASHProvider
|
|
392
|
+
};
|