feat: implement seeking (FFmpeg -ss restart), fix lyrics sync with seekOffset

- AudioPlayer.seek() restarts FFmpeg with -ss parameter for actual seeking
- New POST /api/player/:botId/seek endpoint
- BotStatus includes seekOffset and playStartTime from server
- Frontend elapsed = seekOffset + (now - playStartedAt)
- Progress bar click now seeks to clicked position
- All timing actions use _resetTiming() helper with seekOffset
- Lyrics sync uses store.elapsed which includes seekOffset

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
saopig1andClaude Opus 4.6 committed 2026-03-30 03:16:37 +08:00
1 parent 080c2836c9
commit 1cdface33c
5 files changed
+101 -50

No files matched your search

+4
View File
@@ -37,6 +37,8 @@ export interface BotStatus {
queueSize: number;
volume: number;
playMode: PlayMode;
seekOffset: number; // seconds offset from last seek/play start
playStartTime: number; // server timestamp when playback started
}
export class BotInstance extends EventEmitter {
@@ -505,6 +507,8 @@ export class BotInstance extends EventEmitter {
queueSize: this.queue.size(),
volume: this.player.getVolume(),
playMode: this.queue.getMode(),
seekOffset: this.player.getSeekOffset(),
playStartTime: Date.now(),
};
}