PlayerConfig

data class PlayerConfig(val renderQuality: RenderQuality = RenderQuality.Off, val syncMode: SyncMode = SyncMode.Auto, val hardwareDecode: HwdecPolicy = HwdecPolicy.Auto, val frameDrop: FrameDropPolicy = FrameDropPolicy.LateOnly, val buffer: BufferPolicy = BufferPolicy(), val audio: AudioConfig = AudioConfig(), val subtitles: SubtitleConfig = SubtitleConfig(), val progressInterval: Duration = 200.milliseconds, val statsInterval: Duration = 1.seconds, val frameEvents: Boolean = false, val backends: Backends = Backends(), val network: NetworkConfig = NetworkConfig(), val videoEnabled: Boolean = true, val deinterlace: DeinterlacePolicy = DeinterlacePolicy.Auto, val queue: QueueConfig = QueueConfig(), val hdrPolicy: HdrPolicy = HdrPolicy.Auto, val externalClock: ExternalClockPolicy = ExternalClockPolicy(), val keyframeChoice: KeyframeChoice = KeyframeChoice.Before)

Everything that is decided when the player is created.

Config is immutable and passed once. Anything genuinely changeable while playing is a method on KitePlayer instead. This removes a whole class of bug that libmpv has and documents: an option set after initialisation that is silently ignored.

The engine's session core reads these values: the sync mode, the frame drop policy, every buffering threshold, the audio language preference, the two publication intervals, and the backends. The members nothing reads are marked one by one below, each with a pointer to where they are decided.

Constructors

Link copied to clipboard
constructor(renderQuality: RenderQuality = RenderQuality.Off, syncMode: SyncMode = SyncMode.Auto, hardwareDecode: HwdecPolicy = HwdecPolicy.Auto, frameDrop: FrameDropPolicy = FrameDropPolicy.LateOnly, buffer: BufferPolicy = BufferPolicy(), audio: AudioConfig = AudioConfig(), subtitles: SubtitleConfig = SubtitleConfig(), progressInterval: Duration = 200.milliseconds, statsInterval: Duration = 1.seconds, frameEvents: Boolean = false, backends: Backends = Backends(), network: NetworkConfig = NetworkConfig(), videoEnabled: Boolean = true, deinterlace: DeinterlacePolicy = DeinterlacePolicy.Auto, queue: QueueConfig = QueueConfig(), hdrPolicy: HdrPolicy = HdrPolicy.Auto, externalClock: ExternalClockPolicy = ExternalClockPolicy(), keyframeChoice: KeyframeChoice = KeyframeChoice.Before)

Properties

Link copied to clipboard
Link copied to clipboard

The backends to build the pipeline from. Replace them for a test or a new platform.

Link copied to clipboard
Link copied to clipboard

Whether interlaced video is deinterlaced. See DeinterlacePolicy. A deinterlaced stream decodes in software, like any stream with a video filter.

Link copied to clipboard

How playback follows a clock set with KitePlayer.setExternalClock. See ExternalClock.

Link copied to clipboard
Link copied to clipboard

Emit PlayerEvent.FramePresented per frame. Off by default: sixty events a second is a cost nobody should pay unasked.

Link copied to clipboard

What to do about hardware decoding.

Link copied to clipboard

How HDR video reaches the screen. Change it live with KitePlayer.setHdrPolicy; this is only the value a fresh player starts at.

Link copied to clipboard

Which keyframe a SeekMode.Keyframe seek lands on. Change it live with KitePlayer.setKeyframeChoice; this is only the value a fresh player starts at.

Link copied to clipboard

Network byte supply and the engine's byte cache. The resolver turns URIs into MediaIoResolver-supplied readers at open; the cache wraps every MediaIo-fed open with a forward window and a RAM seek-back window.

Link copied to clipboard

How often KitePlayer.progress is sampled while playing.

Link copied to clipboard

How a queue moves from one item to the next, including the gapless handoff. See QueueConfig.

Link copied to clipboard

How much work renderers spend on the picture beyond decoding it correctly.

Link copied to clipboard

How often KitePlayer.stats is sampled.

Link copied to clipboard

Subtitle selection, timing and styling. The session core reads the language preferences and the forced-track rule when it picks a track, applies SubtitleConfig.delay when it times cues, and passes SubtitleConfig.fontScale to the platform rasterizer.

Link copied to clipboard
Link copied to clipboard

False opens media with video decoding parked: audio plays, no video frame is decoded.