# 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. ## Installation ```bash npx shadcn@latest add litingyes/blocove/video-playlist ``` 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. ## Usage ### Use the block ```tsx 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 } ``` ## API Reference ### 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. | Prop | Type | Default | | --- | --- | --- | | `items` | `VideoPlaylistItem[]` | `Required` | | `defaultId` | `string` | `First item` | | `className` | `string` | - | ### VideoPlaylistItem One playlist entry. The duration is a preformatted string, so it matches how your data already shows it. | Prop | Type | Default | | --- | --- | --- | | `id` | `string` | `Required` | | `title` | `string` | `Required` | | `src` | `string` | `Required` | | `poster` | `string` | - | | `duration` | `string` | - | | `description` | `string` | - | ## Registry dependencies - `litingyes/blocove/video-player` - `scroll-area` Namespace: `npx shadcn@latest add @blocove/video-playlist`