Package com.google.android.exoplayer2.ui
Interface PlayerNotificationManager.MediaDescriptionAdapter
-
- All Known Implementing Classes:
DefaultMediaDescriptionAdapter
- Enclosing class:
- PlayerNotificationManager
public static interface PlayerNotificationManager.MediaDescriptionAdapter
An adapter to provide content assets of the media currently playing.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description PendingIntent
createCurrentContentIntent(Player player)
Creates a content intent for the current media item.CharSequence
getCurrentContentText(Player player)
Gets the content text for the current media item.CharSequence
getCurrentContentTitle(Player player)
Gets the content title for the current media item.Bitmap
getCurrentLargeIcon(Player player, PlayerNotificationManager.BitmapCallback callback)
Gets the large icon for the current media item.default CharSequence
getCurrentSubText(Player player)
Gets the content sub text for the current media item.
-
-
-
Method Detail
-
getCurrentContentTitle
CharSequence getCurrentContentTitle(Player player)
Gets the content title for the current media item.See
NotificationCompat.Builder.setContentTitle(CharSequence)
.- Parameters:
player
- ThePlayer
for which a notification is being built.- Returns:
- The content title for the current media item.
-
createCurrentContentIntent
@Nullable PendingIntent createCurrentContentIntent(Player player)
Creates a content intent for the current media item.See
NotificationCompat.Builder.setContentIntent(PendingIntent)
.- Parameters:
player
- ThePlayer
for which a notification is being built.- Returns:
- The content intent for the current media item, or null if no intent should be fired.
-
getCurrentContentText
@Nullable CharSequence getCurrentContentText(Player player)
Gets the content text for the current media item.See
NotificationCompat.Builder.setContentText(CharSequence)
.- Parameters:
player
- ThePlayer
for which a notification is being built.- Returns:
- The content text for the current media item, or null if no context text should be displayed.
-
getCurrentSubText
@Nullable default CharSequence getCurrentSubText(Player player)
Gets the content sub text for the current media item.See
NotificationCompat.Builder.setSubText(CharSequence)
.- Parameters:
player
- ThePlayer
for which a notification is being built.- Returns:
- The content subtext for the current media item, or null if no subtext should be displayed.
-
getCurrentLargeIcon
@Nullable Bitmap getCurrentLargeIcon(Player player, PlayerNotificationManager.BitmapCallback callback)
Gets the large icon for the current media item.When a bitmap needs to be loaded asynchronously, a placeholder bitmap (or null) should be returned. The actual bitmap should be passed to the
PlayerNotificationManager.BitmapCallback
once it has been loaded. Because the adapter may be called multiple times for the same media item, bitmaps should be cached by the app and returned synchronously when possible.See
NotificationCompat.Builder.setLargeIcon(Bitmap)
.- Parameters:
player
- ThePlayer
for which a notification is being built.callback
- APlayerNotificationManager.BitmapCallback
to provide aBitmap
asynchronously.- Returns:
- The large icon for the current media item, or null if the icon will be returned
through the
PlayerNotificationManager.BitmapCallback
or if no icon should be displayed.
-
-