From 1433446738889ce01233447fc86fe732ac9c5a02 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 22 Feb 2020 00:21:20 +0100 Subject: [PATCH] Fixed resuming when episode was streamed --- .../core/service/playback/PlaybackService.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index bf59b0ffd..0ec325e85 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -643,7 +643,18 @@ public class PlaybackService extends MediaBrowserServiceCompat { private void startPlayingFromPreferences() { Playable playable = Playable.PlayableUtils.createInstanceFromPreferences(getApplicationContext()); if (playable != null) { - mediaPlayer.playMediaObject(playable, false, true, true); + if (PlaybackPreferences.getCurrentEpisodeIsStream() && !NetworkUtils.isStreamingAllowed()) { + displayStreamingNotAllowedNotification( + new PlaybackServiceStarter(this, playable) + .prepareImmediately(true) + .startWhenPrepared(true) + .shouldStream(true) + .getIntent()); + PlaybackPreferences.writeNoMediaPlaying(); + stateManager.stopService(); + return; + } + mediaPlayer.playMediaObject(playable, PlaybackPreferences.getCurrentEpisodeIsStream(), true, true); stateManager.validStartCommandWasReceived(); PlaybackService.this.updateMediaSessionMetadata(playable); } else {