# PlayerNotificationManager.MediaDescriptionAdapter

Artifact: [androidx.media3:media3-ui](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/PlayerNotificationManager.java+class:androidx.media3.ui.PlayerNotificationManager.MediaDescriptionAdapter)

*** ** * ** ***


```
public interface PlayerNotificationManager.MediaDescriptionAdapter
```

<br />

Known direct subclasses [DefaultMediaDescriptionAdapter](https://developer.android.com/reference/androidx/media3/ui/DefaultMediaDescriptionAdapter)

|---|---|
| `https://developer.android.com/reference/androidx/media3/ui/DefaultMediaDescriptionAdapter` | Default implementation of `https://developer.android.com/reference/androidx/media3/ui/PlayerNotificationManager.MediaDescriptionAdapter`. |

*** ** * ** ***

An adapter to provide content assets of the media currently playing.

## Summary

| ### Public methods |
|---|---|
| `abstract @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/app/PendingIntent.html` | `https://developer.android.com/reference/androidx/media3/ui/PlayerNotificationManager.MediaDescriptionAdapter#createCurrentContentIntent(androidx.media3.common.Player)(https://developer.android.com/reference/androidx/media3/common/Player player)` Creates a content intent for the current media item. |
| `abstract @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/CharSequence.html` | `https://developer.android.com/reference/androidx/media3/ui/PlayerNotificationManager.MediaDescriptionAdapter#getCurrentContentText(androidx.media3.common.Player)(https://developer.android.com/reference/androidx/media3/common/Player player)` Gets the content text for the current media item. |
| `abstract https://developer.android.com/reference/java/lang/CharSequence.html` | `https://developer.android.com/reference/androidx/media3/ui/PlayerNotificationManager.MediaDescriptionAdapter#getCurrentContentTitle(androidx.media3.common.Player)(https://developer.android.com/reference/androidx/media3/common/Player player)` Gets the content title for the current media item. |
| `abstract @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/graphics/Bitmap.html` | `https://developer.android.com/reference/androidx/media3/ui/PlayerNotificationManager.MediaDescriptionAdapter#getCurrentLargeIcon(androidx.media3.common.Player,androidx.media3.ui.PlayerNotificationManager.BitmapCallback)( https://developer.android.com/reference/androidx/media3/common/Player player, https://developer.android.com/reference/androidx/media3/ui/PlayerNotificationManager.BitmapCallback callback )` Gets the large icon for the current media item. |
| `default @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/CharSequence.html` | `https://developer.android.com/reference/androidx/media3/ui/PlayerNotificationManager.MediaDescriptionAdapter#getCurrentSubText(androidx.media3.common.Player)(https://developer.android.com/reference/androidx/media3/common/Player player)` Gets the content sub text for the current media item. |

## Public methods

### createCurrentContentIntent

```
abstract @Nullable PendingIntent createCurrentContentIntent(Player player)
```

Creates a content intent for the current media item.

See `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder#setContentIntent(android.app.PendingIntent)`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/Player player` | The `https://developer.android.com/reference/androidx/media3/common/Player` for which a notification is being built. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/app/PendingIntent.html` | The content intent for the current media item, or null if no intent should be fired. |

### getCurrentContentText

```
abstract @Nullable CharSequence getCurrentContentText(Player player)
```

Gets the content text for the current media item.

See `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder#setContentText(java.lang.CharSequence)`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/Player player` | The `https://developer.android.com/reference/androidx/media3/common/Player` for which a notification is being built. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/CharSequence.html` | The content text for the current media item, or null if no context text should be displayed. |

### getCurrentContentTitle

```
abstract CharSequence getCurrentContentTitle(Player player)
```

Gets the content title for the current media item.

See `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder#setContentTitle(java.lang.CharSequence)`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/Player player` | The `https://developer.android.com/reference/androidx/media3/common/Player` for which a notification is being built. |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/CharSequence.html` | The content title for the current media item. |

### getCurrentLargeIcon

```
abstract @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 `https://developer.android.com/reference/androidx/media3/ui/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 `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder#setLargeIcon(android.graphics.Bitmap)`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/Player player` | The `https://developer.android.com/reference/androidx/media3/common/Player` for which a notification is being built. |
| `https://developer.android.com/reference/androidx/media3/ui/PlayerNotificationManager.BitmapCallback callback` | A `https://developer.android.com/reference/androidx/media3/ui/PlayerNotificationManager.BitmapCallback` to provide a `https://developer.android.com/reference/android/graphics/Bitmap.html` asynchronously. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/graphics/Bitmap.html` | The large icon for the current media item, or null if the icon will be returned through the `https://developer.android.com/reference/androidx/media3/ui/PlayerNotificationManager.BitmapCallback` or if no icon should be displayed. |

### getCurrentSubText

```
default @Nullable CharSequence getCurrentSubText(Player player)
```

Gets the content sub text for the current media item.

See `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder#setSubText(java.lang.CharSequence)`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/Player player` | The `https://developer.android.com/reference/androidx/media3/common/Player` for which a notification is being built. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/CharSequence.html` | The content subtext for the current media item, or null if no subtext should be displayed. |