mirror of
https://github.com/androidx/media.git
synced 2025-05-08 08:00:49 +08:00
allow developers to set the subText of the notifcation
Issue: #5344 PiperOrigin-RevId: 229527963
This commit is contained in:
parent
4483639f9a
commit
8bf1267495
@ -16,6 +16,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 ###
|
||||||
|
|
||||||
|
@ -125,6 +125,18 @@ public class PlayerNotificationManager {
|
|||||||
@Nullable
|
@Nullable
|
||||||
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.
|
||||||
*
|
*
|
||||||
@ -832,6 +844,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(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user