@vindral/web-sdk 2.1.5 → 2.2.2

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
@@ -14,6 +14,7 @@ interface CodedAudioSample extends BaseCodedSample {
14
14
  codec: AudioCodec;
15
15
  channels: number;
16
16
  sampleRate: number;
17
+ language?: string;
17
18
  }
18
19
  interface CodedVideoSample extends BaseCodedSample {
19
20
  type: "video";
@@ -21,7 +22,7 @@ interface CodedVideoSample extends BaseCodedSample {
21
22
  }
22
23
  declare type CodedSample = CodedAudioSample | CodedVideoSample;
23
24
  declare type AudioCodec = "aac" | "opus" | "mp3";
24
- declare type VideoCodec = "h264";
25
+ declare type VideoCodec = "h264" | "av1";
25
26
  declare type Codec = VideoCodec | AudioCodec;
26
27
  interface DecodedSampleStatistics {
27
28
  decodeTime: number;
@@ -756,7 +757,6 @@ declare class DecoderModule {
756
757
  private emitDecodeRate;
757
758
  private updateBufferState;
758
759
  }
759
- type ConnectionType = "bluetooth" | "cellular" | "ethernet" | "mixed" | "none" | "other" | "unknown" | "wifi" | "wimax";
760
760
  type EffectiveConnectionType = "2g" | "3g" | "4g" | "slow-2g";
761
761
  interface DocumentState {
762
762
  readonly isVisible: boolean;
@@ -800,6 +800,50 @@ declare class DocumentStateModule implements DocumentState {
800
800
  private onVisibilityChanged;
801
801
  private setIsActive;
802
802
  }
803
+ interface EventModuleEvents {
804
+ ["event"]: Readonly<StoredEvent>;
805
+ }
806
+ interface TimeSource {
807
+ readonly drift: number | undefined;
808
+ readonly serverCurrentTime: number;
809
+ }
810
+ interface BaseEvent {
811
+ timestamp: number;
812
+ }
813
+ declare type TimestampAdded = {
814
+ timestampAdded: number;
815
+ };
816
+ interface Metadata extends BaseEvent {
817
+ type: "metadata";
818
+ content: string;
819
+ }
820
+ interface ChannelSwitch extends BaseEvent {
821
+ type: "channel switch";
822
+ channelId: string;
823
+ }
824
+ interface LanguageSwitch extends BaseEvent {
825
+ type: "language switch";
826
+ language: string;
827
+ }
828
+ declare type Event = Metadata | ChannelSwitch | LanguageSwitch;
829
+ declare type StoredEvent = TimestampAdded & Event;
830
+ declare class EventModule {
831
+ private static EVENT_TIMEOUT;
832
+ private static EVENT_CHECK_INTERVAL;
833
+ private logger;
834
+ private emitter;
835
+ private waitingEvents;
836
+ private isTriggered;
837
+ private timeSource;
838
+ private timers;
839
+ constructor(emitter: Emitter<unknown, EventModuleEvents>, logger: Logger, timeSource: TimeSource);
840
+ load: () => void;
841
+ unload: () => void;
842
+ static create: (emitter: Emitter<unknown, EventModuleEvents>, logger: Logger, timeSource: TimeSource) => EventModule;
843
+ addEvent: (event: Event) => void;
844
+ extractEvent: (previousSample: CodedSample, sample: CodedSample) => void;
845
+ private onBufferedStateChanged;
846
+ }
803
847
  interface IncomingDataModuleListeners {
804
848
  ["connection state"]: Readonly<State>;
805
849
  }
@@ -843,29 +887,6 @@ declare class LoggerModule {
843
887
  unload: () => void;
844
888
  private onLog;
845
889
  }
846
- interface MetadataModuleEvents {
847
- ["metadata"]: Readonly<Metadata>;
848
- }
849
- interface TimeSource {
850
- readonly drift: number | undefined;
851
- readonly serverCurrentTime: number;
852
- }
853
- declare class MetadataModule {
854
- private static METADATA_TIMEOUT;
855
- private static METADATA_CHECK_INTERVAL;
856
- private logger;
857
- private emitter;
858
- private waitingMetadata;
859
- private isTriggered;
860
- private timeSource;
861
- private timers;
862
- constructor(emitter: Emitter<unknown, MetadataModuleEvents>, logger: Logger, timeSource: TimeSource);
863
- load: () => void;
864
- unload: () => void;
865
- static create: (emitter: Emitter<unknown, MetadataModuleEvents>, logger: Logger, timeSource: TimeSource) => MetadataModule;
866
- addMetadata: (metadata: Metadata) => void;
867
- private onBufferedStateChanged;
868
- }
869
890
  interface MseModuleEvents {
870
891
  ["error"]: Readonly<VindralError>;
871
892
  }
@@ -1138,6 +1159,7 @@ declare const defaultOptions: {
1138
1159
  poster: string | boolean;
1139
1160
  reconnectHandler: (state: ReconnectState) => Promise<boolean> | boolean;
1140
1161
  iosWakeLockEnabled: boolean;
1162
+ telemetryEnabled: boolean;
1141
1163
  advanced: {
1142
1164
  wasmDecodingConstraint: Partial<VideoConstraint>;
1143
1165
  };
@@ -1272,6 +1294,7 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1272
1294
  }
1273
1295
  interface TelemetryModuleOptions {
1274
1296
  url: string;
1297
+ enabled?: boolean;
1275
1298
  interval?: number;
1276
1299
  includeErrors?: boolean;
1277
1300
  includeEvents?: boolean;
@@ -1398,7 +1421,7 @@ export interface Modules {
1398
1421
  subscription: SubscriptionModule;
1399
1422
  renditions: RenditionsModule;
1400
1423
  qualityOfService: QualityOfServiceModule;
1401
- metadata: MetadataModule;
1424
+ event: EventModule;
1402
1425
  sync: SyncModule;
1403
1426
  telemetry?: TelemetryModule;
1404
1427
  documentState: DocumentStateModule;
@@ -1430,6 +1453,7 @@ export interface Options {
1430
1453
  mseOpusEnabled?: boolean;
1431
1454
  iosBackgroundPlayEnabled?: boolean;
1432
1455
  abrEnabled?: boolean;
1456
+ telemetryEnabled?: boolean;
1433
1457
  maxSize?: Size;
1434
1458
  maxAudioBitRate?: number;
1435
1459
  maxVideoBitRate?: number;
@@ -1445,6 +1469,12 @@ export interface Options {
1445
1469
  advanced?: AdvancedOptions;
1446
1470
  media?: Media;
1447
1471
  }
1472
+ export interface LanguageSwitchContext {
1473
+ language: string;
1474
+ }
1475
+ export interface ChannelSwitchContext {
1476
+ channelId: string;
1477
+ }
1448
1478
  export interface PublicVindralEvents {
1449
1479
  ["error"]: Readonly<VindralError>;
1450
1480
  ["needs user input"]: NeedsUserInputContext;
@@ -1458,6 +1488,8 @@ export interface PublicVindralEvents {
1458
1488
  ["context switch"]: Readonly<ContextSwitchState>;
1459
1489
  ["server wallclock time"]: Readonly<number>;
1460
1490
  ["is live"]: boolean;
1491
+ ["channel switch"]: Readonly<ChannelSwitchContext>;
1492
+ ["language switch"]: Readonly<LanguageSwitchContext>;
1461
1493
  ["buffer state event"]: Readonly<BufferStateEvent>;
1462
1494
  ["initialized media"]: void;
1463
1495
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vindral/web-sdk",
3
- "version": "2.1.5",
3
+ "version": "2.2.2",
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",