Player
High-level wrapper around AudioPlaybackSession providing a simplified API.
Example Usage
val player = Kodio.player()
// Load and play a recording
player.load(recording)
player.start()
// Control playback
player.pause()
player.resume()
player.stop()
// Clean up
player.release()
// Or use with structured concurrency
Kodio.play(recording) { player ->
player.start()
player.awaitComplete()
} // auto-releasedSeek
seekTo forwards to the session's optional native seek. When it returns SeekResult.Unsupported and supportsTransportSeek is false, callers (e.g. Compose space.kodio.compose.PlayerState) may fall back to reloading a clipped AudioRecording window. Transport sessions treat Unsupported as out-of-window only.
Properties
Currently retained seekable window. Empty if nothing buffered.
Whether playback has finished.
Transport media time, best-effort while playing. Frozen at Duration.ZERO on sessions that have not migrated to transport.
The current unified state of the player.
Flow of state changes for observing the player.
Whether the underlying session implements transport-buffer seek. When true, SeekResult.Unsupported means out-of-window, not "use PCM fallback".
Functions
Waits for playback to complete (finish or error).
Loads an AudioRecording for playback.
Loads an AudioFlow for playback (legacy compatibility).
Attempts a platform-native seek to position.
Access the underlying session for advanced use cases.