UI configuration and variants
uiConfig controls global playback UI behavior and can be shared across custom and responsive UI variants.
uiConfig example
Key fields from the source guide:
disableAutoHideWhenHovered: keeps the control bar visible while the cursor is over the player.
-
playbackSpeedSelectionEnabled: enables playback speed controls in settings. -
metadata.markers: adds visual seekbar markers at specific timestamps.
Build a custom browser UI with customUi
This pattern creates a custom UI container and attaches it through customUi.
The source guide’s browser custom UI example includes:
-
Subtitles and overlays (subtitle display, buffering indicator, play/pause overlay, error messages)
-
Settings panel options for video quality, audio quality, audio track, playback speed, and subtitles
-
Control bar items such as replay, play/pause, skip
-10s/+10s, volume, PiP, fullscreen, and settings -
Title bar metadata display
Build responsive UIs with customUiVariant
Behavior:
-
Mobile variant is selected when
isSmallScreenreturnstrue. -
Desktop/browser UI is used as fallback when no condition matches.
-
A shared
uiConfigapplies across all variants.
Lifecycle events
Use lifecycle hooks to observe when variants resolve and become active:
-
onActiveUiChanged: triggered when the active UI is fully attached. -
onUiVariantResolve: triggered when the variant-selection logic runs.
UI factory variant shortcuts
The guide also includes built-in factory-based options:
-
buildDefaultUI: default responsive UI that adapts between browser and mobile dimensions: -
buildDefaultSmallScreenUI: default small-screen style UI layout: -
buildModernTvUI: modern TV playback UI layout: