Package-level declarations

Types

Link copied to clipboard
data class AstroMediaItem(val mediaId: String, val source: Uri, val metadata: AstroMediaMetadata?)

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

Link copied to clipboard
data class AstroMediaMetadata(val title: String? = null, val artist: String? = null, val albumTitle: String? = null, val albumArtist: String? = null, val displayTitle: String? = null, val subtitle: String? = null, val description: String? = null, val artworkUri: Uri? = null, val trackNumber: Int? = null, val totalTrackCount: Int? = null, val recordingYear: Int? = null, val recordingMonth: Int? = null, val recordingDay: Int? = null, val releaseYear: Int? = null, val releaseMonth: Int? = null, val releaseDay: Int? = null, val writer: String? = null, val composer: String? = null, val conductor: String? = null, val discNumber: Int? = null, val totalDiscCount: Int? = null, val genre: String? = null, val compilation: String? = null, val station: String? = null, val equalizerIdentifier: String? = null, val extras: Map<String, Any>? = null)

A data class representing metadata associated with a media item in the AstroPlayer playlist. This data class provides optional fields for various metadata categories. Not all fields might be available for all media types, and the specific information available will depend on the media source and the player implementation.

Link copied to clipboard
expect open class AstroPlayer(nativeMediaPlayer: NativeMediaPLayer)

The main class for controlling media playback.

actual open class AstroPlayer
actual open class AstroPlayer

The main class for controlling media playback.

Link copied to clipboard
external class Howl(properties: HowlerProperties) : HowlerProperties
Link copied to clipboard
external interface HowlerProperties
Link copied to clipboard
actual typealias NativeMediaPLayer = <Error class: unknown class>

An class representing the underlying native media player implementation.

expect class NativeMediaPLayer

An class representing the underlying native media player implementation.

actual typealias NativeMediaPLayer = EmbeddedMediaListPlayerComponent
actual typealias NativeMediaPLayer = Howl
Link copied to clipboard

An enum class representing the repeat mode of the AstroPlayer.

Properties

Link copied to clipboard

The metadata associated with the currently playing media item, or null if no item is playing or the item has no metadata.

Link copied to clipboard

Indicates whether there's a next media item available in the playlist after the current one.

Link copied to clipboard

Indicates whether there's a previous media item available in the playlist before the current one.

Functions

Link copied to clipboard

Registers a listener to receive notifications about playback and media state changes in AstroPlayer.

Link copied to clipboard
fun MediaItem.asAstroMediaItem(mapExtras: (key: String, value: String) -> Any): AstroMediaItem?

Attempts to convert a platform-specific MediaItem object to an AstroMediaItem object.

Link copied to clipboard

Converts a platform-specific MediaMetadata object to an AstroMediaMetadata object.

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.

Link copied to clipboard

Converts an AstroMediaMetadata object to a platform-specific MediaMetadata object suitable for the underlying media player.

Link copied to clipboard

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

Link copied to clipboard

Clears the current playlist and then adds a single media item.

Clears the current playlist and then adds a single media item at a specific index.

Link copied to clipboard

Clears the current playlist and then adds a collection of media items.

Clears the current playlist and then adds a collection of media items at a specific index.

Link copied to clipboard
Link copied to clipboard

Unregisters a previously registered listener from receiving notifications from AstroPlayer.

Link copied to clipboard
fun AstroPlayer.seekBackwardBy(milliseconds: Long)

Seeks the playback position backward by the specified number of milliseconds.

Link copied to clipboard

Seeks the playback position backward by the default seek backward increment.

Link copied to clipboard
fun AstroPlayer.seekForwardBy(milliseconds: Long)

Seeks the playback position forward by the specified number of milliseconds.

Link copied to clipboard

Seeks the playback position forward by the default seek forward increment.

Link copied to clipboard

Seeks the playback position to the end of the current media item.

Link copied to clipboard
fun AstroPlayer.seekToMediaItemThenAt(index: Int, milliseconds: Long)

Seeks to a specific media item and then sets the playback position within that item.

Link copied to clipboard

Seeks to the next media item in the playlist, if available.

Link copied to clipboard

Seeks to the previous media item in the playlist, if available.

Link copied to clipboard

Seeks the playback position to the beginning of the current media item.