From f985d94e252a45b0448d672123b6f27a633cf1b9 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 4 Apr 2020 11:25:44 +0200 Subject: [PATCH] Open video player when playing video --- .../antennapod/adapter/actionbutton/PlayActionButton.java | 6 ++++++ .../antennapod/adapter/actionbutton/StreamActionButton.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/PlayActionButton.java b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/PlayActionButton.java index 3a80ec998..dd3a57288 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/PlayActionButton.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/PlayActionButton.java @@ -6,6 +6,8 @@ import androidx.annotation.StringRes; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; +import de.danoeh.antennapod.core.feed.MediaType; +import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.util.playback.PlaybackServiceStarter; @@ -42,5 +44,9 @@ public class PlayActionButton extends ItemActionButton { .startWhenPrepared(true) .shouldStream(false) .start(); + + if (media.getMediaType() == MediaType.VIDEO) { + context.startActivity(PlaybackService.getPlayerActivityIntent(context)); + } } } diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/StreamActionButton.java b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/StreamActionButton.java index 2f943e5fb..8db28f5a8 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/StreamActionButton.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/StreamActionButton.java @@ -8,6 +8,8 @@ import androidx.annotation.StringRes; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; +import de.danoeh.antennapod.core.feed.MediaType; +import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.util.NetworkUtils; import de.danoeh.antennapod.core.util.playback.PlaybackServiceStarter; import de.danoeh.antennapod.dialog.StreamingConfirmationDialog; @@ -45,5 +47,9 @@ public class StreamActionButton extends ItemActionButton { .startWhenPrepared(true) .shouldStream(true) .start(); + + if (media.getMediaType() == MediaType.VIDEO) { + context.startActivity(PlaybackService.getPlayerActivityIntent(context)); + } } }