From 743587ee0c75c658158357d860906e67bb7d9438 Mon Sep 17 00:00:00 2001 From: David Carver Date: Tue, 2 Jul 2013 20:01:22 -0400 Subject: [PATCH] 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. --- .../antennapod/service/PlaybackService.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) 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; + } + } } /**