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 🙏

© 2025 – Pkg Stats / Ryan Hefner

vue-wave-player

v1.0.8

Published

Vue 3 audio player component with Telegram-style waveform visualization

Readme

Vue Wave Player

🎵 Audio player with Canvas waveform visualization in Telegram style for Vue 3

Changelog

Vue 3 TypeScript License npm

Demo

View Demo →

Installation

npm install vue-wave-player

Quick Start

Global Registration (recommended)

// main.js
import { createApp } from 'vue'
import App from './App.vue'
import VueWavePlayer from 'vue-wave-player'

const app = createApp(App)
app.use(VueWavePlayer)
app.mount('#app')

Now <VueWavePlayer /> component is available everywhere without import.

Local Import

<template>
  <VueWavePlayer src="/audio.mp3" />
</template>

<script setup>
import { VueWavePlayer } from 'vue-wave-player'
</script>

✅ Styles are included automatically, no separate CSS import needed!

Waveform Bar Settings

<!-- Thin bars 1px with 1px gap -->
<VueWavePlayer src="/audio.mp3" :bar-width="1" :bar-gap="1" />

<!-- Wide bars 4px with 4px gap -->
<VueWavePlayer src="/audio.mp3" :bar-width="4" :bar-gap="4" />

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | src | string | — | Audio file URL (required) | | barWidth | number | 3 | Waveform bar width in pixels | | barGap | number | 2 | Gap between bars in pixels | | primaryColor | string | #3390EC | Primary color (waveform, buttons) | | backgroundColor | string | #FFFFFF | Player background color | | showPlaybackRate | boolean | false | Show speed button | | playbackRates | number[] | [1, 1.5, 2] | Available playback speeds | | autoplay | boolean | false | Autoplay on load |

Slots

| Slot | Data | Description | |------|------|-------------| | #play-button | { isPlaying, isLoading, toggle } | Custom play button | | #time | { currentTime, duration, formattedCurrentTime, formattedDuration } | Custom time display |

<!-- Custom play button -->
<VueWavePlayer src="/audio.mp3">
  <template #play-button="{ isPlaying, toggle }">
    <button @click="toggle">{{ isPlaying ? 'Pause' : 'Play' }}</button>
  </template>
</VueWavePlayer>

<!-- Custom time display -->
<VueWavePlayer src="/audio.mp3">
  <template #time="{ formattedCurrentTime, formattedDuration }">
    <div>{{ formattedCurrentTime }} of {{ formattedDuration }}</div>
  </template>
</VueWavePlayer>

Events

| Event | Data | Description | |-------|------|-------------| | @play | — | Playback started | | @pause | — | Paused | | @ended | — | Playback ended | | @timeupdate | number | Current time update (seconds) | | @durationchange | number | Duration determined (seconds) | | @seeking | number | Seeking started | | @seeked | number | Seeking ended | | @ratechange | number | Playback speed changed | | @error | Error | Load/playback error |

<VueWavePlayer
  src="/audio.mp3"
  @play="onPlay"
  @pause="onPause"
  @ended="onEnded"
  @timeupdate="onTimeUpdate"
/>

Methods

| Method / Property | Type | Description | |-------------------|------|-------------| | play() | function | Start playback | | pause() | function | Pause | | stop() | function | Stop playback and reset to start | | seek(time) | function | Seek to specified time | | setRate(rate) | function | Set playback speed | | currentTime | number | Current playback time | | duration | number | Total duration | | isPlaying | boolean | Is currently playing |

<template>
  <VueWavePlayer ref="player" src="/audio.mp3" />
  <button @click="player.play()">Play</button>
  <button @click="player.pause()">Pause</button>
  <button @click="player.stop()">Stop</button>
</template>

<script setup>
const player = ref()

player.play()        // start playback
player.pause()       // pause
player.stop()        // stop and reset to start
player.seek(10)      // seek to 10 sec
player.setRate(1.5)  // speed 1.5x
player.currentTime   // current time
player.duration      // duration
player.isPlaying     // is playing
</script>

Examples

Custom Colors

<VueWavePlayer
  src="/audio.mp3"
  primary-color="#E91E63"
  background-color="#FCE4EC"
/>

Playback Speed

<VueWavePlayer
  src="/audio.mp3"
  show-playback-rate
  :playback-rates="[1, 1.5, 2]"
/>

License

MIT © 2025 Spot