@vindral/web-sdk 4.8.1 → 4.8.2-10-g2eaf67d3

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.
@@ -1,7 +1,8 @@
1
- import { n as e, t } from "./BsfwXDui.js";
2
- import { t as n } from "./DrWNJwZx.js";
3
- import { i as r, n as i, t as a } from "./BdMchGeH.js";
4
- import { t as o } from "./D1kpe8tT.js";
1
+ import { t as e } from "./CFqytvUK.js";
2
+ import { t } from "./DJNS7hc2.js";
3
+ import { t as n } from "./CXMDq12B.js";
4
+ import { i as r, n as i, t as a } from "./CR_-dzIp.js";
5
+ import { t as o } from "./2sSTdNyC.js";
5
6
  //#region ../../libs/web-sdk/src/decoders/WebCodecsAudioDecoderContext.ts
6
7
  var s, c = globalThis, l = (e) => {
7
8
  var t, n;
@@ -22,7 +23,7 @@ var s, c = globalThis, l = (e) => {
22
23
  }, u = class {
23
24
  constructor(s) {
24
25
  var c = this;
25
- e(this, "decodedSamples", []), e(this, "decoder", null), e(this, "logger", void 0), e(this, "initSegments", /* @__PURE__ */ new Map()), e(this, "previousSample", void 0), e(this, "previousCodec", void 0), e(this, "pendingSamples", new n(Infinity)), e(this, "priming", { remaining: 0 }), e(this, "sentCount", 0), e(this, "doneCount", 0), e(this, "errors", new n(10)), e(this, "resetDecoderState", () => {
26
+ e(this, "decodedSamples", []), e(this, "decoder", null), e(this, "logger", void 0), e(this, "initSegments", /* @__PURE__ */ new Map()), e(this, "previousSample", void 0), e(this, "previousCodec", void 0), e(this, "pendingSamples", new t(Infinity)), e(this, "priming", { remaining: 0 }), e(this, "sentCount", 0), e(this, "doneCount", 0), e(this, "errors", new t(10)), e(this, "resetDecoderState", () => {
26
27
  this.pendingSamples.clear(), this.doneCount = this.sentCount, this.previousSample = void 0, this.previousCodec = void 0;
27
28
  }), e(this, "dropUndecoded", (e) => {
28
29
  for (; this.doneCount < e && this.pendingSamples.pop();) this.doneCount++;
@@ -131,7 +132,7 @@ var s, c = globalThis, l = (e) => {
131
132
  } catch (e) {
132
133
  this.logger.error("Failed to decode chunk:", e), this.pendingSamples.popLast(), this.sentCount--, r.state === "closed" && (this.resetDecoderState(), this.ensureDecoder());
133
134
  }
134
- }), e(this, "flush", t(function* () {
135
+ }), e(this, "flush", n(function* () {
135
136
  if (c.decoder && c.decoder.state === "configured") try {
136
137
  let e = c.sentCount;
137
138
  yield c.decoder.flush(), c.dropUndecoded(e);
@@ -142,7 +143,7 @@ var s, c = globalThis, l = (e) => {
142
143
  }
143
144
  };
144
145
  s = u, e(u, "isSupported", () => c.AudioDecoder !== void 0), e(u, "create", function() {
145
- var e = t(function* (e) {
146
+ var e = n(function* (e) {
146
147
  if (!s.isSupported()) throw Error("WebCodecs AudioDecoder is not supported in this environment");
147
148
  return new s(e);
148
149
  });
@@ -1,10 +1,13 @@
1
- import { n as e } from "./BsfwXDui.js";
1
+ import { t as e } from "./CFqytvUK.js";
2
2
  import { i as t, n, t as r } from "./DSw1XhvD.js";
3
3
  //#region ../../libs/utils/src/Emitter.ts
4
4
  var i = class {
5
5
  constructor() {
6
6
  e(this, "listeners", {});
7
7
  }
8
+ handleListenerError(e, t) {
9
+ throw e;
10
+ }
8
11
  emit(e, t) {
9
12
  let n = this.listeners[e];
10
13
  if (n) {
@@ -15,11 +18,17 @@ var i = class {
15
18
  }
16
19
  r && (this.listeners[e] = n.filter((e) => !e.once));
17
20
  let i, a = n.length;
18
- for (let e = 0; e < a; e++) {
19
- let r = n[e].fn(t);
20
- typeof r == "function" && (i || (i = []), i.push(r));
21
+ for (let r = 0; r < a; r++) try {
22
+ let e = n[r].fn(t);
23
+ typeof e == "function" && (i || (i = []), i.push(e));
24
+ } catch (t) {
25
+ this.handleListenerError(t, e);
26
+ }
27
+ if (i) for (let t = 0; t < i.length; t++) try {
28
+ i[t]();
29
+ } catch (t) {
30
+ this.handleListenerError(t, e);
21
31
  }
22
- if (i) for (let e = 0; e < i.length; e++) i[e]();
23
32
  }
24
33
  }
25
34
  off(e, t) {
package/api-client.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as e } from "./D40eQS8l.js";
1
+ import { t as e } from "./BylishAR.js";
2
2
  export { e as ApiClient };
@@ -1,6 +1,6 @@
1
- import { n as e } from "./BsfwXDui.js";
1
+ import { t as e } from "./CFqytvUK.js";
2
2
  import { i as t, n, r, t as i } from "./DSw1XhvD.js";
3
- import { t as a } from "./Tj9xPXja.js";
3
+ import { t as a } from "./DZ6JmYgs.js";
4
4
  //#region ../../libs/utils/src/formatting.ts
5
5
  var o = 1e3, s = o * 1e3, c = s * 1e3, l = (e, t, n) => e % t === 0 ? e / t : (e / t).toFixed(n), u = (e, t = 1) => e >= c ? `${l(e, c, t)} Gbit/s` : e >= s ? `${l(e, s, t)} Mbit/s` : e >= o ? `${l(e, o, t)} Kbit/s` : `${e} bit/s`, d = ({ width: e, height: t }) => `${e}x${t}`, f = {
6
6
  PAUSED: "paused",
package/cast-sender.d.ts CHANGED
@@ -3,6 +3,11 @@ type VoidKeys<Record> = MatchingKeys<Record, void>;
3
3
  type EventListenerReturnType = (() => void) | void;
4
4
  declare class Emitter<TEvents, TEmits = TEvents, ArgLessEvents extends VoidKeys<TEvents> = VoidKeys<TEvents>, ArgEvents extends Exclude<keyof TEvents, ArgLessEvents> = Exclude<keyof TEvents, ArgLessEvents>, ArgLessEmits extends VoidKeys<TEmits> = VoidKeys<TEmits>, ArgEmits extends Exclude<keyof TEmits, ArgLessEmits> = Exclude<keyof TEmits, ArgLessEmits>> {
5
5
  private listeners;
6
+ /**
7
+ * Called when a listener or a deferred function throws. Rethrows by default, which stops the dispatch;
8
+ * an override that returns lets the remaining listeners and deferred functions run.
9
+ */
10
+ protected handleListenerError(error: unknown, _eventName: PropertyKey): void;
6
11
  emit<T extends ArgLessEmits>(eventName: T): void;
7
12
  emit<T extends ArgEmits>(eventName: T, args: TEmits[T]): void;
8
13
  /**
@@ -299,8 +304,9 @@ interface Options {
299
304
  * Note: the ReconnectState gets reset every time the client instance makes a successful connection.
300
305
  * This means the default reconnect handler will only stop reconnecting after 30 _consecutive_ failed connections.
301
306
  *
302
- * While the page is hidden, a failure counts toward `reconnectRetries` only when the server answered: the channel
303
- * is not live or not found, or the connect request got a 4xx other than 408 or 429. Retries back off up to 30 seconds.
307
+ * While the page is hidden or the browser reports offline, a failure counts toward `reconnectRetries` only when the
308
+ * server answered: the channel is not live or not found, or the connect request got a 4xx other than 408 or 429.
309
+ * Hidden retries back off up to 30 seconds; offline retries wait for the network to return, at most 30 seconds.
304
310
  *
305
311
  * ```typescript
306
312
  * // An example reconnect handler that will reconnect forever
package/cast-sender.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as e } from "./DQ5kuB8C.js";
1
+ import { t as e } from "./daJ21AEO.js";
2
2
  export { e as CastSender };
package/core.d.ts CHANGED
@@ -49,6 +49,11 @@ type VoidKeys<Record> = MatchingKeys<Record, void>;
49
49
  type EventListenerReturnType = (() => void) | void;
50
50
  declare class Emitter<TEvents, TEmits = TEvents, ArgLessEvents extends VoidKeys<TEvents> = VoidKeys<TEvents>, ArgEvents extends Exclude<keyof TEvents, ArgLessEvents> = Exclude<keyof TEvents, ArgLessEvents>, ArgLessEmits extends VoidKeys<TEmits> = VoidKeys<TEmits>, ArgEmits extends Exclude<keyof TEmits, ArgLessEmits> = Exclude<keyof TEmits, ArgLessEmits>> {
51
51
  private listeners;
52
+ /**
53
+ * Called when a listener or a deferred function throws. Rethrows by default, which stops the dispatch;
54
+ * an override that returns lets the remaining listeners and deferred functions run.
55
+ */
56
+ protected handleListenerError(error: unknown, _eventName: PropertyKey): void;
52
57
  emit<T extends ArgLessEmits>(eventName: T): void;
53
58
  emit<T extends ArgEmits>(eventName: T, args: TEmits[T]): void;
54
59
  /**
@@ -408,8 +413,9 @@ export interface Options {
408
413
  * Note: the ReconnectState gets reset every time the client instance makes a successful connection.
409
414
  * This means the default reconnect handler will only stop reconnecting after 30 _consecutive_ failed connections.
410
415
  *
411
- * While the page is hidden, a failure counts toward `reconnectRetries` only when the server answered: the channel
412
- * is not live or not found, or the connect request got a 4xx other than 408 or 429. Retries back off up to 30 seconds.
416
+ * While the page is hidden or the browser reports offline, a failure counts toward `reconnectRetries` only when the
417
+ * server answered: the channel is not live or not found, or the connect request got a 4xx other than 408 or 429.
418
+ * Hidden retries back off up to 30 seconds; offline retries wait for the network to return, at most 30 seconds.
413
419
  *
414
420
  * ```typescript
415
421
  * // An example reconnect handler that will reconnect forever
@@ -1215,6 +1221,7 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1215
1221
  private static BACKGROUND_INACTIVITY_DISCONNECT_TIMEOUT;
1216
1222
  /** How long a pause on a visible page may still turn out to be the platform backgrounding us. */
1217
1223
  private static VISIBLE_PAUSE_DISCONNECT_DELAY;
1224
+ protected handleListenerError(error: unknown, eventName: PropertyKey): void;
1218
1225
  /**
1219
1226
  * Picture in picture
1220
1227
  */
@@ -1257,6 +1264,8 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1257
1264
  private offscreenCanvasElement?;
1258
1265
  private webCodecsRenditionSupport;
1259
1266
  private hasCalledConnect;
1267
+ /** The next join is a rejoin after congestion or fatal QoS, which asks for a short burst. */
1268
+ private shortBurstRejoin;
1260
1269
  /** The last upgrade check held, so the hold is logged once. */
1261
1270
  private upgradeHeld;
1262
1271
  private hasRequestedAudioSession;
@@ -1578,6 +1587,12 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1578
1587
  * since another backlog or stall costs more than a few seconds at low quality.
1579
1588
  */
1580
1589
  private lowerTargetForRejoin;
1590
+ /**
1591
+ * The join burst: the buffer target, or 0 when bursts are off. A link too thin for the target's burst, or a rejoin
1592
+ * after congestion or fatal QoS, gets a short burst instead, so it starts in the edge's live group without
1593
+ * resending history into a link that can't take it.
1594
+ */
1595
+ private joinBurstMs;
1581
1596
  private onPingTimeout;
1582
1597
  private emitLanguagesIfChanged;
1583
1598
  private updateTextTracks;
package/core.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, o, r as s, s as c, t as l, u } from "./DlCbtbuA.js";
1
+ import { a as e, c as t, d as n, f as r, i, l as a, o, r as s, s as c, t as l, u } from "./iEs3KMee.js";
2
2
  export { s as AUTHENTICATION_EXPIRED_CODE, i as AUTHENTICATION_FAILED_CODE, e as CHANNEL_NOT_FOUND_CODE, o as CHANNEL_NOT_LIVE_CODE, c as CONNECTION_FAILED_AFTER_RETRIES_CODE, t as CONNECTION_FAILED_CODE, a as DISCONNECTED_BY_EDGE, u as INACTIVITY_CODE, n as NO_INCOMING_DATA, l as Vindral, r as VindralError };
@@ -1,5 +1,6 @@
1
- import { n as e, t } from "./BsfwXDui.js";
2
- import { n, r } from "./BaDhuUsA.js";
1
+ import { t as e } from "./CFqytvUK.js";
2
+ import { t } from "./CXMDq12B.js";
3
+ import { n, r } from "./Wh46-8RX.js";
3
4
  //#region ../../libs/cast-sender/src/CastSender.ts
4
5
  var i = 1e4, a = "CastSender was unloaded before the Google Cast SDK finished initializing", o = class extends r {
5
6
  constructor(r) {