
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
vue-howler
Advanced tools
A Howler.js mixin for Vue 2 that makes it easy to create custom audio player components
A Howler.js mixin for Vue 2 that makes it easy to create custom audio player components
$ npm install vue-howler
First create a component that uses the mixin
audio-player.vue
<script>
import VueHowler from 'vue-howler'
export default {
mixins: [VueHowler]
}
</script>
<template>
<div>
<span>Total duration: {{ duration }} seconds</span>
<span>Progress: {{ (progress * 100) }}%</span>
<button @click="togglePlayback">{{ playing ? 'Pause' : 'Play' }}</button>
<button @click="stop">Stop</button>
</div>
</template>
Then you can use that component in your templates
home.vue
<script>
import AudioPlayer from './audio-player.vue'
export default {
components: {
AudioPlayer
},
data () {
return {
audioSources: [
"assets/audio/music.webm",
"assets/audio/fallback.mp3",
"assets/audio/fallback2.wav"
]
}
}
}
</script>
<template>
<div>
<audio-player :sources="audioSources" :loop="true"></audio-player>
</div>
</template>
sourcesType: String[] - Required
An array of audio file urls
html5Type: Boolean - Default: false
Whether to force HTML5 Audio
loopType: Boolean - Default: false
Whether to start the playback again automatically after it is done playing
preloadType: Boolean - Default: true
Whether to start downloading the audio file when the component is mounted
autoplayType: Boolean - Default: false
Whether to start the playback when the component is mounted
formatsType: String[] - Default: []
Howler.js automatically detects your file format from the extension, but you may also specify a format in situations where extraction won't work (such as with a SoundCloud stream)
xhrWithCredentialsType: Boolean - Default: false
Whether to enable the withCredentials flag on XHR requests
used to fetch audio files when using Web Audio API (see reference)
playingType: Boolean
Whether audio is currently playing
mutedType: Boolean
Whether the audio playback is muted
volumeType: Number
The volume of the playback on a scale of 0 to 1
rateType: Number
The rate (speed) of the playback on a scale of 0.5 to 4
seekType: Number
The position of the playback in seconds
durationType: Number
The duration of the audio in seconds
progressType: Number
The progress of the playback on a scale of 0 to 1
play()Start the playback
pause()Pause the playback
togglePlayback()Toggle playing or pausing the playback
stop()Stop the playback (also resets the seek to 0)
mute()Mute the playback
unmute()Unmute the playback
toggleMute()Toggle muting and unmuting the playback
setVolume(volume)Set the volume of the playback (value is clamped between 0 and 1)
setRate(rate)Set the rate (speed) of the playback (value is clamped between 0.5 and 4)
setSeek(seek)Set the position of the playback (value is clamped between 0 and duration)
setProgress(progress)Set the progress of the playback (value is clamped between 0 and 1)
MIT © Mick Dekkers
FAQs
A Howler.js mixin for Vue 2 that makes it easy to create custom audio player components
The npm package vue-howler receives a total of 175 weekly downloads. As such, vue-howler popularity was classified as not popular.
We found that vue-howler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.