@vindral/web-sdk 2.1.4 → 2.2.1

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
  }
@@ -1398,7 +1419,7 @@ export interface Modules {
1398
1419
  subscription: SubscriptionModule;
1399
1420
  renditions: RenditionsModule;
1400
1421
  qualityOfService: QualityOfServiceModule;
1401
- metadata: MetadataModule;
1422
+ event: EventModule;
1402
1423
  sync: SyncModule;
1403
1424
  telemetry?: TelemetryModule;
1404
1425
  documentState: DocumentStateModule;
@@ -1428,6 +1449,7 @@ export interface Options {
1428
1449
  burstEnabled?: boolean;
1429
1450
  mseEnabled?: boolean;
1430
1451
  mseOpusEnabled?: boolean;
1452
+ iosBackgroundPlayEnabled?: boolean;
1431
1453
  abrEnabled?: boolean;
1432
1454
  maxSize?: Size;
1433
1455
  maxAudioBitRate?: number;
@@ -1444,6 +1466,12 @@ export interface Options {
1444
1466
  advanced?: AdvancedOptions;
1445
1467
  media?: Media;
1446
1468
  }
1469
+ export interface LanguageSwitchContext {
1470
+ language: string;
1471
+ }
1472
+ export interface ChannelSwitchContext {
1473
+ channelId: string;
1474
+ }
1447
1475
  export interface PublicVindralEvents {
1448
1476
  ["error"]: Readonly<VindralError>;
1449
1477
  ["needs user input"]: NeedsUserInputContext;
@@ -1457,6 +1485,8 @@ export interface PublicVindralEvents {
1457
1485
  ["context switch"]: Readonly<ContextSwitchState>;
1458
1486
  ["server wallclock time"]: Readonly<number>;
1459
1487
  ["is live"]: boolean;
1488
+ ["channel switch"]: Readonly<ChannelSwitchContext>;
1489
+ ["language switch"]: Readonly<LanguageSwitchContext>;
1460
1490
  ["buffer state event"]: Readonly<BufferStateEvent>;
1461
1491
  ["initialized media"]: void;
1462
1492
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vindral/web-sdk",
3
- "version": "2.1.4",
3
+ "version": "2.2.1",
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",