[Android] [PATCH 07/24] jni: Add previous() and next()

Edward Wang edward.c.wang at compdigitec.com
Wed Aug 22 23:15:07 CEST 2012


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

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();
-- 
1.7.5.4



More information about the Android mailing list