summaryrefslogtreecommitdiff
path: root/model/src
diff options
context:
space:
mode:
Diffstat (limited to 'model/src')
-rw-r--r--model/src/main/java/de/danoeh/antennapod/model/playback/MediaType.java26
1 files changed, 0 insertions, 26 deletions
diff --git a/model/src/main/java/de/danoeh/antennapod/model/playback/MediaType.java b/model/src/main/java/de/danoeh/antennapod/model/playback/MediaType.java
index 6a7b36097..799977e9a 100644
--- a/model/src/main/java/de/danoeh/antennapod/model/playback/MediaType.java
+++ b/model/src/main/java/de/danoeh/antennapod/model/playback/MediaType.java
@@ -15,16 +15,6 @@ public enum MediaType {
"application/x-flac"
));
- // based on https://developer.android.com/guide/topics/media/media-formats
- static final Set<String> AUDIO_FILE_EXTENSIONS = new HashSet<>(Arrays.asList(
- "3gp", "aac", "amr", "flac", "imy", "m4a", "mid", "mkv", "mp3", "mp4", "mxmf", "oga",
- "ogg", "ogx", "opus", "ota", "rtttl", "rtx", "wav", "xmf"
- ));
-
- static final Set<String> VIDEO_FILE_EXTENSIONS = new HashSet<>(Arrays.asList(
- "3gp", "mkv", "mp4", "ogg", "ogv", "ogx", "webm"
- ));
-
public static MediaType fromMimeType(String mimeType) {
if (TextUtils.isEmpty(mimeType)) {
return MediaType.UNKNOWN;
@@ -37,20 +27,4 @@ public enum MediaType {
}
return MediaType.UNKNOWN;
}
-
- /**
- * @param extensionWithoutDot the file extension (suffix) without the dot
- * @return the {@link MediaType} that likely corresponds to the extension. However, since the
- * extension is not always enough to determine whether a file is an audio or video (3gp
- * can be both, for example), this may not be correct. As a result, where possible,
- * {@link #fromMimeType(String) fromMimeType} should always be tried first.
- */
- public static MediaType fromFileExtension(String extensionWithoutDot) {
- if (AUDIO_FILE_EXTENSIONS.contains(extensionWithoutDot)) {
- return MediaType.AUDIO;
- } else if (VIDEO_FILE_EXTENSIONS.contains(extensionWithoutDot)) {
- return MediaType.VIDEO;
- }
- return MediaType.UNKNOWN;
- }
}