UI

Player Controls

The main wrapper component for all PlayerKit UI elements.

Player Controls

The PlayerControls component acts as the unified container for all UI elements overlaying the video. It manages the layout, styling, and interactions of the user interface.

Usage

import { PlayerKit } from "@playerkit/react";
import { PlayerControls } from "@playerkit/ui";

export default function MyPlayer() {
  return (
    <PlayerKit src="https://example.com/video.mp4">
      <PlayerControls />
    </PlayerKit>
  );
}

Anatomy

PlayerControls internally wraps the individual components like ProgressBar, TimeDisplay, VolumeControl, etc., and arranges them according to the selected theme and layout.

Props

The PlayerControls component accepts PlayerControlsProps. If you are using the @playerkit/react components (<Player>, <HlsPlayer>, etc.), these props are automatically wired up for you!

If you are using @playerkit/ui in a headless environment, you must pass these props manually:

PropTypeDescription
playerPlayerControls | nullThe core engine instance
statePlayerSnapshot | nullThe current reactive state snapshot
bufferednumberBuffered percentage (0-1)
progressnumberPlayback progress (0-1)
isMobilebooleanWhether to render the mobile touch layout
controlsVisiblebooleanWhether the control bar should be visible
themePlayerThemeNamePreset theme layout (e.g. "default")
playbackRatesnumber[]Available speeds for the settings menu
objectFitPlayerObjectFitVideo scaling ("contain", "cover", "fill")
customizationPlayerCustomizationObject to hide/show specific UI features
onControlsInteraction() => voidCallback to keep controls visible (reset timer)
seekRelative(direction: -1 | 1) => voidCallback for skipping forward/backward
onSettingsOpenChange(open: boolean) => voidCallback when settings menu toggles
onObjectFitChange(fit: PlayerObjectFit) => voidCallback when object fit button is clicked

See the Themes and Components documentation for more details on customization.

On this page