From 5774d9d2c7027fef7fa0a884942247421a27306b Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 18 Aug 2019 12:44:51 +0200 Subject: [PATCH] Better media player error messages --- .../antennapod/core/util/playback/MediaPlayerError.java | 8 +++++++- core/src/main/res/values/strings.xml | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java index b04c02075..32d37a67e 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java @@ -16,10 +16,16 @@ public class MediaPlayerError { case MediaPlayer.MEDIA_ERROR_SERVER_DIED: resId = R.string.playback_error_server_died; break; + case MediaPlayer.MEDIA_ERROR_UNSUPPORTED: + resId = R.string.playback_error_unsupported; + break; + case MediaPlayer.MEDIA_ERROR_TIMED_OUT: + resId = R.string.playback_error_timeout; + break; default: resId = R.string.playback_error_unknown; break; } - return context.getString(resId); + return context.getString(resId) + " (" + code + ")"; } } diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index a4084b76b..7521f6834 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -277,6 +277,8 @@ Ready Seeking Server died + Unsupported media type + Operation timed out Unknown Error No media playing 00:00:00