guide-audio-player
v1.0.1
Published
一个自定义的音频文件播放组件,支持暂停、播放、进度改变、音量改变等功能,可查看当前进度和总文件长度。
Downloads
7
Readme
介绍
AudioPlayer是一个自定义的音频文件播放组件,支持暂停、播放、进度改变、音量改变等功能,可查看当前进度和总文件长度。
安装
可通过 npm i guide-audio-player 直接安装
使用方法
一、可直接在main.js中全局引入
import { AudioPlayer } from 'guide-audio-player'
import 'guide-audio-player/guide-audio-player.css'
Vue.use(AudioPlayer)
二、也可以在某个页面中单独引入
<template>
<AudioPlayer audioUrl = 'youAudioFilePath' audioType = 'audio/wav'></AudioPlayer>
</template>
<script>
import { AudioPlayer } from 'guide-audio-player'
import 'guide-audio-player/guide-audio-player.css'
export default {
components: {
AudioPlayer
}
}
</script>
props
- audioUrl
{ String } 需要播放的音频文件地址 - audioType
{ String } 需要播放的音频文件的类型,audio/wav,audio/mpeg,audio/ogg