@openrails/contentkit-ui 0.90.3 → 0.91.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.
@@ -1,5 +1,6 @@
1
1
  import { KeyboardEvent, MouseEvent, PointerEvent } from 'react';
2
2
  import { GalleryView } from '../client/gallery.js';
3
+ import { HlsLoader } from '../client/http.js';
3
4
  import { AbrPolicy, PlaybackError } from '../client/playback.js';
4
5
  import { PlayerTrack } from '../client/player.js';
5
6
  export declare const GALLERY_VIEW_KEY = "ckui.media-gallery.view";
@@ -44,8 +45,8 @@ export type PlayerStatus = "idle" | "loading" | "playing" | "paused" | "bufferin
44
45
  export interface HlsPlayerOptions {
45
46
  /** The master playlist; nothing loads while absent. */
46
47
  src?: string | null;
47
- /** Adds auth to playlist and segment requests (e.g. a bearer header for the app's read API). */
48
- xhrSetup?: (xhr: XMLHttpRequest, url: string) => void | Promise<void>;
48
+ /** Loads playlists with the app's credentials and prepares segment requests: the media client's `hls`. */
49
+ loader?: HlsLoader;
49
50
  /**
50
51
  * Re-grants access (refetch the read API). Called shortly before `expires`,
51
52
  * and once after a 401, 403 or 404 — media-gateway answers an expired token
@@ -132,9 +133,11 @@ export interface UseHlsPlayer {
132
133
  /** The selected subtitle track's TextTrack is kept "hidden": its cues are the caller's to draw. */
133
134
  subtitles: PlayerTracks;
134
135
  }
136
+ /** Fetches a playlist: the loader's, else a plain fetch. */
137
+ export declare const fetchPlaylist: (loader: HlsLoader | undefined, url: string, signal?: AbortSignal) => Promise<Response>;
135
138
  /**
136
139
  * HLS playback that fails fast with a reason: hls.js (lazy-loaded) or native
137
140
  * HLS, tuned retries, a grant refresh before expiry and one on 401/403/404,
138
141
  * and a stall watchdog.
139
142
  */
140
- export declare function useHlsPlayer({ src, xhrSetup, refresh, expires, active, stallTimeout, abr, qualityKey, startAt, autoPlay, audioLanguage, subtitleLanguage, volumeKey, trackKey, }: HlsPlayerOptions): UseHlsPlayer;
143
+ export declare function useHlsPlayer({ src, loader, refresh, expires, active, stallTimeout, abr, qualityKey, startAt, autoPlay, audioLanguage, subtitleLanguage, volumeKey, trackKey, }: HlsPlayerOptions): UseHlsPlayer;