Package-level declarations

Types

Link copied to clipboard
data class PlaybackItem(val id: String, val title: String, val artists: List<String>, val durationMillis: Long?, val artworkUrl: String?)

Presentation-safe metadata for the active track.

Link copied to clipboard
class PlaybackUrl(val value: String)

Short-lived signed URL with a redacted string representation.

Link copied to clipboard
class Player

Cross-platform playback controller.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class PlayerState(val phase: PlayerPhase = PlayerPhase.IDLE, val item: PlaybackItem? = null, val queue: List<PlaybackItem> = emptyList(), val currentIndex: Int = -1, val repeatMode: RepeatMode = RepeatMode.OFF, val isShuffled: Boolean = false, val positionMillis: Long = 0, val bufferedPositionMillis: Long = 0, val durationMillis: Long? = null, val failure: PlayerFailure? = null)

Public player state. Signed media URLs are intentionally absent.

Link copied to clipboard

Functions

Link copied to clipboard

Builds a MediaSession over the same ExoPlayer used by createAndroidPlayer.

fun createAndroidMediaSession(context: Context, exoPlayer: ExoPlayer, player: Player, scope: CoroutineScope): MediaSession

Builds a MediaSession whose system next/previous commands control the common queue. The host supplies a service-owned scope and remains responsible for releasing the session.

Link copied to clipboard

Creates an owned Media3 player with audio-focus handling enabled.

fun createAndroidPlayer(exoPlayer: ExoPlayer, releasePlayerOnClose: Boolean = false): Player

Wraps an existing ExoPlayer. This is the preferred factory for a host-owned MediaSessionService; the host keeps lifecycle control by default.

Link copied to clipboard

Creates an iOS player backed by AVPlayer and system media controls.

Link copied to clipboard

Creates a browser-backed player using an HTMLAudioElement.

Link copied to clipboard

Resolves this track into the best full, direct playback URL.