# Podcast Player

> An episode player for podcasts. A scrubber split into chapter segments previews the chapter under the pointer, with skip back 15 and forward 30, a speed menu and a sleep timer that can stop at the end of a chapter. Chapters and a transcript sit in tabs; the transcript follows playback, highlights the sentence being spoken and seeks when clicked. Also comes as a one-row mini player.

- Slug: `podcast-player`
- Category: [Media](https://www.assembli.design/category/media.md)
- Type: component
- Tags: podcast, audio, player, chapters, transcript, media, playback, sleep-timer
- npm dependencies: @base-ui/react, lucide-react, motion
- shadcn/ui dependencies: none
- Live preview: https://www.assembli.design/preview/podcast-player
- Page: https://www.assembli.design/components/podcast-player

![Podcast Player preview](https://www.assembli.design/thumbnails/podcast-player-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `src` | `string` |  | The episode's audio. Without it the player runs on a simulated clock for `duration` seconds, which is handy for demos and for designing before the audio exists. |
| `duration` | `number` |  | Length in seconds. Required without `src`; with `src` it's read from the file. |
| `title` (required) | `string` |  |  |
| `show` (required) | `string` |  |  |
| `episode` | `string` |  | A short label such as "Episode 48". |
| `date` | `string` |  | A short date label, e.g. "Oct 28". |
| `cover` | `string \| React.ReactNode` |  | An image URL, or your own artwork node. |
| `chapters` | `PodcastChapter[]` |  |  |
| `transcript` | `PodcastCue[]` |  | Sentences with start times in seconds, in order. |
| `variant` | `"full" \| "mini"` | `"full"` | "full" (with chapters and transcript) or a one-row "mini" player. |
| `defaultTime` | `number` | `0` | Where playback starts, in seconds. |
| `rates` | `number[]` | `[0.8, 1, 1.2, 1.5, 1.75, 2]` |  |
| `defaultRate` | `number` | `1` |  |
| `onTimeChange` | `(seconds: number) => void` |  |  |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/podcast-player/podcast-player.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/podcast-player
```

Registry item JSON: https://www.assembli.design/r/podcast-player.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
