import { Api } from './api'; import { Observable } from 'rxjs'; import { PlayheadMoveEvent, ScrubberMoveEvent, TimecodeClickEvent, TimecodeMouseMoveEvent, TimelineReadyEvent, TimelineScrollEvent, TimelineZoomEvent } from '../types'; import { ScrubberLane, TimelineStyle } from '../timeline'; import { TimelineLaneApi } from './timeline-lane-api'; import { ThumbnailVttFile } from '../vtt'; export interface TimelineApi extends Api { /** * Fires when Timeline is ready and all timeline lanes are created. Initial value is undefined. * Always emits the current value on subscription. * * @readonly */ onReady$: Observable; /** * Fires on Timeline scroll * @readonly */ onScroll$: Observable; /** * Fires on Timeline zoom * @readonly */ onZoom$: Observable; /** * Fires on Timeline style change * @readonly */ onStyleChange$: Observable; /** * Fires on click anywhere on Timeline where timecode of the video can be determined */ onTimecodeClick$: Observable; /** * Fires on mouse move anywhere on Timeline where timecode of the video can be determined */ onTimecodeMouseMove$: Observable; /** * Fires on moving the scrubber */ onScrubberMove$: Observable; /** * Fires on moving the playhead */ onPlayheadMove$: Observable; /** * Style getter / setter */ style: TimelineStyle; /** * Thumbnail VTT file * @readonly */ get thumbnailVttFile(): ThumbnailVttFile | undefined; /** * @returns true if visible, false if not visible */ get descriptionPaneVisible(): boolean; /** * Timeline zoom * @param percent number between 100 and TimelineConfig.zoomMax */ zoomTo(percent: number): number; /** * Timeline zoom * @param percent number between 100 and {@link TimelineConfig.zoomMax} * @param zoomFocusPercent in range from 0 - timeline start or first timestamp, to 100 - timeline end or last timestamop */ zoomTo(percent: number, zoomFocusPercent: number | undefined): number; /** * Timeline zoom * @param percent number between 100 and {@link TimelineConfig.zoomMax} */ zoomToEased(percent: number): Observable; /** * Timeline zoom * @param percent number between 100 and {@link TimelineConfig.zoomMax} * @param zoomFocusPercent in range from 0 - timeline start or first timestamp, to 100 - timeline end or last timestamop */ zoomToEased(percent: number, zoomFocusPercent: number | undefined): Observable; /** * Zoom in. Zoom scale in single method call is defined with TimelineConfig.zoomScale */ zoomInEased(): Observable; /** * Zoom out. Zoom scale in single method call is defined with {@link TimelineConfig.zoomScale} */ zoomOutEased(): Observable; /** * Zoom to max resolution */ zoomToMaxEased(): Observable; /** * @returns current zoom perent */ getZoomPercent(): number; /** * Scrolls timeline * @param percent in range from 0 - timeline start or first timestamp, to 100 - timeline end or last timestamop */ scrollToEased(percent: number): Observable; /** * Scrolls timeline to playhead position */ scrollToPlayheadEased(): Observable; /** * Adds {@link TimelineLaneApi} instance to timeline * @param timelineLane */ addTimelineLane(timelineLane: TimelineLaneApi): TimelineLaneApi; /** * Adds {@link TimelineLaneApi} instance to timeline * @param timelineLane * @param index */ addTimelineLaneAtIndex(timelineLane: TimelineLaneApi, index: number): TimelineLaneApi; /** * Removes {@link TimelineLaneApi} instance by id * @param id {@link TimelineLaneApi.id} */ removeTimelineLane(id: string): void; /** * Removes {@link TimelineLaneApi} instances by ids * @param ids {@link TimelineLaneApi.id}s */ removeTimelineLanes(ids: string[]): void; /** * Removes all timeline lanes */ removeAllTimelineLanes(): void; /** * Adds multiple instantiated {@link TimelineLaneApi} instances to timeline * @param timelineLanes */ addTimelineLanes(timelineLanes: TimelineLaneApi[]): TimelineLaneApi[]; /** * @returns all {@link TimelineLaneApi} instances */ getTimelineLanes(): TimelineLaneApi[]; /** * @returns single {@link TimelineLaneApi} instance * @param id {@link TimelineLaneApi.id} */ getTimelineLane(id: string): T | undefined; /** * @returns ScrubberLane instance */ getScrubberLane(): ScrubberLane; /** * Shows or hides Timeline description pane */ setDescriptionPaneVisible(visible: boolean): void; /** * Toggles Timeline description pane */ toggleDescriptionPaneVisible(): void; /** * Shows or hides Timeline description pane */ setDescriptionPaneVisibleEased(visible: boolean): Observable; /** * Toggles Timeline description pane */ toggleDescriptionPaneVisibleEased(): Observable; /** * Toggles the CTI between its interactive and read-only state */ toggleTimecodeEdit(): void; /** * Load ThumbnailVttFile */ loadThumbnailVttFileFromUrl(vttUrl: string): Observable; /** * Load ThumbnailVttFile by url */ loadThumbnailVttFile(vttFile: ThumbnailVttFile): void; /** * Minimize timeline lanes * @param timelineLanes */ minimizeTimelineLanes(timelineLanes: TimelineLaneApi[]): void; /** * Maximize timeline lanes * @param timelineLanes */ maximizeTimelineLanes(timelineLanes: TimelineLaneApi[]): void; /** * Recalculates and settles layout, called on window resize event */ settleLayout(): void; /** * Destroys Timeline and it's dependencies */ destroy(): void; }