AI
NUI logov3.1.0

VideoPlayer

Note

@nofinite/media is the standalone media engine powered by Vidstack with customized NUICSS skins. For guides on HLS/DASH streaming, AudioPlayer, and keyboard shortcuts, visit the dedicated Media Documentation Hub.

A fully accessible, token-driven VideoPlayer component powered by Vidstack and styled with @nofinite/nuicss.

tsx
import { VideoPlayer } from '@nofinite/media/react';

Interactive Preview

Loading preview...

Usage

Basic Example

tsx
import { VideoPlayer } from '@nofinite/media/react';

export default function VideoDemo() {
  return (
    <div className="w-full max-w-lg rounded-xl overflow-hidden border border-default bg-surface">
      <VideoPlayer src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4" />
    </div>
  );
}

API Reference

PropTypeDefaultDescription
srcstring——
urlstring——
posterstring——
titlestring——
autoPlaybooleanfalse—
loopbooleanfalse—
mutedbooleanfalse—
playsInlinebooleantrue—
controlsbooleantrue—
themeanyauto—
aspectRatiostring16/9—
classNamestring——
styleCSSProperties——
tracksMediaTrack[]——
thumbnailsstring——
playbackRatesnumber[] | { min: number; max: number; step: number; }——
seekStepnumber——
crossOriginboolean | "anonymous" | "use-credentials"anonymous—
loadenum——
preloadenum——
slotsany——
onPlay(() => void)——
onPause(() => void)——
onEnded(() => void)——
onTimeUpdate((detail: { currentTime: number; duration: number; }) => void)——
onVolumeChange((detail: { volume: number; muted: boolean; }) => void)——
onError((error: any) => void)——
onSeeked((time: number) => void)——
onLoadedMetadata((detail: { duration: number; }) => void)——
onFullscreenChange((fullscreen: boolean) => void)——

Accessibility & Guidelines

  • Semantic Tokens: Built strictly using Nuicss semantic tokens (bg-surface, text-default, border-subtle, bg-primary).
  • Keyboard Navigation: Adheres to strict WAI-ARIA standards.
  • Screen Reader Support: Includes semantic roles and live regions where appropriate.