# A2uiAudioPlayerRenderer

Artifact: [androidx.compose.material3:material3-a2ui](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/a2ui/catalog/MaterialA2uiBasicCatalogV1AudioPlayer.kt+class:androidx.compose.material3.a2ui.catalog.A2uiAudioPlayerRenderer) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/compose-material3#1.0.0-alpha02)


```
fun interface A2uiAudioPlayerRenderer
```

<br />

*** ** * ** ***

An abstraction of an asynchronous audio player which should be implemented using the application's media loading library (such as Media3/ExoPlayer), used for rendering audio playback controls for `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/ui/catalog/A2uiBasicCatalogV1.AudioPlayer`.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/a2ui/catalog/A2uiAudioPlayerRenderer#AudioPlayer(kotlin.String,kotlin.String,androidx.compose.ui.Modifier,kotlin.Function1)( url: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, contentDescription: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier, onError: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` Displays an audio player from a URL. |

## Public functions

### AudioPlayer

```
@Composable
fun AudioPlayer(
    url: String,
    contentDescription: String?,
    modifier: Modifier,
    onError: (Throwable?) -> Unit
): Unit
```

Displays an audio player from a URL.

| Parameters |
|---|---|
| `url: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The URL of the audio to load and play. |
| `contentDescription: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | Accessibility text for the audio player. |
| `modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | The modifier to be applied to the layout. |
| `onError: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | The callback to be invoked when the audio fails to load or play. |