AstroMediaItem

data class AstroMediaItem(val mediaId: String, val source: Uri, val metadata: AstroMediaMetadata?)

A data class representing a single media item in the AstroPlayer playlist.

Constructors

Link copied to clipboard
constructor(mediaId: String, source: Uri, metadata: AstroMediaMetadata?)

Properties

Link copied to clipboard

A unique identifier for the media item. The format and meaning of this ID are implementation-specific. This ID can be used to reference the media item within the AstroPlayer API.

Link copied to clipboard

Optional metadata associated with the media item. This AstroMediaMetadata provides additional information such as title, artist, album, genre, and more.

Link copied to clipboard
val source: Uri

The URI (Uniform Resource Identifier) of the media resource to play. This can be:

Functions

Link copied to clipboard
fun AstroMediaItem.asNativeMediaItem(metadata: MediaMetadata? = this.metadata?.asNativeMediaMetadata()): MediaItem

Converts an AstroMediaItem object to a platform-specific MediaItem object suitable for the underlying media player.

Link copied to clipboard
fun AstroMediaItem.asNativeMediaItemBuilder(metadata: MediaMetadata? = this.metadata?.asNativeMediaMetadata()): MediaItem.Builder

Creates a builder object for a platform-specific MediaItem compatible with the underlying media player, pre-populated with data from the current AstroMediaItem.