summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod/service
diff options
context:
space:
mode:
authorDavid Carver <d_a_carver@yahoo.com>2013-07-02 20:01:22 -0400
committerDavid Carver <d_a_carver@yahoo.com>2013-07-02 20:01:22 -0400
commit743587ee0c75c658158357d860906e67bb7d9438 (patch)
treecf8774db516e3cf941323a9e7643c8a3463b68d6 /src/de/danoeh/antennapod/service
parent62961d6594687eb34e36adaeba55a90c99e2dd4e (diff)
downloadAntennaPod-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/danoeh/antennapod/service')
-rw-r--r--src/de/danoeh/antennapod/service/PlaybackService.java22
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;
+ }
+ }
}
/**