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

Guillaume h.guillaume at gmail.com
Wed Apr 8 23:26:17 CEST 2015


This is AudioService.java. I just assumed it was only used for audio media
files. Is this wrong? In my testing, it hasn't triggered when playing video
files.

Only the strings can be null. If any of them are null, the receiver app
will deal with it accordingly. For instance, while some apps won't do
anything unless both "track" & "artist" have a value, some aren't even
interested in the strings and only look at the duration. Therefore passing
null values is fine.

On Wed, Apr 8, 2015 at 10:59 PM Jean-Baptiste Kempf <jb at videolan.org> wrote:

> 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
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20150408/5143647c/attachment.html>


More information about the vlc-devel mailing list