Component API

<video-player>

Open live example

Video player wrapping a native <video> element (native controls
disabled) with the same tokenized transport bar as audio-player — a
play/pause icon-button, elapsed/total time, a seekable progress bar, a
mute toggle + volume slider — plus a fullscreen toggle. The control bar
sits in a persistent strip under the video frame rather than a
hover-reveal overlay, so it stays usable for keyboard/touch input without
a pointer hover state.

Install

import "@f-ewald/components/video-player.js";

Usage

<video-player
  src="/clip.mp4"
  poster="/clip-poster.jpg"
  label="Episode 12"
></video-player>

Attributes / properties

PropertyAttributeTypeDefaultDescription
srcsrcstring""URL of the video file to play.
posterposterstring""Poster image shown before playback starts.
labellabelstring"Video player"Accessible name for the player, e.g. a video title.
looploopbooleanfalseLoops playback once it reaches the end.
preloadpreload"none" | "metadata" | "auto""metadata"Native <video preload> hint.

Events

EventDescription
playThe video started playing.
pauseThe video was paused.
endedPlayback reached the end.

Slots

None.

CSS custom properties

Custom property
--ui-border
--ui-border-width
--ui-danger
--ui-font
--ui-font-size-sm
--ui-radius
--ui-surface
--ui-text-muted