# DefaultMediaDescriptionAdapter

# DefaultMediaDescriptionAdapter

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/DefaultMediaDescriptionAdapter.java+class:androidx.media3.ui.DefaultMediaDescriptionAdapter)

*** ** * ** ***

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

<br />

```
@UnstableApi
class DefaultMediaDescriptionAdapter : PlayerNotificationManager.MediaDescriptionAdapter
```

<br />

*** ** * ** ***

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

Uses values from the[player mediaMetadata](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getMediaMetadata())to populate the notification.

## Summary

|                                                                                                                                                                                                                          ### Public constructors                                                                                                                                                                                                                           |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DefaultMediaDescriptionAdapter](https://developer.android.com/reference/kotlin/androidx/media3/ui/DefaultMediaDescriptionAdapter#DefaultMediaDescriptionAdapter(android.app.PendingIntent))`(pendingIntent: `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`?)` Creates a default[MediaDescriptionAdapter](https://developer.android.com/reference/kotlin/androidx/media3/ui/PlayerNotificationManager.MediaDescriptionAdapter). |

|                                       ### Public functions                                        |
|---------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`?`        | [createCurrentContentIntent](https://developer.android.com/reference/kotlin/androidx/media3/ui/DefaultMediaDescriptionAdapter#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/DefaultMediaDescriptionAdapter#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/DefaultMediaDescriptionAdapter#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/DefaultMediaDescriptionAdapter#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. |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.media3.ui.PlayerNotificationManager.MediaDescriptionAdapter](https://developer.android.com/reference/kotlin/androidx/media3/ui/PlayerNotificationManager.MediaDescriptionAdapter) |---------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [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 constructors

### DefaultMediaDescriptionAdapter

```
DefaultMediaDescriptionAdapter(pendingIntent: PendingIntent?)
```

Creates a default[MediaDescriptionAdapter](https://developer.android.com/reference/kotlin/androidx/media3/ui/PlayerNotificationManager.MediaDescriptionAdapter).  

|                                                 Parameters                                                  |
|-------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `pendingIntent: `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`?` | The[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)to be returned from[createCurrentContentIntent](https://developer.android.com/reference/kotlin/androidx/media3/ui/DefaultMediaDescriptionAdapter#createCurrentContentIntent(androidx.media3.common.Player)), or null if no intent should be fired. |

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