diff --git a/RELEASENOTES.md b/RELEASENOTES.md index f6ecfb962e..7fb10727cc 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -16,6 +16,8 @@ ([#5351](https://github.com/google/ExoPlayer/issues/5351)). * Fix issue where uneven track durations in MP4 streams can cause OOM problems ([#3670](https://github.com/google/ExoPlayer/issues/3670)). +* Add the sub text to the MediaDescriptionAdapter of the + PlayerNotificationManager. ### 2.9.3 ### diff --git a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java index 47025d9bba..7cbe52d404 100644 --- a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java +++ b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java @@ -125,6 +125,18 @@ public class PlayerNotificationManager { @Nullable String getCurrentContentText(Player player); + /** + * Gets the content sub text for the current media item. + * + *

See {@link NotificationCompat.Builder#setSubText(CharSequence)}. + * + * @param player The {@link Player} for which a notification is being built. + */ + @Nullable + default String getCurrentSubText(Player player) { + return null; + } + /** * Gets the large icon for the current media item. * @@ -832,6 +844,7 @@ public class PlayerNotificationManager { // Set media specific notification properties from MediaDescriptionAdapter. builder.setContentTitle(mediaDescriptionAdapter.getCurrentContentTitle(player)); builder.setContentText(mediaDescriptionAdapter.getCurrentContentText(player)); + builder.setSubText(mediaDescriptionAdapter.getCurrentSubText(player)); if (largeIcon == null) { largeIcon = mediaDescriptionAdapter.getCurrentLargeIcon(