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.
This commit is contained in:
parent
62961d6594
commit
743587ee0c
|
@ -432,6 +432,28 @@ public class PlaybackService extends Service {
|
||||||
pause(true, true);
|
pause(true, true);
|
||||||
}
|
}
|
||||||
break;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue