Snippets Card

Bootstrap 5 Audio Music Player Card

A music player card with album art, a seekable progress bar, play and pause, skip controls and a like button, driven by a short synthesised demo track.

Bootstrap 5 No jQuery Oct 2019 7.5K views

<section class="wdw-stage">
  <div class="container" style="max-width: 400px">
    <div class="wdw-card p-3 p-sm-4">
      <div class="cover position-relative rounded-4 overflow-hidden mb-4">
        <img src="https://images.unsplash.com/photo-1470225620780-dba8ba36b745?w=800&h=800&fit=crop&q=80" alt="DJ turntable with warm stage lights" class="w-100 d-block">
        <span class="badge rounded-pill text-bg-dark position-absolute top-0 start-0 m-3 bg-opacity-75">Featured</span>
      </div>
      <div class="d-flex justify-content-between align-items-start gap-3 mb-3">
        <div class="min-w-0"><h1 class="h5 wdw-heading mb-0 text-truncate">Midnight Bachata</h1><p class="wdw-muted mb-0">DJ Flam · Urban remix</p></div>
        <button type="button" class="btn btn-outline-secondary border-0 rounded-circle p-0 text-body flex-none" style="width:44px" id="likeBtn" aria-pressed="false" aria-label="Like">
          <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><path d="M20.8 4.600a5.500 5.500 0 0 0-7.800 0L12 5.700l-1-1.100a5.500 5.500 0 0 0-7.800 7.800l1 1.100L12 21.200l7.800-7.700 1-1.100a5.500 5.500 0 0 0 0-7.800z"/></svg>
        </button>
      </div>
      <input type="range" class="seek w-100" id="seek" min="0" max="100" value="0" step="0.1" aria-label="Seek">
      <div class="d-flex justify-content-between small wdw-muted mt-1 mb-3"><span id="tNow">0:00</span><span id="tTotal">0:12</span></div>
      <div class="d-flex justify-content-center align-items-center gap-3">
        <button type="button" class="btn btn-outline-secondary border-0 rounded-circle p-0 text-body" style="width:48px;min-height:48px" id="backBtn" aria-label="Back 5 seconds"><svg width="22" height="22" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M6 6h2v12H6zM20 6v12L9.500 12z"/></svg></button>
        <button type="button" class="btn btn-primary rounded-circle p-0" style="width:64px;min-height:64px" id="playBtn" aria-label="Play">
          <svg width="26" height="26" viewBox="0 0 24 24" fill="currentColor" id="icoPlay" aria-hidden="true"><path d="M8 5v14l11-7z"/></svg>
          <svg width="26" height="26" viewBox="0 0 24 24" fill="currentColor" id="icoPause" class="d-none" aria-hidden="true"><path d="M6 5h4v14H6zM14 5h4v14h-4z"/></svg>
        </button>
        <button type="button" class="btn btn-outline-secondary border-0 rounded-circle p-0 text-body" style="width:48px;min-height:48px" id="fwdBtn" aria-label="Forward 5 seconds"><svg width="22" height="22" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M16 6h2v12h-2zM4 18V6l10.500 6z"/></svg></button>
      </div>
      <p class="text-center small wdw-muted mt-3 mb-0">Synthesised demo track</p>
    </div>
  </div>
</section>

Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.

Free to use in personal and commercial projects under the MIT license.