Skip to content

Commit

Permalink
Added method to get the player state.
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
  • Loading branch information
coderReview authored and jbkempf committed Jul 25, 2014
1 parent 5c8988f commit 76d172e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions vlc-android/jni/libvlcjni.c
Expand Up @@ -487,6 +487,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);
Expand Down
5 changes: 5 additions & 0 deletions vlc-android/src/org/videolan/libvlc/LibVLC.java
Expand Up @@ -558,6 +558,11 @@ public boolean isDebugBuffering() {
*/
public native void stop();

/**
* Get player state.
*/
public native int getPlayerState();

/**
* Gets volume as integer
*/
Expand Down

0 comments on commit 76d172e

Please sign in to comment.