feat(streaming): add seekbar progress and dynamic buffer sizing

- Pass track duration from frontend to streaming playback for seekbar
- Add StreamInfo struct with speed measurement during probe
- Implement StreamingConfig::from_speed_mbps() for adaptive buffer sizing
- Add play_streaming_dynamic() method using speed-based buffer config
- Enhanced download logging with progress %, speed (current/avg), and ETA
- Auto-cache streamed tracks for instant replay

The seekbar now shows playback progress during streaming by using
the track's known duration from metadata rather than detecting it
from incomplete audio data.
This commit is contained in:
vicrodh committed 2026-01-25 18:06:41 -06:00
1 parent 7d0aa215a5
commit 008c5623cb
5 files changed
+201 -39

No files matched your search

+1 -1
View File
@@ -114,7 +114,7 @@ export async function playTrack(
if (isLocal) {
await invoke('library_play_track', { trackId: track.id });
} else {
await invoke('play_track', { trackId: track.id });
await invoke('play_track', { trackId: track.id, durationSecs: track.duration });
}
}
+2 -2
View File
@@ -245,8 +245,8 @@ export async function togglePlay(): Promise<void> {
console.log('[Player] Restoring local track:', localTrackId);
await invoke('library_play_track', { trackId: localTrackId });
} else {
// Qobuz track - use play_track
await invoke('play_track', { trackId: currentTrack.id });
// Qobuz track - use play_track with duration for seekbar
await invoke('play_track', { trackId: currentTrack.id, durationSecs: currentTrack.duration });
}
// Seek to saved position after a short delay to let audio load