Search in sources :

Example 6 with MediaItem

use of android.support.v4.media.MediaBrowserCompat.MediaItem in project AntennaPod by AntennaPod.

the class FeedMedia method getMediaItem.

/**
     * Returns a MediaItem representing the FeedMedia object.
     * This is used by the MediaBrowserService
     */
public MediaBrowserCompat.MediaItem getMediaItem() {
    Playable p = this;
    MediaDescriptionCompat description = new MediaDescriptionCompat.Builder().setMediaId(String.valueOf(id)).setTitle(p.getEpisodeTitle()).setDescription(p.getFeedTitle()).setSubtitle(p.getFeedTitle()).build();
    return new MediaBrowserCompat.MediaItem(description, MediaBrowserCompat.MediaItem.FLAG_PLAYABLE);
}
Also used : Playable(de.danoeh.antennapod.core.util.playback.Playable) MediaDescriptionCompat(android.support.v4.media.MediaDescriptionCompat)

Aggregations

MediaBrowserCompat (android.support.v4.media.MediaBrowserCompat)3 MediaSessionCompat (android.support.v4.media.session.MediaSessionCompat)3 Intent (android.content.Intent)2 MediaDescriptionCompat (android.support.v4.media.MediaDescriptionCompat)2 MediaMetadataCompat (android.support.v4.media.MediaMetadataCompat)2 MediaControllerCompat (android.support.v4.media.session.MediaControllerCompat)2 PendingIntent (android.app.PendingIntent)1 Context (android.content.Context)1 Bundle (android.os.Bundle)1 RemoteException (android.os.RemoteException)1 ListRow (android.support.v17.leanback.widget.ListRow)1 ListRowPresenter (android.support.v17.leanback.widget.ListRowPresenter)1 OnItemViewClickedListener (android.support.v17.leanback.widget.OnItemViewClickedListener)1 Presenter (android.support.v17.leanback.widget.Presenter)1 Row (android.support.v17.leanback.widget.Row)1 RowPresenter (android.support.v17.leanback.widget.RowPresenter)1 FragmentActivity (android.support.v4.app.FragmentActivity)1 MediaItem (android.support.v4.media.MediaBrowserCompat.MediaItem)1 MockResources (android.test.mock.MockResources)1 View (android.view.View)1