Skip to content

MediaPlayer

Playback handed to the browser's accessible controls.

Live — this one is real

A four-second calibration tone

Usage

import { MediaPlayer } from "mizu-ui";

export function Example() {
  return (
    <MediaPlayer
      kind="audio"
      label="A four-second calibration tone"
      src="/audio/calibration.wav"
      preload="metadata"
    />
  );
}

Source & setup

Import mizu-ui/styles.css once. Fonts are optional via mizu-ui/fonts.css. Override --mizu-* tokens or use className for local styling. Uses native React and CSS; install the package peers for root imports.

Inspect content/Media.tsx

Source is included in the npm package under src/content/Media.tsx.

Open full source ↗

Props

PropTypeDefaultDescription
kind"audio" | "video""video"Native media element.
labelstring—Figure and player name.
...props / childrenVideoHTMLAttributes / ReactNode—Native source, poster, tracks, events; children may include caption tracks.

Accessibility

Native controls support keyboard and touch. Provide captions/transcripts for speech and video. Autoplay is opt-in through native props.

Motion

Playback follows user intent; no synthetic timer.

Works alongside