Commit 8bf12674 by bachinger Committed by Oliver Woodman

allow developers to set the subText of the notifcation

Issue: #5344
PiperOrigin-RevId: 229527963
parent 4483639f
......@@ -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 ###
......
......@@ -126,6 +126,18 @@ public class PlayerNotificationManager {
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.
*
* <p>When a bitmap initially needs to be asynchronously loaded, a placeholder (or null) can be
......@@ -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(
......
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