Commit 8adc16a6 by bachinger Committed by Oliver Woodman

allow developers to set the subText of the notifcation

Issue: #5344
PiperOrigin-RevId: 229527963
parent ca7675ce
...@@ -54,6 +54,8 @@ ...@@ -54,6 +54,8 @@
([#5351](https://github.com/google/ExoPlayer/issues/5351)). ([#5351](https://github.com/google/ExoPlayer/issues/5351)).
* Fix issue where uneven track durations in MP4 streams can cause OOM problems * Fix issue where uneven track durations in MP4 streams can cause OOM problems
([#3670](https://github.com/google/ExoPlayer/issues/3670)). ([#3670](https://github.com/google/ExoPlayer/issues/3670)).
* Add the sub text to the MediaDescriptionAdapter of the
PlayerNotificationManager.
### 2.9.3 ### ### 2.9.3 ###
......
...@@ -127,6 +127,18 @@ public class PlayerNotificationManager { ...@@ -127,6 +127,18 @@ public class PlayerNotificationManager {
String getCurrentContentText(Player player); String getCurrentContentText(Player player);
/** /**
* Gets the content sub text for the current media item.
*
* <p>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. * Gets the large icon for the current media item.
* *
* <p>When a bitmap initially needs to be asynchronously loaded, a placeholder (or null) can be * <p>When a bitmap initially needs to be asynchronously loaded, a placeholder (or null) can be
...@@ -946,6 +958,7 @@ public class PlayerNotificationManager { ...@@ -946,6 +958,7 @@ public class PlayerNotificationManager {
// Set media specific notification properties from MediaDescriptionAdapter. // Set media specific notification properties from MediaDescriptionAdapter.
builder.setContentTitle(mediaDescriptionAdapter.getCurrentContentTitle(player)); builder.setContentTitle(mediaDescriptionAdapter.getCurrentContentTitle(player));
builder.setContentText(mediaDescriptionAdapter.getCurrentContentText(player)); builder.setContentText(mediaDescriptionAdapter.getCurrentContentText(player));
builder.setSubText(mediaDescriptionAdapter.getCurrentSubText(player));
if (largeIcon == null) { if (largeIcon == null) {
largeIcon = largeIcon =
mediaDescriptionAdapter.getCurrentLargeIcon( mediaDescriptionAdapter.getCurrentLargeIcon(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment