strataplayer 1.2.18 → 1.2.19

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.
@@ -8,6 +8,10 @@ export interface Notification {
8
8
  type: 'info' | 'success' | 'warning' | 'error' | 'loading';
9
9
  duration?: number;
10
10
  progress?: number;
11
+ action?: {
12
+ label: string;
13
+ onClick: () => void;
14
+ };
11
15
  }
12
16
  export interface TextTrackConfig {
13
17
  src: string;
@@ -16,6 +20,11 @@ export interface TextTrackConfig {
16
20
  default?: boolean;
17
21
  kind?: 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata';
18
22
  }
23
+ export interface SubtitleTrackState extends TextTrackConfig {
24
+ index: number;
25
+ status: 'idle' | 'loading' | 'success' | 'error';
26
+ isDefault?: boolean;
27
+ }
19
28
  export interface SubtitleSettings {
20
29
  useNative: boolean;
21
30
  fixCapitalization: boolean;
@@ -64,6 +73,7 @@ export interface SettingItem {
64
73
  icon?: string | React.ReactNode;
65
74
  tooltip?: string;
66
75
  separator?: boolean;
76
+ isLabel?: boolean;
67
77
  active?: boolean;
68
78
  value?: any;
69
79
  switch?: boolean;
@@ -122,11 +132,7 @@ export interface PlayerState {
122
132
  isFullscreen: boolean;
123
133
  isWebFullscreen: boolean;
124
134
  isPip: boolean;
125
- subtitleTracks: {
126
- label: string;
127
- language: string;
128
- index: number;
129
- }[];
135
+ subtitleTracks: SubtitleTrackState[];
130
136
  currentSubtitle: number;
131
137
  subtitleOffset: number;
132
138
  subtitleSettings: SubtitleSettings;
@@ -210,7 +216,8 @@ export declare class StrataCore {
210
216
  private retryTimer;
211
217
  private currentSource;
212
218
  private currentSrc;
213
- private currentTracks;
219
+ private trackConfigs;
220
+ private currentDownloadController;
214
221
  private castInitialized;
215
222
  private boundCueChange;
216
223
  private boundFullscreenChange;
@@ -241,8 +248,9 @@ export declare class StrataCore {
241
248
  triggerError(message: string, isFatal?: boolean): void;
242
249
  private handleError;
243
250
  private updateBuffer;
244
- private updateSubtitles;
245
- fetchWithRetry(url: string, retries?: number, timeout?: number): Promise<Response>;
251
+ private updateSubtitleTrackState;
252
+ fetchWithRetry(url: string, retries?: number, timeout?: number, signal?: AbortSignal): Promise<Response>;
253
+ private convertToVTT;
246
254
  attach(container: HTMLElement): void;
247
255
  use(plugin: IPlugin): void;
248
256
  setSources(sources: PlayerSource[], tracks?: TextTrackConfig[]): void;
@@ -275,11 +283,15 @@ export declare class StrataCore {
275
283
  requestCast(): void;
276
284
  private loadMediaToCast;
277
285
  private handleCueChange;
278
- setSubtitle(index: number): void;
286
+ setSubtitle(index: number): Promise<void>;
279
287
  updateSubtitleSettings(settings: Partial<SubtitleSettings>): void;
280
288
  resetSubtitleSettings(): void;
281
289
  setSubtitleOffset(offset: number): void;
282
- download(): Promise<void>;
290
+ cancelDownload(): void;
291
+ download(options?: {
292
+ format?: 'ts' | 'mp4';
293
+ }): Promise<void>;
294
+ downloadHls(url: string, format: 'ts' | 'mp4'): Promise<void>;
283
295
  notify(n: Omit<Notification, 'id'> & {
284
296
  id?: string;
285
297
  }): string;