# Artwork

## Functions summary

|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/Artwork.composable#Artwork(androidx.media3.common.Player,androidx.compose.ui.Modifier,kotlin.String,androidx.compose.ui.Alignment,androidx.compose.ui.layout.ContentScale,kotlin.Float,androidx.compose.ui.graphics.ColorFilter,kotlin.Function1)( player: https://developer.android.com/reference/kotlin/androidx/media3/common/Player?, modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier, contentDescription: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, alignment: https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment, contentScale: https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ContentScale, alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, colorFilter: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorFilter?, painter: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/CurrentMediaItemState.() -> https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter? )` Displays the artwork of the current `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem` from the `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/package-summary#Artwork(androidx.media3.common.Player,androidx.compose.ui.Modifier,kotlin.String,androidx.compose.ui.Alignment,androidx.compose.ui.layout.ContentScale,kotlin.Float,androidx.compose.ui.graphics.ColorFilter,kotlin.Function1)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/Artwork.composable#Artwork(androidx.media3.common.MediaMetadata,androidx.compose.ui.Modifier,kotlin.String,androidx.compose.ui.Alignment,androidx.compose.ui.layout.ContentScale,kotlin.Float,androidx.compose.ui.graphics.ColorFilter,androidx.compose.ui.graphics.FilterQuality,androidx.media3.common.util.BitmapLoader,androidx.compose.ui.graphics.painter.Painter,androidx.compose.ui.graphics.painter.Painter,androidx.compose.ui.graphics.painter.Painter,kotlinx.coroutines.CoroutineDispatcher)( metadata: https://developer.android.com/reference/kotlin/androidx/media3/common/MediaMetadata?, modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier, contentDescription: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, alignment: https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment, contentScale: https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ContentScale, alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, colorFilter: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorFilter?, filterQuality: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/FilterQuality, bitmapLoader: https://developer.android.com/reference/kotlin/androidx/media3/common/util/BitmapLoader?, placeholder: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter?, error: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter?, fallback: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter?, coroutineDispatcher: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html )` Displays artwork for the given `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaMetadata`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/Artwork.composable#Artwork(androidx.media3.common.Player,androidx.compose.ui.Modifier,kotlin.String,androidx.compose.ui.Alignment,androidx.compose.ui.layout.ContentScale,kotlin.Float,androidx.compose.ui.graphics.ColorFilter,androidx.compose.ui.graphics.FilterQuality,androidx.media3.common.util.BitmapLoader,androidx.compose.ui.graphics.painter.Painter,androidx.compose.ui.graphics.painter.Painter,androidx.compose.ui.graphics.painter.Painter,kotlinx.coroutines.CoroutineDispatcher)( player: https://developer.android.com/reference/kotlin/androidx/media3/common/Player?, modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier, contentDescription: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, alignment: https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment, contentScale: https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ContentScale, alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, colorFilter: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorFilter?, filterQuality: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/FilterQuality, bitmapLoader: https://developer.android.com/reference/kotlin/androidx/media3/common/util/BitmapLoader?, placeholder: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter?, error: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter?, fallback: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter?, coroutineDispatcher: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html )` Displays the artwork of the current `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem` from the `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/package-summary#Artwork(androidx.media3.common.Player,androidx.compose.ui.Modifier,kotlin.String,androidx.compose.ui.Alignment,androidx.compose.ui.layout.ContentScale,kotlin.Float,androidx.compose.ui.graphics.ColorFilter,androidx.compose.ui.graphics.FilterQuality,androidx.media3.common.util.BitmapLoader,androidx.compose.ui.graphics.painter.Painter,androidx.compose.ui.graphics.painter.Painter,androidx.compose.ui.graphics.painter.Painter,kotlinx.coroutines.CoroutineDispatcher)`. |

## Functions

### Artwork

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/Artwork.kt+function:Artwork)

```
@UnstableApi
@Composable
fun Artwork(
    player: Player?,
    modifier: Modifier = Modifier,
    contentDescription: String? = null,
    alignment: Alignment = Alignment.Center,
    contentScale: ContentScale = ContentScale.Fit,
    alpha: Float = DefaultAlpha,
    colorFilter: ColorFilter? = null,
    painter: @Composable CurrentMediaItemState.() -> Painter?
): Unit
```

Displays the artwork of the current `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem` from the `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/package-summary#Artwork(androidx.media3.common.Player,androidx.compose.ui.Modifier,kotlin.String,androidx.compose.ui.Alignment,androidx.compose.ui.layout.ContentScale,kotlin.Float,androidx.compose.ui.graphics.ColorFilter,kotlin.Function1)`.

