From 5a3778e2f03bafd5f30be189b9725e8a7e0d6a93 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Thu, 26 Mar 2020 17:12:00 +0100 Subject: Do not show buffering indicator when playing local file --- .../java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java | 6 +++++- .../de/danoeh/antennapod/core/util/playback/PlaybackController.java | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java index ed136af3c..0be59904d 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java @@ -265,7 +265,11 @@ public class AudioPlayerFragment extends Fragment implements @Override public void onBufferUpdate(float progress) { - sbPosition.setSecondaryProgress((int) (progress * sbPosition.getMax())); + if (isStreaming()) { + sbPosition.setSecondaryProgress((int) (progress * sbPosition.getMax())); + } else { + sbPosition.setSecondaryProgress(0); + } } @Override diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java index 8f21437b0..baf5d924f 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java @@ -743,6 +743,10 @@ public class PlaybackController { } } + public boolean isStreaming() { + return playbackService != null && playbackService.isStreaming(); + } + private void initServiceNotRunning() { if (getPlayButton() == null) { return; -- cgit v1.2.3