PlaybackError

sealed class PlaybackError

A failure that stopped playback.

The rule that keeps this honest: an error always stops playback and a warning never does. There is no third category and no silent degradation. If the engine can continue, it emits a PlaybackWarning and continues. A viewer must never lose playback because one subtitle track was malformed, and a developer must never discover a software-decode fallback by noticing the fan.

Inheritors

Types

Link copied to clipboard
data class AudioDeviceUnavailable(val device: String, val detail: String) : PlaybackError

The audio output device the player was bound to cannot be opened: it has gone away, or the platform does not let an application choose one. A bound device that disappears during playback fails the player with this error too. device is the id the player was given.

Link copied to clipboard
data class ConfigurationInvalid(val detail: String) : PlaybackError

The player was asked to exist without something it cannot invent, or against a runtime it cannot use, or an item it was asked to open sets one option twice.

Link copied to clipboard
data class DecoderFailed(val codec: String, val detail: String, val cause: Throwable? = null) : PlaybackError

A decoder opened and then failed in a way that cannot be recovered from.

Link copied to clipboard
data class Internal(val detail: String, val cause: Throwable? = null) : PlaybackError

The engine hit a state it does not know how to leave. This is always a bug here.

Link copied to clipboard
data class NoPlayableStream(val streams: List<TrackInfo>) : PlaybackError

The container was read and holds nothing this build can play.

Link copied to clipboard
data class NotMedia(val uri: String, val detail: String? = null) : PlaybackError

The bytes were reached and are not media the demuxer recognises.

Link copied to clipboard
data class RendererIncompatible(val renderer: String, val frames: FrameShape) : PlaybackError

The renderer cannot show the frames the running video decoder makes, so the attach was refused and the renderer attached before stays. renderer names the refused one.

Link copied to clipboard
data class RuntimeCompromised(val detail: String) : PlaybackError

A shutdown did not complete inside its deadline, or stopped part way, so part of the pipeline may still be running or still hold resources.

Link copied to clipboard
data class SchemeUnsupported(val uri: String, val scheme: String, val detail: String? = null) : PlaybackError

The item's address has a scheme this build has no way to open, such as srt:// or rtmps://, or rtsp:// on the web, where the player has no sockets of its own. Nothing was sent over any network: the address was refused for its scheme alone.

Link copied to clipboard
data class SourceStalled(val uri: String, val stalledFor: Duration) : PlaybackError

The source stopped answering: a read waited stalledFor without a packet or a byte, which is at least BufferPolicy.stallTimeout. The engine interrupted the read and ended the session. The same media may play when the network recovers.

Link copied to clipboard
data class SourceUnavailable(val uri: String, val cause: Throwable?, val detail: String? = null) : PlaybackError

The bytes could not be reached at all: no such file, refused connection, permission denied.

Properties

Link copied to clipboard
open val cause: Throwable? = null
Link copied to clipboard
abstract val message: String

Functions

Link copied to clipboard
override fun toString(): String

The type and the message, with every URI cut to its file name. Final, so no subclass prints its fields: a data class would print a signed URL whole, and errors are what apps log.