Add current and total track numbers to metadata
This commit is contained in:
parent
224a607bc3
commit
ccdd450283
|
@ -60,6 +60,8 @@ public class BasePlayerMediaSession implements MediaSessionCallback {
|
||||||
Bundle additionalMetadata = new Bundle();
|
Bundle additionalMetadata = new Bundle();
|
||||||
additionalMetadata.putString(MediaMetadataCompat.METADATA_KEY_ARTIST, item.getUploader());
|
additionalMetadata.putString(MediaMetadataCompat.METADATA_KEY_ARTIST, item.getUploader());
|
||||||
additionalMetadata.putLong(MediaMetadataCompat.METADATA_KEY_DURATION, item.getDuration() * 1000);
|
additionalMetadata.putLong(MediaMetadataCompat.METADATA_KEY_DURATION, item.getDuration() * 1000);
|
||||||
|
additionalMetadata.putLong(MediaMetadataCompat.METADATA_KEY_TRACK_NUMBER, index + 1);
|
||||||
|
additionalMetadata.putLong(MediaMetadataCompat.METADATA_KEY_NUM_TRACKS, player.getPlayQueue().size());
|
||||||
descriptionBuilder.setExtras(additionalMetadata);
|
descriptionBuilder.setExtras(additionalMetadata);
|
||||||
|
|
||||||
final Uri thumbnailUri = Uri.parse(item.getThumbnailUrl());
|
final Uri thumbnailUri = Uri.parse(item.getThumbnailUrl());
|
||||||
|
|
Loading…
Reference in New Issue