diff options
author | ByteHamster <info@bytehamster.com> | 2020-06-11 23:17:06 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2020-06-11 23:17:06 +0200 |
commit | 58f931b575b8667e5bc9d9ed4b4b6c8ce8042f95 (patch) | |
tree | d653135d8933ef7ba7c2040f434ef1b1fe8bbca4 | |
parent | f48c75aa8344dd6ac8c4043c8f11097ae23c69d4 (diff) | |
download | AntennaPod-58f931b575b8667e5bc9d9ed4b4b6c8ce8042f95.zip |
Send play intent if service state is unknown
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java | 1 | ||||
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java index 02f1de0d4..94c9bd056 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java @@ -77,7 +77,6 @@ public class ExternalPlayerFragment extends Fragment { @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - controller = setupPlaybackController(); butPlay.setOnClickListener(v -> { if (controller != null) { controller.playPause(); 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 0b849aa1f..44f5f9b11 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 @@ -508,6 +508,13 @@ public class PlaybackController { playbackService.setStartWhenPrepared(true); playbackService.prepare(); break; + default: + new PlaybackServiceStarter(activity, media) + .startWhenPrepared(true) + .streamIfLastWasStream() + .start(); + Log.w(TAG, "Play/Pause button was pressed and PlaybackService state was unknown"); + break; } } |