MediaPlayer
Playback handed to the browser's accessible controls.
Live — this one is real
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.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| kind | "audio" | "video" | "video" | Native media element. |
| label | string | — | Figure and player name. |
| ...props / children | VideoHTMLAttributes / 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.