@oddin-gg/havik-player 2.17.0 → 2.19.0

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/dist/index.d.cts CHANGED
@@ -98,6 +98,9 @@ export declare interface CatalogTournament {
98
98
  */
99
99
  export declare function clearDeviceId(): void;
100
100
 
101
+ /** Forget every remembered estimate (privacy / "reset player data" control). */
102
+ export declare function clearRememberedBandwidth(): void;
103
+
101
104
  /**
102
105
  * Endpoint selection, enforced at COMPILE time.
103
106
  *
@@ -193,6 +196,17 @@ export declare interface CreatePlayerOptions {
193
196
  * return is the one from before leaving. Default: true. Live/LL only.
194
197
  */
195
198
  snapToLiveOnRefocus?: boolean;
199
+ /**
200
+ * Start a stream at the quality this device's last measured speed allows,
201
+ * instead of always at ~360p. The hls.js engine saves its bandwidth estimate
202
+ * in localStorage (key `havik.player.bandwidth`, per connection type where the
203
+ * browser reports one) after ~10 s of playback and reuses it, discounted to
204
+ * 80%, for up to 3 days; a device that measured a slow line starts from that
205
+ * lower figure (never below 0.3 Mbps). A first visit, a stale record, or
206
+ * blocked storage keeps the conservative ~1 Mbps start. An explicit
207
+ * hlsConfig.abrEwmaDefaultEstimate or startLevel still wins. Default: true.
208
+ */
209
+ rememberBandwidth?: boolean;
196
210
  /**
197
211
  * DRM cold start: download the first init segment and parts while the
198
212
  * first key is still being acquired, instead of after it (hls.js waits for
@@ -610,6 +624,26 @@ export declare type FrameToHost = {
610
624
  message: string;
611
625
  };
612
626
 
627
+ /**
628
+ * Whether a fullscreen presentation for `video` can work, by the same
629
+ * ladder enterVideoFullscreen walks. False means a request is KNOWN to
630
+ * fail, so the caller should hide its button:
631
+ *
632
+ * - the element API exists on `container` (or the video) but the document
633
+ * reports `fullscreenEnabled === false` — the Fullscreen spec sets that
634
+ * exactly when permissions policy blocks the feature, which is what a
635
+ * cross-origin iframe without `fullscreen` in its `allow` list looks
636
+ * like (prefixed `webkitFullscreenEnabled` on older Safari);
637
+ * - no element API at all, media already loaded, and the video does not
638
+ * offer the video-native presentation either (a webview with nothing).
639
+ *
640
+ * True otherwise — including "not known yet": with no element API and
641
+ * media not loaded (iPhone before the first play) the video-native flag
642
+ * is not readable, so the answer stays optimistic. Re-check on
643
+ * `loadedmetadata`; the managed control bar does.
644
+ */
645
+ export declare function fullscreenSupported(video: HTMLVideoElement, container?: HTMLElement): boolean;
646
+
613
647
  export declare function getDeviceId(): string;
614
648
 
615
649
  /**
@@ -983,6 +1017,14 @@ export declare interface Player {
983
1017
  enterFullscreen(): Promise<boolean>;
984
1018
  /** Leave fullscreen (element or video-native). Safe when not fullscreen. */
985
1019
  exitFullscreen(): Promise<void>;
1020
+ /**
1021
+ * Whether enterFullscreen can work here: false when the page's permissions
1022
+ * policy blocks fullscreen (an iframe without `fullscreen` in `allow`) or
1023
+ * the platform has no mechanism, so a custom UI can hide its button. Stays
1024
+ * true before media loads on iPhone (not knowable yet); re-check on the
1025
+ * video's `loadedmetadata`.
1026
+ */
1027
+ fullscreenSupported(): boolean;
986
1028
  /** Retry playback after an error (re-resolves and re-attaches). */
987
1029
  retry(): Promise<void>;
988
1030
  /** Re-resolve playback (refreshes the signed license URL) and re-attach. */
package/dist/index.d.ts CHANGED
@@ -98,6 +98,9 @@ export declare interface CatalogTournament {
98
98
  */
99
99
  export declare function clearDeviceId(): void;
100
100
 
101
+ /** Forget every remembered estimate (privacy / "reset player data" control). */
102
+ export declare function clearRememberedBandwidth(): void;
103
+
101
104
  /**
102
105
  * Endpoint selection, enforced at COMPILE time.
103
106
  *
@@ -193,6 +196,17 @@ export declare interface CreatePlayerOptions {
193
196
  * return is the one from before leaving. Default: true. Live/LL only.
194
197
  */
195
198
  snapToLiveOnRefocus?: boolean;
199
+ /**
200
+ * Start a stream at the quality this device's last measured speed allows,
201
+ * instead of always at ~360p. The hls.js engine saves its bandwidth estimate
202
+ * in localStorage (key `havik.player.bandwidth`, per connection type where the
203
+ * browser reports one) after ~10 s of playback and reuses it, discounted to
204
+ * 80%, for up to 3 days; a device that measured a slow line starts from that
205
+ * lower figure (never below 0.3 Mbps). A first visit, a stale record, or
206
+ * blocked storage keeps the conservative ~1 Mbps start. An explicit
207
+ * hlsConfig.abrEwmaDefaultEstimate or startLevel still wins. Default: true.
208
+ */
209
+ rememberBandwidth?: boolean;
196
210
  /**
197
211
  * DRM cold start: download the first init segment and parts while the
198
212
  * first key is still being acquired, instead of after it (hls.js waits for
@@ -610,6 +624,26 @@ export declare type FrameToHost = {
610
624
  message: string;
611
625
  };
612
626
 
627
+ /**
628
+ * Whether a fullscreen presentation for `video` can work, by the same
629
+ * ladder enterVideoFullscreen walks. False means a request is KNOWN to
630
+ * fail, so the caller should hide its button:
631
+ *
632
+ * - the element API exists on `container` (or the video) but the document
633
+ * reports `fullscreenEnabled === false` — the Fullscreen spec sets that
634
+ * exactly when permissions policy blocks the feature, which is what a
635
+ * cross-origin iframe without `fullscreen` in its `allow` list looks
636
+ * like (prefixed `webkitFullscreenEnabled` on older Safari);
637
+ * - no element API at all, media already loaded, and the video does not
638
+ * offer the video-native presentation either (a webview with nothing).
639
+ *
640
+ * True otherwise — including "not known yet": with no element API and
641
+ * media not loaded (iPhone before the first play) the video-native flag
642
+ * is not readable, so the answer stays optimistic. Re-check on
643
+ * `loadedmetadata`; the managed control bar does.
644
+ */
645
+ export declare function fullscreenSupported(video: HTMLVideoElement, container?: HTMLElement): boolean;
646
+
613
647
  export declare function getDeviceId(): string;
614
648
 
615
649
  /**
@@ -983,6 +1017,14 @@ export declare interface Player {
983
1017
  enterFullscreen(): Promise<boolean>;
984
1018
  /** Leave fullscreen (element or video-native). Safe when not fullscreen. */
985
1019
  exitFullscreen(): Promise<void>;
1020
+ /**
1021
+ * Whether enterFullscreen can work here: false when the page's permissions
1022
+ * policy blocks fullscreen (an iframe without `fullscreen` in `allow`) or
1023
+ * the platform has no mechanism, so a custom UI can hide its button. Stays
1024
+ * true before media loads on iPhone (not knowable yet); re-check on the
1025
+ * video's `loadedmetadata`.
1026
+ */
1027
+ fullscreenSupported(): boolean;
986
1028
  /** Retry playback after an error (re-resolves and re-attaches). */
987
1029
  retry(): Promise<void>;
988
1030
  /** Re-resolve playback (refreshes the signed license URL) and re-attach. */