feat: Sync offline/online playback when able (#431)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2025-08-03 13:35:56 +02:00 committed by GitHub
parent 15ac3566e2
commit 092836328f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 1002 additions and 497 deletions

View file

@ -244,10 +244,10 @@ class MediaControlsWrapper extends BaseAudioHandler {
final position = _player?.lastState.position;
final totalDuration = _player?.lastState.duration;
//Small delay so we don't post right after playback/progress update
// //Small delay so we don't post right after playback/progress update
await Future.delayed(const Duration(seconds: 1));
ref.read(playBackModel)?.playbackStopped(position ?? Duration.zero, totalDuration, ref);
await ref.read(playBackModel)?.playbackStopped(position ?? Duration.zero, totalDuration, ref);
ref.read(mediaPlaybackProvider.notifier).update((state) => state.copyWith(position: Duration.zero));
smtc?.setPlaybackStatus(PlaybackStatus.stopped);