@vindral/web-sdk 4.1.4 → 4.1.5

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/react.d.ts CHANGED
@@ -17,6 +17,10 @@ interface Channel {
17
17
  * URLs to fetch thumbnail from
18
18
  */
19
19
  thumbnailUrls: string[];
20
+ /**
21
+ * Urls for timeshift if available
22
+ */
23
+ timeshiftUrls?: string[];
20
24
  }
21
25
  interface ClientOverrides {
22
26
  maxVideoBitRate?: number;
@@ -215,6 +219,10 @@ interface MoQConnectInfo {
215
219
  telemetry?: Telemetry;
216
220
  channels: ChannelWithCatalog[];
217
221
  edges: Edge[];
222
+ timeshift: {
223
+ urls: string[];
224
+ duration: string;
225
+ };
218
226
  }
219
227
  interface VindralConnectInfo {
220
228
  logsUrl?: string;
@@ -425,6 +433,14 @@ interface Options {
425
433
  * This can be used to provide user options to limit the video bandwidth usage.
426
434
  */
427
435
  maxVideoBitRate?: number;
436
+ /**
437
+ * Initial maximum bit rate cap applied when first connecting to a channel.
438
+ * This helps prevent buffering on initial connection by starting at a conservative bitrate.
439
+ * The client will adapt to higher bitrates as bandwidth allows if ABR is enabled.
440
+ *
441
+ * Default is 2.5 Mbps (2500000 bits per second).
442
+ */
443
+ maxInitialBitRate?: number;
428
444
  /**
429
445
  * Controls video element background behaviour while loading.
430
446
  * - If `false`, a black background will be shown.
@@ -746,11 +762,11 @@ interface QualityOfServiceModuleStatistics {
746
762
  */
747
763
  fatalQosCount: number;
748
764
  /**
749
- * Ratio of time being spent on different bitrates.
750
- * Example: `"timeSpentRatio": { "1160000": 0.2, "2260000": 0.8 }` shows 20% spent on 1.16 Mbps, 80% spent on 2.26 Mbps.
765
+ * Ratio of time being spent on different quality indexes. Index 0 is always the highest quality.
766
+ * Example: `"timeSpentRatio": { "0": 0.8, "1": 0.2 }` shows 80% spent on the best level, 20% on the next one.
751
767
  */
752
768
  timeSpentRatio: {
753
- [bitRate: string]: number;
769
+ [qualityIndex: string]: number;
754
770
  };
755
771
  }
756
772
  interface SyncModuleStatistics {
@@ -759,6 +775,20 @@ interface SyncModuleStatistics {
759
775
  timeshiftDriftAdjustmentCount: number;
760
776
  seekTime: number;
761
777
  }
778
+ interface JitterStatistics {
779
+ /** Minimum jitter in the recent window */
780
+ min: number;
781
+ /** Maximum jitter in the recent window for spike detection */
782
+ max: number;
783
+ /** Latest average jitter in ms (recent window) */
784
+ last: number;
785
+ /** Average jitter in ms (RFC 3550 style, smoothed with /16) */
786
+ average: number;
787
+ }
788
+ interface JitterModuleStatistics {
789
+ audioJitter: JitterStatistics | undefined;
790
+ videoJitter: JitterStatistics | undefined;
791
+ }
762
792
  interface VideoPlayerStatistics {
763
793
  renderedFrameCount: number;
764
794
  rendererDroppedFrameCount: number;
@@ -797,7 +827,7 @@ declare class UserAgentInformation {
797
827
  userAgent: string;
798
828
  };
799
829
  }
800
- type ModuleStatistics = AdaptivityStatistics & BufferTimeStatistics & ConnectionStatistics & ConstraintCapStatistics & DecoderStatistics & DocumentStateModulesStatistics & IncomingDataModuleStatistics & MseModuleStatistics & PlaybackModuleStatistics & QualityOfServiceModuleStatistics & RenditionsModuleStatistics & SyncModuleStatistics & TelemetryModuleStatistics & VideoPlayerStatistics;
830
+ type ModuleStatistics = AdaptivityStatistics & BufferTimeStatistics & ConnectionStatistics & ConstraintCapStatistics & DecoderStatistics & DocumentStateModulesStatistics & IncomingDataModuleStatistics & JitterModuleStatistics & MseModuleStatistics & PlaybackModuleStatistics & QualityOfServiceModuleStatistics & RenditionsModuleStatistics & SyncModuleStatistics & TelemetryModuleStatistics & VideoPlayerStatistics;
801
831
  type Statistics = ModuleStatistics & ReturnType<UserAgentInformation["getUserAgentInformation"]> & {
802
832
  /**
803
833
  * Version of the @vindral/web-sdk being used.
@@ -839,11 +869,14 @@ type Statistics = ModuleStatistics & ReturnType<UserAgentInformation["getUserAge
839
869
  */
840
870
  timeToFirstFrame?: number;
841
871
  iosMediaElementEnabled?: boolean;
872
+ /**
873
+ * Average bitrate for the entire session in bits/second.
874
+ */
875
+ averageBitRate?: number;
842
876
  };
843
877
  declare class Vindral extends Emitter<PublicVindralEvents> {
844
878
  #private;
845
879
  private static MAX_POOL_SIZE;
846
- private static INITIAL_MAX_BIT_RATE;
847
880
  private static DISCONNECT_TIMEOUT;
848
881
  private static REMOVE_CUE_THRESHOLD;
849
882
  /**
@@ -1303,6 +1336,10 @@ interface VolumeState {
1303
1336
  */
1304
1337
  volume: number;
1305
1338
  }
1339
+ interface TimeShiftInfo {
1340
+ urls: string[];
1341
+ duration: string;
1342
+ }
1306
1343
  interface PublicVindralEvents {
1307
1344
  /**
1308
1345
  * When an error that requires action has occured
@@ -1399,6 +1436,10 @@ interface PublicVindralEvents {
1399
1436
  * from external sources such as OS media shortcuts or other native UI outside of the browser.
1400
1437
  */
1401
1438
  ["volume state"]: Readonly<VolumeState>;
1439
+ /**
1440
+ * Emitted when the timeshift URLs are updated.
1441
+ */
1442
+ ["timeshift info"]: Readonly<TimeShiftInfo>;
1402
1443
  ["buffer state event"]: Readonly<BufferStateEvent>;
1403
1444
  ["initialized media"]: void;
1404
1445
  }
@@ -1589,11 +1630,29 @@ declare class AirPlaySender extends Emitter<AirPlaySenderEvents> {
1589
1630
  private getHlsUrl;
1590
1631
  private checkHlsUrl;
1591
1632
  }
1633
+ interface FullscreenEvents {
1634
+ ["on fullscreen change"]: boolean;
1635
+ }
1636
+ declare class Fullscreen extends Emitter<FullscreenEvents> {
1637
+ private container;
1638
+ constructor(container: HTMLElement);
1639
+ unload: () => void;
1640
+ request: () => Promise<void>;
1641
+ exit: () => Promise<void>;
1642
+ private onChange;
1643
+ isFullscreen: () => boolean;
1644
+ isSupported: () => boolean;
1645
+ isFullscreenApiSupported: () => boolean;
1646
+ static isFullscreenApiSupported: (element: HTMLElement) => boolean;
1647
+ private isInIframe;
1648
+ private get requestFn();
1649
+ private get exitFn();
1650
+ }
1592
1651
  type ControllerAttributes = (typeof Controller.observedAttributes)[number];
1593
1652
  declare class Controller extends HTMLElement {
1594
1653
  #private;
1595
1654
  static observedAttributes: readonly [
1596
- ...("language" | "channels" | "buffering" | "paused" | "volume" | "muted" | "user-interacting" | "is-casting" | "cast-available" | "cast-receiver-name" | "ui-locked" | "hide-ui-on-pause" | "is-fullscreen" | "is-fullscreen-fallback" | "rendition-levels" | "rendition-level" | "max-video-bit-rate" | "channel-id" | "channel-group-id" | "pip-available" | "is-pip" | "airplay-available" | "is-airplaying" | "media" | "languages" | "text-tracks" | "text-track" | "needs-user-input-video" | "needs-user-input-audio" | "authentication-token" | "volume-level" | "cast" | "airplay" | "pip" | "fullscreen" | "vu-meter" | "poster-src")[],
1655
+ ...("language" | "channels" | "buffering" | "paused" | "volume" | "muted" | "duration" | "user-interacting" | "is-casting" | "cast-available" | "cast-receiver-name" | "ui-locked" | "hide-ui-on-pause" | "is-fullscreen" | "is-fullscreen-fallback" | "rendition-levels" | "rendition-level" | "max-video-bit-rate" | "max-initial-bit-rate" | "channel-id" | "channel-group-id" | "pip-available" | "is-pip" | "airplay-available" | "is-airplaying" | "media" | "languages" | "text-tracks" | "text-track" | "needs-user-input-video" | "needs-user-input-audio" | "authentication-token" | "volume-level" | "cast" | "airplay" | "pip" | "fullscreen" | "vu-meter" | "poster-src" | "timeshift")[],
1597
1656
  "url",
1598
1657
  "edge-url",
1599
1658
  "target-buffer-time",
@@ -1604,6 +1663,7 @@ declare class Controller extends HTMLElement {
1604
1663
  "min-buffer-time",
1605
1664
  "max-buffer-time",
1606
1665
  "max-audio-bit-rate",
1666
+ "max-initial-bit-rate",
1607
1667
  "burst-enabled",
1608
1668
  "mse-enabled",
1609
1669
  "mse-opus-enabled",
@@ -1634,7 +1694,9 @@ declare class Controller extends HTMLElement {
1634
1694
  attributeChangedCallback(name: ControllerAttributes, oldValue: string, newValue?: string): void;
1635
1695
  connectListener(component: HTMLElement): void;
1636
1696
  disconnectListener(component: HTMLElement): void;
1697
+ handleTimeShiftUpdate: (timeShift: string | false) => void;
1637
1698
  get instance(): Vindral | undefined;
1699
+ get fullscreen(): Fullscreen | undefined;
1638
1700
  get airPlay(): AirPlaySender | undefined;
1639
1701
  connect(): void;
1640
1702
  }
@@ -1720,7 +1782,7 @@ declare class PlayButton extends VindralButton {
1720
1782
  type PlayerAttributes = (typeof Player.observedAttributes)[number];
1721
1783
  declare class Player extends HTMLElement {
1722
1784
  #private;
1723
- static observedAttributes: readonly ("title" | "advanced" | "poster" | "language" | "channels" | "buffering" | "paused" | "volume" | "muted" | "user-interacting" | "is-casting" | "cast-available" | "cast-receiver-name" | "ui-locked" | "hide-ui-on-pause" | "is-fullscreen" | "is-fullscreen-fallback" | "rendition-levels" | "rendition-level" | "max-video-bit-rate" | "channel-id" | "channel-group-id" | "pip-available" | "is-pip" | "airplay-available" | "is-airplaying" | "media" | "languages" | "text-tracks" | "text-track" | "needs-user-input-video" | "needs-user-input-audio" | "authentication-token" | "volume-level" | "cast" | "airplay" | "pip" | "fullscreen" | "vu-meter" | "poster-src" | "url" | "offline" | "edge-url" | "target-buffer-time" | "cast-receiver-id" | "cast-background" | "log-level" | "max-size" | "min-buffer-time" | "max-buffer-time" | "max-audio-bit-rate" | "burst-enabled" | "mse-enabled" | "mse-opus-enabled" | "ios-background-play-enabled" | "ios-wake-lock-enabled" | "ios-media-element-enabled" | "abr-enabled" | "size-based-resolution-cap-enabled" | "telemetry-enabled" | "video-codecs" | "drm-headers" | "drm-queryparams" | "drm-widevine-video-robustness" | "drm-widevine-audio-robustness" | "drm-playready-video-robustness" | "drm-playready-audio-robustness" | "webtransport-enabled" | "reconnect-retries" | "auto-instance-enabled" | "refresh-poster-enabled" | "stream-poll-enabled")[];
1785
+ static observedAttributes: readonly ("title" | "poster" | "language" | "channels" | "buffering" | "paused" | "volume" | "muted" | "duration" | "user-interacting" | "is-casting" | "cast-available" | "cast-receiver-name" | "ui-locked" | "hide-ui-on-pause" | "is-fullscreen" | "is-fullscreen-fallback" | "rendition-levels" | "rendition-level" | "max-video-bit-rate" | "max-initial-bit-rate" | "channel-id" | "channel-group-id" | "pip-available" | "is-pip" | "airplay-available" | "is-airplaying" | "media" | "languages" | "text-tracks" | "text-track" | "needs-user-input-video" | "needs-user-input-audio" | "authentication-token" | "volume-level" | "cast" | "airplay" | "pip" | "fullscreen" | "vu-meter" | "poster-src" | "timeshift" | "url" | "advanced" | "offline" | "edge-url" | "target-buffer-time" | "cast-receiver-id" | "cast-background" | "log-level" | "max-size" | "min-buffer-time" | "max-buffer-time" | "max-audio-bit-rate" | "burst-enabled" | "mse-enabled" | "mse-opus-enabled" | "ios-background-play-enabled" | "ios-wake-lock-enabled" | "ios-media-element-enabled" | "abr-enabled" | "size-based-resolution-cap-enabled" | "telemetry-enabled" | "video-codecs" | "drm-headers" | "drm-queryparams" | "drm-widevine-video-robustness" | "drm-widevine-audio-robustness" | "drm-playready-video-robustness" | "drm-playready-audio-robustness" | "webtransport-enabled" | "reconnect-retries" | "auto-instance-enabled" | "refresh-poster-enabled" | "stream-poll-enabled")[];
1724
1786
  constructor();
1725
1787
  connectedCallback(): void;
1726
1788
  disconnectedCallback(): void;
@@ -1786,6 +1848,20 @@ declare class ScrollOverlay extends HTMLElement {
1786
1848
  set visible(value: boolean);
1787
1849
  get visible(): boolean;
1788
1850
  }
1851
+ declare class VindralRange extends HTMLElement {
1852
+ #private;
1853
+ static observedAttributes: string[];
1854
+ range: HTMLInputElement;
1855
+ constructor();
1856
+ connectedCallback(): void;
1857
+ disconnectedCallback(): void;
1858
+ attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
1859
+ enable(): void;
1860
+ disable(): void;
1861
+ handleEvent(event: Event): void;
1862
+ updateBar(): void;
1863
+ get keysUsed(): string[];
1864
+ }
1789
1865
  type UserInputPlayOverlayAttributes = (typeof VindralUserInputPlayOverlay.observedAttributes)[number];
1790
1866
  declare class VindralUserInputPlayOverlay extends HTMLElement {
1791
1867
  #private;
@@ -1815,20 +1891,6 @@ declare class VindralPlayOverlay extends HTMLElement {
1815
1891
  disconnectedCallback(): void;
1816
1892
  attributeChangedCallback(name: string, old: string | null, value: string | null): void;
1817
1893
  }
1818
- declare class VindralRange extends HTMLElement {
1819
- #private;
1820
- static observedAttributes: string[];
1821
- range: HTMLInputElement;
1822
- constructor();
1823
- connectedCallback(): void;
1824
- disconnectedCallback(): void;
1825
- attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
1826
- enable(): void;
1827
- disable(): void;
1828
- handleEvent(event: Event): void;
1829
- updateBar(): void;
1830
- get keysUsed(): string[];
1831
- }
1832
1894
  type VolumeRangeAttributes = (typeof VolumeRange.observedAttributes)[number];
1833
1895
  declare class VolumeRange extends VindralRange {
1834
1896
  #private;
@@ -1840,11 +1902,11 @@ declare class VolumeRange extends VindralRange {
1840
1902
  get volume(): string;
1841
1903
  get muted(): boolean;
1842
1904
  }
1843
- type CustomElement<T, K extends string> = DetailedHTMLProps<HtmlHTMLAttributes<T> & {
1905
+ type CustomElement<T, K extends string> = Partial<Omit<DetailedHTMLProps<HtmlHTMLAttributes<T>, T>, "class"> & {
1844
1906
  [Key in K]?: string;
1845
1907
  } & {
1846
1908
  class?: string;
1847
- }, T>;
1909
+ }>;
1848
1910
  /**
1849
1911
  * @ignore
1850
1912
  */