Podcast Player
ProNewA podcast page: show header with follow links, episodes with descriptions and lengths, and a docked player with skip back 15, forward 30, speed and progress that remembers where each episode was left.
Installation
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
Props
| Prop | Type | Default |
|---|---|---|
| show* | PodcastShowThe show the header describes. | — |
| episodes* | PodcastEpisode[]Episodes, newest first. | — |
| layout | "page" | "compact" | "bar"`page` is the full show page with descriptions, `compact` is a tighter card with one line per episode, and `bar` is the player alone with the episodes in a panel that opens above it. | "page" |
| height | numberCaps the height in pixels: the list scrolls inside and the player stays docked at the bottom. | — |
| pageSize | numberEpisodes shown before the "Show more" button. 0 shows all of them. | 5 |
| skipBack | numberSeconds the back button jumps. | 15 |
| skipForward | numberSeconds the forward button jumps. | 30 |
| speeds | number[]Playback rates the speed button steps through. An empty list hides it. | [1, 1.25, 1.5, 2, 0.75] |
| continuous | booleanPlay the next episode in the list when one ends. | true |
| defaultIndex | numberEpisode selected at first. | 0 |
| defaultVolume | numberVolume at first, from 0 to 1. | 1 |
| locale | stringLocale used to write dates. | "en-US" |
| loading | booleanDraws a placeholder while the feed is being fetched. | false |
| disabled | booleanTurns every control off. | false |
| label | stringAccessible name of the player. | — |
| onEpisodeChange | (index: number, episode: PodcastEpisode) => voidCalled when another episode is selected. | — |
| onPlayingChange | (playing: boolean) => voidCalled when sound starts or stops. | — |
| className | string | — |
Accessibility
- Each episode has its own button named Play or Pause plus the episode title, the selected one carries aria-current, and long descriptions open with a Show more button that reports its state.
- The docked player is a named group: Back 15 seconds, Play, Forward 30 seconds, a seek slider that reads elapsed and total time, a speed button that says the current rate, and volume.
- Show more episodes moves focus to the first new episode, an episode change is announced politely, and a file that fails to load raises an alert with Retry.
- With a fixed height the scrolling list is focusable so it can be scrolled by keyboard; under reduced motion the equalizer, spinner and panel slide stand still.