PlayerSnapshot

data class PlayerSnapshot(val status: PlaybackStatus = PlaybackStatus.Idle, val media: MediaItem? = null, val duration: Duration? = null, val seekable: Boolean = false, val videoSize: VideoSize? = null, val tracks: Tracks = Tracks.Empty, val chapters: List<Chapter> = emptyList(), val markers: List<Marker> = emptyList(), val metadata: Map<String, String> = emptyMap(), val speed: Double = 1.0, val volume: Float = 1.0f, val muted: Boolean = false, val loop: LoopMode = LoopMode.Off, val videoScale: VideoScale = VideoScale.Fit, val videoAdjustments: VideoAdjustments = VideoAdjustments.Identity, val renderQuality: RenderQuality = RenderQuality.Off, val videoTransform: VideoTransform = VideoTransform.Identity, val subtitleDelay: Duration = Duration.ZERO, val subtitleScale: Float = 1.0f, val subtitleStyle: SubtitleStyleOverride? = null, val subtitlePosition: Float = 1.0f, val forcedPicturesOnly: Boolean = false, val subtitleTypesetter: String? = null, val audioDelay: Duration = Duration.ZERO, val abLoopA: Duration? = null, val abLoopB: Duration? = null, val preservePitch: Boolean = true, val error: PlaybackError? = null, val generation: Generation = Generation.Initial, val queue: List<MediaItem> = emptyList(), val queueIndex: Int = -1, val audioSessionId: Int? = null, val appliedReplayGainDb: Float? = null, val balance: Float = 0.0f, val videoEnabled: Boolean = true, val sleepTimer: SleepTimer? = null, val equalizer: EqualizerSettings = EqualizerSettings.Flat, val shuffle: Boolean = false, val queueOrder: List<Int> = emptyList(), val failedQueueItems: Set<Int> = emptySet(), val playRequested: Boolean = false, val preloadedIndex: Int? = null, val hdrPolicy: HdrPolicy = HdrPolicy.Auto, val videoDynamicRange: VideoDynamicRange = VideoDynamicRange.Standard, val durationIsEstimate: Boolean = false, val stereoMode: StereoMode = StereoMode.Stereo, val lyrics: String? = null, val nightMode: Boolean = false, val dialogueLevelDb: Float = 0.0f, val pitchSemitones: Double = 0.0, val skipSilence: Boolean = false)

Everything about the player that changes rarely, as one immutable value.

Position is deliberately not here. A position field would make this snapshot change sixty times a second, and every consumer collecting it would recompose or redraw at that rate for a value most of them wanted at 4 Hz. Read the position from KitePlayer.position when you need it now, or collect KitePlayer.progress when you want it on a timer.

Constructors

Link copied to clipboard
constructor(status: PlaybackStatus = PlaybackStatus.Idle, media: MediaItem? = null, duration: Duration? = null, seekable: Boolean = false, videoSize: VideoSize? = null, tracks: Tracks = Tracks.Empty, chapters: List<Chapter> = emptyList(), markers: List<Marker> = emptyList(), metadata: Map<String, String> = emptyMap(), speed: Double = 1.0, volume: Float = 1.0f, muted: Boolean = false, loop: LoopMode = LoopMode.Off, videoScale: VideoScale = VideoScale.Fit, videoAdjustments: VideoAdjustments = VideoAdjustments.Identity, renderQuality: RenderQuality = RenderQuality.Off, videoTransform: VideoTransform = VideoTransform.Identity, subtitleDelay: Duration = Duration.ZERO, subtitleScale: Float = 1.0f, subtitleStyle: SubtitleStyleOverride? = null, subtitlePosition: Float = 1.0f, forcedPicturesOnly: Boolean = false, subtitleTypesetter: String? = null, audioDelay: Duration = Duration.ZERO, abLoopA: Duration? = null, abLoopB: Duration? = null, preservePitch: Boolean = true, error: PlaybackError? = null, generation: Generation = Generation.Initial, queue: List<MediaItem> = emptyList(), queueIndex: Int = -1, audioSessionId: Int? = null, appliedReplayGainDb: Float? = null, balance: Float = 0.0f, videoEnabled: Boolean = true, sleepTimer: SleepTimer? = null, equalizer: EqualizerSettings = EqualizerSettings.Flat, shuffle: Boolean = false, queueOrder: List<Int> = emptyList(), failedQueueItems: Set<Int> = emptySet(), playRequested: Boolean = false, preloadedIndex: Int? = null, hdrPolicy: HdrPolicy = HdrPolicy.Auto, videoDynamicRange: VideoDynamicRange = VideoDynamicRange.Standard, durationIsEstimate: Boolean = false, stereoMode: StereoMode = StereoMode.Stereo, lyrics: String? = null, nightMode: Boolean = false, dialogueLevelDb: Float = 0.0f, pitchSemitones: Double = 0.0, skipSilence: Boolean = false)

Properties

Link copied to clipboard

The A of the armed A-B loop, or null when none is armed.

Link copied to clipboard

The B of the armed A-B loop. Null with a non-null abLoopA wraps at the end of the media.

Link copied to clipboard

The ReplayGain actually applied to the current track, in dB, or null when none is.

Link copied to clipboard

What media's sound is, as the audio device is told it (#446): the item's own MediaItem.audioContent, with AudioContent.Automatic already answered from the selected video track, so never AudioContent.Automatic itself. AudioContent.Music when nothing is open. An application that asks for audio focus or sets up its audio session itself reads this.

