@webitel/ui-sdk 25.10.51 → 25.10.53

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.
Files changed (57) hide show
  1. package/dist/errors-DCJKAXTz.js +70 -0
  2. package/dist/img/sprite/index.js +4 -0
  3. package/dist/img/sprite/player-enter-fullscreen.svg +3 -0
  4. package/dist/img/sprite/player-exit-fullscreen.svg +4 -0
  5. package/dist/install-By5bv5Ga.js +111259 -0
  6. package/dist/prod-DTLJXtPo.js +994 -0
  7. package/dist/srt-parser-CWqahKwO.js +27 -0
  8. package/dist/ssa-parser-BqjjKy4M.js +209 -0
  9. package/dist/ui-sdk.css +1 -1
  10. package/dist/ui-sdk.js +2 -100294
  11. package/dist/ui-sdk.umd.cjs +1633 -1605
  12. package/dist/vidstack-54Jpr2Lq-B2le6Uto.js +142 -0
  13. package/dist/vidstack-BP-l85ST-CTFw3KUN.js +21 -0
  14. package/dist/vidstack-BTBUzdbF-BuhaE3ef.js +29 -0
  15. package/dist/vidstack-Ccp8mxka-2ZiXmway.js +20 -0
  16. package/dist/vidstack-Dgd3Tj9x-BuTqiZFH.js +397 -0
  17. package/dist/vidstack-DscYSLiW-Dk1undJ-.js +33 -0
  18. package/dist/vidstack-HTyVv8Yq-DzaVyW2f.js +52 -0
  19. package/dist/vidstack-audio-BEcEzkeF.js +26 -0
  20. package/dist/vidstack-dash-D8SZVGUN.js +405 -0
  21. package/dist/vidstack-google-cast-Yhgv2Xji.js +405 -0
  22. package/dist/vidstack-hls-C5jjqF8L.js +328 -0
  23. package/dist/vidstack-video-1erl9Gbe.js +149 -0
  24. package/dist/vidstack-vimeo-BSb58vEP.js +434 -0
  25. package/dist/vidstack-youtube-BeeLfeYv.js +204 -0
  26. package/package.json +2 -1
  27. package/src/assets/icons/sprite/index.js +4 -0
  28. package/src/assets/icons/sprite/player-enter-fullscreen.svg +3 -0
  29. package/src/assets/icons/sprite/player-exit-fullscreen.svg +4 -0
  30. package/src/components/index.js +3 -0
  31. package/src/components/wt-image/wt-image.vue +4 -1
  32. package/src/components/wt-loader/wt-loader.vue +1 -0
  33. package/src/components/wt-popup/_mixins.scss +31 -0
  34. package/src/components/wt-popup/wt-popup.vue +7 -21
  35. package/src/components/wt-table/wt-table.vue +5 -0
  36. package/src/components/wt-vidstack-player/components/layouts/video-layout.vue +112 -0
  37. package/src/components/wt-vidstack-player/components/panels/media-control-panel/components/buttons/fullscreen-button.vue +37 -0
  38. package/src/components/wt-vidstack-player/components/panels/media-control-panel/components/buttons/play-button.vue +21 -0
  39. package/src/components/wt-vidstack-player/components/panels/media-control-panel/components/sliders/time-slider.vue +31 -0
  40. package/src/components/wt-vidstack-player/components/panels/media-control-panel/components/time-group.vue +19 -0
  41. package/src/components/wt-vidstack-player/components/panels/media-control-panel/media-control-panel.vue +34 -0
  42. package/src/components/wt-vidstack-player/components/panels/video-display-panel/video-display-panel.vue +95 -0
  43. package/src/components/wt-vidstack-player/components/toggle-button.vue +54 -0
  44. package/src/components/wt-vidstack-player/wt-vidstack-player.vue +156 -0
  45. package/src/install.ts +1 -0
  46. package/types/components/index.d.ts +3 -1
  47. package/types/components/wt-image/wt-image.vue.d.ts +12 -2
  48. package/types/components/wt-vidstack-player/components/layouts/video-layout.vue.d.ts +11 -0
  49. package/types/components/wt-vidstack-player/components/panels/media-control-panel/components/buttons/fullscreen-button.vue.d.ts +6 -0
  50. package/types/components/wt-vidstack-player/components/panels/media-control-panel/components/buttons/play-button.vue.d.ts +2 -0
  51. package/types/components/wt-vidstack-player/components/panels/media-control-panel/components/sliders/time-slider.vue.d.ts +2 -0
  52. package/types/components/wt-vidstack-player/components/panels/media-control-panel/components/time-group.vue.d.ts +2 -0
  53. package/types/components/wt-vidstack-player/components/panels/media-control-panel/media-control-panel.vue.d.ts +2 -0
  54. package/types/components/wt-vidstack-player/components/panels/video-display-panel/video-display-panel.vue.d.ts +11 -0
  55. package/types/components/wt-vidstack-player/components/toggle-button.vue.d.ts +12 -0
  56. package/types/components/wt-vidstack-player/wt-vidstack-player.vue.d.ts +25 -0
  57. package/types/install.d.ts +1 -0
