Play voice with wechat voice ui styles.
<template>
<VoicePlayer :url="audio source url" :only="true or false"/>
</template>
<script>
import VoicePlayer from 'voice-player'
import 'voice-player/dist/voice-player.css'
</script>
name | type | description |
---|---|---|
url | string | Voice audio source url |
only | boolean | Uniqueness, only one voice can be played at a time, default is true |
name | type | description |
---|---|---|
duration | number | Voice audio duration, in seconds |
audio | HTMLAudioElement | The audio element |
name | description |
---|---|
toggle() | Toggle play & pause |
play() | Play voice |
pause() | Pause voice |
pauseAll() | Pause all voices |
name | description |
---|---|
play | When voice is playing |
pause | When voice is paused |