diff options
author | David Carver <d_a_carver@yahoo.com> | 2013-07-02 20:01:22 -0400 |
---|---|---|
committer | David Carver <d_a_carver@yahoo.com> | 2013-07-02 20:01:22 -0400 |
commit | 743587ee0c75c658158357d860906e67bb7d9438 (patch) | |
tree | cf8774db516e3cf941323a9e7643c8a3463b68d6 /src/de | |
parent | 62961d6594687eb34e36adaeba55a90c99e2dd4e (diff) | |
download | AntennaPod-743587ee0c75c658158357d860906e67bb7d9438.zip |
Enable Fast Forward and Rewind keys on Google TV remotes.
This enables the Fast Forward and Rewind keys on the google tv remote.
If pressed it will jump ahead by 10 seconds or go back by 10 seconds.
Diffstat (limited to 'src/de')
-rw-r--r-- | src/de/danoeh/antennapod/service/PlaybackService.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/de/danoeh/antennapod/service/PlaybackService.java b/src/de/danoeh/antennapod/service/PlaybackService.java index 409ac6b48..ad2b2e090 100644 --- a/src/de/danoeh/antennapod/service/PlaybackService.java +++ b/src/de/danoeh/antennapod/service/PlaybackService.java @@ -432,7 +432,29 @@ public class PlaybackService extends Service { pause(true, true); } 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); + } + } + 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); + } + } + break; + } + } } /** |