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.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

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.

Link copied to clipboard

What a screen reader calls this view, as its accessible name. English by default; pass a translated one.

Link copied to clipboard
Link copied to clipboard
open val alignmentX: Float
Link copied to clipboard
open val alignmentY: Float
Link copied to clipboard
open var background: Color?
Link copied to clipboard
open var bounds: Rectangle?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var cursor: Cursor?
Link copied to clipboard
Link copied to clipboard

Frames that reached no canvas for a reason other than being superseded.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var font: Font?
Link copied to clipboard
open var foreground: Color?
Link copied to clipboard
open val graphics: Graphics?
Link copied to clipboard
Link copied to clipboard
open val height: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var isEnabled: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val isFontSet: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val isOpaque: Boolean
Link copied to clipboard
Link copied to clipboard
open val isShowing: Boolean
Link copied to clipboard
open val isValid: Boolean
Link copied to clipboard
open var isVisible: Boolean
Link copied to clipboard

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.

Link copied to clipboard
open val keyListeners: Array<out KeyListener?>?
Link copied to clipboard
open var locale: Locale?
Link copied to clipboard
open var location: Point?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val mousePosition: Point?
Link copied to clipboard
Link copied to clipboard
open var name: String?
Link copied to clipboard
open val parent: Container?
Link copied to clipboard

The player whose picture this view shows. Assigning replaces the previous pairing; null detaches. Playback never depends on this being set.

Link copied to clipboard
Link copied to clipboard

Frames painted onto this canvas, across every renderer this view has built.

Link copied to clipboard
Link copied to clipboard

Creates the renderer attached to player. Null uses PlayerViewDefaults.rendererFactory, and the view stays headless when that is null too.

Link copied to clipboard
open var size: Dimension?
Link copied to clipboard

Frames replaced by a newer one before they could be drawn.

Link copied to clipboard
open val toolkit: Toolkit?
Link copied to clipboard
Link copied to clipboard

The video's display aspect as the renderer last reported it, or 0 when there is none.

Link copied to clipboard

The video's rotation in degrees as the renderer last reported it.

Link copied to clipboard
open val width: Int
Link copied to clipboard
open val x: Int
Link copied to clipboard
open val y: Int

Functions

