Exemple #1
0
 public static void openMedia(final Context context, final MediaWrapper media) {
   if (media == null) return;
   if (media.getType() == MediaWrapper.TYPE_VIDEO)
     VideoPlayerActivity.start(context, media.getUri(), media.getTitle());
   else if (media.getType() == MediaWrapper.TYPE_AUDIO) {
     new DialogCallback(
         context,
         new DialogCallback.Runnable() {
           @Override
           public void run(PlaybackService service) {
             service.load(media);
           }
         });
   }
 }
Exemple #2
0
 public static String getMediaSubtitle(Context ctx, MediaWrapper media) {
   if (media.getType() == MediaWrapper.TYPE_AUDIO)
     return media.getNowPlaying() != null
         ? media.getNowPlaying()
         : getMediaArtist(ctx, media) + " - " + getMediaAlbum(ctx, media);
   else return "";
 }