# PlayerNotificationManager.MediaDescriptionAdapter

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/ui/PlayerNotificationManager.MediaDescriptionAdapter "View this page in Java")

<br />

```
interface PlayerNotificationManager.MediaDescriptionAdapter
```

<br />

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

|------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DefaultMediaDescriptionAdapter](https://developer.android.com/reference/kotlin/androidx/media3/ui/DefaultMediaDescriptionAdapter) | Default implementation of[MediaDescriptionAdapter](https://developer.android.com/reference/kotlin/androidx/media3/ui/PlayerNotificationManager.MediaDescriptionAdapter). |

*** ** * ** ***

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

## Summary

|                                       ### Public functions                                        |
|---------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`?`        | [createCurrentContentIntent](https://developer.android.com/reference/kotlin/androidx/media3/ui/PlayerNotificationManager.MediaDescriptionAdapter#createCurrentContentIntent(androidx.media3.common.Player))`(player: `[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)`!)` Creates a content intent for the current media item.                                                                                                                                                                                                                         |
| [CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`?` | [getCurrentContentText](https://developer.android.com/reference/kotlin/androidx/media3/ui/PlayerNotificationManager.MediaDescriptionAdapter#getCurrentContentText(androidx.media3.common.Player))`(player: `[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)`!)` Gets the content text for the current media item.                                                                                                                                                                                                                                      |
| [CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`!` | [getCurrentContentTitle](https://developer.android.com/reference/kotlin/androidx/media3/ui/PlayerNotificationManager.MediaDescriptionAdapter#getCurrentContentTitle(androidx.media3.common.Player))`(player: `[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)`!)` Gets the content title for the current media item.                                                                                                                                                                                                                                   |
| [Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)`?`                 | [getCurrentLargeIcon](https://developer.android.com/reference/kotlin/androidx/media3/ui/PlayerNotificationManager.MediaDescriptionAdapter#getCurrentLargeIcon(androidx.media3.common.Player,androidx.media3.ui.PlayerNotificationManager.BitmapCallback))`(` ` player: `[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)`!,` ` callback: `[PlayerNotificationManager.BitmapCallback](https://developer.android.com/reference/kotlin/androidx/media3/ui/PlayerNotificationManager.BitmapCallback)`!` `)` Gets the large icon for the current media item. |
| [CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`?` | [getCurrentSubText](https://developer.android.com/reference/kotlin/androidx/media3/ui/PlayerNotificationManager.MediaDescriptionAdapter#getCurrentSubText(androidx.media3.common.Player))`(player: `[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)`!)` Gets the content sub text for the current media item.                                                                                                                                                                                                                                          |

## Public functions

### createCurrentContentIntent

```
fun createCurrentContentIntent(player: Player!): PendingIntent?
```

Creates a content intent for the current media item.

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

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

|                                          Returns                                           |
|--------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
| [PendingIntent](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

```
fun getCurrentContentText(player: Player!): CharSequence?
```

Gets the content text for the current media item.

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

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

|                                              Returns                                              |
|---------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| [CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`?` | 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](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#setContentTitle(java.lang.CharSequence)).  

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

|                                              Returns                                              |
|---------------------------------------------------------------------------------------------------|-----------------------------------------------|
| [CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`!` | 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](https://developer.android.com/reference/kotlin/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[setLargeIcon](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#setLargeIcon(android.graphics.Bitmap)).  

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

|                                      Returns                                      |
|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Bitmap](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[BitmapCallback](https://developer.android.com/reference/kotlin/androidx/media3/ui/PlayerNotificationManager.BitmapCallback)or if no icon should be displayed. |

### getCurrentSubText

```
fun getCurrentSubText(player: Player!): CharSequence?
```

Gets the content sub text for the current media item.

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

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

|                                              Returns                                              |
|---------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|
| [CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`?` | The content subtext for the current media item, or null if no subtext should be displayed. |