Link copied to clipboard
open fun action(evt: Event?, what: Any?): Boolean
Link copied to clipboard
open fun add(popup: PopupMenu?)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun addNotify()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun bounds(): Rectangle?
Link copied to clipboard
open fun checkImage(image: Image?, observer: ImageObserver?): Int
open fun checkImage(image: Image?, width: Int, height: Int, observer: ImageObserver?): Int
Link copied to clipboard
open operator fun contains(p: Point?): Boolean
open fun contains(x: Int, y: Int): Boolean
Link copied to clipboard
open fun createBufferStrategy(numBuffers: Int)
open fun createBufferStrategy(numBuffers: Int, caps: BufferCapabilities?)
Link copied to clipboard
open fun createImage(producer: ImageProducer?): Image?
open fun createImage(width: Int, height: Int): Image?
Link copied to clipboard
open fun createVolatileImage(width: Int, height: Int): VolatileImage?
open fun createVolatileImage(width: Int, height: Int, caps: ImageCapabilities?): VolatileImage?
Link copied to clipboard
open fun deliverEvent(e: Event?)
Link copied to clipboard
open fun disable()
Link copied to clipboard
Link copied to clipboard
open fun doLayout()
Link copied to clipboard
open fun enable()
open fun enable(b: Boolean)
Link copied to clipboard
open fun enableInputMethods(enable: Boolean)
Link copied to clipboard
open fun firePropertyChange(propertyName: String?, oldValue: Byte, newValue: Byte)
open fun firePropertyChange(propertyName: String?, oldValue: Char, newValue: Char)
open fun firePropertyChange(propertyName: String?, oldValue: Double, newValue: Double)
open fun firePropertyChange(propertyName: String?, oldValue: Float, newValue: Float)
open fun firePropertyChange(propertyName: String?, oldValue: Long, newValue: Long)
open fun firePropertyChange(propertyName: String?, oldValue: Short, newValue: Short)
Link copied to clipboard
Link copied to clipboard
open fun getBaseline(width: Int, height: Int): Int
Link copied to clipboard
open fun getComponentAt(x: Int, y: Int): Component?
Link copied to clipboard
Link copied to clipboard
open fun getFontMetrics(font: Font?): FontMetrics?
Link copied to clipboard
open fun <T : EventListener?> getListeners(listenerType: Class<T?>?): Array<out T?>?
Link copied to clipboard
open fun gotFocus(evt: Event?, what: Any?): Boolean
Link copied to clipboard
open fun handleEvent(evt: Event?): Boolean
Link copied to clipboard
open fun hasFocus(): Boolean
Link copied to clipboard
open fun hide()
Link copied to clipboard
open fun imageUpdate(img: Image?, infoflags: Int, x: Int, y: Int, w: Int, h: Int): Boolean
Link copied to clipboard
open fun inside(x: Int, y: Int): Boolean
Link copied to clipboard
open fun invalidate()
Link copied to clipboard
open fun isFocusCycleRoot(container: Container?): Boolean
Link copied to clipboard
open fun keyDown(evt: Event?, key: Int): Boolean
Link copied to clipboard
open fun keyUp(evt: Event?, key: Int): Boolean
Link copied to clipboard
open fun layout()
Link copied to clipboard
open fun list()
open fun list(out: PrintStream?)
open fun list(out: PrintWriter?)
open fun list(out: PrintStream?, indent: Int)
open fun list(out: PrintWriter?, indent: Int)
Link copied to clipboard
open fun locate(x: Int, y: Int): Component?
Link copied to clipboard
open fun location(): Point?
Link copied to clipboard
open fun lostFocus(evt: Event?, what: Any?): Boolean
Link copied to clipboard
open fun minimumSize(): Dimension?
Link copied to clipboard
open fun mouseDown(evt: Event?, x: Int, y: Int): Boolean
Link copied to clipboard
open fun mouseDrag(evt: Event?, x: Int, y: Int): Boolean
Link copied to clipboard
open fun mouseEnter(evt: Event?, x: Int, y: Int): Boolean
Link copied to clipboard
open fun mouseExit(evt: Event?, x: Int, y: Int): Boolean
Link copied to clipboard
open fun mouseMove(evt: Event?, x: Int, y: Int): Boolean
Link copied to clipboard
open fun mouseUp(evt: Event?, x: Int, y: Int): Boolean
Link copied to clipboard
open fun move(x: Int, y: Int)
Link copied to clipboard
open fun nextFocus()
Link copied to clipboard
open fun paint(g: Graphics?)
Link copied to clipboard
open fun paintAll(g: Graphics?)
Link copied to clipboard
open fun postEvent(e: Event?): Boolean
Link copied to clipboard
Link copied to clipboard
open fun prepareImage(image: Image?, observer: ImageObserver?): Boolean
open fun prepareImage(image: Image?, width: Int, height: Int, observer: ImageObserver?): Boolean
Link copied to clipboard
open fun print(g: Graphics?)
Link copied to clipboard
open fun printAll(g: Graphics?)
Link copied to clipboard
fun release()

Permanently releases this view's player pairing and active renderer.

Link copied to clipboard
open fun remove(popup: MenuComponent?)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun removeNotify()
Link copied to clipboard
Link copied to clipboard
open fun repaint()
open fun repaint(tm: Long)
open fun repaint(x: Int, y: Int, width: Int, height: Int)
open fun repaint(tm: Long, x: Int, y: Int, width: Int, height: Int)
Link copied to clipboard
open fun requestFocus()
open fun requestFocus(cause: FocusEvent.Cause?)
Link copied to clipboard
Link copied to clipboard
open fun reshape(x: Int, y: Int, width: Int, height: Int)
Link copied to clipboard
open fun resize(d: Dimension?)
open fun resize(width: Int, height: Int)
Link copied to clipboard
open fun revalidate()
Link copied to clipboard
open fun setFocusTraversalKeys(id: Int, keystrokes: Set<out AWTKeyStroke?>?)
Link copied to clipboard
open fun setMixingCutoutShape(shape: Shape?)
Link copied to clipboard
open fun show()
open fun show(b: Boolean)
Link copied to clipboard
open fun size(): Dimension?
Link copied to clipboard
open fun transferFocus()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun update(g: Graphics?)
Link copied to clipboard

Re-reads what a screen reader should say about the player and tells the platform.

Link copied to clipboard
open fun validate()