[Android] jni: Add previous() and next()

Edward Wang git at videolan.org
Fri Aug 24 14:45:07 CEST 2012


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Wed Aug 22 17:15:07 2012 -0400| [ce2f0ad66a0c6ab598793ff121c5735c915d06be] | committer: Jean-Baptiste Kempf

jni: Add previous() and next()

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 vlc-android/jni/libvlcjni.c                  |   14 ++++++++++++++
 vlc-android/src/org/videolan/vlc/LibVLC.java |   10 ++++++++++
 2 files changed, 24 insertions(+)

diff --git a/vlc-android/jni/libvlcjni.c b/vlc-android/jni/libvlcjni.c
index f4a38c5..d6b3423 100644
--- a/vlc-android/jni/libvlcjni.c
+++ b/vlc-android/jni/libvlcjni.c
@@ -830,6 +830,20 @@ void Java_org_videolan_vlc_LibVLC_stop(JNIEnv *env, jobject thiz)
         libvlc_media_list_player_stop(mp);
 }
 
+void Java_org_videolan_vlc_LibVLC_previous(JNIEnv *env, jobject thiz)
+{
+    libvlc_media_list_player_t *mp = getMediaListPlayer(env, thiz);
+    if (mp)
+        libvlc_media_list_player_previous(mp);
+}
+
+void Java_org_videolan_vlc_LibVLC_next(JNIEnv *env, jobject thiz)
+{
+    libvlc_media_list_player_t *mp = getMediaListPlayer(env, thiz);
+    if (mp)
+        libvlc_media_list_player_next(mp);
+}
+
 jint Java_org_videolan_vlc_LibVLC_getVolume(JNIEnv *env, jobject thiz)
 {
     libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
diff --git a/vlc-android/src/org/videolan/vlc/LibVLC.java b/vlc-android/src/org/videolan/vlc/LibVLC.java
index bb6494b..95e7404 100644
--- a/vlc-android/src/org/videolan/vlc/LibVLC.java
+++ b/vlc-android/src/org/videolan/vlc/LibVLC.java
@@ -349,6 +349,16 @@ public class LibVLC {
     public native void stop();
 
     /**
+     * Play the previous media (if any) in the media list
+     */
+    public native void previous();
+
+    /**
+     * Play the next media (if any) in the media list
+     */
+    public native void next();
+
+    /**
      * Gets volume as integer
      */
     public native int getVolume();



More information about the Android mailing list