[Android] [PATCH 5/5] Added method to get the player state.

Jean-Baptiste Kempf jb at videolan.org
Fri Jul 25 23:41:24 CEST 2014


Applied. Thanks for the whole thing

Le 24/07/2014 19:14, Paulo Vitor Magacho da Silva a écrit :
> ---
>   vlc-android/jni/libvlcjni.c                     | 8 ++++++++
>   vlc-android/src/org/videolan/libvlc/LibVLC.java | 5 +++++
>   2 files changed, 13 insertions(+)
>
> diff --git a/vlc-android/jni/libvlcjni.c b/vlc-android/jni/libvlcjni.c
> index 1f11b20..ec1a28b 100644
> --- a/vlc-android/jni/libvlcjni.c
> +++ b/vlc-android/jni/libvlcjni.c
> @@ -503,6 +503,14 @@ void Java_org_videolan_libvlc_LibVLC_stop(JNIEnv *env, jobject thiz)
>           libvlc_media_player_stop(mp);
>   }
>
> +jint Java_org_videolan_libvlc_LibVLC_getPlayerState(JNIEnv *env, jobject thiz)
> +{
> +    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
> +    if (mp)
> +        return (jint) libvlc_media_player_get_state(mp);
> +    return -1;
> +}
> +
>   jint Java_org_videolan_libvlc_LibVLC_getVolume(JNIEnv *env, jobject thiz)
>   {
>       libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
> diff --git a/vlc-android/src/org/videolan/libvlc/LibVLC.java b/vlc-android/src/org/videolan/libvlc/LibVLC.java
> index abc50a7..0dbc1f5 100644
> --- a/vlc-android/src/org/videolan/libvlc/LibVLC.java
> +++ b/vlc-android/src/org/videolan/libvlc/LibVLC.java
> @@ -565,6 +565,11 @@ public class LibVLC {
>       public native void stop();
>
>       /**
> +     * Get player state.
> +     */
> +    public native int getPlayerState();
> +
> +    /**
>        * Gets volume as integer
>        */
>       public native int getVolume();
>


-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device


More information about the Android mailing list