From 8a2640e040c7e4e96bde4b9f15ae0c61c38f8ac0 Mon Sep 17 00:00:00 2001 From: daniel oeh Date: Sat, 3 Aug 2013 21:42:25 +0200 Subject: [PATCH] Set seek time of media keys to 30 seconds. --- .../antennapod/service/PlaybackService.java | 19 +++---------------- .../util/playback/PlaybackController.java | 2 +- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/de/danoeh/antennapod/service/PlaybackService.java b/src/de/danoeh/antennapod/service/PlaybackService.java index ad2b2e090..294892ec9 100644 --- a/src/de/danoeh/antennapod/service/PlaybackService.java +++ b/src/de/danoeh/antennapod/service/PlaybackService.java @@ -54,6 +54,7 @@ import de.danoeh.antennapod.util.BitmapDecoder; import de.danoeh.antennapod.util.flattr.FlattrUtils; import de.danoeh.antennapod.util.playback.Playable; import de.danoeh.antennapod.util.playback.Playable.PlayableException; +import de.danoeh.antennapod.util.playback.PlaybackController; /** Controls the MediaPlayer that plays a FeedMedia-file */ public class PlaybackService extends Service { @@ -433,25 +434,11 @@ public class PlaybackService extends Service { } break; case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD: { - int currentPos = getCurrentPositionSafe(); - int duration = getDurationSafe(); - - if (currentPos != INVALID_TIME && duration != INVALID_TIME) { - if (currentPos < duration) { - seek(currentPos + 10000); - } - } + seekDelta(PlaybackController.DEFAULT_SEEK_DELTA); break; } case KeyEvent.KEYCODE_MEDIA_REWIND: { - int currentPos = getCurrentPositionSafe(); - int duration = getDurationSafe(); - - if (currentPos != INVALID_TIME && duration != INVALID_TIME) { - if (currentPos > 10000) { - seek(currentPos - 10000); - } - } + seekDelta(-PlaybackController.DEFAULT_SEEK_DELTA); break; } } diff --git a/src/de/danoeh/antennapod/util/playback/PlaybackController.java b/src/de/danoeh/antennapod/util/playback/PlaybackController.java index cebb11cf0..cbd8f16ed 100644 --- a/src/de/danoeh/antennapod/util/playback/PlaybackController.java +++ b/src/de/danoeh/antennapod/util/playback/PlaybackController.java @@ -43,7 +43,7 @@ import de.danoeh.antennapod.util.playback.Playable.PlayableUtils; public abstract class PlaybackController { private static final String TAG = "PlaybackController"; - static final int DEFAULT_SEEK_DELTA = 30000; + public static final int DEFAULT_SEEK_DELTA = 30000; public static final int INVALID_TIME = -1; private Activity activity;