Music player with playlist support.
https://luna.liriliri.io/?path=/story/music-player
Add the following script and style to your page.
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-music-player/luna-music-player.css" />
<script src="//cdn.jsdelivr.net/npm/luna-music-player/luna-music-player.js"></script>
You can also get it on npm.
npm install luna-music-player --save
import 'luna-music-player/luna-music-player.css'
import LunaMusicPlayer from 'luna-music-player'
const container = document.getElementById('container')
const musicPlayer = new LunaMusicPlayer(container, {
audio: {
url: 'https://luna.liriliri.io/Get_along.mp3',
cover: 'https://luna.liriliri.io/Get_along.jpg',
title: 'Get Along',
artist: '林原めぐみ',
}
})
musicPlayer.play()
- audio(IAudio | IAudio[]): Audio list.
- listFolded(boolean): Whether list should folded at first.
- artist(string): Audio artist.
- cover(string): Audio cover.
- title(string): Audio title.
- url(string): Audio src.