Skip to content

A cross platform Audiobookshelf client for Android and iOS

Dart

Show the widget as paused when a call or another app interrupts playback

Barnabascca9c39c844d
diff --git a/lib/services/audio_player_service.dart b/lib/services/audio_player_service.dart
index b073258d..f6c83366 100644
--- a/lib/services/audio_player_service.dart
+++ b/lib/services/audio_player_service.dart
@@ -2699,6 +2699,11 @@ class AudioPlayerService extends ChangeNotifier {
await service._player?.pause();
service._lastPauseTime = DateTime.now();
service._wasPlayingBeforeInterrupt = true;
+ // The notification reads the player directly, but the home
+ // widget, cards and watch only refresh on notify - without this
+ // the widget kept showing "playing" and ticking its clock
+ // through the whole interruption.
+ service.notifyListeners();
}
} else {
if (event.type == AudioInterruptionType.duck &&