KitePlayerUIView
The reusable iOS player view: a black UIView whose video layer's whole lifecycle is handled here.
Assign player and the view does the rest: while it is in a window it keeps a renderer attached over its own layer, and when it leaves the window it closes that renderer and detaches. The player is never owned here: opening media, playing, seeking and closing stay the caller's, and removing the view from its window only stops the picture, never the playback, because a backgrounded view should not stop the sound.
With no rendererFactory of its own, the view uses PlayerViewDefaults.rendererFactory, which the kiteplayer module sets when it builds a player. The default adapter in kiteplayer uses Metal: VideoToolbox frames wrap into textures with no copy and software frames upload in their native format. preferMetal set false before the view enters a window asks that adapter for its CPU-converter CALayer fallback. A custom backend can install its own adapter without this view depending on KiteFFmpeg or the output implementation.
All members must be used from the main thread, where UIKit delivers the callbacks that drive them.
Properties
Builds what VoiceOver says about the state from the status, the position and the duration. The default, accessibilityStateText, is English; pass a translated one.
What VoiceOver calls this view. English by default; pass a translated one.
Frames that reached no layer for a reason other than being superseded.
True while the VISIBLE layer holds a picture. The CG layer's close never clears the last delivered contents; a CAMetalLayer keeps its last presented drawable on the glass the same way. Presentation evidence, not playback state.
Keeps the display from dimming and locking while the player plays video and this view is in a window, through the app's idle timer. True by default. A paused or ended player, or one that plays audio only, lets the display sleep again. Every view and composable of this library shares one count of holds, so one of them letting go does not wake the timer while another still plays.
The player whose picture this view shows. Assigning replaces the previous pairing; null detaches. Playback never depends on this being set.
False asks an installed adapter for its CG fallback. Read when a renderer is CREATED (entering a window with a player attached); flipping it later applies from the next attachment, which is the same honest boundary every other view property has.
Frames delivered to this view's layer, across every renderer this view has built.
The renderer adapter for this view. Null uses PlayerViewDefaults.rendererFactory, which the kiteplayer module sets when it builds a player. A view with neither remains a valid UIKit container and attaches no renderer; installing one later rebuilds immediately.
Frames replaced by a newer one before they could be shown. See the renderer's own docs.
Functions
Re-reads what VoiceOver should say about the player and sets it as this view's value.