@@ -0,0 +1,405 @@
1
+ import { x as b, J as h, U as l, w as E, D as g, d as c, l as f, e as k, V as C, L as y } from "./install-By5bv5Ga.js";
2
+ import { R as A } from "./vidstack-Ccp8mxka-2ZiXmway.js";
3
+ import { g as v, a as L, b as p, h as m, l as w, c as S } from "./vidstack-54Jpr2Lq-B2le6Uto.js";
4
+ class j {
5
+ constructor(t) {
6
+ this.$a = new chrome.cast.media.MediaInfo(t.src, t.type);
7
+ }
8
+ build() {
9
+ return this.$a;
10
+ }
11
+ lj(t) {
12
+ return t.includes("live") ? this.$a.streamType = chrome.cast.media.StreamType.LIVE : this.$a.streamType = chrome.cast.media.StreamType.BUFFERED, this;
13
+ }
14
+ mj(t) {
15
+ return this.$a.tracks = t.map(this.nj), this;
16
+ }
17
+ oj(t, e) {
18
+ return this.$a.metadata = new chrome.cast.media.GenericMediaMetadata(), this.$a.metadata.title = t, this.$a.metadata.images = [{ url: e }], this;
19
+ }
20
+ nj(t, e) {
21
+ const s = new chrome.cast.media.Track(e, chrome.cast.media.TrackType.TEXT);
22
+ return s.name = t.label, s.trackContentId = t.src, s.trackContentType = "text/vtt", s.language = t.language, s.subtype = t.kind.toUpperCase(), s;
23
+ }
24
+ }
25
+ const d = chrome.cast.media.TrackType.TEXT, T = chrome.cast.media.TrackType.AUDIO;
26
+ class D {
27
+ constructor(t, e, s) {
28
+ this.od = t, this.b = e, this.Ae = s;
29
+ }
30
+ he() {
31
+ const t = this.ug.bind(this);
32
+ f(this.b.audioTracks, "change", t), f(this.b.textTracks, "mode-change", t), k(this.pj.bind(this));
33
+ }
34
+ nd() {
35
+ return this.b.$state.textTracks().filter((t) => t.src && t.type === "vtt");
36
+ }
37
+ vg() {
38
+ return this.b.$state.audioTracks();
39
+ }
40
+ xc(t) {
41
+ var s;
42
+ const e = ((s = this.od.mediaInfo) == null ? void 0 : s.tracks) ?? [];
43
+ return t ? e.filter((i) => i.type === t) : e;
44
+ }
45
+ qj() {
46
+ const t = [], e = this.vg().find((i) => i.selected), s = this.nd().filter(
47
+ (i) => i.mode === "showing"
48
+ );
49
+ if (e) {
50
+ const i = this.xc(T), r = this.ze(i, e);
51
+ r && t.push(r.trackId);
52
+ }
53
+ if (s != null && s.length) {
54
+ const i = this.xc(d);
55
+ if (i.length)
56
+ for (const r of s) {
57
+ const a = this.ze(i, r);
58
+ a && t.push(a.trackId);
59
+ }
60
+ }
61
+ return t;
62
+ }
63
+ pj() {
64
+ const t = this.nd();
65
+ if (!this.od.isMediaLoaded)
66
+ return;
67
+ const e = this.xc(d);
68
+ for (const s of t)
69
+ if (!this.ze(e, s)) {
70
+ C(() => {
71
+ var r;
72
+ return (r = this.Ae) == null ? void 0 : r.call(this);
73
+ });
74
+ break;
75
+ }
76
+ }
77
+ rj(t) {
78
+ if (!this.od.isMediaLoaded)
79
+ return;
80
+ const e = this.vg(), s = this.nd(), i = this.xc(T), r = this.xc(d);
81
+ for (const a of i) {
82
+ if (this.wg(e, a))
83
+ continue;
84
+ const n = {
85
+ id: a.trackId.toString(),
86
+ label: a.name,
87
+ language: a.language,
88
+ kind: a.subtype ?? "main",
89
+ selected: !1
90
+ };
91
+ this.b.audioTracks[y.da](n, t);
92
+ }
93
+ for (const a of r) {
94
+ if (this.wg(s, a))
95
+ continue;
96
+ const n = {
97
+ id: a.trackId.toString(),
98
+ src: a.trackContentId,
99
+ label: a.name,
100
+ language: a.language,
101
+ kind: a.subtype.toLowerCase()
102
+ };
103
+ this.b.textTracks.add(n, t);
104
+ }
105
+ }
106
+ ug(t) {
107
+ if (!this.od.isMediaLoaded)
108
+ return;
109
+ const e = this.qj(), s = new chrome.cast.media.EditTracksInfoRequest(e);
110
+ this.sj(s).catch((i) => {
111
+ });
112
+ }
113
+ sj(t) {
114
+ const e = p();
115
+ return new Promise((s, i) => e == null ? void 0 : e.editTracksInfo(t, s, i));
116
+ }
117
+ wg(t, e) {
118
+ return t.find((s) => this.xg(s, e));
119
+ }
120
+ ze(t, e) {
121
+ return t.find((s) => this.xg(e, s));
122
+ }
123
+ // Note: we can't rely on id matching because they will differ between local/remote. A local
124
+ // track id might not even exist.
125
+ xg(t, e) {
126
+ return e.name === t.label && e.language === t.language && e.subtype.toLowerCase() === t.kind.toLowerCase();
127
+ }
128
+ }
129
+ class M {
130
+ constructor(t, e) {
131
+ this.f = t, this.b = e, this.$$PROVIDER_TYPE = "GOOGLE_CAST", this.scope = b(), this.K = null, this.za = "disconnected", this.ua = 0, this.ga = 0, this.ba = new h(0, 0), this.Aa = new h(0, 0), this.fa = new A(this.kc.bind(this)), this.Pa = null, this.Be = !1, this.va = new D(
132
+ this.f,
133
+ this.b,
134
+ this.Ae.bind(this)
135
+ );
136
+ }
137
+ get c() {
138
+ return this.b.delegate.c;
139
+ }
140
+ get type() {
141
+ return "google-cast";
142
+ }
143
+ get currentSrc() {
144
+ return this.K;
145
+ }
146
+ /**
147
+ * The Google Cast remote player.
148
+ *
149
+ * @see {@link https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer}
150
+ */
151
+ get player() {
152
+ return this.f;
153
+ }
154
+ /**
155
+ * @see {@link https://developers.google.com/cast/docs/reference/web_sender/cast.framework.CastContext}
156
+ */
157
+ get cast() {
158
+ return v();
159
+ }
160
+ /**
161
+ * @see {@link https://developers.google.com/cast/docs/reference/web_sender/cast.framework.CastSession}
162
+ */
163
+ get session() {
164
+ return L();
165
+ }
166
+ /**
167
+ * @see {@link https://developers.google.com/cast/docs/reference/web_sender/chrome.cast.media.Media}
168
+ */
169
+ get media() {
170
+ return p();
171
+ }
172
+ /**
173
+ * Whether the current Google Cast session belongs to this provider.
174
+ */
175
+ get hasActiveSession() {
176
+ return m(this.K);
177
+ }
178
+ setup() {
179
+ this.tj(), this.uj(), this.va.he(), this.c("provider-setup", this);
180
+ }
181
+ tj() {
182
+ w(
183
+ cast.framework.CastContextEventType.CAST_STATE_CHANGED,
184
+ this.zg.bind(this)
185
+ );
186
+ }
187
+ uj() {
188
+ const t = cast.framework.RemotePlayerEventType, e = {
189
+ [t.IS_CONNECTED_CHANGED]: this.zg,
190
+ [t.IS_MEDIA_LOADED_CHANGED]: this.Ag,
191
+ [t.CAN_CONTROL_VOLUME_CHANGED]: this.Bg,
192
+ [t.CAN_SEEK_CHANGED]: this.Cg,
193
+ [t.DURATION_CHANGED]: this.de,
194
+ [t.IS_MUTED_CHANGED]: this.Na,
195
+ [t.VOLUME_LEVEL_CHANGED]: this.Na,
196
+ [t.IS_PAUSED_CHANGED]: this.vj,
197
+ [t.LIVE_SEEKABLE_RANGE_CHANGED]: this.nb,
198
+ [t.PLAYER_STATE_CHANGED]: this.wj
199
+ };
200
+ this.yg = e;
201
+ const s = this.xj.bind(this);
202
+ for (const i of l(e))
203
+ this.f.controller.addEventListener(i, s);
204
+ E(() => {
205
+ for (const i of l(e))
206
+ this.f.controller.removeEventListener(i, s);
207
+ });
208
+ }
209
+ async play() {
210
+ var t;
211
+ if (!(!this.f.isPaused && !this.Be)) {
212
+ if (this.Be) {
213
+ await this.Dg(!1, 0);
214
+ return;
215
+ }
216
+ (t = this.f.controller) == null || t.playOrPause();
217
+ }
218
+ }
219
+ async pause() {
220
+ var t;
221
+ this.f.isPaused || (t = this.f.controller) == null || t.playOrPause();
222
+ }
223
+ getMediaStatus(t) {
224
+ return new Promise((e, s) => {
225
+ var i;
226
+ (i = this.media) == null || i.getStatus(t, e, s);
227
+ });
228
+ }
229
+ setMuted(t) {
230
+ var s;
231
+ (t && !this.f.isMuted || !t && this.f.isMuted) && ((s = this.f.controller) == null || s.muteOrUnmute());
232
+ }
233
+ setCurrentTime(t) {
234
+ var e;
235
+ this.f.currentTime = t, this.c("seeking", t), (e = this.f.controller) == null || e.seek();
236
+ }
237
+ setVolume(t) {
238
+ var e;
239
+ this.f.volumeLevel = t, (e = this.f.controller) == null || e.setVolumeLevel();
240
+ }
241
+ async loadSource(t) {
242
+ var i;
243
+ if (((i = this.Pa) == null ? void 0 : i.src) !== t && (this.Pa = null), m(t)) {
244
+ this.yj(), this.K = t;
245
+ return;
246
+ }
247
+ this.c("load-start");
248
+ const e = this.zj(t), s = await this.session.loadMedia(e);
249
+ if (s) {
250
+ this.K = null, this.c("error", Error(S(s)));
251
+ return;
252
+ }
253
+ this.K = t;
254
+ }
255
+ destroy() {
256
+ this.z(), this.Eg();
257
+ }
258
+ z() {
259
+ this.Pa || (this.ga = 0, this.ba = new h(0, 0), this.Aa = new h(0, 0)), this.fa.$(), this.ua = 0, this.Pa = null;
260
+ }
261
+ yj() {
262
+ const t = new g("resume-session", { detail: this.session });
263
+ this.Ag(t);
264
+ const { muted: e, volume: s, savedState: i } = this.b.$state, r = i();
265
+ this.setCurrentTime(Math.max(this.f.currentTime, (r == null ? void 0 : r.currentTime) ?? 0)), this.setMuted(e()), this.setVolume(s()), (r == null ? void 0 : r.paused) === !1 && this.play();
266
+ }
267
+ Eg() {
268
+ this.cast.endCurrentSession(!0);
269
+ const { remotePlaybackLoader: t } = this.b.$state;
270
+ t.set(null);
271
+ }
272
+ Aj() {
273
+ const { savedState: t } = this.b.$state;
274
+ t.set({
275
+ paused: this.f.isPaused,
276
+ currentTime: this.f.currentTime
277
+ }), this.Eg();
278
+ }
279
+ kc() {
280
+ this.Bj();
281
+ }
282
+ xj(t) {
283
+ this.yg[t.type].call(this, t);
284
+ }
285
+ zg(t) {
286
+ const e = this.cast.getCastState(), s = e === cast.framework.CastState.CONNECTED ? "connected" : e === cast.framework.CastState.CONNECTING ? "connecting" : "disconnected";
287
+ if (this.za === s)
288
+ return;
289
+ const i = { type: "google-cast", state: s }, r = this.ab(t);
290
+ this.za = s, this.c("remote-playback-change", i, r), s === "disconnected" && this.Aj();
291
+ }
292
+ Ag(t) {
293
+ if (!!!this.f.isMediaLoaded)
294
+ return;
295
+ const s = c(this.b.$state.source);
296
+ Promise.resolve().then(() => {
297
+ if (s !== c(this.b.$state.source) || !this.f.isMediaLoaded)
298
+ return;
299
+ this.z();
300
+ const i = this.f.duration;
301
+ this.Aa = new h(0, i);
302
+ const r = {
303
+ provider: this,
304
+ duration: i,
305
+ buffered: this.ba,
306
+ seekable: this.Fg()
307
+ }, a = this.ab(t);
308
+ this.c("loaded-metadata", void 0, a), this.c("loaded-data", void 0, a), this.c("can-play", r, a), this.Bg(), this.Cg(t);
309
+ const { volume: o, muted: n } = this.b.$state;
310
+ this.setVolume(o()), this.setMuted(n()), this.fa.Xa(), this.va.rj(a), this.va.ug(a);
311
+ });
312
+ }
313
+ Bg() {
314
+ this.b.$state.canSetVolume.set(this.f.canControlVolume);
315
+ }
316
+ Cg(t) {
317
+ const e = this.ab(t);
318
+ this.c("stream-type-change", this.Cj(), e);
319
+ }
320
+ Cj() {
321
+ var e;
322
+ return ((e = this.f.mediaInfo) == null ? void 0 : e.streamType) === chrome.cast.media.StreamType.LIVE ? this.f.canSeek ? "live:dvr" : "live" : "on-demand";
323
+ }
324
+ Bj() {
325
+ if (this.Pa)
326
+ return;
327
+ const t = this.f.currentTime;
328
+ if (t === this.ua)
329
+ return;
330
+ const e = this.ga, s = this.uc(t), i = { currentTime: t, played: s };
331
+ this.c("time-update", i), t > e && this.nb(), this.b.$state.seeking() && this.c("seeked", t), this.ua = t;
332
+ }
333
+ uc(t) {
334
+ return this.ga >= t ? this.ba : this.ba = new h(0, this.ga = t);
335
+ }
336
+ de(t) {
337
+ if (!this.f.isMediaLoaded || this.Pa)
338
+ return;
339
+ const e = this.f.duration, s = this.ab(t);
340
+ this.Aa = new h(0, e), this.c("duration-change", e, s);
341
+ }
342
+ Na(t) {
343
+ if (!this.f.isMediaLoaded)
344
+ return;
345
+ const e = {
346
+ muted: this.f.isMuted,
347
+ volume: this.f.volumeLevel
348
+ }, s = this.ab(t);
349
+ this.c("volume-change", e, s);
350
+ }
351
+ vj(t) {
352
+ const e = this.ab(t);
353
+ this.f.isPaused ? this.c("pause", void 0, e) : this.c("play", void 0, e);
354
+ }
355
+ nb(t) {
356
+ const e = {
357
+ seekable: this.Fg(),
358
+ buffered: this.ba
359
+ }, s = t ? this.ab(t) : void 0;
360
+ this.c("progress", e, s);
361
+ }
362
+ wj(t) {
363
+ const e = this.f.playerState, s = chrome.cast.media.PlayerState;
364
+ if (this.Be = e === s.IDLE, e === s.PAUSED)
365
+ return;
366
+ const i = this.ab(t);
367
+ switch (e) {
368
+ case s.PLAYING:
369
+ this.c("playing", void 0, i);
370
+ break;
371
+ case s.BUFFERING:
372
+ this.c("waiting", void 0, i);
373
+ break;
374
+ case s.IDLE:
375
+ this.fa.$(), this.c("pause"), this.c("end");
376
+ break;
377
+ }
378
+ }
379
+ Fg() {
380
+ return this.f.liveSeekableRange ? new h(this.f.liveSeekableRange.start, this.f.liveSeekableRange.end) : this.Aa;
381
+ }
382
+ ab(t) {
383
+ return t instanceof Event ? t : new g(t.type, { detail: t });
384
+ }
385
+ Dj(t) {
386
+ const { streamType: e, title: s, poster: i } = this.b.$state;
387
+ return new j(t).oj(s(), i()).lj(e()).mj(this.va.nd()).build();
388
+ }
389
+ zj(t) {
390
+ var r, a;
391
+ const e = this.Dj(t), s = new chrome.cast.media.LoadRequest(e), i = this.b.$state.savedState();
392
+ return s.autoplay = (((r = this.Pa) == null ? void 0 : r.paused) ?? (i == null ? void 0 : i.paused)) === !1, s.currentTime = ((a = this.Pa) == null ? void 0 : a.time) ?? (i == null ? void 0 : i.currentTime) ?? 0, s;
393
+ }
394
+ async Dg(t, e) {
395
+ const s = c(this.b.$state.source);
396
+ this.Pa = { src: s, paused: t, time: e }, await this.loadSource(s);
397
+ }
398
+ Ae() {
399
+ this.Dg(this.f.isPaused, this.f.currentTime).catch((t) => {
400
+ });
401
+ }
402
+ }
403
+ export {
404
+ M as GoogleCastProvider
405
+ };