summaryrefslogtreecommitdiff
path: root/src/de
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2012-08-19 13:38:20 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2012-08-19 13:38:20 +0200
commitc77247126892152caf644b34150244cb2cdb7d25 (patch)
tree2e922c692e166b11a9a6c71569bf91298df48bdf /src/de
parent663993afb25f8ec50678b44399c6538d1b9bd71c (diff)
downloadAntennaPod-c77247126892152caf644b34150244cb2cdb7d25.zip
PlaybackService will now reload the last episode if no more episodes are
available
Diffstat (limited to 'src/de')
-rw-r--r--src/de/danoeh/antennapod/service/PlaybackService.java38
1 files changed, 22 insertions, 16 deletions
diff --git a/src/de/danoeh/antennapod/service/PlaybackService.java b/src/de/danoeh/antennapod/service/PlaybackService.java
index b1299402c..8164ffae2 100644
--- a/src/de/danoeh/antennapod/service/PlaybackService.java
+++ b/src/de/danoeh/antennapod/service/PlaybackService.java
@@ -524,30 +524,36 @@ public class PlaybackService extends Service {
.getDefaultSharedPreferences(getApplicationContext())
.getBoolean(PodcastApp.PREF_FOLLOW_QUEUE, false);
FeedItem nextItem = manager.getFirstQueueItem();
- if (isInQueue && followQueue && nextItem != null) {
+ boolean playNextItem = isInQueue && followQueue && nextItem != null;
+ if (playNextItem) {
if (AppConfig.DEBUG)
Log.d(TAG, "Loading next item in queue");
media = nextItem.getMedia();
feed = nextItem.getFeed();
shouldStream = !media.isDownloaded();
- int notificationCode = 0;
- if (media.getMime_type().startsWith("audio")) {
- notificationCode = EXTRA_CODE_AUDIO;
- playingVideo = false;
- } else if (media.getMime_type().startsWith("video")) {
- notificationCode = EXTRA_CODE_VIDEO;
- }
- resetVideoSurface();
- refreshRemoteControlClientState();
- sendNotificationBroadcast(NOTIFICATION_TYPE_RELOAD,
- notificationCode);
+ startWhenPrepared = true;
} else {
if (AppConfig.DEBUG)
- Log.d(TAG, "Stopping playback");
- stopWidgetUpdater();
- setStatus(PlayerStatus.STOPPED);
- stopForeground(true);
+ Log.d(TAG,
+ "No more episodes available to play; Reloading current episode");
+ startWhenPrepared = false;
+ }
+ int notificationCode = 0;
+ if (media.getMime_type().startsWith("audio")) {
+ notificationCode = EXTRA_CODE_AUDIO;
+ playingVideo = false;
+ } else if (media.getMime_type().startsWith("video")) {
+ notificationCode = EXTRA_CODE_VIDEO;
}
+ resetVideoSurface();
+ refreshRemoteControlClientState();
+ sendNotificationBroadcast(NOTIFICATION_TYPE_RELOAD,
+ notificationCode);
+ /*
+ * } else { if (AppConfig.DEBUG) Log.d(TAG, "Stopping playback");
+ * stopWidgetUpdater(); setStatus(PlayerStatus.STOPPED);
+ * stopForeground(true); }
+ */
}
};