This audio player is small javascript library used to play tracks and playlists. It's a snap to setup and works on all modern browsers.Supports all major browsers (Google Chrome, Firefox, Safari, IE 11, Edge)
npm i vanilla-audio-player
import AudioPlayer from 'vanilla-audio-player'
new AudioPlayer('your-selector', tracks, options);
new AudioPlayer('.player-1',[
{
name: 'Song 1',
src: '/url/to/your/file.mp3'
},
{
name: 'Song 2',
src: '/url/to/your/file.mp3'
},
{
name: 'Song 3',
src: '/url/to/your/file.mp3'
} ], options);
@import "~vanilla-audio-player/src/scss/app.scss";
<div class="audio-player player-1"></div>
Name | Meaning |
---|---|
autoplay | Sets autoplay for player (only works if user have already interacted with site) |
trackList | Adds track list to player |
Name | Meaning |
---|---|
name | Your song title that will be shown in player |
src | Url to your audio file |
Name | Meaning |
---|---|
destroy() | Destroy AudioPlayer instance |