@webitel/ui-sdk 26.6.33 → 26.6.35
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/AgentStatus.enum-C3IGHtvR.js +9 -0
- package/dist/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
- package/dist/caseConverters-DXegZoCt.js +27 -0
- package/dist/chunk-CY3AvKd6.js +20 -0
- package/dist/clients-A6MHYfOX.js +36118 -0
- package/dist/components-B4aAS7wB.js +5391 -0
- package/dist/composables-DnDH-KUv.js +263 -0
- package/dist/convertDuration-1K7fuEpO.js +8 -0
- package/dist/debounce-DrmECuJ2.js +128 -0
- package/dist/deep-copy-CQw5yeEH.js +41 -0
- package/dist/displayText-CtaxzaBz.js +3 -0
- package/dist/dist-05Bf47Wg.js +87 -0
- package/dist/dist-BYiYpK00.js +7 -0
- package/dist/dist-Dz55hlwp.js +1371 -0
- package/dist/engineCallFileType-D7QVFOac.js +11 -0
- package/dist/enums-pbYAJNeb.js +158 -0
- package/dist/errors-SUXKojVW.js +69 -0
- package/dist/floating-ui.dom-n2j9PKCB.js +842 -0
- package/dist/generateInstance-ppTIeLX4.js +2582 -0
- package/dist/isObject-Dgs_L5xI.js +11 -0
- package/dist/logger-hl3ueNok.js +47 -0
- package/dist/prod-Cp0BjuxI.js +775 -0
- package/dist/prod-DSuxcp5t.js +2 -0
- package/dist/side-channel-Cyte-MzW.js +833 -0
- package/dist/sortQueryAdapters-CyYXvnDN.js +14 -0
- package/dist/srt-parser-DdH5U08c.js +21 -0
- package/dist/ssa-parser-Bjs7yDD1.js +184 -0
- package/dist/ui-sdk.css +2 -1
- package/dist/ui-sdk.js +34541 -4
- package/dist/ui-sdk.umd.cjs +7740 -7606
- package/dist/useExpansion-DVdIpoOn.js +24 -0
- package/dist/useValidation-DG0tifBv.js +37 -0
- package/dist/useVidstackSrc-DfNrFbOO.js +155 -0
- package/dist/useWtTable-tqmVOvve.js +12 -0
- package/dist/vidstack-B01xzxC4-DeYSgDZy.js +7 -0
- package/dist/vidstack-BGSTndAW-CyKM_CM4.js +957 -0
- package/dist/vidstack-BQlOPwOu-ChhdffAJ.js +43 -0
- package/dist/vidstack-Bq6c3Bam-3dCf_D36.js +398 -0
- package/dist/vidstack-C2US-gSO-DeIgENrW.js +127 -0
- package/dist/vidstack-C9vIqaYT-C1EgPq17.js +9 -0
- package/dist/vidstack-CTojmhKq-D7sZJxgm.js +30 -0
- package/dist/vidstack-ChQTHmIQ-nTO94M6P.js +51 -0
- package/dist/vidstack-Ci54COQW-CAAXpwzv.js +208 -0
- package/dist/vidstack-D2pY00kU-DoW028io.js +70 -0
- package/dist/vidstack-D5EzK014-DOe01V3H.js +14 -0
- package/dist/vidstack-DDXt6fpN-Don_e6LS.js +42 -0
- package/dist/vidstack-D_-9AA6_-Dq3APB0-.js +19 -0
- package/dist/vidstack-Dihypf8P-ibWMCHK-.js +12 -0
- package/dist/vidstack-Dm1xEU9Q-VlefmrP8.js +31 -0
- package/dist/vidstack-DqAw8m9J-Dk1GT3Oe.js +22 -0
- package/dist/vidstack-audio-B58bvsna.js +23 -0
- package/dist/vidstack-dash-CX-LTHx3.js +332 -0
- package/dist/vidstack-google-cast-Co5Q_rfL.js +361 -0
- package/dist/vidstack-hls-CLzdTFu6.js +269 -0
- package/dist/vidstack-krOAtKMi-DN1WZC3p.js +30 -0
- package/dist/vidstack-video-XtP8iTBc.js +151 -0
- package/dist/vidstack-vimeo-EzzPpggD.js +386 -0
- package/dist/vidstack-youtube-C1_NAfWa.js +205 -0
- package/dist/vue-i18n-B8Px6VcD.js +2201 -0
- package/dist/wt-action-bar-Ba1ZJjE_.js +85 -0
- package/dist/wt-button-DENbrKdy.js +785 -0
- package/dist/wt-button-select-BnRHgJ4i.js +80 -0
- package/dist/wt-call-media-action-Bkyppnsm.js +42 -0
- package/dist/wt-chat-emoji-wdBt1XzD.js +2208 -0
- package/dist/wt-confirm-dialog-DCUitG2v.js +70 -0
- package/dist/wt-context-menu-yW52oF-2.js +89 -0
- package/dist/wt-copy-action-d9gVzAsB.js +38 -0
- package/dist/wt-datepicker-Cnbarx_j.js +5774 -0
- package/dist/wt-display-chip-items-CvMM8WMk.js +34 -0
- package/dist/wt-dual-panel-DAhTYFS_.js +49 -0
- package/dist/wt-dummy-CLjhRWZ6.js +59 -0
- package/dist/wt-error-page-vhu4lIyF.js +62 -0
- package/dist/wt-expand-transition-C2p9bR4j.js +39 -0
- package/dist/wt-expansion-card-qsxvbtZm.js +47 -0
- package/dist/wt-expansion-panel-C_EXvx1d.js +40 -0
- package/dist/wt-filters-panel-wrapper-Cc9b3aci.js +51 -0
- package/dist/wt-galleria-CWXKuZTD.js +224 -0
- package/dist/wt-icon-action-CQlZHMDB.js +100 -0
- package/dist/wt-icon-btn-CjjI4cgE.js +107 -0
- package/dist/wt-icon-pxO7IjwV.js +1026 -0
- package/dist/wt-inline-add-panel-B0E4Vk2l.js +43 -0
- package/dist/wt-navigation-menu-CenQi_-T.js +126 -0
- package/dist/wt-notifications-bar-Ep1QuFZi.js +52 -0
- package/dist/wt-page-header-CDbd4aOh.js +59 -0
- package/dist/wt-pagination-BA_PZPIE.js +94 -0
- package/dist/wt-player-uidPXSTe.js +287 -0
- package/dist/wt-popover-CJZH3wMl.js +98 -0
- package/dist/wt-screen-recordings-action-Dg7Ts2Jt.js +37 -0
- package/dist/wt-search-bar-CWZdvAOf.js +123 -0
- package/dist/wt-selection-popup-B77UY7Yu.js +79 -0
- package/dist/wt-send-message-popup-D0GJMGni.js +77 -0
- package/dist/wt-slider-BS3SoGht.js +68 -0
- package/dist/wt-start-page-eN1PEokc.js +86 -0
- package/dist/wt-status-select-A5t6Vjm4.js +101 -0
- package/dist/wt-stepper-B6zpd1Uh.js +41 -0
- package/dist/wt-table-D0FynxIE.js +364 -0
- package/dist/wt-table-actions-4-peSVkc.js +63 -0
- package/dist/wt-table-column-select-DFF6z3a3.js +100 -0
- package/dist/wt-tabs-DuOgj-lZ.js +60 -0
- package/dist/wt-time-input-CO2cop3y.js +62 -0
- package/dist/wt-timepicker-BltFF1QD.js +145 -0
- package/dist/wt-tree-ZyoPrNOl.js +1206 -0
- package/dist/wt-tree-table-MLET4gIv.js +221 -0
- package/dist/wt-type-extension-value-input-fnNxJLsq.js +104 -0
- package/dist/wt-vidstack-player-DLTA9mBK.js +7440 -0
- package/package.json +5 -5
- package/src/components/wt-table-column-select/__tests__/WtTableColumnSelect.spec.js +3 -3
- package/src/components/wt-vidstack-player/wt-vidstack-player.vue +2 -2
- package/dist/contacts-C-FnP7wP.js +0 -49654
- package/dist/displayText-Cbh4IOfM.js +0 -5
- package/dist/engineCallFileType-yaadA7-2.js +0 -8
- package/dist/errors-CTL-RV3B.js +0 -70
- package/dist/index-BBLSS-t1.js +0 -50
- package/dist/install-DOSuNFtE.js +0 -53489
- package/dist/isObject-CMQJaQIp.js +0 -28
- package/dist/prod-BoQuiIB3.js +0 -973
- package/dist/srt-parser-CsN7bp5E.js +0 -26
- package/dist/ssa-parser-BJOOPeQF.js +0 -200
- package/dist/useExpansion-BrQ40HiR.js +0 -24
- package/dist/useVidstackSrc-MfWBq7Ef.js +0 -1341
- package/dist/vidstack-Bq6c3Bam-C_T8PkmG.js +0 -426
- package/dist/vidstack-D2pY00kU-CphVKcJq.js +0 -136
- package/dist/vidstack-DDXt6fpN-2lNfj8Ca.js +0 -51
- package/dist/vidstack-D_-9AA6_-Cyl8HzDm.js +0 -21
- package/dist/vidstack-Dm1xEU9Q-CXHNvShT.js +0 -30
- package/dist/vidstack-DqAw8m9J-C2p9K7Db.js +0 -22
- package/dist/vidstack-audio-BL-Sa_Ap.js +0 -28
- package/dist/vidstack-dash-mKhgfurw.js +0 -393
- package/dist/vidstack-google-cast-BGqSw2iP.js +0 -383
- package/dist/vidstack-hls-U5fTV3hj.js +0 -310
- package/dist/vidstack-krOAtKMi-C50BTxmn.js +0 -28
- package/dist/vidstack-video-Bxf7KDne.js +0 -164
- package/dist/vidstack-vimeo-MngSXtDR.js +0 -452
- package/dist/vidstack-youtube-Ctg91VeX.js +0 -233
- package/dist/wt-action-bar-DaDcqA4n.js +0 -102
- package/dist/wt-button-select-q_BITVhH.js +0 -105
- package/dist/wt-call-media-action-BkBcZN17.js +0 -60
- package/dist/wt-chat-emoji-BGuSgYi3.js +0 -2909
- package/dist/wt-confirm-dialog-C7-74ROm.js +0 -92
- package/dist/wt-context-menu-CzAHMaOj.js +0 -104
- package/dist/wt-copy-action-BpckAObd.js +0 -60
- package/dist/wt-datepicker-DauMnf2r.js +0 -5660
- package/dist/wt-display-chip-items-zcqxH89_.js +0 -47
- package/dist/wt-dual-panel-Cj79kJpk.js +0 -66
- package/dist/wt-dummy-BUHYAcsk.js +0 -104
- package/dist/wt-error-page-CNSqDA-o.js +0 -89
- package/dist/wt-expansion-card-CtcuXg6f.js +0 -56
- package/dist/wt-expansion-panel-BU2Hb-N2.js +0 -54
- package/dist/wt-filters-panel-wrapper-BlLlAixc.js +0 -75
- package/dist/wt-galleria-BQzGD6-3.js +0 -323
- package/dist/wt-inline-add-panel-fG58a6T3.js +0 -49
- package/dist/wt-navigation-menu-2ggfyrM_.js +0 -159
- package/dist/wt-notifications-bar-Epn_SA_R.js +0 -79
- package/dist/wt-page-header-DdsnoLgd.js +0 -115
- package/dist/wt-pagination-Byg79HfY.js +0 -144
- package/dist/wt-player-kjdJYVi3.js +0 -291
- package/dist/wt-popover-Di-7_rDL.js +0 -4
- package/dist/wt-popover.vue_vue_type_style_index_0_lang-DMDTlCgv.js +0 -81
- package/dist/wt-screen-recordings-action-Z3x-gI0n.js +0 -54
- package/dist/wt-search-bar-CxwSi-Xo.js +0 -144
- package/dist/wt-selection-popup-MdCfrgcd.js +0 -109
- package/dist/wt-send-message-popup-DklTgoGj.js +0 -579
- package/dist/wt-slider-BEkw4KGp.js +0 -4
- package/dist/wt-slider.vue_vue_type_script_setup_true_lang-DlaRDHxo.js +0 -55
- package/dist/wt-start-page-B59KbWqX.js +0 -99
- package/dist/wt-status-select-hOAr_xBg.js +0 -138
- package/dist/wt-stepper-CMeW3d6N.js +0 -65
- package/dist/wt-table-C5CLtnK5.js +0 -426
- package/dist/wt-table-actions-DgAfy-dd.js +0 -79
- package/dist/wt-table-column-select-BK5rozpI.js +0 -128
- package/dist/wt-tabs-Bn6rSg0s.js +0 -74
- package/dist/wt-time-input-DYiW0ijt.js +0 -42
- package/dist/wt-timepicker-CkjoLwXC.js +0 -118
- package/dist/wt-tree-CCvr4TTF.js +0 -2777
- package/dist/wt-tree-table-BWmGF3rE.js +0 -285
- package/dist/wt-type-extension-value-input-q5286OSO.js +0 -121
- package/dist/wt-vidstack-player-CTWna35Q.js +0 -9093
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import { D as e, H as t, I as n, K as r, N as i, R as a, f as o, r as s, v as c } from "./vidstack-BGSTndAW-CyKM_CM4.js";
|
|
2
|
+
import { _ as l, f as u, r as d, u as f } from "./useVidstackSrc-DfNrFbOO.js";
|
|
3
|
+
import { i as p, r as m } from "./vidstack-CTojmhKq-D7sZJxgm.js";
|
|
4
|
+
import { t as h } from "./vidstack-DqAw8m9J-Dk1GT3Oe.js";
|
|
5
|
+
import { t as g } from "./vidstack-D5EzK014-DOe01V3H.js";
|
|
6
|
+
import { n as _, t as v } from "./vidstack-Ci54COQW-CAAXpwzv.js";
|
|
7
|
+
import { VideoProvider as y } from "./vidstack-video-XtP8iTBc.js";
|
|
8
|
+
import { t as b } from "./vidstack-B01xzxC4-DeYSgDZy.js";
|
|
9
|
+
import { n as x } from "./vidstack-C9vIqaYT-C1EgPq17.js";
|
|
10
|
+
//#region node_modules/vidstack/prod/providers/vidstack-dash.js
|
|
11
|
+
function S(e) {
|
|
12
|
+
try {
|
|
13
|
+
return new Intl.DisplayNames(navigator.languages, { type: "language" }).of(e) ?? null;
|
|
14
|
+
} catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
var C = (e) => `dash-${o(e)}`, w = class {
|
|
19
|
+
#e;
|
|
20
|
+
#t;
|
|
21
|
+
#n = null;
|
|
22
|
+
#r = /* @__PURE__ */ new Set();
|
|
23
|
+
#i = null;
|
|
24
|
+
config = {};
|
|
25
|
+
get instance() {
|
|
26
|
+
return this.#n;
|
|
27
|
+
}
|
|
28
|
+
constructor(e, t) {
|
|
29
|
+
this.#e = e, this.#t = t;
|
|
30
|
+
}
|
|
31
|
+
setup(e) {
|
|
32
|
+
this.#n = e().create();
|
|
33
|
+
let n = this.#c.bind(this);
|
|
34
|
+
for (let t of Object.values(e.events)) this.#n.on(t, n);
|
|
35
|
+
this.#n.on(e.events.ERROR, this.#g.bind(this));
|
|
36
|
+
for (let e of this.#r) e(this.#n);
|
|
37
|
+
this.#t.player.dispatch("dash-instance", { detail: this.#n }), this.#n.initialize(this.#e, void 0, !1), this.#n.updateSettings({
|
|
38
|
+
streaming: {
|
|
39
|
+
text: {
|
|
40
|
+
defaultEnabled: !1,
|
|
41
|
+
dispatchForManualRendering: !0
|
|
42
|
+
},
|
|
43
|
+
buffer: { fastSwitchEnabled: !0 }
|
|
44
|
+
},
|
|
45
|
+
...this.config
|
|
46
|
+
}), this.#n.on(e.events.FRAGMENT_LOADING_STARTED, this.#_.bind(this)), this.#n.on(e.events.FRAGMENT_LOADING_COMPLETED, this.#v.bind(this)), this.#n.on(e.events.MANIFEST_LOADED, this.#h.bind(this)), this.#n.on(e.events.QUALITY_CHANGE_RENDERED, this.#m.bind(this)), this.#n.on(e.events.TEXT_TRACKS_ADDED, this.#f.bind(this)), this.#n.on(e.events.TRACK_CHANGE_RENDERED, this.#p.bind(this)), this.#t.qualities[b.enableAuto] = this.#C.bind(this), t(this.#t.qualities, "change", this.#T.bind(this)), t(this.#t.audioTracks, "change", this.#E.bind(this)), this.#i = c(this.#o.bind(this));
|
|
47
|
+
}
|
|
48
|
+
#a(e) {
|
|
49
|
+
return new s(C(e.type), { detail: e });
|
|
50
|
+
}
|
|
51
|
+
#o() {
|
|
52
|
+
if (!this.#t.$state.live()) return;
|
|
53
|
+
let e = new h(this.#s.bind(this));
|
|
54
|
+
return e.start(), e.stop.bind(e);
|
|
55
|
+
}
|
|
56
|
+
#s() {
|
|
57
|
+
if (!this.#n) return;
|
|
58
|
+
let e = this.#n.duration() - this.#n.time();
|
|
59
|
+
this.#t.$state.liveSyncPosition.set(isNaN(e) ? Infinity : e);
|
|
60
|
+
}
|
|
61
|
+
#c(e) {
|
|
62
|
+
this.#t.player?.dispatch(this.#a(e));
|
|
63
|
+
}
|
|
64
|
+
#l = null;
|
|
65
|
+
#u = {};
|
|
66
|
+
#d(e) {
|
|
67
|
+
let t = this.#l?.[_.native], n = (t?.track).cues;
|
|
68
|
+
if (!t || !n) return;
|
|
69
|
+
let r = this.#l.id, i = this.#u[r] ?? 0, a = this.#a(e);
|
|
70
|
+
for (let e = i; e < n.length; e++) {
|
|
71
|
+
let t = n[e];
|
|
72
|
+
t.positionAlign ||= "auto", this.#l.addCue(t, a);
|
|
73
|
+
}
|
|
74
|
+
this.#u[r] = n.length;
|
|
75
|
+
}
|
|
76
|
+
#f(e) {
|
|
77
|
+
if (!this.#n) return;
|
|
78
|
+
let t = e.tracks, n = [...this.#e.textTracks].filter((e) => "manualMode" in e), r = this.#a(e);
|
|
79
|
+
for (let e = 0; e < n.length; e++) {
|
|
80
|
+
let i = t[e], a = n[e], o = new v({
|
|
81
|
+
id: `dash-${i.kind}-${e}`,
|
|
82
|
+
label: i?.label ?? i.labels.find((e) => e.text)?.text ?? (i?.lang && S(i.lang)) ?? i?.lang ?? void 0,
|
|
83
|
+
language: i.lang ?? void 0,
|
|
84
|
+
kind: i.kind,
|
|
85
|
+
default: i.defaultTrack
|
|
86
|
+
});
|
|
87
|
+
o[_.native] = {
|
|
88
|
+
managed: !0,
|
|
89
|
+
track: a
|
|
90
|
+
}, o[_.readyState] = 2, o[_.onModeChange] = () => {
|
|
91
|
+
this.#n && (o.mode === "showing" ? (this.#n.setTextTrack(e), this.#l = o) : (this.#n.setTextTrack(-1), this.#l = null));
|
|
92
|
+
}, this.#t.textTracks.add(o, r);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
#p(e) {
|
|
96
|
+
let { mediaType: t, newMediaInfo: n } = e;
|
|
97
|
+
if (t === "audio") {
|
|
98
|
+
let t = this.#t.audioTracks.getById(`dash-audio-${n.index}`);
|
|
99
|
+
if (t) {
|
|
100
|
+
let n = this.#a(e);
|
|
101
|
+
this.#t.audioTracks[g.select](t, !0, n);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
#m(e) {
|
|
106
|
+
if (e.mediaType !== "video") return;
|
|
107
|
+
let t = this.#t.qualities[e.newQuality];
|
|
108
|
+
if (t) {
|
|
109
|
+
let n = this.#a(e);
|
|
110
|
+
this.#t.qualities[g.select](t, !0, n);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
#h(e) {
|
|
114
|
+
if (this.#t.$state.canPlay() || !this.#n) return;
|
|
115
|
+
let { type: t, mediaPresentationDuration: n } = e.data, r = this.#a(e);
|
|
116
|
+
this.#t.notify("stream-type-change", t === "static" ? "on-demand" : "live", r), this.#t.notify("duration-change", n, r), this.#t.qualities[b.setAuto](!0, r);
|
|
117
|
+
let a = this.#n.getVideoElement(), o = this.#n.getTracksForTypeFromManifest("video", e.data), c = [...new Set(o.map((e) => e.mimeType))].find((e) => e && u(a, e)), l = o.filter((e) => c === e.mimeType)[0], d = this.#n.getTracksForTypeFromManifest("audio", e.data), p = [...new Set(d.map((e) => e.mimeType))].find((e) => e && f(a, e));
|
|
118
|
+
if (d = d.filter((e) => p === e.mimeType), l.bitrateList.forEach((e, t) => {
|
|
119
|
+
let n = {
|
|
120
|
+
id: e.id?.toString() ?? `dash-bitrate-${t}`,
|
|
121
|
+
width: e.width ?? 0,
|
|
122
|
+
height: e.height ?? 0,
|
|
123
|
+
bitrate: e.bandwidth ?? 0,
|
|
124
|
+
codec: l.codec,
|
|
125
|
+
index: t
|
|
126
|
+
};
|
|
127
|
+
this.#t.qualities[g.add](n, r);
|
|
128
|
+
}), i(l.index)) {
|
|
129
|
+
let e = this.#t.qualities[l.index];
|
|
130
|
+
e && this.#t.qualities[g.select](e, !0, r);
|
|
131
|
+
}
|
|
132
|
+
d.forEach((e, t) => {
|
|
133
|
+
let n = e.labels.find((e) => navigator.languages.some((t) => e.lang && t.toLowerCase().startsWith(e.lang.toLowerCase()))) || e.labels[0], i = {
|
|
134
|
+
id: `dash-audio-${e?.index}`,
|
|
135
|
+
label: n?.text ?? (e.lang && S(e.lang)) ?? e.lang ?? "",
|
|
136
|
+
language: e.lang ?? "",
|
|
137
|
+
kind: "main",
|
|
138
|
+
mimeType: e.mimeType,
|
|
139
|
+
codec: e.codec,
|
|
140
|
+
index: t
|
|
141
|
+
};
|
|
142
|
+
this.#t.audioTracks[g.add](i, r);
|
|
143
|
+
}), a.dispatchEvent(new s("canplay", { trigger: r }));
|
|
144
|
+
}
|
|
145
|
+
#g(e) {
|
|
146
|
+
let { type: t, error: n } = e;
|
|
147
|
+
switch (n.code) {
|
|
148
|
+
case 27:
|
|
149
|
+
this.#b(n);
|
|
150
|
+
break;
|
|
151
|
+
default:
|
|
152
|
+
this.#S(n);
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
#_() {
|
|
157
|
+
this.#y >= 0 && this.#x();
|
|
158
|
+
}
|
|
159
|
+
#v(e) {
|
|
160
|
+
e.mediaType === "text" && requestAnimationFrame(this.#d.bind(this, e));
|
|
161
|
+
}
|
|
162
|
+
#y = -1;
|
|
163
|
+
#b(e) {
|
|
164
|
+
this.#x(), this.#n?.play(), this.#y = window.setTimeout(() => {
|
|
165
|
+
this.#y = -1, this.#S(e);
|
|
166
|
+
}, 5e3);
|
|
167
|
+
}
|
|
168
|
+
#x() {
|
|
169
|
+
clearTimeout(this.#y), this.#y = -1;
|
|
170
|
+
}
|
|
171
|
+
#S(e) {
|
|
172
|
+
this.#t.notify("error", {
|
|
173
|
+
message: e.message ?? "",
|
|
174
|
+
code: 1,
|
|
175
|
+
error: e
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
#C() {
|
|
179
|
+
this.#w("video", !0);
|
|
180
|
+
let { qualities: e } = this.#t;
|
|
181
|
+
this.#n?.setQualityFor("video", e.selectedIndex, !0);
|
|
182
|
+
}
|
|
183
|
+
#w(e, t) {
|
|
184
|
+
this.#n?.updateSettings({ streaming: { abr: { autoSwitchBitrate: { [e]: t } } } });
|
|
185
|
+
}
|
|
186
|
+
#T() {
|
|
187
|
+
let { qualities: e } = this.#t;
|
|
188
|
+
!this.#n || e.auto || !e.selected || (this.#w("video", !1), this.#n.setQualityFor("video", e.selectedIndex, e.switch === "current"), d && (this.#e.currentTime = this.#e.currentTime));
|
|
189
|
+
}
|
|
190
|
+
#E() {
|
|
191
|
+
if (!this.#n) return;
|
|
192
|
+
let { audioTracks: e } = this.#t, t = this.#n.getTracksFor("audio").find((t) => e.selected && e.selected.id === `dash-audio-${t.index}`);
|
|
193
|
+
t && this.#n.setCurrentTrack(t);
|
|
194
|
+
}
|
|
195
|
+
#D() {
|
|
196
|
+
this.#x(), this.#l = null, this.#u = {};
|
|
197
|
+
}
|
|
198
|
+
onInstance(e) {
|
|
199
|
+
return this.#r.add(e), () => this.#r.delete(e);
|
|
200
|
+
}
|
|
201
|
+
loadSource(e) {
|
|
202
|
+
this.#D(), n(e.src) && this.#n?.attachSource(e.src);
|
|
203
|
+
}
|
|
204
|
+
destroy() {
|
|
205
|
+
this.#D(), this.#n?.destroy(), this.#n = null, this.#i?.(), this.#i = null;
|
|
206
|
+
}
|
|
207
|
+
}, T = class {
|
|
208
|
+
#e;
|
|
209
|
+
#t;
|
|
210
|
+
#n;
|
|
211
|
+
constructor(e, t, n) {
|
|
212
|
+
this.#e = e, this.#t = t, this.#n = n, this.#r();
|
|
213
|
+
}
|
|
214
|
+
async #r() {
|
|
215
|
+
let e = {
|
|
216
|
+
onLoadStart: this.#i.bind(this),
|
|
217
|
+
onLoaded: this.#a.bind(this),
|
|
218
|
+
onLoadError: this.#o.bind(this)
|
|
219
|
+
}, t = await D(this.#e, e);
|
|
220
|
+
return a(t) && !n(this.#e) && (t = await E(this.#e, e)), t ? window.dashjs.supportsMediaSource() ? t : (this.#t.player.dispatch(new s("dash-unsupported")), this.#t.notify("error", {
|
|
221
|
+
message: "[vidstack] `dash.js` is not supported in this environment",
|
|
222
|
+
code: 4
|
|
223
|
+
}), null) : null;
|
|
224
|
+
}
|
|
225
|
+
#i() {
|
|
226
|
+
this.#t.player.dispatch(new s("dash-lib-load-start"));
|
|
227
|
+
}
|
|
228
|
+
#a(e) {
|
|
229
|
+
this.#t.player.dispatch(new s("dash-lib-loaded", { detail: e })), this.#n(e);
|
|
230
|
+
}
|
|
231
|
+
#o(e) {
|
|
232
|
+
let t = x(e);
|
|
233
|
+
this.#t.player.dispatch(new s("dash-lib-load-error", { detail: t })), this.#t.notify("error", {
|
|
234
|
+
message: t.message,
|
|
235
|
+
code: 4,
|
|
236
|
+
error: t
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
async function E(e, t = {}) {
|
|
241
|
+
if (!a(e)) {
|
|
242
|
+
if (t.onLoadStart?.(), O(e)) return t.onLoaded?.(e), e;
|
|
243
|
+
if (k(e)) {
|
|
244
|
+
let n = e.MediaPlayer;
|
|
245
|
+
return t.onLoaded?.(n), n;
|
|
246
|
+
}
|
|
247
|
+
try {
|
|
248
|
+
let n = (await e())?.default;
|
|
249
|
+
if (k(n)) return t.onLoaded?.(n.MediaPlayer), n.MediaPlayer;
|
|
250
|
+
if (n) t.onLoaded?.(n);
|
|
251
|
+
else throw Error("");
|
|
252
|
+
return n;
|
|
253
|
+
} catch (e) {
|
|
254
|
+
t.onLoadError?.(e);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
async function D(t, r = {}) {
|
|
259
|
+
if (n(t)) {
|
|
260
|
+
r.onLoadStart?.();
|
|
261
|
+
try {
|
|
262
|
+
if (await m(t), !e(window.dashjs.MediaPlayer)) throw Error("");
|
|
263
|
+
let n = window.dashjs.MediaPlayer;
|
|
264
|
+
return r.onLoaded?.(n), n;
|
|
265
|
+
} catch (e) {
|
|
266
|
+
r.onLoadError?.(e);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
function O(e) {
|
|
271
|
+
return e && e.prototype && e.prototype !== Function;
|
|
272
|
+
}
|
|
273
|
+
function k(e) {
|
|
274
|
+
return e && "MediaPlayer" in e;
|
|
275
|
+
}
|
|
276
|
+
var A = "https://cdn.jsdelivr.net", j = class extends y {
|
|
277
|
+
$$PROVIDER_TYPE = "DASH";
|
|
278
|
+
#e = null;
|
|
279
|
+
#t = new w(this.video, this.ctx);
|
|
280
|
+
get ctor() {
|
|
281
|
+
return this.#e;
|
|
282
|
+
}
|
|
283
|
+
get instance() {
|
|
284
|
+
return this.#t.instance;
|
|
285
|
+
}
|
|
286
|
+
static supported = l();
|
|
287
|
+
get type() {
|
|
288
|
+
return "dash";
|
|
289
|
+
}
|
|
290
|
+
get canLiveSync() {
|
|
291
|
+
return !0;
|
|
292
|
+
}
|
|
293
|
+
#n = `${A}/npm/dashjs@4.7.4/dist/dash.all.min.js`;
|
|
294
|
+
get config() {
|
|
295
|
+
return this.#t.config;
|
|
296
|
+
}
|
|
297
|
+
set config(e) {
|
|
298
|
+
this.#t.config = e;
|
|
299
|
+
}
|
|
300
|
+
get library() {
|
|
301
|
+
return this.#n;
|
|
302
|
+
}
|
|
303
|
+
set library(e) {
|
|
304
|
+
this.#n = e;
|
|
305
|
+
}
|
|
306
|
+
preconnect() {
|
|
307
|
+
n(this.#n) && p(this.#n);
|
|
308
|
+
}
|
|
309
|
+
setup() {
|
|
310
|
+
super.setup(), new T(this.#n, this.ctx, (e) => {
|
|
311
|
+
this.#e = e, this.#t.setup(e), this.ctx.notify("provider-setup", this);
|
|
312
|
+
let t = r(this.ctx.$state.source);
|
|
313
|
+
t && this.loadSource(t);
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
async loadSource(e, t) {
|
|
317
|
+
if (!n(e.src)) {
|
|
318
|
+
this.removeSource();
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
this.media.preload = t || "", this.appendSource(e, "application/x-mpegurl"), this.#t.loadSource(e), this.currentSrc = e;
|
|
322
|
+
}
|
|
323
|
+
onInstance(e) {
|
|
324
|
+
let t = this.#t.instance;
|
|
325
|
+
return t && e(t), this.#t.onInstance(e);
|
|
326
|
+
}
|
|
327
|
+
destroy() {
|
|
328
|
+
this.#t.destroy();
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
//#endregion
|
|
332
|
+
export { j as DASHProvider };
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import { G as e, H as t, K as n, V as r, h as i, r as a, tt as o, v as s } from "./vidstack-BGSTndAW-CyKM_CM4.js";
|
|
2
|
+
import { a as c, d as l, i as u, n as d, s as f, t as p } from "./vidstack-BQlOPwOu-ChhdffAJ.js";
|
|
3
|
+
import { t as m } from "./vidstack-DqAw8m9J-Dk1GT3Oe.js";
|
|
4
|
+
import { t as h } from "./vidstack-D5EzK014-DOe01V3H.js";
|
|
5
|
+
import { t as g } from "./vidstack-ChQTHmIQ-nTO94M6P.js";
|
|
6
|
+
//#region node_modules/vidstack/prod/providers/vidstack-google-cast.js
|
|
7
|
+
var _ = class {
|
|
8
|
+
#e;
|
|
9
|
+
constructor(e) {
|
|
10
|
+
this.#e = new chrome.cast.media.MediaInfo(e.src, e.type);
|
|
11
|
+
}
|
|
12
|
+
build() {
|
|
13
|
+
return this.#e;
|
|
14
|
+
}
|
|
15
|
+
setStreamType(e) {
|
|
16
|
+
return e.includes("live") ? this.#e.streamType = chrome.cast.media.StreamType.LIVE : this.#e.streamType = chrome.cast.media.StreamType.BUFFERED, this;
|
|
17
|
+
}
|
|
18
|
+
setTracks(e) {
|
|
19
|
+
return this.#e.tracks = e.map(this.#t), this;
|
|
20
|
+
}
|
|
21
|
+
setMetadata(e, t) {
|
|
22
|
+
return this.#e.metadata = new chrome.cast.media.GenericMediaMetadata(), this.#e.metadata.title = e, this.#e.metadata.images = [{ url: t }], this;
|
|
23
|
+
}
|
|
24
|
+
#t(e, t) {
|
|
25
|
+
let n = new chrome.cast.media.Track(t, chrome.cast.media.TrackType.TEXT);
|
|
26
|
+
return n.name = e.label, n.trackContentId = e.src, n.trackContentType = "text/vtt", n.language = e.language, n.subtype = e.kind.toUpperCase(), n;
|
|
27
|
+
}
|
|
28
|
+
}, v = class {
|
|
29
|
+
#e;
|
|
30
|
+
#t;
|
|
31
|
+
#n;
|
|
32
|
+
constructor(e, t, n) {
|
|
33
|
+
this.#e = e, this.#t = t, this.#n = n;
|
|
34
|
+
}
|
|
35
|
+
setup() {
|
|
36
|
+
let e = this.syncRemoteActiveIds.bind(this);
|
|
37
|
+
t(this.#t.audioTracks, "change", e), t(this.#t.textTracks, "mode-change", e), s(this.#o.bind(this));
|
|
38
|
+
}
|
|
39
|
+
getLocalTextTracks() {
|
|
40
|
+
return this.#t.$state.textTracks().filter((e) => e.src && e.type === "vtt");
|
|
41
|
+
}
|
|
42
|
+
#r() {
|
|
43
|
+
return this.#t.$state.audioTracks();
|
|
44
|
+
}
|
|
45
|
+
#i(e) {
|
|
46
|
+
let t = this.#e.mediaInfo?.tracks ?? [];
|
|
47
|
+
return e ? t.filter((t) => t.type === e) : t;
|
|
48
|
+
}
|
|
49
|
+
#a() {
|
|
50
|
+
let e = [], t = this.#r().find((e) => e.selected), n = this.getLocalTextTracks().filter((e) => e.mode === "showing");
|
|
51
|
+
if (t) {
|
|
52
|
+
let n = this.#i(chrome.cast.media.TrackType.AUDIO), r = this.#l(n, t);
|
|
53
|
+
r && e.push(r.trackId);
|
|
54
|
+
}
|
|
55
|
+
if (n?.length) {
|
|
56
|
+
let t = this.#i(chrome.cast.media.TrackType.TEXT);
|
|
57
|
+
if (t.length) for (let r of n) {
|
|
58
|
+
let n = this.#l(t, r);
|
|
59
|
+
n && e.push(n.trackId);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return e;
|
|
63
|
+
}
|
|
64
|
+
#o() {
|
|
65
|
+
let e = this.getLocalTextTracks();
|
|
66
|
+
if (!this.#e.isMediaLoaded) return;
|
|
67
|
+
let t = this.#i(chrome.cast.media.TrackType.TEXT);
|
|
68
|
+
for (let n of e) if (!this.#l(t, n)) {
|
|
69
|
+
o(() => this.#n?.());
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
syncRemoteTracks(e) {
|
|
74
|
+
if (!this.#e.isMediaLoaded) return;
|
|
75
|
+
let t = this.#r(), n = this.getLocalTextTracks(), r = this.#i(chrome.cast.media.TrackType.AUDIO), i = this.#i(chrome.cast.media.TrackType.TEXT);
|
|
76
|
+
for (let n of r) {
|
|
77
|
+
if (this.#c(t, n)) continue;
|
|
78
|
+
let r = {
|
|
79
|
+
id: n.trackId.toString(),
|
|
80
|
+
label: n.name,
|
|
81
|
+
language: n.language,
|
|
82
|
+
kind: n.subtype ?? "main",
|
|
83
|
+
selected: !1
|
|
84
|
+
};
|
|
85
|
+
this.#t.audioTracks[h.add](r, e);
|
|
86
|
+
}
|
|
87
|
+
for (let t of i) {
|
|
88
|
+
if (this.#c(n, t)) continue;
|
|
89
|
+
let r = {
|
|
90
|
+
id: t.trackId.toString(),
|
|
91
|
+
src: t.trackContentId,
|
|
92
|
+
label: t.name,
|
|
93
|
+
language: t.language,
|
|
94
|
+
kind: t.subtype.toLowerCase()
|
|
95
|
+
};
|
|
96
|
+
this.#t.textTracks.add(r, e);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
syncRemoteActiveIds(e) {
|
|
100
|
+
if (!this.#e.isMediaLoaded) return;
|
|
101
|
+
let t = this.#a(), n = new chrome.cast.media.EditTracksInfoRequest(t);
|
|
102
|
+
this.#s(n).catch((e) => {});
|
|
103
|
+
}
|
|
104
|
+
#s(e) {
|
|
105
|
+
let t = c();
|
|
106
|
+
return new Promise((n, r) => t?.editTracksInfo(e, n, r));
|
|
107
|
+
}
|
|
108
|
+
#c(e, t) {
|
|
109
|
+
return e.find((e) => this.#u(e, t));
|
|
110
|
+
}
|
|
111
|
+
#l(e, t) {
|
|
112
|
+
return e.find((e) => this.#u(t, e));
|
|
113
|
+
}
|
|
114
|
+
#u(e, t) {
|
|
115
|
+
return t.name === e.label && t.language === e.language && t.subtype.toLowerCase() === e.kind.toLowerCase();
|
|
116
|
+
}
|
|
117
|
+
}, y = class {
|
|
118
|
+
$$PROVIDER_TYPE = "GOOGLE_CAST";
|
|
119
|
+
scope = i();
|
|
120
|
+
#e;
|
|
121
|
+
#t;
|
|
122
|
+
#n;
|
|
123
|
+
#r = null;
|
|
124
|
+
#i = "disconnected";
|
|
125
|
+
#a = 0;
|
|
126
|
+
#o = 0;
|
|
127
|
+
#s = new g(0, 0);
|
|
128
|
+
#c = new m(this.#v.bind(this));
|
|
129
|
+
#l;
|
|
130
|
+
#u = null;
|
|
131
|
+
#d = !1;
|
|
132
|
+
constructor(e, t) {
|
|
133
|
+
this.#e = e, this.#t = t, this.#n = new v(e, t, this.#I.bind(this));
|
|
134
|
+
}
|
|
135
|
+
get type() {
|
|
136
|
+
return "google-cast";
|
|
137
|
+
}
|
|
138
|
+
get currentSrc() {
|
|
139
|
+
return this.#r;
|
|
140
|
+
}
|
|
141
|
+
get player() {
|
|
142
|
+
return this.#e;
|
|
143
|
+
}
|
|
144
|
+
get cast() {
|
|
145
|
+
return p();
|
|
146
|
+
}
|
|
147
|
+
get session() {
|
|
148
|
+
return u();
|
|
149
|
+
}
|
|
150
|
+
get media() {
|
|
151
|
+
return c();
|
|
152
|
+
}
|
|
153
|
+
get hasActiveSession() {
|
|
154
|
+
return f(this.#r);
|
|
155
|
+
}
|
|
156
|
+
setup() {
|
|
157
|
+
this.#f(), this.#p(), this.#n.setup(), this.#t.notify("provider-setup", this);
|
|
158
|
+
}
|
|
159
|
+
#f() {
|
|
160
|
+
l(cast.framework.CastContextEventType.CAST_STATE_CHANGED, this.#b.bind(this));
|
|
161
|
+
}
|
|
162
|
+
#p() {
|
|
163
|
+
let t = cast.framework.RemotePlayerEventType, n = {
|
|
164
|
+
[t.IS_CONNECTED_CHANGED]: this.#b,
|
|
165
|
+
[t.IS_MEDIA_LOADED_CHANGED]: this.#x,
|
|
166
|
+
[t.CAN_CONTROL_VOLUME_CHANGED]: this.#S,
|
|
167
|
+
[t.CAN_SEEK_CHANGED]: this.#C,
|
|
168
|
+
[t.DURATION_CHANGED]: this.#E,
|
|
169
|
+
[t.IS_MUTED_CHANGED]: this.#D,
|
|
170
|
+
[t.VOLUME_LEVEL_CHANGED]: this.#D,
|
|
171
|
+
[t.IS_PAUSED_CHANGED]: this.#O,
|
|
172
|
+
[t.LIVE_SEEKABLE_RANGE_CHANGED]: this.#k,
|
|
173
|
+
[t.PLAYER_STATE_CHANGED]: this.#A
|
|
174
|
+
};
|
|
175
|
+
this.#l = n;
|
|
176
|
+
let i = this.#y.bind(this);
|
|
177
|
+
for (let e of r(n)) this.#e.controller.addEventListener(e, i);
|
|
178
|
+
e(() => {
|
|
179
|
+
for (let e of r(n)) this.#e.controller.removeEventListener(e, i);
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
async play() {
|
|
183
|
+
if (!(!this.#e.isPaused && !this.#d)) {
|
|
184
|
+
if (this.#d) {
|
|
185
|
+
await this.#F(!1, 0);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
this.#e.controller?.playOrPause();
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
async pause() {
|
|
192
|
+
this.#e.isPaused || this.#e.controller?.playOrPause();
|
|
193
|
+
}
|
|
194
|
+
getMediaStatus(e) {
|
|
195
|
+
return new Promise((t, n) => {
|
|
196
|
+
this.media?.getStatus(e, t, n);
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
setMuted(e) {
|
|
200
|
+
(e && !this.#e.isMuted || !e && this.#e.isMuted) && this.#e.controller?.muteOrUnmute();
|
|
201
|
+
}
|
|
202
|
+
setCurrentTime(e) {
|
|
203
|
+
this.#e.currentTime = e, this.#t.notify("seeking", e), this.#e.controller?.seek();
|
|
204
|
+
}
|
|
205
|
+
setVolume(e) {
|
|
206
|
+
this.#e.volumeLevel = e, this.#e.controller?.setVolumeLevel();
|
|
207
|
+
}
|
|
208
|
+
async loadSource(e) {
|
|
209
|
+
if (this.#u?.src !== e && (this.#u = null), f(e)) {
|
|
210
|
+
this.#h(), this.#r = e;
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
this.#t.notify("load-start");
|
|
214
|
+
let t = this.#P(e), n = await this.session.loadMedia(t);
|
|
215
|
+
if (n) {
|
|
216
|
+
this.#r = null, this.#t.notify("error", Error(d(n)));
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
this.#r = e;
|
|
220
|
+
}
|
|
221
|
+
destroy() {
|
|
222
|
+
this.#m(), this.#g();
|
|
223
|
+
}
|
|
224
|
+
#m() {
|
|
225
|
+
this.#u || (this.#o = 0, this.#s = new g(0, 0)), this.#c.stop(), this.#a = 0, this.#u = null;
|
|
226
|
+
}
|
|
227
|
+
#h() {
|
|
228
|
+
let e = new a("resume-session", { detail: this.session });
|
|
229
|
+
this.#x(e);
|
|
230
|
+
let { muted: t, volume: n, savedState: r } = this.#t.$state, i = r();
|
|
231
|
+
this.setCurrentTime(Math.max(this.#e.currentTime, i?.currentTime ?? 0)), this.setMuted(t()), this.setVolume(n()), i?.paused === !1 && this.play();
|
|
232
|
+
}
|
|
233
|
+
#g() {
|
|
234
|
+
this.cast.endCurrentSession(!0);
|
|
235
|
+
let { remotePlaybackLoader: e } = this.#t.$state;
|
|
236
|
+
e.set(null);
|
|
237
|
+
}
|
|
238
|
+
#_() {
|
|
239
|
+
let { savedState: e } = this.#t.$state;
|
|
240
|
+
e.set({
|
|
241
|
+
paused: this.#e.isPaused,
|
|
242
|
+
currentTime: this.#e.currentTime
|
|
243
|
+
}), this.#g();
|
|
244
|
+
}
|
|
245
|
+
#v() {
|
|
246
|
+
this.#T();
|
|
247
|
+
}
|
|
248
|
+
#y(e) {
|
|
249
|
+
this.#l[e.type].call(this, e);
|
|
250
|
+
}
|
|
251
|
+
#b(e) {
|
|
252
|
+
let t = this.cast.getCastState(), n = t === cast.framework.CastState.CONNECTED ? "connected" : t === cast.framework.CastState.CONNECTING ? "connecting" : "disconnected";
|
|
253
|
+
if (this.#i === n) return;
|
|
254
|
+
let r = {
|
|
255
|
+
type: "google-cast",
|
|
256
|
+
state: n
|
|
257
|
+
}, i = this.#M(e);
|
|
258
|
+
this.#i = n, this.#t.notify("remote-playback-change", r, i), n === "disconnected" && this.#_();
|
|
259
|
+
}
|
|
260
|
+
#x(e) {
|
|
261
|
+
if (!this.#e.isMediaLoaded) return;
|
|
262
|
+
let t = n(this.#t.$state.source);
|
|
263
|
+
Promise.resolve().then(() => {
|
|
264
|
+
if (t !== n(this.#t.$state.source) || !this.#e.isMediaLoaded) return;
|
|
265
|
+
this.#m();
|
|
266
|
+
let r = this.#e.duration;
|
|
267
|
+
this.#s = new g(0, r);
|
|
268
|
+
let i = {
|
|
269
|
+
provider: this,
|
|
270
|
+
duration: r,
|
|
271
|
+
buffered: new g(0, 0),
|
|
272
|
+
seekable: this.#j()
|
|
273
|
+
}, a = this.#M(e);
|
|
274
|
+
this.#t.notify("loaded-metadata", void 0, a), this.#t.notify("loaded-data", void 0, a), this.#t.notify("can-play", i, a), this.#S(), this.#C(e);
|
|
275
|
+
let { volume: o, muted: s } = this.#t.$state;
|
|
276
|
+
this.setVolume(o()), this.setMuted(s()), this.#c.start(), this.#n.syncRemoteTracks(a), this.#n.syncRemoteActiveIds(a);
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
#S() {
|
|
280
|
+
this.#t.$state.canSetVolume.set(this.#e.canControlVolume);
|
|
281
|
+
}
|
|
282
|
+
#C(e) {
|
|
283
|
+
let t = this.#M(e);
|
|
284
|
+
this.#t.notify("stream-type-change", this.#w(), t);
|
|
285
|
+
}
|
|
286
|
+
#w() {
|
|
287
|
+
return this.#e.mediaInfo?.streamType === chrome.cast.media.StreamType.LIVE ? this.#e.canSeek ? "live:dvr" : "live" : "on-demand";
|
|
288
|
+
}
|
|
289
|
+
#T() {
|
|
290
|
+
if (this.#u) return;
|
|
291
|
+
let e = this.#e.currentTime;
|
|
292
|
+
e !== this.#a && (this.#t.notify("time-change", e), e > this.#o && (this.#o = e, this.#k()), this.#t.$state.seeking() && this.#t.notify("seeked", e), this.#a = e);
|
|
293
|
+
}
|
|
294
|
+
#E(e) {
|
|
295
|
+
if (!this.#e.isMediaLoaded || this.#u) return;
|
|
296
|
+
let t = this.#e.duration, n = this.#M(e);
|
|
297
|
+
this.#s = new g(0, t), this.#t.notify("duration-change", t, n);
|
|
298
|
+
}
|
|
299
|
+
#D(e) {
|
|
300
|
+
if (!this.#e.isMediaLoaded) return;
|
|
301
|
+
let t = {
|
|
302
|
+
muted: this.#e.isMuted,
|
|
303
|
+
volume: this.#e.volumeLevel
|
|
304
|
+
}, n = this.#M(e);
|
|
305
|
+
this.#t.notify("volume-change", t, n);
|
|
306
|
+
}
|
|
307
|
+
#O(e) {
|
|
308
|
+
let t = this.#M(e);
|
|
309
|
+
this.#e.isPaused ? this.#t.notify("pause", void 0, t) : this.#t.notify("play", void 0, t);
|
|
310
|
+
}
|
|
311
|
+
#k(e) {
|
|
312
|
+
let t = {
|
|
313
|
+
seekable: this.#j(),
|
|
314
|
+
buffered: new g(0, this.#o)
|
|
315
|
+
}, n = e ? this.#M(e) : void 0;
|
|
316
|
+
this.#t.notify("progress", t, n);
|
|
317
|
+
}
|
|
318
|
+
#A(e) {
|
|
319
|
+
let t = this.#e.playerState, n = chrome.cast.media.PlayerState;
|
|
320
|
+
if (this.#d = t === n.IDLE, t === n.PAUSED) return;
|
|
321
|
+
let r = this.#M(e);
|
|
322
|
+
switch (t) {
|
|
323
|
+
case n.PLAYING:
|
|
324
|
+
this.#t.notify("playing", void 0, r);
|
|
325
|
+
break;
|
|
326
|
+
case n.BUFFERING:
|
|
327
|
+
this.#t.notify("waiting", void 0, r);
|
|
328
|
+
break;
|
|
329
|
+
case n.IDLE:
|
|
330
|
+
this.#c.stop(), this.#t.notify("pause"), this.#t.notify("end");
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
#j() {
|
|
335
|
+
return this.#e.liveSeekableRange ? new g(this.#e.liveSeekableRange.start, this.#e.liveSeekableRange.end) : this.#s;
|
|
336
|
+
}
|
|
337
|
+
#M(e) {
|
|
338
|
+
return e instanceof Event ? e : new a(e.type, { detail: e });
|
|
339
|
+
}
|
|
340
|
+
#N(e) {
|
|
341
|
+
let { streamType: t, title: n, poster: r } = this.#t.$state;
|
|
342
|
+
return new _(e).setMetadata(n(), r()).setStreamType(t()).setTracks(this.#n.getLocalTextTracks()).build();
|
|
343
|
+
}
|
|
344
|
+
#P(e) {
|
|
345
|
+
let t = this.#N(e), n = new chrome.cast.media.LoadRequest(t), r = this.#t.$state.savedState();
|
|
346
|
+
return n.autoplay = (this.#u?.paused ?? r?.paused) === !1, n.currentTime = this.#u?.time ?? r?.currentTime ?? 0, n;
|
|
347
|
+
}
|
|
348
|
+
async #F(e, t) {
|
|
349
|
+
let r = n(this.#t.$state.source);
|
|
350
|
+
this.#u = {
|
|
351
|
+
src: r,
|
|
352
|
+
paused: e,
|
|
353
|
+
time: t
|
|
354
|
+
}, await this.loadSource(r);
|
|
355
|
+
}
|
|
356
|
+
#I() {
|
|
357
|
+
this.#F(this.#e.isPaused, this.#e.currentTime).catch((e) => {});
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
//#endregion
|
|
361
|
+
export { y as GoogleCastProvider };
|