@omnimedia/omnitool
Version:
open source video processing tools
40 lines (39 loc) • 1.36 kB
TypeScript
import { CanvasSinkOptions, WrappedCanvas } from "mediabunny";
import { DecoderSource } from '../../driver/fns/schematic.js';
export declare class Filmstrip {
#private;
private videoTrack;
private options;
private constructor();
static init(source: DecoderSource, options: FilmstripOptions): Promise<Filmstrip>;
/**
* Sets the frequency (granularity) of filmstrip thumbnails.
* Changing this triggers a filmstrip refresh after any ongoing update finishes.
* @param value - The new frequency in seconds.
*/
set frequency(value: number);
get frequency(): number;
/**
* Updates the visible time range for the filmstrip.
*
* Triggers a thumbnails update, with extended margins to preload
* thumbnails slightly outside the visible range.
* @param visibleRange - The current timeline viewport as a [start, end] tuple in seconds.
*/
set range(visibleRange: TimeRange);
/**
* Returns the cached thumbnail (if any) for a given timestamp.
* @param time - The timestamp to retrieve the canvas for.
*/
getThumbnail(time: number): any;
}
type TimeRange = [number, number];
interface FilmstripOptions {
frequency?: number;
canvasSinkOptions?: CanvasSinkOptions;
onChange: (tiles: {
time: number;
canvas: WrappedCanvas;
}[]) => void;
}
export {};