@vindral/web-sdk 4.8.2-2-g17ce1f28 → 4.8.2-21-g813526bf1
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/{BEFbWAJ5.js → 0pn2HUuS.js} +21 -24
- package/{Z7yt7Imj.js → BY9E8uAJ.js} +20 -22
- package/{DyoeX7Rz.js → BcjjQpy0.js} +326 -346
- package/{D40eQS8l.js → BeCY4GvT.js} +93 -77
- package/Bz5OiWeK.js +129 -0
- package/CXECk2wD.js +185 -0
- package/{SmL84Oio.js → ClL-QhcZ.js} +4191 -4302
- package/{BsAceGtc.js → Cwut_XDC.js} +1901 -1717
- package/{CLvW8aae.js → DHV7WJZT.js} +26 -31
- package/{BsfwXDui.js → DvtbAkGW.js} +5 -10
- package/QwO652WK.js +20938 -0
- package/api-client.js +1 -2
- package/cast-sender.js +1 -2
- package/core.d.ts +8 -0
- package/core.js +1 -2
- package/legacy.d.ts +8 -0
- package/legacy.es.js +4410 -4710
- package/legacy.umd.js +17 -1239
- package/package.json +1 -1
- package/player.d.ts +8 -0
- package/player.js +3 -4
- package/react.d.ts +8 -0
- package/style.css +2 -0
- package/vindral-player-component.js +2 -4
- package/BdMchGeH.js +0 -169
- package/Bg5VLlmK.js +0 -110
- package/C2hzXxnL.js +0 -195
- package/CoLAnqGB.js +0 -378
- package/Ct8GqCxq.js +0 -18624
- package/CuYn2z5X.js +0 -4
- package/D1kpe8tT.js +0 -25
- package/DSw1XhvD.js +0 -27
- package/DrWNJwZx.js +0 -35
- package/Tj9xPXja.js +0 -7
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
//#region ../../libs/wasm-decoders/src/opus/wasm/opus.js
|
|
1
|
+
import { F as e, P as t } from "./ClL-QhcZ.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
|
|
6
5
|
var a = (function() {
|
|
7
6
|
var e = typeof document < "u" && document.currentScript ? document.currentScript.src : void 0;
|
|
8
7
|
return (function(t) {
|
|
@@ -205,35 +204,34 @@ var a = (function() {
|
|
|
205
204
|
});
|
|
206
205
|
})(), o, s = /* @__PURE__ */ function(e) {
|
|
207
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;
|
|
208
|
-
}(s || {}), c = class
|
|
209
|
-
constructor(
|
|
210
|
-
|
|
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", () => {
|
|
211
210
|
this.opusModule._free(this.opusBufferPointer), this.opusModule._free(this.pcmBufferPointer), this.opusModule._opus_decoder_destroy(this.decoderInstance);
|
|
212
|
-
}),
|
|
213
|
-
if (
|
|
214
|
-
this.opusModule.HEAPU8.set(
|
|
215
|
-
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);
|
|
216
215
|
if (n < 0) throw Error(`${s[n]} (${n})`);
|
|
217
216
|
let r = this.pcmBufferPointer / Float32Array.BYTES_PER_ELEMENT;
|
|
218
217
|
return this.opusModule.HEAPF32.subarray(r, r + n * this.channels);
|
|
219
|
-
}), 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());
|
|
220
219
|
}
|
|
221
220
|
};
|
|
222
|
-
o = c,
|
|
223
|
-
var e =
|
|
221
|
+
o = c, n(c, "MAX_OPUS_BUFFER", 16384), n(c, "MAX_SAMPLES", 5760), n(c, "create", function() {
|
|
222
|
+
var e = r(function* (e, t) {
|
|
224
223
|
return new o(yield a(), e, t);
|
|
225
224
|
});
|
|
226
225
|
return function(t, n) {
|
|
227
226
|
return e.apply(this, arguments);
|
|
228
227
|
};
|
|
229
228
|
}());
|
|
230
|
-
|
|
231
|
-
//#region ../../libs/web-sdk/src/decoders/OpusDecoderContext.ts
|
|
229
|
+
// ../../libs/web-sdk/src/decoders/OpusDecoderContext.ts
|
|
232
230
|
var l, u = class {
|
|
233
|
-
constructor(
|
|
234
|
-
|
|
231
|
+
constructor(r) {
|
|
232
|
+
n(this, "decodedSamples", []), n(this, "decoder", void 0), n(this, "errors", new t(10)), n(this, "unload", () => {
|
|
235
233
|
this.decoder.unload();
|
|
236
|
-
}),
|
|
234
|
+
}), n(this, "enqueue", (e) => {
|
|
237
235
|
try {
|
|
238
236
|
let t = performance.now(), n = this.decoder.decode(new Uint8Array(e.data));
|
|
239
237
|
this.decodedSamples.push(i(i({}, e), {}, {
|
|
@@ -250,19 +248,18 @@ var l, u = class {
|
|
|
250
248
|
} catch (e) {
|
|
251
249
|
e instanceof Error && this.errors.push(e);
|
|
252
250
|
}
|
|
253
|
-
}),
|
|
251
|
+
}), n(this, "initSegment", e), n(this, "take", () => this.decodedSamples.shift()), this.decoder = r;
|
|
254
252
|
}
|
|
255
253
|
error() {
|
|
256
254
|
return this.errors.pop();
|
|
257
255
|
}
|
|
258
256
|
};
|
|
259
|
-
l = u,
|
|
260
|
-
var e =
|
|
257
|
+
l = u, n(u, "create", function() {
|
|
258
|
+
var e = r(function* (e, t) {
|
|
261
259
|
return new l(yield c.create(e, t));
|
|
262
260
|
});
|
|
263
261
|
return function(t, n) {
|
|
264
262
|
return e.apply(this, arguments);
|
|
265
263
|
};
|
|
266
264
|
}());
|
|
267
|
-
//#endregion
|
|
268
265
|
export { u as OpusDecoderContext };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
//#region ../../libs/web-sdk/src/decoders/WebCodecsAudioDecoderContext.ts
|
|
1
|
+
import { P as e, i as t, n, r } from "./ClL-QhcZ.js";
|
|
2
|
+
import { n as i, t as a } from "./DvtbAkGW.js";
|
|
3
|
+
import { l as o } from "./BeCY4GvT.js";
|
|
4
|
+
// ../../libs/web-sdk/src/decoders/WebCodecsAudioDecoderContext.ts
|
|
6
5
|
var s, c = globalThis, l = (e) => {
|
|
7
6
|
var t, n;
|
|
8
7
|
if (!e) return {
|
|
@@ -22,11 +21,11 @@ var s, c = globalThis, l = (e) => {
|
|
|
22
21
|
}, u = class {
|
|
23
22
|
constructor(s) {
|
|
24
23
|
var c = this;
|
|
25
|
-
|
|
24
|
+
i(this, "decodedSamples", []), i(this, "decoder", null), i(this, "logger", void 0), i(this, "initSegments", /* @__PURE__ */ new Map()), i(this, "previousSample", void 0), i(this, "previousCodec", void 0), i(this, "pendingSamples", new e(Infinity)), i(this, "priming", { remaining: 0 }), i(this, "sentCount", 0), i(this, "doneCount", 0), i(this, "errors", new e(10)), i(this, "resetDecoderState", () => {
|
|
26
25
|
this.pendingSamples.clear(), this.doneCount = this.sentCount, this.previousSample = void 0, this.previousCodec = void 0;
|
|
27
|
-
}),
|
|
26
|
+
}), i(this, "dropUndecoded", (e) => {
|
|
28
27
|
for (; this.doneCount < e && this.pendingSamples.pop();) this.doneCount++;
|
|
29
|
-
}),
|
|
28
|
+
}), i(this, "ensureDecoder", () => (this.decoder && this.decoder.state !== "closed" || (this.decoder = this.createDecoder()), this.decoder)), i(this, "createDecoder", () => new AudioDecoder({
|
|
30
29
|
output: (e) => {
|
|
31
30
|
let t = this.pendingSamples.pop();
|
|
32
31
|
if (!t) {
|
|
@@ -67,18 +66,18 @@ var s, c = globalThis, l = (e) => {
|
|
|
67
66
|
error: (e) => {
|
|
68
67
|
this.logger.error("Decoder error:", e.name, e.message), this.resetDecoderState(), this.errors.push(e);
|
|
69
68
|
}
|
|
70
|
-
})),
|
|
71
|
-
let
|
|
72
|
-
if (
|
|
73
|
-
if (e === "opus") return
|
|
74
|
-
if (e === "aac") return
|
|
75
|
-
}),
|
|
69
|
+
})), i(this, "buildCodecString", n), i(this, "getDescription", (e, n) => {
|
|
70
|
+
let i = this.initSegments.get(n.renditionId);
|
|
71
|
+
if (i && i.data.byteLength > 0 && i.codec === e) return i.data;
|
|
72
|
+
if (e === "opus") return r(n.channels, n.sampleRate);
|
|
73
|
+
if (e === "aac") return t(n.channels, n.sampleRate);
|
|
74
|
+
}), i(this, "reset", () => {
|
|
76
75
|
this.decodedSamples = [], this.decoder && this.decoder.state !== "closed" && this.decoder.reset(), this.resetDecoderState();
|
|
77
|
-
}),
|
|
76
|
+
}), i(this, "unload", () => {
|
|
78
77
|
this.reset(), this.decoder && this.decoder.state !== "closed" && this.decoder.close(), this.decoder = null;
|
|
79
|
-
}),
|
|
78
|
+
}), i(this, "initSegment", (e) => {
|
|
80
79
|
this.initSegments.set(e.renditionId, e);
|
|
81
|
-
}),
|
|
80
|
+
}), i(this, "enqueue", (e) => {
|
|
82
81
|
var t, n;
|
|
83
82
|
let r = this.ensureDecoder(), i = e.codec, a = ((t = this.previousSample) == null ? void 0 : t.channelId) !== e.channelId, o = ((n = this.previousSample) == null ? void 0 : n.renditionId) !== e.renditionId, s = this.previousCodec !== i;
|
|
84
83
|
if (!this.previousSample || a || o || s) {
|
|
@@ -131,18 +130,18 @@ var s, c = globalThis, l = (e) => {
|
|
|
131
130
|
} catch (e) {
|
|
132
131
|
this.logger.error("Failed to decode chunk:", e), this.pendingSamples.popLast(), this.sentCount--, r.state === "closed" && (this.resetDecoderState(), this.ensureDecoder());
|
|
133
132
|
}
|
|
134
|
-
}),
|
|
133
|
+
}), i(this, "flush", a(function* () {
|
|
135
134
|
if (c.decoder && c.decoder.state === "configured") try {
|
|
136
135
|
let e = c.sentCount;
|
|
137
136
|
yield c.decoder.flush(), c.dropUndecoded(e);
|
|
138
137
|
} catch (e) {
|
|
139
138
|
c.logger.error("Failed to flush decoder:", e), c.resetDecoderState();
|
|
140
139
|
}
|
|
141
|
-
})),
|
|
140
|
+
})), i(this, "error", () => this.errors.pop()), i(this, "take", () => this.decodedSamples.shift()), this.logger = s, this.decoder = this.createDecoder();
|
|
142
141
|
}
|
|
143
142
|
};
|
|
144
|
-
s = u,
|
|
145
|
-
var e =
|
|
143
|
+
s = u, i(u, "isSupported", () => c.AudioDecoder !== void 0), i(u, "create", function() {
|
|
144
|
+
var e = a(function* (e) {
|
|
146
145
|
if (!s.isSupported()) throw Error("WebCodecs AudioDecoder is not supported in this environment");
|
|
147
146
|
return new s(e);
|
|
148
147
|
});
|
|
@@ -150,5 +149,4 @@ s = u, e(u, "isSupported", () => c.AudioDecoder !== void 0), e(u, "create", func
|
|
|
150
149
|
return e.apply(this, arguments);
|
|
151
150
|
};
|
|
152
151
|
}());
|
|
153
|
-
//#endregion
|
|
154
152
|
export { u as WebCodecsAudioDecoderContext };
|