spotube/lib/services/audio_services
Rahul Agarwal 9c92e2529e fix: propagate player-discovered duration to OS media session
Tracks opened from Home/Album/Liked Album pages can carry an unknown
(zero) durationMs from the metadata source, which was forwarded verbatim
to audio_service as Duration.zero. Android's media notification then
rendered 0:00 / 0:00 with no working seek bar, and macOS Now Playing
showed --:-- (issue #3077), even though the in-app player UI showed the
correct duration via the player's durationStream.

WindowsAudioService already forwards audioPlayer.durationStream to SMTC
(setEndTime), but MobileAudioService (Android/macOS/Linux) never updated
the active MediaItem after the player discovered the real duration.

- Report an unknown (zero) model duration as null instead of
  Duration.zero so the OS treats it as unknown rather than 0:00.
- Update the active MediaItem from audioPlayer.durationStream once the
  real duration is known, mirroring the existing Windows behaviour.

Fixes #3077

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 19:35:47 +05:30
..
audio_services.dart fix: propagate player-discovered duration to OS media session 2026-07-18 19:35:47 +05:30
mobile_audio_service.dart fix: propagate player-discovered duration to OS media session 2026-07-18 19:35:47 +05:30
windows_audio_service.dart refactor: move from Track to SpotubeTrackObject and use TrackSources object for providers 2025-06-18 21:30:32 +06:00