This overload is designed for custom image loading. It delegates the rendering of the artwork to the provided `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/package-summary#Artwork(androidx.media3.common.Player,androidx.compose.ui.Modifier,kotlin.String,androidx.compose.ui.Alignment,androidx.compose.ui.layout.ContentScale,kotlin.Float,androidx.compose.ui.graphics.ColorFilter,kotlin.Function1)` composable function, which has access to the `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/CurrentMediaItemState`.

| Parameters |
|---|---|
| `player: https://developer.android.com/reference/kotlin/androidx/media3/common/Player?` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` to get the current media item from. |
| `modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier = Modifier` | The `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` to be applied to this composable. |
| `contentDescription: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? = null` | The content description for the artwork. Defaults to title or null. |
| `alignment: https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment = Alignment.Center` | Optional scale alignment within the container. |
| `contentScale: https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ContentScale = ContentScale.Fit` | Optional scale type for the artwork image. |
| `alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = DefaultAlpha` | Optional opacity to be applied to the artwork image. |
| `colorFilter: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorFilter? = null` | Optional `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorFilter` to apply for the artwork image. |
| `painter: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/state/CurrentMediaItemState.() -> https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter?` | A composable function that returns a `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter` to display the artwork. |

### Artwork

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/Artwork.kt+function:Artwork)

```
@UnstableApi
@Composable
fun Artwork(
    metadata: MediaMetadata?,
    modifier: Modifier = Modifier,
    contentDescription: String? = metadata?.title?.toString(),
    alignment: Alignment = Alignment.Center,
    contentScale: ContentScale = ContentScale.Fit,
    alpha: Float = DefaultAlpha,
    colorFilter: ColorFilter? = null,
    filterQuality: FilterQuality = DefaultFilterQuality,
    bitmapLoader: BitmapLoader? = null,
    placeholder: Painter? = null,
    error: Painter? = null,
    fallback: Painter? = error,
    coroutineDispatcher: CoroutineDispatcher = Dispatchers.IO
): Unit
```

Displays artwork for the given `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaMetadata`.

This overload is designed for displaying artwork from a specific `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaMetadata` instance, independent of the player's current item (e.g. for displaying artwork in a playlist). If `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/package-summary#Artwork(androidx.media3.common.MediaMetadata,androidx.compose.ui.Modifier,kotlin.String,androidx.compose.ui.Alignment,androidx.compose.ui.layout.ContentScale,kotlin.Float,androidx.compose.ui.graphics.ColorFilter,androidx.compose.ui.graphics.FilterQuality,androidx.media3.common.util.BitmapLoader,androidx.compose.ui.graphics.painter.Painter,androidx.compose.ui.graphics.painter.Painter,androidx.compose.ui.graphics.painter.Painter,kotlinx.coroutines.CoroutineDispatcher)` is not provided, it falls back to a default implementation that only supports reading local URIs and byte arrays.

| Parameters |
|---|---|
| `metadata: https://developer.android.com/reference/kotlin/androidx/media3/common/MediaMetadata?` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaMetadata` containing artwork info. |
| `modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier = Modifier` | The `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` to be applied to this composable. |
| `contentDescription: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? = metadata?.title?.toString()` | The content description for the artwork. Defaults to metadata title. |
| `alignment: https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment = Alignment.Center` | Optional scale alignment within the container. |
| `contentScale: https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ContentScale = ContentScale.Fit` | Optional scale type for the artwork image. |
| `alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = DefaultAlpha` | Optional opacity to be applied to the artwork image. |
| `colorFilter: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorFilter? = null` | Optional `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorFilter` to apply for the artwork image. |
| `filterQuality: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/FilterQuality = DefaultFilterQuality` | Optional `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/FilterQuality` to apply to the artwork image bitmap. |
| `bitmapLoader: https://developer.android.com/reference/kotlin/androidx/media3/common/util/BitmapLoader? = null` | Optional custom artwork loader. If `null`, defaults to reading artwork data or URI from `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaMetadata` using internal BitmapFactory. |
| `placeholder: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter? = null` | Optional `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter` to display while the artwork is loading (after the 1-second delay). |
| `error: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter? = null` | Optional `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter` to display if the artwork loading throws an exception. |
| `fallback: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter? = error` | Optional `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter` to display if the media item has no artwork. Defaults to `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/package-summary#Artwork(androidx.media3.common.MediaMetadata,androidx.compose.ui.Modifier,kotlin.String,androidx.compose.ui.Alignment,androidx.compose.ui.layout.ContentScale,kotlin.Float,androidx.compose.ui.graphics.ColorFilter,androidx.compose.ui.graphics.FilterQuality,androidx.media3.common.util.BitmapLoader,androidx.compose.ui.graphics.painter.Painter,androidx.compose.ui.graphics.painter.Painter,androidx.compose.ui.graphics.painter.Painter,kotlinx.coroutines.CoroutineDispatcher)`. |
| `coroutineDispatcher: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html = Dispatchers.IO` | Optional `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html` to execute background artwork loading. Defaults to `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-dispatchers/-i-o.html`. |

