@vindral/web-sdk 4.8.0 → 4.8.1-10-gcc2fea9d

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.
@@ -5,6 +5,9 @@ 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) {
@@ -1,5 +1,5 @@
1
1
  import { n as e, t } from "./BsfwXDui.js";
2
- import { n, r } from "./BaDhuUsA.js";
2
+ import { n, r } from "./Bg5VLlmK.js";
3
3
  //#region ../../libs/cast-sender/src/CastSender.ts
4
4
  var i = 1e4, a = "CastSender was unloaded before the Google Cast SDK finished initializing", o = class extends r {
5
5
  constructor(r) {
package/api-client.d.ts CHANGED
@@ -219,7 +219,7 @@ export declare class ApiClient {
219
219
  * Fetches information regarding a single channel.
220
220
  *
221
221
  * @param channelId the channel to fetch
222
- * @returns a [[Channel]] containing information about the requested channel.
222
+ * @returns a {@link Channel} containing information about the requested channel.
223
223
  */
224
224
  getChannel(channelId: string): Promise<Channel>;
225
225
  /**
@@ -228,7 +228,7 @@ export declare class ApiClient {
228
228
  * Note: The returned list includes inactive channels - check isLive to filter out only active channels
229
229
  *
230
230
  * @param channelGroupId the channel group to fetch channels from
231
- * @returns an array of [[Channel]] that belong to the channel group
231
+ * @returns an array of {@link Channel} that belong to the channel group
232
232
  */
233
233
  getChannels(channelGroupId: string): Promise<Channel[]>;
234
234
  private getHeaders;
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
  /**
package/cast-sender.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as e } from "./DQ5kuB8C.js";
1
+ import { t as e } from "./CLvW8aae.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
  /**
@@ -820,7 +825,7 @@ declare class ApiClient {
820
825
  * Fetches information regarding a single channel.
821
826
  *
822
827
  * @param channelId the channel to fetch
823
- * @returns a [[Channel]] containing information about the requested channel.
828
+ * @returns a {@link Channel} containing information about the requested channel.
824
829
  */
825
830
  getChannel(channelId: string): Promise<Channel>;
826
831
  /**
@@ -829,7 +834,7 @@ declare class ApiClient {
829
834
  * Note: The returned list includes inactive channels - check isLive to filter out only active channels
830
835
  *
831
836
  * @param channelGroupId the channel group to fetch channels from
832
- * @returns an array of [[Channel]] that belong to the channel group
837
+ * @returns an array of {@link Channel} that belong to the channel group
833
838
  */
834
839
  getChannels(channelGroupId: string): Promise<Channel[]>;
835
840
  private getHeaders;
@@ -1180,10 +1185,10 @@ export type Statistics = ModuleStatistics & ReturnType<UserAgentInformation["get
1180
1185
  *
1181
1186
  * - play() - connects and starts playing; call it from a user gesture to activate audio on browsers that require one
1182
1187
  * - attach() - to attach the Vindral video view to the DOM so that users can see it
1183
- * - unload() - unloads the instance, its very important that this is called when cleaning up the Vindral instance, otherwise background timers may leak.
1188
+ * - unload() - unloads the instance, it's very important that this is called when cleaning up the Vindral instance, otherwise background timers may leak.
1184
1189
  *
1185
- * The Vindral instance will emit a variety of events during its lifetime. Use .on("event-name", callback) to listen to these events.
1186
- * See [[PublicVindralEvents]] for the events types that can be emitted.
1190
+ * The Vindral instance will emit a variety of events during its lifetime. Use `.on("event-name", callback)` to listen to these events.
1191
+ * See {@link PublicVindralEvents} for the event types that can be emitted.
1187
1192
  *
1188
1193
  * ```typescript
1189
1194
  * // minimal configuration of a Vindral client instance
@@ -1215,6 +1220,7 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1215
1220
  private static BACKGROUND_INACTIVITY_DISCONNECT_TIMEOUT;
1216
1221
  /** How long a pause on a visible page may still turn out to be the platform backgrounding us. */
1217
1222
  private static VISIBLE_PAUSE_DISCONNECT_DELAY;
1223
+ protected handleListenerError(error: unknown, eventName: PropertyKey): void;
1218
1224
  /**
1219
1225
  * Picture in picture
1220
1226
  */
@@ -1455,7 +1461,7 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1455
1461
  /**
1456
1462
  * Set the current channelId
1457
1463
  *
1458
- * Possible channels to set are available from [[channels]]
1464
+ * Possible channels to set are available from {@link channels}
1459
1465
  *
1460
1466
  * Note that the following scenarios are not possible right now:
1461
1467
  * - switching channel from a channel with audio to a channel without audio (unless audio only mode is active)
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 "./Bf7Esc1M.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 "./oiQZIm8G.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 };
package/legacy.d.ts CHANGED
@@ -52,6 +52,11 @@ type VoidKeys<Record> = MatchingKeys<Record, void>;
52
52
  type EventListenerReturnType = (() => void) | void;
53
53
  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>> {
54
54
  private listeners;
55
+ /**
56
+ * Called when a listener or a deferred function throws. Rethrows by default, which stops the dispatch;
57
+ * an override that returns lets the remaining listeners and deferred functions run.
58
+ */
59
+ protected handleListenerError(error: unknown, _eventName: PropertyKey): void;
55
60
  emit<T extends ArgLessEmits>(eventName: T): void;
56
61
  emit<T extends ArgEmits>(eventName: T, args: TEmits[T]): void;
57
62
  /**
@@ -835,7 +840,7 @@ export declare class ApiClient {
835
840
  * Fetches information regarding a single channel.
836
841
  *
837
842
  * @param channelId the channel to fetch
838
- * @returns a [[Channel]] containing information about the requested channel.
843
+ * @returns a {@link Channel} containing information about the requested channel.
839
844
  */
840
845
  getChannel(channelId: string): Promise<Channel>;
841
846
  /**
@@ -844,7 +849,7 @@ export declare class ApiClient {
844
849
  * Note: The returned list includes inactive channels - check isLive to filter out only active channels
845
850
  *
846
851
  * @param channelGroupId the channel group to fetch channels from
847
- * @returns an array of [[Channel]] that belong to the channel group
852
+ * @returns an array of {@link Channel} that belong to the channel group
848
853
  */
849
854
  getChannels(channelGroupId: string): Promise<Channel[]>;
850
855
  private getHeaders;
@@ -1195,10 +1200,10 @@ export type Statistics = ModuleStatistics & ReturnType<UserAgentInformation["get
1195
1200
  *
1196
1201
  * - play() - connects and starts playing; call it from a user gesture to activate audio on browsers that require one
1197
1202
  * - attach() - to attach the Vindral video view to the DOM so that users can see it
1198
- * - unload() - unloads the instance, its very important that this is called when cleaning up the Vindral instance, otherwise background timers may leak.
1203
+ * - unload() - unloads the instance, it's very important that this is called when cleaning up the Vindral instance, otherwise background timers may leak.
1199
1204
  *
1200
- * The Vindral instance will emit a variety of events during its lifetime. Use .on("event-name", callback) to listen to these events.
1201
- * See [[PublicVindralEvents]] for the events types that can be emitted.
1205
+ * The Vindral instance will emit a variety of events during its lifetime. Use `.on("event-name", callback)` to listen to these events.
1206
+ * See {@link PublicVindralEvents} for the event types that can be emitted.
1202
1207
  *
1203
1208
  * ```typescript
1204
1209
  * // minimal configuration of a Vindral client instance
@@ -1230,6 +1235,7 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1230
1235
  private static BACKGROUND_INACTIVITY_DISCONNECT_TIMEOUT;
1231
1236
  /** How long a pause on a visible page may still turn out to be the platform backgrounding us. */
1232
1237
  private static VISIBLE_PAUSE_DISCONNECT_DELAY;
1238
+ protected handleListenerError(error: unknown, eventName: PropertyKey): void;
1233
1239
  /**
1234
1240
  * Picture in picture
1235
1241
  */
@@ -1470,7 +1476,7 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1470
1476
  /**
1471
1477
  * Set the current channelId
1472
1478
  *
1473
- * Possible channels to set are available from [[channels]]
1479
+ * Possible channels to set are available from {@link channels}
1474
1480
  *
1475
1481
  * Note that the following scenarios are not possible right now:
1476
1482
  * - switching channel from a channel with audio to a channel without audio (unless audio only mode is active)