1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-01-22 23:17:00 +00:00

Add uploader name of streams as subtitle of MediaItems

They should be displayed only by Android Auto if they are known, i.e. when they
are not empty.
This commit is contained in:
AudricV 2023-08-20 17:44:44 +02:00 committed by Siddhesh Naik
parent 4fc92cbaa4
commit c916608c98

View File

@ -139,6 +139,7 @@ public class MediaBrowserConnector implements MediaSessionConnector.PlaybackPrep
final var builder = new MediaDescriptionCompat.Builder(); final var builder = new MediaDescriptionCompat.Builder();
builder.setMediaId(createMediaIdForPlaylistIndex(playlistId, index)) builder.setMediaId(createMediaIdForPlaylistIndex(playlistId, index))
.setTitle(item.getStreamEntity().getTitle()) .setTitle(item.getStreamEntity().getTitle())
.setSubtitle(item.getStreamEntity().getUploader())
.setIconUri(Uri.parse(item.getStreamEntity().getThumbnailUrl())); .setIconUri(Uri.parse(item.getStreamEntity().getThumbnailUrl()));
return new MediaItem(builder.build(), MediaItem.FLAG_PLAYABLE); return new MediaItem(builder.build(), MediaItem.FLAG_PLAYABLE);
@ -207,6 +208,7 @@ public class MediaBrowserConnector implements MediaSessionConnector.PlaybackPrep
final var builder = new MediaDescriptionCompat.Builder(); final var builder = new MediaDescriptionCompat.Builder();
builder.setMediaId(ID_STREAM + '/' + streamHistoryEntry.getStreamId()) builder.setMediaId(ID_STREAM + '/' + streamHistoryEntry.getStreamId())
.setTitle(streamHistoryEntry.getStreamEntity().getTitle()) .setTitle(streamHistoryEntry.getStreamEntity().getTitle())
.setSubtitle(streamHistoryEntry.getStreamEntity().getUploader())
.setIconUri(Uri.parse(streamHistoryEntry.getStreamEntity().getThumbnailUrl())); .setIconUri(Uri.parse(streamHistoryEntry.getStreamEntity().getThumbnailUrl()));
return new MediaItem(builder.build(), MediaItem.FLAG_PLAYABLE); return new MediaItem(builder.build(), MediaItem.FLAG_PLAYABLE);