diff options
author | ByteHamster <info@bytehamster.com> | 2020-10-25 18:15:37 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2020-10-25 18:15:37 +0100 |
commit | e767282bffdfa6c79d82eea039271d90de57586d (patch) | |
tree | b7d4ba6b6ba24acffc6c05d2df726d20b4872849 /core/src/play | |
parent | 361db64a07feb66e5632b8d60b14337b2e3497b0 (diff) | |
download | AntennaPod-e767282bffdfa6c79d82eea039271d90de57586d.zip |
Fail gracefully when trying to cast local feed
Diffstat (limited to 'core/src/play')
-rw-r--r-- | core/src/play/java/de/danoeh/antennapod/core/cast/CastUtils.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/core/src/play/java/de/danoeh/antennapod/core/cast/CastUtils.java b/core/src/play/java/de/danoeh/antennapod/core/cast/CastUtils.java index f01a8b638..6fa874eca 100644 --- a/core/src/play/java/de/danoeh/antennapod/core/cast/CastUtils.java +++ b/core/src/play/java/de/danoeh/antennapod/core/cast/CastUtils.java @@ -1,5 +1,6 @@ package de.danoeh.antennapod.core.cast; +import android.content.ContentResolver; import android.net.Uri; import android.text.TextUtils; import android.util.Log; @@ -50,15 +51,18 @@ public class CastUtils { public static final int FORMAT_VERSION_VALUE = 1; public static final int MAX_VERSION_FORWARD_COMPATIBILITY = 9999; - public static boolean isCastable(Playable media){ + public static boolean isCastable(Playable media) { if (media == null || media instanceof ExternalMedia) { return false; } - if (media instanceof FeedMedia || media instanceof RemoteMedia){ + if (media instanceof FeedMedia || media instanceof RemoteMedia) { String url = media.getStreamUrl(); - if(url == null || url.isEmpty()){ + if (url == null || url.isEmpty()) { return false; } + if (url.startsWith(ContentResolver.SCHEME_CONTENT)) { + return false; // Local feed + } switch (media.getMediaType()) { case UNKNOWN: return false; |