### Artwork

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/Artwork.kt+function:Artwork)

```
@UnstableApi
@Composable
fun Artwork(
    player: Player?,
    modifier: Modifier = Modifier,
    contentDescription: String? = null,
    alignment: Alignment = Alignment.Center,
    contentScale: ContentScale = ContentScale.Fit,
    alpha: Float = DefaultAlpha,
    colorFilter: ColorFilter? = null,
    filterQuality: FilterQuality = DefaultFilterQuality,
    bitmapLoader: BitmapLoader? = null,
    placeholder: Painter? = null,
    error: Painter? = null,
    fallback: Painter? = error,
    coroutineDispatcher: CoroutineDispatcher = Dispatchers.IO
): Unit
```

Displays the artwork of the current `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem` from the `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/package-summary#Artwork(androidx.media3.common.Player,androidx.compose.ui.Modifier,kotlin.String,androidx.compose.ui.Alignment,androidx.compose.ui.layout.ContentScale,kotlin.Float,androidx.compose.ui.graphics.ColorFilter,androidx.compose.ui.graphics.FilterQuality,androidx.media3.common.util.BitmapLoader,androidx.compose.ui.graphics.painter.Painter,androidx.compose.ui.graphics.painter.Painter,androidx.compose.ui.graphics.painter.Painter,kotlinx.coroutines.CoroutineDispatcher)`.

This overload is designed for displaying artwork using a built-in or custom `https://developer.android.com/reference/kotlin/androidx/media3/common/util/BitmapLoader`. It automatically tracks the player's current media item. If `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/package-summary#Artwork(androidx.media3.common.Player,androidx.compose.ui.Modifier,kotlin.String,androidx.compose.ui.Alignment,androidx.compose.ui.layout.ContentScale,kotlin.Float,androidx.compose.ui.graphics.ColorFilter,androidx.compose.ui.graphics.FilterQuality,androidx.media3.common.util.BitmapLoader,androidx.compose.ui.graphics.painter.Painter,androidx.compose.ui.graphics.painter.Painter,androidx.compose.ui.graphics.painter.Painter,kotlinx.coroutines.CoroutineDispatcher)` is not provided, it falls back to a default implementation that only supports reading local URIs and byte arrays.

| Parameters |
|---|---|
| `player: https://developer.android.com/reference/kotlin/androidx/media3/common/Player?` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` to get the current media item from. |
| `modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier = Modifier` | The `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` to be applied to this composable. |
| `contentDescription: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? = null` | The content description for the artwork. Defaults to title or null. |
| `alignment: https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment = Alignment.Center` | Optional scale alignment within the container. |
| `contentScale: https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ContentScale = ContentScale.Fit` | Optional scale type for the artwork image. |
| `alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = DefaultAlpha` | Optional opacity to be applied to the artwork image. |
| `colorFilter: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorFilter? = null` | Optional `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorFilter` to apply for the artwork image. |
| `filterQuality: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/FilterQuality = DefaultFilterQuality` | Optional `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/FilterQuality` to apply to the artwork image bitmap. |
| `bitmapLoader: https://developer.android.com/reference/kotlin/androidx/media3/common/util/BitmapLoader? = null` | Optional custom artwork loader. If `null`, defaults to reading artwork data or URI from `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaMetadata` using internal BitmapFactory. |
| `placeholder: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter? = null` | Optional `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter` to display while the artwork is loading (after the 1-second delay). |
| `error: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter? = null` | Optional `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter` to display if the artwork loading throws an exception. |
| `fallback: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter? = error` | Optional `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter` to display if the media item has no artwork. Defaults to `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/package-summary#Artwork(androidx.media3.common.Player,androidx.compose.ui.Modifier,kotlin.String,androidx.compose.ui.Alignment,androidx.compose.ui.layout.ContentScale,kotlin.Float,androidx.compose.ui.graphics.ColorFilter,androidx.compose.ui.graphics.FilterQuality,androidx.media3.common.util.BitmapLoader,androidx.compose.ui.graphics.painter.Painter,androidx.compose.ui.graphics.painter.Painter,androidx.compose.ui.graphics.painter.Painter,kotlinx.coroutines.CoroutineDispatcher)`. |
| `coroutineDispatcher: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html = Dispatchers.IO` | Optional `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html` to execute background artwork loading. Defaults to `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-dispatchers/-i-o.html`. |