Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Collections

  • QuestionCard
  • Table
  • Book3D
  • ProTable
  • PricingTable
  • JsonViewer
  • EditableTable
  • List
  • Descriptions
  • RowActions
  • Tree
  • Card
  • Carousel
  • Video
  • Audio
  • BentoGrid
  • Image
  • MagicCard
  • AnimatedList
  • Marquee
  • Sortable
  • Kanban
  • DesignCanvas
  • LayerTree
  • StageDraw
  • SlideDeck
  • PresenterView
  • ComponentPicker
  • EventStream
  • QueueLane
  • DocumentSheet
  • Novel reader
  • Scheduler
  • Org classroom
  • Danmaku
  • LiveChat
  • LivePlayer
  • LogViewer
  • FileTree
  • CodeReviewThread
  • VirtualList
  • InfiniteScroll
  • LogoLoop
  • BounceCards
  • CardSwap
  • ChromaGrid
  • CircularGallery
  • DomeGallery
  • FlyingPosters
  • InfiniteMenu
  • MagicBento
  • ScrollStack
  • ProfileCard
  • TiltedCard
  • PixelCard
  • DecayCard
  • ReflectiveCard
  • Folder

Charts and Diagrams

  • Flow
  • Diagram
  • Paper
  • SequenceDiagram
  • Sankey
  • Sparkline
  • Funnel
  • Treemap
  • Gantt
  • Heatmap
  • ContributionGraph
  • Legend
  • Chart
  • WorldMap

Information

  • ImageViewer
  • LiveProductCard
  • DiffStat
  • ScoreRing
  • ScoreScale
  • Badge
  • Dot
  • StatusDot
  • Chip
  • FilterChip
  • Coupon
  • Tag
  • Annotation
  • Avatar
  • AvatarCircles
  • User
  • QRCode
  • Comment
  • RelativeTime
  • GitCommit
  • DeployStatus
  • ShieldBadge
  • AwardBadge
  • CreditCard
  • IconTile

Metrics

  • Stat
  • Statistic
  • Meter
  • Timeline
  • NumberTicker

Placeholders

  • Empty
  • Skeleton
  • Watermark

Video

video

Plays file or HLS video with custom controls, chapters, resume, picture-in-picture, and fullscreen.

Usage

Basic usage

Input MP4 file URL, which comes with Hulian skin's playback/progress/volume/double speed/full screen controls.

tsx
<Video src="/demo/sample-video.mp4" title="Demo video" className="w-full max-w-2xl" />

With poster

poster Show the cover image before the first frame is loaded.

tsx
<Video src="/demo/sample-video.mp4" poster="/demo/sample-poster.jpg" title="With poster" className="w-full max-w-2xl" />

HLS stream

src Transfer .m3u8 to play the HLS live/on-demand stream.

tsx
<Video src="/demo/hls/stream.m3u8" title="HLS flow" className="w-full max-w-2xl" />

Chapter Markers

chapters renders segments tick on the progress bar, hover displays chapter titles.

tsx
<Video
  src="/demo/sample-video.mp4"
  poster="/demo/sample-poster.jpg"
  title="With Chapter Marks"
  className="w-full max-w-2xl"
  chapters={[
    { time: 0, title: "Opening Introduction" },
    { time: 3, title: "Core Concept" },
    { time: 6, title: "Practical Demonstration" },
    { time: 9, title: "Summary" },
  ]}
/>

When to use

Use Video for course media, product demonstrations, or replay streams that need branded controls, chapters, resume position, and an end screen. Use Card for a static cover.

Import

ts
import { Video, formatTime, normalizeSrc, chapterMarkers, DEFAULT_PLAYBACK_RATES } from "@hulianui/ui"

Props

VideoProps:

NameTypeDefaultDescription
src*string | { src: string; type? }[]-File URL, HLS .m3u8, or multiple sources.
posterstring-Poster image.
titlestring-Accessible title used by internal controls.
autoPlayboolean-Starts playback automatically.
mutedboolean-Starts muted.
loopboolean-Repeats playback.
crossOriginboolean | string-Forwarded media crossorigin setting.
aspectRatiostring"16/9"CSS aspect ratio.
playbackRatesnumber[]DEFAULT_PLAYBACK_RATES(0.5-2)Available playback speeds.
chaptersVideoChapter[]-{ time, title } segments rendered as progress ticks and hover titles.
startTimenumber-One-time initial seek in seconds after media becomes playable.
classNamestring-Root class name.

Events

EventTypeDescription
onPlay() => voidPlayback started.
onPause() => voidPlayback paused.
onEnded() => voidPlayback ended.
onTimeUpdate(currentTime: number) => voidCurrent time in seconds.

Slots

SlotTypeDescription
endScreenReactNodeOverlay shown after completion; omission leaves only replay.
childrenReactNodeReserved for a future extension and currently unused.
formatTime, chapterMarkers, normalizeSrc, and DEFAULT_PLAYBACK_RATES are exported pure helpers or constants.

Localization

Built-in play, pause, mute, speed, picture-in-picture, fullscreen, and replay
labels follow the nearest ConfigProvider locale. Both zhCN and enUS are
included. A legacy custom locale without components.video keeps the original
Chinese fallback labels instead of rendering empty accessible names.

Usage notes

  • Vidstack makes Video client-only. Render it below a "use client" boundary in Next.js.
  • startTime seeks once only when first playable and only above zero; later prop changes do not seek again.
  • Chapter ticks require a finite nonzero duration, so they are absent before metadata loads.
  • Built-in Chinese controls are "\u64ad\u653e\u901f\u5ea6" (“Playback speed”), "\u91cd\u65b0\u64ad\u653e" (“Replay”), "\u64ad\u653e\u89c6\u9891" (“Play video”), "\u64ad\u653e" / "\u6682\u505c" (“Play” / “Pause”), "\u53d6\u6d88\u9759\u97f3" / "\u9759\u97f3" (“Unmute” / “Mute”), "\u9000\u51fa\u753b\u4e2d\u753b" / "\u753b\u4e2d\u753b" (“Exit PiP” / “PiP”), and "\u9000\u51fa\u5168\u5c4f" / "\u5168\u5c4f" (“Exit fullscreen” / “Fullscreen”).

Related

Table · Book3D · ProTable · PricingTable · JsonViewer · EditableTable

Playground

<Video
  src="/demo/sample-video.mp4"
  aspectRatio="16/9"
/>
PreviousCarouselData DisplayNextAudio

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Events
    • Slots
    • Localization
    • Usage notes
    • Related
  • Playground