@vindral/web-sdk 4.2.0-3-g8556e878 → 4.2.0-30-ga903ef89
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/B5bZayjf.js +208 -0
- package/B7hT-BKr.js +32 -0
- package/BdFcdkj1.js +143 -0
- package/BsfwXDui.js +65 -0
- package/Bt-ONXfO.js +59 -0
- package/C01DcfYu.js +118 -0
- package/CpxUFfbm.js +223 -0
- package/Cug44nXk.js +149 -0
- package/DDyRtLW6.js +1761 -0
- package/Ddby8xU_.js +18624 -0
- package/De8D3gGg.js +268 -0
- package/DrWNJwZx.js +35 -0
- package/FYiEDBC4.js +50 -0
- package/QPIJgvaR.js +11277 -0
- package/RxoWWyzp.js +25 -0
- package/api-client.d.ts +2 -2
- package/api-client.js +2 -4
- package/cast-sender.d.ts +6 -6
- package/cast-sender.js +2 -230
- package/core.d.ts +31 -23
- package/core.js +3 -13
- package/iAXSTx_B.js +4361 -0
- package/legacy.d.ts +40 -32
- package/legacy.es.js +13439 -15260
- package/legacy.umd.js +1176 -15
- package/package.json +1 -1
- package/player.d.ts +56 -40
- package/player.js +4 -5476
- package/react.d.ts +49 -41
- package/react.js +0 -1
- package/vindral-player-component.js +5 -2
- package/zW8mAbQp.js +166 -0
- package/BRgIGU_Y.js +0 -232
- package/BzumD0lc.js +0 -206
- package/CuhQLT-7.js +0 -254
- package/DGo74EDo.js +0 -59
- package/DKTZWEmJ.js +0 -13182
- package/DUcIP7Nf.js +0 -312
- package/h5LA1Y1W.js +0 -21750
package/B5bZayjf.js
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { n as e, t } from "./BsfwXDui.js";
|
|
2
|
+
import { t as n } from "./RxoWWyzp.js";
|
|
3
|
+
//#region ../../libs/utils/src/assert.ts
|
|
4
|
+
function r(e, t) {
|
|
5
|
+
if (!e) throw Error(t);
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region ../../libs/utils/src/tryJsonParse.ts
|
|
9
|
+
var i = (e) => {
|
|
10
|
+
try {
|
|
11
|
+
return JSON.parse(e);
|
|
12
|
+
} catch (e) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
}, a = (e) => {
|
|
16
|
+
switch (e) {
|
|
17
|
+
case "h264":
|
|
18
|
+
case "av1": return "video";
|
|
19
|
+
case "aac":
|
|
20
|
+
case "opus":
|
|
21
|
+
case "mp3": return "audio";
|
|
22
|
+
case "webvtt": return "text";
|
|
23
|
+
default: throw Error("Unknown codec");
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
function o(e) {
|
|
27
|
+
if (e.startsWith("opus")) return "opus";
|
|
28
|
+
if (e.startsWith("mp4a")) return "aac";
|
|
29
|
+
if (e.startsWith("avc1")) return "h264";
|
|
30
|
+
if (e.startsWith("av01")) return "av1";
|
|
31
|
+
if (e.startsWith("webvtt")) return "webvtt";
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region ../../libs/data-types/src/ConnectInfo.ts
|
|
35
|
+
function s(e) {
|
|
36
|
+
return !(typeof e.edges[0] == "string" || e.channels[0] && !("catalog" in e.channels[0]));
|
|
37
|
+
}
|
|
38
|
+
function c(e) {
|
|
39
|
+
return e.tracks.filter((e) => !!e.codec).filter((e) => o(e.codec || "")).map((e, t) => {
|
|
40
|
+
let n = e.codec, i = e.bitrate;
|
|
41
|
+
r(n, "codec is required"), r(i !== void 0, "bitrate is required");
|
|
42
|
+
let s = o(n);
|
|
43
|
+
if (r(s, "codec is required"), a(s) === "audio") {
|
|
44
|
+
let r = e.samplerate || 0;
|
|
45
|
+
return {
|
|
46
|
+
track: e,
|
|
47
|
+
id: t,
|
|
48
|
+
codec: s,
|
|
49
|
+
codecString: n,
|
|
50
|
+
bitRate: i,
|
|
51
|
+
channels: e.channelConfig === "stereo" ? 2 : 1,
|
|
52
|
+
sampleRate: r,
|
|
53
|
+
language: e.language
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return a(s) === "text" ? {
|
|
57
|
+
track: e,
|
|
58
|
+
id: t,
|
|
59
|
+
bitRate: 0,
|
|
60
|
+
codec: s,
|
|
61
|
+
kind: "subtitles",
|
|
62
|
+
codecString: n,
|
|
63
|
+
label: e.label,
|
|
64
|
+
language: e.language
|
|
65
|
+
} : (r(e.width, "width is required"), r(e.height, "width is required"), r(e.framerate, "framerate is required"), {
|
|
66
|
+
track: e,
|
|
67
|
+
id: t,
|
|
68
|
+
codec: s,
|
|
69
|
+
bitRate: i,
|
|
70
|
+
codecString: n,
|
|
71
|
+
width: e.width,
|
|
72
|
+
height: e.height,
|
|
73
|
+
frameRate: e.framerate
|
|
74
|
+
});
|
|
75
|
+
}).sort((e, t) => e.bitRate - t.bitRate);
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region ../../libs/api-client/src/auth.ts
|
|
79
|
+
var l = (e) => e ? { Authorization: `Bearer ${e}` } : void 0, u = (e, t) => {
|
|
80
|
+
try {
|
|
81
|
+
let t = e.ancestorOrigins;
|
|
82
|
+
if (t && t.length > 0) return Array.from(t).join(",") || void 0;
|
|
83
|
+
} catch (e) {}
|
|
84
|
+
try {
|
|
85
|
+
if (t.referrer) return new URL(t.referrer).origin || void 0;
|
|
86
|
+
} catch (e) {}
|
|
87
|
+
}, d = (e) => typeof e == "object" && !!e && "message" in e, f = class extends Error {
|
|
88
|
+
constructor({ status: t, url: n, body: r }) {
|
|
89
|
+
let a = i(r), o = d(a) ? a.message : `Url ${n.toString()}, Status code: ${t}, Body: ${r}`;
|
|
90
|
+
super(o), e(this, "status", void 0), e(this, "body", void 0), e(this, "url", void 0), this.status = t, this.body = r, this.url = n, Object.setPrototypeOf(this, new.target.prototype);
|
|
91
|
+
}
|
|
92
|
+
}, p = (e) => typeof e.status == "number", m = () => {
|
|
93
|
+
if (!(typeof window > "u" || typeof document > "u")) return u(window.location, document);
|
|
94
|
+
}, h = (e) => {
|
|
95
|
+
let t = m();
|
|
96
|
+
if (!t || e.searchParams.has("parentOrigin")) return e;
|
|
97
|
+
let n = new URL(e.toString());
|
|
98
|
+
return n.searchParams.append("parentOrigin", t), n;
|
|
99
|
+
}, g = function() {
|
|
100
|
+
var e = t(function* (e, t) {
|
|
101
|
+
let r = h(e), i = yield fetch(r.toString(), n({ mode: "cors" }, t));
|
|
102
|
+
if (!i.ok) throw new f({
|
|
103
|
+
status: i.status,
|
|
104
|
+
url: r,
|
|
105
|
+
body: yield i.text()
|
|
106
|
+
});
|
|
107
|
+
return i;
|
|
108
|
+
});
|
|
109
|
+
return function(t, n) {
|
|
110
|
+
return e.apply(this, arguments);
|
|
111
|
+
};
|
|
112
|
+
}(), _ = function() {
|
|
113
|
+
var e = t(function* (e, t) {
|
|
114
|
+
return yield (yield g(e, n({}, t))).json();
|
|
115
|
+
});
|
|
116
|
+
return function(t, n) {
|
|
117
|
+
return e.apply(this, arguments);
|
|
118
|
+
};
|
|
119
|
+
}();
|
|
120
|
+
(function() {
|
|
121
|
+
var e = t(function* (e) {
|
|
122
|
+
return g(e);
|
|
123
|
+
});
|
|
124
|
+
return function(t) {
|
|
125
|
+
return e.apply(this, arguments);
|
|
126
|
+
};
|
|
127
|
+
})();
|
|
128
|
+
var v = function() {
|
|
129
|
+
var e = t(function* (e, t) {
|
|
130
|
+
return g(e, n({ method: "POST" }, t));
|
|
131
|
+
});
|
|
132
|
+
return function(t, n) {
|
|
133
|
+
return e.apply(this, arguments);
|
|
134
|
+
};
|
|
135
|
+
}();
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region ../../libs/api-client/src/responses/connect.ts
|
|
138
|
+
function y(e) {
|
|
139
|
+
var t;
|
|
140
|
+
return !(typeof e.edges[0] == "string" || e.channels[0] && "catalog" in e.channels[0] && ((t = e.channels[0]) == null ? void 0 : t.catalog) === void 0);
|
|
141
|
+
}
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region ../../libs/api-client/src/client.ts
|
|
144
|
+
var b = {
|
|
145
|
+
lbConnect: (e) => e.channelGroupId ? `connect?channelId=${e.channelId}&channelGroupId=${e.channelGroupId}` : `connect?channelId=${e.channelId}`,
|
|
146
|
+
thumbnails: (e, t) => t ? e.channelGroupId ? `thumbnail/?channelGroupId=${e.channelGroupId}&auth.token=${t}&auth.type=jwt` : e.channelId ? `thumbnail/?channelId=${e.channelId}&auth.token=${t}&auth.type=jwt` : "thumbnail" : "thumbnail"
|
|
147
|
+
}, x = class {
|
|
148
|
+
constructor(t) {
|
|
149
|
+
e(this, "baseUrl", void 0), e(this, "tokenFactory", void 0), this.baseUrl = new URL("/api/v4/", t.publicEndpoint).toString(), this.tokenFactory = t.tokenFactory;
|
|
150
|
+
}
|
|
151
|
+
connect(e) {
|
|
152
|
+
var r = this;
|
|
153
|
+
return t(function* () {
|
|
154
|
+
let { channelId: t, channelGroupId: i } = e, a = {
|
|
155
|
+
channelId: t,
|
|
156
|
+
channelGroupId: i
|
|
157
|
+
}, o = new URL(b.lbConnect(e), r.baseUrl), s = r.getAuthToken(a), l = yield _(o, { headers: r.getHeaders(s) });
|
|
158
|
+
if (y(l)) {
|
|
159
|
+
let e = l.channels.map((e) => {
|
|
160
|
+
let t = r.toChannel(e, a), i = c(e.catalog);
|
|
161
|
+
return n(n(n({}, e), t), {}, { renditions: i });
|
|
162
|
+
});
|
|
163
|
+
return n(n({}, l), {}, { channels: e });
|
|
164
|
+
} else {
|
|
165
|
+
let e = l.channels.map((e) => {
|
|
166
|
+
let t = r.toChannel(e, a);
|
|
167
|
+
return n(n({}, e), t);
|
|
168
|
+
});
|
|
169
|
+
return n(n({}, l), {}, { channels: e });
|
|
170
|
+
}
|
|
171
|
+
})();
|
|
172
|
+
}
|
|
173
|
+
getChannel(e) {
|
|
174
|
+
var n = this;
|
|
175
|
+
return t(function* () {
|
|
176
|
+
let t = { channelId: e }, r = new URL(`channel/${e}`, n.baseUrl), i = n.getAuthToken(t), a = yield _(r, { headers: n.getHeaders(i) });
|
|
177
|
+
return n.toChannel(a, t, i);
|
|
178
|
+
})();
|
|
179
|
+
}
|
|
180
|
+
getChannels(e) {
|
|
181
|
+
var n = this;
|
|
182
|
+
return t(function* () {
|
|
183
|
+
let t = { channelGroupId: e }, r = new URL(`channels/${e}`, n.baseUrl), i = n.getAuthToken(t), a = yield _(r, { headers: n.getHeaders(i) }), o = Array.isArray(a) ? a : a.channels;
|
|
184
|
+
return n.toChannels(o, t, i);
|
|
185
|
+
})();
|
|
186
|
+
}
|
|
187
|
+
getHeaders(e) {
|
|
188
|
+
var t;
|
|
189
|
+
return (t = l(e)) == null ? {} : t;
|
|
190
|
+
}
|
|
191
|
+
getAuthToken(e) {
|
|
192
|
+
return this.tokenFactory ? this.tokenFactory(e) : void 0;
|
|
193
|
+
}
|
|
194
|
+
toChannels(e, t, n) {
|
|
195
|
+
return e.map((e) => this.toChannel(e, t, n));
|
|
196
|
+
}
|
|
197
|
+
toChannel(e, t, n) {
|
|
198
|
+
let { baseUrl: r, sizes: i } = e.thumbnail, a = r || new URL(b.thumbnails(t, n), this.baseUrl), o = i.map((r) => new URL(`?channelId=${e.channelId}&width=${r.width}&height=${r.height}${S(t, n)}`, a).toString());
|
|
199
|
+
return {
|
|
200
|
+
channelId: e.channelId,
|
|
201
|
+
name: e.name,
|
|
202
|
+
isLive: e.isLive,
|
|
203
|
+
thumbnailUrls: o
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
}, S = (e, t) => t ? e.channelGroupId ? `&channelGroupId=${e.channelGroupId}&auth.token=${t}&auth.type=jwt` : `&auth.token=${t}&auth.type=jwt` : "";
|
|
207
|
+
//#endregion
|
|
208
|
+
export { s as a, i as c, c as i, r as l, p as n, o, v as r, a as s, x as t };
|
package/B7hT-BKr.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/checkPrivateRedeclaration.js
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
|
|
4
|
+
}
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/classPrivateFieldInitSpec.js
|
|
7
|
+
function t(t, n, r) {
|
|
8
|
+
e(t, n), n.set(t, r);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/assertClassBrand.js
|
|
12
|
+
function n(e, t, n) {
|
|
13
|
+
if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
14
|
+
throw TypeError("Private element is not present on this object");
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/classPrivateFieldSet2.js
|
|
18
|
+
function r(e, t, r) {
|
|
19
|
+
return e.set(n(e, t), r), r;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/classPrivateFieldGet2.js
|
|
23
|
+
function i(e, t) {
|
|
24
|
+
return e.get(n(e, t));
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/classPrivateMethodInitSpec.js
|
|
28
|
+
function a(t, n) {
|
|
29
|
+
e(t, n), n.add(t);
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { t as a, n as i, i as n, r, a as t };
|
package/BdFcdkj1.js
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { n as e, t } from "./BsfwXDui.js";
|
|
2
|
+
import { t as n } from "./FYiEDBC4.js";
|
|
3
|
+
//#region ../../libs/cast-sender/src/CastSender.ts
|
|
4
|
+
var r = class extends n {
|
|
5
|
+
constructor(n) {
|
|
6
|
+
var r;
|
|
7
|
+
super(), r = this, e(this, "state", "not casting"), e(this, "config", void 0), e(this, "unloaded", !1), e(this, "updateAuthenticationToken", (e) => {
|
|
8
|
+
this.config && (this.config.options.authenticationToken = e, this.send({
|
|
9
|
+
type: "updateAuthToken",
|
|
10
|
+
token: e
|
|
11
|
+
}));
|
|
12
|
+
}), e(this, "unload", () => {
|
|
13
|
+
var e;
|
|
14
|
+
this.unloaded = !0, (e = this.getSession()) == null || e.removeMessageListener("urn:x-cast:com.vindral.castdata", this.onMessage);
|
|
15
|
+
}), e(this, "init", t(function* () {
|
|
16
|
+
return new Promise((e, t) => {
|
|
17
|
+
let n = !1, i = setTimeout(() => {
|
|
18
|
+
n = !0, t();
|
|
19
|
+
}, 1e4);
|
|
20
|
+
window.__onGCastApiAvailable = (a) => {
|
|
21
|
+
if (n) {
|
|
22
|
+
n = !1;
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (clearTimeout(i), !a) return t();
|
|
26
|
+
setTimeout(() => {
|
|
27
|
+
try {
|
|
28
|
+
r.onGCastApiAvailable(), e();
|
|
29
|
+
} catch (e) {
|
|
30
|
+
t();
|
|
31
|
+
}
|
|
32
|
+
}, 1e3);
|
|
33
|
+
}, r.castLibrariesAdded() && window.cast ? window.__onGCastApiAvailable(!0) : r.verifyCastLibraries();
|
|
34
|
+
});
|
|
35
|
+
})), e(this, "start", t(function* () {
|
|
36
|
+
var e;
|
|
37
|
+
yield (e = r.getInstance()) == null ? void 0 : e.requestSession();
|
|
38
|
+
})), e(this, "stop", () => {
|
|
39
|
+
var e;
|
|
40
|
+
(e = this.getSession()) == null || e.endSession(!0);
|
|
41
|
+
}), e(this, "getReceiverName", () => {
|
|
42
|
+
var e;
|
|
43
|
+
return ((e = this.getSession()) == null || (e = e.getCastDevice()) == null ? void 0 : e.friendlyName) || void 0;
|
|
44
|
+
}), e(this, "onGCastApiAvailable", () => {
|
|
45
|
+
var e;
|
|
46
|
+
let t = this.getInstance();
|
|
47
|
+
if (!t) throw "cast context should exist";
|
|
48
|
+
let n = t.getSessionState(), r = ((e = this.config) == null ? void 0 : e.receiverApplicationId) || "A5452297";
|
|
49
|
+
t.setOptions({
|
|
50
|
+
receiverApplicationId: r,
|
|
51
|
+
autoJoinPolicy: chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED,
|
|
52
|
+
resumeSavedSession: !0
|
|
53
|
+
}), t.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED, this.onSessionStateChanged), n === cast.framework.SessionState.SESSION_STARTED && setTimeout(() => {
|
|
54
|
+
this.state = "casting", this.emit("resumed");
|
|
55
|
+
});
|
|
56
|
+
}), e(this, "send", (e) => {
|
|
57
|
+
var t;
|
|
58
|
+
(t = this.getSession()) == null || t.sendMessage("urn:x-cast:com.vindral.castdata", e);
|
|
59
|
+
}), e(this, "onMessage", (e, t) => {
|
|
60
|
+
if (e === "urn:x-cast:com.vindral.castdata") try {
|
|
61
|
+
let e = JSON.parse(t);
|
|
62
|
+
switch (e.type) {
|
|
63
|
+
case "metadata":
|
|
64
|
+
this.emit("metadata", e.metadata);
|
|
65
|
+
break;
|
|
66
|
+
case "serverWallclockTime":
|
|
67
|
+
this.emit("server wallclock time", e.serverWallclockTime);
|
|
68
|
+
break;
|
|
69
|
+
default: break;
|
|
70
|
+
}
|
|
71
|
+
} catch (e) {}
|
|
72
|
+
}), e(this, "onSessionStarted", () => {
|
|
73
|
+
var e;
|
|
74
|
+
(e = this.getSession()) == null || e.addMessageListener("urn:x-cast:com.vindral.castdata", this.onMessage), this.send({
|
|
75
|
+
type: "start",
|
|
76
|
+
config: this.config
|
|
77
|
+
});
|
|
78
|
+
}), e(this, "onSessionStateChanged", (e) => {
|
|
79
|
+
if (!this.unloaded) switch (e.sessionState) {
|
|
80
|
+
case cast.framework.SessionState.SESSION_START_FAILED:
|
|
81
|
+
this.state = "not casting", this.emit("failed");
|
|
82
|
+
break;
|
|
83
|
+
case cast.framework.SessionState.SESSION_ENDED:
|
|
84
|
+
this.state = "not casting", this.emit("disconnected");
|
|
85
|
+
break;
|
|
86
|
+
case cast.framework.SessionState.SESSION_ENDING: break;
|
|
87
|
+
case cast.framework.SessionState.SESSION_RESUMED:
|
|
88
|
+
this.onSessionStarted(), this.state = "casting", this.emit("resumed");
|
|
89
|
+
break;
|
|
90
|
+
case cast.framework.SessionState.SESSION_STARTED:
|
|
91
|
+
this.onSessionStarted(), this.state = "casting", this.emit("connected");
|
|
92
|
+
break;
|
|
93
|
+
case cast.framework.SessionState.SESSION_STARTING: break;
|
|
94
|
+
default: break;
|
|
95
|
+
}
|
|
96
|
+
}), e(this, "getInstance", () => {
|
|
97
|
+
var e;
|
|
98
|
+
return (e = window.cast) == null ? void 0 : e.framework.CastContext.getInstance();
|
|
99
|
+
}), e(this, "getSession", () => {
|
|
100
|
+
var e;
|
|
101
|
+
return (e = this.getInstance()) == null ? void 0 : e.getCurrentSession();
|
|
102
|
+
}), e(this, "castLibrariesAdded", () => !!(document.querySelector("#vindralCastFrameworkLib") && document.querySelector("#vindralCastSenderLib"))), e(this, "verifyCastLibraries", () => {
|
|
103
|
+
if (this.castLibrariesAdded()) return;
|
|
104
|
+
let e = document.createElement("script");
|
|
105
|
+
e.type = "text/javascript", e.id = "vindralCastFrameworkLib", e.src = "//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js", document.head.appendChild(e);
|
|
106
|
+
let t = document.createElement("script");
|
|
107
|
+
t.type = "text/javascript", t.id = "vindralCastSenderLib", t.src = "//www.gstatic.com/cv/js/sender/v1/cast_sender.js", document.head.appendChild(t);
|
|
108
|
+
}), this.config = n;
|
|
109
|
+
}
|
|
110
|
+
get casting() {
|
|
111
|
+
return this.state === "casting";
|
|
112
|
+
}
|
|
113
|
+
get volume() {
|
|
114
|
+
var e, t;
|
|
115
|
+
return (e = (t = this.getSession()) == null ? void 0 : t.getVolume()) == null ? 0 : e;
|
|
116
|
+
}
|
|
117
|
+
set volume(e) {
|
|
118
|
+
var t;
|
|
119
|
+
(t = this.getSession()) == null || t.setVolume(e);
|
|
120
|
+
}
|
|
121
|
+
get language() {
|
|
122
|
+
var e;
|
|
123
|
+
return (e = this.config) == null || (e = e.options) == null ? void 0 : e.language;
|
|
124
|
+
}
|
|
125
|
+
set language(e) {
|
|
126
|
+
this.config && (this.config.options.language = e, this.send({
|
|
127
|
+
type: "setLanguage",
|
|
128
|
+
language: e
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
get channelId() {
|
|
132
|
+
var e;
|
|
133
|
+
return ((e = this.config) == null ? void 0 : e.options.channelId) || "";
|
|
134
|
+
}
|
|
135
|
+
set channelId(e) {
|
|
136
|
+
this.config && (this.config.options.channelId = e, this.send({
|
|
137
|
+
type: "setChannelId",
|
|
138
|
+
channelId: e
|
|
139
|
+
}));
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
//#endregion
|
|
143
|
+
export { r as t };
|
package/BsfwXDui.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/typeof.js
|
|
2
|
+
function e(t) {
|
|
3
|
+
"@babel/helpers - typeof";
|
|
4
|
+
return e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
5
|
+
return typeof e;
|
|
6
|
+
} : function(e) {
|
|
7
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
8
|
+
}, e(t);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/toPrimitive.js
|
|
12
|
+
function t(t, n) {
|
|
13
|
+
if (e(t) != "object" || !t) return t;
|
|
14
|
+
var r = t[Symbol.toPrimitive];
|
|
15
|
+
if (r !== void 0) {
|
|
16
|
+
var i = r.call(t, n || "default");
|
|
17
|
+
if (e(i) != "object") return i;
|
|
18
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
19
|
+
}
|
|
20
|
+
return (n === "string" ? String : Number)(t);
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/toPropertyKey.js
|
|
24
|
+
function n(n) {
|
|
25
|
+
var r = t(n, "string");
|
|
26
|
+
return e(r) == "symbol" ? r : r + "";
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/defineProperty.js
|
|
30
|
+
function r(e, t, r) {
|
|
31
|
+
return (t = n(t)) in e ? Object.defineProperty(e, t, {
|
|
32
|
+
value: r,
|
|
33
|
+
enumerable: !0,
|
|
34
|
+
configurable: !0,
|
|
35
|
+
writable: !0
|
|
36
|
+
}) : e[t] = r, e;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/asyncToGenerator.js
|
|
40
|
+
function i(e, t, n, r, i, a, o) {
|
|
41
|
+
try {
|
|
42
|
+
var s = e[a](o), c = s.value;
|
|
43
|
+
} catch (e) {
|
|
44
|
+
n(e);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
s.done ? t(c) : Promise.resolve(c).then(r, i);
|
|
48
|
+
}
|
|
49
|
+
function a(e) {
|
|
50
|
+
return function() {
|
|
51
|
+
var t = this, n = arguments;
|
|
52
|
+
return new Promise(function(r, a) {
|
|
53
|
+
var o = e.apply(t, n);
|
|
54
|
+
function s(e) {
|
|
55
|
+
i(o, r, a, s, c, "next", e);
|
|
56
|
+
}
|
|
57
|
+
function c(e) {
|
|
58
|
+
i(o, r, a, s, c, "throw", e);
|
|
59
|
+
}
|
|
60
|
+
s(void 0);
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { r as n, a as t };
|
package/Bt-ONXfO.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//#region ../../libs/media/src/aac.ts
|
|
2
|
+
var e = [
|
|
3
|
+
96e3,
|
|
4
|
+
88200,
|
|
5
|
+
64e3,
|
|
6
|
+
48e3,
|
|
7
|
+
44100,
|
|
8
|
+
32e3,
|
|
9
|
+
24e3,
|
|
10
|
+
22050,
|
|
11
|
+
16e3,
|
|
12
|
+
12e3,
|
|
13
|
+
11025,
|
|
14
|
+
8e3,
|
|
15
|
+
7350
|
|
16
|
+
], t = (t, n) => {
|
|
17
|
+
let r = e.indexOf(n);
|
|
18
|
+
if (r === -1 || t < 1 || t > 8 || t === 7) return;
|
|
19
|
+
let i = /* @__PURE__ */ new ArrayBuffer(2), a = new Uint8Array(i), o = t === 8 ? 7 : t;
|
|
20
|
+
return a[0] = 16 | r >> 1, a[1] = (r & 1) << 7 | o << 3, i;
|
|
21
|
+
}, n = (e) => {
|
|
22
|
+
if (!e) return;
|
|
23
|
+
let t = e.channelMappingTable, n = new Uint8Array(19 + t.byteLength), r = new DataView(n.buffer, n.byteOffset, n.byteLength);
|
|
24
|
+
return n.set([
|
|
25
|
+
79,
|
|
26
|
+
112,
|
|
27
|
+
117,
|
|
28
|
+
115,
|
|
29
|
+
72,
|
|
30
|
+
101,
|
|
31
|
+
97,
|
|
32
|
+
100
|
|
33
|
+
], 0), r.setUint8(8, 1), r.setUint8(9, e.channelCount), r.setUint16(10, e.preSkip, !0), r.setUint32(12, e.inputSampleRate, !0), r.setInt16(16, e.outputGain, !0), r.setUint8(18, e.channelMappingFamily), t.byteLength > 0 && n.set(t, 19), n;
|
|
34
|
+
}, r = (e, t) => {
|
|
35
|
+
if (e < 1 || e > 2) return;
|
|
36
|
+
let n = new Uint8Array(19), r = new DataView(n.buffer, n.byteOffset, n.byteLength);
|
|
37
|
+
return n.set([
|
|
38
|
+
79,
|
|
39
|
+
112,
|
|
40
|
+
117,
|
|
41
|
+
115,
|
|
42
|
+
72,
|
|
43
|
+
101,
|
|
44
|
+
97,
|
|
45
|
+
100
|
|
46
|
+
]), r.setUint8(8, 1), r.setUint8(9, e), r.setUint16(10, 3840, !0), r.setUint32(12, t, !0), r.setInt16(16, 0, !0), r.setUint8(18, 0), n;
|
|
47
|
+
}, i = (e) => {
|
|
48
|
+
switch (e) {
|
|
49
|
+
case "opus": return "opus";
|
|
50
|
+
case "aac": return "mp4a.40.2";
|
|
51
|
+
case "mp3": return "mp3";
|
|
52
|
+
default: {
|
|
53
|
+
let t = e;
|
|
54
|
+
throw Error(`Unsupported audio codec: ${t}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
59
|
+
export { t as i, r as n, n as r, i as t };
|
package/C01DcfYu.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { n as e } from "./BsfwXDui.js";
|
|
2
|
+
import { t } from "./RxoWWyzp.js";
|
|
3
|
+
//#region ../../libs/utils/src/noop.ts
|
|
4
|
+
var n = () => {}, r = "connection_failed", i = "connection_failed_will_not_attempt_again", a = "authentication_error", o = "authentication_expired", s = "channel_not_found", c = "no_incoming_data_error", l = "connection_inactivity", u = "missing_init_segment", d = "no_track_context", f = "invalid_track_context_state", p = "disconnected_by_edge", m = "decoder_error", h = "audio_player_error", g = "unsupported_audio_codec", _ = "media_source_error", v = "webgl_context_lost_error", y = "access_forbidden", b = "channel_switch_failed", x = "drm_error", S = class extends Error {
|
|
5
|
+
constructor(n, r, i = {}) {
|
|
6
|
+
super(n), e(this, "props", void 0), e(this, "extra", {}), e(this, "code", () => this.props.code), e(this, "isFatal", () => this.props.isFatal), e(this, "source", () => this.props.source), e(this, "type", () => {
|
|
7
|
+
var e;
|
|
8
|
+
return (e = this.props.type) == null ? "external" : e;
|
|
9
|
+
}), e(this, "toStringifiable", () => {
|
|
10
|
+
var e;
|
|
11
|
+
let n = this.source(), r = n instanceof Error ? n.stack : this.stack;
|
|
12
|
+
return t(t({}, this.extra), {}, {
|
|
13
|
+
code: this.props.code,
|
|
14
|
+
isFatal: this.props.isFatal,
|
|
15
|
+
type: this.props.type,
|
|
16
|
+
message: this.message,
|
|
17
|
+
sourceMessage: (e = this.source()) == null ? void 0 : e.message,
|
|
18
|
+
stack: r
|
|
19
|
+
});
|
|
20
|
+
}), this.props = r, this.extra = i, Object.setPrototypeOf(this, new.target.prototype);
|
|
21
|
+
}
|
|
22
|
+
}, C = (e, t) => new S("MediaElement Error", {
|
|
23
|
+
isFatal: e,
|
|
24
|
+
code: "media_element_error",
|
|
25
|
+
source: t
|
|
26
|
+
}, { mediaErrorCode: t.code }), w = (e, t) => new S("Decoder Error", {
|
|
27
|
+
isFatal: e,
|
|
28
|
+
code: m,
|
|
29
|
+
source: t,
|
|
30
|
+
type: "internal"
|
|
31
|
+
}), T = (e, t, n) => new S(`No decoder available for audio codec "${e}" in non-MSE playback. ${t}`, {
|
|
32
|
+
isFatal: !0,
|
|
33
|
+
code: g,
|
|
34
|
+
source: n,
|
|
35
|
+
type: "external"
|
|
36
|
+
}, {
|
|
37
|
+
codec: e,
|
|
38
|
+
reason: t
|
|
39
|
+
}), E = (e, t) => new S("Audio Player Error", {
|
|
40
|
+
isFatal: e,
|
|
41
|
+
code: h,
|
|
42
|
+
source: t,
|
|
43
|
+
type: "internal"
|
|
44
|
+
}), D = (e, t) => new S(`No init segment for rendition id ${e} for channel ${t}`, {
|
|
45
|
+
isFatal: !1,
|
|
46
|
+
code: u,
|
|
47
|
+
type: "internal"
|
|
48
|
+
}), O = (e, t, n, r) => new S("MediaSource Error", {
|
|
49
|
+
isFatal: e,
|
|
50
|
+
code: _,
|
|
51
|
+
source: t,
|
|
52
|
+
type: "internal"
|
|
53
|
+
}, {
|
|
54
|
+
type: r,
|
|
55
|
+
consecutiveErrorsCount: n
|
|
56
|
+
}), k = (e, t) => new S(`No track context for ${e}${t ? `, rendition id ${t}` : ""}`, {
|
|
57
|
+
isFatal: !1,
|
|
58
|
+
code: d,
|
|
59
|
+
type: "internal"
|
|
60
|
+
}), A = (e, t) => new S(`Track context is in an invalid state for ${e}${t ? `, rendition id ${t}` : ""}`, {
|
|
61
|
+
isFatal: !1,
|
|
62
|
+
code: f,
|
|
63
|
+
type: "internal"
|
|
64
|
+
}), j = () => new S("Web Audio Context resume timeout", {
|
|
65
|
+
isFatal: !1,
|
|
66
|
+
code: "web_audio_context_resume_timeout"
|
|
67
|
+
}), M = (e) => new S("Disconnected From Edge Server", {
|
|
68
|
+
type: "external",
|
|
69
|
+
source: e,
|
|
70
|
+
isFatal: !1,
|
|
71
|
+
code: p
|
|
72
|
+
}), N = (e) => new S("Authentication Failed", {
|
|
73
|
+
isFatal: !0,
|
|
74
|
+
code: a,
|
|
75
|
+
source: e
|
|
76
|
+
}), P = (e) => new S("Authentication Expired", {
|
|
77
|
+
isFatal: !0,
|
|
78
|
+
code: o,
|
|
79
|
+
source: e
|
|
80
|
+
}), F = (e, t) => new S("Connection closed due to inactivity", {
|
|
81
|
+
isFatal: !1,
|
|
82
|
+
code: l,
|
|
83
|
+
source: t,
|
|
84
|
+
type: e
|
|
85
|
+
}), I = (e, t) => new S("Channel not found", {
|
|
86
|
+
isFatal: !1,
|
|
87
|
+
code: s,
|
|
88
|
+
source: t,
|
|
89
|
+
type: e
|
|
90
|
+
}), L = (e) => new S("No Incoming Data", {
|
|
91
|
+
isFatal: !1,
|
|
92
|
+
code: c,
|
|
93
|
+
source: e
|
|
94
|
+
}), R = (e) => new S("Connection attempt failed", {
|
|
95
|
+
isFatal: !1,
|
|
96
|
+
code: r,
|
|
97
|
+
source: e
|
|
98
|
+
}), z = () => new S("Connection failed - no more reconnect attempts", {
|
|
99
|
+
isFatal: !0,
|
|
100
|
+
code: i
|
|
101
|
+
}), B = (e) => new S("WebGL Context Lost", {
|
|
102
|
+
isFatal: !1,
|
|
103
|
+
code: v,
|
|
104
|
+
source: e,
|
|
105
|
+
type: "internal"
|
|
106
|
+
}), V = (e) => new S(e, {
|
|
107
|
+
isFatal: !0,
|
|
108
|
+
code: y
|
|
109
|
+
}), H = (e) => new S(`Channel switch to '${e}' failed`, {
|
|
110
|
+
isFatal: !1,
|
|
111
|
+
code: b
|
|
112
|
+
}), U = (e, t = !1, n) => new S(e, {
|
|
113
|
+
isFatal: t,
|
|
114
|
+
code: x,
|
|
115
|
+
source: n
|
|
116
|
+
});
|
|
117
|
+
//#endregion
|
|
118
|
+
export { T as A, C, k as D, L as E, n as M, z as O, A as S, D as T, H as _, i as a, U as b, l as c, V as d, j as f, I as g, P as h, s as i, B as j, R as k, c as l, N as m, o as n, r as o, E as p, a as r, p as s, y as t, S as u, w as v, O as w, F as x, M as y };
|