[codex] Replace mpv fullscreen toggle with launch mode config (#48)

Co-authored-by: bee <autumn@skerritt.blog>
This commit is contained in:
Autumn (Bee)
2026-04-07 16:38:15 +09:00
committed by GitHub
parent 7a64488ed5
commit bc7dde3b02
31 changed files with 305 additions and 31 deletions

View File

@@ -0,0 +1,24 @@
import type { MpvLaunchMode } from '../types/config';
export const MPV_LAUNCH_MODE_VALUES = ['normal', 'maximized', 'fullscreen'] as const satisfies
readonly MpvLaunchMode[];
export function parseMpvLaunchMode(value: unknown): MpvLaunchMode | undefined {
if (typeof value !== 'string') {
return undefined;
}
const normalized = value.trim().toLowerCase();
return MPV_LAUNCH_MODE_VALUES.find((candidate) => candidate === normalized);
}
export function buildMpvLaunchModeArgs(launchMode: MpvLaunchMode): string[] {
switch (launchMode) {
case 'fullscreen':
return ['--fullscreen'];
case 'maximized':
return ['--window-maximized=yes'];
default:
return [];
}
}