Files
libpgs-js/dist/pgsRendererOptions.d.ts
T
zoriya bfd15e68bc Commit the build output.
Not for upstream: this branch only exists so a consumer can depend on the fork
straight from git while the `ready` promise waits on a release.
2026-08-26 19:23:04 +02:00

35 lines
1.1 KiB
TypeScript

import { PgsRendererMode } from "./pgsRendererMode";
export interface PgsRendererOptions {
/**
* The video element to sync the subtitle to.
* Optional, if you provide a custom canvas and use `renderAtTimestamp` to manually update the timestamp.
*/
video?: HTMLVideoElement;
/**
* The initial canvas element to draw the subtitles to.
* If not provided, the renderer creates its own canvas next to the video element.
*/
canvas?: HTMLCanvasElement;
/**
* The video-to-subtitle time offset in seconds.
*/
timeOffset?: number;
/**
* The canvas aspect ratio mode. This should match the `object-fit` property of the video.
*/
aspectRatio?: 'contain' | 'cover' | 'fill';
/**
* The initial subtitle file url to load from.
*/
subUrl?: string;
/**
* The url to the worker javascript file.
*/
workerUrl?: string;
/**
* The forced renderer mode.
* If not provided, the renderer checks the current browser to detect the best mode for your platform.
*/
mode?: PgsRendererMode;
}