DefaultMediaDescriptionAdapter
@UnstableApi
class DefaultMediaDescriptionAdapter : PlayerNotificationManager.MediaDescriptionAdapter
Default implementation of MediaDescriptionAdapter.
Uses values from the player mediaMetadata to populate the notification.
Summary
Public constructors |
|---|
DefaultMediaDescriptionAdapter(pendingIntent: PendingIntent?)Creates a default |
Public functions |
|
|---|---|
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(Gets the large icon for the current media item. |
Inherited functions |
||
|---|---|---|
|
Public constructors
DefaultMediaDescriptionAdapter
DefaultMediaDescriptionAdapter(pendingIntent: PendingIntent?)
Creates a default MediaDescriptionAdapter.
| Parameters | |
|---|---|
pendingIntent: PendingIntent? |
The |
Public functions
createCurrentContentIntent
fun createCurrentContentIntent(player: Player!): PendingIntent?
Creates a content intent for the current media item.
See setContentIntent.
| Returns | |
|---|---|
PendingIntent? |
The content intent for the current media item, or null if no intent should be fired. |
getCurrentContentText
fun getCurrentContentText(player: Player!): CharSequence?
Gets the content text for the current media item.
See setContentText.
| Returns | |
|---|---|
CharSequence? |
The content text for the current media item, or null if no context text should be displayed. |
getCurrentContentTitle
fun getCurrentContentTitle(player: Player!): CharSequence!
Gets the content title for the current media item.
See setContentTitle.
| Returns | |
|---|---|
CharSequence! |
The content title for the current media item. |
getCurrentLargeIcon
fun getCurrentLargeIcon(
player: Player!,
callback: PlayerNotificationManager.BitmapCallback!
): Bitmap?
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 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 setLargeIcon.
| Parameters | |
|---|---|
player: Player! |
The |
callback: PlayerNotificationManager.BitmapCallback! |
A |
| Returns | |
|---|---|
Bitmap? |
The large icon for the current media item, or null if the icon will be returned through the |