One player and a list that swaps which video sits in it: trailers, talks, sessions, a channel's latest uploads. YouTube and Vimeo stay behind the privacy-friendly lite embed until the visitor presses play; self-hosted files use the kit's video player. The list sits under the player or beside it on wide containers.
Big Buck Bunny (open movie)
Installation
The whole kit as one package — get updates by bumping the version. Add the styles to globals.css: @import "@vamos-ui/react/styles.css";
Usage
import { VideoPlaylist } from "@vamos-ui/react/media";
<VideoPlaylist layout="side" items={[
{ id: "trailer", title: "Launch trailer", provider: "youtube", videoId: "aqz-KE-bpKQ", duration: 74 },
{ id: "walkthrough", title: "Walkthrough", src: "/media/walkthrough.mp4", poster: "/media/walkthrough.jpg" },
]} />The list is an ordered list of buttons; the selected one has aria-current. Picking another video announces "Now showing: …" and keeps focus in the list.
Nothing is requested from YouTube or Vimeo until play is pressed, not even after switching; YouTube rows use the video's thumbnail unless you pass one.
Examples
List below, controlled, play on select
value / onValueChange from outside; playOnSelect starts a self-hosted file once picked (embeds always wait for a click).
Session 1: Getting started
Selected: s1
API
VideoPlaylist
| Prop | Type | Default |
|---|---|---|
items{ id, title, description?, duration? (s or text), thumbnail? } plus either { provider: "youtube" | "vimeo", videoId, poster?, start? } or { src, poster?, tracks? }. | VideoPlaylistItem[] | — |
value / defaultValue / onValueChangeSelected video id (default: the first). | string | — |
layoutList under the player, or beside it when the container is wide. | "below" | "side" | "below" |
aspectPlayer aspect ratio. | ImageAspect | "16/9" |
showDetailsTitle and description of the selected video under the player. | boolean | true |
headingLevelLevel of that title. | 2 | 3 | 4 | 3 |
numbered01, 02 … before each row. | boolean | true |
playOnSelectStart a self-hosted video as soon as it is picked. | boolean | — |
labelsDictionary namespace "videoPlaylist": list, nowShowing, duration. | Partial<VideoPlaylistLabels> | — |
playerLabelsPassed to the player / embed. | Partial<VideoPlayerLabels> | — |