@vindral/web-sdk 2.1.3 → 2.1.4

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/index.d.ts CHANGED
@@ -443,6 +443,7 @@ declare class BufferTimeModule {
443
443
  }
444
444
  interface VindralErrorProps {
445
445
  isFatal: boolean;
446
+ type?: ErrorType;
446
447
  code: string;
447
448
  source?: Error | MediaError;
448
449
  }
@@ -456,6 +457,8 @@ export declare const INACTIVITY_CODE = "connection_inactivity";
456
457
  export declare const MISSING_INIT_SEGMENT = "missing_init_segment";
457
458
  export declare const NO_TRACK_CONTEXT = "no_track_context";
458
459
  export declare const DISCONNECTED_BY_EDGE = "disconnected_by_edge";
460
+ export declare const DECODER_ERROR = "decoder_error";
461
+ export declare type ErrorType = "internal" | "external";
459
462
  export declare class VindralError extends Error {
460
463
  private props;
461
464
  private extra;
@@ -463,17 +466,19 @@ export declare class VindralError extends Error {
463
466
  code: () => string;
464
467
  isFatal: () => boolean;
465
468
  source: () => Error | MediaError | undefined;
469
+ type: () => ErrorType;
466
470
  toStringifiable: () => Record<string, unknown>;
467
471
  }
468
472
  export declare const mediaElementError: (isFatal: boolean, source: MediaError) => VindralError;
473
+ export declare const decoderError: (isFatal: boolean, source: Error) => VindralError;
469
474
  export declare const missingInitSegmentError: (renditionId: number, channelId: string) => VindralError;
470
475
  export declare const noTrackContextError: (type: "audio" | "video", renditionId: number, channelId: string) => VindralError;
471
476
  export declare const audioContextTimeoutError: () => VindralError;
472
477
  export declare const disconnectedFromEdgeServerError: (source?: VindralError | undefined) => VindralError;
473
478
  export declare const authenticationError: (source?: Error | undefined) => VindralError;
474
479
  export declare const authenticationExpiredError: (source?: Error | undefined) => VindralError;
475
- export declare const inactivityError: (source?: Error | undefined) => VindralError;
476
- export declare const channelNotFoundError: (source?: Error | undefined) => VindralError;
480
+ export declare const inactivityError: (type: ErrorType, source?: Error | undefined) => VindralError;
481
+ export declare const channelNotFoundError: (type: ErrorType, source?: Error | undefined) => VindralError;
477
482
  export declare const noIncomingDataError: (source?: Error | undefined) => VindralError;
478
483
  export declare const unableToConnectError: (source?: Error | undefined) => VindralError;
479
484
  export declare const unableToConnectAfterRetriesError: () => VindralError;
@@ -698,11 +703,13 @@ interface DecoderContext<Type extends "audio" | "video"> {
698
703
  initSegment(initSegment: Readonly<InitSegment>): void;
699
704
  enqueue(sample: Readonly<DecoderParamType<Type>>): void;
700
705
  take(): DecoderReturnType<Type> | undefined;
706
+ error?: () => Error | undefined;
701
707
  }
702
708
  interface DecoderModuleEvents {
703
709
  ["video decode rate"]: number;
704
710
  ["decoded frame"]: Readonly<DecodedSample>;
705
711
  ["buffer state"]: Readonly<BufferState>;
712
+ ["error"]: Readonly<VindralError>;
706
713
  }
707
714
  interface DecoderModuleListeners {
708
715
  ["init segment"]: Readonly<InitSegment>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vindral/web-sdk",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "homepage": "https://vindral.com",
5
5
  "description": "Web SDK for viewing Vindral streams",
6
6
  "license": "SEE LICENSE IN https://www.vindral.com/terms-conditions",