# Podcast Player

> Expandable podcast episode card driving a real audio element — waveform seek bar with hover scrubber, chapter chips, speed cycling, volume, and a compact pill mode. Dark and light mode, fully responsive.

<demo-podcast-player>



</demo-podcast-player>

## Installation

```bash
npx shadcn-vue@latest add "https://nxui.geoql.in/r/podcast-player.json"
```

## Usage

```vue
<script setup lang="ts">
  import PodcastPlayer from '~/components/ui/podcast-player/PodcastPlayer.vue';

  const chapters = [
    { time: 0, label: 'Cold open' },
    { time: 156, label: 'Indicator #1: The vibe' },
    { time: 372, label: 'Indicator #2: Rate cuts' },
  ];
</script>

<template>
  <PodcastPlayer
    src="/audio/episode.mp3"
    title="Indicators of the Year"
    show="Planet Money"
    date="12/31/2025"
    rating="4.6"
    rating-count="30K"
    :meta="['Business', 'Updated daily']"
    description="Our favorite economic indicators of the year, ranked and roasted."
    :chapters="chapters"
    accent="#f4502c"
  />
</template>
```

The player drives a real `HTMLAudioElement`: click the waveform to seek (with
a hover time scrubber), cycle playback speed through 1x/1.25x/1.5x/2x, drag
the volume slider, and jump between chapters. The minimize button collapses
the card into a compact pill with a mini waveform and an Open button.
Follow/save actions confirm with a small toast. Uses shadcn theme tokens
(`card`, `border`, `muted`, `popover`) so it adapts to dark and light mode,
and the layout is responsive down to small screens.

## Props

<table>
<thead>
  <tr>
    <th>
      Prop
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        src
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Audio file URL
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        title
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Episode title
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        show
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Show / channel name
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        date
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <code>
        ''
      </code>
    </td>
    
    <td>
      Release date string
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        rating
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <code>
        ''
      </code>
    </td>
    
    <td>
      Star rating (e.g. <code>
        4.6
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        rating-count
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <code>
        ''
      </code>
    </td>
    
    <td>
      Rating count (e.g. <code>
        30K
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        meta
      </code>
    </td>
    
    <td>
      <code>
        string[]
      </code>
    </td>
    
    <td>
      <code>
        []
      </code>
    </td>
    
    <td>
      Meta segments (e.g. <code>
        ['Business']
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        description
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <code>
        ''
      </code>
    </td>
    
    <td>
      Episode description
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        chapters
      </code>
    </td>
    
    <td>
      <code>
        PodcastChapter[]
      </code>
    </td>
    
    <td>
      <code>
        []
      </code>
    </td>
    
    <td>
      Chapter markers (<code>
        { time, label }
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        accent
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <code>
        '#f4502c'
      </code>
    </td>
    
    <td>
      Accent color for waveform, play icon, and toggles
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        bars
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        96
      </code>
    </td>
    
    <td>
      Number of waveform bars
    </td>
  </tr>
</tbody>
</table>

## Events

<table>
<thead>
  <tr>
    <th>
      Event
    </th>
    
    <th>
      Payload
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        play
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Playback started
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        pause
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Playback paused
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        ended
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Playback reached end
    </td>
  </tr>
</tbody>
</table>

## Credits

Ported from the "Podcast player (dark mode)" exploration by
[@disarto_max](https://x.com/disarto_max/status/2074543495407153193),
extended with light-mode support and responsive layout.
