Phase 6 Feat: VOD-Kapitelauswahl

- Kapitel werden via Twitch GQL API geladen
- Kapitelauswahl als Modal-Overlay zentriert dargestellt
- A-Taste pausiert/setzt VOD-Wiedergabe fort (war: Stop)
This commit is contained in:
Andre
2026-04-11 11:11:02 +02:00
parent ffad3b045d
commit 56d212a3b7
9 changed files with 420 additions and 18 deletions
+18
View File
@@ -80,6 +80,24 @@ export class MpvController {
}
}
seekAbsolute(seconds: number): void {
if (this.socket?.writable) {
this._send({ command: ['seek', seconds, 'absolute'] })
}
}
togglePause(): void {
if (this.socket?.writable) {
this._send({ command: ['cycle', 'pause'] })
}
}
setPause(paused: boolean): void {
if (this.socket?.writable) {
this._send({ command: ['set_property', 'pause', paused] })
}
}
quit(): void {
if (this.socket?.writable) {
try {
+20 -2
View File
@@ -64,7 +64,8 @@ export class PlaybackService extends EventEmitter {
vodId: string,
channelLogin: string,
title: string,
durationSeconds: number
durationSeconds: number,
startSeconds?: number
): Promise<void> {
if (this.current) await this.stop()
@@ -88,7 +89,8 @@ export class PlaybackService extends EventEmitter {
return
}
const proc = spawnMpv(hlsUrl, { ipcPath: this.ipcPath, startSeconds: resumePos })
const effectiveStart = startSeconds !== undefined ? startSeconds : resumePos
const proc = spawnMpv(hlsUrl, { ipcPath: this.ipcPath, startSeconds: effectiveStart })
let mpvStderrBuf = ''
proc.stdout?.on('data', (d: Buffer) => console.log('[mpv]', d.toString().trim()))
@@ -145,6 +147,22 @@ export class PlaybackService extends EventEmitter {
this.current?.mpv.seek(seconds)
}
togglePause(): void {
this.current?.mpv.togglePause()
}
pause(): void {
this.current?.mpv.setPause(true)
}
resume(): void {
this.current?.mpv.setPause(false)
}
seekTo(seconds: number): void {
this.current?.mpv.seekAbsolute(seconds)
}
async stop(): Promise<void> {
if (!this.current) return
const { process: proc, mpv } = this.current