KitePlayerAwtView
A desktop player view: an ordinary AWT canvas that a renderer paints video into.
It exists for the reason the Android and iOS views exist. A platform component painted by its own thread keeps its frame rate when the surrounding UI is busy, where video drawn as part of the UI's own scene stops when that scene stops. On desktop that is the difference between a heavy Compose window stuttering the picture and not.
A view with no rendererFactory of its own uses PlayerViewDefaults.rendererFactory, which the kiteplayer module sets when it builds a player, so view.player = player is the whole setup. The renderer is attached as soon as the player and a factory exist, before the canvas has a peer, so a renderer-coupled decoder can take part in decoder selection; the canvas is then handed over and taken back as AWT creates and destroys the peer. Unlike the Android view there is no separate subtitle component: a desktop renderer composites overlays into the same canvas, which is what the engine's overlay contract already expects of it.
Compose content drawn over this view cannot receive mouse input, and that is a platform rule rather than a bug here. macOS delivers a click to the topmost NATIVE view under the pointer, and this canvas is one; anything Compose paints above it afterwards is invisible to that decision. Controls that must be clickable ON TOP of video belong in a borderless window owned by this view's window, which is measurably the only arrangement that works. Controls that do not overlap the video need nothing special. Measured 2026-08-30 across seven arrangements, in kiteplayer-sample-desktop/INTEROP-SPIKE.md.
Call release when the owner is permanently destroyed. Removing the canvas from its container is not proof it will not be reused, so that alone does not release it.
All members must be used from the AWT event dispatch thread, which is where the lifecycle callbacks that drive this arrive.
Properties
Builds what a screen reader says about the state from the status, the position and the duration. The default, accessibilityStateText, is English; pass a translated one.
What a screen reader calls this view, as its accessible name. English by default; pass a translated one.
Frames that reached no canvas for a reason other than being superseded.
Accepted for symmetry with the Android and iOS views, and does nothing: the desktop JVM has no call that keeps the display awake. A desktop application that needs it asks its own platform, for example with a power assertion on macOS.
The player whose picture this view shows. Assigning replaces the previous pairing; null detaches. Playback never depends on this being set.
Frames painted onto this canvas, across every renderer this view has built.
Creates the renderer attached to player. Null uses PlayerViewDefaults.rendererFactory, and the view stays headless when that is null too.
Frames replaced by a newer one before they could be drawn.
The video's display aspect as the renderer last reported it, or 0 when there is none.
The video's rotation in degrees as the renderer last reported it.
Functions
Re-reads what a screen reader should say about the player and tells the platform.