mirror of
https://github.com/zoriya/libpgs-js.git
synced 2026-08-27 00:00:51 +00:00
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.
35 lines
1.1 KiB
TypeScript
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;
|
|
}
|