summaryrefslogtreecommitdiff
path: root/src/de
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2012-08-05 14:57:42 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2012-08-05 14:57:42 +0200
commit3bcd77c0d291485f4ddc80ce20d7f6e5874b2cb6 (patch)
tree09f5f4a23454dab5a13d25b4e6b44aa1403ed985 /src/de
parentbe7ff097b99f634a9d5678aeb79b35ba234cd254 (diff)
downloadAntennaPod-3bcd77c0d291485f4ddc80ce20d7f6e5874b2cb6.zip
Switching between players should now work
Diffstat (limited to 'src/de')
-rw-r--r--src/de/danoeh/antennapod/activity/VideoplayerActivity.java1
-rw-r--r--src/de/danoeh/antennapod/service/PlaybackService.java12
2 files changed, 10 insertions, 3 deletions
diff --git a/src/de/danoeh/antennapod/activity/VideoplayerActivity.java b/src/de/danoeh/antennapod/activity/VideoplayerActivity.java
index 6644cc29b..ba1e434d0 100644
--- a/src/de/danoeh/antennapod/activity/VideoplayerActivity.java
+++ b/src/de/danoeh/antennapod/activity/VideoplayerActivity.java
@@ -44,7 +44,6 @@ public class VideoplayerActivity extends MediaplayerActivity implements
if (videoControlsToggler != null) {
videoControlsToggler.cancel(true);
}
- finish();
}
@Override
diff --git a/src/de/danoeh/antennapod/service/PlaybackService.java b/src/de/danoeh/antennapod/service/PlaybackService.java
index c34874893..53bed27ca 100644
--- a/src/de/danoeh/antennapod/service/PlaybackService.java
+++ b/src/de/danoeh/antennapod/service/PlaybackService.java
@@ -68,7 +68,7 @@ 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;
@@ -362,8 +362,12 @@ public class PlaybackService extends Service {
/** Called after service has extracted the media it is supposed to play. */
private void setupMediaplayer() {
+ if (AppConfig.DEBUG)
+ Log.d(TAG, "Setting up media player");
try {
if (media.getMime_type().startsWith("audio")) {
+ if (AppConfig.DEBUG)
+ Log.d(TAG, "Mime type is audio");
playingVideo = false;
if (shouldStream) {
player.setDataSource(media.getDownload_url());
@@ -375,6 +379,8 @@ public class PlaybackService extends Service {
player.prepare();
}
} else if (media.getMime_type().startsWith("video")) {
+ if (AppConfig.DEBUG)
+ Log.d(TAG, "Mime type is video");
playingVideo = true;
setStatus(PlayerStatus.AWAITING_VIDEO_SURFACE);
player.setScreenOnWhilePlaying(true);
@@ -485,11 +491,13 @@ public class PlaybackService extends Service {
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();
- sendNotificationBroadcast(NOTIFICATION_TYPE_RELOAD, notificationCode);
+ sendNotificationBroadcast(NOTIFICATION_TYPE_RELOAD,
+ notificationCode);
} else {
if (AppConfig.DEBUG)
Log.d(TAG, "Stopping playback");