PreviousMediaItemButton
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
: An AstroPlayerState
object that provides access to player state and information.
: Modifier to apply to the button (optional)
: Function to be called when the button is clicked (default: calls seekToPreviousMediaItem on astroPlayer)
: The vector asset to be used as the button icon (default: Icons.Outlined.SkipPrevious)
: A content description for accessibility (default: "Seek to previous MediaItem")
: Boolean indicating whether the button is clickable (default: true)
: Colors to be applied to the button (default: IconButtonDefaults.iconButtonColors())
: 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).