Skip to content

A cross platform Audiobookshelf client for Android and iOS

Dart

Count the card play button, car mode and the reader as playing from the app so they check for progress from another device too

Barnabasec459873ce15
diff --git a/lib/screens/car_mode_screen.dart b/lib/screens/car_mode_screen.dart
index 42220d3a..e336da9e 100644
--- a/lib/screens/car_mode_screen.dart
+++ b/lib/screens/car_mode_screen.dart
@@ -346,7 +346,7 @@ class _CarModeScreenState extends State<CarModeScreen>
aspectRatio: 1,
child: GestureDetector(
onTap: player.hasBook
- ? player.togglePlayPause
+ ? () => player.togglePlayPause(fromUi: true)
: widget.itemId != null ? _startPlayback : null,
child: Stack(
children: [
diff --git a/lib/widgets/card_playback_controls.dart b/lib/widgets/card_playback_controls.dart
index edb88886..9f467fc2 100644
--- a/lib/widgets/card_playback_controls.dart
+++ b/lib/widgets/card_playback_controls.dart
@@ -198,7 +198,7 @@ class _CardPlaybackControlsState extends State<CardPlaybackControls> {
)),
if (widget.showPlayButton)
Flexible(child: _playPauseButton(cs, playing: widget.isActive && widget.player.isPlaying, loading: loading,
- onTap: widget.isActive ? widget.player.togglePlayPause : widget.onStart)),
+ onTap: widget.isActive ? () => widget.player.togglePlayPause(fromUi: true) : widget.onStart)),
Flexible(child: Pressable(
onTap: widget.isActive ? () => widget.player.skipForward(_forwardSkip) : null,
child: SizedBox(width: skBox, height: skBox, child: Center(child: _skipIcon(_forwardSkip, true, active: widget.isActive, size: skIcon))),
diff --git a/lib/widgets/ebook_reader_view.dart b/lib/widgets/ebook_reader_view.dart
index 701447ca..2eacf3f1 100644
--- a/lib/widgets/ebook_reader_view.dart
+++ b/lib/widgets/ebook_reader_view.dart
@@ -1848,7 +1848,9 @@ class EbookReaderViewState extends State<EbookReaderView> with WidgetsBindingObs
// Active: toggle. Otherwise start this book's audiobook.
onPressed: _startingAudio
? null
- : (isActive ? player.togglePlayPause : _startThisBook),
+ : (isActive
+ ? () => player.togglePlayPause(fromUi: true)
+ : _startThisBook),
),
IconButton(
icon: Icon(fwdIcon, color: isActive ? fg : dim),