Skip to content

Repository files navigation

vue-tiny-audio

A simple vue audio component build by vue-cli

Install

npm install vue-tiny-audio --save

Usage

<template>
<tiny-audio :src="audioSrc"
:title="audioTitle"
ref="tinyAudio"
@play="onPlay"
@pause="onPause"
@end="onEnd"
@next="onNext"
@previous="onPrevious">
</tiny-audio>
</template>
<script>
import tinyAudio from 'vue-tiny-audio';
import 'vue-tiny-audio/lib/tinyAudio.css';
export default {
components: {
tinyAudio
},
data () {
return {
src: 'xxx',
title: 'xxx',
step: 10
}
}
}
</script>

props

proptypedefaultrequired
srcStringundefinedtrue
titleStringundefinedfalse
speedsArray[1, 1.25, 1.5, 2]false
stepNumber5false

events

eventdescription
playaudio start to play
pauseaudio pause
endaudio complete play
previousclick previous button
nextclick next button

slots

slotdescriptionscopeData
titlethe play material titletitle
controlthe audio all control DOMaudio(all the data you need)
timethe part of DOM which is related to timeaudio(all the data you need)
previousthe previous buttonnone
nextthe next buttonnone
backthe back buttonnone
forwardthe forward buttonnone
playOrPausethe play/pause buttonstatus(play/pause/waiting)
speedthe all DOM related to speed controlnone
speedLabelthe label of speed control DOMspeed

About

a vue tiny audio component

Resources

Stars

1 star

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages