Video Playlist

A video with a playlist: the player next to the episode list, where selecting an entry swaps the media and the title without recreating the player.

Blocksvideo-playlistView JSON

The demo reuses two sample clips for three episodes, so selecting an entry visibly swaps the media as well as the title. The list scrolls on its own and the grid collapses to one column below the `lg` breakpoint.

Preview

Composing the shell
0:00

Composing the shell

The shell owns the player and the skin. The media element stays a separate item, so it can be swapped without touching the interface.

Installation

Add the item with the shadcn CLI, or copy the source manually.

pnpm dlx shadcn@latest add litingyes/blocove/video-playlist

Requires a shadcn/ui project set up with Base UI primitives. Blocove is developed against the b0 preset, but it installs no base config or theme tokens: your own preset, fonts and colors stay in place.

Or install from the namespace after adding the registry: npx shadcn@latest add @blocove/video-playlist

Usage

Use the block
import { VideoPlaylist } from "@/components/blocove/video-playlist"
const episodes = [  { id: "one", title: "Composing the shell", src: "/one.mp4", duration: "12:40" },  { id: "two", title: "Swapping the media", src: "/two.mp4", duration: "08:15" },]
export function CoursePlayer() {  return <VideoPlaylist items={episodes} defaultId="one" />}

API Reference

Props accepted by the exported components.

VideoPlaylist

The player next to the episode list. Selecting an entry swaps the media element and the title without recreating the player, so the interface keeps its state.

PropTypeDefault
itemsVideoPlaylistItem[]Required
defaultIdstringFirst item
classNamestring-

VideoPlaylistItem

One playlist entry. The duration is a preformatted string, so it matches how your data already shows it.

PropTypeDefault
idstringRequired
titlestringRequired
srcstringRequired
posterstring-
durationstring-
descriptionstring-