@webitel/ui-sdk 25.10.51 → 25.10.52
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 +70 -0
- package/dist/img/sprite/index.js +4 -0
- package/dist/img/sprite/player-enter-fullscreen.svg +3 -0
- package/dist/img/sprite/player-exit-fullscreen.svg +4 -0
- package/dist/install-hlMLq0U3.js +111257 -0
- package/dist/prod-DTLJXtPo.js +994 -0
- package/dist/srt-parser-CWqahKwO.js +27 -0
- package/dist/ssa-parser-BqjjKy4M.js +209 -0
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +2 -100294
- package/dist/ui-sdk.umd.cjs +1633 -1605
- package/dist/vidstack-54Jpr2Lq-B-3uagaf.js +142 -0
- package/dist/vidstack-BP-l85ST-cd089zs4.js +21 -0
- package/dist/vidstack-BTBUzdbF-BuhaE3ef.js +29 -0
- package/dist/vidstack-Ccp8mxka-Cyoe3N05.js +20 -0
- package/dist/vidstack-Dgd3Tj9x-D_ifpfX9.js +397 -0
- package/dist/vidstack-DscYSLiW-Dk1undJ-.js +33 -0
- package/dist/vidstack-HTyVv8Yq-DRdwbVZd.js +52 -0
- package/dist/vidstack-audio-CFFRqrJ3.js +26 -0
- package/dist/vidstack-dash-BDtu3f4j.js +405 -0
- package/dist/vidstack-google-cast-hKSzmdiF.js +405 -0
- package/dist/vidstack-hls-BLyFYePL.js +328 -0
- package/dist/vidstack-video-BlmYiw-x.js +149 -0
- package/dist/vidstack-vimeo-DhWdWK51.js +434 -0
- package/dist/vidstack-youtube-l9Si5Vl-.js +204 -0
- package/package.json +2 -1
- package/src/assets/icons/sprite/index.js +4 -0
- package/src/assets/icons/sprite/player-enter-fullscreen.svg +3 -0
- package/src/assets/icons/sprite/player-exit-fullscreen.svg +4 -0
- package/src/components/index.js +3 -0
- package/src/components/wt-loader/wt-loader.vue +1 -0
- package/src/components/wt-popup/_mixins.scss +31 -0
- package/src/components/wt-popup/wt-popup.vue +7 -21
- package/src/components/wt-table/wt-table.vue +5 -0
- package/src/components/wt-vidstack-player/components/layouts/video-layout.vue +112 -0
- package/src/components/wt-vidstack-player/components/panels/media-control-panel/components/buttons/fullscreen-button.vue +37 -0
- package/src/components/wt-vidstack-player/components/panels/media-control-panel/components/buttons/play-button.vue +21 -0
- package/src/components/wt-vidstack-player/components/panels/media-control-panel/components/sliders/time-slider.vue +31 -0
- package/src/components/wt-vidstack-player/components/panels/media-control-panel/components/time-group.vue +19 -0
- package/src/components/wt-vidstack-player/components/panels/media-control-panel/media-control-panel.vue +34 -0
- package/src/components/wt-vidstack-player/components/panels/video-display-panel/video-display-panel.vue +95 -0
- package/src/components/wt-vidstack-player/components/toggle-button.vue +54 -0
- package/src/components/wt-vidstack-player/wt-vidstack-player.vue +156 -0
- package/src/install.ts +1 -0
- package/types/components/index.d.ts +3 -1
- package/types/components/wt-vidstack-player/components/layouts/video-layout.vue.d.ts +11 -0
- package/types/components/wt-vidstack-player/components/panels/media-control-panel/components/buttons/fullscreen-button.vue.d.ts +6 -0
- package/types/components/wt-vidstack-player/components/panels/media-control-panel/components/buttons/play-button.vue.d.ts +2 -0
- package/types/components/wt-vidstack-player/components/panels/media-control-panel/components/sliders/time-slider.vue.d.ts +2 -0
- package/types/components/wt-vidstack-player/components/panels/media-control-panel/components/time-group.vue.d.ts +2 -0
- package/types/components/wt-vidstack-player/components/panels/media-control-panel/media-control-panel.vue.d.ts +2 -0
- package/types/components/wt-vidstack-player/components/panels/video-display-panel/video-display-panel.vue.d.ts +11 -0
- package/types/components/wt-vidstack-player/components/toggle-button.vue.d.ts +12 -0
- package/types/components/wt-vidstack-player/wt-vidstack-player.vue.d.ts +25 -0
- package/types/install.d.ts +1 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { r as E, b as c, p as S, d as f, Q as v, l as m, e as w, D as u, f as q, g as _, T, L as l, I, m as L, n as D, o as R, q as $ } from "./install-hlMLq0U3.js";
|
|
2
|
+
import { VideoProvider as O } from "./vidstack-video-BlmYiw-x.js";
|
|
3
|
+
import { R as x } from "./vidstack-Ccp8mxka-Cyoe3N05.js";
|
|
4
|
+
const C = (h) => q(h);
|
|
5
|
+
class A {
|
|
6
|
+
constructor(t, i) {
|
|
7
|
+
this.m = t, this.b = i, this.d = null, this.qb = null, this.rb = {}, this.sb = /* @__PURE__ */ new Set(), this.na = -1;
|
|
8
|
+
}
|
|
9
|
+
get instance() {
|
|
10
|
+
return this.d;
|
|
11
|
+
}
|
|
12
|
+
setup(t) {
|
|
13
|
+
const { streamType: i } = this.b.$state, e = f(i).includes("live"), r = f(i).includes("ll-");
|
|
14
|
+
this.d = new t({
|
|
15
|
+
lowLatencyMode: r,
|
|
16
|
+
backBufferLength: r ? 4 : e ? 8 : void 0,
|
|
17
|
+
renderTextTracksNatively: !1,
|
|
18
|
+
...this.rb
|
|
19
|
+
});
|
|
20
|
+
const n = this.Oi.bind(this);
|
|
21
|
+
for (const o of Object.values(t.Events))
|
|
22
|
+
this.d.on(o, n);
|
|
23
|
+
this.d.on(t.Events.ERROR, this.Q.bind(this));
|
|
24
|
+
for (const o of this.sb)
|
|
25
|
+
o(this.d);
|
|
26
|
+
this.b.player.dispatch("hls-instance", {
|
|
27
|
+
detail: this.d
|
|
28
|
+
}), this.d.attachMedia(this.m), this.d.on(t.Events.FRAG_LOADING, this.Pi.bind(this)), this.d.on(t.Events.AUDIO_TRACK_SWITCHED, this.Qi.bind(this)), this.d.on(t.Events.LEVEL_SWITCHED, this.Ri.bind(this)), this.d.on(t.Events.LEVEL_LOADED, this.Si.bind(this)), this.d.on(t.Events.NON_NATIVE_TEXT_TRACKS_FOUND, this.Ti.bind(this)), this.d.on(t.Events.CUES_PARSED, this.Ui.bind(this)), this.b.qualities[v.Ia] = this.je.bind(this), m(this.b.qualities, "change", this.ke.bind(this)), m(this.b.audioTracks, "change", this.le.bind(this)), this.qb = w(this.me.bind(this));
|
|
29
|
+
}
|
|
30
|
+
aa(t, i) {
|
|
31
|
+
return new u(C(t), { detail: i });
|
|
32
|
+
}
|
|
33
|
+
me() {
|
|
34
|
+
if (!this.b.$state.live())
|
|
35
|
+
return;
|
|
36
|
+
const t = new x(this.ne.bind(this));
|
|
37
|
+
return t.Xa(), t.$.bind(t);
|
|
38
|
+
}
|
|
39
|
+
ne() {
|
|
40
|
+
var t;
|
|
41
|
+
this.b.$state.liveSyncPosition.set(((t = this.d) == null ? void 0 : t.liveSyncPosition) ?? 1 / 0);
|
|
42
|
+
}
|
|
43
|
+
Oi(t, i) {
|
|
44
|
+
var e;
|
|
45
|
+
(e = this.b.player) == null || e.dispatch(this.aa(t, i));
|
|
46
|
+
}
|
|
47
|
+
Ti(t, i) {
|
|
48
|
+
const e = this.aa(t, i);
|
|
49
|
+
let r = -1;
|
|
50
|
+
for (let n = 0; n < i.tracks.length; n++) {
|
|
51
|
+
const o = i.tracks[n], s = o.subtitleTrack ?? o.closedCaptions, d = new _({
|
|
52
|
+
id: `hls-${o.kind}-${n}`,
|
|
53
|
+
src: s == null ? void 0 : s.url,
|
|
54
|
+
label: o.label,
|
|
55
|
+
language: s == null ? void 0 : s.lang,
|
|
56
|
+
kind: o.kind,
|
|
57
|
+
default: o.default
|
|
58
|
+
});
|
|
59
|
+
d[T.ma] = 2, d[T.hb] = () => {
|
|
60
|
+
d.mode === "showing" ? (this.d.subtitleTrack = n, r = n) : r === n && (this.d.subtitleTrack = -1, r = -1);
|
|
61
|
+
}, this.b.textTracks.add(d, e);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
Ui(t, i) {
|
|
65
|
+
var o;
|
|
66
|
+
const e = (o = this.d) == null ? void 0 : o.subtitleTrack, r = this.b.textTracks.getById(`hls-${i.type}-${e}`);
|
|
67
|
+
if (!r)
|
|
68
|
+
return;
|
|
69
|
+
const n = this.aa(t, i);
|
|
70
|
+
for (const s of i.cues)
|
|
71
|
+
s.positionAlign = "auto", r.addCue(s, n);
|
|
72
|
+
}
|
|
73
|
+
Qi(t, i) {
|
|
74
|
+
const e = this.b.audioTracks[i.id];
|
|
75
|
+
if (e) {
|
|
76
|
+
const r = this.aa(t, i);
|
|
77
|
+
this.b.audioTracks[l.ea](e, !0, r);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
Ri(t, i) {
|
|
81
|
+
const e = this.b.qualities[i.level];
|
|
82
|
+
if (e) {
|
|
83
|
+
const r = this.aa(t, i);
|
|
84
|
+
this.b.qualities[l.ea](e, !0, r);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
Si(t, i) {
|
|
88
|
+
var g;
|
|
89
|
+
if (this.b.$state.canPlay())
|
|
90
|
+
return;
|
|
91
|
+
const { type: e, live: r, totalduration: n, targetduration: o } = i.details, s = this.aa(t, i);
|
|
92
|
+
this.b.delegate.c(
|
|
93
|
+
"stream-type-change",
|
|
94
|
+
r ? e === "EVENT" && Number.isFinite(n) && o >= 10 ? "live:dvr" : "live" : "on-demand",
|
|
95
|
+
s
|
|
96
|
+
), this.b.delegate.c("duration-change", n, s);
|
|
97
|
+
const d = this.d.media;
|
|
98
|
+
this.d.currentLevel === -1 && this.b.qualities[v.Wa](!0, s);
|
|
99
|
+
for (const a of this.d.audioTracks) {
|
|
100
|
+
const p = {
|
|
101
|
+
id: a.id.toString(),
|
|
102
|
+
label: a.name,
|
|
103
|
+
language: a.lang || "",
|
|
104
|
+
kind: "main"
|
|
105
|
+
};
|
|
106
|
+
this.b.audioTracks[l.da](p, s);
|
|
107
|
+
}
|
|
108
|
+
for (const a of this.d.levels) {
|
|
109
|
+
const p = {
|
|
110
|
+
id: ((g = a.id) == null ? void 0 : g.toString()) ?? a.height + "p",
|
|
111
|
+
width: a.width,
|
|
112
|
+
height: a.height,
|
|
113
|
+
codec: a.codecSet,
|
|
114
|
+
bitrate: a.bitrate
|
|
115
|
+
};
|
|
116
|
+
this.b.qualities[l.da](p, s);
|
|
117
|
+
}
|
|
118
|
+
d.dispatchEvent(new u("canplay", { trigger: s }));
|
|
119
|
+
}
|
|
120
|
+
Q(t, i) {
|
|
121
|
+
var e;
|
|
122
|
+
if (i.fatal)
|
|
123
|
+
switch (i.type) {
|
|
124
|
+
case "networkError":
|
|
125
|
+
this.pe(i.error);
|
|
126
|
+
break;
|
|
127
|
+
case "mediaError":
|
|
128
|
+
(e = this.d) == null || e.recoverMediaError();
|
|
129
|
+
break;
|
|
130
|
+
default:
|
|
131
|
+
this.qc(i.error);
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
Pi() {
|
|
136
|
+
this.na >= 0 && this._a();
|
|
137
|
+
}
|
|
138
|
+
pe(t) {
|
|
139
|
+
var i;
|
|
140
|
+
this._a(), (i = this.d) == null || i.startLoad(), this.na = window.setTimeout(() => {
|
|
141
|
+
this.na = -1, this.qc(t);
|
|
142
|
+
}, 5e3);
|
|
143
|
+
}
|
|
144
|
+
_a() {
|
|
145
|
+
clearTimeout(this.na), this.na = -1;
|
|
146
|
+
}
|
|
147
|
+
qc(t) {
|
|
148
|
+
this.b.delegate.c("error", {
|
|
149
|
+
message: t.message,
|
|
150
|
+
code: 1,
|
|
151
|
+
error: t
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
je() {
|
|
155
|
+
this.d && (this.d.currentLevel = -1);
|
|
156
|
+
}
|
|
157
|
+
ke() {
|
|
158
|
+
const { qualities: t } = this.b;
|
|
159
|
+
!this.d || t.auto || (this.d[t.switch + "Level"] = t.selectedIndex, I && (this.m.currentTime = this.m.currentTime));
|
|
160
|
+
}
|
|
161
|
+
le() {
|
|
162
|
+
const { audioTracks: t } = this.b;
|
|
163
|
+
this.d && this.d.audioTrack !== t.selectedIndex && (this.d.audioTrack = t.selectedIndex);
|
|
164
|
+
}
|
|
165
|
+
Vi(t) {
|
|
166
|
+
var i;
|
|
167
|
+
this._a(), c(t.src) && ((i = this.d) == null || i.loadSource(t.src));
|
|
168
|
+
}
|
|
169
|
+
Wi() {
|
|
170
|
+
var t, i;
|
|
171
|
+
this._a(), (t = this.d) == null || t.destroy(), this.d = null, (i = this.qb) == null || i.call(this), this.qb = null;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
class H {
|
|
175
|
+
constructor(t, i, e) {
|
|
176
|
+
this.L = t, this.b = i, this.La = e, this.qe();
|
|
177
|
+
}
|
|
178
|
+
async qe() {
|
|
179
|
+
const t = {
|
|
180
|
+
onLoadStart: this.Ma.bind(this),
|
|
181
|
+
onLoaded: this.tb.bind(this),
|
|
182
|
+
onLoadError: this.re.bind(this)
|
|
183
|
+
};
|
|
184
|
+
let i = await j(this.L, t);
|
|
185
|
+
if (L(i) && !c(this.L) && (i = await N(this.L, t)), !i)
|
|
186
|
+
return null;
|
|
187
|
+
if (!i.isSupported()) {
|
|
188
|
+
const e = "[vidstack] `hls.js` is not supported in this environment";
|
|
189
|
+
return this.b.player.dispatch(new u("hls-unsupported")), this.b.delegate.c("error", { message: e, code: 4 }), null;
|
|
190
|
+
}
|
|
191
|
+
return i;
|
|
192
|
+
}
|
|
193
|
+
Ma() {
|
|
194
|
+
this.b.player.dispatch(new u("hls-lib-load-start"));
|
|
195
|
+
}
|
|
196
|
+
tb(t) {
|
|
197
|
+
this.b.player.dispatch(
|
|
198
|
+
new u("hls-lib-loaded", {
|
|
199
|
+
detail: t
|
|
200
|
+
})
|
|
201
|
+
), this.La(t);
|
|
202
|
+
}
|
|
203
|
+
re(t) {
|
|
204
|
+
const i = D(t);
|
|
205
|
+
this.b.player.dispatch(
|
|
206
|
+
new u("hls-lib-load-error", {
|
|
207
|
+
detail: i
|
|
208
|
+
})
|
|
209
|
+
), this.b.delegate.c("error", {
|
|
210
|
+
message: i.message,
|
|
211
|
+
code: 4,
|
|
212
|
+
error: i
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
async function N(h, t = {}) {
|
|
217
|
+
var i, e, r, n, o;
|
|
218
|
+
if (!L(h)) {
|
|
219
|
+
if ((i = t.onLoadStart) == null || i.call(t), h.prototype && h.prototype !== Function)
|
|
220
|
+
return (e = t.onLoaded) == null || e.call(t, h), h;
|
|
221
|
+
try {
|
|
222
|
+
const s = (r = await h()) == null ? void 0 : r.default;
|
|
223
|
+
if (s && s.isSupported)
|
|
224
|
+
(n = t.onLoaded) == null || n.call(t, s);
|
|
225
|
+
else
|
|
226
|
+
throw Error(
|
|
227
|
+
""
|
|
228
|
+
);
|
|
229
|
+
return s;
|
|
230
|
+
} catch (s) {
|
|
231
|
+
(o = t.onLoadError) == null || o.call(t, s);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
async function j(h, t = {}) {
|
|
236
|
+
var i, e, r;
|
|
237
|
+
if (c(h)) {
|
|
238
|
+
(i = t.onLoadStart) == null || i.call(t);
|
|
239
|
+
try {
|
|
240
|
+
if (await R(h), !$(window.Hls))
|
|
241
|
+
throw Error(
|
|
242
|
+
""
|
|
243
|
+
);
|
|
244
|
+
const n = window.Hls;
|
|
245
|
+
return (e = t.onLoaded) == null || e.call(t, n), n;
|
|
246
|
+
} catch (n) {
|
|
247
|
+
(r = t.onLoadError) == null || r.call(t, n);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
const V = "https://cdn.jsdelivr.net", b = class b extends O {
|
|
252
|
+
constructor() {
|
|
253
|
+
super(...arguments), this.$$PROVIDER_TYPE = "HLS", this.rc = null, this.e = new A(this.video, this.b), this.oa = `${V}/npm/hls.js@^1.5.0/dist/hls.min.js`;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* The `hls.js` constructor.
|
|
257
|
+
*/
|
|
258
|
+
get ctor() {
|
|
259
|
+
return this.rc;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* The current `hls.js` instance.
|
|
263
|
+
*/
|
|
264
|
+
get instance() {
|
|
265
|
+
return this.e.instance;
|
|
266
|
+
}
|
|
267
|
+
get type() {
|
|
268
|
+
return "hls";
|
|
269
|
+
}
|
|
270
|
+
get canLiveSync() {
|
|
271
|
+
return !0;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* The `hls.js` configuration object.
|
|
275
|
+
*
|
|
276
|
+
* @see {@link https://github.com/video-dev/hls.js/blob/master/docs/API.md#fine-tuning}
|
|
277
|
+
*/
|
|
278
|
+
get config() {
|
|
279
|
+
return this.e.rb;
|
|
280
|
+
}
|
|
281
|
+
set config(t) {
|
|
282
|
+
this.e.rb = t;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* The `hls.js` constructor (supports dynamic imports) or a URL of where it can be found.
|
|
286
|
+
*
|
|
287
|
+
* @defaultValue `https://cdn.jsdelivr.net/npm/hls.js@^1.0.0/dist/hls.min.js`
|
|
288
|
+
*/
|
|
289
|
+
get library() {
|
|
290
|
+
return this.oa;
|
|
291
|
+
}
|
|
292
|
+
set library(t) {
|
|
293
|
+
this.oa = t;
|
|
294
|
+
}
|
|
295
|
+
preconnect() {
|
|
296
|
+
c(this.oa) && S(this.oa);
|
|
297
|
+
}
|
|
298
|
+
setup() {
|
|
299
|
+
super.setup(), new H(this.oa, this.b, (t) => {
|
|
300
|
+
this.rc = t, this.e.setup(t), this.b.delegate.c("provider-setup", this);
|
|
301
|
+
const i = f(this.b.$state.source);
|
|
302
|
+
i && this.loadSource(i);
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
async loadSource(t, i) {
|
|
306
|
+
if (!c(t.src)) {
|
|
307
|
+
this.oc();
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
this.a.preload = i || "", this.ge(t, "application/x-mpegurl"), this.e.Vi(t), this.K = t;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* The given callback is invoked when a new `hls.js` instance is created and right before it's
|
|
314
|
+
* attached to media.
|
|
315
|
+
*/
|
|
316
|
+
onInstance(t) {
|
|
317
|
+
const i = this.e.instance;
|
|
318
|
+
return i && t(i), this.e.sb.add(t), () => this.e.sb.delete(t);
|
|
319
|
+
}
|
|
320
|
+
destroy() {
|
|
321
|
+
this.e.Wi();
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
b.supported = E();
|
|
325
|
+
let y = b;
|
|
326
|
+
export {
|
|
327
|
+
y as HLSProvider
|
|
328
|
+
};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { s as p, t as u, u as o, v as f, w as d, l as c, D as g, g as m, T as n } from "./install-hlMLq0U3.js";
|
|
2
|
+
import { H as P, a as b } from "./vidstack-Dgd3Tj9x-D_ifpfX9.js";
|
|
3
|
+
class k {
|
|
4
|
+
constructor(t, e) {
|
|
5
|
+
this.m = t, this.b = e, t.textTracks.onaddtrack = this.Yd.bind(this), d(this.ce.bind(this));
|
|
6
|
+
}
|
|
7
|
+
Yd(t) {
|
|
8
|
+
const e = t.track;
|
|
9
|
+
if (!e || T(this.m, e))
|
|
10
|
+
return;
|
|
11
|
+
const i = new m({
|
|
12
|
+
id: e.id,
|
|
13
|
+
kind: e.kind,
|
|
14
|
+
label: e.label ?? "",
|
|
15
|
+
language: e.language,
|
|
16
|
+
type: "vtt"
|
|
17
|
+
});
|
|
18
|
+
i[n._] = { track: e }, i[n.ma] = 2, i[n.Mf] = !0;
|
|
19
|
+
let s = 0;
|
|
20
|
+
const h = (l) => {
|
|
21
|
+
if (e.cues)
|
|
22
|
+
for (let a = s; a < e.cues.length; a++)
|
|
23
|
+
i.addCue(e.cues[a], l), s++;
|
|
24
|
+
};
|
|
25
|
+
h(t), e.oncuechange = h, this.b.textTracks.add(i, t), i.setMode(e.mode, t);
|
|
26
|
+
}
|
|
27
|
+
ce() {
|
|
28
|
+
var t;
|
|
29
|
+
this.m.textTracks.onaddtrack = null;
|
|
30
|
+
for (const e of this.b.textTracks) {
|
|
31
|
+
const i = (t = e[n._]) == null ? void 0 : t.track;
|
|
32
|
+
i != null && i.oncuechange && (i.oncuechange = null);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function T(r, t) {
|
|
37
|
+
return Array.from(r.children).find((e) => e.track === t);
|
|
38
|
+
}
|
|
39
|
+
class x {
|
|
40
|
+
constructor(t, e) {
|
|
41
|
+
this.m = t, this.a = e, this.E = (i, s) => {
|
|
42
|
+
this.a.delegate.c("picture-in-picture-change", i, s);
|
|
43
|
+
}, c(this.m, "enterpictureinpicture", this.Gi.bind(this)), c(this.m, "leavepictureinpicture", this.Hi.bind(this));
|
|
44
|
+
}
|
|
45
|
+
get active() {
|
|
46
|
+
return document.pictureInPictureElement === this.m;
|
|
47
|
+
}
|
|
48
|
+
get supported() {
|
|
49
|
+
return o(this.m);
|
|
50
|
+
}
|
|
51
|
+
async enter() {
|
|
52
|
+
return this.m.requestPictureInPicture();
|
|
53
|
+
}
|
|
54
|
+
exit() {
|
|
55
|
+
return document.exitPictureInPicture();
|
|
56
|
+
}
|
|
57
|
+
Gi(t) {
|
|
58
|
+
this.E(!0, t);
|
|
59
|
+
}
|
|
60
|
+
Hi(t) {
|
|
61
|
+
this.E(!1, t);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
class y {
|
|
65
|
+
constructor(t, e) {
|
|
66
|
+
this.m = t, this.a = e, this.U = "inline", c(this.m, "webkitpresentationmodechanged", this.hb.bind(this));
|
|
67
|
+
}
|
|
68
|
+
get pb() {
|
|
69
|
+
return u(this.m);
|
|
70
|
+
}
|
|
71
|
+
async fd(t) {
|
|
72
|
+
this.U !== t && this.m.webkitSetPresentationMode(t);
|
|
73
|
+
}
|
|
74
|
+
hb(t) {
|
|
75
|
+
var i;
|
|
76
|
+
const e = this.U;
|
|
77
|
+
this.U = this.m.webkitPresentationMode, (i = this.a.player) == null || i.dispatch(
|
|
78
|
+
new g("video-presentation-change", {
|
|
79
|
+
detail: this.U,
|
|
80
|
+
trigger: t
|
|
81
|
+
})
|
|
82
|
+
), ["fullscreen", "picture-in-picture"].forEach((s) => {
|
|
83
|
+
(this.U === s || e === s) && this.a.delegate.c(`${s}-change`, this.U === s, t);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
class O {
|
|
88
|
+
constructor(t) {
|
|
89
|
+
this.Oa = t;
|
|
90
|
+
}
|
|
91
|
+
get active() {
|
|
92
|
+
return this.Oa.U === "fullscreen";
|
|
93
|
+
}
|
|
94
|
+
get supported() {
|
|
95
|
+
return this.Oa.pb;
|
|
96
|
+
}
|
|
97
|
+
async enter() {
|
|
98
|
+
this.Oa.fd("fullscreen");
|
|
99
|
+
}
|
|
100
|
+
async exit() {
|
|
101
|
+
this.Oa.fd("inline");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
class w {
|
|
105
|
+
constructor(t) {
|
|
106
|
+
this.Oa = t;
|
|
107
|
+
}
|
|
108
|
+
get active() {
|
|
109
|
+
return this.Oa.U === "picture-in-picture";
|
|
110
|
+
}
|
|
111
|
+
get supported() {
|
|
112
|
+
return this.Oa.pb;
|
|
113
|
+
}
|
|
114
|
+
async enter() {
|
|
115
|
+
this.Oa.fd("picture-in-picture");
|
|
116
|
+
}
|
|
117
|
+
async exit() {
|
|
118
|
+
this.Oa.fd("inline");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
class I extends P {
|
|
122
|
+
constructor(t, e) {
|
|
123
|
+
super(t, e), this.$$PROVIDER_TYPE = "VIDEO", p(() => {
|
|
124
|
+
if (this.airPlay = new b(t, e), u(t)) {
|
|
125
|
+
const i = new y(t, e);
|
|
126
|
+
this.fullscreen = new O(i), this.pictureInPicture = new w(i);
|
|
127
|
+
} else o(t) && (this.pictureInPicture = new x(t, e));
|
|
128
|
+
}, this.scope);
|
|
129
|
+
}
|
|
130
|
+
get type() {
|
|
131
|
+
return "video";
|
|
132
|
+
}
|
|
133
|
+
setup() {
|
|
134
|
+
super.setup(), f(this.video) && new k(this.video, this.b), this.b.textRenderers.Xf(this.video), d(() => {
|
|
135
|
+
this.b.textRenderers.Xf(null);
|
|
136
|
+
}), this.type === "video" && this.b.delegate.c("provider-setup", this);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The native HTML `<video>` element.
|
|
140
|
+
*
|
|
141
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement}
|
|
142
|
+
*/
|
|
143
|
+
get video() {
|
|
144
|
+
return this.a;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
export {
|
|
148
|
+
I as VideoProvider
|
|
149
|
+
};
|