Video playlist

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.

VideoEmbed · VideoPlayer media/video-playlist.tsxtheme · material · accent · density · font

Big Buck Bunny (open movie)

Blender Foundation · 2008

Installation

$ pnpm add @vamos-ui/react

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

Room A · 24 min

Selected: s1

API

VideoPlaylist

PropTypeDefault
items
{ id, title, description?, duration? (s or text), thumbnail? } plus either { provider: "youtube" | "vimeo", videoId, poster?, start? } or { src, poster?, tracks? }.
VideoPlaylistItem[]—
value / defaultValue / onValueChange
Selected video id (default: the first).
string—
layout
List under the player, or beside it when the container is wide.
"below" | "side""below"
aspect
Player aspect ratio.
ImageAspect"16/9"
showDetails
Title and description of the selected video under the player.
booleantrue
headingLevel
Level of that title.
2 | 3 | 43
numbered
01, 02 … before each row.
booleantrue
playOnSelect
Start a self-hosted video as soon as it is picked.
boolean—
labels
Dictionary namespace "videoPlaylist": list, nowShowing, duration.
Partial<VideoPlaylistLabels>—
playerLabels
Passed to the player / embed.
Partial<VideoPlayerLabels>—