0.4.3 • Published 7 years ago
react-responsive-music-player v0.4.3
React Responsive Music Player
Example
Please see a demo.

Install
npm install react-responsive-music-player --saveor
yarn add react-responsive-music-playerUsage
import React, { Component } from 'react';
import MusicPlayer from 'react-responsive-music-player';
class App extends Component {
render() {
return (
<div>
<MusicPlayer playlist={playlist} />
</div>
);
}
}API
props
| prop | type | default | notes |
|---|---|---|---|
| mode | string | horizontal | |
| width | number, string | 100% | |
| autoplay | bool | false | |
| progressColor | string | #66cccc | the color of the progress |
| btnColor | string | #4a4a4a | the color of the buttons |
| playlist | array | [] | the playlist |
| style | object | {} |
JSON
const playlist = [
{
url: 'path/to/mp3',
cover: 'path/to/jpg',
title: 'Despacito',
artist: [
'Luis Fonsi',
'Daddy Yankee'
]
},
{
url: 'path/to/mp3',
cover: 'path/to/jpg',
title: 'Bedtime Stories',
artist: [
'Jay Chou'
]
}
]Development
npm install
npm startLicense
MIT License
Copyright (c) 2019 Shixiang Zhang