strataplayer 1.2.18 → 1.2.20

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,10 @@ 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;
254
+ private formatDuration;
246
255
  attach(container: HTMLElement): void;
247
256
  use(plugin: IPlugin): void;
248
257
  setSources(sources: PlayerSource[], tracks?: TextTrackConfig[]): void;
@@ -275,11 +284,15 @@ export declare class StrataCore {
275
284
  requestCast(): void;
276
285
  private loadMediaToCast;
277
286
  private handleCueChange;
278
- setSubtitle(index: number): void;
287
+ setSubtitle(index: number): Promise<void>;
279
288
  updateSubtitleSettings(settings: Partial<SubtitleSettings>): void;
280
289
  resetSubtitleSettings(): void;
281
290
  setSubtitleOffset(offset: number): void;
282
- download(): Promise<void>;
291
+ cancelDownload(): void;
292
+ download(options?: {
293
+ format?: 'ts' | 'mp4';
294
+ }): Promise<void>;
295
+ downloadHls(url: string, format: 'ts' | 'mp4'): Promise<void>;
283
296
  notify(n: Omit<Notification, 'id'> & {
284
297
  id?: string;
285
298
  }): string;