Commit c40d37aa authored by Paulo Vitor Magacho da Silva's avatar Paulo Vitor Magacho da Silva Committed by Jean-Baptiste Kempf

Handled MediaPlayerTimeChanged event.

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 775c8798
...@@ -146,6 +146,10 @@ static void vlc_event_callback(const libvlc_event_t *ev, void *data) ...@@ -146,6 +146,10 @@ static void vlc_event_callback(const libvlc_event_t *ev, void *data)
jstring sData = (*env)->NewStringUTF(env, "data"); jstring sData = (*env)->NewStringUTF(env, "data");
(*env)->CallVoidMethod(env, bundle, putFloat, sData, ev->u.media_player_position_changed.new_position); (*env)->CallVoidMethod(env, bundle, putFloat, sData, ev->u.media_player_position_changed.new_position);
(*env)->DeleteLocalRef(env, sData); (*env)->DeleteLocalRef(env, sData);
} else if (ev->type == libvlc_MediaPlayerTimeChanged) {
jstring sData = (*env)->NewStringUTF(env, "data");
(*env)->CallVoidMethod(env, bundle, putInt, sData, (int) ev->u.media_player_time_changed.new_time);
(*env)->DeleteLocalRef(env, sData);
} else if(ev->type == libvlc_MediaPlayerVout) { } else if(ev->type == libvlc_MediaPlayerVout) {
/* For determining the vout/ES track change */ /* For determining the vout/ES track change */
jstring sData = (*env)->NewStringUTF(env, "data"); jstring sData = (*env)->NewStringUTF(env, "data");
...@@ -388,6 +392,7 @@ void Java_org_videolan_libvlc_LibVLC_playMRL(JNIEnv *env, jobject thiz, jlong in ...@@ -388,6 +392,7 @@ void Java_org_videolan_libvlc_LibVLC_playMRL(JNIEnv *env, jobject thiz, jlong in
libvlc_MediaPlayerStopped, libvlc_MediaPlayerStopped,
libvlc_MediaPlayerVout, libvlc_MediaPlayerVout,
libvlc_MediaPlayerPositionChanged, libvlc_MediaPlayerPositionChanged,
libvlc_MediaPlayerTimeChanged,
libvlc_MediaPlayerEncounteredError libvlc_MediaPlayerEncounteredError
}; };
for(int i = 0; i < (sizeof(mp_events) / sizeof(*mp_events)); i++) for(int i = 0; i < (sizeof(mp_events) / sizeof(*mp_events)); i++)
......
...@@ -50,7 +50,7 @@ public class EventHandler { ...@@ -50,7 +50,7 @@ public class EventHandler {
//public static final int MediaPlayerBackward = 0x108; //public static final int MediaPlayerBackward = 0x108;
public static final int MediaPlayerEndReached = 0x109; public static final int MediaPlayerEndReached = 0x109;
public static final int MediaPlayerEncounteredError = 0x10a; public static final int MediaPlayerEncounteredError = 0x10a;
//public static final int MediaPlayerTimeChanged = 0x10b; public static final int MediaPlayerTimeChanged = 0x10b;
public static final int MediaPlayerPositionChanged = 0x10c; public static final int MediaPlayerPositionChanged = 0x10c;
//public static final int MediaPlayerSeekableChanged = 0x10d; //public static final int MediaPlayerSeekableChanged = 0x10d;
//public static final int MediaPlayerPausableChanged = 0x10e; //public static final int MediaPlayerPausableChanged = 0x10e;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment