Package Exports
- vuetify-audio
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vuetify-audio) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
vuetify-audio
Vue.js sound audio player base on Vuetify UI framework. Covers audio-tag API and adds more.
Features
- Support most of audio play in this component.
- You can set the color you want for all component buttons.
- Support download the audio file.
- After audio playing finished or before start the playing, you can do something.
- Support Dark mode of Vuetify.
Demo
https://wilsonwu.github.io/dist/index.html#/vuetifyaudio
Installation
Use npm: npm install vuetify-audio --save
Prepare
At first make sure your project is Vue project, and has Vuetify as UI framework:
- Install Vuetify:
npm install vuetify --save-dev- Add Vuetify to
app.jsormain.js:
import Vuetify from 'vuetify';
import 'vuetify/dist/vuetify.min.css';
Vue.use(Vuetify);You also can use Vue plugin to install Vuetify by only one line command:
vue add vuetifyNode: Make sure you are using the default Vuetify iconfont (mdi).
Usage
Add below code into your <script>:
export default {
components: {
VuetifyAudio: () => import('vuetify-audio'),
},
data: () => ({
file: 'http://www.noiseaddicts.com/samples_1w72b820/290.mp3',
}),
}
And below code in the <template>:
<vuetify-audio :file="file" color="success" :ended="audioFinish"></vuetify-audio>Attributes
- file (String) (Required): Set audio file for the audio player
- ended (Function) (Optional): Set callback function name after audio finish
- canPlay (Function) (Optional): Set callback function name when audio ready for playing
- color (String) (Optional): Set all component buttons color
Known Issues
- Audio play pregress bar can't support drag, only support click.
ToDo
Create online demoCreate npm installAdd customize collor for componentAdd event for end audio- Add downloadable property for audio file
Fully support dark mode
License
MIT