Skip to content

Haykys/react-responsive-music-player

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Responsive Music Player

Example

Please see a demo.

Install

npm install react-responsive-music-player --save

Usage

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
autoplay bool false
color string #66cccc the theme color of the player
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 start

License

MIT License

Copyright (c) 2017 Shixiang Zhang

About

A responsive music player built with React

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 62.3%
  • CSS 34.2%
  • HTML 3.5%