Limeplay - Open Source Video Player UI ComponentsLimeplay

Seek Control

Controls for seeking forward or backward in media playback

Installation

Install the component

npx shadcn add @limeplay/seek-control

Ready to Use

The SeekControl component uses the useSeek hook internally, which only requires the MediaProvider context. No additional store setup is needed as seeking is a direct action on the media element.

Example Usage

  1. Design seek controls with icons and offset values.
components/player/seek-group-control.tsx
"use client"

import {
  CaretCircleDoubleLeftIcon,
  CaretCircleDoubleRightIcon,
} from "@phosphor-icons/react"

import { Button } from "@/components/ui/button"
import { SeekControl } from "@/components/limeplay/seek-controls"

export function SeekGroupControl() {
  return (
    <div className="flex items-center gap-2">
      <SeekControl offset={-10} asChild>
        <Button variant="ghost" size="icon">
          <CaretCircleDoubleLeftIcon />
        </Button>
      </SeekControl>
      <SeekControl offset={10} asChild>
        <Button variant="ghost" size="icon">
          <CaretCircleDoubleRightIcon />
        </Button>
      </SeekControl>
    </div>
  )
}
  1. Use the component in your player.
components/player/bottom-controls.tsx
<SeekGroupControl />

Understanding

The SeekControl component provides seek functionality for the media player. Unlike volume or playback controls, seeking is a purely action-based operation:

  • Action Bridge: Uses useSeek() hook to access seek(offset) which directly modifies currentTime on the native media element
  • No Event Bridge: No state synchronization is needed since currentTime is already tracked by the timeline hooks

The component automatically handles edge cases like clamping seek positions to valid ranges (0 to duration) and resets the idle state to keep controls visible after seeking.

Components

SeekControl

The main component for seeking forward or backward. It supports the Slot pattern (asChild prop) for composition and includes automatic ARIA labels based on the offset value.

API Reference

Prop

Type

On this page