Limeplay - Open Source Video Player UI ComponentsLimeplay

Timeline Labels

Semantic time display components for elapsed, remaining, duration, and hover time.

Installation

npx shadcn add @limeplay/timeline-labels

Requires timelineFeature registered in your createMediaKit.

Usage

components/player/time-display.tsx
"use client"

import { useState } from "react"
import { Button } from "@/components/ui/button"
import { useTimelineStore } from "@/hooks/limeplay/use-timeline"
import {
  Duration,
  Elapsed,
  Remaining,
} from "@/components/limeplay/timeline-labels"

export function TimeDisplay() {
  const [showRemaining, setShowRemaining] = useState(false)
  const isLive = useTimelineStore((s) => s.isLive)

  return (
    <div className="flex items-center gap-3 select-none">
      {!isLive && <Elapsed className="text-xs font-medium" />}
      {!isLive && (
        <Button
          variant="ghost"
          size="sm"
          onClick={() => setShowRemaining(!showRemaining)}
        >
          {showRemaining ? (
            <Remaining className="text-xs font-medium" />
          ) : (
            <Duration className="text-xs font-medium" />
          )}
        </Button>
      )}
    </div>
  )
}

Components

ComponentDescription
ElapsedCurrent playback time
DurationTotal media duration
RemainingTime remaining (shows with - prefix)
HoverTimeTime at the current hover position on the timeline
LiveLatencyLatency behind live edge (for live streams)

All components accept className for styling and automatically format time based on duration (e.g. 1:23 vs 1:23:45).

On this page