PreviousMediaItemButton

fun PreviousMediaItemButton(astroPlayerState: AstroPlayerState, modifier: Modifier = Modifier, onClick: () -> Unit = { astroPlayerState.astroPlayer.seekToPreviousMediaItem() }, imageVector: ImageVector = Icons.Outlined.SkipPrevious, contentDescription: String = "Seek to previous MediaItem", enabled: Boolean = true, colors: IconButtonColors = IconButtonDefaults.iconButtonColors(), interactionSource: MutableInteractionSource = remember { MutableInteractionSource() })

A composable function that renders a button to seek to the previous media item in a player.

This function is a wrapper around the standard IconButton composable with logic to handle enabling/disabling based on the availability of a previous media item in the AstroPlayerState.

Parameters

astroPlayerState

: An AstroPlayerState object that provides access to player state and information.

modifier

: Modifier to apply to the button (optional)

onClick

: Function to be called when the button is clicked (default: calls seekToPreviousMediaItem on astroPlayer)

imageVector

: The vector asset to be used as the button icon (default: Icons.Outlined.SkipPrevious)

contentDescription

: A content description for accessibility (default: "Seek to previous MediaItem")

enabled

: Boolean indicating whether the button is clickable (default: true)

colors

: Colors to be applied to the button (default: IconButtonDefaults.iconButtonColors())

interactionSource

: A MutableInteractionSource object to provide information about user interactions (default: a new instance)

This function checks if there's a previous media item using astroPlayerState.hasPreviousMediaItem before enabling the button. Clicking the button triggers the provided onClick function (default: seeks to the previous media item).