fix(overlay): poll cheap playback state in the open subtitle sidebar (#290)

This commit is contained in:
sudacode authored and GitHub committed 2026-10-11 00:35:27 -07:00
1 parent 7108e086ba
commit a6d96e9966
14 files changed
+286 -108

No files matched your search

+13 -3
View File
@@ -226,15 +226,25 @@ export interface SubtitleData {
endTime?: number | null;
}
export interface SubtitleSidebarSnapshot {
/**
* Per-tick sidebar state, served from main's cached state without mpv round-trips. When
* `sourceKey` or `cuesRevision` differs from the last full snapshot's, the renderer fetches a
* new `SubtitleSidebarSnapshot`.
*/
export interface SubtitleSidebarPlaybackState {
sourceKey: string | null;
cues: SubtitleCue[];
currentTimeSec?: number | null;
/** Bumps whenever main swaps in a different parsed cue array. */
cuesRevision: number;
currentTimeSec: number | null;
currentSubtitle: {
text: string;
startTime: number | null;
endTime: number | null;
};
}
export interface SubtitleSidebarSnapshot extends SubtitleSidebarPlaybackState {
cues: SubtitleCue[];
config: SubtitleSidebarSnapshotConfig;
}