fix: align youtube playback with shared overlay startup

This commit is contained in:
2026-03-22 18:34:25 -07:00
parent 7666a094f4
commit e7242d006f
31 changed files with 3545 additions and 60 deletions

View File

@@ -139,6 +139,7 @@ export interface MpvClient {
currentSubStart: number;
currentSubEnd: number;
currentAudioStreamIndex: number | null;
requestProperty?: (name: string) => Promise<unknown>;
send(command: { command: unknown[]; request_id?: number }): boolean;
}
@@ -559,6 +560,41 @@ export interface ControllerRuntimeSnapshot {
}
export type JimakuLanguagePreference = 'ja' | 'en' | 'none';
export type YoutubeFlowMode = 'download' | 'generate';
export type YoutubeTrackKind = 'manual' | 'auto';
export interface YoutubeTrackOption {
id: string;
language: string;
sourceLanguage: string;
kind: YoutubeTrackKind;
label: string;
title?: string;
downloadUrl?: string;
fileExtension?: string;
}
export interface YoutubePickerOpenPayload {
sessionId: string;
url: string;
mode: YoutubeFlowMode;
tracks: YoutubeTrackOption[];
defaultPrimaryTrackId: string | null;
defaultSecondaryTrackId: string | null;
hasTracks: boolean;
}
export interface YoutubePickerResolveRequest {
sessionId: string;
action: 'use-selected' | 'continue-without-subtitles';
primaryTrackId: string | null;
secondaryTrackId: string | null;
}
export interface YoutubePickerResolveResult {
ok: boolean;
message: string;
}
export interface JimakuConfig {
apiKey?: string;
@@ -1166,14 +1202,20 @@ export interface ElectronAPI {
onRuntimeOptionsChanged: (callback: (options: RuntimeOptionState[]) => void) => void;
onOpenRuntimeOptions: (callback: () => void) => void;
onOpenJimaku: (callback: () => void) => void;
onOpenYoutubeTrackPicker: (callback: (payload: YoutubePickerOpenPayload) => void) => void;
onCancelYoutubeTrackPicker: (callback: () => void) => void;
onKeyboardModeToggleRequested: (callback: () => void) => void;
onLookupWindowToggleRequested: (callback: () => void) => void;
appendClipboardVideoToQueue: () => Promise<ClipboardAppendResult>;
youtubePickerResolve: (
request: YoutubePickerResolveRequest,
) => Promise<YoutubePickerResolveResult>;
notifyOverlayModalClosed: (
modal:
| 'runtime-options'
| 'subsync'
| 'jimaku'
| 'youtube-track-picker'
| 'kiku'
| 'controller-select'
| 'controller-debug'
@@ -1184,6 +1226,7 @@ export interface ElectronAPI {
| 'runtime-options'
| 'subsync'
| 'jimaku'
| 'youtube-track-picker'
| 'kiku'
| 'controller-select'
| 'controller-debug'