[Android] [PATCH 2/4] Read the nowplaying tag when reading metadata

Alexandre Perraud 4leyx4ndre at gmail.com
Mon Nov 24 18:34:22 CET 2014


---
 libvlc/jni/libvlcjni-track.c                  | 1 +
 libvlc/src/org/videolan/libvlc/Media.java     | 1 +
 libvlc/src/org/videolan/libvlc/TrackInfo.java | 1 +
 3 files changed, 3 insertions(+)

diff --git a/libvlc/jni/libvlcjni-track.c b/libvlc/jni/libvlcjni-track.c
index eba0b5c..53ea64c 100644
--- a/libvlc/jni/libvlcjni-track.c
+++ b/libvlc/jni/libvlcjni-track.c
@@ -154,6 +154,7 @@ jobjectArray read_track_info_internal(JNIEnv *env, jobject thiz, libvlc_media_t*
                 setString(env, item, "Album", libvlc_media_get_meta(p_m, libvlc_meta_Album));
                 setString(env, item, "Genre", libvlc_media_get_meta(p_m, libvlc_meta_Genre));
                 setString(env, item, "ArtworkURL", libvlc_media_get_meta(p_m, libvlc_meta_ArtworkURL));
+                setString(env, item, "NowPlaying", libvlc_media_get_meta(p_m, libvlc_meta_NowPlaying));
                 continue;
             }
 
diff --git a/libvlc/src/org/videolan/libvlc/Media.java b/libvlc/src/org/videolan/libvlc/Media.java
index 29b9d94..5f10054 100644
--- a/libvlc/src/org/videolan/libvlc/Media.java
+++ b/libvlc/src/org/videolan/libvlc/Media.java
@@ -158,6 +158,7 @@ public class Media implements Comparable<Media> {
                 mAlbum = getValueWrapper(track.Album, UnknownStringType.Album);
                 mGenre = getValueWrapper(track.Genre, UnknownStringType.Genre);
                 mArtworkURL = track.ArtworkURL;
+                mNowPlaying = track.NowPlaying;
                 Log.d(TAG, "Title " + mTitle);
                 Log.d(TAG, "Artist " + mArtist);
                 Log.d(TAG, "Genre " + mGenre);
diff --git a/libvlc/src/org/videolan/libvlc/TrackInfo.java b/libvlc/src/org/videolan/libvlc/TrackInfo.java
index b55dc55..b651540 100644
--- a/libvlc/src/org/videolan/libvlc/TrackInfo.java
+++ b/libvlc/src/org/videolan/libvlc/TrackInfo.java
@@ -50,4 +50,5 @@ public class TrackInfo {
     public String Album;
     public String Genre;
     public String ArtworkURL;
+    public String NowPlaying;
 }
-- 
2.1.0



More information about the Android mailing list