[vlc-devel] [PATCH] [Android] Implement Scrobbling compatibility (#11904)

Jean-Baptiste Kempf jb at videolan.org
Wed Apr 8 22:59:42 CEST 2015


On 08 Apr, Guillaume wrote :
> +    private void broadcastMetadata(Context context) {
> +        MediaWrapper media = getCurrentMedia();
> +        if (media == null)
> +            return;
> +        String track = media.getTitle();
> +        String artist = Util.getMediaArtist(this, media);
> +        String album = Util.getMediaAlbum(this, media);
> +        long duration = media.getLength();
> +        boolean playing = mLibVLC.isPlaying();
> +
> +        Intent broadcast = new Intent("com.android.music.metachanged");
> +        broadcast.putExtra("track", track);
> +        broadcast.putExtra("artist", artist);
> +        broadcast.putExtra("album", album);
> +        broadcast.putExtra("duration", duration);
> +        broadcast.putExtra("playing", playing);
> +
> +        context.sendBroadcast(broadcast);
> +    }

What happens if any of those are null? Or if the media is a video?

With my kindest regards,

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



More information about the vlc-devel mailing list