diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-08-03 21:42:25 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-08-03 21:42:25 +0200 |
commit | 8a2640e040c7e4e96bde4b9f15ae0c61c38f8ac0 (patch) | |
tree | 515d9064d08bea9c96f738b60e9b747744af1c27 | |
parent | 4e6276c9c4c3cf3fa344abc181688ce6dd17ec51 (diff) | |
download | AntennaPod-8a2640e040c7e4e96bde4b9f15ae0c61c38f8ac0.zip |
Set seek time of media keys to 30 seconds.
-rw-r--r-- | src/de/danoeh/antennapod/service/PlaybackService.java | 19 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/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; |