strataplayer 1.2.19 → 1.2.21

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/README.md CHANGED
@@ -172,7 +172,9 @@ The `<StrataPlayer />` component accepts the following configuration options.
172
172
  | **themeColor** | `string` | `'#6366f1'` | Primary accent color (Hex, RGB). |
173
173
  | **iconSize** | `string` | `'medium'` | `'small'`, `'medium'`, or `'large'`. |
174
174
  | **backdrop** | `boolean` | `true` | Enable background blur effects in menus. |
175
- | **autoSize** | `boolean` | `false` | Toggles `object-fit: cover`. |
175
+ | **autoSize** | `boolean` | `false` | Toggles `object-fit: cover`. (Legacy: use `videoFit`) |
176
+ | **videoFit** | `string` | `'contain'` | Sets initial video scaling (`contain`, `cover`, `fill`, `none`). |
177
+ | **brightness** | `number` | `1` | Initial video brightness filter (0.0 to 2.0). |
176
178
  | **highlight** | `Highlight[]` | `[]` | Markers to display on the timeline. |
177
179
 
178
180
  ### Functionality & Controls
@@ -253,4 +255,3 @@ Contributions are welcome! Please follow these steps:
253
255
  ## License
254
256
 
255
257
  Distributed under the MIT License. See `LICENSE` for more information.
256
-
@@ -39,6 +39,7 @@ export interface SubtitleSettings {
39
39
  }
40
40
  export declare const DEFAULT_SUBTITLE_SETTINGS: SubtitleSettings;
41
41
  export type PlayerTheme = 'default' | 'pixel' | 'game' | 'hacker';
42
+ export type VideoFit = 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
42
43
  export interface PlayerSource {
43
44
  url: string;
44
45
  type?: 'hls' | 'mp4' | 'webm' | 'dash' | 'mpegts' | 'webtorrent' | string;
@@ -151,6 +152,8 @@ export interface PlayerState {
151
152
  vertical: boolean;
152
153
  };
153
154
  aspectRatio: string;
155
+ videoFit: VideoFit;
156
+ brightness: number;
154
157
  isAutoSized: boolean;
155
158
  isLooping: boolean;
156
159
  controlsVisible: boolean;
@@ -172,6 +175,8 @@ export interface StrataConfig {
172
175
  iconSize?: 'small' | 'medium' | 'large';
173
176
  backdrop?: boolean;
174
177
  autoSize?: boolean;
178
+ brightness?: number;
179
+ videoFit?: VideoFit;
175
180
  subtitleSettings?: Partial<SubtitleSettings>;
176
181
  screenshot?: boolean;
177
182
  setting?: boolean;
@@ -217,7 +222,7 @@ export declare class StrataCore {
217
222
  private currentSource;
218
223
  private currentSrc;
219
224
  private trackConfigs;
220
- private currentDownloadController;
225
+ private activeDownloads;
221
226
  private castInitialized;
222
227
  private boundCueChange;
223
228
  private boundFullscreenChange;
@@ -251,6 +256,7 @@ export declare class StrataCore {
251
256
  private updateSubtitleTrackState;
252
257
  fetchWithRetry(url: string, retries?: number, timeout?: number, signal?: AbortSignal): Promise<Response>;
253
258
  private convertToVTT;
259
+ private formatDuration;
254
260
  attach(container: HTMLElement): void;
255
261
  use(plugin: IPlugin): void;
256
262
  setSources(sources: PlayerSource[], tracks?: TextTrackConfig[]): void;
@@ -278,6 +284,8 @@ export declare class StrataCore {
278
284
  toggleLoop(): void;
279
285
  setFlip(direction: 'horizontal' | 'vertical'): void;
280
286
  setAspectRatio(ratio: string): void;
287
+ setVideoFit(fit: VideoFit): void;
288
+ setBrightness(val: number): void;
281
289
  private updateAspectRatio;
282
290
  private initCast;
283
291
  requestCast(): void;
@@ -287,7 +295,7 @@ export declare class StrataCore {
287
295
  updateSubtitleSettings(settings: Partial<SubtitleSettings>): void;
288
296
  resetSubtitleSettings(): void;
289
297
  setSubtitleOffset(offset: number): void;
290
- cancelDownload(): void;
298
+ cancelDownload(id?: string): void;
291
299
  download(options?: {
292
300
  format?: 'ts' | 'mp4';
293
301
  }): Promise<void>;