Phase 6 Fix 4

- Unter "Du folgst" wurde immer der erste Kanal aufgerufen, unabhängig vom ausgewählten Kanal
- Abbrechen der Wiedergabe auch unter "Durchsuchen" und Top-Stream möglich.
This commit is contained in:
Andre
2026-04-11 09:59:31 +02:00
parent f592de7aeb
commit ffad3b045d
10 changed files with 91 additions and 23 deletions
+6
View File
@@ -123,6 +123,12 @@ class JoystickReader {
} else if (axis === 1) {
if (value < -STICK_THRESHOLD) key = 'ArrowUp'
else if (value > STICK_THRESHOLD) key = 'ArrowDown'
}
// Trigger (Axes 2/5): -32767 = nicht gedrückt, +32767 = voll gedrückt
else if (axis === 2) {
if (value > 0) key = 'l2'
} else if (axis === 5) {
if (value > 0) key = 'r2'
} else {
return
}
+2
View File
@@ -23,6 +23,7 @@ export const IPC = {
playbackStartLive: 'playback:start-live',
playbackStartVod: 'playback:start-vod',
playbackStop: 'playback:stop',
playbackSeek: 'playback:seek',
/** main → renderer */
playbackEvent: 'playback:event'
} as const
@@ -74,6 +75,7 @@ export function registerIpcHandlers(
playback.startVod(vodId, channelLogin, title, durationSeconds)
)
ipcMain.handle(IPC.playbackStop, () => playback.stop())
ipcMain.handle(IPC.playbackSeek, (_e, seconds: number) => playback.seek(seconds))
playback.on('playback-event', (event: PlaybackEvent) => {
for (const win of BrowserWindow.getAllWindows()) {
+6
View File
@@ -74,6 +74,12 @@ export class MpvController {
})
}
seek(seconds: number): void {
if (this.socket?.writable) {
this._send({ command: ['seek', seconds, 'relative'] })
}
}
quit(): void {
if (this.socket?.writable) {
try {
+4
View File
@@ -141,6 +141,10 @@ export class PlaybackService extends EventEmitter {
})
}
seek(seconds: number): void {
this.current?.mpv.seek(seconds)
}
async stop(): Promise<void> {
if (!this.current) return
const { process: proc, mpv } = this.current