npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@molecule/app-audio-player-vue

v1.1.0

Published

HTML5 audio player chrome — play/pause, scrub, time, mute toggle, optional visualizer slot

Readme

@molecule/app-audio-player-vue

Vue HTML5 audio player chrome — play/pause, scrub bar, elapsed/total time, and a mute toggle, over a hidden <audio> element. Use for podcasts, voice notes, music previews, narrated lessons.

Exports <AudioPlayer> — the Vue counterpart of @molecule/app-audio-player-react: the same props (React names) and the same DOM for the same input.

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

Quick Start

import { createApp, defineComponent, h } from 'vue'
import { AudioPlayer } from '@molecule/app-audio-player-vue'

const Player = defineComponent({
  setup() {
    return () =>
      h(AudioPlayer, {
        src: '/audio/episode-42.mp3',
        title: 'Episode 42: Getting Started',
        subtitle: 'The Molecule Podcast',
        onPlay: () => console.log('playing'),
        onEnded: () => console.log('finished'),
      })
  },
})

createApp(Player).mount('#app')

Type

feature

Installation

npm install @molecule/app-audio-player-vue @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue

API

Interfaces

AudioPlayerProps

Props accepted by the {@link AudioPlayer} component.

interface AudioPlayerProps {
  /** Audio source URL (a file, a stream or a data URI). */
  src: string
  /**
   * Optional title / track name. Passed as a prop or as the same-named slot —
   * both work.
   */
  title?: VNodeChild
  /**
   * Optional artist / source label. Passed as a prop or as the same-named slot
   * — both work.
   */
  subtitle?: VNodeChild
  /**
   * Optional waveform / visualizer slot rendered above the controls. Passed as
   * a prop or as the same-named slot — both work.
   */
  visualizer?: VNodeChild
  /**
   * WebVTT captions file URL. When set, the player loads it on the media
   * element's captions `<track>` and shows the current caption under the
   * controls, in a polite live region that screen readers announce. Without
   * it the track is empty and no caption line is shown.
   */
  captions?: string
  /** BCP 47 language of the captions (the track's `srclang`). */
  captionsLang?: string
  /**
   * Human-readable name of the captions track. Defaults through i18n
   * (`audio.captions`, English "Captions").
   */
  captionsLabel?: string
  /** Initial muted state. */
  defaultMuted?: boolean
  /** Autoplay (browser may block). Passed to the `<audio>` element. */
  autoPlay?: boolean
  /** Called when the media starts playing. */
  onPlay?: () => void
  /** Called when the media is paused. */
  onPause?: () => void
  /** Called when the media reaches its end. */
  onEnded?: () => void
  /** Extra classes on the outer wrapper. */
  className?: string
}

Constants

AudioPlayer

HTML5 audio player chrome — play/pause, scrub, time, mute, optional visualizer slot. Use for podcasts, voice notes, music previews, narrated lessons.

const AudioPlayer: DefineComponent<
  ExtractPropTypes<{
    src: { type: StringConstructor; required: true }
    title: null
    subtitle: null
    visualizer: null
    captions: StringConstructor
    captionsLang: StringConstructor
    captionsLabel: StringConstructor
    defaultMuted: { type: PropType<boolean | undefined>; default: undefined }
    autoPlay: { type: PropType<boolean | undefined>; default: undefined }
    onPlay: PropType<AudioPlayerProps['onPlay']>
    onPause: PropType<AudioPlayerProps['onPause']>
    onEnded: PropType<AudioPlayerProps['onEnded']>
    className: StringConstructor
  }>,
  () => VNode,
  {},
  {},
  {},
  ComponentOptionsMixin,
  ComponentOptionsMixin,
  {},
  string,
  PublicProps,
  Readonly<
    ExtractPropTypes<{
      src: { type: StringConstructor; required: true }
      title: null
      subtitle: null
      visualizer: null
      captions: StringConstructor
      captionsLang: StringConstructor
      captionsLabel: StringConstructor
      defaultMuted: { type: PropType<boolean | undefined>; default: undefined }
      autoPlay: { type: PropType<boolean | undefined>; default: undefined }
      onPlay: PropType<AudioPlayerProps['onPlay']>
      onPause: PropType<AudioPlayerProps['onPause']>
      onEnded: PropType<AudioPlayerProps['onEnded']>
      className: StringConstructor
    }>
  > &
    Readonly<{}>,
  { defaultMuted: boolean | undefined; autoPlay: boolean | undefined },
  {},
  {},
  {},
  string,
  ComponentProvideOptions,
  true,
  {},
  any
>
  • props — Component props (see {@link AudioPlayerProps}).

Returns: The audio player component.

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-vue ^1.1.0
  • @molecule/app-vue ^3.5.0
  • vue ^3.4.0

Runtime Dependencies

  • @molecule/app-ui
  • @molecule/app-ui-vue
  • @molecule/app-vue
  • vue

There is NO volume slider — only a mute toggle; and no playback-rate or skip controls. The optional visualizer prop is a free-form node slot rendered above the controls (bring your own waveform); it may be passed as a prop or as the same-named slot. autoPlay is passed to the <audio> element and is routinely blocked by browsers until user interaction — never rely on it. Duration renders 0:00 until loadedmetadata fires (preload="metadata"). Translations come from the companion @molecule/app-locales-audio-player locale bond.

Translations

Translation strings are provided by @molecule/app-locales-audio-player.