[Android] Handle next/previous media keys

Geoffrey Métais git at videolan.org
Fri Jun 12 10:44:55 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jun 12 10:36:24 2015 +0200| [f2275df973d51aaf5c3b0040093d4dd78825b5a2] | committer: Geoffrey Métais

Handle next/previous media keys

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=f2275df973d51aaf5c3b0040093d4dd78825b5a2
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java  |    2 ++
 .../src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java |    2 ++
 2 files changed, 4 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 439028c..91d12c1 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -981,10 +981,12 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVideoPlay
         switch (keyCode) {
         case KeyEvent.KEYCODE_F:
         case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD:
+        case KeyEvent.KEYCODE_MEDIA_NEXT:
             seekDelta(10000);
             return true;
         case KeyEvent.KEYCODE_R:
         case KeyEvent.KEYCODE_MEDIA_REWIND:
+        case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
             seekDelta(-10000);
             return true;
         case KeyEvent.KEYCODE_BUTTON_R1:
diff --git a/vlc-android/tv/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java b/vlc-android/tv/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java
index b2f003f..1896935 100644
--- a/vlc-android/tv/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java
+++ b/vlc-android/tv/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java
@@ -184,6 +184,7 @@ public class AudioPlayerActivity extends Activity implements PlaybackServiceClie
                 return true;
             case KeyEvent.KEYCODE_F:
             case KeyEvent.KEYCODE_BUTTON_R1:
+            case KeyEvent.KEYCODE_MEDIA_NEXT:
                 goNext();
                 return true;
             case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD:
@@ -194,6 +195,7 @@ public class AudioPlayerActivity extends Activity implements PlaybackServiceClie
                 return true;
             case KeyEvent.KEYCODE_R:
             case KeyEvent.KEYCODE_BUTTON_L1:
+            case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
                 goPrevious();
                 return true;
             /*



More information about the Android mailing list