# ErrorText

## 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/material3/text/ErrorText.composable#ErrorText(androidx.media3.common.Player,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Color,kotlin.CharSequence,androidx.media3.common.ErrorMessageProvider)( player: https://developer.android.com/reference/kotlin/androidx/media3/common/Player?, modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier, color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, customErrorMessage: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?, errorMessageProvider: https://developer.android.com/reference/kotlin/androidx/media3/common/ErrorMessageProvider<https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException>? )` A Composable for displaying an error message overlay on top of the player. |

## Functions

### ErrorText

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

```
@UnstableApi
@Composable
fun ErrorText(
    player: Player?,
    modifier: Modifier = Modifier,
    color: Color = Color.Unspecified,
    customErrorMessage: CharSequence? = null,
    errorMessageProvider: ErrorMessageProvider<PlaybackException>? = rememberDefaultErrorMessageProvider()
): Unit
```

A Composable for displaying an error message overlay on top of the player.

| Parameters |
|---|---|
| `player: https://developer.android.com/reference/kotlin/androidx/media3/common/Player?` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/Player` instance to observe for errors. |
| `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 the layout. |
| `color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | The `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` of the error text. |
| `customErrorMessage: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html? = null` | An optional custom message to display permanently. |
| `errorMessageProvider: https://developer.android.com/reference/kotlin/androidx/media3/common/ErrorMessageProvider<https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException>? = rememberDefaultErrorMessageProvider()` | An `https://developer.android.com/reference/kotlin/androidx/media3/common/ErrorMessageProvider` used to format the `https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException`. Defaults to a provider with localization support. |