@vindral/web-sdk 4.8.2-9-gec246501 → 4.8.3
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/{BylishAR.js → BeCY4GvT.js} +93 -78
- package/{Dom0pf6K.js → BiqsvhSb.js} +20 -23
- package/Bz5OiWeK.js +129 -0
- package/CcifCOAv.js +185 -0
- package/CmTzPIcG.js +5311 -0
- package/{C1ebXKEm.js → CnefSzun.js} +4580 -4647
- package/{B_i2EMYc.js → CukMAxok.js} +340 -361
- package/{CZXxMdn3.js → DCE6HgL-.js} +18 -22
- package/{daJ21AEO.js → DHV7WJZT.js} +26 -32
- package/{CFqytvUK.js → DvtbAkGW.js} +30 -9
- package/{DiWlRJyv.js → QwO652WK.js} +1719 -1831
- package/api-client.js +1 -2
- package/cast-sender.d.ts +8 -1
- package/cast-sender.js +1 -2
- package/core.d.ts +8 -1
- package/core.js +1 -2
- package/legacy.d.ts +8 -1
- package/legacy.es.js +3916 -4172
- package/legacy.umd.js +15 -1237
- package/package.json +1 -1
- package/player.d.ts +8 -1
- package/player.js +3 -4
- package/react.d.ts +8 -1
- package/style.css +2 -0
- package/vindral-player-component.js +2 -4
- package/2sSTdNyC.js +0 -25
- package/BeUVgVO0.js +0 -5124
- package/CG3eQNjj.js +0 -196
- package/CR_-dzIp.js +0 -169
- package/CXMDq12B.js +0 -27
- package/CuYn2z5X.js +0 -4
- package/DJNS7hc2.js +0 -35
- package/DSw1XhvD.js +0 -27
- package/DZ6JmYgs.js +0 -7
- package/Wh46-8RX.js +0 -110
- package/c9cSjfkk.js +0 -378
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { t as i } from "./2sSTdNyC.js";
|
|
6
|
-
//#region ../../libs/wasm-decoders/src/opus/wasm/opus.js
|
|
1
|
+
import { F as e, P as t } from "./CnefSzun.js";
|
|
2
|
+
import { n, t as r } from "./DvtbAkGW.js";
|
|
3
|
+
import { l as i } from "./BeCY4GvT.js";
|
|
4
|
+
// ../../libs/wasm-decoders/src/opus/wasm/opus.js
|
|
7
5
|
var a = (function() {
|
|
8
6
|
var e = typeof document < "u" && document.currentScript ? document.currentScript.src : void 0;
|
|
9
7
|
return (function(t) {
|
|
@@ -206,21 +204,21 @@ var a = (function() {
|
|
|
206
204
|
});
|
|
207
205
|
})(), o, s = /* @__PURE__ */ function(e) {
|
|
208
206
|
return e[e.OK = 0] = "OK", e[e["Bad argument"] = -1] = "Bad argument", e[e["Buffer too small"] = -2] = "Buffer too small", e[e["Internal error"] = -3] = "Internal error", e[e["Invalid packet"] = -4] = "Invalid packet", e[e.Unimplemented = -5] = "Unimplemented", e[e["Invalid state"] = -6] = "Invalid state", e[e["Memory allocation fail"] = -7] = "Memory allocation fail", e;
|
|
209
|
-
}(s || {}), c = class
|
|
210
|
-
constructor(
|
|
211
|
-
|
|
207
|
+
}(s || {}), c = class e {
|
|
208
|
+
constructor(t, r, i) {
|
|
209
|
+
n(this, "opusModule", void 0), n(this, "decoderInstance", void 0), n(this, "opusBufferPointer", void 0), n(this, "pcmBufferPointer", void 0), n(this, "channels", void 0), n(this, "pcmBufferByteSize", () => e.MAX_SAMPLES * this.channels * Float32Array.BYTES_PER_ELEMENT), n(this, "unload", () => {
|
|
212
210
|
this.opusModule._free(this.opusBufferPointer), this.opusModule._free(this.pcmBufferPointer), this.opusModule._opus_decoder_destroy(this.decoderInstance);
|
|
213
|
-
}),
|
|
214
|
-
if (
|
|
215
|
-
this.opusModule.HEAPU8.set(
|
|
216
|
-
let n = this.opusModule._opus_decode_float(this.decoderInstance, this.opusBufferPointer,
|
|
211
|
+
}), n(this, "decode", (t) => {
|
|
212
|
+
if (t.byteLength > e.MAX_OPUS_BUFFER) throw Error(`Opus packet too large (${t.byteLength} bytes), max ${e.MAX_OPUS_BUFFER} bytes`);
|
|
213
|
+
this.opusModule.HEAPU8.set(t, this.opusBufferPointer);
|
|
214
|
+
let n = this.opusModule._opus_decode_float(this.decoderInstance, this.opusBufferPointer, t.byteLength, this.pcmBufferPointer, e.MAX_SAMPLES, 0);
|
|
217
215
|
if (n < 0) throw Error(`${s[n]} (${n})`);
|
|
218
216
|
let r = this.pcmBufferPointer / Float32Array.BYTES_PER_ELEMENT;
|
|
219
217
|
return this.opusModule.HEAPF32.subarray(r, r + n * this.channels);
|
|
220
|
-
}), this.opusModule =
|
|
218
|
+
}), this.opusModule = t, this.channels = i, this.decoderInstance = this.opusModule._opus_decoder_create(r, i, 0), this.opusBufferPointer = this.opusModule._malloc(e.MAX_OPUS_BUFFER), this.pcmBufferPointer = this.opusModule._malloc(this.pcmBufferByteSize());
|
|
221
219
|
}
|
|
222
220
|
};
|
|
223
|
-
o = c,
|
|
221
|
+
o = c, n(c, "MAX_OPUS_BUFFER", 16384), n(c, "MAX_SAMPLES", 5760), n(c, "create", function() {
|
|
224
222
|
var e = r(function* (e, t) {
|
|
225
223
|
return new o(yield a(), e, t);
|
|
226
224
|
});
|
|
@@ -228,13 +226,12 @@ o = c, e(c, "MAX_OPUS_BUFFER", 16384), e(c, "MAX_SAMPLES", 6 * 960), e(c, "creat
|
|
|
228
226
|
return e.apply(this, arguments);
|
|
229
227
|
};
|
|
230
228
|
}());
|
|
231
|
-
|
|
232
|
-
//#region ../../libs/web-sdk/src/decoders/OpusDecoderContext.ts
|
|
229
|
+
// ../../libs/web-sdk/src/decoders/OpusDecoderContext.ts
|
|
233
230
|
var l, u = class {
|
|
234
231
|
constructor(r) {
|
|
235
|
-
|
|
232
|
+
n(this, "decodedSamples", []), n(this, "decoder", void 0), n(this, "errors", new t(10)), n(this, "unload", () => {
|
|
236
233
|
this.decoder.unload();
|
|
237
|
-
}),
|
|
234
|
+
}), n(this, "enqueue", (e) => {
|
|
238
235
|
try {
|
|
239
236
|
let t = performance.now(), n = this.decoder.decode(new Uint8Array(e.data));
|
|
240
237
|
this.decodedSamples.push(i(i({}, e), {}, {
|
|
@@ -251,13 +248,13 @@ var l, u = class {
|
|
|
251
248
|
} catch (e) {
|
|
252
249
|
e instanceof Error && this.errors.push(e);
|
|
253
250
|
}
|
|
254
|
-
}),
|
|
251
|
+
}), n(this, "initSegment", e), n(this, "take", () => this.decodedSamples.shift()), this.decoder = r;
|
|
255
252
|
}
|
|
256
253
|
error() {
|
|
257
254
|
return this.errors.pop();
|
|
258
255
|
}
|
|
259
256
|
};
|
|
260
|
-
l = u,
|
|
257
|
+
l = u, n(u, "create", function() {
|
|
261
258
|
var e = r(function* (e, t) {
|
|
262
259
|
return new l(yield c.create(e, t));
|
|
263
260
|
});
|
|
@@ -265,5 +262,4 @@ l = u, e(u, "create", function() {
|
|
|
265
262
|
return e.apply(this, arguments);
|
|
266
263
|
};
|
|
267
264
|
}());
|
|
268
|
-
//#endregion
|
|
269
265
|
export { u as OpusDecoderContext };
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
constructor(r) {
|
|
1
|
+
import { n as e, r as t } from "./Bz5OiWeK.js";
|
|
2
|
+
import { n, t as r } from "./DvtbAkGW.js";
|
|
3
|
+
// ../../libs/cast-sender/src/CastSender.ts
|
|
4
|
+
var i = 1e4, a = "CastSender was unloaded before the Google Cast SDK finished initializing", o = class extends t {
|
|
5
|
+
constructor(t) {
|
|
7
6
|
var o;
|
|
8
|
-
super(), o = this,
|
|
7
|
+
super(), o = this, n(this, "state", "not casting"), n(this, "config", void 0), n(this, "unloaded", !1), n(this, "logger", e.get().createContext("CastSender")), n(this, "devicesAvailable", void 0), n(this, "updateAuthenticationToken", (e) => {
|
|
9
8
|
this.config && (this.config.options.authenticationToken = e, this.send({
|
|
10
9
|
type: "updateAuthToken",
|
|
11
10
|
token: e
|
|
12
11
|
}));
|
|
13
|
-
}),
|
|
12
|
+
}), n(this, "unload", () => {
|
|
14
13
|
var e;
|
|
15
14
|
this.unloaded = !0, (e = this.getSession()) == null || e.removeMessageListener("urn:x-cast:com.vindral.castdata", this.onMessage), this.devicesAvailable && this.emit("devices available", !1), this.devicesAvailable = void 0;
|
|
16
|
-
}),
|
|
15
|
+
}), n(this, "init", r(function* () {
|
|
17
16
|
return new Promise((e, t) => {
|
|
18
17
|
let n = !1, r = setTimeout(() => {
|
|
19
18
|
n = !0, t(/* @__PURE__ */ Error(`Timed out after ${i} ms waiting for the Google Cast SDK`));
|
|
20
19
|
}, i);
|
|
21
20
|
window.__onGCastApiAvailable = (i) => {
|
|
22
|
-
if (clearTimeout(r), o.unloaded) return t(Error(a));
|
|
21
|
+
if (clearTimeout(r), o.unloaded) return t(/* @__PURE__ */ Error(a));
|
|
23
22
|
if (!i) return t(/* @__PURE__ */ Error("The Google Cast SDK reported the Cast API as unavailable"));
|
|
24
23
|
setTimeout(() => {
|
|
25
|
-
if (o.unloaded) return t(Error(a));
|
|
24
|
+
if (o.unloaded) return t(/* @__PURE__ */ Error(a));
|
|
26
25
|
try {
|
|
27
26
|
o.onGCastApiAvailable(), e();
|
|
28
27
|
} catch (e) {
|
|
@@ -32,16 +31,16 @@ var i = 1e4, a = "CastSender was unloaded before the Google Cast SDK finished in
|
|
|
32
31
|
}, 1e3);
|
|
33
32
|
}, o.castLibrariesAdded() && window.cast ? window.__onGCastApiAvailable(!0) : o.verifyCastLibraries();
|
|
34
33
|
});
|
|
35
|
-
})),
|
|
34
|
+
})), n(this, "start", r(function* () {
|
|
36
35
|
var e;
|
|
37
36
|
yield (e = o.getInstance()) == null ? void 0 : e.requestSession();
|
|
38
|
-
})),
|
|
37
|
+
})), n(this, "stop", () => {
|
|
39
38
|
var e;
|
|
40
39
|
(e = this.getSession()) == null || e.endSession(!0);
|
|
41
|
-
}),
|
|
40
|
+
}), n(this, "getReceiverName", () => {
|
|
42
41
|
var e;
|
|
43
42
|
return ((e = this.getSession()) == null || (e = e.getCastDevice()) == null ? void 0 : e.friendlyName) || void 0;
|
|
44
|
-
}),
|
|
43
|
+
}), n(this, "onGCastApiAvailable", () => {
|
|
45
44
|
var e;
|
|
46
45
|
let t = this.getInstance();
|
|
47
46
|
if (!t) throw "cast context should exist";
|
|
@@ -53,34 +52,31 @@ var i = 1e4, a = "CastSender was unloaded before the Google Cast SDK finished in
|
|
|
53
52
|
}), t.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED, this.onSessionStateChanged), t.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED, this.onCastStateChanged), this.updateDevicesAvailable(t.getCastState()), n === cast.framework.SessionState.SESSION_STARTED && setTimeout(() => {
|
|
54
53
|
this.state = "casting", this.emit("resumed");
|
|
55
54
|
});
|
|
56
|
-
}),
|
|
55
|
+
}), n(this, "send", (e) => {
|
|
57
56
|
var t;
|
|
58
57
|
(t = this.getSession()) == null || t.sendMessage("urn:x-cast:com.vindral.castdata", e);
|
|
59
|
-
}),
|
|
58
|
+
}), n(this, "onMessage", (e, t) => {
|
|
60
59
|
if (e === "urn:x-cast:com.vindral.castdata") try {
|
|
61
60
|
let e = JSON.parse(t);
|
|
62
61
|
switch (e.type) {
|
|
63
62
|
case "metadata":
|
|
64
63
|
this.emit("metadata", e.metadata);
|
|
65
64
|
break;
|
|
66
|
-
case "serverWallclockTime":
|
|
67
|
-
this.emit("server wallclock time", e.serverWallclockTime);
|
|
68
|
-
break;
|
|
69
|
-
default: break;
|
|
65
|
+
case "serverWallclockTime": this.emit("server wallclock time", e.serverWallclockTime);
|
|
70
66
|
}
|
|
71
67
|
} catch (e) {}
|
|
72
|
-
}),
|
|
68
|
+
}), n(this, "onSessionStarted", () => {
|
|
73
69
|
var e;
|
|
74
70
|
(e = this.getSession()) == null || e.addMessageListener("urn:x-cast:com.vindral.castdata", this.onMessage), this.send({
|
|
75
71
|
type: "start",
|
|
76
72
|
config: this.config
|
|
77
73
|
});
|
|
78
|
-
}),
|
|
74
|
+
}), n(this, "onCastStateChanged", (e) => {
|
|
79
75
|
this.unloaded || this.updateDevicesAvailable(e.castState);
|
|
80
|
-
}),
|
|
76
|
+
}), n(this, "updateDevicesAvailable", (e) => {
|
|
81
77
|
let t = e !== cast.framework.CastState.NO_DEVICES_AVAILABLE;
|
|
82
78
|
t !== this.devicesAvailable && (this.devicesAvailable = t, this.emit("devices available", t));
|
|
83
|
-
}),
|
|
79
|
+
}), n(this, "onSessionStateChanged", (e) => {
|
|
84
80
|
if (!this.unloaded) switch (e.sessionState) {
|
|
85
81
|
case cast.framework.SessionState.SESSION_START_FAILED:
|
|
86
82
|
this.state = "not casting", this.emit("failed");
|
|
@@ -95,22 +91,21 @@ var i = 1e4, a = "CastSender was unloaded before the Google Cast SDK finished in
|
|
|
95
91
|
case cast.framework.SessionState.SESSION_STARTED:
|
|
96
92
|
this.onSessionStarted(), this.state = "casting", this.emit("connected");
|
|
97
93
|
break;
|
|
98
|
-
case cast.framework.SessionState.SESSION_STARTING:
|
|
99
|
-
default: break;
|
|
94
|
+
case cast.framework.SessionState.SESSION_STARTING:
|
|
100
95
|
}
|
|
101
|
-
}),
|
|
96
|
+
}), n(this, "getInstance", () => {
|
|
102
97
|
var e;
|
|
103
98
|
return (e = window.cast) == null ? void 0 : e.framework.CastContext.getInstance();
|
|
104
|
-
}),
|
|
99
|
+
}), n(this, "getSession", () => {
|
|
105
100
|
var e;
|
|
106
101
|
return (e = this.getInstance()) == null ? void 0 : e.getCurrentSession();
|
|
107
|
-
}),
|
|
102
|
+
}), n(this, "castLibrariesAdded", () => !!(document.querySelector("#vindralCastFrameworkLib") && document.querySelector("#vindralCastSenderLib"))), n(this, "verifyCastLibraries", () => {
|
|
108
103
|
if (this.castLibrariesAdded()) return;
|
|
109
104
|
let e = document.createElement("script");
|
|
110
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);
|
|
111
106
|
let t = document.createElement("script");
|
|
112
107
|
t.type = "text/javascript", t.id = "vindralCastSenderLib", t.src = "//www.gstatic.com/cv/js/sender/v1/cast_sender.js", document.head.appendChild(t);
|
|
113
|
-
}), this.config =
|
|
108
|
+
}), this.config = t;
|
|
114
109
|
}
|
|
115
110
|
get casting() {
|
|
116
111
|
return this.state === "casting";
|
|
@@ -144,5 +139,4 @@ var i = 1e4, a = "CastSender was unloaded before the Google Cast SDK finished in
|
|
|
144
139
|
}));
|
|
145
140
|
}
|
|
146
141
|
};
|
|
147
|
-
//#endregion
|
|
148
142
|
export { o as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/typeof.js
|
|
2
2
|
function e(t) {
|
|
3
3
|
"@babel/helpers - typeof";
|
|
4
4
|
return e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
@@ -7,8 +7,7 @@ function e(t) {
|
|
|
7
7
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
8
8
|
}, e(t);
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
//#region \0@oxc-project+runtime@0.115.0/helpers/toPrimitive.js
|
|
10
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPrimitive.js
|
|
12
11
|
function t(t, n) {
|
|
13
12
|
if (e(t) != "object" || !t) return t;
|
|
14
13
|
var r = t[Symbol.toPrimitive];
|
|
@@ -19,14 +18,12 @@ function t(t, n) {
|
|
|
19
18
|
}
|
|
20
19
|
return (n === "string" ? String : Number)(t);
|
|
21
20
|
}
|
|
22
|
-
|
|
23
|
-
//#region \0@oxc-project+runtime@0.115.0/helpers/toPropertyKey.js
|
|
21
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPropertyKey.js
|
|
24
22
|
function n(n) {
|
|
25
23
|
var r = t(n, "string");
|
|
26
24
|
return e(r) == "symbol" ? r : r + "";
|
|
27
25
|
}
|
|
28
|
-
|
|
29
|
-
//#region \0@oxc-project+runtime@0.115.0/helpers/defineProperty.js
|
|
26
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/defineProperty.js
|
|
30
27
|
function r(e, t, r) {
|
|
31
28
|
return (t = n(t)) in e ? Object.defineProperty(e, t, {
|
|
32
29
|
value: r,
|
|
@@ -35,5 +32,29 @@ function r(e, t, r) {
|
|
|
35
32
|
writable: !0
|
|
36
33
|
}) : e[t] = r, e;
|
|
37
34
|
}
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/asyncToGenerator.js
|
|
36
|
+
function i(e, t, n, r, i, a, o) {
|
|
37
|
+
try {
|
|
38
|
+
var s = e[a](o), c = s.value;
|
|
39
|
+
} catch (e) {
|
|
40
|
+
n(e);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
s.done ? t(c) : Promise.resolve(c).then(r, i);
|
|
44
|
+
}
|
|
45
|
+
function a(e) {
|
|
46
|
+
return function() {
|
|
47
|
+
var t = this, n = arguments;
|
|
48
|
+
return new Promise(function(r, a) {
|
|
49
|
+
var o = e.apply(t, n);
|
|
50
|
+
function s(e) {
|
|
51
|
+
i(o, r, a, s, c, "next", e);
|
|
52
|
+
}
|
|
53
|
+
function c(e) {
|
|
54
|
+
i(o, r, a, s, c, "throw", e);
|
|
55
|
+
}
|
|
56
|
+
s(void 0);
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export { r as n, a as t };
|