Support next/previous media keys

The "seek" buttons in my car send "next" and "previous" media key codes,
rather than "fast forward" and "rewind", so update the playback service
to recognize them.

fixes #386
fixes #432
This commit is contained in:
David Reiss 2014-06-07 16:23:34 -07:00
parent 817769672a
commit 12660478a8
1 changed files with 2 additions and 0 deletions

View File

@ -310,9 +310,11 @@ public class PlaybackService extends Service {
mediaPlayer.pause(true, true);
}
break;
case KeyEvent.KEYCODE_MEDIA_NEXT:
case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD:
mediaPlayer.seekDelta(PlaybackController.DEFAULT_SEEK_DELTA);
break;
case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
case KeyEvent.KEYCODE_MEDIA_REWIND:
mediaPlayer.seekDelta(-PlaybackController.DEFAULT_SEEK_DELTA);
break;