Link copied to clipboard

The runtime audio timing shift, mpv's sign. Positive presents the picture earlier, for sound that reaches the ear early. Late sound, such as unreported Bluetooth latency, needs a negative one.

Link copied to clipboard

The audio device's platform handle for effects, or null when there is no device open or the platform has no such concept.

Link copied to clipboard

Stereo balance: -1 hard left, 0 centre, 1 hard right. See KitePlayer.setBalance.

Link copied to clipboard

The chapters of the current media item, in container order. Empty for media with no chapter table.

Link copied to clipboard

How far the dialogue is raised or lowered in a downmix, in decibels. See KitePlayer.setDialogueLevel.

Link copied to clipboard

Null when the duration is genuinely unknown, for example a live stream. Possibly only an estimate, which durationIsEstimate says.

Link copied to clipboard

True while duration is only an estimate, such as FFmpeg's guess from the bit rate of an ADTS AAC file or of an MP3 without its Xing header, which for variable bit rate audio can be minutes out (#422). A seek bar can draw it as approximate. Seeks are not cut at it, and once playback passes it duration follows what has played; once the item ends it is the real length and this goes false.

Link copied to clipboard

duration in milliseconds, or null when it is unknown. For Java, which cannot read a Duration (#394).

Link copied to clipboard

The equaliser in force. See KitePlayer.setEqualizer.

Link copied to clipboard

The last failure, retained until another one replaces it or the player is opened again.

Link copied to clipboard

Positions into queue of the items the queue skipped because they could not be opened, as QueueItemFailure.Skip does (#487). An item leaves the set once it opens, and an edit of the queue carries the set along with the items it moves.

Link copied to clipboard

True while only the forced pictures of an image subtitle track draw. See KitePlayer.setForcedPicturesOnly.

Link copied to clipboard

Increments on every seek and every stream reconfiguration.

Link copied to clipboard

How HDR video reaches the screen.

Link copied to clipboard
Link copied to clipboard

The song's lyrics as its tags carry them without times, for an application to show beside the music, or null when it carries none (#443). An ID3 USLT frame, a Vorbis LYRICS or UNSYNCEDLYRICS comment, an MP4 ©lyr atom and a Matroska LYRICS tag all arrive here.

Link copied to clipboard

The markers set with io.github.yuroyami.kiteplayer.KitePlayer.setMarkers, sorted by position.

Link copied to clipboard
Link copied to clipboard

The container's own tags: title, artist, encoder and whatever else it wrote.

Link copied to clipboard
Link copied to clipboard

Whether the night mode is on. See KitePlayer.setNightMode.

Link copied to clipboard

How far the pitch is moved, in semitones. See KitePlayer.setPitch.

Link copied to clipboard

True while the player means to make sound: while it plays, while it buffers, and while a queue that was playing opens its next item. status says whether sound comes out now; this says whether it will once the pipeline can supply it. A guard that pauses for a call or for headphones coming out reads this, not status alone.

Link copied to clipboard

The position in queue of the next item while it is open in the background for the gapless handoff, or null. Under a repeat it is the current item's own position, because its next pass is what opens, and null outside queue playback. A next item that is the next part of the current item's file opens nothing, because it joins on the current item's reads, so it reads null too (#456). See QueueConfig.

Link copied to clipboard

Whether speed keeps pitch. False plays rate through the resampler, pitch moving with it.

Link copied to clipboard

The open queue's items. Empty outside queue playback.

Link copied to clipboard

The index of media inside queue, or -1 outside queue playback.

Link copied to clipboard

Positions into queue in PLAY order, which is what next, previous and the advance at the end of an item all follow.

Link copied to clipboard

The render-quality passes in force.

Link copied to clipboard
Link copied to clipboard

Whether the queue is playing in a shuffled order. See KitePlayer.setShuffle.

Link copied to clipboard

Whether the silent stretches are shortened. See KitePlayer.setSkipSilence: the setting, which is true even while an item with a picture or a live stream plays uncut.

Link copied to clipboard

The armed sleep timer, or null. Cleared when it fires. See KitePlayer.setSleepTimer.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

What the two front speakers play. See KitePlayer.setStereoMode.

Link copied to clipboard

The runtime subtitle timing shift. Positive shows cues later.

Link copied to clipboard

Where the implicit subtitle stack anchors, as a fraction of the height. 1.0 is the bottom.

Link copied to clipboard

The runtime subtitle size multiplier over the authored size.

Link copied to clipboard

The viewer's live subtitle style override, or null when the authored styles stand.

Link copied to clipboard

The identifier of the typesetting engine drawing the selected subtitle track, or null when the built-in styling draws it. Non-null only for an ASS or SSA track with kiteplayer-libass installed and SubtitleConfig.typesetting on.

Link copied to clipboard
Link copied to clipboard

The live picture controls (brightness, contrast, saturation, hue). Renderers honour them.

Link copied to clipboard

What the screen shows of this item's dynamic range, as the renderer last reported it. Back to VideoDynamicRange.Standard at every open.

Link copied to clipboard

False while video decoding is parked. See KitePlayer.setVideoEnabled.

Link copied to clipboard

How the picture occupies its surface. The engine's choice; renderers honour it.

Link copied to clipboard

The size of the picture as it is shown, after any crop its container states (#497). See PictureCrop.

Link copied to clipboard

The live framing controls (aspect override, zoom, pan). Renderers honour them.

Link copied to clipboard