summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod/service
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2012-08-05 14:45:32 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2012-08-05 14:45:32 +0200
commitbe7ff097b99f634a9d5678aeb79b35ba234cd254 (patch)
tree75ee038e9d48f4e1c4a1c81d87ae1b5b1c55acdb /src/de/danoeh/antennapod/service
parentf25c1f80ec1ffca2cfb1ad1e3ba0b17456430653 (diff)
downloadAntennaPod-be7ff097b99f634a9d5678aeb79b35ba234cd254.zip
added notification extra to reload notification to switch between
mediaplayers when the media type changes
Diffstat (limited to 'src/de/danoeh/antennapod/service')
-rw-r--r--src/de/danoeh/antennapod/service/PlaybackService.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/de/danoeh/antennapod/service/PlaybackService.java b/src/de/danoeh/antennapod/service/PlaybackService.java
index 3bbbdba66..c34874893 100644
--- a/src/de/danoeh/antennapod/service/PlaybackService.java
+++ b/src/de/danoeh/antennapod/service/PlaybackService.java
@@ -68,6 +68,10 @@ public class PlaybackService extends Service {
public static final String ACTION_PLAYER_NOTIFICATION = "action.de.danoeh.antennapod.service.playerNotification";
public static final String EXTRA_NOTIFICATION_CODE = "extra.de.danoeh.antennapod.service.notificationCode";
public static final String EXTRA_NOTIFICATION_TYPE = "extra.de.danoeh.antennapod.service.notificationType";
+
+ /** Used in NOTIFICATION_TYPE_RELOAD. */
+ public static final int EXTRA_CODE_AUDIO = 1;
+ public static final int EXTRA_CODE_VIDEO = 2;
public static final int NOTIFICATION_TYPE_ERROR = 0;
public static final int NOTIFICATION_TYPE_INFO = 1;
@@ -478,8 +482,14 @@ public class PlaybackService extends Service {
media = nextItem.getMedia();
feed = nextItem.getFeed();
shouldStream = !media.isDownloaded();
+ int notificationCode = 0;
+ if (media.getMime_type().startsWith("audio")) {
+ notificationCode = EXTRA_CODE_AUDIO;
+ } else if (media.getMime_type().startsWith("video")) {
+ notificationCode = EXTRA_CODE_VIDEO;
+ }
resetVideoSurface();
- sendNotificationBroadcast(NOTIFICATION_TYPE_RELOAD, 0);
+ sendNotificationBroadcast(NOTIFICATION_TYPE_RELOAD, notificationCode);
} else {
if (AppConfig.DEBUG)
Log.d(TAG, "Stopping playback");