@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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.1.4",
2
+ "version": "4.1.5",
3
3
  "name": "@vindral/web-sdk",
4
4
  "main": "./legacy.umd.js",
5
5
  "module": "./legacy.es.js",
package/player.d.ts CHANGED
@@ -15,6 +15,10 @@ interface Channel {
15
15
  * URLs to fetch thumbnail from
16
16
  */
17
17
  thumbnailUrls: string[];
18
+ /**
19
+ * Urls for timeshift if available
20
+ */
21
+ timeshiftUrls?: string[];
18
22
  }
19
23
  interface ClientOverrides {
20
24
  maxVideoBitRate?: number;
@@ -213,6 +217,10 @@ interface MoQConnectInfo {
213
217
  telemetry?: Telemetry;
214
218
  channels: ChannelWithCatalog[];
215
219
  edges: Edge[];
220
+ timeshift: {
221
+ urls: string[];
222
+ duration: string;
223
+ };
216
224
  }
217
225
  interface VindralConnectInfo {
218
226
  logsUrl?: string;
@@ -423,6 +431,14 @@ interface Options {
423
431
  * This can be used to provide user options to limit the video bandwidth usage.
424
432
  */
425
433
  maxVideoBitRate?: number;
434
+ /**
435
+ * Initial maximum bit rate cap applied when first connecting to a channel.
436
+ * This helps prevent buffering on initial connection by starting at a conservative bitrate.
437
+ * The client will adapt to higher bitrates as bandwidth allows if ABR is enabled.
438
+ *
439
+ * Default is 2.5 Mbps (2500000 bits per second).
440
+ */
441
+ maxInitialBitRate?: number;
426
442
  /**
427
443
  * Controls video element background behaviour while loading.
428
444
  * - If `false`, a black background will be shown.
@@ -744,11 +760,11 @@ interface QualityOfServiceModuleStatistics {
744
760
  */
745
761
  fatalQosCount: number;
746
762
  /**
747
- * Ratio of time being spent on different bitrates.
748
- * Example: `"timeSpentRatio": { "1160000": 0.2, "2260000": 0.8 }` shows 20% spent on 1.16 Mbps, 80% spent on 2.26 Mbps.
763
+ * Ratio of time being spent on different quality indexes. Index 0 is always the highest quality.
764
+ * Example: `"timeSpentRatio": { "0": 0.8, "1": 0.2 }` shows 80% spent on the best level, 20% on the next one.
749
765
  */
750
766
  timeSpentRatio: {
751
- [bitRate: string]: number;
767
+ [qualityIndex: string]: number;
752
768
  };
753
769
  }
754
770
  interface SyncModuleStatistics {
@@ -757,6 +773,20 @@ interface SyncModuleStatistics {
757
773
  timeshiftDriftAdjustmentCount: number;
758
774
  seekTime: number;
759
775
  }
776
+ interface JitterStatistics {
777
+ /** Minimum jitter in the recent window */
778
+ min: number;
779
+ /** Maximum jitter in the recent window for spike detection */
780
+ max: number;
781
+ /** Latest average jitter in ms (recent window) */
782
+ last: number;
783
+ /** Average jitter in ms (RFC 3550 style, smoothed with /16) */
784
+ average: number;
785
+ }
786
+ interface JitterModuleStatistics {
787
+ audioJitter: JitterStatistics | undefined;
788
+ videoJitter: JitterStatistics | undefined;
789
+ }
760
790
  interface VideoPlayerStatistics {
761
791
  renderedFrameCount: number;
762
792
  rendererDroppedFrameCount: number;
@@ -795,7 +825,7 @@ declare class UserAgentInformation {
795
825
  userAgent: string;
796
826
  };
797
827
  }
798
- type ModuleStatistics = AdaptivityStatistics & BufferTimeStatistics & ConnectionStatistics & ConstraintCapStatistics & DecoderStatistics & DocumentStateModulesStatistics & IncomingDataModuleStatistics & MseModuleStatistics & PlaybackModuleStatistics & QualityOfServiceModuleStatistics & RenditionsModuleStatistics & SyncModuleStatistics & TelemetryModuleStatistics & VideoPlayerStatistics;
828
+ type ModuleStatistics = AdaptivityStatistics & BufferTimeStatistics & ConnectionStatistics & ConstraintCapStatistics & DecoderStatistics & DocumentStateModulesStatistics & IncomingDataModuleStatistics & JitterModuleStatistics & MseModuleStatistics & PlaybackModuleStatistics & QualityOfServiceModuleStatistics & RenditionsModuleStatistics & SyncModuleStatistics & TelemetryModuleStatistics & VideoPlayerStatistics;
799
829
  type Statistics = ModuleStatistics & ReturnType<UserAgentInformation["getUserAgentInformation"]> & {
800
830
  /**
801
831
  * Version of the @vindral/web-sdk being used.
@@ -837,11 +867,14 @@ type Statistics = ModuleStatistics & ReturnType<UserAgentInformation["getUserAge
837
867
  */
838
868
  timeToFirstFrame?: number;
839
869
  iosMediaElementEnabled?: boolean;
870
+ /**
871
+ * Average bitrate for the entire session in bits/second.
872
+ */
873
+ averageBitRate?: number;
840
874
  };
841
875
  declare class Vindral extends Emitter<PublicVindralEvents> {
842
876
  #private;
843
877
  private static MAX_POOL_SIZE;
844
- private static INITIAL_MAX_BIT_RATE;
845
878
  private static DISCONNECT_TIMEOUT;
846
879
  private static REMOVE_CUE_THRESHOLD;
847
880
  /**
@@ -1301,6 +1334,10 @@ interface VolumeState {
1301
1334
  */
1302
1335
  volume: number;
1303
1336
  }
1337
+ interface TimeShiftInfo {
1338
+ urls: string[];
1339
+ duration: string;
1340
+ }
1304
1341
  interface PublicVindralEvents {
1305
1342
  /**
1306
1343
  * When an error that requires action has occured
@@ -1397,6 +1434,10 @@ interface PublicVindralEvents {
1397
1434
  * from external sources such as OS media shortcuts or other native UI outside of the browser.
1398
1435
  */
1399
1436
  ["volume state"]: Readonly<VolumeState>;
1437
+ /**
1438
+ * Emitted when the timeshift URLs are updated.
1439
+ */
1440
+ ["timeshift info"]: Readonly<TimeShiftInfo>;
1400
1441
  ["buffer state event"]: Readonly<BufferStateEvent>;
1401
1442
  ["initialized media"]: void;
1402
1443
  }
@@ -1580,11 +1621,29 @@ declare class AirPlaySender extends Emitter<AirPlaySenderEvents> {
1580
1621
  private getHlsUrl;
1581
1622
  private checkHlsUrl;
1582
1623
  }
1624
+ interface FullscreenEvents {
1625
+ ["on fullscreen change"]: boolean;
1626
+ }
1627
+ declare class Fullscreen extends Emitter<FullscreenEvents> {
1628
+ private container;
1629
+ constructor(container: HTMLElement);
1630
+ unload: () => void;
1631
+ request: () => Promise<void>;
1632
+ exit: () => Promise<void>;
1633
+ private onChange;
1634
+ isFullscreen: () => boolean;
1635
+ isSupported: () => boolean;
1636
+ isFullscreenApiSupported: () => boolean;
1637
+ static isFullscreenApiSupported: (element: HTMLElement) => boolean;
1638
+ private isInIframe;
1639
+ private get requestFn();
1640
+ private get exitFn();
1641
+ }
1583
1642
  type ControllerAttributes = (typeof Controller.observedAttributes)[number];
1584
1643
  export declare class Controller extends HTMLElement {
1585
1644
  #private;
1586
1645
  static observedAttributes: readonly [
1587
- ...("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")[],
1646
+ ...("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")[],
1588
1647
  "url",
1589
1648
  "edge-url",
1590
1649
  "target-buffer-time",
@@ -1595,6 +1654,7 @@ export declare class Controller extends HTMLElement {
1595
1654
  "min-buffer-time",
1596
1655
  "max-buffer-time",
1597
1656
  "max-audio-bit-rate",
1657
+ "max-initial-bit-rate",
1598
1658
  "burst-enabled",
1599
1659
  "mse-enabled",
1600
1660
  "mse-opus-enabled",
@@ -1625,7 +1685,9 @@ export declare class Controller extends HTMLElement {
1625
1685
  attributeChangedCallback(name: ControllerAttributes, oldValue: string, newValue?: string): void;
1626
1686
  connectListener(component: HTMLElement): void;
1627
1687
  disconnectListener(component: HTMLElement): void;
1688
+ handleTimeShiftUpdate: (timeShift: string | false) => void;
1628
1689
  get instance(): Vindral | undefined;
1690
+ get fullscreen(): Fullscreen | undefined;
1629
1691
  get airPlay(): AirPlaySender | undefined;
1630
1692
  connect(): void;
1631
1693
  }
@@ -1704,7 +1766,7 @@ export declare class PlayButton extends VindralButton {
1704
1766
  }
1705
1767
  export declare class Player extends HTMLElement {
1706
1768
  #private;
1707
- 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")[];
1769
+ 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")[];
1708
1770
  constructor();
1709
1771
  connectedCallback(): void;
1710
1772
  disconnectedCallback(): void;
@@ -1767,6 +1829,20 @@ export declare class ScrollOverlay extends HTMLElement {
1767
1829
  set visible(value: boolean);
1768
1830
  get visible(): boolean;
1769
1831
  }
1832
+ declare class VindralRange extends HTMLElement {
1833
+ #private;
1834
+ static observedAttributes: string[];
1835
+ range: HTMLInputElement;
1836
+ constructor();
1837
+ connectedCallback(): void;
1838
+ disconnectedCallback(): void;
1839
+ attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
1840
+ enable(): void;
1841
+ disable(): void;
1842
+ handleEvent(event: Event): void;
1843
+ updateBar(): void;
1844
+ get keysUsed(): string[];
1845
+ }
1770
1846
  declare class VindralUserInputPlayOverlay extends HTMLElement {
1771
1847
  #private;
1772
1848
  static observedAttributes: string[];
@@ -1793,20 +1869,6 @@ declare class VindralPlayOverlay extends HTMLElement {
1793
1869
  disconnectedCallback(): void;
1794
1870
  attributeChangedCallback(name: string, old: string | null, value: string | null): void;
1795
1871
  }
1796
- declare class VindralRange extends HTMLElement {
1797
- #private;
1798
- static observedAttributes: string[];
1799
- range: HTMLInputElement;
1800
- constructor();
1801
- connectedCallback(): void;
1802
- disconnectedCallback(): void;
1803
- attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
1804
- enable(): void;
1805
- disable(): void;
1806
- handleEvent(event: Event): void;
1807
- updateBar(): void;
1808
- get keysUsed(): string[];
1809
- }
1810
1872
  export declare class VolumeRange extends VindralRange {
1811
1873
  #private;
1812
1874
  static observedAttributes: string[];